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.html 18KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <html>
  2. <head>
  3. <title>C:\M\Projects\MessageSniffer\PKG-SNF-SDK-WIN_Work\PKG-SNF-SDK-WIN\include\snfmultidll.h</title>
  4. <style>
  5. body { background-color: #ffffff; font-family: "Courier New"; font-size:10.0pt; font-style: normal; font-weight: normal; text-decoration: none; }
  6. .se2 { color: #000000; background-color: #ffffff; } /* Window Text */
  7. .se17 { color: #800080; background-color: #ffffff; } /* Keyword */
  8. .se19 { color: #000080; background-color: #ffffff; } /* Number */
  9. .se20 { color: #008080; background-color: #ffffff; } /* String */
  10. .se21 { color: #008000; background-color: #ffffff; font-style: italic; } /* Comment */
  11. .se22 { color: #808000; background-color: #ffffff; } /* Preprocessor */
  12. .se23 { color: #800000; background-color: #ffffff; } /* Punctuation */
  13. .se25 { color: #000000; background-color: #ffffff; } /* Operator */
  14. .se28 { color: #000000; background-color: #ffffff; font-weight: bolder; } /* Function */
  15. .se55 { color: #000000; background-color: #ffffff; } /* Window Text */
  16. .se56 { color: #303080; background-color: #ffffff; } /* Number */
  17. </style>
  18. </head>
  19. <body>
  20. <pre>
  21. <span class="se21">/* snfmultidll.h</span>
  22. <span class="se21">// Copyright (C) 2007-2009 ARM Research Labs, LLC</span>
  23. <span class="se21">//</span>
  24. <span class="se21">// SNFMulti DLL header.</span>
  25. <span class="se21">*/</span>
  26. <span class="se22">#ifndef</span><span class="se2"> </span><span class="se55">snfmultidll_included</span>
  27. <span class="se22">#define</span><span class="se2"> </span><span class="se55">snfmultidll_included</span>
  28. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_SUCCESS</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">0</span><span class="se25">;</span>
  29. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_CMD_LINE</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">65</span><span class="se25">;</span>
  30. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_LOG_FILE</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">66</span><span class="se25">;</span>
  31. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_RULE_FILE</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">67</span><span class="se25">;</span>
  32. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_RULE_DATA</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">68</span><span class="se25">;</span>
  33. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_RULE_AUTH</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">73</span><span class="se25">;</span>
  34. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_MSG_FILE</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">69</span><span class="se25">;</span>
  35. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_ALLOCATION</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">70</span><span class="se25">;</span>
  36. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_BAD_MATRIX</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">71</span><span class="se25">;</span>
  37. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_MAX_EVALS</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">72</span><span class="se25">;</span>
  38. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_UNKNOWN</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">99</span><span class="se25">;</span>
  39. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_NO_HANDLE</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se25">-</span><span class="se19">1</span><span class="se25">;</span>
  40. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_SCAN_FAILED</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se25">-</span><span class="se19">2</span><span class="se25">;</span>
  41. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_ERROR_EXCEPTION</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se25">-</span><span class="se19">3</span><span class="se25">;</span>
  42. <span class="se21">/*</span>
  43. <span class="se21">enum snfIPRange { // IP action ranges</span>
  44. <span class="se21"> Unknown, // Unknown - not defined.</span>
  45. <span class="se21"> White, // This is a good guy.</span>
  46. <span class="se21"> Normal, // Benefit of the doubt.</span>
  47. <span class="se21"> New, // It is new to us.</span>
  48. <span class="se21"> Caution, // This is suspicious.</span>
  49. <span class="se21"> Black, // This is bad.</span>
  50. <span class="se21"> Truncate // Don't even bother looking.</span>
  51. <span class="se21">};</span>
  52. <span class="se21">*/</span>
  53. <span class="se21">/* Map these C constants to the enum snfIPRange */</span>
  54. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_IP_Unknown</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">0</span><span class="se25">;</span>
  55. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_IP_White</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">1</span><span class="se25">;</span>
  56. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_IP_Normal</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">2</span><span class="se25">;</span>
  57. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_IP_New</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">3</span><span class="se25">;</span>
  58. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_IP_Caution</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">4</span><span class="se25">;</span>
  59. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_IP_Black</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">5</span><span class="se25">;</span>
  60. <span class="se17">const</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">snf_IP_Truncate</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se19">6</span><span class="se25">;</span>
  61. <span class="se21">/* IP Reputation Figure Constants */</span>
  62. <span class="se17">const</span><span class="se2"> </span><span class="se17">double</span><span class="se2"> </span><span class="se55">snf_ReputationMehResult</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se56">0.0</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Don't know or don't care */</span>
  63. <span class="se17">const</span><span class="se2"> </span><span class="se17">double</span><span class="se2"> </span><span class="se55">snf_ReputationBadResult</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se56">1.0</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* IP is pure evil */</span>
  64. <span class="se17">const</span><span class="se2"> </span><span class="se17">double</span><span class="se2"> </span><span class="se55">snf_ReputationGoodResult</span><span class="se2"> </span><span class="se25">=</span><span class="se2"> </span><span class="se25">-</span><span class="se56">1.0</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* IP is pure good */</span>
  65. <span class="se21">/* This is the API to the SNFMulti DLL */</span>
  66. <span class="se22">#define</span><span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se28">__declspec</span><span class="se2">(</span><span class="se55">dllimport</span><span class="se2">)</span>
  67. <span class="se17">extern</span><span class="se2"> </span><span class="se20">&quot;C&quot;</span><span class="se2"> </span><span class="se23">{</span>
  68. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">setThrottle</span><span class="se2">(</span><span class="se17">int</span><span class="se2"> </span><span class="se55">Threads</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Set a scan thread limit */</span>
  69. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">startupSNF</span><span class="se2">(</span><span class="se17">char</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Path</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Start SNF with configuration. */</span>
  70. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">startupSNFAuthenticated</span><span class="se2">(</span><span class="se17">char</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Path</span><span class="se2">, </span><span class="se17">char</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Lic</span><span class="se2">, </span><span class="se17">char</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Auth</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Start SNF with conf &amp; auth. */</span>
  71. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">shutdownSNF</span><span class="se2">()</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Shutdown SNF. */</span>
  72. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">testIP</span><span class="se2">(</span><span class="se17">unsigned</span><span class="se2"> </span><span class="se17">long</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">IPToCheck</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Test the IP for a GBUdb range. */</span>
  73. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">double</span><span class="se2"> </span><span class="se28">getIPReputation</span><span class="se2">(</span><span class="se17">unsigned</span><span class="se2"> </span><span class="se17">long</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se55">IPToCheck</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Get reputation figure for IP. */</span>
  74. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">scanBuffer</span><span class="se2">(</span><span class="se17">unsigned</span><span class="se2"> </span><span class="se17">char</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Bfr</span><span class="se2">, </span><span class="se17">int</span><span class="se2"> </span><span class="se55">Length</span><span class="se2">, </span><span class="se17">char</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Name</span><span class="se2">, </span><span class="se17">int</span><span class="se2"> </span><span class="se55">Setup</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Scan msgBuffer, name, setup time. */</span>
  75. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">scanFile</span><span class="se2">(</span><span class="se17">char</span><span class="se25">*</span><span class="se2"> </span><span class="se55">FilePath</span><span class="se2">, </span><span class="se17">int</span><span class="se2"> </span><span class="se55">Setup</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Scan msgFile, setup time. */</span>
  76. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">getScanXHeaders</span><span class="se2">(</span><span class="se17">int</span><span class="se2"> </span><span class="se55">ScanHandle</span><span class="se2">, </span><span class="se17">char</span><span class="se25">**</span><span class="se2"> </span><span class="se55">Bfr</span><span class="se2">, </span><span class="se17">int</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Length</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Get result &amp; XHeaders. */</span>
  77. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">getScanXMLLog</span><span class="se2">(</span><span class="se17">int</span><span class="se2"> </span><span class="se55">ScanHandle</span><span class="se2">, </span><span class="se17">char</span><span class="se25">**</span><span class="se2"> </span><span class="se55">Bfr</span><span class="se2">, </span><span class="se17">int</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Length</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Get result &amp; XML Log. */</span>
  78. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">getScanClassicLog</span><span class="se2">(</span><span class="se17">int</span><span class="se2"> </span><span class="se55">ScanHandle</span><span class="se2">, </span><span class="se17">char</span><span class="se25">**</span><span class="se2"> </span><span class="se55">Bfr</span><span class="se2">, </span><span class="se17">int</span><span class="se25">*</span><span class="se2"> </span><span class="se55">Length</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Get result &amp; Classic Log. */</span>
  79. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">getScanResult</span><span class="se2">(</span><span class="se17">int</span><span class="se2"> </span><span class="se55">ScanHandle</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Get just the scan result. */</span>
  80. <span class="se2"> </span><span class="se55">IMP</span><span class="se2"> </span><span class="se17">int</span><span class="se2"> </span><span class="se28">closeScan</span><span class="se2">(</span><span class="se17">int</span><span class="se2"> </span><span class="se55">ScanHandle</span><span class="se2">)</span><span class="se25">;</span><span class="se2"> </span><span class="se21">/* Close the scan result. */</span>
  81. <span class="se23">}</span>
  82. <span class="se22">#endif</span>
  83. </pre>
  84. </body>
  85. </html>