service_tftp.c (snort-2.9.16.1) | : | service_tftp.c (snort-2.9.17) | ||
---|---|---|---|---|
skipping to change at line 102 | skipping to change at line 102 | |||
pp | pp | |||
}; | }; | |||
static tAppRegistryEntry appIdRegistry[] = {{APP_ID_TFTP, APPINFO_FLAG_SERVICE_A DDITIONAL}}; | static tAppRegistryEntry appIdRegistry[] = {{APP_ID_TFTP, APPINFO_FLAG_SERVICE_A DDITIONAL}}; | |||
static int16_t app_id; | static int16_t app_id; | |||
static int tftp_init(const InitServiceAPI * const init_api) | static int tftp_init(const InitServiceAPI * const init_api) | |||
{ | { | |||
unsigned i; | unsigned i; | |||
#ifdef TARGET_BASED | ||||
app_id = init_api->dpd->addProtocolReference("tftp"); | app_id = init_api->dpd->addProtocolReference("tftp"); | |||
for (i=0; i < sizeof(appIdRegistry)/sizeof(*appIdRegistry); i++) | for (i=0; i < sizeof(appIdRegistry)/sizeof(*appIdRegistry); i++) | |||
{ | { | |||
_dpd.debugMsg(DEBUG_LOG,"registering appId: %d\n",appIdRegistry[i].appId ); | _dpd.debugMsg(DEBUG_LOG,"registering appId: %d\n",appIdRegistry[i].appId ); | |||
init_api->RegisterAppId(&tftp_validate, appIdRegistry[i].appId, appIdReg istry[i].additionalInfo, init_api->pAppidConfig); | init_api->RegisterAppId(&tftp_validate, appIdRegistry[i].appId, appIdReg istry[i].additionalInfo, init_api->pAppidConfig); | |||
} | } | |||
#endif | ||||
return 0; | return 0; | |||
} | } | |||
static int tftp_verify_header(const uint8_t *data, uint16_t size, | static int tftp_verify_header(const uint8_t *data, uint16_t size, | |||
uint16_t *block) | uint16_t *block) | |||
{ | { | |||
const ServiceTFTPHeader *hdr; | const ServiceTFTPHeader *hdr; | |||
if (size < sizeof(ServiceTFTPHeader)) return -1; | if (size < sizeof(ServiceTFTPHeader)) return -1; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |