From: Mike Stepanek (mstepane) Date: Thu, 3 May 2018 22:53:27 +0000 (-0400) Subject: Merge pull request #1215 in SNORT/snort3 from appid_header_fix to master X-Git-Tag: 3.0.0-245~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d58097a3c8f262bcfa5512440f903820ca2fb8fb;p=thirdparty%2Fsnort3.git Merge pull request #1215 in SNORT/snort3 from appid_header_fix to master Squashed commit of the following: commit 1185586735fc9e4c516cf8beed416aad47e92f39 Author: deramada Date: Thu May 3 16:38:28 2018 -0400 appid: moved HttpFieldIds to appid_http_session --- diff --git a/src/network_inspectors/appid/appid_http_session.h b/src/network_inspectors/appid/appid_http_session.h index b78ee54e7..74bfd6733 100644 --- a/src/network_inspectors/appid/appid_http_session.h +++ b/src/network_inspectors/appid/appid_http_session.h @@ -29,13 +29,30 @@ #include "appid_types.h" #include "application_ids.h" -#include "detector_plugins/http_url_patterns.h" #include "http_xff_fields.h" class AppIdSession; class ChpMatchDescriptor; class HttpPatternMatchers; -enum HttpFieldIds : uint8_t; + +// These values are used in Lua code as raw numbers. Do NOT reassign new values. +enum HttpFieldIds : uint8_t +{ + // Request-side headers + REQ_AGENT_FID, // 0 + REQ_HOST_FID, // 1 + REQ_REFERER_FID, // 2 + REQ_URI_FID, // 3 + REQ_COOKIE_FID, // 4 + REQ_BODY_FID, // 5 + // Response-side headers + RSP_CONTENT_TYPE_FID, // 6 + RSP_LOCATION_FID, // 7 + RSP_BODY_FID, // 8 + MAX_HTTP_FIELD_ID, // 9 + MAX_PATTERN_TYPE = RSP_BODY_FID, + MAX_KEY_PATTERN = REQ_URI_FID, +}; #define RESPONSE_CODE_PACKET_THRESHHOLD 0 diff --git a/src/network_inspectors/appid/detector_plugins/http_url_patterns.h b/src/network_inspectors/appid/detector_plugins/http_url_patterns.h index eecf8fb4d..28c760cdc 100644 --- a/src/network_inspectors/appid/detector_plugins/http_url_patterns.h +++ b/src/network_inspectors/appid/detector_plugins/http_url_patterns.h @@ -30,9 +30,10 @@ #include "search_engines/search_tool.h" #include "utils/util.h" -#include "application_ids.h" -#include "appid_utils/sf_multi_mpse.h" +#include "appid_http_session.h" #include "appid_utils/sf_mlmp.h" +#include "appid_utils/sf_multi_mpse.h" +#include "application_ids.h" namespace snort { @@ -164,25 +165,6 @@ enum ActionType MAX_ACTION_TYPE = DEFER_TO_SIMPLE_DETECT, }; -// These values are used in Lua code as raw numbers. Do NOT reassign new values. -enum HttpFieldIds : uint8_t -{ - // Request-side headers - REQ_AGENT_FID, // 0 - REQ_HOST_FID, // 1 - REQ_REFERER_FID, // 2 - REQ_URI_FID, // 3 - REQ_COOKIE_FID, // 4 - REQ_BODY_FID, // 5 - // Response-side headers - RSP_CONTENT_TYPE_FID, // 6 - RSP_LOCATION_FID, // 7 - RSP_BODY_FID, // 8 - MAX_HTTP_FIELD_ID, // 9 - MAX_PATTERN_TYPE = RSP_BODY_FID, - MAX_KEY_PATTERN = REQ_URI_FID, -}; - struct CHPApp { AppId appIdInstance; // * see note above