123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
-
-
-
-
-
- #include <iostream>
- #include <string>
- #include "../include/snfmultidll.h"
-
- using namespace std;
-
-
-
- const string LicenseID = "licensid";
- const string Authentication = "authenticationxx";
- const string ConfigurationPath = "snf_engine.xml";
-
-
- const unsigned int IPToTest = 0x0c22384e;
-
- const string SampleMessage =
- "Received: from mx-out.example.com [12.34.56.78] (HELO Somebody)\r\n"
- " by mx-in.example.com (nosuchserver v1.0) for nobody@example.com\r\n"
- "From: <somebody@example.com>\r\n"
- "To: <nobody@example.com>\r\n"
- "Subject: Nothing to see here\r\n"
- "\r\n"
- "So this is the big thing that's not here to see.\r\n"
- "I thought it would be more interesting than this.\r\n"
- "\r\n"
- "_M\r\n"
- ".\r\n";
-
-
-
-
- int main() {
-
- int Result = 0;
-
- Result = startupSNF(const_cast<char*>(ConfigurationPath.c_str()));
-
-
-
-
-
-
-
- cout << "Started with config " << ConfigurationPath << " Result: " << Result << endl;
-
-
-
- Result = testIP(IPToTest);
- cout << "IP test result: " << Result << endl;
-
- double IPReputation = getIPReputation(IPToTest);
- cout << "IP Reputation: " << IPReputation << endl;
-
-
-
- const int NumberOfScans = 10;
- for(int i = 0; i < NumberOfScans; i++) {
-
-
-
- double IPReputation = getIPReputation(IPToTest);
- cout << "IP Reputation: " << IPReputation << endl;
-
-
-
- int SetupTime = 12;
- int ScanHandle = 0;
- unsigned char* MsgBuffer = (unsigned char*) SampleMessage.c_str();
- unsigned int MsgBufferLength = (unsigned int) SampleMessage.length();
- ScanHandle = scanBuffer(MsgBuffer, MsgBufferLength, "TestMessage", SetupTime);
-
-
- cout << "Scan Handle: " << ScanHandle << endl;
-
-
-
- char* XHeadersBuffer = 0;
- int XHeadersLength = 0;
- int ScanResult = 0;
- ScanResult = getScanXHeaders(ScanHandle, &XHeadersBuffer, &XHeadersLength);
- string XHeaders(XHeadersBuffer);
-
-
-
- Result = closeScan(ScanHandle);
-
- cout << "Scan Close Result: " << Result << endl;
-
-
-
-
- cout << "Scan result code: " << ScanResult << endl;
- cout << "Scan X- headers: " << XHeaders << endl;
-
- }
-
-
-
- Result = shutdownSNF();
-
- return Result;
-
- }
|