12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <html>
- <head>
- <title>C:\M\Projects\MessageSniffer\PKG-SNF-SDK-WIN_Work\PKG-SNF-SDK-WIN\include\snfmultidll.h</title>
- <style>
- body { background-color: #ffffff; font-family: "Courier New"; font-size:10.0pt; font-style: normal; font-weight: normal; text-decoration: none; }
- .se2 { color: #000000; background-color: #ffffff; } /* Window Text */
- .se17 { color: #800080; background-color: #ffffff; } /* Keyword */
- .se19 { color: #000080; background-color: #ffffff; } /* Number */
- .se20 { color: #008080; background-color: #ffffff; } /* String */
- .se21 { color: #008000; background-color: #ffffff; font-style: italic; } /* Comment */
- .se22 { color: #808000; background-color: #ffffff; } /* Preprocessor */
- .se23 { color: #800000; background-color: #ffffff; } /* Punctuation */
- .se25 { color: #000000; background-color: #ffffff; } /* Operator */
- .se28 { color: #000000; background-color: #ffffff; font-weight: bolder; } /* Function */
- .se55 { color: #000000; background-color: #ffffff; } /* Window Text */
- .se56 { color: #303080; background-color: #ffffff; } /* Number */
- </style>
- </head>
- <body>
- <pre>
- <span class="se21">/* snfmultidll.h</span>
- <span class="se21">// Copyright (C) 2007-2009 ARM Research Labs, LLC</span>
- <span class="se21">//</span>
- <span class="se21">// SNFMulti DLL header.</span>
- <span class="se21">*/</span>
-
- <span class="se22">#ifndef</span><span class="se2"> </span><span class="se55">snfmultidll_included</span>
- <span class="se22">#define</span><span class="se2"> </span><span class="se55">snfmultidll_included</span>
-
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
-
- <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>
- <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>
- <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>
-
- <span class="se21">/*</span>
- <span class="se21">enum snfIPRange { // IP action ranges</span>
- <span class="se21"> Unknown, // Unknown - not defined.</span>
- <span class="se21"> White, // This is a good guy.</span>
- <span class="se21"> Normal, // Benefit of the doubt.</span>
- <span class="se21"> New, // It is new to us.</span>
- <span class="se21"> Caution, // This is suspicious.</span>
- <span class="se21"> Black, // This is bad.</span>
- <span class="se21"> Truncate // Don't even bother looking.</span>
- <span class="se21">};</span>
- <span class="se21">*/</span>
-
- <span class="se21">/* Map these C constants to the enum snfIPRange */</span>
-
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
-
- <span class="se21">/* IP Reputation Figure Constants */</span>
-
- <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>
- <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>
- <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>
-
- <span class="se21">/* This is the API to the SNFMulti DLL */</span>
- <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>
- <span class="se17">extern</span><span class="se2"> </span><span class="se20">"C"</span><span class="se2"> </span><span class="se23">{</span>
-
- <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>
- <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>
- <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 & auth. */</span>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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 & XHeaders. */</span>
- <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 & XML Log. */</span>
- <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 & Classic Log. */</span>
- <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>
- <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>
-
- <span class="se23">}</span>
-
- <span class="se22">#endif</span>
- </pre>
- </body>
- </html>
|