/* snfmultidll.h
// Copyright (C) 2007-2009 ARM Research Labs, LLC
//
// SNFMulti DLL header.
*/

#ifndef snfmultidll_included
#define snfmultidll_included

const int snf_SUCCESS = 0;
const int snf_ERROR_CMD_LINE = 65;
const int snf_ERROR_LOG_FILE = 66;
const int snf_ERROR_RULE_FILE = 67;
const int snf_ERROR_RULE_DATA = 68;
const int snf_ERROR_RULE_AUTH = 73;
const int snf_ERROR_MSG_FILE = 69;
const int snf_ERROR_ALLOCATION = 70;
const int snf_ERROR_BAD_MATRIX = 71;
const int snf_ERROR_MAX_EVALS = 72;
const int snf_ERROR_UNKNOWN = 99;

const int snf_ERROR_NO_HANDLE = -1;
const int snf_ERROR_SCAN_FAILED = -2;
const int snf_ERROR_EXCEPTION = -3;

/*
enum snfIPRange {                                                               // IP action ranges
    Unknown,                                                                    // Unknown - not defined.
    White,                                                                      // This is a good guy.
    Normal,                                                                     // Benefit of the doubt.
    New,                                                                        // It is new to us.
    Caution,                                                                    // This is suspicious.
    Black,                                                                      // This is bad.
    Truncate                                                                    // Don't even bother looking.
};
*/

/* Map these C constants to the enum snfIPRange */

const int snf_IP_Unknown = 0;
const int snf_IP_White = 1;
const int snf_IP_Normal = 2;
const int snf_IP_New = 3;
const int snf_IP_Caution = 4;
const int snf_IP_Black = 5;
const int snf_IP_Truncate = 6;

/* IP Reputation Figure Constants */

const double snf_ReputationMehResult = 0.0;                                     /* Don't know or don't care */
const double snf_ReputationBadResult = 1.0;                                     /* IP is pure evil */
const double snf_ReputationGoodResult = -1.0;                                   /* IP is pure good */

/* This is the API to the SNFMulti DLL */
#define IMP __declspec(dllimport)
extern "C" {

    IMP int setThrottle(int Threads);                                           /* Set a scan thread limit */
    IMP int startupSNF(char* Path);                                             /* Start SNF with configuration. */
    IMP int startupSNFAuthenticated(char* Path, char* Lic, char* Auth);         /* Start SNF with conf & auth. */
    IMP int shutdownSNF();                                                      /* Shutdown SNF. */
    IMP int testIP(unsigned long int IPToCheck);                                /* Test the IP for a GBUdb range. */
    IMP double getIPReputation(unsigned long int IPToCheck);                    /* Get reputation figure for IP. */
    IMP int scanBuffer(unsigned char* Bfr, int Length, char* Name, int Setup);  /* Scan msgBuffer, name, setup time. */
    IMP int scanFile(char* FilePath, int Setup);                                /* Scan msgFile, setup time. */
    IMP int getScanXHeaders(int ScanHandle, char** Bfr, int* Length);           /* Get result & XHeaders. */
    IMP int getScanXMLLog(int ScanHandle, char** Bfr, int* Length);             /* Get result & XML Log. */
    IMP int getScanClassicLog(int ScanHandle, char** Bfr, int* Length);         /* Get result & Classic Log. */
    IMP int getScanResult(int ScanHandle);                                      /* Get just the scan result. */
    IMP int closeScan(int ScanHandle);                                          /* Close the scan result. */

}

#endif