4.1.3 DynamicEngineData

DynamicEngineData定义了检查插件和Snort交互的相关接口。它不但包括记录日志、错误、关键错误和调试信息,还包括一些注册和流字节坚持的接口。它还包括定位Snort规则片段和动态规则加载的接口,同时也提供了方法http和一个可选缓存。它定义在sf_dynamic_engine.h中:

typedef struct _DynamicEngineData
{
int version;

SFDataBuffer *altBuffer;
SFDataPointer *altDetect;
SFDataPointer *fileDataBuf;

RegisterRule ruleRegister;
RegisterBit flowbitRegister;
CheckFlowbit flowbitCheck;
DetectAsn1 asn1Detect;
LogMsgFunc logMsg;
LogMsgFunc errMsg;
LogMsgFunc fatalMsg;
char *dataDumpDirectory;

PreprocRuleOptInit preprocRuleOptInit;

SetRuleData setRuleData;
GetRuleData getRuleData;

DebugMsgFunc debugMsg;
#ifdef SF_WCHAR
DebugWideMsgFunc debugWideMsg;
#endif

char **debugMsgFile;
int *debugMsgLine;

PCRECompileFunc pcreCompile;
PCREStudyFunc pcreStudy;
PCREExecFunc pcreExec;
SfUnfold sfUnfold;
SfBase64Decode sfbase64decode;
GetAltDetectFunc GetAltDetect;
SetAltDetectFunc SetAltDetect;
IsDetectFlagFunc Is_DetectFlag;
DetectFlagDisableFunc DetectFlag_Disable;

AllocRuleData allocRuleData;
FreeRuleData freeRuleData;

UnregisterBit flowbitUnregister;

PCRECapture pcreCapture;
PCREOvectorInfo pcreOvectorInfo;

GetHttpBufferFunc getHttpBuffer;

} DynamicEngineData;