"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dynamic-plugins/sf_dynamic_plugins.c" between
snort-2.9.16.1.tar.gz and snort-2.9.17.tar.gz

About: Snort is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

sf_dynamic_plugins.c  (snort-2.9.16.1):sf_dynamic_plugins.c  (snort-2.9.17)
skipping to change at line 61 skipping to change at line 61
/* Of course, WIN32 couldn't do things the unix way... /* Of course, WIN32 couldn't do things the unix way...
* Define a few of these to get around portability issues. * Define a few of these to get around portability issues.
*/ */
#define getcwd _getcwd #define getcwd _getcwd
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX MAX_PATH #define PATH_MAX MAX_PATH
#endif #endif
#endif /* !WIN32 */ #endif /* !WIN32 */
#include <errno.h> #include <errno.h>
#include <stdarg.h>
#if defined(FEAT_OPEN_APPID) #if defined(FEAT_OPEN_APPID)
#include <pthread.h> #include <pthread.h>
#endif #endif
#include "config.h" #include "config.h"
#include "decode.h" #include "decode.h"
#include "encode.h" #include "encode.h"
#include "snort_debug.h" #include "snort_debug.h"
#include "detect.h" #include "detect.h"
skipping to change at line 1130 skipping to change at line 1131
static void DynamicRuleDataFreeSession(void *data) static void DynamicRuleDataFreeSession(void *data)
{ {
DynamicRuleSessionData *drsd = (DynamicRuleSessionData *)data; DynamicRuleSessionData *drsd = (DynamicRuleSessionData *)data;
while (drsd != NULL) while (drsd != NULL)
{ {
DynamicRuleSessionData *tmp = drsd; DynamicRuleSessionData *tmp = drsd;
drsd = drsd->next; drsd = drsd->next;
DynamicRuleDataFree(tmp->data); DynamicRuleDataFree(tmp->data);
DynamicRuleDataFree(tmp);
#ifdef SNORT_RELOAD #ifdef SNORT_RELOAD
ada_appdata_freed(ada, tmp); ada_appdata_freed(ada, tmp);
#endif #endif
if (tmp->compression_data)
{
DynamicDecompressDestroy(tmp->compression_data);
}
DynamicRuleDataFree(tmp);
} }
} }
int DynamicSetRuleData(void *p, const RuleInformation *info, void *data, void *c ompression_data) int DynamicSetRuleData(void *p, const RuleInformation *info, void *data, void *c ompression_data)
{ {
Packet *pkt = (Packet *)p; Packet *pkt = (Packet *)p;
if (stream_api && pkt && pkt->ssnptr) if (stream_api && pkt && pkt->ssnptr)
{ {
DynamicRuleSessionData *head = DynamicRuleSessionData *head =
(DynamicRuleSessionData *)session_api->get_application_data(pkt->ssn ptr, PP_SHARED_RULES); (DynamicRuleSessionData *)session_api->get_application_data(pkt->ssn ptr, PP_SHARED_RULES);
skipping to change at line 1926 skipping to change at line 1932
sslAppIdLookupFnPtr = fnptr; sslAppIdLookupFnPtr = fnptr;
} }
static int sslAppIdLookup(void *ssnptr, const char * serverName, const char * co mmonName, int32_t *serviceAppId, int32_t *clientAppId, int32_t *payloadAppId) static int sslAppIdLookup(void *ssnptr, const char * serverName, const char * co mmonName, int32_t *serviceAppId, int32_t *clientAppId, int32_t *payloadAppId)
{ {
if (sslAppIdLookupFnPtr) if (sslAppIdLookupFnPtr)
return (sslAppIdLookupFnPtr)(ssnptr, serverName, commonName, serviceAppI d, clientAppId, payloadAppId); return (sslAppIdLookupFnPtr)(ssnptr, serverName, commonName, serviceAppI d, clientAppId, payloadAppId);
return 0; return 0;
} }
static SetTlsHostAppIdFunc setTlsHostAppIdFnPtr;
static void registerSetTlsHostAppId(SetTlsHostAppIdFunc fnptr)
{
setTlsHostAppIdFnPtr = fnptr;
}
static void setTlsHostAppId(void *ssnptr, const char *serverName, const char *co
mmonName,
const char *orgName, const char *subjectAltName, bool is
SniMismatch,
int32_t *serviceAppId, int32_t *clientAppId, int32_t *pa
yloadAppId)
{
if (setTlsHostAppIdFnPtr)
(setTlsHostAppIdFnPtr)(ssnptr, serverName, commonName, orgName, subjectA
ltName, isSniMismatch, serviceAppId, clientAppId, payloadAppId);
}
static GetAppIdFunc getAppIdFnPtr = NULL; static GetAppIdFunc getAppIdFnPtr = NULL;
static void registerGetAppId(GetAppIdFunc fnptr) static void registerGetAppId(GetAppIdFunc fnptr)
{ {
getAppIdFnPtr = fnptr; getAppIdFnPtr = fnptr;
} }
static int32_t getAppId(void *ssnptr) static int32_t getAppId(void *ssnptr)
{ {
if(getAppIdFnPtr) if(getAppIdFnPtr)
skipping to change at line 2573 skipping to change at line 2594
static SnortConfig* GetCurrentSnortConfig(void) static SnortConfig* GetCurrentSnortConfig(void)
{ {
return snort_conf; return snort_conf;
} }
static void DynamicSetIPRepUpdateCount(uint8_t count) static void DynamicSetIPRepUpdateCount(uint8_t count)
{ {
return setIPRepUpdateCount(count); return setIPRepUpdateCount(count);
} }
static void ErrorMsgThrottled(void* tinfo, const char *format, ...)
{
char buf[STD_BUF+1];
va_list ap;
ThrottleInfo *throttleInfo = (ThrottleInfo *)tinfo;
va_start(ap, format);
vsnprintf(buf, STD_BUF, format, ap);
va_end(ap);
ErrorMessageThrottled(throttleInfo, "%s", buf);
}
int InitDynamicPreprocessors(void) int InitDynamicPreprocessors(void)
{ {
DynamicPreprocessorData preprocData; DynamicPreprocessorData preprocData;
preprocData.version = PREPROCESSOR_DATA_VERSION; preprocData.version = PREPROCESSOR_DATA_VERSION;
preprocData.size = sizeof(DynamicPreprocessorData); preprocData.size = sizeof(DynamicPreprocessorData);
preprocData.altBuffer = (SFDataBuffer *)&DecodeBuffer; preprocData.altBuffer = (SFDataBuffer *)&DecodeBuffer;
preprocData.altDetect = (SFDataPointer *)&DetectBuffer; preprocData.altDetect = (SFDataPointer *)&DetectBuffer;
preprocData.fileDataBuf = (SFDataPointer *)&file_data_ptr; preprocData.fileDataBuf = (SFDataPointer *)&file_data_ptr;
preprocData.logMsg = &LogMessage; preprocData.logMsg = &LogMessage;
preprocData.errMsg = &ErrorMessage; preprocData.errMsg = &ErrorMessage;
preprocData.fatalMsg = &FatalError; preprocData.fatalMsg = &FatalError;
preprocData.debugMsg = &DebugMessageFunc; preprocData.debugMsg = &DebugMessageFunc;
preprocData.errMsgThrottled = &ErrorMsgThrottled;
#ifdef SF_WCHAR #ifdef SF_WCHAR
preprocData.debugWideMsg = &DebugWideMessageFunc; preprocData.debugWideMsg = &DebugWideMessageFunc;
#endif #endif
preprocData.registerPreproc = &RegisterPreprocessor; preprocData.registerPreproc = &RegisterPreprocessor;
#ifdef SNORT_RELOAD #ifdef SNORT_RELOAD
preprocData.getRelatedReloadData = GetRelatedReloadData; preprocData.getRelatedReloadData = GetRelatedReloadData;
#endif #endif
#ifdef DUMP_BUFFER #ifdef DUMP_BUFFER
preprocData.registerBufferTracer = &RegisterBufferTracer; preprocData.registerBufferTracer = &RegisterBufferTracer;
skipping to change at line 2857 skipping to change at line 2892
preprocData.registerMemoryStatsFunc = RegisterMemoryStatsFunction; preprocData.registerMemoryStatsFunc = RegisterMemoryStatsFunction;
preprocData.snortAlloc = SnortPreprocAlloc; preprocData.snortAlloc = SnortPreprocAlloc;
preprocData.snortFree = SnortPreprocFree; preprocData.snortFree = SnortPreprocFree;
preprocData.registerReputationProcessExternal = &registerReputationProcessEx ternal; preprocData.registerReputationProcessExternal = &registerReputationProcessEx ternal;
preprocData.reputation_process_external_ip = &_reputation_process_external_i p; preprocData.reputation_process_external_ip = &_reputation_process_external_i p;
preprocData.registerReputationGetEntryCount = &registerReputationGetEntryCou nt; preprocData.registerReputationGetEntryCount = &registerReputationGetEntryCou nt;
preprocData.reputation_get_entry_count = &_reputation_get_entry_count; preprocData.reputation_get_entry_count = &_reputation_get_entry_count;
preprocData.registerFtpmodeQuery = &registerFtpModeQuery; preprocData.registerFtpmodeQuery = &registerFtpModeQuery;
preprocData.ftpGetMode = &ftpGetDataSessionMode; preprocData.ftpGetMode = &ftpGetDataSessionMode;
preprocData.setTlsHostAppId = &setTlsHostAppId;
preprocData.registerSetTlsHostAppId = &registerSetTlsHostAppId;
return InitDynamicPreprocessorPlugins(&preprocData); return InitDynamicPreprocessorPlugins(&preprocData);
} }
int InitDynamicDetectionPlugins(SnortConfig *sc) int InitDynamicDetectionPlugins(SnortConfig *sc)
{ {
DynamicDetectionPlugin *plugin; DynamicDetectionPlugin *plugin;
if (sc == NULL) if (sc == NULL)
return -1; return -1;
 End of changes. 7 change blocks. 
1 lines changed or deleted 43 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)