You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

snfmultidll.h 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* snfmultidll.h
  2. // Copyright (C) 2007-2009 ARM Research Labs, LLC
  3. //
  4. // SNFMulti DLL header.
  5. */
  6. #ifndef snfmultidll_included
  7. #define snfmultidll_included
  8. const int snf_SUCCESS = 0;
  9. const int snf_ERROR_CMD_LINE = 65;
  10. const int snf_ERROR_LOG_FILE = 66;
  11. const int snf_ERROR_RULE_FILE = 67;
  12. const int snf_ERROR_RULE_DATA = 68;
  13. const int snf_ERROR_RULE_AUTH = 73;
  14. const int snf_ERROR_MSG_FILE = 69;
  15. const int snf_ERROR_ALLOCATION = 70;
  16. const int snf_ERROR_BAD_MATRIX = 71;
  17. const int snf_ERROR_MAX_EVALS = 72;
  18. const int snf_ERROR_UNKNOWN = 99;
  19. const int snf_ERROR_NO_HANDLE = -1;
  20. const int snf_ERROR_SCAN_FAILED = -2;
  21. const int snf_ERROR_EXCEPTION = -3;
  22. /*
  23. enum snfIPRange { // IP action ranges
  24. Unknown, // Unknown - not defined.
  25. White, // This is a good guy.
  26. Normal, // Benefit of the doubt.
  27. New, // It is new to us.
  28. Caution, // This is suspicious.
  29. Black, // This is bad.
  30. Truncate // Don't even bother looking.
  31. };
  32. */
  33. /* Map these C constants to the enum snfIPRange */
  34. const int snf_IP_Unknown = 0;
  35. const int snf_IP_White = 1;
  36. const int snf_IP_Normal = 2;
  37. const int snf_IP_New = 3;
  38. const int snf_IP_Caution = 4;
  39. const int snf_IP_Black = 5;
  40. const int snf_IP_Truncate = 6;
  41. /* IP Reputation Figure Constants */
  42. const double snf_ReputationMehResult = 0.0; /* Don't know or don't care */
  43. const double snf_ReputationBadResult = 1.0; /* IP is pure evil */
  44. const double snf_ReputationGoodResult = -1.0; /* IP is pure good */
  45. /* This is the API to the SNFMulti DLL */
  46. #define IMP __declspec(dllimport)
  47. extern "C" {
  48. IMP int setThrottle(int Threads); /* Set a scan thread limit */
  49. IMP int startupSNF(char* Path); /* Start SNF with configuration. */
  50. IMP int startupSNFAuthenticated(char* Path, char* Lic, char* Auth); /* Start SNF with conf & auth. */
  51. IMP int shutdownSNF(); /* Shutdown SNF. */
  52. IMP int testIP(unsigned long int IPToCheck); /* Test the IP for a GBUdb range. */
  53. IMP double getIPReputation(unsigned long int IPToCheck); /* Get reputation figure for IP. */
  54. IMP int scanBuffer(unsigned char* Bfr, int Length, char* Name, int Setup); /* Scan msgBuffer, name, setup time. */
  55. IMP int scanFile(char* FilePath, int Setup); /* Scan msgFile, setup time. */
  56. IMP int getScanXHeaders(int ScanHandle, char** Bfr, int* Length); /* Get result & XHeaders. */
  57. IMP int getScanXMLLog(int ScanHandle, char** Bfr, int* Length); /* Get result & XML Log. */
  58. IMP int getScanClassicLog(int ScanHandle, char** Bfr, int* Length); /* Get result & Classic Log. */
  59. IMP int getScanResult(int ScanHandle); /* Get just the scan result. */
  60. IMP int closeScan(int ScanHandle); /* Close the scan result. */
  61. }
  62. #endif