"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/dynamic-preprocessors/appid/appInfoTable.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.

appInfoTable.c  (snort-2.9.16.1):appInfoTable.c  (snort-2.9.17)
skipping to change at line 320 skipping to change at line 320
void appInfoTableInit(tAppidStaticConfig* appidSC, tAppIdConfig* pConfig) void appInfoTableInit(tAppidStaticConfig* appidSC, tAppIdConfig* pConfig)
{ {
FILE *tableFile; FILE *tableFile;
const char *token; const char *token;
char buf[MAX_TABLE_LINE_LEN]; char buf[MAX_TABLE_LINE_LEN];
AppInfoTableEntry *entry; AppInfoTableEntry *entry;
tAppId appId; tAppId appId;
uint32_t clientId, serviceId, payloadId; uint32_t clientId, serviceId, payloadId;
char filepath[PATH_MAX]; char filepath[PATH_MAX];
char *appName; char *appName=NULL;
char *snortName=NULL; char *snortName=NULL;
pConfig->AppInfoTableDyn = dynamicArrayCreate(SF_APPID_DYNAMIC_MIN); pConfig->AppInfoTableDyn = dynamicArrayCreate(SF_APPID_DYNAMIC_MIN);
snprintf(filepath, sizeof(filepath), "%s/odp/%s", appidSC->app_id_detector_p ath, APP_MAPPING_FILE); snprintf(filepath, sizeof(filepath), "%s/odp/%s", appidSC->app_id_detector_p ath, APP_MAPPING_FILE);
tableFile = fopen(filepath, "r"); tableFile = fopen(filepath, "r");
if (tableFile == NULL) if (tableFile == NULL)
{ {
_dpd.errMsg("Could not open RnaAppMapping Table file: %s\n", filepath); _dpd.errMsg("Could not open RnaAppMapping Table file: %s\n", filepath);
skipping to change at line 418 skipping to change at line 418
free(appName); free(appName);
free(snortName); free(snortName);
continue; continue;
} }
entry->next = pConfig->AppInfoList; entry->next = pConfig->AppInfoList;
pConfig->AppInfoList = entry; pConfig->AppInfoList = entry;
if (snortName) if (snortName)
{ {
#ifdef TARGET_BASED
entry->snortId = _dpd.addProtocolReference(snortName); entry->snortId = _dpd.addProtocolReference(snortName);
free(snortName); free(snortName);
snortName = NULL; snortName = NULL;
#endif
} }
entry->appName = appName; entry->appName = appName;
entry->appId = appId; entry->appId = appId;
entry->serviceId = serviceId; entry->serviceId = serviceId;
entry->clientId = clientId; entry->clientId = clientId;
entry->payloadId = payloadId; entry->payloadId = payloadId;
entry->priority = APP_PRIORITY_DEFAULT; entry->priority = APP_PRIORITY_DEFAULT;
skipping to change at line 466 skipping to change at line 468
appidSC->is_host_port_app_cache_runtime = 1; appidSC->is_host_port_app_cache_runtime = 1;
appidSC->check_host_port_app_cache = 0; appidSC->check_host_port_app_cache = 0;
appidSC->check_host_cache_unknown_ssl = 0; appidSC->check_host_cache_unknown_ssl = 0;
appidSC->recheck_for_unknown_appid = 0; appidSC->recheck_for_unknown_appid = 0;
appidSC->send_state_sharing_updates = 1; appidSC->send_state_sharing_updates = 1;
appidSC->allow_port_wildcard_host_cache = 0; appidSC->allow_port_wildcard_host_cache = 0;
appidSC->recheck_for_portservice_appid = 0; appidSC->recheck_for_portservice_appid = 0;
appidSC->max_packet_before_service_fail = MIN_MAX_PACKET_BEFORE_SERVICE_FAIL ; appidSC->max_packet_before_service_fail = MIN_MAX_PACKET_BEFORE_SERVICE_FAIL ;
appidSC->max_bytes_before_service_fail = MIN_MAX_BYTES_BEFORE_SERVICE_FAIL; appidSC->max_bytes_before_service_fail = MIN_MAX_BYTES_BEFORE_SERVICE_FAIL;
appidSC->max_packet_service_fail_ignore_bytes = MIN_MAX_PACKET_BEFORE_SERVIC E_FAIL_IGNORE_BYTES; appidSC->max_packet_service_fail_ignore_bytes = MIN_MAX_PACKET_BEFORE_SERVIC E_FAIL_IGNORE_BYTES;
appidSC->http_tunnel_detect = HTTP_TUNNEL_DETECT_RESTART;
snprintf(filepath, sizeof(filepath), "%s/odp/%s", appidSC->app_id_detector_p ath, APP_CONFIG_FILE); snprintf(filepath, sizeof(filepath), "%s/odp/%s", appidSC->app_id_detector_p ath, APP_CONFIG_FILE);
appIdConfLoad (appidSC, filepath); appIdConfLoad (appidSC, filepath);
snprintf(filepath, sizeof(filepath), "%s/../%s", appidSC->app_id_detector_pa th, USR_CONFIG_FILE); snprintf(filepath, sizeof(filepath), "%s/../%s", appidSC->app_id_detector_pa th, USR_CONFIG_FILE);
appIdConfLoad (appidSC, filepath); appIdConfLoad (appidSC, filepath);
} }
void appInfoTableFini(tAppIdConfig *pConfig) void appInfoTableFini(tAppIdConfig *pConfig)
{ {
AppInfoTableEntry *entry; AppInfoTableEntry *entry;
while ((entry = pConfig->AppInfoList)) while ((entry = pConfig->AppInfoList))
{ {
pConfig->AppInfoList = entry->next; pConfig->AppInfoList = entry->next;
free(entry->appName); if (entry->appName)
free(entry->appName);
free(entry); free(entry);
} }
dynamicArrayDestroy(pConfig->AppInfoTableDyn); dynamicArrayDestroy(pConfig->AppInfoTableDyn);
pConfig->AppInfoTableDyn = NULL; pConfig->AppInfoTableDyn = NULL;
appNameHashFini(pConfig->AppNameHash); appNameHashFini(pConfig->AppNameHash);
} }
void appInfoTableDump(tAppIdConfig *pConfig) void appInfoTableDump(tAppIdConfig *pConfig)
skipping to change at line 838 skipping to change at line 842
else if (!(strcasecmp(conf_key, "max_packet_service_fail_ignore_byte s"))) else if (!(strcasecmp(conf_key, "max_packet_service_fail_ignore_byte s")))
{ {
uint16_t max_packet_service_fail_ignore_bytes = atoi(conf_val); uint16_t max_packet_service_fail_ignore_bytes = atoi(conf_val);
if (max_packet_service_fail_ignore_bytes < MIN_MAX_PACKET_BEFORE _SERVICE_FAIL_IGNORE_BYTES) if (max_packet_service_fail_ignore_bytes < MIN_MAX_PACKET_BEFORE _SERVICE_FAIL_IGNORE_BYTES)
{ {
DEBUG_WRAP(DebugMessage(DEBUG_APPID, "AppId: invalid max_pac ket_service_fail_ignore_bytes %"PRIu16", must be greater than %u\n.", max_packe t_service_fail_ignore_bytes, MIN_MAX_PACKET_BEFORE_SERVICE_FAIL_IGNORE_BYTES);); DEBUG_WRAP(DebugMessage(DEBUG_APPID, "AppId: invalid max_pac ket_service_fail_ignore_bytes %"PRIu16", must be greater than %u\n.", max_packe t_service_fail_ignore_bytes, MIN_MAX_PACKET_BEFORE_SERVICE_FAIL_IGNORE_BYTES););
} }
else else
appidSC->max_packet_service_fail_ignore_bytes= max_packet_se rvice_fail_ignore_bytes; appidSC->max_packet_service_fail_ignore_bytes= max_packet_se rvice_fail_ignore_bytes;
} }
else if (!(strcasecmp(conf_key, "http_tunnel_detect")))
{
if (!(strcasecmp(conf_val, "restart_and_reset")))
{
DEBUG_WRAP(DebugMessage(DEBUG_APPID, "AppId: HTTP tunnel det
ect set to restart and reset.\n"););
appidSC->http_tunnel_detect = HTTP_TUNNEL_DETECT_RESTART_AND
_RESET;
continue;
}
}
/* App Priority bit set*/ /* App Priority bit set*/
else if (!(strcasecmp(conf_key, "app_priority"))) else if (!(strcasecmp(conf_key, "app_priority")))
{ {
int temp_appid; int temp_appid;
temp_appid = strtol(conf_val, NULL, 10 ); temp_appid = strtol(conf_val, NULL, 10 );
token = strtok(NULL, CONF_SEPARATORS_USR_APPID); token = strtok(NULL, CONF_SEPARATORS_USR_APPID);
if (token == NULL) if (token == NULL)
{ {
_dpd.errMsg("Could not read app_priority at line %u\n", line ); _dpd.errMsg("Could not read app_priority at line %u\n", line );
continue; continue;
 End of changes. 6 change blocks. 
2 lines changed or deleted 17 lines changed or added

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