From: Philippe Antoine Date: Thu, 17 Dec 2020 11:03:08 +0000 (+0100) Subject: protos: renaming ALPROTO_HTTP* constants X-Git-Tag: suricata-7.0.0-beta1~1792 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=707f027231f11a93fbf7fbd111005afb6b22d443;p=thirdparty%2Fsuricata.git protos: renaming ALPROTO_HTTP* constants Having now ALPROTO_HTTP1, ALPROTO_HTTP2 and ALPROTO_HTTP Run with 3 sed commands git grep ALPROTO_HTTP | cut -d: -f1 | uniq | xargs sed -i -e 's/ALPROTO_HTTP/ALPROTO_HTTP1/g' git grep ALPROTO_HTTP12 | cut -d: -f1 | uniq | xargs sed -i -e 's/ALPROTO_HTTP12/ALPROTO_HTTP2/g' git grep ALPROTO_HTTP1_ANY | cut -d: -f1 | uniq | xargs sed -i -e 's/ALPROTO_HTTP1_ANY/ALPROTO_HTTP/g' and then running clang-format --- diff --git a/rust/src/http2/http2.rs b/rust/src/http2/http2.rs index 47cb73231b..827e0d8ac2 100644 --- a/rust/src/http2/http2.rs +++ b/rust/src/http2/http2.rs @@ -983,7 +983,7 @@ pub extern "C" fn rs_http2_state_new( let boxed = Box::new(state); let r = unsafe { transmute(boxed) }; if orig_state != std::ptr::null_mut() { - //we could check ALPROTO_HTTP == orig_proto + //we could check ALPROTO_HTTP1 == orig_proto unsafe { HTTP2MimicHttp1Request(orig_state, r); } diff --git a/src/alert-prelude.c b/src/alert-prelude.c index 48ae6e58b1..3c73b3866a 100644 --- a/src/alert-prelude.c +++ b/src/alert-prelude.c @@ -667,7 +667,7 @@ static int JsonToAdditionalData(const char * key, json_t * value, idmef_alert_t } /** - * \brief Handle ALPROTO_HTTP JSON information + * \brief Handle ALPROTO_HTTP1 JSON information * \param p Packet where to extract data * \param pa Packet alert information * \param alert IDMEF alert @@ -828,7 +828,7 @@ static int PacketToData(const Packet *p, const PacketAlert *pa, idmef_alert_t *a if (p->flow != NULL) { uint16_t proto = FlowGetAppProtocol(p->flow); switch (proto) { - case ALPROTO_HTTP: + case ALPROTO_HTTP1: PacketToDataProtoHTTP(p, pa, alert); break; case ALPROTO_HTTP2: diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 2d3826b8bd..85bb95fa7d 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -865,8 +865,8 @@ static void AppLayerProtoDetectPrintProbingParsers(AppLayerProtoDetectProbingPar pp_pe = pp_port->dp; for ( ; pp_pe != NULL; pp_pe = pp_pe->next) { - if (pp_pe->alproto == ALPROTO_HTTP) - printf(" alproto: ALPROTO_HTTP\n"); + if (pp_pe->alproto == ALPROTO_HTTP1) + printf(" alproto: ALPROTO_HTTP1\n"); else if (pp_pe->alproto == ALPROTO_FTP) printf(" alproto: ALPROTO_FTP\n"); else if (pp_pe->alproto == ALPROTO_FTPDATA) @@ -942,8 +942,8 @@ static void AppLayerProtoDetectPrintProbingParsers(AppLayerProtoDetectProbingPar pp_pe = pp_port->sp; for ( ; pp_pe != NULL; pp_pe = pp_pe->next) { - if (pp_pe->alproto == ALPROTO_HTTP) - printf(" alproto: ALPROTO_HTTP\n"); + if (pp_pe->alproto == ALPROTO_HTTP1) + printf(" alproto: ALPROTO_HTTP1\n"); else if (pp_pe->alproto == ALPROTO_FTP) printf(" alproto: ALPROTO_FTP\n"); else if (pp_pe->alproto == ALPROTO_FTPDATA) @@ -2095,8 +2095,8 @@ void AppLayerProtoDetectSupportedIpprotos(AppProto alproto, uint8_t *ipprotos) SCEnter(); // Custom case for only signature-only protocol so far - if (alproto == ALPROTO_HTTP_ANY) { - AppLayerProtoDetectSupportedIpprotos(ALPROTO_HTTP, ipprotos); + if (alproto == ALPROTO_HTTP) { + AppLayerProtoDetectSupportedIpprotos(ALPROTO_HTTP1, ipprotos); AppLayerProtoDetectSupportedIpprotos(ALPROTO_HTTP2, ipprotos); } else { AppLayerProtoDetectPMGetIpprotos(alproto, ipprotos); @@ -2198,9 +2198,9 @@ static int AppLayerProtoDetectTest01(void) AppLayerProtoDetectSetup(); const char *buf = "HTTP"; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 4, 0, STREAM_TOCLIENT); buf = "GET"; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 4, 0, STREAM_TOSERVER); AppLayerProtoDetectPrepareState(); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].max_pat_id != 1); @@ -2217,7 +2217,7 @@ static int AppLayerProtoDetectTest02(void) AppLayerProtoDetectSetup(); const char *buf = "HTTP"; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 4, 0, STREAM_TOCLIENT); buf = "ftp"; AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_FTP, buf, 4, 0, STREAM_TOCLIENT); @@ -2229,7 +2229,7 @@ static int AppLayerProtoDetectTest02(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map == NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_FTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP1); AppLayerProtoDetectDeSetup(); AppLayerProtoDetectUnittestCtxRestore(); @@ -2250,7 +2250,7 @@ static int AppLayerProtoDetectTest03(void) const char *buf = "HTTP"; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 4, 0, STREAM_TOCLIENT); buf = "220 "; AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_FTP, buf, 4, 0, STREAM_TOCLIENT); @@ -2265,7 +2265,7 @@ static int AppLayerProtoDetectTest03(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map != NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map == NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_FTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP1); bool rflow = false; uint32_t cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, @@ -2273,7 +2273,7 @@ static int AppLayerProtoDetectTest03(void) STREAM_TOCLIENT, pm_results, &rflow); FAIL_IF(cnt != 1); - FAIL_IF(pm_results[0] != ALPROTO_HTTP); + FAIL_IF(pm_results[0] != ALPROTO_HTTP1); AppLayerProtoDetectDestroyCtxThread(alpd_tctx); AppLayerProtoDetectDeSetup(); @@ -2294,7 +2294,7 @@ static int AppLayerProtoDetectTest04(void) f.protomap = FlowGetProtoMapping(IPPROTO_TCP); const char *buf = "200 "; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 13, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 13, 0, STREAM_TOCLIENT); AppLayerProtoDetectPrepareState(); /* AppLayerProtoDetectGetCtxThread() should be called post AppLayerProtoDetectPrepareState(), since @@ -2306,14 +2306,14 @@ static int AppLayerProtoDetectTest04(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].max_pat_id != 1); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map != NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map == NULL); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP1); bool rdir = false; uint32_t cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, &f, l7data, sizeof(l7data), STREAM_TOCLIENT, pm_results, &rdir); FAIL_IF(cnt != 1); - FAIL_IF(pm_results[0] != ALPROTO_HTTP); + FAIL_IF(pm_results[0] != ALPROTO_HTTP1); AppLayerProtoDetectDestroyCtxThread(alpd_tctx); AppLayerProtoDetectDeSetup(); @@ -2334,7 +2334,7 @@ static int AppLayerProtoDetectTest05(void) f.protomap = FlowGetProtoMapping(IPPROTO_TCP); const char *buf = "HTTP"; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 4, 0, STREAM_TOCLIENT); buf = "220 "; AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_FTP, buf, 4, 0, STREAM_TOCLIENT); @@ -2349,7 +2349,7 @@ static int AppLayerProtoDetectTest05(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map != NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map == NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_FTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP1); bool rdir = false; uint32_t cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, @@ -2357,7 +2357,7 @@ static int AppLayerProtoDetectTest05(void) STREAM_TOCLIENT, pm_results, &rdir); FAIL_IF(cnt != 1); - FAIL_IF(pm_results[0] != ALPROTO_HTTP); + FAIL_IF(pm_results[0] != ALPROTO_HTTP1); AppLayerProtoDetectDestroyCtxThread(alpd_tctx); AppLayerProtoDetectDeSetup(); @@ -2378,7 +2378,7 @@ static int AppLayerProtoDetectTest06(void) f.protomap = FlowGetProtoMapping(IPPROTO_TCP); const char *buf = "HTTP"; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 4, 0, STREAM_TOCLIENT); buf = "220 "; AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_FTP, buf, 4, 0, STREAM_TOCLIENT); @@ -2393,7 +2393,7 @@ static int AppLayerProtoDetectTest06(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map != NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map == NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_FTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[1]->alproto != ALPROTO_HTTP1); bool rdir = false; uint32_t cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, @@ -2421,7 +2421,7 @@ static int AppLayerProtoDetectTest07(void) memset(pm_results, 0, sizeof(pm_results)); const char *buf = "HTTP"; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, buf, 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP1, buf, 4, 0, STREAM_TOCLIENT); AppLayerProtoDetectPrepareState(); /* AppLayerProtoDetectGetCtxThread() should be called post AppLayerProtoDetectPrepareState(), since @@ -2432,7 +2432,7 @@ static int AppLayerProtoDetectTest07(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].max_pat_id != 1); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map != NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map == NULL); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP1); bool rdir = false; uint32_t cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, @@ -2627,14 +2627,22 @@ static int AppLayerProtoDetectTest11(void) memset(&f, 0x00, sizeof(f)); f.protomap = FlowGetProtoMapping(IPPROTO_TCP); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "GET", 3, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "PUT", 3, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "POST", 4, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "TRACE", 5, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "OPTIONS", 7, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "CONNECT", 7, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "HTTP", 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "GET", 3, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "PUT", 3, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "POST", 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "TRACE", 5, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "OPTIONS", 7, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "CONNECT", 7, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "HTTP", 4, 0, STREAM_TOCLIENT); AppLayerProtoDetectPrepareState(); /* AppLayerProtoDetectGetCtxThread() should be called post AppLayerProtoDetectPrepareState(), since @@ -2647,28 +2655,28 @@ static int AppLayerProtoDetectTest11(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map == NULL); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map == NULL); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[1]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[2]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[3]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[4]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[5]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[6]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[1]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[2]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[3]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[4]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[5]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[6]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP1); bool rdir = false; uint32_t cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, &f, l7data, sizeof(l7data), STREAM_TOSERVER, pm_results, &rdir); FAIL_IF(cnt != 1); - FAIL_IF(pm_results[0] != ALPROTO_HTTP); + FAIL_IF(pm_results[0] != ALPROTO_HTTP1); memset(pm_results, 0, sizeof(pm_results)); cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, &f, l7data_resp, sizeof(l7data_resp), STREAM_TOCLIENT, pm_results, &rdir); FAIL_IF(cnt != 1); - FAIL_IF(pm_results[0] != ALPROTO_HTTP); + FAIL_IF(pm_results[0] != ALPROTO_HTTP1); AppLayerProtoDetectDestroyCtxThread(alpd_tctx); AppLayerProtoDetectDeSetup(); @@ -2686,7 +2694,8 @@ static int AppLayerProtoDetectTest12(void) int r = 0; - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_TCP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_TCP, ALPROTO_HTTP1, "HTTP", 4, 0, STREAM_TOSERVER); if (alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].head == NULL || alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map != NULL) { @@ -2705,7 +2714,7 @@ static int AppLayerProtoDetectTest12(void) printf("failure 3\n"); goto end; } - if (alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP) { + if (alpd_ctx.ctx_ipp[FLOW_PROTO_TCP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP1) { printf("failure 4\n"); goto end; } @@ -2743,14 +2752,22 @@ static int AppLayerProtoDetectTest13(void) memset(&f, 0x00, sizeof(f)); f.protomap = FlowGetProtoMapping(IPPROTO_TCP); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "GET", 3, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "PUT", 3, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "POST", 4, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "TRACE", 5, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "OPTIONS", 7, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "CONNECT", 7, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "HTTP", 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "GET", 3, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "PUT", 3, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "POST", 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "TRACE", 5, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "OPTIONS", 7, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "CONNECT", 7, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "HTTP", 4, 0, STREAM_TOCLIENT); AppLayerProtoDetectPrepareState(); /* AppLayerProtoDetectGetCtxThread() should be called post AppLayerProtoDetectPrepareState(), since @@ -2760,14 +2777,14 @@ static int AppLayerProtoDetectTest13(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].max_pat_id != 7); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[1].max_pat_id != 1); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[1]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[2]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[3]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[4]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[5]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[6]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[1]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[2]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[3]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[4]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[5]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[6]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP1); memset(pm_results, 0, sizeof(pm_results)); bool rdir = false; @@ -2790,7 +2807,7 @@ static int AppLayerProtoDetectTest13(void) /** * \test What about if we add some sigs only for udp calling it for UDP? - * It should detect ALPROTO_HTTP (over udp). This is just a check + * It should detect ALPROTO_HTTP1 (over udp). This is just a check * to ensure that TCP/UDP differences work correctly. */ static int AppLayerProtoDetectTest14(void) @@ -2806,14 +2823,22 @@ static int AppLayerProtoDetectTest14(void) memset(&f, 0x00, sizeof(f)); f.protomap = FlowGetProtoMapping(IPPROTO_UDP); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "GET", 3, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "PUT", 3, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "POST", 4, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "TRACE", 5, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "OPTIONS", 7, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "CONNECT", 7, 0, STREAM_TOSERVER); - AppLayerProtoDetectPMRegisterPatternCS(IPPROTO_UDP, ALPROTO_HTTP, "HTTP", 4, 0, STREAM_TOCLIENT); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "HTTP", 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "GET", 3, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "PUT", 3, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "POST", 4, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "TRACE", 5, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "OPTIONS", 7, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "CONNECT", 7, 0, STREAM_TOSERVER); + AppLayerProtoDetectPMRegisterPatternCS( + IPPROTO_UDP, ALPROTO_HTTP1, "HTTP", 4, 0, STREAM_TOCLIENT); AppLayerProtoDetectPrepareState(); /* AppLayerProtoDetectGetCtxThread() should be called post AppLayerProtoDetectPrepareState(), since @@ -2824,14 +2849,14 @@ static int AppLayerProtoDetectTest14(void) FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].max_pat_id != 7); FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[1].max_pat_id != 1); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[1]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[2]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[3]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[4]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[5]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[6]->alproto != ALPROTO_HTTP); - FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[0]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[1]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[2]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[3]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[4]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[5]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[0].map[6]->alproto != ALPROTO_HTTP1); + FAIL_IF(alpd_ctx.ctx_ipp[FLOW_PROTO_UDP].ctx_pm[1].map[0]->alproto != ALPROTO_HTTP1); memset(pm_results, 0, sizeof(pm_results)); bool rdir = false; @@ -2839,14 +2864,14 @@ static int AppLayerProtoDetectTest14(void) &f, l7data, sizeof(l7data), STREAM_TOSERVER, pm_results, &rdir); FAIL_IF(cnt != 1); - FAIL_IF(pm_results[0] != ALPROTO_HTTP); + FAIL_IF(pm_results[0] != ALPROTO_HTTP1); memset(pm_results, 0, sizeof(pm_results)); cnt = AppLayerProtoDetectPMGetProto(alpd_tctx, &f, l7data_resp, sizeof(l7data_resp), STREAM_TOCLIENT, pm_results, &rdir); FAIL_IF(cnt != 1); - FAIL_IF(pm_results[0] != ALPROTO_HTTP); + FAIL_IF(pm_results[0] != ALPROTO_HTTP1); AppLayerProtoDetectDestroyCtxThread(alpd_tctx); AppLayerProtoDetectDeSetup(); @@ -2987,12 +3012,8 @@ static int AppLayerProtoDetectTest15(void) int result = 0; - AppLayerProtoDetectPPRegister(IPPROTO_TCP, - "80", - ALPROTO_HTTP, - 5, 8, - STREAM_TOSERVER, - ProbingParserDummyForTesting, NULL); + AppLayerProtoDetectPPRegister(IPPROTO_TCP, "80", ALPROTO_HTTP1, 5, 8, STREAM_TOSERVER, + ProbingParserDummyForTesting, NULL); AppLayerProtoDetectPPRegister(IPPROTO_TCP, "80", ALPROTO_SMB, @@ -3084,12 +3105,8 @@ static int AppLayerProtoDetectTest15(void) 12, 18, STREAM_TOCLIENT, ProbingParserDummyForTesting, NULL); - AppLayerProtoDetectPPRegister(IPPROTO_TCP, - "80", - ALPROTO_HTTP, - 5, 8, - STREAM_TOCLIENT, - ProbingParserDummyForTesting, NULL); + AppLayerProtoDetectPPRegister(IPPROTO_TCP, "80", ALPROTO_HTTP1, 5, 8, STREAM_TOCLIENT, + ProbingParserDummyForTesting, NULL); AppLayerProtoDetectPPRegister(IPPROTO_TCP, "81", ALPROTO_DCERPC, @@ -3128,23 +3145,22 @@ static int AppLayerProtoDetectTest15(void) ProbingParserDummyForTesting, NULL); AppLayerProtoDetectPPTestDataElement element_ts_80[] = { - { "http", ALPROTO_HTTP, 80, 1 << ALPROTO_HTTP, 5, 8 }, - { "smb", ALPROTO_SMB, 80, 1 << ALPROTO_SMB, 5, 6 }, - { "ftp", ALPROTO_FTP, 80, 1 << ALPROTO_FTP, 7, 10 }, - { "smtp", ALPROTO_SMTP, 0, 1 << ALPROTO_SMTP, 12, 0 }, - { "tls", ALPROTO_TLS, 0, 1 << ALPROTO_TLS, 12, 18 }, - { "irc", ALPROTO_IRC, 0, 1 << ALPROTO_IRC, 12, 25 }, - { "jabber", ALPROTO_JABBER, 0, 1 << ALPROTO_JABBER, 12, 23 }, - }; - AppLayerProtoDetectPPTestDataElement element_tc_80[] = { - { "http", ALPROTO_HTTP, 80, 1 << ALPROTO_HTTP, 5, 8 }, - { "smb", ALPROTO_SMB, 80, 1 << ALPROTO_SMB, 5, 6 }, - { "ftp", ALPROTO_FTP, 80, 1 << ALPROTO_FTP, 7, 10 }, - { "jabber", ALPROTO_JABBER, 0, 1 << ALPROTO_JABBER, 12, 23 }, - { "irc", ALPROTO_IRC, 0, 1 << ALPROTO_IRC, 12, 14 }, - { "tls", ALPROTO_TLS, 0, 1 << ALPROTO_TLS, 12, 18 }, - { "smtp", ALPROTO_SMTP, 0, 1 << ALPROTO_SMTP, 12, 17 } - }; + { "http", ALPROTO_HTTP1, 80, 1 << ALPROTO_HTTP1, 5, 8 }, + { "smb", ALPROTO_SMB, 80, 1 << ALPROTO_SMB, 5, 6 }, + { "ftp", ALPROTO_FTP, 80, 1 << ALPROTO_FTP, 7, 10 }, + { "smtp", ALPROTO_SMTP, 0, 1 << ALPROTO_SMTP, 12, 0 }, + { "tls", ALPROTO_TLS, 0, 1 << ALPROTO_TLS, 12, 18 }, + { "irc", ALPROTO_IRC, 0, 1 << ALPROTO_IRC, 12, 25 }, + { "jabber", ALPROTO_JABBER, 0, 1 << ALPROTO_JABBER, 12, 23 }, + }; + AppLayerProtoDetectPPTestDataElement element_tc_80[] = { { "http", ALPROTO_HTTP1, 80, + 1 << ALPROTO_HTTP1, 5, 8 }, + { "smb", ALPROTO_SMB, 80, 1 << ALPROTO_SMB, 5, 6 }, + { "ftp", ALPROTO_FTP, 80, 1 << ALPROTO_FTP, 7, 10 }, + { "jabber", ALPROTO_JABBER, 0, 1 << ALPROTO_JABBER, 12, 23 }, + { "irc", ALPROTO_IRC, 0, 1 << ALPROTO_IRC, 12, 14 }, + { "tls", ALPROTO_TLS, 0, 1 << ALPROTO_TLS, 12, 18 }, + { "smtp", ALPROTO_SMTP, 0, 1 << ALPROTO_SMTP, 12, 17 } }; AppLayerProtoDetectPPTestDataElement element_ts_81[] = { { "dcerpc", ALPROTO_DCERPC, 81, 1 << ALPROTO_DCERPC, 9, 10 }, @@ -3215,53 +3231,56 @@ static int AppLayerProtoDetectTest15(void) }; AppLayerProtoDetectPPTestDataPort ports_tcp[] = { - { 80, - ((1 << ALPROTO_HTTP) | (1 << ALPROTO_SMB) | (1 << ALPROTO_FTP) | - (1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | (1 << ALPROTO_JABBER)), - ((1 << ALPROTO_HTTP) | (1 << ALPROTO_SMB) | (1 << ALPROTO_FTP) | - (1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), - 23, - element_ts_80, element_tc_80, - sizeof(element_ts_80) / sizeof(AppLayerProtoDetectPPTestDataElement), - sizeof(element_tc_80) / sizeof(AppLayerProtoDetectPPTestDataElement), + { + 80, + ((1 << ALPROTO_HTTP1) | (1 << ALPROTO_SMB) | (1 << ALPROTO_FTP) | + (1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | + (1 << ALPROTO_JABBER)), + ((1 << ALPROTO_HTTP1) | (1 << ALPROTO_SMB) | (1 << ALPROTO_FTP) | + (1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | + (1 << ALPROTO_SMTP)), + 23, + element_ts_80, + element_tc_80, + sizeof(element_ts_80) / sizeof(AppLayerProtoDetectPPTestDataElement), + sizeof(element_tc_80) / sizeof(AppLayerProtoDetectPPTestDataElement), }, - { 81, - ((1 << ALPROTO_DCERPC) | (1 << ALPROTO_FTP) | - (1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | (1 << ALPROTO_JABBER)), - ((1 << ALPROTO_FTP) | (1 << ALPROTO_DCERPC) | - (1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), - 23, - element_ts_81, element_tc_81, - sizeof(element_ts_81) / sizeof(AppLayerProtoDetectPPTestDataElement), - sizeof(element_tc_81) / sizeof(AppLayerProtoDetectPPTestDataElement), + { + 81, + ((1 << ALPROTO_DCERPC) | (1 << ALPROTO_FTP) | (1 << ALPROTO_SMTP) | + (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | (1 << ALPROTO_JABBER)), + ((1 << ALPROTO_FTP) | (1 << ALPROTO_DCERPC) | (1 << ALPROTO_JABBER) | + (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), + 23, + element_ts_81, + element_tc_81, + sizeof(element_ts_81) / sizeof(AppLayerProtoDetectPPTestDataElement), + sizeof(element_tc_81) / sizeof(AppLayerProtoDetectPPTestDataElement), }, { 85, - ((1 << ALPROTO_DCERPC) | (1 << ALPROTO_FTP) | - (1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | (1 << ALPROTO_JABBER)), - ((1 << ALPROTO_DCERPC) | - (1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), - 23, - element_ts_85, element_tc_85, - sizeof(element_ts_85) / sizeof(AppLayerProtoDetectPPTestDataElement), - sizeof(element_tc_85) / sizeof(AppLayerProtoDetectPPTestDataElement) - }, + ((1 << ALPROTO_DCERPC) | (1 << ALPROTO_FTP) | (1 << ALPROTO_SMTP) | + (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | (1 << ALPROTO_JABBER)), + ((1 << ALPROTO_DCERPC) | (1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | + (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), + 23, element_ts_85, element_tc_85, + sizeof(element_ts_85) / sizeof(AppLayerProtoDetectPPTestDataElement), + sizeof(element_tc_85) / sizeof(AppLayerProtoDetectPPTestDataElement) }, { 90, - ((1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | (1 << ALPROTO_JABBER)), - ((1 << ALPROTO_FTP) | - (1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), - 23, - element_ts_90, element_tc_90, - sizeof(element_ts_90) / sizeof(AppLayerProtoDetectPPTestDataElement), - sizeof(element_tc_90) / sizeof(AppLayerProtoDetectPPTestDataElement) - }, + ((1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | + (1 << ALPROTO_JABBER)), + ((1 << ALPROTO_FTP) | (1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | + (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), + 23, element_ts_90, element_tc_90, + sizeof(element_ts_90) / sizeof(AppLayerProtoDetectPPTestDataElement), + sizeof(element_tc_90) / sizeof(AppLayerProtoDetectPPTestDataElement) }, { 0, - ((1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | (1 << ALPROTO_JABBER)), - ((1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | (1 << ALPROTO_SMTP)), - 23, - element_ts_0, element_tc_0, - sizeof(element_ts_0) / sizeof(AppLayerProtoDetectPPTestDataElement), - sizeof(element_tc_0) / sizeof(AppLayerProtoDetectPPTestDataElement) - } + ((1 << ALPROTO_SMTP) | (1 << ALPROTO_TLS) | (1 << ALPROTO_IRC) | + (1 << ALPROTO_JABBER)), + ((1 << ALPROTO_JABBER) | (1 << ALPROTO_IRC) | (1 << ALPROTO_TLS) | + (1 << ALPROTO_SMTP)), + 23, element_ts_0, element_tc_0, + sizeof(element_ts_0) / sizeof(AppLayerProtoDetectPPTestDataElement), + sizeof(element_tc_0) / sizeof(AppLayerProtoDetectPPTestDataElement) } }; AppLayerProtoDetectPPTestDataPort ports_udp[] = { @@ -3340,7 +3359,7 @@ static int AppLayerProtoDetectTest16(void) p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3361,8 +3380,8 @@ static int AppLayerProtoDetectTest16(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(f); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(f); @@ -3434,7 +3453,7 @@ static int AppLayerProtoDetectTest17(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3455,8 +3474,8 @@ static int AppLayerProtoDetectTest17(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(f); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(f); @@ -3530,7 +3549,7 @@ static int AppLayerProtoDetectTest18(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3551,8 +3570,8 @@ static int AppLayerProtoDetectTest18(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(f); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(f); diff --git a/src/app-layer-detect-proto.h b/src/app-layer-detect-proto.h index 153efa3ff3..501f880989 100644 --- a/src/app-layer-detect-proto.h +++ b/src/app-layer-detect-proto.h @@ -136,7 +136,7 @@ int AppLayerProtoDetectDeSetup(void); * With this function you are associating/registering a string * that can be used by users to write rules, i.e. * you register the http protocol for protocol detection using - * AppLayerProtoDetectRegisterProtocol(ctx, ALPROTO_HTTP, "http"), + * AppLayerProtoDetectRegisterProtocol(ctx, ALPROTO_HTTP1, "http"), * following which you can write rules like - * alert http any any -> any any (sid:1;) * which basically matches on the HTTP protocol. diff --git a/src/app-layer-htp-file.c b/src/app-layer-htp-file.c index e5cc415c19..613e88fd3a 100644 --- a/src/app-layer-htp-file.c +++ b/src/app-layer-htp-file.c @@ -382,25 +382,24 @@ static int HTPFileParserTest01(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); @@ -447,35 +446,34 @@ static int HTPFileParserTest02(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 3 size %u <<<<\n", httplen3); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 4 size %u <<<<\n", httplen4); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); FAIL_IF(memcmp(bstr_util_strdup_to_c(tx->request_method), "POST", 4) != 0); @@ -529,45 +527,44 @@ static int HTPFileParserTest03(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 3 size %u <<<<\n", httplen3); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 4 size %u <<<<\n", httplen4); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 5 size %u <<<<\n", httplen5); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf5, httplen5); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf5, httplen5); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 6 size %u <<<<\n", httplen6); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf6, httplen6); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf6, httplen6); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); @@ -625,45 +622,44 @@ static int HTPFileParserTest04(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 3 size %u <<<<\n", httplen3); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 4 size %u <<<<\n", httplen4); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 5 size %u <<<<\n", httplen5); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf5, httplen5); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf5, httplen5); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 6 size %u <<<<\n", httplen6); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf6, httplen6); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf6, httplen6); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); @@ -711,25 +707,24 @@ static int HTPFileParserTest05(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 size %u <<<<\n", httplen1); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); @@ -786,25 +781,24 @@ static int HTPFileParserTest06(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 size %u <<<<\n", httplen1); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); @@ -851,25 +845,24 @@ static int HTPFileParserTest07(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 size %u <<<<\n", httplen1); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); FAIL_IF(memcmp(bstr_util_strdup_to_c(tx->request_method), "POST", 4) != 0); @@ -912,28 +905,28 @@ static int HTPFileParserTest08(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0); + void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f->alstate, 0); FAIL_IF_NULL(tx); - AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, tx); + AppLayerDecoderEvents *decoder_events = + AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP1, tx); FAIL_IF_NULL(decoder_events); FAIL_IF(decoder_events->cnt != 2); @@ -980,38 +973,38 @@ static int HTPFileParserTest09(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 3 size %u <<<<\n", httplen3); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 4 size %u <<<<\n", httplen4); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0); + void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f->alstate, 0); FAIL_IF_NULL(tx); - AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, tx); + AppLayerDecoderEvents *decoder_events = + AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP1, tx); FAIL_IF_NULL(decoder_events); FAIL_IF(decoder_events->cnt != 1); @@ -1056,37 +1049,37 @@ static int HTPFileParserTest10(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 3 size %u <<<<\n", httplen3); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 4 size %u <<<<\n", httplen4); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0); + void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f->alstate, 0); FAIL_IF_NULL(tx); - AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, tx); + AppLayerDecoderEvents *decoder_events = + AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP1, tx); FAIL_IF_NOT_NULL(decoder_events); AppLayerParserThreadCtxFree(alp_tctx); @@ -1157,41 +1150,39 @@ static int HTPFileParserTest11(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 2 size %u <<<<\n", httplen2); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, STREAM_TOSERVER, - httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 3 size %u <<<<\n", httplen3); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, STREAM_TOSERVER, - httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); SCLogDebug("\n>>>> processing chunk 4 size %u <<<<\n", httplen4); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); http_state = f->alstate; FAIL_IF_NULL(http_state); - void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0); + void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f->alstate, 0); FAIL_IF_NULL(txtmp); - AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, txtmp); + AppLayerDecoderEvents *decoder_events = + AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP1, txtmp); FAIL_IF_NOT_NULL(decoder_events); - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, http_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, http_state, 0); FAIL_IF_NULL(tx); FAIL_IF_NULL(tx->request_method); diff --git a/src/app-layer-htp-xff.c b/src/app-layer-htp-xff.c index e223af046e..1d60df3633 100644 --- a/src/app-layer-htp-xff.c +++ b/src/app-layer-htp-xff.c @@ -130,7 +130,7 @@ int HttpXFFGetIPFromTx(const Flow *f, uint64_t tx_id, HttpXFFCfg *xff_cfg, if (tx_id >= total_txs) return 0; - tx = AppLayerParserGetTx(f->proto, ALPROTO_HTTP, htp_state, tx_id); + tx = AppLayerParserGetTx(f->proto, ALPROTO_HTTP1, htp_state, tx_id); if (tx == NULL) { SCLogDebug("tx is NULL, XFF cannot be retrieved"); return 0; diff --git a/src/app-layer-htp.c b/src/app-layer-htp.c index 2b9e84beb6..c19a0b658f 100644 --- a/src/app-layer-htp.c +++ b/src/app-layer-htp.c @@ -1380,7 +1380,7 @@ static int HtpRequestBodyHandleMultipart(HtpState *hstate, HtpTxUserData *htud, /* we currently only handle multipart for ts. When we support it for tc, * we will need to supply right direction */ - tx_progress = AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, STREAM_TOSERVER); + tx_progress = AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, STREAM_TOSERVER); /* if we're in the file storage process, deal with that now */ if (htud->tsflags & HTP_FILENAME_SET) { if (header_start != NULL || (tx_progress > HTP_REQUEST_BODY)) { @@ -2205,7 +2205,7 @@ static int HTPCallbackResponse(htp_tx_t *tx) if (tx->request_port_number != -1) { dp = (uint16_t)tx->request_port_number; } - // both ALPROTO_HTTP and ALPROTO_TLS are normal options + // both ALPROTO_HTTP1 and ALPROTO_TLS are normal options AppLayerRequestProtocolChange(hstate->f, dp, ALPROTO_UNKNOWN); tx->request_progress = HTP_REQUEST_COMPLETE; tx->response_progress = HTP_RESPONSE_COMPLETE; @@ -3076,8 +3076,8 @@ static int HTPRegisterPatternsForProtocolDetection(void) * 3 is subtracted from the length since the spacing is hex typed as |xx| * but the pattern matching should only be one char */ - register_result = AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, - ALPROTO_HTTP, method_buffer, strlen(method_buffer)-3, 0, STREAM_TOSERVER); + register_result = AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, ALPROTO_HTTP1, + method_buffer, strlen(method_buffer) - 3, 0, STREAM_TOSERVER); if (register_result < 0) { return -1; } @@ -3086,9 +3086,8 @@ static int HTPRegisterPatternsForProtocolDetection(void) /* Loop through all the http verions patterns that are TO_CLIENT */ for (versions_pos = 0; versions[versions_pos]; versions_pos++) { - register_result = AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, - ALPROTO_HTTP, versions[versions_pos], strlen(versions[versions_pos]), - 0, STREAM_TOCLIENT); + register_result = AppLayerProtoDetectPMRegisterPatternCI(IPPROTO_TCP, ALPROTO_HTTP1, + versions[versions_pos], strlen(versions[versions_pos]), 0, STREAM_TOCLIENT); if (register_result < 0) { return -1; } @@ -3109,7 +3108,7 @@ void RegisterHTPParsers(void) /** HTTP */ if (AppLayerProtoDetectConfProtoDetectionEnabled("tcp", proto_name)) { - AppLayerProtoDetectRegisterProtocol(ALPROTO_HTTP, proto_name); + AppLayerProtoDetectRegisterProtocol(ALPROTO_HTTP1, proto_name); if (HTPRegisterPatternsForProtocolDetection() < 0) return; } else { @@ -3119,44 +3118,46 @@ void RegisterHTPParsers(void) } if (AppLayerParserConfParserEnabled("tcp", proto_name)) { - AppLayerParserRegisterStateFuncs(IPPROTO_TCP, ALPROTO_HTTP, HTPStateAlloc, HTPStateFree); - AppLayerParserRegisterTxFreeFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPStateTransactionFree); - AppLayerParserRegisterGetFilesFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetFiles); - AppLayerParserRegisterGetStateProgressFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetAlstateProgress); - AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetTxCnt); - AppLayerParserRegisterGetTx(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetTx); + AppLayerParserRegisterStateFuncs(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateAlloc, HTPStateFree); + AppLayerParserRegisterTxFreeFunc(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateTransactionFree); + AppLayerParserRegisterGetFilesFunc(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateGetFiles); + AppLayerParserRegisterGetStateProgressFunc( + IPPROTO_TCP, ALPROTO_HTTP1, HTPStateGetAlstateProgress); + AppLayerParserRegisterGetTxCnt(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateGetTxCnt); + AppLayerParserRegisterGetTx(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateGetTx); AppLayerParserRegisterStateProgressCompletionStatus( - ALPROTO_HTTP, HTP_REQUEST_COMPLETE, HTP_RESPONSE_COMPLETE); - AppLayerParserRegisterGetEventsFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPGetEvents); - AppLayerParserRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetEventInfo); - AppLayerParserRegisterGetEventInfoById(IPPROTO_TCP, ALPROTO_HTTP, HTPStateGetEventInfoById); - - AppLayerParserRegisterTruncateFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPStateTruncate); - AppLayerParserRegisterDetectStateFuncs(IPPROTO_TCP, ALPROTO_HTTP, - HTPGetTxDetectState, HTPSetTxDetectState); - AppLayerParserRegisterTxDataFunc(IPPROTO_TCP, ALPROTO_HTTP, HTPGetTxData); - - AppLayerParserRegisterSetStreamDepthFlag(IPPROTO_TCP, ALPROTO_HTTP, - AppLayerHtpSetStreamDepthFlag); - - AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_HTTP, STREAM_TOSERVER, - HTPHandleRequestData); - AppLayerParserRegisterParser(IPPROTO_TCP, ALPROTO_HTTP, STREAM_TOCLIENT, - HTPHandleResponseData); + ALPROTO_HTTP1, HTP_REQUEST_COMPLETE, HTP_RESPONSE_COMPLETE); + AppLayerParserRegisterGetEventsFunc(IPPROTO_TCP, ALPROTO_HTTP1, HTPGetEvents); + AppLayerParserRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateGetEventInfo); + AppLayerParserRegisterGetEventInfoById( + IPPROTO_TCP, ALPROTO_HTTP1, HTPStateGetEventInfoById); + + AppLayerParserRegisterTruncateFunc(IPPROTO_TCP, ALPROTO_HTTP1, HTPStateTruncate); + AppLayerParserRegisterDetectStateFuncs( + IPPROTO_TCP, ALPROTO_HTTP1, HTPGetTxDetectState, HTPSetTxDetectState); + AppLayerParserRegisterTxDataFunc(IPPROTO_TCP, ALPROTO_HTTP1, HTPGetTxData); + + AppLayerParserRegisterSetStreamDepthFlag( + IPPROTO_TCP, ALPROTO_HTTP1, AppLayerHtpSetStreamDepthFlag); + + AppLayerParserRegisterParser( + IPPROTO_TCP, ALPROTO_HTTP1, STREAM_TOSERVER, HTPHandleRequestData); + AppLayerParserRegisterParser( + IPPROTO_TCP, ALPROTO_HTTP1, STREAM_TOCLIENT, HTPHandleResponseData); SC_ATOMIC_INIT(htp_config_flags); /* This parser accepts gaps. */ AppLayerParserRegisterOptionFlags( - IPPROTO_TCP, ALPROTO_HTTP, APP_LAYER_PARSER_OPT_ACCEPT_GAPS); - AppLayerParserRegisterParserAcceptableDataDirection(IPPROTO_TCP, - ALPROTO_HTTP, STREAM_TOSERVER|STREAM_TOCLIENT); + IPPROTO_TCP, ALPROTO_HTTP1, APP_LAYER_PARSER_OPT_ACCEPT_GAPS); + AppLayerParserRegisterParserAcceptableDataDirection( + IPPROTO_TCP, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_TOCLIENT); HTPConfigure(); } else { SCLogInfo("Parsed disabled for %s protocol. Protocol detection" "still on.", proto_name); } #ifdef UNITTESTS - AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_HTTP, HTPParserRegisterTests); + AppLayerParserRegisterProtocolUnittests(IPPROTO_TCP, ALPROTO_HTTP1, HTPParserRegisterTests); #endif SCReturn; @@ -3197,7 +3198,7 @@ static int HTPParserTest01(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3212,8 +3213,7 @@ static int HTPParserTest01(void) else flags = STREAM_TOSERVER; - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); FAIL_IF(r != 0); } @@ -3253,13 +3253,12 @@ static int HTPParserTest01b(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); uint8_t flags =STREAM_TOSERVER|STREAM_START|STREAM_EOF; - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - httpbuf1, httplen1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, httpbuf1, httplen1); FAIL_IF(r != 0); HtpState *htp_state = f->alstate; @@ -3298,7 +3297,7 @@ static int HTPParserTest01c(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3313,8 +3312,7 @@ static int HTPParserTest01c(void) else flags = STREAM_TOSERVER; - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); FAIL_IF(r != 0); } @@ -3358,7 +3356,7 @@ static int HTPParserTest01a(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3374,8 +3372,7 @@ static int HTPParserTest01a(void) flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -3431,15 +3428,13 @@ static int HTPParserTest02(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); FLOWLOCK_WRLOCK(f); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(f); @@ -3494,7 +3489,7 @@ static int HTPParserTest03(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3507,8 +3502,7 @@ static int HTPParserTest03(void) else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -3563,15 +3557,13 @@ static int HTPParserTest04(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); if (r != 0) { FLOWLOCK_UNLOCK(f); goto end; @@ -3631,34 +3623,30 @@ static int HTPParserTest05(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf4, - httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf4, httplen4); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, STREAM_TOCLIENT, - httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf5, httplen5); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, STREAM_TOSERVER, - httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf3, httplen3); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, httpbuf6, httplen6); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, httpbuf6, httplen6); FAIL_IF(r != 0); HtpState *http_state = f->alstate; @@ -3737,17 +3725,15 @@ static int HTPParserTest06(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf2, - httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf2, httplen2); FAIL_IF(r != 0); HtpState *http_state = f->alstate; @@ -3791,7 +3777,7 @@ static int HTPParserTest07(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3807,8 +3793,7 @@ static int HTPParserTest07(void) flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -3898,7 +3883,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3906,8 +3891,7 @@ libhtp:\n\ flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, httpbuf1, - httplen1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk returned %" PRId32 ", expected" " 0: ", r); @@ -3984,7 +3968,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3992,8 +3976,7 @@ libhtp:\n\ flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, httpbuf1, - httplen1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk returned %" PRId32 ", expected" " 0: ", r); @@ -4051,7 +4034,7 @@ static int HTPParserTest10(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4067,8 +4050,7 @@ static int HTPParserTest10(void) flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -4143,7 +4125,7 @@ static int HTPParserTest11(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4159,8 +4141,7 @@ static int HTPParserTest11(void) flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -4228,7 +4209,7 @@ static int HTPParserTest12(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4244,8 +4225,7 @@ static int HTPParserTest12(void) flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -4316,7 +4296,7 @@ static int HTPParserTest13(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4332,8 +4312,7 @@ static int HTPParserTest13(void) flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -4716,7 +4695,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; htp_cfg_t *htp = cfglist.cfg; @@ -4743,8 +4722,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -4913,7 +4891,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4926,8 +4904,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5082,7 +5059,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5095,8 +5072,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5249,7 +5225,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5262,8 +5238,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5386,7 +5361,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5399,8 +5374,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5496,7 +5470,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5509,8 +5483,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5606,7 +5579,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5619,8 +5592,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5717,7 +5689,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5730,8 +5702,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5825,7 +5796,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5838,8 +5809,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -5934,7 +5904,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5947,8 +5917,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - &httpbuf1[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, &httpbuf1[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -6096,15 +6065,14 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); SCLogDebug("\n>>>> processing chunk 1 <<<<\n"); FLOWLOCK_WRLOCK(f); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(f); @@ -6113,8 +6081,7 @@ libhtp:\n\ FLOWLOCK_UNLOCK(f); SCLogDebug("\n>>>> processing chunk 1 again <<<<\n"); FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, STREAM_TOSERVER, - httpbuf1, httplen1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(f); @@ -6202,7 +6169,7 @@ libhtp:\n\ Flow *f = UTHBuildFlow(AF_INET, "1.2.3.4", "1.2.3.5", 1024, 80); FAIL_IF_NULL(f); f->protoctx = &ssn; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; f->proto = IPPROTO_TCP; StreamTcpInitConfig(TRUE); @@ -6215,8 +6182,8 @@ libhtp:\n\ else if (u == (len - 1)) flags = STREAM_TOSERVER|STREAM_EOF; else flags = STREAM_TOSERVER; - (void)AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - (uint8_t *)&httpbuf[u], 1); + (void)AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, flags, (uint8_t *)&httpbuf[u], 1); } HtpState *htp_state = f->alstate; FAIL_IF_NULL(htp_state); @@ -6226,8 +6193,9 @@ libhtp:\n\ FAIL_IF(tx->request_method_number != HTP_M_GET); FAIL_IF(tx->request_protocol_number != HTP_PROTOCOL_1_1); - void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0); - AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, txtmp); + void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f->alstate, 0); + AppLayerDecoderEvents *decoder_events = + AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP1, txtmp); FAIL_IF_NULL(decoder_events); FAIL_IF(decoder_events->events[0] != HTTP_DECODER_EVENT_REQUEST_FIELD_TOO_LONG); @@ -6305,7 +6273,7 @@ libhtp:\n\ goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6318,8 +6286,7 @@ libhtp:\n\ else flags = STREAM_TOSERVER; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - (uint8_t *)&httpbuf[u], 1); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, (uint8_t *)&httpbuf[u], 1); if (r != 0) { printf("toserver chunk %" PRIu32 " returned %" PRId32 ", expected" " 0: ", u, r); @@ -6344,8 +6311,9 @@ libhtp:\n\ } FLOWLOCK_WRLOCK(f); - void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0); - AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, txtmp); + void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f->alstate, 0); + AppLayerDecoderEvents *decoder_events = + AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP1, txtmp); if (decoder_events != NULL) { printf("app events: "); FLOWLOCK_UNLOCK(f); @@ -6395,15 +6363,14 @@ static int HTPParserTest16(void) goto end; f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); uint8_t flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF; FLOWLOCK_WRLOCK(f); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, flags, - (uint8_t *)httpbuf, len); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, flags, (uint8_t *)httpbuf, len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(f); @@ -6429,8 +6396,9 @@ static int HTPParserTest16(void) #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION //these events are disabled during fuzzing as they are too noisy and consume much resource FLOWLOCK_WRLOCK(f); - void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP,f->alstate, 0); - AppLayerDecoderEvents *decoder_events = AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP, txtmp); + void *txtmp = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f->alstate, 0); + AppLayerDecoderEvents *decoder_events = + AppLayerParserGetEventsByTx(IPPROTO_TCP, ALPROTO_HTTP1, txtmp); if (decoder_events == NULL) { printf("no app events: "); FLOWLOCK_UNLOCK(f); @@ -6482,23 +6450,20 @@ static int HTPParserTest20(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf2, - httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf2, httplen2); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf3, - httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf3, httplen3); FAIL_IF(r != 0); http_state = f->alstate; @@ -6544,23 +6509,20 @@ static int HTPParserTest21(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf2, - httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf2, httplen2); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf3, - httplen3); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf3, httplen3); FAIL_IF(r != 0); http_state = f->alstate; @@ -6605,18 +6567,16 @@ static int HTPParserTest22(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf2, - httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf2, httplen2); FAIL_IF(r != 0); http_state = f->alstate; @@ -6661,18 +6621,16 @@ static int HTPParserTest23(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf2, - httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf2, httplen2); FAIL_IF(r != 0); http_state = f->alstate; @@ -6717,18 +6675,16 @@ static int HTPParserTest24(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, httpbuf2, - httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, httpbuf2, httplen2); FAIL_IF(r != 0); http_state = f->alstate; @@ -6764,58 +6720,58 @@ static int HTPParserTest25(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; const char *str = "GET / HTTP/1.1\r\nHost: www.google.com\r\nUser-Agent: Suricata/1.0\r\n\r\n"; - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, (uint8_t *)str, strlen(str)); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); str = "HTTP 1.1 200 OK\r\nServer: Suricata/1.0\r\nContent-Length: 8\r\n\r\nSuricata"; - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT, (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); AppLayerParserTransactionsCleanup(f); @@ -6827,8 +6783,8 @@ static int HTPParserTest25(void) FAIL_IF_NOT(ret[2] == 8); // log_id FAIL_IF_NOT(ret[3] == 8); // min_id - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, + (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); AppLayerParserTransactionsCleanup(f); @@ -6838,8 +6794,8 @@ static int HTPParserTest25(void) FAIL_IF_NOT(ret[2] == 8); // log_id FAIL_IF_NOT(ret[3] == 8); // min_id - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, (uint8_t *)str, strlen(str)); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, + (uint8_t *)str, strlen(str)); FAIL_IF_NOT(r == 0); AppLayerParserTransactionsCleanup(f); @@ -6918,7 +6874,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6934,10 +6890,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, - httplen1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); http_state = f.alstate; @@ -6953,9 +6907,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, - httplen2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); FAIL_IF(r != 0); http_state = f.alstate; @@ -6966,9 +6919,8 @@ libhtp:\n\ FAIL_IF(!(PacketAlertCheck(p2, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf3, - httplen3); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf3, httplen3); FAIL_IF(r != 0); http_state = f.alstate; diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 4a5c03abe8..cf17f012c2 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -1141,8 +1141,8 @@ uint64_t AppLayerParserGetTransactionActive(const Flow *f, int AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto) { // Custom case for only signature-only protocol so far - if (alproto == ALPROTO_HTTP_ANY) { - return AppLayerParserSupportsFiles(ipproto, ALPROTO_HTTP) || + if (alproto == ALPROTO_HTTP) { + return AppLayerParserSupportsFiles(ipproto, ALPROTO_HTTP1) || AppLayerParserSupportsFiles(ipproto, ALPROTO_HTTP2); } if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].StateGetFiles != NULL) diff --git a/src/app-layer-protos.c b/src/app-layer-protos.c index de8f0dd270..f554bf5740 100644 --- a/src/app-layer-protos.c +++ b/src/app-layer-protos.c @@ -33,7 +33,7 @@ const char *AppProtoToString(AppProto alproto) enum AppProtoEnum proto = alproto; switch (proto) { - case ALPROTO_HTTP: + case ALPROTO_HTTP1: proto_name = "http"; break; case ALPROTO_FTP: @@ -120,7 +120,7 @@ const char *AppProtoToString(AppProto alproto) case ALPROTO_HTTP2: proto_name = "http2"; break; - case ALPROTO_HTTP_ANY: + case ALPROTO_HTTP: proto_name = "http_any"; break; case ALPROTO_FAILED: @@ -142,9 +142,9 @@ AppProto StringToAppProto(const char *proto_name) if (proto_name == NULL) return ALPROTO_UNKNOWN; if (strcmp(proto_name, "http") == 0) - return ALPROTO_HTTP_ANY; - if (strcmp(proto_name, "http1") == 0) return ALPROTO_HTTP; + if (strcmp(proto_name, "http1") == 0) + return ALPROTO_HTTP1; if (strcmp(proto_name,"ftp")==0) return ALPROTO_FTP; if (strcmp(proto_name, "ftp-data") == 0) return ALPROTO_FTPDATA; diff --git a/src/app-layer-protos.h b/src/app-layer-protos.h index f5f41959fe..29e21b0226 100644 --- a/src/app-layer-protos.h +++ b/src/app-layer-protos.h @@ -27,7 +27,7 @@ enum AppProtoEnum { ALPROTO_UNKNOWN = 0, - ALPROTO_HTTP, + ALPROTO_HTTP1, ALPROTO_FTP, ALPROTO_SMTP, ALPROTO_TLS, /* SSLv2, SSLv3 & TLSv1 */ @@ -59,8 +59,8 @@ enum AppProtoEnum { ALPROTO_HTTP2, // signature-only (ie not seen in flow) - // HTTP for any version (ALPROTO_HTTP (version 1) or ALPROTO_HTTP2) - ALPROTO_HTTP_ANY, + // HTTP for any version (ALPROTO_HTTP1 (version 1) or ALPROTO_HTTP2) + ALPROTO_HTTP, /* used by the probing parser when alproto detection fails * permanently for that particular stream */ @@ -85,9 +85,9 @@ static inline bool AppProtoIsValid(AppProto a) static inline bool AppProtoEquals(AppProto sigproto, AppProto alproto) { switch (sigproto) { - case ALPROTO_HTTP_ANY: - return (alproto == ALPROTO_HTTP) || (alproto == ALPROTO_HTTP2) || - (alproto == ALPROTO_HTTP_ANY); + case ALPROTO_HTTP: + return (alproto == ALPROTO_HTTP1) || (alproto == ALPROTO_HTTP2) || + (alproto == ALPROTO_HTTP); } return (sigproto == alproto); } diff --git a/src/app-layer.c b/src/app-layer.c index 4c4a65cc22..291595d15e 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -1194,8 +1194,8 @@ static int AppLayerTest01(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1214,9 +1214,9 @@ static int AppLayerTest01(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -1360,8 +1360,8 @@ static int AppLayerTest02(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1380,9 +1380,9 @@ static int AppLayerTest02(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -1485,8 +1485,8 @@ static int AppLayerTest03(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1505,8 +1505,8 @@ static int AppLayerTest03(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); FAIL_IF(f.alproto_tc != ALPROTO_FAILED); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1571,8 +1571,8 @@ static int AppLayerTest04(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); // toserver complete - FAIL_IF(f.alproto != ALPROTO_HTTP); // http based on ts - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); // ts complete + FAIL_IF(f.alproto != ALPROTO_HTTP1); // http based on ts + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); // ts complete FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1591,8 +1591,8 @@ static int AppLayerTest04(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); // toserver complete - FAIL_IF(f.alproto != ALPROTO_HTTP); // http based on ts - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); // ts complete + FAIL_IF(f.alproto != ALPROTO_HTTP1); // http based on ts + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); // ts complete FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1654,8 +1654,8 @@ static int AppLayerTest04(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); // toserver complete - FAIL_IF(f.alproto != ALPROTO_HTTP); // http based on ts - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); // ts complete + FAIL_IF(f.alproto != ALPROTO_HTTP1); // http based on ts + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); // ts complete FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1674,8 +1674,8 @@ static int AppLayerTest04(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); // toclient complete (failed) FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); // toserver complete - FAIL_IF(f.alproto != ALPROTO_HTTP); // http based on ts - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); // ts complete + FAIL_IF(f.alproto != ALPROTO_HTTP1); // http based on ts + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); // ts complete FAIL_IF(f.alproto_tc != ALPROTO_FAILED); // tc failed FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -1801,9 +1801,9 @@ static int AppLayerTest05(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); FAIL_IF(f.alproto_ts != ALPROTO_FAILED); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -1906,9 +1906,9 @@ static int AppLayerTest06(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED)); FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -1925,9 +1925,9 @@ static int AppLayerTest06(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED)); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2030,8 +2030,8 @@ static int AppLayerTest07(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -2050,8 +2050,8 @@ static int AppLayerTest07(void) FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); FAIL_IF(f.alproto_tc != ALPROTO_DCERPC); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -2177,7 +2177,7 @@ static int AppLayerTest08(void) FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); FAIL_IF(f.alproto != ALPROTO_DCERPC); FAIL_IF(f.alproto_ts != ALPROTO_DCERPC); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(!(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED)); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index 3644978033..81202e2e29 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -239,9 +239,9 @@ static int DetectAppLayerEventParseAppP2(DetectAppLayerEventData *data, static AppProto AppLayerEventGetProtoByName(char *alproto_name) { AppProto alproto = AppLayerGetProtoByName(alproto_name); - if (alproto == ALPROTO_HTTP_ANY) { + if (alproto == ALPROTO_HTTP) { // app-layer events http refer to http1 - alproto = ALPROTO_HTTP; + alproto = ALPROTO_HTTP1; } return alproto; } @@ -490,8 +490,8 @@ static int DetectAppLayerEventTest02(void) AppLayerParserRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_SMTP, DetectAppLayerEventTestGetEventInfo); - AppLayerParserRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_HTTP, - DetectAppLayerEventTestGetEventInfo); + AppLayerParserRegisterGetEventInfo( + IPPROTO_TCP, ALPROTO_HTTP1, DetectAppLayerEventTestGetEventInfo); AppLayerParserRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_SMB, DetectAppLayerEventTestGetEventInfo); AppLayerParserRegisterGetEventInfo(IPPROTO_TCP, ALPROTO_FTP, @@ -520,7 +520,7 @@ static int DetectAppLayerEventTest02(void) &event_type); FAIL_IF_NULL(aled); FAIL_IF(DetectAppLayerEventParseAppP2(aled, ipproto_bitarray, &event_type) < 0); - FAIL_IF(aled->alproto != ALPROTO_HTTP); + FAIL_IF(aled->alproto != ALPROTO_HTTP1); FAIL_IF(aled->event_id != APP_LAYER_EVENT_TEST_MAP_EVENT2); aled = DetectAppLayerEventParse("smb.event3", diff --git a/src/detect-app-layer-protocol.c b/src/detect-app-layer-protocol.c index 3dc4e55219..569d35253b 100644 --- a/src/detect-app-layer-protocol.c +++ b/src/detect-app-layer-protocol.c @@ -290,7 +290,7 @@ static int DetectAppLayerProtocolTest01(void) { DetectAppLayerProtocolData *data = DetectAppLayerProtocolParse("http", false); FAIL_IF_NULL(data); - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated != 0); DetectAppLayerProtocolFree(NULL, data); PASS; @@ -300,7 +300,7 @@ static int DetectAppLayerProtocolTest02(void) { DetectAppLayerProtocolData *data = DetectAppLayerProtocolParse("http", true); FAIL_IF_NULL(data); - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated == 0); DetectAppLayerProtocolFree(NULL, data); PASS; @@ -324,7 +324,7 @@ static int DetectAppLayerProtocolTest03(void) FAIL_IF_NULL(s->sm_lists[DETECT_SM_LIST_MATCH]->ctx); data = (DetectAppLayerProtocolData *)s->sm_lists[DETECT_SM_LIST_MATCH]->ctx; - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated); DetectEngineCtxFree(de_ctx); PASS; @@ -349,7 +349,7 @@ static int DetectAppLayerProtocolTest04(void) data = (DetectAppLayerProtocolData*)s->sm_lists[DETECT_SM_LIST_MATCH]->ctx; FAIL_IF_NULL(data); - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated == 0); DetectEngineCtxFree(de_ctx); @@ -375,7 +375,7 @@ static int DetectAppLayerProtocolTest05(void) data = (DetectAppLayerProtocolData*)s->sm_lists[DETECT_SM_LIST_MATCH]->ctx; FAIL_IF_NULL(data); - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated == 0); data = (DetectAppLayerProtocolData*)s->sm_lists[DETECT_SM_LIST_MATCH]->next->ctx; @@ -515,7 +515,7 @@ static int DetectAppLayerProtocolTest14(void) FAIL_IF_NULL(s1->sm_lists[DETECT_SM_LIST_MATCH]); FAIL_IF_NULL(s1->sm_lists[DETECT_SM_LIST_MATCH]->ctx); data = (DetectAppLayerProtocolData *)s1->sm_lists[DETECT_SM_LIST_MATCH]->ctx; - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated); Signature *s2 = DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any " @@ -525,7 +525,7 @@ static int DetectAppLayerProtocolTest14(void) FAIL_IF_NULL(s2->sm_lists[DETECT_SM_LIST_MATCH]); FAIL_IF_NULL(s2->sm_lists[DETECT_SM_LIST_MATCH]->ctx); data = (DetectAppLayerProtocolData *)s2->sm_lists[DETECT_SM_LIST_MATCH]->ctx; - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated); /* flow:established and other options not supported for PD-only */ @@ -536,7 +536,7 @@ static int DetectAppLayerProtocolTest14(void) FAIL_IF_NULL(s3->sm_lists[DETECT_SM_LIST_MATCH]); FAIL_IF_NULL(s3->sm_lists[DETECT_SM_LIST_MATCH]->ctx); data = (DetectAppLayerProtocolData *)s3->sm_lists[DETECT_SM_LIST_MATCH]->ctx; - FAIL_IF(data->alproto != ALPROTO_HTTP_ANY); + FAIL_IF(data->alproto != ALPROTO_HTTP); FAIL_IF(data->negated); SigGroupBuild(de_ctx); diff --git a/src/detect-bypass.c b/src/detect-bypass.c index 4ef981d78f..9cbbf56c6a 100644 --- a/src/detect-bypass.c +++ b/src/detect-bypass.c @@ -175,7 +175,7 @@ static int DetectBypassTestSig01(void) p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p2->livedev = livedev; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -202,8 +202,8 @@ static int DetectBypassTestSig01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -216,8 +216,8 @@ static int DetectBypassTestSig01(void) FAIL_IF(PacketAlertCheck(p1, 1)); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, - http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); /* do detect */ diff --git a/src/detect-engine-analyzer.c b/src/detect-engine-analyzer.c index c44dc5cdfd..4792949917 100644 --- a/src/detect-engine-analyzer.c +++ b/src/detect-engine-analyzer.c @@ -1097,8 +1097,7 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx, if (rule_content_http > 0 && rule_pcre > 0 && rule_pcre_http == 0) { rule_warning += 1; warn_pcre_http_content = 1; - } - else if (s->alproto == ALPROTO_HTTP && rule_pcre > 0 && rule_pcre_http == 0) { + } else if (s->alproto == ALPROTO_HTTP1 && rule_pcre > 0 && rule_pcre_http == 0) { rule_warning += 1; warn_pcre_http = 1; } @@ -1107,7 +1106,7 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx, rule_warning += 1; warn_content_http_content = 1; } - if (s->alproto == ALPROTO_HTTP && rule_content > 0 && rule_content_http == 0) { + if (s->alproto == ALPROTO_HTTP1 && rule_content > 0 && rule_content_http == 0) { rule_warning += 1; warn_content_http = 1; } @@ -1155,8 +1154,8 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx, rule_warning += 1; warn_offset_depth_alproto = 1; } - if (s->init_data->mpm_sm != NULL && s->alproto == ALPROTO_HTTP && - SigMatchListSMBelongsTo(s, s->init_data->mpm_sm) == DETECT_SM_LIST_PMATCH) { + if (s->init_data->mpm_sm != NULL && s->alproto == ALPROTO_HTTP1 && + SigMatchListSMBelongsTo(s, s->init_data->mpm_sm) == DETECT_SM_LIST_PMATCH) { rule_warning += 1; warn_non_alproto_fp_for_alproto_sig = 1; } @@ -1216,7 +1215,7 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx, fprintf(rule_engine_analysis_FD, " Warning: Rule uses content options with http_* and pcre options without http modifiers.\n" " -Consider adding http pcre modifier.\n"); } - else if (warn_pcre_http /*s->alproto == ALPROTO_HTTP && rule_pcre > 0 && rule_pcre_http == 0*/) { + else if (warn_pcre_http /*s->alproto == ALPROTO_HTTP1 && rule_pcre > 0 && rule_pcre_http == 0*/) { fprintf(rule_engine_analysis_FD, " Warning: Rule app layer protocol is http, but pcre options do not have http modifiers.\n" " -Consider adding http pcre modifiers.\n"); } @@ -1224,7 +1223,7 @@ void EngineAnalysisRules(const DetectEngineCtx *de_ctx, fprintf(rule_engine_analysis_FD, " Warning: Rule contains content with http_* and content without http_*.\n" " -Consider adding http content modifiers.\n"); } - if (warn_content_http /*s->alproto == ALPROTO_HTTP && rule_content > 0 && rule_content_http == 0*/) { + if (warn_content_http /*s->alproto == ALPROTO_HTTP1 && rule_content > 0 && rule_content_http == 0*/) { fprintf(rule_engine_analysis_FD, " Warning: Rule app layer protocol is http, but content options do not have http_* modifiers.\n" " -Consider adding http content modifiers.\n"); } diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index e247730fe2..ac32a95b73 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -71,7 +71,7 @@ static inline int StateIsValid(uint16_t alproto, void *alstate) { if (alstate != NULL) { - if (alproto == ALPROTO_HTTP) { + if (alproto == ALPROTO_HTTP1) { HtpState *htp_state = (HtpState *)alstate; if (htp_state->conn != NULL) { return 1; @@ -420,7 +420,7 @@ static int DeStateSigTest01(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flow = &f; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; @@ -440,26 +440,23 @@ static int DeStateSigTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FAIL_IF_NULL(det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF_NOT(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -513,7 +510,7 @@ static int DeStateSigTest02(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -531,54 +528,48 @@ static int DeStateSigTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FAIL_IF_NULL(det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, f.alstate, 0); + void *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, f.alstate, 0); FAIL_IF_NULL(tx); - DetectEngineState *tx_de_state = AppLayerParserGetTxDetectState(IPPROTO_TCP, ALPROTO_HTTP, tx); + DetectEngineState *tx_de_state = AppLayerParserGetTxDetectState(IPPROTO_TCP, ALPROTO_HTTP1, tx); FAIL_IF_NULL(tx_de_state); FAIL_IF(tx_de_state->dir_state[0].cnt != 1); /* http_header(mpm): 5, uri: 3, method: 6, cookie: 7 */ uint32_t expected_flags = (BIT_U32(5) | BIT_U32(3) | BIT_U32(6) |BIT_U32(7)); FAIL_IF(tx_de_state->dir_state[0].head->store[0].flags != expected_flags); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(!(PacketAlertCheck(p, 1))); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF((PacketAlertCheck(p, 1)) || (PacketAlertCheck(p, 2))); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf7, httplen7); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf7, httplen7); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(!(PacketAlertCheck(p, 2))); @@ -632,7 +623,7 @@ static int DeStateSigTest03(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -644,10 +635,8 @@ static int DeStateSigTest03(void) StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); FAIL_IF(r != 0); HtpState *http_state = f->alstate; @@ -712,7 +701,7 @@ static int DeStateSigTest04(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -723,9 +712,8 @@ static int DeStateSigTest04(void) StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, httplen1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -787,7 +775,7 @@ static int DeStateSigTest05(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -798,10 +786,8 @@ static int DeStateSigTest05(void) StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -864,7 +850,7 @@ static int DeStateSigTest06(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -875,10 +861,8 @@ static int DeStateSigTest06(void) StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -941,7 +925,7 @@ static int DeStateSigTest07(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -952,15 +936,14 @@ static int DeStateSigTest07(void) StreamTcpInitConfig(TRUE); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf2, httplen2); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -1036,7 +1019,7 @@ static int DeStateSigTest08(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -1049,15 +1032,13 @@ static int DeStateSigTest08(void) /* HTTP request with 1st part of the multipart body */ - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -1074,14 +1055,13 @@ static int DeStateSigTest08(void) /* 2nd multipart body file */ - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF_NOT(PacketAlertCheck(p, 1)); @@ -1159,7 +1139,7 @@ static int DeStateSigTest09(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -1172,15 +1152,13 @@ static int DeStateSigTest09(void) /* HTTP request with 1st part of the multipart body */ - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF_NOT(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -1197,14 +1175,13 @@ static int DeStateSigTest09(void) /* 2nd multipart body file */ - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF_NOT(PacketAlertCheck(p, 1)); @@ -1280,7 +1257,7 @@ static int DeStateSigTest10(void) FAIL_IF_NULL(f); f->protoctx = &ssn; f->proto = IPPROTO_TCP; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; Packet *p = UTHBuildPacket(NULL, 0, IPPROTO_TCP); FAIL_IF_NULL(p); @@ -1293,15 +1270,13 @@ static int DeStateSigTest10(void) /* HTTP request with 1st part of the multipart body */ - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF_NOT(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); @@ -1318,14 +1293,13 @@ static int DeStateSigTest10(void) /* 2nd multipart body file */ - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_EOF, httpbuf4, httplen4); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF_NOT(PacketAlertCheck(p, 1)); diff --git a/src/detect-file-data.c b/src/detect-file-data.c index d38e8eec81..4ddfdc1583 100644 --- a/src/detect-file-data.c +++ b/src/detect-file-data.c @@ -99,10 +99,8 @@ void DetectFiledataRegister(void) DetectAppLayerMpmRegister2("file_data", SIG_FLAG_TOSERVER, 2, PrefilterMpmFiledataRegister, NULL, ALPROTO_SMTP, 0); - DetectAppLayerMpmRegister2("file_data", SIG_FLAG_TOCLIENT, 2, - PrefilterGenericMpmRegister, - HttpServerBodyGetDataCallback, - ALPROTO_HTTP, HTP_RESPONSE_BODY); + DetectAppLayerMpmRegister2("file_data", SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister, + HttpServerBodyGetDataCallback, ALPROTO_HTTP1, HTP_RESPONSE_BODY); DetectAppLayerMpmRegister2("file_data", SIG_FLAG_TOSERVER, 2, PrefilterMpmFiledataRegister, NULL, ALPROTO_SMB, 0); @@ -124,7 +122,7 @@ void DetectFiledataRegister(void) DetectAppLayerMpmRegister2( "file_data", SIG_FLAG_TOCLIENT, 2, PrefilterMpmFiledataRegister, NULL, ALPROTO_FTP, 0); - DetectAppLayerInspectEngineRegister2("file_data", ALPROTO_HTTP, SIG_FLAG_TOCLIENT, + DetectAppLayerInspectEngineRegister2("file_data", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, HTP_RESPONSE_BODY, DetectEngineInspectBufferHttpBody, HttpServerBodyGetDataCallback); DetectAppLayerInspectEngineRegister2("file_data", ALPROTO_SMTP, SIG_FLAG_TOSERVER, 0, @@ -239,11 +237,11 @@ static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, } if (flags & STREAM_TOSERVER) { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > HTP_REQUEST_BODY) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } else { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > HTP_RESPONSE_BODY) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } @@ -266,15 +264,15 @@ static int DetectFiledataSetup (DetectEngineCtx *de_ctx, Signature *s, const cha SCEnter(); if (!DetectProtoContainsProto(&s->proto, IPPROTO_TCP) || - (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_HTTP && + (s->alproto != ALPROTO_UNKNOWN && s->alproto != ALPROTO_HTTP1 && s->alproto != ALPROTO_SMTP && s->alproto != ALPROTO_SMB && s->alproto != ALPROTO_HTTP2 && s->alproto != ALPROTO_FTP && - s->alproto != ALPROTO_FTPDATA && s->alproto != ALPROTO_HTTP_ANY)) { + s->alproto != ALPROTO_FTPDATA && s->alproto != ALPROTO_HTTP)) { SCLogError(SC_ERR_CONFLICTING_RULE_KEYWORDS, "rule contains conflicting keywords."); return -1; } - if ((s->alproto == ALPROTO_HTTP || s->alproto == ALPROTO_HTTP_ANY) && + if ((s->alproto == ALPROTO_HTTP1 || s->alproto == ALPROTO_HTTP) && (s->init_data->init_flags & SIG_FLAG_INIT_FLOW) && (s->flags & SIG_FLAG_TOSERVER) && !(s->flags & SIG_FLAG_TOCLIENT)) { SCLogError(SC_ERR_INVALID_SIGNATURE, "Can't use file_data with " @@ -300,8 +298,8 @@ static int DetectFiledataSetup (DetectEngineCtx *de_ctx, Signature *s, const cha static void DetectFiledataSetupCallback(const DetectEngineCtx *de_ctx, Signature *s) { - if (s->alproto == ALPROTO_HTTP || s->alproto == ALPROTO_UNKNOWN || - s->alproto == ALPROTO_HTTP_ANY) { + if (s->alproto == ALPROTO_HTTP1 || s->alproto == ALPROTO_UNKNOWN || + s->alproto == ALPROTO_HTTP) { AppLayerHtpEnableResponseBodyCallback(); } @@ -356,22 +354,24 @@ static InspectionBuffer *HttpServerBodyGetDataCallback(DetectEngineThreadCtx *de return NULL; } - SCLogDebug("response.body_limit %u response_body.content_len_so_far %"PRIu64 - ", response.inspect_min_size %"PRIu32", EOF %s, progress > body? %s", - htp_state->cfg->response.body_limit, - body->content_len_so_far, - htp_state->cfg->response.inspect_min_size, - flags & STREAM_EOF ? "true" : "false", - (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) > HTP_RESPONSE_BODY) ? "true" : "false"); + SCLogDebug("response.body_limit %u response_body.content_len_so_far %" PRIu64 + ", response.inspect_min_size %" PRIu32 ", EOF %s, progress > body? %s", + htp_state->cfg->response.body_limit, body->content_len_so_far, + htp_state->cfg->response.inspect_min_size, flags & STREAM_EOF ? "true" : "false", + (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) > + HTP_RESPONSE_BODY) + ? "true" + : "false"); if (!htp_state->cfg->http_body_inline) { /* inspect the body if the transfer is complete or we have hit * our body size limit */ if ((htp_state->cfg->response.body_limit == 0 || - body->content_len_so_far < htp_state->cfg->response.body_limit) && - body->content_len_so_far < htp_state->cfg->response.inspect_min_size && - !(AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) > HTP_RESPONSE_BODY) && - !(flags & STREAM_EOF)) { + body->content_len_so_far < htp_state->cfg->response.body_limit) && + body->content_len_so_far < htp_state->cfg->response.inspect_min_size && + !(AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) > + HTP_RESPONSE_BODY) && + !(flags & STREAM_EOF)) { SCLogDebug("we still haven't seen the entire response body. " "Let's defer body inspection till we see the " "entire body."); diff --git a/src/detect-filemagic.c b/src/detect-filemagic.c index 2f3c23a3b4..806c391fad 100644 --- a/src/detect-filemagic.c +++ b/src/detect-filemagic.c @@ -126,10 +126,10 @@ void DetectFilemagicRegister(void) g_file_match_list_id = DetectBufferTypeRegister("files"); - AppProto protos_ts[] = { - ALPROTO_HTTP, ALPROTO_SMTP, ALPROTO_FTP, ALPROTO_SMB, ALPROTO_NFS, ALPROTO_HTTP2, 0 }; - AppProto protos_tc[] = { - ALPROTO_HTTP, ALPROTO_FTP, ALPROTO_SMB, ALPROTO_NFS, ALPROTO_HTTP2, 0 }; + AppProto protos_ts[] = { ALPROTO_HTTP1, ALPROTO_SMTP, ALPROTO_FTP, ALPROTO_SMB, ALPROTO_NFS, + ALPROTO_HTTP2, 0 }; + AppProto protos_tc[] = { ALPROTO_HTTP1, ALPROTO_FTP, ALPROTO_SMB, ALPROTO_NFS, ALPROTO_HTTP2, + 0 }; for (int i = 0; protos_ts[i] != 0; i++) { DetectAppLayerInspectEngineRegister2("file.magic", protos_ts[i], diff --git a/src/detect-filename.c b/src/detect-filename.c index 301f51ea94..f990f0dcda 100644 --- a/src/detect-filename.c +++ b/src/detect-filename.c @@ -97,9 +97,9 @@ void DetectFilenameRegister(void) sigmatch_table[DETECT_FILE_NAME].Setup = DetectFilenameSetupSticky; sigmatch_table[DETECT_FILE_NAME].flags = SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("files", ALPROTO_HTTP, SIG_FLAG_TOSERVER, HTP_REQUEST_BODY, - DetectFileInspectGeneric, NULL); - DetectAppLayerInspectEngineRegister2("files", ALPROTO_HTTP, SIG_FLAG_TOCLIENT, + DetectAppLayerInspectEngineRegister2("files", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_BODY, DetectFileInspectGeneric, NULL); + DetectAppLayerInspectEngineRegister2("files", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, HTP_RESPONSE_BODY, DetectFileInspectGeneric, NULL); DetectAppLayerInspectEngineRegister2( @@ -128,9 +128,9 @@ void DetectFilenameRegister(void) g_file_match_list_id = DetectBufferTypeGetByName("files"); - AppProto protos_ts[] = { ALPROTO_HTTP, ALPROTO_SMTP, ALPROTO_FTP, ALPROTO_FTPDATA, ALPROTO_SMB, + AppProto protos_ts[] = { ALPROTO_HTTP1, ALPROTO_SMTP, ALPROTO_FTP, ALPROTO_FTPDATA, ALPROTO_SMB, ALPROTO_NFS, 0 }; - AppProto protos_tc[] = { ALPROTO_HTTP, ALPROTO_FTP, ALPROTO_FTPDATA, ALPROTO_SMB, ALPROTO_NFS, + AppProto protos_tc[] = { ALPROTO_HTTP1, ALPROTO_FTP, ALPROTO_FTPDATA, ALPROTO_SMB, ALPROTO_NFS, 0 }; for (int i = 0; protos_ts[i] != 0; i++) { diff --git a/src/detect-filestore.c b/src/detect-filestore.c index cf995a6920..937a90fdaa 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -152,7 +152,7 @@ static int FilestorePostMatchWithOptions(Packet *p, Flow *f, const DetectFilesto FileStoreFileById(fc, file_id); } else if (this_tx) { /* flag tx all files will be stored */ - if (f->alproto == ALPROTO_HTTP && f->alstate != NULL) { + if (f->alproto == ALPROTO_HTTP1 && f->alstate != NULL) { HtpState *htp_state = f->alstate; if (toserver_dir) { htp_state->flags |= HTP_FLAG_STORE_FILES_TX_TS; @@ -166,7 +166,7 @@ static int FilestorePostMatchWithOptions(Packet *p, Flow *f, const DetectFilesto } } else if (this_flow) { /* flag flow all files will be stored */ - if (f->alproto == ALPROTO_HTTP && f->alstate != NULL) { + if (f->alproto == ALPROTO_HTTP1 && f->alstate != NULL) { HtpState *htp_state = f->alstate; if (toserver_dir) { htp_state->flags |= HTP_FLAG_STORE_FILES_TS; @@ -455,7 +455,7 @@ static int DetectFilestoreSetup (DetectEngineCtx *de_ctx, Signature *s, const ch sm->ctx = (SigMatchCtx*)NULL; } - if (s->alproto == ALPROTO_HTTP || s->alproto == ALPROTO_HTTP_ANY) { + if (s->alproto == ALPROTO_HTTP1 || s->alproto == ALPROTO_HTTP) { AppLayerHtpNeedFileInspection(); } diff --git a/src/detect-http-client-body.c b/src/detect-http-client-body.c index cacc3ed6a9..749ea4485e 100644 --- a/src/detect-http-client-body.c +++ b/src/detect-http-client-body.c @@ -98,14 +98,12 @@ void DetectHttpClientBodyRegister(void) sigmatch_table[DETECT_HTTP_REQUEST_BODY].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_HTTP_REQUEST_BODY].flags |= SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_client_body", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_BODY, - DetectEngineInspectBufferGeneric, - HttpClientBodyGetDataCallback); + DetectAppLayerInspectEngineRegister2("http_client_body", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_BODY, DetectEngineInspectBufferGeneric, HttpClientBodyGetDataCallback); DetectAppLayerMpmRegister2("http_client_body", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, HttpClientBodyGetDataCallback, - ALPROTO_HTTP, HTP_REQUEST_BODY); + PrefilterGenericMpmRegister, HttpClientBodyGetDataCallback, ALPROTO_HTTP1, + HTP_REQUEST_BODY); DetectBufferTypeSetDescriptionByName("http_client_body", "http request body"); @@ -141,10 +139,8 @@ static void DetectHttpClientBodySetupCallback(const DetectEngineCtx *de_ctx, */ int DetectHttpClientBodySetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_CLIENT_BODY, - g_http_client_body_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, DETECT_AL_HTTP_CLIENT_BODY, + g_http_client_body_buffer_id, ALPROTO_HTTP1); } /** @@ -160,7 +156,7 @@ static int DetectHttpClientBodySetupSticky(DetectEngineCtx *de_ctx, Signature *s { if (DetectBufferSetActiveList(s, g_http_client_body_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } @@ -208,21 +204,24 @@ static InspectionBuffer *HttpClientBodyGetDataCallback(DetectEngineThreadCtx *de return NULL; } - SCLogDebug("request.body_limit %u request_body.content_len_so_far %"PRIu64 - ", request.inspect_min_size %"PRIu32", EOF %s, progress > body? %s", - htp_state->cfg->request.body_limit, body->content_len_so_far, - htp_state->cfg->request.inspect_min_size, - flags & STREAM_EOF ? "true" : "false", - (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) > HTP_REQUEST_BODY) ? "true" : "false"); + SCLogDebug("request.body_limit %u request_body.content_len_so_far %" PRIu64 + ", request.inspect_min_size %" PRIu32 ", EOF %s, progress > body? %s", + htp_state->cfg->request.body_limit, body->content_len_so_far, + htp_state->cfg->request.inspect_min_size, flags & STREAM_EOF ? "true" : "false", + (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) > + HTP_REQUEST_BODY) + ? "true" + : "false"); if (!htp_state->cfg->http_body_inline) { /* inspect the body if the transfer is complete or we have hit * our body size limit */ if ((htp_state->cfg->request.body_limit == 0 || - body->content_len_so_far < htp_state->cfg->request.body_limit) && - body->content_len_so_far < htp_state->cfg->request.inspect_min_size && - !(AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) > HTP_REQUEST_BODY) && - !(flags & STREAM_EOF)) { + body->content_len_so_far < htp_state->cfg->request.body_limit) && + body->content_len_so_far < htp_state->cfg->request.inspect_min_size && + !(AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) > + HTP_REQUEST_BODY) && + !(flags & STREAM_EOF)) { SCLogDebug("we still haven't seen the entire request body. " "Let's defer body inspection till we see the " "entire body."); diff --git a/src/detect-http-cookie.c b/src/detect-http-cookie.c index a1068da0f0..d8992a1234 100644 --- a/src/detect-http-cookie.c +++ b/src/detect-http-cookie.c @@ -102,19 +102,15 @@ void DetectHttpCookieRegister(void) sigmatch_table[DETECT_HTTP_COOKIE].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_HTTP_COOKIE].flags |= SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_cookie", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - DetectEngineInspectBufferGeneric, GetRequestData); - DetectAppLayerInspectEngineRegister2("http_cookie", ALPROTO_HTTP, - SIG_FLAG_TOCLIENT, HTP_REQUEST_HEADERS, - DetectEngineInspectBufferGeneric, GetResponseData); - - DetectAppLayerMpmRegister2("http_cookie", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetRequestData, ALPROTO_HTTP, - HTP_REQUEST_HEADERS); - DetectAppLayerMpmRegister2("http_cookie", SIG_FLAG_TOCLIENT, 2, - PrefilterGenericMpmRegister, GetResponseData, ALPROTO_HTTP, - HTP_REQUEST_HEADERS); + DetectAppLayerInspectEngineRegister2("http_cookie", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, DetectEngineInspectBufferGeneric, GetRequestData); + DetectAppLayerInspectEngineRegister2("http_cookie", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_REQUEST_HEADERS, DetectEngineInspectBufferGeneric, GetResponseData); + + DetectAppLayerMpmRegister2("http_cookie", SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetRequestData, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); + DetectAppLayerMpmRegister2("http_cookie", SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister, + GetResponseData, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); DetectBufferTypeSetDescriptionByName("http_cookie", "http cookie header"); @@ -135,10 +131,8 @@ void DetectHttpCookieRegister(void) static int DetectHttpCookieSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, str, - DETECT_AL_HTTP_COOKIE, - g_http_cookie_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, str, DETECT_AL_HTTP_COOKIE, g_http_cookie_buffer_id, ALPROTO_HTTP1); } /** @@ -155,7 +149,7 @@ static int DetectHttpCookieSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co if (DetectBufferSetActiveList(s, g_http_cookie_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; diff --git a/src/detect-http-header-names.c b/src/detect-http-header-names.c index 989a24c3e5..32a5a88de0 100644 --- a/src/detect-http-header-names.c +++ b/src/detect-http-header-names.c @@ -96,12 +96,12 @@ static uint8_t *GetBufferForTX(htp_tx_t *tx, uint64_t tx_id, htp_table_t *headers; if (flags & STREAM_TOSERVER) { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) <= + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <= HTP_REQUEST_HEADERS) return NULL; headers = tx->request_headers; } else { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) <= + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <= HTP_RESPONSE_HEADERS) return NULL; headers = tx->response_headers; @@ -352,10 +352,12 @@ static int InspectEngineHttpHeaderNames( end: if (flags & STREAM_TOSERVER) { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > HTP_REQUEST_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > + HTP_REQUEST_HEADERS) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } else { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > HTP_RESPONSE_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > + HTP_RESPONSE_HEADERS) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } return DETECT_ENGINE_INSPECT_SIG_NO_MATCH; @@ -379,7 +381,7 @@ static int DetectHttpHeaderNamesSetup(DetectEngineCtx *de_ctx, Signature *s, con if (DetectBufferSetActiveList(s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; @@ -399,18 +401,14 @@ void DetectHttpHeaderNamesRegister(void) sigmatch_table[DETECT_AL_HTTP_HEADER_NAMES].flags |= SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER; DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, - PrefilterTxHttpRequestHeaderNamesRegister, NULL, ALPROTO_HTTP, - HTP_REQUEST_HEADERS); + PrefilterTxHttpRequestHeaderNamesRegister, NULL, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, - PrefilterTxHttpResponseHeaderNamesRegister, NULL, ALPROTO_HTTP, - HTP_RESPONSE_HEADERS); - - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, - ALPROTO_HTTP, SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - InspectEngineHttpHeaderNames, NULL); - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, - ALPROTO_HTTP, SIG_FLAG_TOCLIENT, HTP_RESPONSE_HEADERS, - InspectEngineHttpHeaderNames, NULL); + PrefilterTxHttpResponseHeaderNamesRegister, NULL, ALPROTO_HTTP1, HTP_RESPONSE_HEADERS); + + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, InspectEngineHttpHeaderNames, NULL); + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_HEADERS, InspectEngineHttpHeaderNames, NULL); DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC); diff --git a/src/detect-http-header.c b/src/detect-http-header.c index 8eabfebecf..e5b66747b2 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -85,11 +85,13 @@ static uint8_t *GetBufferForTX(htp_tx_t *tx, uint64_t tx_id, htp_table_t *headers; if (flags & STREAM_TOSERVER) { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) <= HTP_REQUEST_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <= + HTP_REQUEST_HEADERS) return NULL; headers = tx->request_headers; } else { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) <= HTP_RESPONSE_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <= + HTP_RESPONSE_HEADERS) return NULL; headers = tx->response_headers; } @@ -199,10 +201,12 @@ static int DetectEngineInspectBufferHttpHeader( } end: if (flags & STREAM_TOSERVER) { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > HTP_REQUEST_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > + HTP_REQUEST_HEADERS) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } else { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > HTP_RESPONSE_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > + HTP_RESPONSE_HEADERS) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } return DETECT_ENGINE_INSPECT_SIG_NO_MATCH; @@ -376,10 +380,8 @@ static int PrefilterMpmHttpHeaderResponseRegister(DetectEngineCtx *de_ctx, */ static int DetectHttpHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_HEADER, - g_http_header_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_HEADER, g_http_header_buffer_id, ALPROTO_HTTP1); } /** @@ -395,7 +397,7 @@ static int DetectHttpHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co { if (DetectBufferSetActiveList(s, g_http_header_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } @@ -425,18 +427,16 @@ void DetectHttpHeaderRegister(void) sigmatch_table[DETECT_HTTP_HEADER].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_HTTP_HEADER].flags |= SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_header", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - DetectEngineInspectBufferHttpHeader, NULL); + DetectAppLayerInspectEngineRegister2("http_header", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, DetectEngineInspectBufferHttpHeader, NULL); DetectAppLayerMpmRegister2("http_header", SIG_FLAG_TOSERVER, 2, - PrefilterMpmHttpHeaderRequestRegister, NULL, ALPROTO_HTTP, + PrefilterMpmHttpHeaderRequestRegister, NULL, ALPROTO_HTTP1, 0); /* not used, registered twice: HEADERS/TRAILER */ - DetectAppLayerInspectEngineRegister2("http_header", ALPROTO_HTTP, - SIG_FLAG_TOCLIENT, HTP_RESPONSE_HEADERS, - DetectEngineInspectBufferHttpHeader, NULL); + DetectAppLayerInspectEngineRegister2("http_header", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_HEADERS, DetectEngineInspectBufferHttpHeader, NULL); DetectAppLayerMpmRegister2("http_header", SIG_FLAG_TOCLIENT, 2, - PrefilterMpmHttpHeaderResponseRegister, NULL, ALPROTO_HTTP, + PrefilterMpmHttpHeaderResponseRegister, NULL, ALPROTO_HTTP1, 0); /* not used, registered twice: HEADERS/TRAILER */ DetectBufferTypeSetDescriptionByName("http_header", diff --git a/src/detect-http-headers-stub.h b/src/detect-http-headers-stub.h index 33fea36533..adebbc5714 100644 --- a/src/detect-http-headers-stub.h +++ b/src/detect-http-headers-stub.h @@ -129,7 +129,7 @@ static int DetectHttpHeadersSetupSticky(DetectEngineCtx *de_ctx, Signature *s, c if (DetectBufferSetActiveList(s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; @@ -147,24 +147,20 @@ static void DetectHttpHeadersRegisterStub(void) sigmatch_table[KEYWORD_ID].flags |= SIGMATCH_NOOPT | SIGMATCH_INFO_STICKY_BUFFER; #ifdef KEYWORD_TOSERVER - DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetRequestData, - ALPROTO_HTTP, HTP_REQUEST_HEADERS); + DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetRequestData, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); #endif #ifdef KEYWORD_TOCLIENT - DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, - PrefilterGenericMpmRegister, GetResponseData, - ALPROTO_HTTP, HTP_RESPONSE_HEADERS); + DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister, + GetResponseData, ALPROTO_HTTP1, HTP_RESPONSE_HEADERS); #endif #ifdef KEYWORD_TOSERVER - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, - ALPROTO_HTTP, SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - DetectEngineInspectBufferGeneric, GetRequestData); + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, DetectEngineInspectBufferGeneric, GetRequestData); #endif #ifdef KEYWORD_TOCLIENT - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, - ALPROTO_HTTP, SIG_FLAG_TOCLIENT, HTP_RESPONSE_HEADERS, - DetectEngineInspectBufferGeneric, GetResponseData); + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_HEADERS, DetectEngineInspectBufferGeneric, GetResponseData); #endif DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC); diff --git a/src/detect-http-host.c b/src/detect-http-host.c index 0870fd920f..f3cf70ee90 100644 --- a/src/detect-http-host.c +++ b/src/detect-http-host.c @@ -99,13 +99,11 @@ void DetectHttpHHRegister(void) sigmatch_table[DETECT_HTTP_HOST].Setup = DetectHttpHostSetup; sigmatch_table[DETECT_HTTP_HOST].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_host", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_host", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerMpmRegister2("http_host", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_REQUEST_HEADERS); + DetectAppLayerMpmRegister2("http_host", SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); DetectBufferTypeRegisterValidateCallback("http_host", DetectHttpHostValidateCallback); @@ -130,13 +128,11 @@ void DetectHttpHHRegister(void) sigmatch_table[DETECT_HTTP_HOST_RAW].Setup = DetectHttpHostRawSetupSticky; sigmatch_table[DETECT_HTTP_HOST_RAW].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_raw_host", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - DetectEngineInspectBufferGeneric, GetRawData); + DetectAppLayerInspectEngineRegister2("http_raw_host", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, DetectEngineInspectBufferGeneric, GetRawData); - DetectAppLayerMpmRegister2("http_raw_host", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetRawData, ALPROTO_HTTP, - HTP_REQUEST_HEADERS); + DetectAppLayerMpmRegister2("http_raw_host", SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetRawData, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); DetectBufferTypeSetDescriptionByName("http_raw_host", "http raw host header"); @@ -159,10 +155,8 @@ void DetectHttpHHRegister(void) */ static int DetectHttpHHSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_HOST, - g_http_host_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_HOST, g_http_host_buffer_id, ALPROTO_HTTP1); } static bool DetectHttpHostValidateCallback(const Signature *s, const char **sigerror) @@ -214,8 +208,8 @@ static int DetectHttpHostSetup(DetectEngineCtx *de_ctx, Signature *s, const char { if (DetectBufferSetActiveList(s, g_http_host_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) - return -1; + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) + return -1; return 0; } @@ -255,10 +249,8 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, */ int DetectHttpHRHSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_RAW_HOST, - g_http_raw_host_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_RAW_HOST, g_http_raw_host_buffer_id, ALPROTO_HTTP1); } /** @@ -274,8 +266,8 @@ static int DetectHttpHostRawSetupSticky(DetectEngineCtx *de_ctx, Signature *s, c { if (DetectBufferSetActiveList(s, g_http_raw_host_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) - return -1; + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) + return -1; return 0; } diff --git a/src/detect-http-method.c b/src/detect-http-method.c index 4674ea6467..fb38033a1d 100644 --- a/src/detect-http-method.c +++ b/src/detect-http-method.c @@ -95,13 +95,11 @@ void DetectHttpMethodRegister(void) sigmatch_table[DETECT_HTTP_METHOD].Setup = DetectHttpMethodSetupSticky; sigmatch_table[DETECT_HTTP_METHOD].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_method", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_LINE, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_method", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_LINE, DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerMpmRegister2("http_method", SIG_FLAG_TOSERVER, 4, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_REQUEST_LINE); + DetectAppLayerMpmRegister2("http_method", SIG_FLAG_TOSERVER, 4, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_REQUEST_LINE); DetectBufferTypeSetDescriptionByName("http_method", "http request method"); @@ -127,10 +125,8 @@ void DetectHttpMethodRegister(void) */ static int DetectHttpMethodSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, str, - DETECT_AL_HTTP_METHOD, - g_http_method_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, str, DETECT_AL_HTTP_METHOD, g_http_method_buffer_id, ALPROTO_HTTP1); } /** @@ -147,7 +143,7 @@ static int DetectHttpMethodSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co if (DetectBufferSetActiveList(s, g_http_method_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; diff --git a/src/detect-http-protocol.c b/src/detect-http-protocol.c index 6a35ac7e9b..0f32154ddd 100644 --- a/src/detect-http-protocol.c +++ b/src/detect-http-protocol.c @@ -77,7 +77,7 @@ static int DetectHttpProtocolSetup(DetectEngineCtx *de_ctx, Signature *s, const if (DetectBufferSetActiveList(s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; @@ -128,18 +128,14 @@ void DetectHttpProtocolRegister(void) sigmatch_table[DETECT_AL_HTTP_PROTOCOL].Setup = DetectHttpProtocolSetup; sigmatch_table[DETECT_AL_HTTP_PROTOCOL].flags |= SIGMATCH_INFO_STICKY_BUFFER | SIGMATCH_NOOPT; - DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_REQUEST_LINE); - DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_RESPONSE_LINE); - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_LINE, - DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP, - SIG_FLAG_TOCLIENT, HTP_RESPONSE_LINE, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_REQUEST_LINE); + DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_RESPONSE_LINE); + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_LINE, DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_LINE, DetectEngineInspectBufferGeneric, GetData); DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC); diff --git a/src/detect-http-raw-header.c b/src/detect-http-raw-header.c index e75dbb96ee..0371a18bf6 100644 --- a/src/detect-http-raw-header.c +++ b/src/detect-http-raw-header.c @@ -93,18 +93,16 @@ void DetectHttpRawHeaderRegister(void) sigmatch_table[DETECT_HTTP_RAW_HEADER].Setup = DetectHttpRawHeaderSetupSticky; sigmatch_table[DETECT_HTTP_RAW_HEADER].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_raw_header", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS+1, - DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerInspectEngineRegister2("http_raw_header", ALPROTO_HTTP, - SIG_FLAG_TOCLIENT, HTP_RESPONSE_HEADERS+1, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_raw_header", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS + 1, DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_raw_header", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_HEADERS + 1, DetectEngineInspectBufferGeneric, GetData); DetectAppLayerMpmRegister2("http_raw_header", SIG_FLAG_TOSERVER, 2, - PrefilterMpmHttpHeaderRawRequestRegister, NULL, ALPROTO_HTTP, + PrefilterMpmHttpHeaderRawRequestRegister, NULL, ALPROTO_HTTP1, 0); /* progress handled in register */ DetectAppLayerMpmRegister2("http_raw_header", SIG_FLAG_TOCLIENT, 2, - PrefilterMpmHttpHeaderRawResponseRegister, NULL, ALPROTO_HTTP, + PrefilterMpmHttpHeaderRawResponseRegister, NULL, ALPROTO_HTTP1, 0); /* progress handled in register */ DetectBufferTypeSetDescriptionByName("http_raw_header", @@ -131,10 +129,8 @@ void DetectHttpRawHeaderRegister(void) */ int DetectHttpRawHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_RAW_HEADER, - g_http_raw_header_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_RAW_HEADER, g_http_raw_header_buffer_id, ALPROTO_HTTP1); } /** @@ -150,7 +146,7 @@ static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, { if (DetectBufferSetActiveList(s, g_http_raw_header_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } diff --git a/src/detect-http-request-line.c b/src/detect-http-request-line.c index 8f6ae56267..bde3a0dc5d 100644 --- a/src/detect-http-request-line.c +++ b/src/detect-http-request-line.c @@ -86,14 +86,11 @@ void DetectHttpRequestLineRegister(void) #endif sigmatch_table[DETECT_AL_HTTP_REQUEST_LINE].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_request_line", - ALPROTO_HTTP, SIG_FLAG_TOSERVER, HTP_REQUEST_LINE, - DetectEngineInspectBufferGeneric, - GetData); + DetectAppLayerInspectEngineRegister2("http_request_line", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_LINE, DetectEngineInspectBufferGeneric, GetData); DetectAppLayerMpmRegister2("http_request_line", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetData, - ALPROTO_HTTP, HTP_REQUEST_LINE); + PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP1, HTP_REQUEST_LINE); DetectBufferTypeSetDescriptionByName("http_request_line", "http request line"); @@ -119,7 +116,7 @@ static int DetectHttpRequestLineSetup(DetectEngineCtx *de_ctx, Signature *s, con if (DetectBufferSetActiveList(s, g_http_request_line_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; @@ -210,7 +207,7 @@ static int DetectHttpRequestLineTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -227,7 +224,8 @@ static int DetectHttpRequestLineTest02(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); FAIL_IF(r != 0); http_state = f.alstate; @@ -283,7 +281,7 @@ static int DetectHttpRequestLineWrapper(const char *sig, const int expectation) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -299,7 +297,8 @@ static int DetectHttpRequestLineWrapper(const char *sig, const int expectation) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); FAIL_IF(r != 0); http_state = f.alstate; diff --git a/src/detect-http-response-line.c b/src/detect-http-response-line.c index 64d915c675..ea3b3cf6db 100644 --- a/src/detect-http-response-line.c +++ b/src/detect-http-response-line.c @@ -85,14 +85,11 @@ void DetectHttpResponseLineRegister(void) #endif sigmatch_table[DETECT_AL_HTTP_RESPONSE_LINE].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_response_line", - ALPROTO_HTTP, SIG_FLAG_TOCLIENT, HTP_RESPONSE_LINE, - DetectEngineInspectBufferGeneric, - GetData); + DetectAppLayerInspectEngineRegister2("http_response_line", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_LINE, DetectEngineInspectBufferGeneric, GetData); DetectAppLayerMpmRegister2("http_response_line", SIG_FLAG_TOCLIENT, 2, - PrefilterGenericMpmRegister, GetData, - ALPROTO_HTTP, HTP_RESPONSE_LINE); + PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP1, HTP_RESPONSE_LINE); DetectBufferTypeSetDescriptionByName("http_response_line", "http response line"); @@ -118,7 +115,7 @@ static int DetectHttpResponseLineSetup(DetectEngineCtx *de_ctx, Signature *s, co if (DetectBufferSetActiveList(s, g_http_response_line_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; @@ -215,7 +212,7 @@ static int DetectHttpResponseLineTest02(void) p->flow = &f; p->flowflags |= (FLOW_PKT_TOSERVER|FLOW_PKT_ESTABLISHED); p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -232,13 +229,15 @@ static int DetectHttpResponseLineTest02(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); FAIL_IF(r != 0); http_state = f.alstate; FAIL_IF_NULL(http_state); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ diff --git a/src/detect-http-server-body.c b/src/detect-http-server-body.c index 8c330cdee8..1b6aff7c4d 100644 --- a/src/detect-http-server-body.c +++ b/src/detect-http-server-body.c @@ -109,10 +109,8 @@ void DetectHttpServerBodyRegister(void) */ int DetectHttpServerBodySetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_SERVER_BODY, - g_file_data_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_SERVER_BODY, g_file_data_buffer_id, ALPROTO_HTTP1); } /** @@ -128,7 +126,7 @@ static int DetectHttpServerBodySetupSticky(DetectEngineCtx *de_ctx, Signature *s { if (DetectBufferSetActiveList(s, g_file_data_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } diff --git a/src/detect-http-start.c b/src/detect-http-start.c index 1a42e088b1..8aaa14e59f 100644 --- a/src/detect-http-start.c +++ b/src/detect-http-start.c @@ -96,13 +96,13 @@ static uint8_t *GetBufferForTX(htp_tx_t *tx, uint64_t tx_id, bstr *line = NULL; htp_table_t *headers; if (flags & STREAM_TOSERVER) { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) <= + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <= HTP_REQUEST_HEADERS) return NULL; line = tx->request_line; headers = tx->request_headers; } else { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, tx, flags) <= + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <= HTP_RESPONSE_HEADERS) return NULL; headers = tx->response_headers; @@ -349,10 +349,12 @@ static int InspectEngineHttpStart( end: if (flags & STREAM_TOSERVER) { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > HTP_REQUEST_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > + HTP_REQUEST_HEADERS) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } else { - if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP, txv, flags) > HTP_RESPONSE_HEADERS) + if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, txv, flags) > + HTP_RESPONSE_HEADERS) return DETECT_ENGINE_INSPECT_SIG_CANT_MATCH; } return DETECT_ENGINE_INSPECT_SIG_NO_MATCH; @@ -363,7 +365,7 @@ static int DetectHttpStartSetup(DetectEngineCtx *de_ctx, Signature *s, const cha if (DetectBufferSetActiveList(s, g_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; @@ -382,18 +384,14 @@ void DetectHttpStartRegister(void) sigmatch_table[DETECT_AL_HTTP_START].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOSERVER, 2, - PrefilterTxHttpRequestStartRegister, NULL, ALPROTO_HTTP, - HTP_REQUEST_HEADERS); + PrefilterTxHttpRequestStartRegister, NULL, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); DetectAppLayerMpmRegister2(BUFFER_NAME, SIG_FLAG_TOCLIENT, 2, - PrefilterTxHttpResponseStartRegister, NULL, ALPROTO_HTTP, - HTP_RESPONSE_HEADERS); - - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, - ALPROTO_HTTP, SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - InspectEngineHttpStart, NULL); - DetectAppLayerInspectEngineRegister2(BUFFER_NAME, - ALPROTO_HTTP, SIG_FLAG_TOCLIENT, HTP_RESPONSE_HEADERS, - InspectEngineHttpStart, NULL); + PrefilterTxHttpResponseStartRegister, NULL, ALPROTO_HTTP1, HTP_RESPONSE_HEADERS); + + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, InspectEngineHttpStart, NULL); + DetectAppLayerInspectEngineRegister2(BUFFER_NAME, ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_HEADERS, InspectEngineHttpStart, NULL); DetectBufferTypeSetDescriptionByName(BUFFER_NAME, BUFFER_DESC); diff --git a/src/detect-http-stat-code.c b/src/detect-http-stat-code.c index bd0405508e..765eb9d138 100644 --- a/src/detect-http-stat-code.c +++ b/src/detect-http-stat-code.c @@ -96,13 +96,11 @@ void DetectHttpStatCodeRegister (void) sigmatch_table[DETECT_HTTP_STAT_CODE].Setup = DetectHttpStatCodeSetupSticky; sigmatch_table[DETECT_HTTP_STAT_CODE].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_stat_code", ALPROTO_HTTP, - SIG_FLAG_TOCLIENT, HTP_RESPONSE_LINE, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_stat_code", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_LINE, DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerMpmRegister2("http_stat_code", SIG_FLAG_TOCLIENT, 4, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_RESPONSE_LINE); + DetectAppLayerMpmRegister2("http_stat_code", SIG_FLAG_TOCLIENT, 4, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_RESPONSE_LINE); DetectBufferTypeSetDescriptionByName("http_stat_code", "http response status code"); @@ -123,10 +121,8 @@ void DetectHttpStatCodeRegister (void) static int DetectHttpStatCodeSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_STAT_CODE, - g_http_stat_code_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_STAT_CODE, g_http_stat_code_buffer_id, ALPROTO_HTTP1); } /** @@ -142,7 +138,7 @@ static int DetectHttpStatCodeSetupSticky(DetectEngineCtx *de_ctx, Signature *s, { if (DetectBufferSetActiveList(s, g_http_stat_code_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } diff --git a/src/detect-http-stat-msg.c b/src/detect-http-stat-msg.c index 6eeb5685cc..44952331e7 100644 --- a/src/detect-http-stat-msg.c +++ b/src/detect-http-stat-msg.c @@ -96,13 +96,11 @@ void DetectHttpStatMsgRegister (void) sigmatch_table[DETECT_HTTP_STAT_MSG].Setup = DetectHttpStatMsgSetupSticky; sigmatch_table[DETECT_HTTP_STAT_MSG].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_stat_msg", ALPROTO_HTTP, - SIG_FLAG_TOCLIENT, HTP_RESPONSE_LINE, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_stat_msg", ALPROTO_HTTP1, SIG_FLAG_TOCLIENT, + HTP_RESPONSE_LINE, DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerMpmRegister2("http_stat_msg", SIG_FLAG_TOCLIENT, 3, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_RESPONSE_LINE); + DetectAppLayerMpmRegister2("http_stat_msg", SIG_FLAG_TOCLIENT, 3, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_RESPONSE_LINE); DetectBufferTypeSetDescriptionByName("http_stat_msg", "http response status message"); @@ -123,10 +121,8 @@ void DetectHttpStatMsgRegister (void) static int DetectHttpStatMsgSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_STAT_MSG, - g_http_stat_msg_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_STAT_MSG, g_http_stat_msg_buffer_id, ALPROTO_HTTP1); } /** @@ -142,7 +138,7 @@ static int DetectHttpStatMsgSetupSticky(DetectEngineCtx *de_ctx, Signature *s, c { if (DetectBufferSetActiveList(s, g_http_stat_msg_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } diff --git a/src/detect-http-ua.c b/src/detect-http-ua.c index f7be34d055..f7a3960032 100644 --- a/src/detect-http-ua.c +++ b/src/detect-http-ua.c @@ -95,13 +95,11 @@ void DetectHttpUARegister(void) sigmatch_table[DETECT_HTTP_UA].flags |= SIGMATCH_NOOPT; sigmatch_table[DETECT_HTTP_UA].flags |= SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_user_agent", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_HEADERS, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_user_agent", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_HEADERS, DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerMpmRegister2("http_user_agent", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_REQUEST_HEADERS); + DetectAppLayerMpmRegister2("http_user_agent", SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_REQUEST_HEADERS); DetectBufferTypeSetDescriptionByName("http_user_agent", "http user agent"); @@ -124,10 +122,8 @@ void DetectHttpUARegister(void) */ int DetectHttpUASetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_USER_AGENT, - g_http_ua_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_USER_AGENT, g_http_ua_buffer_id, ALPROTO_HTTP1); } /** @@ -143,7 +139,7 @@ static int DetectHttpUserAgentSetup(DetectEngineCtx *de_ctx, Signature *s, const { if (DetectBufferSetActiveList(s, g_http_ua_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } diff --git a/src/detect-http-uri.c b/src/detect-http-uri.c index a05c203e83..ba621678fd 100644 --- a/src/detect-http-uri.c +++ b/src/detect-http-uri.c @@ -106,13 +106,11 @@ void DetectHttpUriRegister (void) sigmatch_table[DETECT_HTTP_URI].Setup = DetectHttpUriSetupSticky; sigmatch_table[DETECT_HTTP_URI].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_uri", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_LINE, - DetectEngineInspectBufferGeneric, GetData); + DetectAppLayerInspectEngineRegister2("http_uri", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_LINE, DetectEngineInspectBufferGeneric, GetData); - DetectAppLayerMpmRegister2("http_uri", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetData, ALPROTO_HTTP, - HTP_REQUEST_LINE); + DetectAppLayerMpmRegister2("http_uri", SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetData, ALPROTO_HTTP1, HTP_REQUEST_LINE); DetectBufferTypeSetDescriptionByName("http_uri", "http request uri"); @@ -140,13 +138,11 @@ void DetectHttpUriRegister (void) sigmatch_table[DETECT_HTTP_URI_RAW].Setup = DetectHttpRawUriSetupSticky; sigmatch_table[DETECT_HTTP_URI_RAW].flags |= SIGMATCH_NOOPT|SIGMATCH_INFO_STICKY_BUFFER; - DetectAppLayerInspectEngineRegister2("http_raw_uri", ALPROTO_HTTP, - SIG_FLAG_TOSERVER, HTP_REQUEST_LINE, - DetectEngineInspectBufferGeneric, GetRawData); + DetectAppLayerInspectEngineRegister2("http_raw_uri", ALPROTO_HTTP1, SIG_FLAG_TOSERVER, + HTP_REQUEST_LINE, DetectEngineInspectBufferGeneric, GetRawData); - DetectAppLayerMpmRegister2("http_raw_uri", SIG_FLAG_TOSERVER, 2, - PrefilterGenericMpmRegister, GetRawData, ALPROTO_HTTP, - HTP_REQUEST_LINE); + DetectAppLayerMpmRegister2("http_raw_uri", SIG_FLAG_TOSERVER, 2, PrefilterGenericMpmRegister, + GetRawData, ALPROTO_HTTP1, HTP_REQUEST_LINE); DetectBufferTypeSetDescriptionByName("http_raw_uri", "raw http uri"); @@ -173,10 +169,8 @@ void DetectHttpUriRegister (void) int DetectHttpUriSetup(DetectEngineCtx *de_ctx, Signature *s, const char *str) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, str, - DETECT_AL_HTTP_URI, - g_http_uri_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, str, DETECT_AL_HTTP_URI, g_http_uri_buffer_id, ALPROTO_HTTP1); } static bool DetectHttpUriValidateCallback(const Signature *s, const char **sigerror) @@ -204,7 +198,7 @@ static int DetectHttpUriSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const { if (DetectBufferSetActiveList(s, g_http_uri_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } @@ -247,10 +241,8 @@ static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx, */ static int DetectHttpRawUriSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) { - return DetectEngineContentModifierBufferSetup(de_ctx, s, arg, - DETECT_AL_HTTP_RAW_URI, - g_http_raw_uri_buffer_id, - ALPROTO_HTTP); + return DetectEngineContentModifierBufferSetup( + de_ctx, s, arg, DETECT_AL_HTTP_RAW_URI, g_http_raw_uri_buffer_id, ALPROTO_HTTP1); } static bool DetectHttpRawUriValidateCallback(const Signature *s, const char **sigerror) @@ -278,7 +270,7 @@ static int DetectHttpRawUriSetupSticky(DetectEngineCtx *de_ctx, Signature *s, co { if (DetectBufferSetActiveList(s, g_http_raw_uri_buffer_id) < 0) return -1; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) < 0) return -1; return 0; } diff --git a/src/detect-lua.c b/src/detect-lua.c index faf1998013..811a4a7f28 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -376,7 +376,7 @@ static int DetectLuaMatch (DetectEngineThreadCtx *det_ctx, LuaPushStringBuffer (tlua->luastate, (const uint8_t *)GET_PKT_DATA(p), (size_t)GET_PKT_LEN(p)); /* stack at -3 */ lua_settable(tlua->luastate, -3); } - if (tlua->alproto == ALPROTO_HTTP) { + if (tlua->alproto == ALPROTO_HTTP1) { HtpState *htp_state = p->flow->alstate; if (htp_state != NULL && htp_state->connp != NULL) { htp_tx_t *tx = NULL; @@ -384,7 +384,7 @@ static int DetectLuaMatch (DetectEngineThreadCtx *det_ctx, STREAM_TOSERVER); uint64_t total_txs= AppLayerParserGetTxCnt(p->flow, htp_state); for ( ; idx < total_txs; idx++) { - tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, idx); + tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, idx); if (tx == NULL) continue; @@ -492,11 +492,11 @@ static int DetectLuaAppMatchCommon (DetectEngineThreadCtx *det_ctx, lua_getglobal(tlua->luastate, "match"); lua_newtable(tlua->luastate); /* stack at -1 */ - if (tlua->alproto == ALPROTO_HTTP) { + if (tlua->alproto == ALPROTO_HTTP1) { HtpState *htp_state = state; if (htp_state != NULL && htp_state->connp != NULL) { htp_tx_t *tx = NULL; - tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, det_ctx->tx_id); + tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, det_ctx->tx_id); if (tx != NULL) { if ((tlua->flags & DATATYPE_HTTP_REQUEST_LINE) && tx->request_line != NULL && bstr_len(tx->request_line) > 0) { @@ -863,7 +863,7 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld) } } else if (strncmp(k, "http", 4) == 0 && strcmp(v, "true") == 0) { - if (ld->alproto != ALPROTO_UNKNOWN && ld->alproto != ALPROTO_HTTP) { + if (ld->alproto != ALPROTO_UNKNOWN && ld->alproto != ALPROTO_HTTP1) { SCLogError(SC_ERR_LUA_ERROR, "can just inspect script against one app layer proto like HTTP at a time"); goto error; } @@ -873,7 +873,7 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld) } /* http types */ - ld->alproto = ALPROTO_HTTP; + ld->alproto = ALPROTO_HTTP1; if (strcmp(k, "http.uri") == 0) ld->flags |= DATATYPE_HTTP_URI; @@ -1042,7 +1042,7 @@ static int DetectLuaSetup (DetectEngineCtx *de_ctx, Signature *s, const char *st list = DETECT_SM_LIST_MATCH; } - } else if (lua->alproto == ALPROTO_HTTP) { + } else if (lua->alproto == ALPROTO_HTTP1) { if (lua->flags & DATATYPE_HTTP_RESPONSE_BODY) { list = DetectBufferTypeGetByName("file_data"); } else if (lua->flags & DATATYPE_HTTP_REQUEST_BODY) { @@ -1211,7 +1211,7 @@ static int LuaMatchTest01(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -1240,8 +1240,8 @@ static int LuaMatchTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1264,8 +1264,7 @@ static int LuaMatchTest01(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1373,7 +1372,7 @@ static int LuaMatchTest01a(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -1403,7 +1402,7 @@ static int LuaMatchTest01a(void) FLOWLOCK_WRLOCK(&f); int r = AppLayerParserParse( - NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf1, httplen1); + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1426,7 +1425,7 @@ static int LuaMatchTest01a(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1533,7 +1532,7 @@ static int LuaMatchTest02(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -1666,7 +1665,7 @@ static int LuaMatchTest02a(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -1799,7 +1798,7 @@ static int LuaMatchTest03(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -1932,7 +1931,7 @@ static int LuaMatchTest03a(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -2064,7 +2063,7 @@ static int LuaMatchTest04(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -2095,7 +2094,7 @@ static int LuaMatchTest04(void) FLOWLOCK_WRLOCK(&f); int r = AppLayerParserParse( - NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf1, httplen1); + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2118,7 +2117,7 @@ static int LuaMatchTest04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2219,7 +2218,7 @@ static int LuaMatchTest04a(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -2250,7 +2249,7 @@ static int LuaMatchTest04a(void) FLOWLOCK_WRLOCK(&f); int r = AppLayerParserParse( - NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf1, httplen1); + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2273,7 +2272,7 @@ static int LuaMatchTest04a(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2367,7 +2366,7 @@ static int LuaMatchTest05(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -2398,7 +2397,7 @@ static int LuaMatchTest05(void) FLOWLOCK_WRLOCK(&f); int r = AppLayerParserParse( - NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf1, httplen1); + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2421,7 +2420,7 @@ static int LuaMatchTest05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2515,7 +2514,7 @@ static int LuaMatchTest05a(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -2545,8 +2544,8 @@ static int LuaMatchTest05a(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2569,8 +2568,7 @@ static int LuaMatchTest05a(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2669,7 +2667,7 @@ static int LuaMatchTest06(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -2699,8 +2697,8 @@ static int LuaMatchTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2723,8 +2721,7 @@ static int LuaMatchTest06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2823,7 +2820,7 @@ static int LuaMatchTest06a(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -2853,8 +2850,8 @@ static int LuaMatchTest06a(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2877,8 +2874,7 @@ static int LuaMatchTest06a(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); diff --git a/src/detect-parse.c b/src/detect-parse.c index 85c72b4490..c3c0b6b179 100644 --- a/src/detect-parse.c +++ b/src/detect-parse.c @@ -1759,7 +1759,7 @@ static int SigValidate(DetectEngineCtx *de_ctx, Signature *s) s->flags |= SIG_FLAG_TOSERVER; s->flags &= ~SIG_FLAG_TOCLIENT; } - if ((s->init_data->smlists[DETECT_SM_LIST_FILEDATA] != NULL && s->alproto == ALPROTO_HTTP) || + if ((s->init_data->smlists[DETECT_SM_LIST_FILEDATA] != NULL && s->alproto == ALPROTO_HTTP1) || s->init_data->smlists[DETECT_SM_LIST_HSMDMATCH] != NULL || s->init_data->smlists[DETECT_SM_LIST_HSCDMATCH] != NULL) { sig_flags |= SIG_FLAG_TOCLIENT; @@ -1876,7 +1876,7 @@ static int SigValidate(DetectEngineCtx *de_ctx, Signature *s) SCReturnInt(0); } - if (s->alproto == ALPROTO_HTTP || s->alproto == ALPROTO_HTTP_ANY) { + if (s->alproto == ALPROTO_HTTP1 || s->alproto == ALPROTO_HTTP) { AppLayerHtpNeedFileInspection(); } } diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 7b73a5251d..2dfce14fd2 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -483,7 +483,7 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_uri"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'V': { @@ -493,7 +493,7 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_user_agent"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'W': { @@ -503,7 +503,7 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_host"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; check_host_header = 1; break; } @@ -514,7 +514,7 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_raw_host"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'H': { /* snort's option */ @@ -524,7 +524,7 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_header"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'I': { /* snort's option */ if (pd->flags & DETECT_PCRE_RAWBYTES) { @@ -533,13 +533,13 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_raw_uri"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'D': { /* snort's option */ int list = DetectBufferTypeGetByName("http_raw_header"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'M': { /* snort's option */ @@ -549,7 +549,7 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_method"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'C': { /* snort's option */ @@ -559,35 +559,35 @@ static DetectPcreData *DetectPcreParse (DetectEngineCtx *de_ctx, } int list = DetectBufferTypeGetByName("http_cookie"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'P': { /* snort's option (http request body inspection) */ int list = DetectBufferTypeGetByName("http_client_body"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'Q': { int list = DetectBufferTypeGetByName("file_data"); /* suricata extension (http response body inspection) */ *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'Y': { /* snort's option */ int list = DetectBufferTypeGetByName("http_stat_msg"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } case 'S': { /* snort's option */ int list = DetectBufferTypeGetByName("http_stat_code"); *sm_list = DetectPcreSetList(*sm_list, list); - *alproto = ALPROTO_HTTP; + *alproto = ALPROTO_HTTP1; break; } default: @@ -1013,7 +1013,7 @@ static int DetectPcreParseTest02 (void) pd = DetectPcreParse(de_ctx, teststring, &list, NULL, 0, false, &alproto); FAIL_IF_NOT_NULL(pd); - FAIL_IF_NOT(alproto == ALPROTO_HTTP); + FAIL_IF_NOT(alproto == ALPROTO_HTTP1); DetectEngineCtxFree(de_ctx); return result; @@ -1120,7 +1120,7 @@ static int DetectPcreParseTest07 (void) pd = DetectPcreParse(de_ctx, teststring, &list, NULL, 0, false, &alproto); FAIL_IF_NULL(pd); - FAIL_IF_NOT(alproto == ALPROTO_HTTP); + FAIL_IF_NOT(alproto == ALPROTO_HTTP1); DetectPcreFree(NULL, pd); DetectEngineCtxFree(de_ctx); @@ -1696,7 +1696,7 @@ static int DetectPcreTestSig01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; DetectEngineCtx *de_ctx = DetectEngineCtxInit(); FAIL_IF(de_ctx == NULL); @@ -1708,8 +1708,8 @@ static int DetectPcreTestSig01(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, buf, buflen); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, buf, buflen); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); @@ -1878,7 +1878,7 @@ static int DetectPcreModifPTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1900,8 +1900,8 @@ static int DetectPcreModifPTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -1990,7 +1990,7 @@ static int DetectPcreModifPTest05(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2012,8 +2012,8 @@ static int DetectPcreModifPTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2028,8 +2028,7 @@ static int DetectPcreModifPTest05(void) FAIL_IF(PacketAlertCheck(p1, 2)); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2139,7 +2138,7 @@ static int DetectPcreTestSig09(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2157,8 +2156,8 @@ static int DetectPcreTestSig09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2218,7 +2217,7 @@ static int DetectPcreTestSig10(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2236,8 +2235,8 @@ static int DetectPcreTestSig10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2297,7 +2296,7 @@ static int DetectPcreTestSig11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2315,8 +2314,8 @@ static int DetectPcreTestSig11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2376,7 +2375,7 @@ static int DetectPcreTestSig12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2394,8 +2393,8 @@ static int DetectPcreTestSig12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2455,7 +2454,7 @@ static int DetectPcreTestSig13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2473,8 +2472,8 @@ static int DetectPcreTestSig13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2534,7 +2533,7 @@ static int DetectPcreTestSig14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2552,8 +2551,8 @@ static int DetectPcreTestSig14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2613,7 +2612,7 @@ static int DetectPcreTestSig15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2632,8 +2631,8 @@ static int DetectPcreTestSig15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2693,7 +2692,7 @@ static int DetectPcreTestSig16(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2712,8 +2711,8 @@ static int DetectPcreTestSig16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2777,40 +2776,33 @@ static int DetectPcreTxBodyChunksTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); AppLayerHtpEnableRequestBodyCallback(); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf7, httplen7); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf7, httplen7); FAIL_IF(r != 0); /* Now we should have 2 transactions, each with it's own list @@ -2822,8 +2814,8 @@ static int DetectPcreTxBodyChunksTest01(void) /* hardcoded check of the transactions and it's client body chunks */ FAIL_IF(AppLayerParserGetTxCnt(&f, htp_state) != 2); - htp_tx_t *t1 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 0); - htp_tx_t *t2 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 1); + htp_tx_t *t1 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 0); + htp_tx_t *t2 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 1); HtpTxUserData *htud = (HtpTxUserData *) htp_tx_get_user_data(t1); FAIL_IF(htud == NULL); @@ -2889,7 +2881,7 @@ static int DetectPcreTxBodyChunksTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2907,8 +2899,8 @@ static int DetectPcreTxBodyChunksTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2918,8 +2910,7 @@ static int DetectPcreTxBodyChunksTest02(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2929,8 +2920,7 @@ static int DetectPcreTxBodyChunksTest02(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2940,8 +2930,7 @@ static int DetectPcreTxBodyChunksTest02(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2951,8 +2940,7 @@ static int DetectPcreTxBodyChunksTest02(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2962,8 +2950,7 @@ static int DetectPcreTxBodyChunksTest02(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2975,8 +2962,7 @@ static int DetectPcreTxBodyChunksTest02(void) SCLogDebug("sending data chunk 7"); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf7, httplen7); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf7, httplen7); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -2991,8 +2977,8 @@ static int DetectPcreTxBodyChunksTest02(void) /* hardcoded check of the transactions and it's client body chunks */ FAIL_IF(AppLayerParserGetTxCnt(&f, htp_state) != 2); - htp_tx_t *t1 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 0); - htp_tx_t *t2 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 1); + htp_tx_t *t1 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 0); + htp_tx_t *t2 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 1); HtpTxUserData *htud = (HtpTxUserData *) htp_tx_get_user_data(t1); @@ -3064,7 +3050,7 @@ static int DetectPcreTxBodyChunksTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3082,8 +3068,8 @@ static int DetectPcreTxBodyChunksTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3093,8 +3079,7 @@ static int DetectPcreTxBodyChunksTest03(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3104,8 +3089,7 @@ static int DetectPcreTxBodyChunksTest03(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3115,8 +3099,7 @@ static int DetectPcreTxBodyChunksTest03(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3126,8 +3109,7 @@ static int DetectPcreTxBodyChunksTest03(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3137,8 +3119,7 @@ static int DetectPcreTxBodyChunksTest03(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3150,8 +3131,7 @@ static int DetectPcreTxBodyChunksTest03(void) SCLogDebug("sending data chunk 7"); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf7, httplen7); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf7, httplen7); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3220,7 +3200,7 @@ static int DetectPcreFlowvarCapture01(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -3245,8 +3225,8 @@ static int DetectPcreFlowvarCapture01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3321,7 +3301,7 @@ static int DetectPcreFlowvarCapture02(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -3359,8 +3339,8 @@ static int DetectPcreFlowvarCapture02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); @@ -3437,7 +3417,7 @@ static int DetectPcreFlowvarCapture03(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1->flow = &f; p1->flowflags |= FLOW_PKT_TOSERVER; @@ -3472,8 +3452,8 @@ static int DetectPcreFlowvarCapture03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); FLOWLOCK_UNLOCK(&f); diff --git a/src/detect-uricontent.c b/src/detect-uricontent.c index df1c882091..1644fd5676 100644 --- a/src/detect-uricontent.c +++ b/src/detect-uricontent.c @@ -219,16 +219,14 @@ static int HTTPUriTest01(void) FLOW_INITIALIZE(&f); f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; f.flags |= FLOW_IPV4; StreamTcpInitConfig(TRUE); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); if (r != 0) { printf("AppLayerParse failed: r(%d) != 0: ", r); goto end; @@ -240,7 +238,7 @@ static int HTTPUriTest01(void) goto end; } - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 0); if (tx->request_method_number != HTP_M_GET || tx->request_protocol_number != HTP_PROTOCOL_1_1) @@ -290,16 +288,14 @@ static int HTTPUriTest02(void) FLOW_INITIALIZE(&f); f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; f.flags |= FLOW_IPV4; StreamTcpInitConfig(TRUE); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); if (r != 0) { printf("AppLayerParse failed: r(%d) != 0: ", r); goto end; @@ -311,7 +307,7 @@ static int HTTPUriTest02(void) goto end; } - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 0); if (tx->request_method_number != HTP_M_GET || tx->request_protocol_number != HTP_PROTOCOL_1_1) @@ -361,16 +357,14 @@ static int HTTPUriTest03(void) FLOW_INITIALIZE(&f); f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; f.flags |= FLOW_IPV4; StreamTcpInitConfig(TRUE); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); if (r != 0) { printf("AppLayerParse failed: r(%d) != 0: ", r); goto end; @@ -382,7 +376,7 @@ static int HTTPUriTest03(void) goto end; } - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 0); if (tx->request_method_number != HTP_M_UNKNOWN || tx->request_protocol_number != HTP_PROTOCOL_1_1) @@ -433,16 +427,14 @@ static int HTTPUriTest04(void) FLOW_INITIALIZE(&f); f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; f.flags |= FLOW_IPV4; StreamTcpInitConfig(TRUE); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - httpbuf1, - httplen1); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, httpbuf1, httplen1); if (r != 0) { printf("AppLayerParse failed: r(%d) != 0: ", r); goto end; @@ -454,7 +446,7 @@ static int HTTPUriTest04(void) goto end; } - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 0); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 0); if (tx->request_method_number != HTP_M_GET || tx->request_protocol_number != HTP_PROTOCOL_1_1) @@ -540,7 +532,7 @@ static int DetectUriSigTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -576,8 +568,8 @@ static int DetectUriSigTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -656,7 +648,7 @@ static int DetectUriSigTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -692,8 +684,8 @@ static int DetectUriSigTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -717,8 +709,7 @@ static int DetectUriSigTest03(void) FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -996,7 +987,7 @@ static int DetectUriSigTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; DetectEngineCtx *de_ctx = DetectEngineCtxInit(); FAIL_IF_NULL(de_ctx); @@ -1019,8 +1010,8 @@ static int DetectUriSigTest05(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); http_state = f->alstate; FAIL_IF_NULL(http_state); @@ -1075,7 +1066,7 @@ static int DetectUriSigTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; DetectEngineCtx *de_ctx = DetectEngineCtxInit(); FAIL_IF_NULL(de_ctx); @@ -1108,8 +1099,8 @@ static int DetectUriSigTest06(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); http_state = f->alstate; FAIL_IF_NULL(http_state); @@ -1164,7 +1155,7 @@ static int DetectUriSigTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; DetectEngineCtx *de_ctx = DetectEngineCtxInit(); FAIL_IF_NULL(de_ctx); @@ -1197,8 +1188,8 @@ static int DetectUriSigTest07(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF(r != 0); http_state = f->alstate; FAIL_IF_NULL(http_state); @@ -1786,4 +1777,4 @@ static void DetectUricontentRegisterTests(void) UtRegisterTest("DetectUricontentIsdataatParseTest", DetectUricontentIsdataatParseTest); } -#endif /* UNITTESTS */ \ No newline at end of file +#endif /* UNITTESTS */ diff --git a/src/detect-urilen.c b/src/detect-urilen.c index 0a507840ec..1622330e59 100644 --- a/src/detect-urilen.c +++ b/src/detect-urilen.c @@ -248,7 +248,7 @@ static int DetectUrilenSetup (DetectEngineCtx *de_ctx, Signature *s, const char DetectUrilenData *urilend = NULL; SigMatch *sm = NULL; - if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) != 0) + if (DetectSignatureSetAppProto(s, ALPROTO_HTTP1) != 0) return -1; urilend = DetectUrilenParse(urilenstr); @@ -657,7 +657,7 @@ static int DetectUrilenSigTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -688,8 +688,8 @@ static int DetectUrilenSigTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { SCLogDebug("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); diff --git a/src/log-httplog.c b/src/log-httplog.c index ab67859bf1..63e54ccd14 100644 --- a/src/log-httplog.c +++ b/src/log-httplog.c @@ -65,9 +65,8 @@ int LogHttpLogger(ThreadVars *tv, void *thread_data, const Packet *, Flow *f, vo void LogHttpLogRegister (void) { - OutputRegisterTxModule(LOGGER_HTTP, MODULE_NAME, "http-log", - LogHttpLogInitCtx, ALPROTO_HTTP, LogHttpLogger, LogHttpLogThreadInit, - LogHttpLogThreadDeinit, NULL); + OutputRegisterTxModule(LOGGER_HTTP, MODULE_NAME, "http-log", LogHttpLogInitCtx, ALPROTO_HTTP1, + LogHttpLogger, LogHttpLogThreadInit, LogHttpLogThreadDeinit, NULL); } #define LOG_HTTP_CF_REQUEST_HOST 'h' @@ -611,7 +610,7 @@ OutputInitResult LogHttpLogInitCtx(ConfNode *conf) SCLogDebug("HTTP log output initialized"); /* enable the logger for the app layer */ - AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_HTTP); + AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_HTTP1); result.ctx = output_ctx; result.ok = true; diff --git a/src/output-json-alert.c b/src/output-json-alert.c index c0db7ef084..abc77b6766 100644 --- a/src/output-json-alert.c +++ b/src/output-json-alert.c @@ -447,7 +447,7 @@ static void AlertAddAppLayer(const Packet *p, JsonBuilder *jb, const AppProto proto = FlowGetAppProtocol(p->flow); JsonBuilderMark mark = { 0, 0, 0 }; switch (proto) { - case ALPROTO_HTTP: + case ALPROTO_HTTP1: // TODO: Could result in an empty http object being logged. jb_open_object(jb, "http"); if (EveHttpAddMetadata(p->flow, tx_id, jb)) { @@ -596,7 +596,7 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p) int have_xff_ip = 0; char xff_buffer[XFF_MAXLEN]; if ((xff_cfg != NULL) && !(xff_cfg->flags & XFF_DISABLED) && p->flow != NULL) { - if (FlowGetAppProtocol(p->flow) == ALPROTO_HTTP) { + if (FlowGetAppProtocol(p->flow) == ALPROTO_HTTP1) { if (pa->flags & PACKET_ALERT_FLAG_TX) { have_xff_ip = HttpXFFGetIPFromTx(p->flow, pa->tx_id, xff_cfg, xff_buffer, XFF_MAXLEN); diff --git a/src/output-json-file.c b/src/output-json-file.c index 5932c6ab8f..92018344a0 100644 --- a/src/output-json-file.c +++ b/src/output-json-file.c @@ -106,7 +106,7 @@ JsonBuilder *JsonBuildFileInfoRecord(const Packet *p, const File *ff, int have_xff_ip = 0; char xff_buffer[XFF_MAXLEN]; if ((xff_cfg != NULL) && !(xff_cfg->flags & XFF_DISABLED)) { - if (FlowGetAppProtocol(p->flow) == ALPROTO_HTTP) { + if (FlowGetAppProtocol(p->flow) == ALPROTO_HTTP1) { have_xff_ip = HttpXFFGetIPFromTx(p->flow, ff->txid, xff_cfg, xff_buffer, XFF_MAXLEN); } if (have_xff_ip && xff_cfg->flags & XFF_OVERWRITE) { @@ -125,7 +125,7 @@ JsonBuilder *JsonBuildFileInfoRecord(const Packet *p, const File *ff, JsonBuilderMark mark = { 0, 0, 0 }; switch (p->flow->alproto) { - case ALPROTO_HTTP: + case ALPROTO_HTTP1: jb_open_object(js, "http"); EveHttpAddMetadata(p->flow, ff->txid, js); jb_close(js); diff --git a/src/output-json-http.c b/src/output-json-http.c index 585a303681..598bf8a8ef 100644 --- a/src/output-json-http.c +++ b/src/output-json-http.c @@ -411,7 +411,7 @@ void EveHttpLogJSONBodyPrintable(JsonBuilder *js, Flow *f, uint64_t tx_id) { HtpState *htp_state = (HtpState *)FlowGetAppState(f); if (htp_state) { - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, tx_id); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, tx_id); if (tx) { HtpTxUserData *htud = (HtpTxUserData *)htp_tx_get_user_data(tx); if (htud != NULL) { @@ -446,7 +446,7 @@ void EveHttpLogJSONBodyBase64(JsonBuilder *js, Flow *f, uint64_t tx_id) { HtpState *htp_state = (HtpState *)FlowGetAppState(f); if (htp_state) { - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, tx_id); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, tx_id); if (tx) { HtpTxUserData *htud = (HtpTxUserData *)htp_tx_get_user_data(tx); if (htud != NULL) { @@ -529,7 +529,7 @@ bool EveHttpAddMetadata(const Flow *f, uint64_t tx_id, JsonBuilder *js) { HtpState *htp_state = (HtpState *)FlowGetAppState(f); if (htp_state) { - htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, tx_id); + htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, tx_id); if (tx) { EveHttpLogJSONBasic(js, tx); @@ -629,7 +629,7 @@ static OutputInitResult OutputHttpLogInitSub(ConfNode *conf, OutputCtx *parent_c output_ctx->DeInit = OutputHttpLogDeinitSub; /* enable the logger for the app layer */ - AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_HTTP); + AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_HTTP1); result.ctx = output_ctx; result.ok = true; @@ -690,7 +690,7 @@ static TmEcode JsonHttpLogThreadDeinit(ThreadVars *t, void *data) void JsonHttpLogRegister (void) { /* register as child of eve-log */ - OutputRegisterTxSubModule(LOGGER_JSON_HTTP, "eve-log", "JsonHttpLog", - "eve-log.http", OutputHttpLogInitSub, ALPROTO_HTTP, JsonHttpLogger, - JsonHttpLogThreadInit, JsonHttpLogThreadDeinit, NULL); + OutputRegisterTxSubModule(LOGGER_JSON_HTTP, "eve-log", "JsonHttpLog", "eve-log.http", + OutputHttpLogInitSub, ALPROTO_HTTP1, JsonHttpLogger, JsonHttpLogThreadInit, + JsonHttpLogThreadDeinit, NULL); } diff --git a/src/output-lua.c b/src/output-lua.c index 6cd77dec39..b65855fbec 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -513,7 +513,7 @@ static int LuaScriptInit(const char *filename, LogLuaScriptOptions *options) { SCLogDebug("k='%s', v='%s'", k, v); if (strcmp(k,"protocol") == 0 && strcmp(v, "http") == 0) - options->alproto = ALPROTO_HTTP; + options->alproto = ALPROTO_HTTP1; else if (strcmp(k,"protocol") == 0 && strcmp(v, "dns") == 0) options->alproto = ALPROTO_DNS; else if (strcmp(k,"protocol") == 0 && strcmp(v, "tls") == 0) @@ -783,25 +783,25 @@ static OutputInitResult OutputLuaLogInit(ConfNode *conf) om->ThreadInit = LuaLogThreadInit; om->ThreadDeinit = LuaLogThreadDeinit; - if (opts.alproto == ALPROTO_HTTP && opts.streaming) { + if (opts.alproto == ALPROTO_HTTP1 && opts.streaming) { om->StreamingLogFunc = LuaStreamingLogger; om->stream_type = STREAMING_HTTP_BODIES; - om->alproto = ALPROTO_HTTP; + om->alproto = ALPROTO_HTTP1; AppLayerHtpEnableRequestBodyCallback(); AppLayerHtpEnableResponseBodyCallback(); - } else if (opts.alproto == ALPROTO_HTTP) { + } else if (opts.alproto == ALPROTO_HTTP1) { om->TxLogFunc = LuaTxLogger; - om->alproto = ALPROTO_HTTP; + om->alproto = ALPROTO_HTTP1; om->ts_log_progress = -1; om->tc_log_progress = -1; - AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_HTTP); + AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_HTTP1); } else if (opts.alproto == ALPROTO_TLS) { om->TxLogFunc = LuaTxLogger; om->alproto = ALPROTO_TLS; om->tc_log_progress = TLS_HANDSHAKE_DONE; om->ts_log_progress = TLS_HANDSHAKE_DONE; AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_TLS); - } else if (opts.alproto == ALPROTO_DNS) { + } else if (opts.alproto == ALPROTO_DNS) { om->TxLogFunc = LuaTxLogger; om->alproto = ALPROTO_DNS; om->ts_log_progress = -1; diff --git a/src/output-streaming.c b/src/output-streaming.c index d445d88837..7cfc0218ec 100644 --- a/src/output-streaming.c +++ b/src/output-streaming.c @@ -164,11 +164,9 @@ static int HttpBodyIterator(Flow *f, int close, void *cbdata, uint8_t iflags) } const int tx_progress_done_value_ts = - AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP, - STREAM_TOSERVER); + AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP1, STREAM_TOSERVER); const int tx_progress_done_value_tc = - AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP, - STREAM_TOCLIENT); + AppLayerParserGetStateProgressCompletionStatus(ALPROTO_HTTP1, STREAM_TOCLIENT); const uint64_t total_txs = AppLayerParserGetTxCnt(f, f->alstate); uint64_t tx_id = 0; @@ -181,10 +179,10 @@ static int HttpBodyIterator(Flow *f, int close, void *cbdata, uint8_t iflags) int tx_done = 0; int tx_logged = 0; int tx_progress_ts = AppLayerParserGetStateProgress( - IPPROTO_TCP, ALPROTO_HTTP, tx, FlowGetDisruptionFlags(f, STREAM_TOSERVER)); + IPPROTO_TCP, ALPROTO_HTTP1, tx, FlowGetDisruptionFlags(f, STREAM_TOSERVER)); if (tx_progress_ts >= tx_progress_done_value_ts) { int tx_progress_tc = AppLayerParserGetStateProgress( - IPPROTO_TCP, ALPROTO_HTTP, tx, FlowGetDisruptionFlags(f, STREAM_TOCLIENT)); + IPPROTO_TCP, ALPROTO_HTTP1, tx, FlowGetDisruptionFlags(f, STREAM_TOCLIENT)); if (tx_progress_tc >= tx_progress_done_value_tc) { tx_done = 1; } @@ -351,7 +349,7 @@ static TmEcode OutputStreamingLog(ThreadVars *tv, Packet *p, void *thread_data) } } if (op_thread_data->loggers & (1<alproto == ALPROTO_HTTP && f->alstate != NULL) { + if (f->alproto == ALPROTO_HTTP1 && f->alstate != NULL) { int close = 0; TcpSession *ssn = f->protoctx; if (ssn) { diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 29b8abe3fe..90364ebbd6 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -2558,8 +2558,8 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); @@ -2582,9 +2582,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2607,9 +2607,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2632,9 +2632,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2656,9 +2656,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2682,9 +2682,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2708,9 +2708,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2733,9 +2733,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2760,9 +2760,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); FAIL_IF(ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED); FAIL_IF(!FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); FAIL_IF(!FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); @@ -2786,9 +2786,9 @@ static int StreamTcpReassembleTest39 (void) FAIL_IF(StreamTcpPacket(&tv, p, &stt, &pq) == -1); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); FAIL_IF(!StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); - FAIL_IF(f.alproto != ALPROTO_HTTP); - FAIL_IF(f.alproto_ts != ALPROTO_HTTP); - FAIL_IF(f.alproto_tc != ALPROTO_HTTP); + FAIL_IF(f.alproto != ALPROTO_HTTP1); + FAIL_IF(f.alproto_ts != ALPROTO_HTTP1); + FAIL_IF(f.alproto_tc != ALPROTO_HTTP1); StreamTcpPruneSession(&f, STREAM_TOSERVER); StreamTcpPruneSession(&f, STREAM_TOCLIENT); @@ -2944,7 +2944,7 @@ static int StreamTcpReassembleTest40 (void) ssn.server.last_ack = 16; SCLogDebug("8 -- start"); FAIL_IF(StreamTcpReassembleHandleSegment(&tv, ra_ctx, &ssn, s, p, &pq) == -1); - FAIL_IF(f->alproto != ALPROTO_HTTP); + FAIL_IF(f->alproto != ALPROTO_HTTP1); StreamTcpUTClearSession(&ssn); StreamTcpReassembleFreeThreadCtx(ra_ctx); @@ -3123,7 +3123,7 @@ static int StreamTcpReassembleTest47 (void) FAIL_IF(StreamTcpReassembleHandleSegment(&tv, ra_ctx, &ssn, s, p, &pq) == -1); } - FAIL_IF(f->alproto != ALPROTO_HTTP); + FAIL_IF(f->alproto != ALPROTO_HTTP1); StreamTcpUTClearSession(&ssn); StreamTcpReassembleFreeThreadCtx(ra_ctx); diff --git a/src/tests/detect-http-client-body.c b/src/tests/detect-http-client-body.c index a87a2249da..4ac57f6cdc 100644 --- a/src/tests/detect-http-client-body.c +++ b/src/tests/detect-http-client-body.c @@ -143,7 +143,7 @@ static int RunTest (struct TestSteps *steps, const char *sig, const char *yaml) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; SCLogDebug("sig %s", sig); Signature *s = DetectEngineAppendSig(de_ctx, (char *)sig); @@ -164,9 +164,9 @@ static int RunTest (struct TestSteps *steps, const char *sig, const char *yaml) p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - b->direction, (uint8_t *)b->input, - b->input_size ? b->input_size : strlen((const char *)b->input)); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, b->direction, + (uint8_t *)b->input, + b->input_size ? b->input_size : strlen((const char *)b->input)); FAIL_IF_NOT(r == 0); /* do detect */ @@ -1000,7 +1000,7 @@ static int DetectHttpClientBodyTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1020,8 +1020,8 @@ static int DetectHttpClientBodyTest06(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1105,7 +1105,7 @@ static int DetectHttpClientBodyTest07(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1125,8 +1125,8 @@ static int DetectHttpClientBodyTest07(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1147,8 +1147,8 @@ static int DetectHttpClientBodyTest07(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); goto end; @@ -1224,7 +1224,7 @@ static int DetectHttpClientBodyTest08(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1244,8 +1244,8 @@ static int DetectHttpClientBodyTest08(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1267,8 +1267,8 @@ static int DetectHttpClientBodyTest08(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1346,7 +1346,7 @@ static int DetectHttpClientBodyTest09(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1366,8 +1366,8 @@ static int DetectHttpClientBodyTest09(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1389,8 +1389,8 @@ static int DetectHttpClientBodyTest09(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1468,7 +1468,7 @@ static int DetectHttpClientBodyTest10(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1488,8 +1488,8 @@ static int DetectHttpClientBodyTest10(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1511,8 +1511,8 @@ static int DetectHttpClientBodyTest10(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1581,7 +1581,7 @@ static int DetectHttpClientBodyTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1601,8 +1601,8 @@ static int DetectHttpClientBodyTest11(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1677,7 +1677,7 @@ static int DetectHttpClientBodyTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1697,8 +1697,8 @@ static int DetectHttpClientBodyTest12(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1773,7 +1773,7 @@ static int DetectHttpClientBodyTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1793,8 +1793,8 @@ static int DetectHttpClientBodyTest13(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1870,7 +1870,7 @@ static int DetectHttpClientBodyTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1895,8 +1895,8 @@ static int DetectHttpClientBodyTest14(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); goto end; @@ -1910,8 +1910,7 @@ static int DetectHttpClientBodyTest14(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); goto end; @@ -1925,8 +1924,7 @@ static int DetectHttpClientBodyTest14(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); goto end; @@ -1940,8 +1938,7 @@ static int DetectHttpClientBodyTest14(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 4 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1956,8 +1953,7 @@ static int DetectHttpClientBodyTest14(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); if (r != 0) { printf("toserver chunk 5 returned %" PRId32 ", expected 0: ", r); goto end; @@ -1971,8 +1967,7 @@ static int DetectHttpClientBodyTest14(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); if (r != 0) { printf("toserver chunk 6 returned %" PRId32 ", expected 0: ", r); goto end; @@ -1988,8 +1983,7 @@ static int DetectHttpClientBodyTest14(void) SCLogDebug("sending data chunk 7"); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf7, httplen7); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf7, httplen7); if (r != 0) { printf("toserver chunk 7 returned %" PRId32 ", expected 0: ", r); goto end; @@ -2073,7 +2067,7 @@ static int DetectHttpClientBodyTest15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2098,8 +2092,8 @@ static int DetectHttpClientBodyTest15(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); goto end; @@ -2113,8 +2107,7 @@ static int DetectHttpClientBodyTest15(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); goto end; @@ -2128,8 +2121,7 @@ static int DetectHttpClientBodyTest15(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); goto end; @@ -2143,8 +2135,7 @@ static int DetectHttpClientBodyTest15(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 4 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2159,8 +2150,7 @@ static int DetectHttpClientBodyTest15(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); if (r != 0) { printf("toserver chunk 5 returned %" PRId32 ", expected 0: ", r); goto end; @@ -2174,8 +2164,7 @@ static int DetectHttpClientBodyTest15(void) } p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); if (r != 0) { printf("toserver chunk 6 returned %" PRId32 ", expected 0: ", r); goto end; @@ -2191,8 +2180,7 @@ static int DetectHttpClientBodyTest15(void) SCLogDebug("sending data chunk 7"); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf7, httplen7); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf7, httplen7); if (r != 0) { printf("toserver chunk 7 returned %" PRId32 ", expected 0: ", r); goto end; @@ -2219,8 +2207,8 @@ static int DetectHttpClientBodyTest15(void) goto end; } - htp_tx_t *t1 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 0); - htp_tx_t *t2 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, 1); + htp_tx_t *t1 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 0); + htp_tx_t *t2 = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP1, htp_state, 1); HtpTxUserData *htud = (HtpTxUserData *) htp_tx_get_user_data(t1); diff --git a/src/tests/detect-http-cookie.c b/src/tests/detect-http-cookie.c index 86cebfb911..90a5b15a1c 100644 --- a/src/tests/detect-http-cookie.c +++ b/src/tests/detect-http-cookie.c @@ -82,7 +82,7 @@ static int DetectEngineHttpCookieTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -103,8 +103,8 @@ static int DetectEngineHttpCookieTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -177,7 +177,7 @@ static int DetectEngineHttpCookieTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -198,8 +198,8 @@ static int DetectEngineHttpCookieTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -272,7 +272,7 @@ static int DetectEngineHttpCookieTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -293,8 +293,8 @@ static int DetectEngineHttpCookieTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -367,7 +367,7 @@ static int DetectEngineHttpCookieTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -388,8 +388,8 @@ static int DetectEngineHttpCookieTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -462,7 +462,7 @@ static int DetectEngineHttpCookieTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -483,8 +483,8 @@ static int DetectEngineHttpCookieTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -557,7 +557,7 @@ static int DetectEngineHttpCookieTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -578,8 +578,8 @@ static int DetectEngineHttpCookieTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -652,7 +652,7 @@ static int DetectEngineHttpCookieTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -673,8 +673,8 @@ static int DetectEngineHttpCookieTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -747,7 +747,7 @@ static int DetectEngineHttpCookieTest08(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -768,8 +768,8 @@ static int DetectEngineHttpCookieTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -842,7 +842,7 @@ static int DetectEngineHttpCookieTest09(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -863,8 +863,8 @@ static int DetectEngineHttpCookieTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -937,7 +937,7 @@ static int DetectEngineHttpCookieTest10(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -959,8 +959,8 @@ static int DetectEngineHttpCookieTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1033,7 +1033,7 @@ static int DetectEngineHttpCookieTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1055,8 +1055,8 @@ static int DetectEngineHttpCookieTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1129,7 +1129,7 @@ static int DetectEngineHttpCookieTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1151,8 +1151,8 @@ static int DetectEngineHttpCookieTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1225,7 +1225,7 @@ static int DetectEngineHttpCookieTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1247,8 +1247,8 @@ static int DetectEngineHttpCookieTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1321,7 +1321,7 @@ static int DetectEngineHttpCookieTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1343,8 +1343,8 @@ static int DetectEngineHttpCookieTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1417,7 +1417,7 @@ static int DetectEngineHttpCookieTest15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1439,8 +1439,8 @@ static int DetectEngineHttpCookieTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1513,7 +1513,7 @@ static int DetectEngineHttpCookieTest16(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1535,8 +1535,8 @@ static int DetectEngineHttpCookieTest16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1609,7 +1609,7 @@ static int DetectEngineHttpCookieTest17(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1631,8 +1631,8 @@ static int DetectEngineHttpCookieTest17(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1887,7 +1887,7 @@ static int DetectHttpCookieSigTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1916,8 +1916,8 @@ static int DetectHttpCookieSigTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1993,7 +1993,7 @@ static int DetectHttpCookieSigTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2015,8 +2015,8 @@ static int DetectHttpCookieSigTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2086,7 +2086,7 @@ static int DetectHttpCookieSigTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2108,8 +2108,8 @@ static int DetectHttpCookieSigTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2180,7 +2180,7 @@ static int DetectHttpCookieSigTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2202,8 +2202,8 @@ static int DetectHttpCookieSigTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2274,7 +2274,7 @@ static int DetectHttpCookieSigTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2296,8 +2296,8 @@ static int DetectHttpCookieSigTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2368,7 +2368,7 @@ static int DetectHttpCookieSigTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2391,8 +2391,8 @@ static int DetectHttpCookieSigTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2461,7 +2461,7 @@ static int DetectHttpCookieSigTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2483,8 +2483,8 @@ static int DetectHttpCookieSigTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2559,7 +2559,7 @@ static int DetectHttpCookieSigTest08(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP); p1->flow = &f; @@ -2594,9 +2594,8 @@ static int DetectHttpCookieSigTest08(void) /* request */ FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf_request, - httpbuf_request_len); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf_request, + httpbuf_request_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2619,9 +2618,8 @@ static int DetectHttpCookieSigTest08(void) /* response */ FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf_response, - httpbuf_response_len); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf_response, + httpbuf_response_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2691,7 +2689,7 @@ static int DetectHttpCookieSigTest09(void) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p1 = UTHBuildPacket(NULL, 0, IPPROTO_TCP); p1->flow = &f; @@ -2732,9 +2730,8 @@ static int DetectHttpCookieSigTest09(void) /* request */ FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf_request, - httpbuf_request_len); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf_request, + httpbuf_request_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2757,9 +2754,8 @@ static int DetectHttpCookieSigTest09(void) /* response */ FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf_response, - httpbuf_response_len); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf_response, + httpbuf_response_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; diff --git a/src/tests/detect-http-header.c b/src/tests/detect-http-header.c index 9949513c9f..6f3b5763b7 100644 --- a/src/tests/detect-http-header.c +++ b/src/tests/detect-http-header.c @@ -164,7 +164,7 @@ static int DetectHttpHeaderTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -185,8 +185,8 @@ static int DetectHttpHeaderTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -271,7 +271,7 @@ static int DetectHttpHeaderTest07(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -289,8 +289,8 @@ static int DetectHttpHeaderTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FAIL_IF_NULL(det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF(r != 0); HtpState *http_state = f.alstate; @@ -300,8 +300,8 @@ static int DetectHttpHeaderTest07(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p1); FAIL_IF( (PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF(r != 0); /* do detect */ @@ -365,7 +365,7 @@ static int DetectHttpHeaderTest08(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -386,8 +386,8 @@ static int DetectHttpHeaderTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -412,8 +412,8 @@ static int DetectHttpHeaderTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -491,7 +491,7 @@ static int DetectHttpHeaderTest09(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -513,8 +513,8 @@ static int DetectHttpHeaderTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -539,8 +539,8 @@ static int DetectHttpHeaderTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -618,7 +618,7 @@ static int DetectHttpHeaderTest10(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -639,8 +639,8 @@ static int DetectHttpHeaderTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -665,8 +665,8 @@ static int DetectHttpHeaderTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -736,7 +736,7 @@ static int DetectHttpHeaderTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -757,8 +757,8 @@ static int DetectHttpHeaderTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -834,7 +834,7 @@ static int DetectHttpHeaderTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -855,8 +855,8 @@ static int DetectHttpHeaderTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -933,7 +933,7 @@ static int DetectHttpHeaderTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -954,8 +954,8 @@ static int DetectHttpHeaderTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1330,7 +1330,7 @@ static int DetectHttpHeaderTest28(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1350,8 +1350,8 @@ static int DetectHttpHeaderTest28(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1414,7 +1414,7 @@ static int DetectHttpHeaderTest29(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1434,8 +1434,8 @@ static int DetectHttpHeaderTest29(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1498,7 +1498,7 @@ static int DetectHttpHeaderTest30(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1518,8 +1518,8 @@ static int DetectHttpHeaderTest30(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1609,7 +1609,7 @@ static int DetectEngineHttpHeaderTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1630,8 +1630,8 @@ static int DetectEngineHttpHeaderTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1702,7 +1702,7 @@ static int DetectEngineHttpHeaderTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1723,8 +1723,8 @@ static int DetectEngineHttpHeaderTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1795,7 +1795,7 @@ static int DetectEngineHttpHeaderTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1816,8 +1816,8 @@ static int DetectEngineHttpHeaderTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1888,7 +1888,7 @@ static int DetectEngineHttpHeaderTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1909,8 +1909,8 @@ static int DetectEngineHttpHeaderTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1981,7 +1981,7 @@ static int DetectEngineHttpHeaderTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2002,8 +2002,8 @@ static int DetectEngineHttpHeaderTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2074,7 +2074,7 @@ static int DetectEngineHttpHeaderTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2095,8 +2095,8 @@ static int DetectEngineHttpHeaderTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2167,7 +2167,7 @@ static int DetectEngineHttpHeaderTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2188,8 +2188,8 @@ static int DetectEngineHttpHeaderTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2260,7 +2260,7 @@ static int DetectEngineHttpHeaderTest08(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2281,8 +2281,8 @@ static int DetectEngineHttpHeaderTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2353,7 +2353,7 @@ static int DetectEngineHttpHeaderTest09(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2374,8 +2374,8 @@ static int DetectEngineHttpHeaderTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2446,7 +2446,7 @@ static int DetectEngineHttpHeaderTest10(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2467,8 +2467,8 @@ static int DetectEngineHttpHeaderTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2539,7 +2539,7 @@ static int DetectEngineHttpHeaderTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2560,8 +2560,8 @@ static int DetectEngineHttpHeaderTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2632,7 +2632,7 @@ static int DetectEngineHttpHeaderTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2653,8 +2653,8 @@ static int DetectEngineHttpHeaderTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2725,7 +2725,7 @@ static int DetectEngineHttpHeaderTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2746,8 +2746,8 @@ static int DetectEngineHttpHeaderTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2818,7 +2818,7 @@ static int DetectEngineHttpHeaderTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2839,8 +2839,8 @@ static int DetectEngineHttpHeaderTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2911,7 +2911,7 @@ static int DetectEngineHttpHeaderTest15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2932,8 +2932,8 @@ static int DetectEngineHttpHeaderTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3004,7 +3004,7 @@ static int DetectEngineHttpHeaderTest16(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3025,8 +3025,8 @@ static int DetectEngineHttpHeaderTest16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3097,7 +3097,7 @@ static int DetectEngineHttpHeaderTest17(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3118,8 +3118,8 @@ static int DetectEngineHttpHeaderTest17(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3197,7 +3197,7 @@ static int DetectEngineHttpHeaderTest20(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3219,8 +3219,8 @@ static int DetectEngineHttpHeaderTest20(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3245,8 +3245,8 @@ static int DetectEngineHttpHeaderTest20(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3319,7 +3319,7 @@ static int DetectEngineHttpHeaderTest21(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3341,8 +3341,8 @@ static int DetectEngineHttpHeaderTest21(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3367,8 +3367,8 @@ static int DetectEngineHttpHeaderTest21(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3441,7 +3441,7 @@ static int DetectEngineHttpHeaderTest22(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3463,8 +3463,8 @@ static int DetectEngineHttpHeaderTest22(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3489,8 +3489,8 @@ static int DetectEngineHttpHeaderTest22(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3563,7 +3563,7 @@ static int DetectEngineHttpHeaderTest23(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3585,8 +3585,8 @@ static int DetectEngineHttpHeaderTest23(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3611,8 +3611,8 @@ static int DetectEngineHttpHeaderTest23(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3685,7 +3685,7 @@ static int DetectEngineHttpHeaderTest24(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3707,8 +3707,8 @@ static int DetectEngineHttpHeaderTest24(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3733,8 +3733,8 @@ static int DetectEngineHttpHeaderTest24(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3807,7 +3807,7 @@ static int DetectEngineHttpHeaderTest25(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3829,8 +3829,8 @@ static int DetectEngineHttpHeaderTest25(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3855,8 +3855,8 @@ static int DetectEngineHttpHeaderTest25(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3929,7 +3929,7 @@ static int DetectEngineHttpHeaderTest26(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3951,8 +3951,8 @@ static int DetectEngineHttpHeaderTest26(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3977,8 +3977,8 @@ static int DetectEngineHttpHeaderTest26(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -4051,7 +4051,7 @@ static int DetectEngineHttpHeaderTest27(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4073,8 +4073,8 @@ static int DetectEngineHttpHeaderTest27(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4099,8 +4099,8 @@ static int DetectEngineHttpHeaderTest27(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -4178,7 +4178,7 @@ static int DetectEngineHttpHeaderTest28(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4199,8 +4199,8 @@ static int DetectEngineHttpHeaderTest28(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4225,8 +4225,8 @@ static int DetectEngineHttpHeaderTest28(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -4301,7 +4301,7 @@ static int DetectEngineHttpHeaderTest29(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4322,8 +4322,8 @@ static int DetectEngineHttpHeaderTest29(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4348,8 +4348,8 @@ static int DetectEngineHttpHeaderTest29(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -4458,7 +4458,7 @@ static int DetectEngineHttpHeaderTest30(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4479,8 +4479,8 @@ static int DetectEngineHttpHeaderTest30(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4505,8 +4505,8 @@ static int DetectEngineHttpHeaderTest30(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -4575,7 +4575,7 @@ static int DetectEngineHttpHeaderTest31(void) p1->flowflags |= FLOW_PKT_TOSERVER; p1->flowflags |= FLOW_PKT_ESTABLISHED; p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4598,8 +4598,8 @@ static int DetectEngineHttpHeaderTest31(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4678,7 +4678,7 @@ static int DetectEngineHttpHeaderTest32(void) p1->flowflags |= FLOW_PKT_TOSERVER; p1->flowflags |= FLOW_PKT_ESTABLISHED; p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4698,8 +4698,8 @@ static int DetectEngineHttpHeaderTest32(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4787,7 +4787,7 @@ static int DetectEngineHttpHeaderTest33(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4803,8 +4803,8 @@ static int DetectEngineHttpHeaderTest33(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); http_state = f.alstate; @@ -4815,8 +4815,8 @@ static int DetectEngineHttpHeaderTest33(void) FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); /* do detect */ @@ -4893,7 +4893,7 @@ static int DetectEngineHttpHeaderTest34(void) p3->flowflags |= FLOW_PKT_ESTABLISHED; p3->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p3->pcap_cnt = 3; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4909,8 +4909,8 @@ static int DetectEngineHttpHeaderTest34(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); http_state = f.alstate; @@ -4920,16 +4920,16 @@ static int DetectEngineHttpHeaderTest34(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p1); FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); /* do detect */ SigMatchSignatures(&th_v, de_ctx, det_ctx, p2); FAIL_IF(PacketAlertCheck(p2, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http3_buf, http3_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http3_buf, http3_len); FAIL_IF_NOT(r == 0); /* do detect */ @@ -5006,7 +5006,7 @@ static int DetectEngineHttpHeaderTest35(void) p3->flowflags |= FLOW_PKT_ESTABLISHED; p3->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p3->pcap_cnt = 3; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5022,8 +5022,8 @@ static int DetectEngineHttpHeaderTest35(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); http_state = f.alstate; @@ -5033,16 +5033,16 @@ static int DetectEngineHttpHeaderTest35(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p1); FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); /* do detect */ SigMatchSignatures(&th_v, de_ctx, det_ctx, p2); FAIL_IF(PacketAlertCheck(p2, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http3_buf, http3_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http3_buf, http3_len); FAIL_IF_NOT(r == 0); /* do detect */ diff --git a/src/tests/detect-http-host.c b/src/tests/detect-http-host.c index 41b7acdc15..02d6a26da3 100644 --- a/src/tests/detect-http-host.c +++ b/src/tests/detect-http-host.c @@ -78,7 +78,7 @@ static int DetectEngineHttpHHTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -99,8 +99,8 @@ static int DetectEngineHttpHHTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -177,7 +177,7 @@ static int DetectEngineHttpHHTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -198,8 +198,8 @@ static int DetectEngineHttpHHTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -276,7 +276,7 @@ static int DetectEngineHttpHHTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -297,8 +297,8 @@ static int DetectEngineHttpHHTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -375,7 +375,7 @@ static int DetectEngineHttpHHTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -396,8 +396,8 @@ static int DetectEngineHttpHHTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -474,7 +474,7 @@ static int DetectEngineHttpHHTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -495,8 +495,8 @@ static int DetectEngineHttpHHTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -573,7 +573,7 @@ static int DetectEngineHttpHHTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -594,8 +594,8 @@ static int DetectEngineHttpHHTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -672,7 +672,7 @@ static int DetectEngineHttpHHTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -693,8 +693,8 @@ static int DetectEngineHttpHHTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -771,7 +771,7 @@ static int DetectEngineHttpHHTest08(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -792,8 +792,8 @@ static int DetectEngineHttpHHTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -870,7 +870,7 @@ static int DetectEngineHttpHHTest09(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -891,8 +891,8 @@ static int DetectEngineHttpHHTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -969,7 +969,7 @@ static int DetectEngineHttpHHTest10(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -991,8 +991,8 @@ static int DetectEngineHttpHHTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1069,7 +1069,7 @@ static int DetectEngineHttpHHTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1091,8 +1091,8 @@ static int DetectEngineHttpHHTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1169,7 +1169,7 @@ static int DetectEngineHttpHHTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1191,8 +1191,8 @@ static int DetectEngineHttpHHTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1269,7 +1269,7 @@ static int DetectEngineHttpHHTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1291,8 +1291,8 @@ static int DetectEngineHttpHHTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1369,7 +1369,7 @@ static int DetectEngineHttpHHTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1391,8 +1391,8 @@ static int DetectEngineHttpHHTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1469,7 +1469,7 @@ static int DetectEngineHttpHHTest15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1491,8 +1491,8 @@ static int DetectEngineHttpHHTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1569,7 +1569,7 @@ static int DetectEngineHttpHHTest16(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1591,8 +1591,8 @@ static int DetectEngineHttpHHTest16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1669,7 +1669,7 @@ static int DetectEngineHttpHHTest17(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1691,8 +1691,8 @@ static int DetectEngineHttpHHTest17(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1765,7 +1765,7 @@ static int DetectEngineHttpHHTest18(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1786,8 +1786,8 @@ static int DetectEngineHttpHHTest18(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1860,7 +1860,7 @@ static int DetectEngineHttpHHTest19(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1881,8 +1881,8 @@ static int DetectEngineHttpHHTest19(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1955,7 +1955,7 @@ static int DetectEngineHttpHHTest20(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1976,8 +1976,8 @@ static int DetectEngineHttpHHTest20(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2049,7 +2049,7 @@ static int DetectEngineHttpHHTest21(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2070,8 +2070,8 @@ static int DetectEngineHttpHHTest21(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2143,7 +2143,7 @@ static int DetectEngineHttpHHTest22(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2164,8 +2164,8 @@ static int DetectEngineHttpHHTest22(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2237,7 +2237,7 @@ static int DetectEngineHttpHHTest23(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2258,8 +2258,8 @@ static int DetectEngineHttpHHTest23(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2332,7 +2332,7 @@ static int DetectEngineHttpHHTest24(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2353,8 +2353,8 @@ static int DetectEngineHttpHHTest24(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2427,7 +2427,7 @@ static int DetectEngineHttpHHTest25(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2448,8 +2448,8 @@ static int DetectEngineHttpHHTest25(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2677,7 +2677,7 @@ static int DetectHttpHHTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2698,8 +2698,8 @@ static int DetectHttpHHTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2781,7 +2781,7 @@ static int DetectHttpHHTest07(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2802,8 +2802,8 @@ static int DetectHttpHHTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2827,8 +2827,8 @@ static int DetectHttpHHTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2902,7 +2902,7 @@ static int DetectHttpHHTest08(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2923,8 +2923,8 @@ static int DetectHttpHHTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2949,8 +2949,8 @@ static int DetectHttpHHTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3030,7 +3030,7 @@ static int DetectHttpHHTest09(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3051,8 +3051,8 @@ static int DetectHttpHHTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3077,8 +3077,8 @@ static int DetectHttpHHTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3158,7 +3158,7 @@ static int DetectHttpHHTest10(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3179,8 +3179,8 @@ static int DetectHttpHHTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3205,8 +3205,8 @@ static int DetectHttpHHTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3276,7 +3276,7 @@ static int DetectHttpHHTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3297,8 +3297,8 @@ static int DetectHttpHHTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3372,7 +3372,7 @@ static int DetectHttpHHTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3393,8 +3393,8 @@ static int DetectHttpHHTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3469,7 +3469,7 @@ static int DetectHttpHHTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3490,8 +3490,8 @@ static int DetectHttpHHTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3569,7 +3569,7 @@ static int DetectHttpHHTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3595,8 +3595,8 @@ static int DetectHttpHHTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3613,8 +3613,7 @@ static int DetectHttpHHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3631,8 +3630,7 @@ static int DetectHttpHHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3649,8 +3647,7 @@ static int DetectHttpHHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 5 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3667,8 +3664,7 @@ static int DetectHttpHHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); if (r != 0) { printf("toserver chunk 6 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3687,8 +3683,7 @@ static int DetectHttpHHTest14(void) SCLogDebug("sending data chunk 7"); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); if (r != 0) { printf("toserver chunk 7 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4559,7 +4554,7 @@ static int DetectHttpHRHTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4580,8 +4575,8 @@ static int DetectHttpHRHTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4663,7 +4658,7 @@ static int DetectHttpHRHTest07(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4684,8 +4679,8 @@ static int DetectHttpHRHTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4709,8 +4704,8 @@ static int DetectHttpHRHTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4784,7 +4779,7 @@ static int DetectHttpHRHTest08(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4805,8 +4800,8 @@ static int DetectHttpHRHTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4831,8 +4826,8 @@ static int DetectHttpHRHTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4912,7 +4907,7 @@ static int DetectHttpHRHTest09(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4933,8 +4928,8 @@ static int DetectHttpHRHTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4959,8 +4954,8 @@ static int DetectHttpHRHTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5040,7 +5035,7 @@ static int DetectHttpHRHTest10(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5061,8 +5056,8 @@ static int DetectHttpHRHTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5087,8 +5082,8 @@ static int DetectHttpHRHTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5157,7 +5152,7 @@ static int DetectHttpHRHTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5178,8 +5173,8 @@ static int DetectHttpHRHTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5253,7 +5248,7 @@ static int DetectHttpHRHTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5274,8 +5269,8 @@ static int DetectHttpHRHTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5350,7 +5345,7 @@ static int DetectHttpHRHTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5371,8 +5366,8 @@ static int DetectHttpHRHTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5450,7 +5445,7 @@ static int DetectHttpHRHTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5476,8 +5471,8 @@ static int DetectHttpHRHTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -5494,8 +5489,7 @@ static int DetectHttpHRHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -5512,8 +5506,7 @@ static int DetectHttpHRHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -5530,8 +5523,7 @@ static int DetectHttpHRHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 5 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -5548,8 +5540,7 @@ static int DetectHttpHRHTest14(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); if (r != 0) { printf("toserver chunk 6 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -5568,8 +5559,7 @@ static int DetectHttpHRHTest14(void) SCLogDebug("sending data chunk 7"); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); if (r != 0) { printf("toserver chunk 7 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -6334,7 +6324,7 @@ static int DetectHttpHRHTest37(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6355,8 +6345,8 @@ static int DetectHttpHRHTest37(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6381,8 +6371,8 @@ static int DetectHttpHRHTest37(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6448,7 +6438,7 @@ static int DetectEngineHttpHRHTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6469,8 +6459,8 @@ static int DetectEngineHttpHRHTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6543,7 +6533,7 @@ static int DetectEngineHttpHRHTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6564,8 +6554,8 @@ static int DetectEngineHttpHRHTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6638,7 +6628,7 @@ static int DetectEngineHttpHRHTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6659,8 +6649,8 @@ static int DetectEngineHttpHRHTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6733,7 +6723,7 @@ static int DetectEngineHttpHRHTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6754,8 +6744,8 @@ static int DetectEngineHttpHRHTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6828,7 +6818,7 @@ static int DetectEngineHttpHRHTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6849,8 +6839,8 @@ static int DetectEngineHttpHRHTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6923,7 +6913,7 @@ static int DetectEngineHttpHRHTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6944,8 +6934,8 @@ static int DetectEngineHttpHRHTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7018,7 +7008,7 @@ static int DetectEngineHttpHRHTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7039,8 +7029,8 @@ static int DetectEngineHttpHRHTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7113,7 +7103,7 @@ static int DetectEngineHttpHRHTest08(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7134,8 +7124,8 @@ static int DetectEngineHttpHRHTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7208,7 +7198,7 @@ static int DetectEngineHttpHRHTest09(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7229,8 +7219,8 @@ static int DetectEngineHttpHRHTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7303,7 +7293,7 @@ static int DetectEngineHttpHRHTest10(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7325,8 +7315,8 @@ static int DetectEngineHttpHRHTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7399,7 +7389,7 @@ static int DetectEngineHttpHRHTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7421,8 +7411,8 @@ static int DetectEngineHttpHRHTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7495,7 +7485,7 @@ static int DetectEngineHttpHRHTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7517,8 +7507,8 @@ static int DetectEngineHttpHRHTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7591,7 +7581,7 @@ static int DetectEngineHttpHRHTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7613,8 +7603,8 @@ static int DetectEngineHttpHRHTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7687,7 +7677,7 @@ static int DetectEngineHttpHRHTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7709,8 +7699,8 @@ static int DetectEngineHttpHRHTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7783,7 +7773,7 @@ static int DetectEngineHttpHRHTest15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7805,8 +7795,8 @@ static int DetectEngineHttpHRHTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7879,7 +7869,7 @@ static int DetectEngineHttpHRHTest16(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7901,8 +7891,8 @@ static int DetectEngineHttpHRHTest16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7975,7 +7965,7 @@ static int DetectEngineHttpHRHTest17(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7997,8 +7987,8 @@ static int DetectEngineHttpHRHTest17(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8067,7 +8057,7 @@ static int DetectEngineHttpHRHTest18(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8088,8 +8078,8 @@ static int DetectEngineHttpHRHTest18(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8158,7 +8148,7 @@ static int DetectEngineHttpHRHTest19(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8179,8 +8169,8 @@ static int DetectEngineHttpHRHTest19(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8249,7 +8239,7 @@ static int DetectEngineHttpHRHTest20(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8270,8 +8260,8 @@ static int DetectEngineHttpHRHTest20(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8339,7 +8329,7 @@ static int DetectEngineHttpHRHTest21(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8360,8 +8350,8 @@ static int DetectEngineHttpHRHTest21(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8429,7 +8419,7 @@ static int DetectEngineHttpHRHTest22(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8450,8 +8440,8 @@ static int DetectEngineHttpHRHTest22(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8519,7 +8509,7 @@ static int DetectEngineHttpHRHTest23(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8540,8 +8530,8 @@ static int DetectEngineHttpHRHTest23(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8610,7 +8600,7 @@ static int DetectEngineHttpHRHTest24(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8631,8 +8621,8 @@ static int DetectEngineHttpHRHTest24(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8701,7 +8691,7 @@ static int DetectEngineHttpHRHTest25(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8722,8 +8712,8 @@ static int DetectEngineHttpHRHTest25(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; diff --git a/src/tests/detect-http-method.c b/src/tests/detect-http-method.c index e0a815b2a2..02a9708bb8 100644 --- a/src/tests/detect-http-method.c +++ b/src/tests/detect-http-method.c @@ -77,7 +77,7 @@ static int DetectEngineHttpMethodTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -98,8 +98,8 @@ static int DetectEngineHttpMethodTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -171,7 +171,7 @@ static int DetectEngineHttpMethodTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -192,8 +192,8 @@ static int DetectEngineHttpMethodTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -265,7 +265,7 @@ static int DetectEngineHttpMethodTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -286,8 +286,8 @@ static int DetectEngineHttpMethodTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -359,7 +359,7 @@ static int DetectEngineHttpMethodTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -380,8 +380,8 @@ static int DetectEngineHttpMethodTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -453,7 +453,7 @@ static int DetectEngineHttpMethodTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -474,8 +474,8 @@ static int DetectEngineHttpMethodTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -547,7 +547,7 @@ static int DetectEngineHttpMethodTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -568,8 +568,8 @@ static int DetectEngineHttpMethodTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -641,7 +641,7 @@ static int DetectEngineHttpMethodTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -662,8 +662,8 @@ static int DetectEngineHttpMethodTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -735,7 +735,7 @@ static int DetectEngineHttpMethodTest08(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -756,8 +756,8 @@ static int DetectEngineHttpMethodTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -829,7 +829,7 @@ static int DetectEngineHttpMethodTest09(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -850,8 +850,8 @@ static int DetectEngineHttpMethodTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -923,7 +923,7 @@ static int DetectEngineHttpMethodTest10(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -945,8 +945,8 @@ static int DetectEngineHttpMethodTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1018,7 +1018,7 @@ static int DetectEngineHttpMethodTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1040,8 +1040,8 @@ static int DetectEngineHttpMethodTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1113,7 +1113,7 @@ static int DetectEngineHttpMethodTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1135,8 +1135,8 @@ static int DetectEngineHttpMethodTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1208,7 +1208,7 @@ static int DetectEngineHttpMethodTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1230,8 +1230,8 @@ static int DetectEngineHttpMethodTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1303,7 +1303,7 @@ static int DetectEngineHttpMethodTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1325,8 +1325,8 @@ static int DetectEngineHttpMethodTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1398,7 +1398,7 @@ static int DetectEngineHttpMethodTest15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1420,8 +1420,8 @@ static int DetectEngineHttpMethodTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1493,7 +1493,7 @@ static int DetectEngineHttpMethodTest16(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1515,8 +1515,8 @@ static int DetectEngineHttpMethodTest16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1588,7 +1588,7 @@ static int DetectEngineHttpMethodTest17(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1610,8 +1610,8 @@ static int DetectEngineHttpMethodTest17(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1940,7 +1940,7 @@ static int DetectHttpMethodSigTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1973,8 +1973,8 @@ static int DetectHttpMethodSigTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { SCLogDebug("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2043,7 +2043,7 @@ static int DetectHttpMethodSigTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2076,8 +2076,8 @@ static int DetectHttpMethodSigTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { SCLogDebug("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2146,7 +2146,7 @@ static int DetectHttpMethodSigTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2171,8 +2171,8 @@ static int DetectHttpMethodSigTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { SCLogDebug("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2238,7 +2238,7 @@ static int DetectHttpMethodSigTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2267,8 +2267,8 @@ static int DetectHttpMethodSigTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { SCLogDebug("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); diff --git a/src/tests/detect-http-raw-header.c b/src/tests/detect-http-raw-header.c index 283d8010c7..5f74b971b5 100644 --- a/src/tests/detect-http-raw-header.c +++ b/src/tests/detect-http-raw-header.c @@ -123,7 +123,7 @@ static int DetectEngineHttpRawHeaderTest01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -144,8 +144,8 @@ static int DetectEngineHttpRawHeaderTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -216,7 +216,7 @@ static int DetectEngineHttpRawHeaderTest02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -237,8 +237,8 @@ static int DetectEngineHttpRawHeaderTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -309,7 +309,7 @@ static int DetectEngineHttpRawHeaderTest03(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -330,8 +330,8 @@ static int DetectEngineHttpRawHeaderTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -402,7 +402,7 @@ static int DetectEngineHttpRawHeaderTest04(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -423,8 +423,8 @@ static int DetectEngineHttpRawHeaderTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -495,7 +495,7 @@ static int DetectEngineHttpRawHeaderTest05(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -516,8 +516,8 @@ static int DetectEngineHttpRawHeaderTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -588,7 +588,7 @@ static int DetectEngineHttpRawHeaderTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -609,8 +609,8 @@ static int DetectEngineHttpRawHeaderTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -681,7 +681,7 @@ static int DetectEngineHttpRawHeaderTest07(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -702,8 +702,8 @@ static int DetectEngineHttpRawHeaderTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -774,7 +774,7 @@ static int DetectEngineHttpRawHeaderTest08(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -795,8 +795,8 @@ static int DetectEngineHttpRawHeaderTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -867,7 +867,7 @@ static int DetectEngineHttpRawHeaderTest09(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -888,8 +888,8 @@ static int DetectEngineHttpRawHeaderTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -960,7 +960,7 @@ static int DetectEngineHttpRawHeaderTest10(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -981,8 +981,8 @@ static int DetectEngineHttpRawHeaderTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1053,7 +1053,7 @@ static int DetectEngineHttpRawHeaderTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1074,8 +1074,8 @@ static int DetectEngineHttpRawHeaderTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1146,7 +1146,7 @@ static int DetectEngineHttpRawHeaderTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1167,8 +1167,8 @@ static int DetectEngineHttpRawHeaderTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1239,7 +1239,7 @@ static int DetectEngineHttpRawHeaderTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1260,8 +1260,8 @@ static int DetectEngineHttpRawHeaderTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1332,7 +1332,7 @@ static int DetectEngineHttpRawHeaderTest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1353,8 +1353,8 @@ static int DetectEngineHttpRawHeaderTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1425,7 +1425,7 @@ static int DetectEngineHttpRawHeaderTest15(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1446,8 +1446,8 @@ static int DetectEngineHttpRawHeaderTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1518,7 +1518,7 @@ static int DetectEngineHttpRawHeaderTest16(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1539,8 +1539,8 @@ static int DetectEngineHttpRawHeaderTest16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1611,7 +1611,7 @@ static int DetectEngineHttpRawHeaderTest17(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1632,8 +1632,8 @@ static int DetectEngineHttpRawHeaderTest17(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1709,7 +1709,7 @@ static int DetectEngineHttpRawHeaderTest20(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1727,8 +1727,8 @@ static int DetectEngineHttpRawHeaderTest20(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FAIL_IF_NULL(det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); HtpState *http_state = f.alstate; @@ -1738,8 +1738,8 @@ static int DetectEngineHttpRawHeaderTest20(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p1); FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); /* do detect */ @@ -1799,7 +1799,7 @@ static int DetectEngineHttpRawHeaderTest21(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1821,8 +1821,8 @@ static int DetectEngineHttpRawHeaderTest21(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1847,8 +1847,8 @@ static int DetectEngineHttpRawHeaderTest21(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1921,7 +1921,7 @@ static int DetectEngineHttpRawHeaderTest22(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1943,8 +1943,8 @@ static int DetectEngineHttpRawHeaderTest22(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1969,8 +1969,8 @@ static int DetectEngineHttpRawHeaderTest22(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2043,7 +2043,7 @@ static int DetectEngineHttpRawHeaderTest23(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2065,8 +2065,8 @@ static int DetectEngineHttpRawHeaderTest23(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2091,8 +2091,8 @@ static int DetectEngineHttpRawHeaderTest23(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2165,7 +2165,7 @@ static int DetectEngineHttpRawHeaderTest24(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2187,8 +2187,8 @@ static int DetectEngineHttpRawHeaderTest24(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2213,8 +2213,8 @@ static int DetectEngineHttpRawHeaderTest24(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2287,7 +2287,7 @@ static int DetectEngineHttpRawHeaderTest25(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2309,8 +2309,8 @@ static int DetectEngineHttpRawHeaderTest25(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2335,8 +2335,8 @@ static int DetectEngineHttpRawHeaderTest25(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2409,7 +2409,7 @@ static int DetectEngineHttpRawHeaderTest26(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2431,8 +2431,8 @@ static int DetectEngineHttpRawHeaderTest26(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2457,8 +2457,8 @@ static int DetectEngineHttpRawHeaderTest26(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2529,7 +2529,7 @@ static int DetectEngineHttpRawHeaderTest27(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2551,8 +2551,8 @@ static int DetectEngineHttpRawHeaderTest27(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2577,8 +2577,8 @@ static int DetectEngineHttpRawHeaderTest27(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2656,7 +2656,7 @@ static int DetectEngineHttpRawHeaderTest28(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2677,8 +2677,8 @@ static int DetectEngineHttpRawHeaderTest28(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2703,8 +2703,8 @@ static int DetectEngineHttpRawHeaderTest28(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2782,7 +2782,7 @@ static int DetectEngineHttpRawHeaderTest29(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2803,8 +2803,8 @@ static int DetectEngineHttpRawHeaderTest29(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2829,8 +2829,8 @@ static int DetectEngineHttpRawHeaderTest29(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2935,7 +2935,7 @@ static int DetectEngineHttpRawHeaderTest31(void) p1->flowflags |= FLOW_PKT_TOSERVER; p1->flowflags |= FLOW_PKT_ESTABLISHED; p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2956,8 +2956,8 @@ static int DetectEngineHttpRawHeaderTest31(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3044,7 +3044,7 @@ static int DetectEngineHttpRawHeaderTest32(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3065,8 +3065,8 @@ static int DetectEngineHttpRawHeaderTest32(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3091,8 +3091,8 @@ static int DetectEngineHttpRawHeaderTest32(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3316,7 +3316,7 @@ static int DetectHttpRawHeaderTest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3337,8 +3337,8 @@ static int DetectHttpRawHeaderTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3422,7 +3422,7 @@ static int DetectHttpRawHeaderTest07(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3443,8 +3443,8 @@ static int DetectHttpRawHeaderTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3469,8 +3469,8 @@ static int DetectHttpRawHeaderTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3547,7 +3547,7 @@ static int DetectHttpRawHeaderTest08(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3568,8 +3568,8 @@ static int DetectHttpRawHeaderTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3594,8 +3594,8 @@ static int DetectHttpRawHeaderTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3673,7 +3673,7 @@ static int DetectHttpRawHeaderTest09(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3694,8 +3694,8 @@ static int DetectHttpRawHeaderTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3720,8 +3720,8 @@ static int DetectHttpRawHeaderTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3799,7 +3799,7 @@ static int DetectHttpRawHeaderTest10(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3820,8 +3820,8 @@ static int DetectHttpRawHeaderTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3846,8 +3846,8 @@ static int DetectHttpRawHeaderTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3917,7 +3917,7 @@ static int DetectHttpRawHeaderTest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3938,8 +3938,8 @@ static int DetectHttpRawHeaderTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4015,7 +4015,7 @@ static int DetectHttpRawHeaderTest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4036,8 +4036,8 @@ static int DetectHttpRawHeaderTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4114,7 +4114,7 @@ static int DetectHttpRawHeaderTest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4135,8 +4135,8 @@ static int DetectHttpRawHeaderTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; diff --git a/src/tests/detect-http-server-body.c b/src/tests/detect-http-server-body.c index 3b63794930..c3360a3f71 100644 --- a/src/tests/detect-http-server-body.c +++ b/src/tests/detect-http-server-body.c @@ -103,7 +103,7 @@ static int RunTest(struct TestSteps *steps, const char *sig, const char *yaml) f.protoctx = (void *)&ssn; f.proto = IPPROTO_TCP; f.flags |= FLOW_IPV4; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; SCLogDebug("sig %s", sig); Signature *s = DetectEngineAppendSig(de_ctx, (char *)sig); @@ -124,9 +124,9 @@ static int RunTest(struct TestSteps *steps, const char *sig, const char *yaml) p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - b->direction, (uint8_t *)b->input, - b->input_size ? b->input_size : strlen((const char *)b->input)); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, b->direction, + (uint8_t *)b->input, + b->input_size ? b->input_size : strlen((const char *)b->input)); FAIL_IF_NOT(r == 0); /* do detect */ @@ -201,7 +201,7 @@ static int DetectEngineHttpServerBodyTest01(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -222,8 +222,8 @@ static int DetectEngineHttpServerBodyTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -248,8 +248,8 @@ static int DetectEngineHttpServerBodyTest01(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -321,7 +321,7 @@ static int DetectEngineHttpServerBodyTest02(void) p1->flowflags |= FLOW_PKT_TOCLIENT; p1->flowflags |= FLOW_PKT_ESTABLISHED; p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -342,8 +342,8 @@ static int DetectEngineHttpServerBodyTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -353,8 +353,8 @@ static int DetectEngineHttpServerBodyTest02(void) FLOWLOCK_UNLOCK(&f); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -441,7 +441,7 @@ static int DetectEngineHttpServerBodyTest03(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -462,8 +462,8 @@ static int DetectEngineHttpServerBodyTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -488,8 +488,8 @@ static int DetectEngineHttpServerBodyTest03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -499,8 +499,8 @@ static int DetectEngineHttpServerBodyTest03(void) FLOWLOCK_UNLOCK(&f); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -578,7 +578,7 @@ static int DetectEngineHttpServerBodyTest04(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -599,8 +599,8 @@ static int DetectEngineHttpServerBodyTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -625,8 +625,8 @@ static int DetectEngineHttpServerBodyTest04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -704,7 +704,7 @@ static int DetectEngineHttpServerBodyTest05(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -725,8 +725,8 @@ static int DetectEngineHttpServerBodyTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -751,8 +751,8 @@ static int DetectEngineHttpServerBodyTest05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -830,7 +830,7 @@ static int DetectEngineHttpServerBodyTest06(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -851,8 +851,8 @@ static int DetectEngineHttpServerBodyTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -877,8 +877,8 @@ static int DetectEngineHttpServerBodyTest06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -956,7 +956,7 @@ static int DetectEngineHttpServerBodyTest07(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -977,8 +977,8 @@ static int DetectEngineHttpServerBodyTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1003,8 +1003,8 @@ static int DetectEngineHttpServerBodyTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1082,7 +1082,7 @@ static int DetectEngineHttpServerBodyTest08(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1103,8 +1103,8 @@ static int DetectEngineHttpServerBodyTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1129,8 +1129,8 @@ static int DetectEngineHttpServerBodyTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1208,7 +1208,7 @@ static int DetectEngineHttpServerBodyTest09(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1230,8 +1230,8 @@ static int DetectEngineHttpServerBodyTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1256,8 +1256,8 @@ static int DetectEngineHttpServerBodyTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1335,7 +1335,7 @@ static int DetectEngineHttpServerBodyTest10(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1357,8 +1357,8 @@ static int DetectEngineHttpServerBodyTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1383,8 +1383,8 @@ static int DetectEngineHttpServerBodyTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1462,7 +1462,7 @@ static int DetectEngineHttpServerBodyTest11(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1484,8 +1484,8 @@ static int DetectEngineHttpServerBodyTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1510,8 +1510,8 @@ static int DetectEngineHttpServerBodyTest11(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1589,7 +1589,7 @@ static int DetectEngineHttpServerBodyTest12(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1611,8 +1611,8 @@ static int DetectEngineHttpServerBodyTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1637,8 +1637,8 @@ static int DetectEngineHttpServerBodyTest12(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1716,7 +1716,7 @@ static int DetectEngineHttpServerBodyTest13(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1738,8 +1738,8 @@ static int DetectEngineHttpServerBodyTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1764,8 +1764,8 @@ static int DetectEngineHttpServerBodyTest13(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1843,7 +1843,7 @@ static int DetectEngineHttpServerBodyTest14(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1865,8 +1865,8 @@ static int DetectEngineHttpServerBodyTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1891,8 +1891,8 @@ static int DetectEngineHttpServerBodyTest14(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1970,7 +1970,7 @@ static int DetectEngineHttpServerBodyTest15(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1992,8 +1992,8 @@ static int DetectEngineHttpServerBodyTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2018,8 +2018,8 @@ static int DetectEngineHttpServerBodyTest15(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2123,7 +2123,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2144,8 +2144,8 @@ libhtp:\n\ DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2170,8 +2170,8 @@ libhtp:\n\ } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2189,8 +2189,8 @@ libhtp:\n\ } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2298,7 +2298,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2319,8 +2319,8 @@ libhtp:\n\ DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2345,8 +2345,8 @@ libhtp:\n\ } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2364,8 +2364,8 @@ libhtp:\n\ } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2457,7 +2457,7 @@ static int DetectEngineHttpServerBodyTest18(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2477,8 +2477,8 @@ static int DetectEngineHttpServerBodyTest18(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2500,8 +2500,8 @@ static int DetectEngineHttpServerBodyTest18(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2585,7 +2585,7 @@ static int DetectEngineHttpServerBodyTest19(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2605,8 +2605,8 @@ static int DetectEngineHttpServerBodyTest19(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2628,8 +2628,8 @@ static int DetectEngineHttpServerBodyTest19(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2713,7 +2713,7 @@ static int DetectEngineHttpServerBodyTest20(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2733,8 +2733,8 @@ static int DetectEngineHttpServerBodyTest20(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2756,8 +2756,8 @@ static int DetectEngineHttpServerBodyTest20(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2842,7 +2842,7 @@ static int DetectEngineHttpServerBodyTest21(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2862,8 +2862,8 @@ static int DetectEngineHttpServerBodyTest21(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2885,8 +2885,8 @@ static int DetectEngineHttpServerBodyTest21(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2973,7 +2973,7 @@ static int DetectEngineHttpServerBodyTest22(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2993,8 +2993,8 @@ static int DetectEngineHttpServerBodyTest22(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3016,8 +3016,8 @@ static int DetectEngineHttpServerBodyTest22(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3092,7 +3092,7 @@ static int DetectEngineHttpServerBodyFileDataTest01(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3114,8 +3114,8 @@ static int DetectEngineHttpServerBodyFileDataTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3140,8 +3140,8 @@ static int DetectEngineHttpServerBodyFileDataTest01(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3219,7 +3219,7 @@ static int DetectEngineHttpServerBodyFileDataTest02(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3241,8 +3241,8 @@ static int DetectEngineHttpServerBodyFileDataTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3267,8 +3267,8 @@ static int DetectEngineHttpServerBodyFileDataTest02(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -3347,7 +3347,7 @@ static int DetectEngineHttpServerBodyFileDataTest03(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3372,8 +3372,8 @@ static int DetectEngineHttpServerBodyFileDataTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -3398,8 +3398,8 @@ static int DetectEngineHttpServerBodyFileDataTest03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -4084,7 +4084,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4102,7 +4102,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4113,7 +4114,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -4209,7 +4211,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4227,7 +4229,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4238,7 +4241,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -4334,7 +4338,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4352,7 +4356,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4363,7 +4368,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -4459,7 +4465,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4477,7 +4483,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4488,7 +4495,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -4584,7 +4592,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4602,7 +4610,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4613,7 +4622,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -4711,7 +4721,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4730,7 +4740,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4741,7 +4752,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -4837,7 +4849,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4855,7 +4867,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4866,7 +4879,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -4964,7 +4978,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4982,7 +4996,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -4993,7 +5008,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -5089,7 +5105,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5107,7 +5123,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -5118,7 +5135,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -5214,7 +5232,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5232,7 +5250,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -5243,7 +5262,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -5338,7 +5358,7 @@ libhtp:\n\ p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5356,7 +5376,8 @@ libhtp:\n\ SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); FAIL_IF(r != 0); http_state = f.alstate; @@ -5367,7 +5388,8 @@ libhtp:\n\ FAIL_IF((PacketAlertCheck(p1, 1))); - r = AppLayerParserParse(&th_v, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + &th_v, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); FAIL_IF(r != 0); /* do detect */ @@ -5587,7 +5609,7 @@ static int DetectHttpServerBodyTest06(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5608,20 +5630,16 @@ static int DetectHttpServerBodyTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - http_buf, - http_len); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START | STREAM_EOF, - http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOCLIENT | STREAM_START | STREAM_EOF, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5711,7 +5729,7 @@ static int DetectHttpServerBodyTest07(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5732,19 +5750,16 @@ static int DetectHttpServerBodyTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, - http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -5767,9 +5782,8 @@ static int DetectHttpServerBodyTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -5851,7 +5865,7 @@ static int DetectHttpServerBodyTest08(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5872,9 +5886,8 @@ static int DetectHttpServerBodyTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5891,9 +5904,8 @@ static int DetectHttpServerBodyTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5911,9 +5923,8 @@ static int DetectHttpServerBodyTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6000,7 +6011,7 @@ static int DetectHttpServerBodyTest09(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6021,9 +6032,8 @@ static int DetectHttpServerBodyTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6040,9 +6050,8 @@ static int DetectHttpServerBodyTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6060,9 +6069,8 @@ static int DetectHttpServerBodyTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6070,9 +6078,8 @@ static int DetectHttpServerBodyTest09(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf4, - http_len4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf4, http_len4); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6159,7 +6166,7 @@ static int DetectHttpServerBodyTest10(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6180,9 +6187,8 @@ static int DetectHttpServerBodyTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6199,9 +6205,8 @@ static int DetectHttpServerBodyTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6219,9 +6224,8 @@ static int DetectHttpServerBodyTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6229,9 +6233,8 @@ static int DetectHttpServerBodyTest10(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf4, - http_len4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf4, http_len4); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6314,7 +6317,7 @@ static int DetectHttpServerBodyTest11(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6335,9 +6338,8 @@ static int DetectHttpServerBodyTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6354,9 +6356,8 @@ static int DetectHttpServerBodyTest11(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6374,9 +6375,8 @@ static int DetectHttpServerBodyTest11(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6459,7 +6459,7 @@ static int DetectHttpServerBodyTest12(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6480,9 +6480,8 @@ static int DetectHttpServerBodyTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6499,9 +6498,8 @@ static int DetectHttpServerBodyTest12(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6519,9 +6517,8 @@ static int DetectHttpServerBodyTest12(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6592,7 +6589,7 @@ static int DetectHttpServerBodyTest13(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6613,20 +6610,16 @@ static int DetectHttpServerBodyTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - http_buf, - http_len); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START | STREAM_EOF, - http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOCLIENT | STREAM_START | STREAM_EOF, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6714,7 +6707,7 @@ static int DetectHttpServerBodyTest14(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6742,9 +6735,8 @@ static int DetectHttpServerBodyTest14(void) SCLogDebug("add chunk 1"); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -6753,8 +6745,7 @@ static int DetectHttpServerBodyTest14(void) SCLogDebug("add chunk 2"); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -6775,8 +6766,7 @@ static int DetectHttpServerBodyTest14(void) SCLogDebug("add chunk 3"); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -6785,8 +6775,8 @@ static int DetectHttpServerBodyTest14(void) SCLogDebug("add chunk 4"); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 4 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -6886,7 +6876,7 @@ static int DetectHttpServerBodyTest15(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6912,17 +6902,15 @@ static int DetectHttpServerBodyTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -6943,16 +6931,15 @@ static int DetectHttpServerBodyTest15(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 4 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -7708,7 +7695,7 @@ static int DetectHttpServerBodyFileDataTest01(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7725,15 +7712,11 @@ static int DetectHttpServerBodyFileDataTest01(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - http_buf, - http_len); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, http_buf, http_len); FAIL_IF(r != 0); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START | STREAM_EOF, - http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOCLIENT | STREAM_START | STREAM_EOF, http_buf2, http_len2); FAIL_IF(r != 0); http_state = f.alstate; FAIL_IF_NULL(http_state); @@ -7805,7 +7788,7 @@ static int DetectHttpServerBodyFileDataTest02(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7826,10 +7809,8 @@ static int DetectHttpServerBodyFileDataTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, - http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7837,9 +7818,8 @@ static int DetectHttpServerBodyFileDataTest02(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7863,9 +7843,8 @@ static int DetectHttpServerBodyFileDataTest02(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -7947,7 +7926,7 @@ static int DetectHttpServerBodyFileDataTest03(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7968,9 +7947,8 @@ static int DetectHttpServerBodyFileDataTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7987,9 +7965,8 @@ static int DetectHttpServerBodyFileDataTest03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8007,9 +7984,8 @@ static int DetectHttpServerBodyFileDataTest03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8097,7 +8073,7 @@ static int DetectHttpServerBodyFileDataTest04(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8118,9 +8094,8 @@ static int DetectHttpServerBodyFileDataTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8137,9 +8112,8 @@ static int DetectHttpServerBodyFileDataTest04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8157,9 +8131,8 @@ static int DetectHttpServerBodyFileDataTest04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8167,9 +8140,8 @@ static int DetectHttpServerBodyFileDataTest04(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf4, - http_len4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf4, http_len4); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8256,7 +8228,7 @@ static int DetectHttpServerBodyFileDataTest05(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8277,9 +8249,8 @@ static int DetectHttpServerBodyFileDataTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8296,9 +8267,8 @@ static int DetectHttpServerBodyFileDataTest05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8316,9 +8286,8 @@ static int DetectHttpServerBodyFileDataTest05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8326,9 +8295,8 @@ static int DetectHttpServerBodyFileDataTest05(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf4, - http_len4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf4, http_len4); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8411,7 +8379,7 @@ static int DetectHttpServerBodyFileDataTest06(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8432,9 +8400,8 @@ static int DetectHttpServerBodyFileDataTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8451,9 +8418,8 @@ static int DetectHttpServerBodyFileDataTest06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8471,9 +8437,8 @@ static int DetectHttpServerBodyFileDataTest06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8556,7 +8521,7 @@ static int DetectHttpServerBodyFileDataTest07(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8577,9 +8542,8 @@ static int DetectHttpServerBodyFileDataTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, http_buf1, - http_len1); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, + http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8596,9 +8560,8 @@ static int DetectHttpServerBodyFileDataTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START, http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_START, + http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8616,9 +8579,8 @@ static int DetectHttpServerBodyFileDataTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, http_buf3, - http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8689,7 +8651,7 @@ static int DetectHttpServerBodyFileDataTest08(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8710,20 +8672,16 @@ static int DetectHttpServerBodyFileDataTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START | STREAM_EOF, - http_buf, - http_len); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOSERVER | STREAM_START | STREAM_EOF, http_buf, http_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_START | STREAM_EOF, - http_buf2, - http_len2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, + STREAM_TOCLIENT | STREAM_START | STREAM_EOF, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -8811,7 +8769,7 @@ static int DetectHttpServerBodyFileDataTest09(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8837,17 +8795,15 @@ static int DetectHttpServerBodyFileDataTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -8864,16 +8820,15 @@ static int DetectHttpServerBodyFileDataTest09(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 4 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -8971,7 +8926,7 @@ static int DetectHttpServerBodyFileDataTest10(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -8997,17 +8952,15 @@ static int DetectHttpServerBodyFileDataTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER | STREAM_START, httpbuf1, - httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER | STREAM_START, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -9024,16 +8977,15 @@ static int DetectHttpServerBodyFileDataTest10(void) p->alerts.cnt = 0; FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); if (r != 0) { printf("toserver chunk 3 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT | STREAM_EOF, httpbuf4, httplen4); if (r != 0) { printf("toserver chunk 4 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); diff --git a/src/tests/detect-http-stat-code.c b/src/tests/detect-http-stat-code.c index 5987b0e3e3..92a45ec360 100644 --- a/src/tests/detect-http-stat-code.c +++ b/src/tests/detect-http-stat-code.c @@ -85,7 +85,7 @@ static int DetectEngineHttpStatCodeTest01(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -106,8 +106,8 @@ static int DetectEngineHttpStatCodeTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -132,8 +132,8 @@ static int DetectEngineHttpStatCodeTest01(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -205,7 +205,7 @@ static int DetectEngineHttpStatCodeTest02(void) p1->flowflags |= FLOW_PKT_TOCLIENT; p1->flowflags |= FLOW_PKT_ESTABLISHED; p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -226,8 +226,8 @@ static int DetectEngineHttpStatCodeTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -237,8 +237,8 @@ static int DetectEngineHttpStatCodeTest02(void) FLOWLOCK_UNLOCK(&f); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -325,7 +325,7 @@ static int DetectEngineHttpStatCodeTest03(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -346,8 +346,8 @@ static int DetectEngineHttpStatCodeTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -372,8 +372,8 @@ static int DetectEngineHttpStatCodeTest03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -383,8 +383,8 @@ static int DetectEngineHttpStatCodeTest03(void) FLOWLOCK_UNLOCK(&f); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -462,7 +462,7 @@ static int DetectEngineHttpStatCodeTest04(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -483,8 +483,8 @@ static int DetectEngineHttpStatCodeTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -509,8 +509,8 @@ static int DetectEngineHttpStatCodeTest04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -588,7 +588,7 @@ static int DetectEngineHttpStatCodeTest05(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -609,8 +609,8 @@ static int DetectEngineHttpStatCodeTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -635,8 +635,8 @@ static int DetectEngineHttpStatCodeTest05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -714,7 +714,7 @@ static int DetectEngineHttpStatCodeTest06(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -735,8 +735,8 @@ static int DetectEngineHttpStatCodeTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -761,8 +761,8 @@ static int DetectEngineHttpStatCodeTest06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -840,7 +840,7 @@ static int DetectEngineHttpStatCodeTest07(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -861,8 +861,8 @@ static int DetectEngineHttpStatCodeTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -887,8 +887,8 @@ static int DetectEngineHttpStatCodeTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -966,7 +966,7 @@ static int DetectEngineHttpStatCodeTest08(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -987,8 +987,8 @@ static int DetectEngineHttpStatCodeTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1013,8 +1013,8 @@ static int DetectEngineHttpStatCodeTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1092,7 +1092,7 @@ static int DetectEngineHttpStatCodeTest09(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1114,8 +1114,8 @@ static int DetectEngineHttpStatCodeTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1140,8 +1140,8 @@ static int DetectEngineHttpStatCodeTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1219,7 +1219,7 @@ static int DetectEngineHttpStatCodeTest10(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1241,8 +1241,8 @@ static int DetectEngineHttpStatCodeTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1267,8 +1267,8 @@ static int DetectEngineHttpStatCodeTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1346,7 +1346,7 @@ static int DetectEngineHttpStatCodeTest11(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1368,8 +1368,8 @@ static int DetectEngineHttpStatCodeTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1394,8 +1394,8 @@ static int DetectEngineHttpStatCodeTest11(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1473,7 +1473,7 @@ static int DetectEngineHttpStatCodeTest12(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1495,8 +1495,8 @@ static int DetectEngineHttpStatCodeTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1521,8 +1521,8 @@ static int DetectEngineHttpStatCodeTest12(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1600,7 +1600,7 @@ static int DetectEngineHttpStatCodeTest13(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1622,8 +1622,8 @@ static int DetectEngineHttpStatCodeTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1648,8 +1648,8 @@ static int DetectEngineHttpStatCodeTest13(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1727,7 +1727,7 @@ static int DetectEngineHttpStatCodeTest14(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1749,8 +1749,8 @@ static int DetectEngineHttpStatCodeTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1775,8 +1775,8 @@ static int DetectEngineHttpStatCodeTest14(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1854,7 +1854,7 @@ static int DetectEngineHttpStatCodeTest15(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1876,8 +1876,8 @@ static int DetectEngineHttpStatCodeTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1902,8 +1902,8 @@ static int DetectEngineHttpStatCodeTest15(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2072,7 +2072,7 @@ static int DetectHttpStatCodeSigTest01(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2095,16 +2095,15 @@ static int DetectHttpStatCodeSigTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toclient chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2175,7 +2174,7 @@ static int DetectHttpStatCodeSigTest02(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2204,8 +2203,8 @@ static int DetectHttpStatCodeSigTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2213,8 +2212,7 @@ static int DetectHttpStatCodeSigTest02(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toclient chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2292,7 +2290,7 @@ static int DetectHttpStatCodeSigTest03(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2321,8 +2319,8 @@ static int DetectHttpStatCodeSigTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2330,8 +2328,7 @@ static int DetectHttpStatCodeSigTest03(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toclient chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2409,7 +2406,7 @@ static int DetectHttpStatCodeSigTest04(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2438,8 +2435,8 @@ static int DetectHttpStatCodeSigTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2447,8 +2444,7 @@ static int DetectHttpStatCodeSigTest04(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toclient chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; diff --git a/src/tests/detect-http-stat-msg.c b/src/tests/detect-http-stat-msg.c index d0e27aaff5..71144eb867 100644 --- a/src/tests/detect-http-stat-msg.c +++ b/src/tests/detect-http-stat-msg.c @@ -85,7 +85,7 @@ static int DetectEngineHttpStatMsgTest01(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -106,8 +106,8 @@ static int DetectEngineHttpStatMsgTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -132,8 +132,8 @@ static int DetectEngineHttpStatMsgTest01(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -205,7 +205,7 @@ static int DetectEngineHttpStatMsgTest02(void) p1->flowflags |= FLOW_PKT_TOCLIENT; p1->flowflags |= FLOW_PKT_ESTABLISHED; p1->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -226,8 +226,8 @@ static int DetectEngineHttpStatMsgTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -237,8 +237,8 @@ static int DetectEngineHttpStatMsgTest02(void) FLOWLOCK_UNLOCK(&f); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -325,7 +325,7 @@ static int DetectEngineHttpStatMsgTest03(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -346,8 +346,8 @@ static int DetectEngineHttpStatMsgTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -372,8 +372,8 @@ static int DetectEngineHttpStatMsgTest03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -383,8 +383,8 @@ static int DetectEngineHttpStatMsgTest03(void) FLOWLOCK_UNLOCK(&f); FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf3, http_len3); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf3, http_len3); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -462,7 +462,7 @@ static int DetectEngineHttpStatMsgTest04(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -483,8 +483,8 @@ static int DetectEngineHttpStatMsgTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -509,8 +509,8 @@ static int DetectEngineHttpStatMsgTest04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -588,7 +588,7 @@ static int DetectEngineHttpStatMsgTest05(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -609,8 +609,8 @@ static int DetectEngineHttpStatMsgTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -635,8 +635,8 @@ static int DetectEngineHttpStatMsgTest05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -714,7 +714,7 @@ static int DetectEngineHttpStatMsgTest06(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -735,8 +735,8 @@ static int DetectEngineHttpStatMsgTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -761,8 +761,8 @@ static int DetectEngineHttpStatMsgTest06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -840,7 +840,7 @@ static int DetectEngineHttpStatMsgTest07(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -861,8 +861,8 @@ static int DetectEngineHttpStatMsgTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -887,8 +887,8 @@ static int DetectEngineHttpStatMsgTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -966,7 +966,7 @@ static int DetectEngineHttpStatMsgTest08(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -987,8 +987,8 @@ static int DetectEngineHttpStatMsgTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1013,8 +1013,8 @@ static int DetectEngineHttpStatMsgTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1092,7 +1092,7 @@ static int DetectEngineHttpStatMsgTest09(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1114,8 +1114,8 @@ static int DetectEngineHttpStatMsgTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1140,8 +1140,8 @@ static int DetectEngineHttpStatMsgTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1219,7 +1219,7 @@ static int DetectEngineHttpStatMsgTest10(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1241,8 +1241,8 @@ static int DetectEngineHttpStatMsgTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1267,8 +1267,8 @@ static int DetectEngineHttpStatMsgTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1346,7 +1346,7 @@ static int DetectEngineHttpStatMsgTest11(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1368,8 +1368,8 @@ static int DetectEngineHttpStatMsgTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1394,8 +1394,8 @@ static int DetectEngineHttpStatMsgTest11(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1473,7 +1473,7 @@ static int DetectEngineHttpStatMsgTest12(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1495,8 +1495,8 @@ static int DetectEngineHttpStatMsgTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1521,8 +1521,8 @@ static int DetectEngineHttpStatMsgTest12(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1600,7 +1600,7 @@ static int DetectEngineHttpStatMsgTest13(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1622,8 +1622,8 @@ static int DetectEngineHttpStatMsgTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1648,8 +1648,8 @@ static int DetectEngineHttpStatMsgTest13(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1727,7 +1727,7 @@ static int DetectEngineHttpStatMsgTest14(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1749,8 +1749,8 @@ static int DetectEngineHttpStatMsgTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1775,8 +1775,8 @@ static int DetectEngineHttpStatMsgTest14(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -1854,7 +1854,7 @@ static int DetectEngineHttpStatMsgTest15(void) p2->flowflags |= FLOW_PKT_TOCLIENT; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1876,8 +1876,8 @@ static int DetectEngineHttpStatMsgTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_len1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_len1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -1902,8 +1902,8 @@ static int DetectEngineHttpStatMsgTest15(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, http_buf2, http_len2); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, http_buf2, http_len2); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -2064,7 +2064,7 @@ static int DetectHttpStatMsgSigTest01(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2093,8 +2093,8 @@ static int DetectHttpStatMsgSigTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2102,8 +2102,7 @@ static int DetectHttpStatMsgSigTest01(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toclient chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2180,7 +2179,7 @@ static int DetectHttpStatMsgSigTest02(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2202,8 +2201,8 @@ static int DetectHttpStatMsgSigTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2211,8 +2210,7 @@ static int DetectHttpStatMsgSigTest02(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toclient chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2286,7 +2284,7 @@ static int DetectHttpStatMsgSigTest03(void) p->flowflags |= FLOW_PKT_TOCLIENT; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2315,8 +2313,8 @@ static int DetectHttpStatMsgSigTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -2324,8 +2322,7 @@ static int DetectHttpStatMsgSigTest03(void) goto end; } - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOCLIENT, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOCLIENT, httpbuf2, httplen2); if (r != 0) { printf("toclient chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; diff --git a/src/tests/detect-http-uri.c b/src/tests/detect-http-uri.c index 5b3c180113..9cf3036608 100644 --- a/src/tests/detect-http-uri.c +++ b/src/tests/detect-http-uri.c @@ -69,7 +69,7 @@ static int UriTestSig01(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -90,8 +90,8 @@ static int UriTestSig01(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -114,8 +114,8 @@ static int UriTestSig01(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -191,7 +191,7 @@ static int UriTestSig02(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -212,8 +212,8 @@ static int UriTestSig02(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -236,8 +236,8 @@ static int UriTestSig02(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -313,7 +313,7 @@ static int UriTestSig03(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -334,8 +334,8 @@ static int UriTestSig03(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -358,8 +358,8 @@ static int UriTestSig03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -435,7 +435,7 @@ static int UriTestSig04(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -456,8 +456,8 @@ static int UriTestSig04(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -480,8 +480,8 @@ static int UriTestSig04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -557,7 +557,7 @@ static int UriTestSig05(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -578,8 +578,8 @@ static int UriTestSig05(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -602,8 +602,8 @@ static int UriTestSig05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -679,7 +679,7 @@ static int UriTestSig06(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -700,8 +700,8 @@ static int UriTestSig06(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -724,8 +724,8 @@ static int UriTestSig06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -801,7 +801,7 @@ static int UriTestSig07(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -822,8 +822,8 @@ static int UriTestSig07(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -846,8 +846,8 @@ static int UriTestSig07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -923,7 +923,7 @@ static int UriTestSig08(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -944,8 +944,8 @@ static int UriTestSig08(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -968,8 +968,8 @@ static int UriTestSig08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1045,7 +1045,7 @@ static int UriTestSig09(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1066,8 +1066,8 @@ static int UriTestSig09(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1090,8 +1090,8 @@ static int UriTestSig09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1167,7 +1167,7 @@ static int UriTestSig12(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1189,8 +1189,8 @@ static int UriTestSig12(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1213,8 +1213,8 @@ static int UriTestSig12(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1290,7 +1290,7 @@ static int UriTestSig13(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1311,8 +1311,8 @@ static int UriTestSig13(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1335,8 +1335,8 @@ static int UriTestSig13(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1413,7 +1413,7 @@ static int UriTestSig14(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1434,8 +1434,8 @@ static int UriTestSig14(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1458,8 +1458,8 @@ static int UriTestSig14(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1536,7 +1536,7 @@ static int UriTestSig15(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1557,8 +1557,8 @@ static int UriTestSig15(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1581,8 +1581,8 @@ static int UriTestSig15(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1659,7 +1659,7 @@ static int UriTestSig16(void) p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST | PKT_DETECT_HAS_STREAMDATA; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f->alproto = ALPROTO_HTTP; + f->alproto = ALPROTO_HTTP1; DetectEngineCtx *de_ctx = DetectEngineCtxInit(); FAIL_IF_NULL(de_ctx); @@ -1673,8 +1673,8 @@ static int UriTestSig16(void) UTHAddStreamToFlow(f, 0, http_buf2, http_buf2_len); - int r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); FAIL_IF(r != 0); http_state = f->alstate; @@ -1688,8 +1688,8 @@ static int UriTestSig16(void) p->payload = http_buf2; p->payload_len = http_buf2_len; - r = AppLayerParserParse(NULL, alp_tctx, f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); FAIL_IF(r != 0); http_state = f->alstate; @@ -1743,7 +1743,7 @@ static int UriTestSig17(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1766,8 +1766,8 @@ static int UriTestSig17(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1839,7 +1839,7 @@ static int UriTestSig18(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1862,8 +1862,8 @@ static int UriTestSig18(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -1935,7 +1935,7 @@ static int UriTestSig19(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1959,8 +1959,8 @@ static int UriTestSig19(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2032,7 +2032,7 @@ static int UriTestSig20(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2055,8 +2055,8 @@ static int UriTestSig20(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2128,7 +2128,7 @@ static int UriTestSig21(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2150,8 +2150,8 @@ static int UriTestSig21(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2224,7 +2224,7 @@ static int UriTestSig22(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2245,8 +2245,8 @@ static int UriTestSig22(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2318,7 +2318,7 @@ static int UriTestSig23(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2339,8 +2339,8 @@ static int UriTestSig23(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2412,7 +2412,7 @@ static int UriTestSig24(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2433,8 +2433,8 @@ static int UriTestSig24(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2505,7 +2505,7 @@ static int UriTestSig25(void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; StreamTcpInitConfig(TRUE); @@ -2527,8 +2527,8 @@ static int UriTestSig25(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2600,7 +2600,7 @@ static int UriTestSig26(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2621,8 +2621,8 @@ static int UriTestSig26(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2694,7 +2694,7 @@ static int UriTestSig27(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2715,8 +2715,8 @@ static int UriTestSig27(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2820,7 +2820,7 @@ static int UriTestSig28(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2843,8 +2843,8 @@ static int UriTestSig28(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -2913,7 +2913,7 @@ static int UriTestSig29(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -2936,8 +2936,8 @@ static int UriTestSig29(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3006,7 +3006,7 @@ static int UriTestSig30(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3029,8 +3029,8 @@ static int UriTestSig30(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3099,7 +3099,7 @@ static int UriTestSig31(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3122,8 +3122,8 @@ static int UriTestSig31(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3192,7 +3192,7 @@ static int UriTestSig32(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -3215,8 +3215,8 @@ static int UriTestSig32(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3284,7 +3284,7 @@ static int UriTestSig33(void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; StreamTcpInitConfig(TRUE); @@ -3306,8 +3306,8 @@ static int UriTestSig33(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3375,7 +3375,7 @@ static int UriTestSig34(void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; StreamTcpInitConfig(TRUE); @@ -3397,8 +3397,8 @@ static int UriTestSig34(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3466,7 +3466,7 @@ static int UriTestSig35(void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; StreamTcpInitConfig(TRUE); @@ -3488,8 +3488,8 @@ static int UriTestSig35(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3557,7 +3557,7 @@ static int UriTestSig36(void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; StreamTcpInitConfig(TRUE); @@ -3579,8 +3579,8 @@ static int UriTestSig36(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3648,7 +3648,7 @@ static int UriTestSig37(void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; StreamTcpInitConfig(TRUE); @@ -3670,8 +3670,8 @@ static int UriTestSig37(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -3739,7 +3739,7 @@ static int UriTestSig38(void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; StreamTcpInitConfig(TRUE); @@ -3761,8 +3761,8 @@ static int UriTestSig38(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4719,7 +4719,7 @@ static int DetectEngineHttpRawUriTest01(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4740,8 +4740,8 @@ static int DetectEngineHttpRawUriTest01(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4766,8 +4766,8 @@ static int DetectEngineHttpRawUriTest01(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -4845,7 +4845,7 @@ static int DetectEngineHttpRawUriTest02(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4866,8 +4866,8 @@ static int DetectEngineHttpRawUriTest02(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -4956,7 +4956,7 @@ static int DetectEngineHttpRawUriTest03(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4977,8 +4977,8 @@ static int DetectEngineHttpRawUriTest03(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5003,8 +5003,8 @@ static int DetectEngineHttpRawUriTest03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5086,7 +5086,7 @@ static int DetectEngineHttpRawUriTest04(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5107,8 +5107,8 @@ static int DetectEngineHttpRawUriTest04(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5133,8 +5133,8 @@ static int DetectEngineHttpRawUriTest04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5215,7 +5215,7 @@ static int DetectEngineHttpRawUriTest05(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5236,8 +5236,8 @@ static int DetectEngineHttpRawUriTest05(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5262,8 +5262,8 @@ static int DetectEngineHttpRawUriTest05(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5344,7 +5344,7 @@ static int DetectEngineHttpRawUriTest06(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5365,8 +5365,8 @@ static int DetectEngineHttpRawUriTest06(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5391,8 +5391,8 @@ static int DetectEngineHttpRawUriTest06(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5473,7 +5473,7 @@ static int DetectEngineHttpRawUriTest07(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5494,8 +5494,8 @@ static int DetectEngineHttpRawUriTest07(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5520,8 +5520,8 @@ static int DetectEngineHttpRawUriTest07(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5602,7 +5602,7 @@ static int DetectEngineHttpRawUriTest08(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5623,8 +5623,8 @@ static int DetectEngineHttpRawUriTest08(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5649,8 +5649,8 @@ static int DetectEngineHttpRawUriTest08(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5731,7 +5731,7 @@ static int DetectEngineHttpRawUriTest09(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5753,8 +5753,8 @@ static int DetectEngineHttpRawUriTest09(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5779,8 +5779,8 @@ static int DetectEngineHttpRawUriTest09(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5861,7 +5861,7 @@ static int DetectEngineHttpRawUriTest10(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -5883,8 +5883,8 @@ static int DetectEngineHttpRawUriTest10(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -5909,8 +5909,8 @@ static int DetectEngineHttpRawUriTest10(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -5991,7 +5991,7 @@ static int DetectEngineHttpRawUriTest11(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6013,8 +6013,8 @@ static int DetectEngineHttpRawUriTest11(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6039,8 +6039,8 @@ static int DetectEngineHttpRawUriTest11(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6121,7 +6121,7 @@ static int DetectEngineHttpRawUriTest12(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6143,8 +6143,8 @@ static int DetectEngineHttpRawUriTest12(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6169,8 +6169,8 @@ static int DetectEngineHttpRawUriTest12(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6251,7 +6251,7 @@ static int DetectEngineHttpRawUriTest13(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6273,8 +6273,8 @@ static int DetectEngineHttpRawUriTest13(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6299,8 +6299,8 @@ static int DetectEngineHttpRawUriTest13(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6381,7 +6381,7 @@ static int DetectEngineHttpRawUriTest14(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6403,8 +6403,8 @@ static int DetectEngineHttpRawUriTest14(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6429,8 +6429,8 @@ static int DetectEngineHttpRawUriTest14(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6511,7 +6511,7 @@ static int DetectEngineHttpRawUriTest15(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6533,8 +6533,8 @@ static int DetectEngineHttpRawUriTest15(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6559,8 +6559,8 @@ static int DetectEngineHttpRawUriTest15(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6641,7 +6641,7 @@ static int DetectEngineHttpRawUriTest16(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6663,8 +6663,8 @@ static int DetectEngineHttpRawUriTest16(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6689,8 +6689,8 @@ static int DetectEngineHttpRawUriTest16(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6771,7 +6771,7 @@ static int DetectEngineHttpRawUriTest21(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6793,8 +6793,8 @@ static int DetectEngineHttpRawUriTest21(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6819,8 +6819,8 @@ static int DetectEngineHttpRawUriTest21(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -6901,7 +6901,7 @@ static int DetectEngineHttpRawUriTest22(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -6923,8 +6923,8 @@ static int DetectEngineHttpRawUriTest22(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -6949,8 +6949,8 @@ static int DetectEngineHttpRawUriTest22(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -7031,7 +7031,7 @@ static int DetectEngineHttpRawUriTest23(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7053,8 +7053,8 @@ static int DetectEngineHttpRawUriTest23(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7079,8 +7079,8 @@ static int DetectEngineHttpRawUriTest23(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -7161,7 +7161,7 @@ static int DetectEngineHttpRawUriTest24(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7183,8 +7183,8 @@ static int DetectEngineHttpRawUriTest24(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7209,8 +7209,8 @@ static int DetectEngineHttpRawUriTest24(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -7291,7 +7291,7 @@ static int DetectEngineHttpRawUriTest25(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7313,8 +7313,8 @@ static int DetectEngineHttpRawUriTest25(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7339,8 +7339,8 @@ static int DetectEngineHttpRawUriTest25(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -7421,7 +7421,7 @@ static int DetectEngineHttpRawUriTest26(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7443,8 +7443,8 @@ static int DetectEngineHttpRawUriTest26(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7469,8 +7469,8 @@ static int DetectEngineHttpRawUriTest26(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -7551,7 +7551,7 @@ static int DetectEngineHttpRawUriTest27(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7573,8 +7573,8 @@ static int DetectEngineHttpRawUriTest27(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7599,8 +7599,8 @@ static int DetectEngineHttpRawUriTest27(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -7681,7 +7681,7 @@ static int DetectEngineHttpRawUriTest28(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7703,8 +7703,8 @@ static int DetectEngineHttpRawUriTest28(void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -7729,8 +7729,8 @@ static int DetectEngineHttpRawUriTest28(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: \n", r); result = 0; @@ -7798,7 +7798,7 @@ static int DetectEngineHttpRawUriTest29(void) p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7820,8 +7820,8 @@ static int DetectEngineHttpRawUriTest29(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -7893,7 +7893,7 @@ static int DetectEngineHttpRawUriTest30(void) p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -7914,8 +7914,8 @@ static int DetectEngineHttpRawUriTest30(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_buf_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_buf_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); diff --git a/src/tests/detect-http-user-agent.c b/src/tests/detect-http-user-agent.c index 2c8cfbe06d..015565f6fc 100644 --- a/src/tests/detect-http-user-agent.c +++ b/src/tests/detect-http-user-agent.c @@ -68,7 +68,7 @@ static int DetectEngineHttpUATest( p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -83,7 +83,7 @@ static int DetectEngineHttpUATest( DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FAIL_IF_NULL(det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, STREAM_TOSERVER, buf, buf_len); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, buf, buf_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -455,7 +455,7 @@ static int DetectHttpUATest06(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW | PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -472,8 +472,8 @@ static int DetectHttpUATest06(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -533,7 +533,7 @@ static int DetectHttpUATest07(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -550,8 +550,8 @@ static int DetectHttpUATest07(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -560,8 +560,8 @@ static int DetectHttpUATest07(void) FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -621,7 +621,7 @@ static int DetectHttpUATest08(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -638,8 +638,8 @@ static int DetectHttpUATest08(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -647,8 +647,8 @@ static int DetectHttpUATest08(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p1); FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -713,7 +713,7 @@ static int DetectHttpUATest09(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -730,8 +730,8 @@ static int DetectHttpUATest09(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -739,8 +739,8 @@ static int DetectHttpUATest09(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p1); FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -804,7 +804,7 @@ static int DetectHttpUATest10(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -821,8 +821,8 @@ static int DetectHttpUATest10(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http1_buf, http1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http1_buf, http1_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -830,8 +830,8 @@ static int DetectHttpUATest10(void) SigMatchSignatures(&th_v, de_ctx, det_ctx, p1); FAIL_IF(PacketAlertCheck(p1, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http2_buf, http2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http2_buf, http2_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -883,7 +883,7 @@ static int DetectHttpUATest11(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -900,8 +900,8 @@ static int DetectHttpUATest11(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -952,7 +952,7 @@ static int DetectHttpUATest12(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -969,8 +969,8 @@ static int DetectHttpUATest12(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -1022,7 +1022,7 @@ static int DetectHttpUATest13(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1040,8 +1040,8 @@ static int DetectHttpUATest13(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf, http_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf, http_len); FAIL_IF_NOT(r == 0); FAIL_IF_NULL(f.alstate); @@ -1098,7 +1098,7 @@ static int DetectHttpUATest14(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -1114,24 +1114,22 @@ static int DetectHttpUATest14(void) SigGroupBuild(de_ctx); DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf1, httplen1); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf1, httplen1); FAIL_IF_NOT(r == 0); /* do detect */ SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf2, httplen2); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf2, httplen2); FAIL_IF_NOT(r == 0); /* do detect */ SigMatchSignatures(&th_v, de_ctx, det_ctx, p); FAIL_IF(PacketAlertCheck(p, 1)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf3, httplen3); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf3, httplen3); FAIL_IF_NOT(r == 0); /* do detect */ @@ -1139,8 +1137,7 @@ static int DetectHttpUATest14(void) FAIL_IF_NOT(PacketAlertCheck(p, 1)); p->alerts.cnt = 0; - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf4, httplen4); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf4, httplen4); FAIL_IF_NOT(r == 0); /* do detect */ @@ -1148,8 +1145,7 @@ static int DetectHttpUATest14(void) FAIL_IF(PacketAlertCheck(p, 1)); FAIL_IF(PacketAlertCheck(p, 2)); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf5, httplen5); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf5, httplen5); FAIL_IF_NOT(r == 0); /* do detect */ @@ -1159,8 +1155,7 @@ static int DetectHttpUATest14(void) SCLogDebug("sending data chunk 7"); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, httpbuf6, httplen6); + r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, httpbuf6, httplen6); FAIL_IF_NOT(r == 0); /* do detect */ diff --git a/src/tests/detect.c b/src/tests/detect.c index 34b18cd828..a78b529373 100644 --- a/src/tests/detect.c +++ b/src/tests/detect.c @@ -332,7 +332,7 @@ static int SigTest06 (void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -350,8 +350,7 @@ static int SigTest06 (void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx); FAIL_IF_NULL(det_ctx); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, buf, buflen); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, buf, buflen); FAIL_IF(r != 0); SigMatchSignatures(&th_v, de_ctx, det_ctx, p); @@ -399,7 +398,7 @@ static int SigTest07 (void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -425,8 +424,7 @@ static int SigTest07 (void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx,(void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, buf, buflen); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, buf, buflen); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -489,7 +487,7 @@ static int SigTest08 (void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -515,8 +513,7 @@ static int SigTest08 (void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx,(void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, buf, buflen); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, buf, buflen); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -581,7 +578,7 @@ static int SigTest09 (void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -607,8 +604,7 @@ static int SigTest09 (void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx,(void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, buf, buflen); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, buf, buflen); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -665,7 +661,7 @@ static int SigTest10 (void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -691,8 +687,7 @@ static int SigTest10 (void) DetectEngineThreadCtxInit(&th_v, (void *)de_ctx,(void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, buf, buflen); + int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, buf, buflen); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); result = 0; @@ -747,7 +742,7 @@ static int SigTest11 (void) p->flow = &f; p->flowflags |= FLOW_PKT_TOSERVER; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4487,7 +4482,7 @@ static int SigTestDropFlow01(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4508,8 +4503,8 @@ static int SigTestDropFlow01(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4590,7 +4585,7 @@ static int SigTestDropFlow02(void) p->flowflags |= FLOW_PKT_TOSERVER; p->flowflags |= FLOW_PKT_ESTABLISHED; p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4611,8 +4606,8 @@ static int SigTestDropFlow02(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4711,7 +4706,7 @@ static int SigTestDropFlow03(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4742,8 +4737,8 @@ static int SigTestDropFlow03(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4788,8 +4783,8 @@ static int SigTestDropFlow03(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4885,7 +4880,7 @@ static int SigTestDropFlow04(void) p2->flowflags |= FLOW_PKT_TOSERVER; p2->flowflags |= FLOW_PKT_ESTABLISHED; p2->flags |= PKT_HAS_FLOW|PKT_STREAM_EST; - f.alproto = ALPROTO_HTTP; + f.alproto = ALPROTO_HTTP1; StreamTcpInitConfig(TRUE); @@ -4915,8 +4910,8 @@ static int SigTestDropFlow04(void) DetectEngineThreadCtxInit(&tv, (void *)de_ctx, (void *)&det_ctx); FLOWLOCK_WRLOCK(&f); - int r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf1, http_buf1_len); + int r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf1, http_buf1_len); if (r != 0) { printf("toserver chunk 1 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); @@ -4971,8 +4966,8 @@ static int SigTestDropFlow04(void) } FLOWLOCK_WRLOCK(&f); - r = AppLayerParserParse(NULL, alp_tctx, &f, ALPROTO_HTTP, - STREAM_TOSERVER, http_buf2, http_buf2_len); + r = AppLayerParserParse( + NULL, alp_tctx, &f, ALPROTO_HTTP1, STREAM_TOSERVER, http_buf2, http_buf2_len); if (r != 0) { printf("toserver chunk 2 returned %" PRId32 ", expected 0: ", r); FLOWLOCK_UNLOCK(&f); diff --git a/src/util-lua-http.c b/src/util-lua-http.c index bf612020f5..5dc521df7d 100644 --- a/src/util-lua-http.c +++ b/src/util-lua-http.c @@ -59,7 +59,7 @@ static int HttpGetRequestHost(lua_State *luastate) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -75,7 +75,7 @@ static int HttpGetRequestHost(lua_State *luastate) static int HttpGetRequestUriRaw(lua_State *luastate) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -91,7 +91,7 @@ static int HttpGetRequestUriRaw(lua_State *luastate) static int HttpGetRequestUriNormalized(lua_State *luastate) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -114,7 +114,7 @@ static int HttpGetRequestUriNormalized(lua_State *luastate) static int HttpGetRequestLine(lua_State *luastate) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -130,7 +130,7 @@ static int HttpGetRequestLine(lua_State *luastate) static int HttpGetResponseLine(lua_State *luastate) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -146,7 +146,7 @@ static int HttpGetResponseLine(lua_State *luastate) static int HttpGetHeader(lua_State *luastate, int dir) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -183,7 +183,7 @@ static int HttpGetResponseHeader(lua_State *luastate) static int HttpGetRawHeaders(lua_State *luastate, int dir) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -220,7 +220,7 @@ static int HttpGetRawResponseHeaders(lua_State *luastate) static int HttpGetHeaders(lua_State *luastate, int dir) { - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate); @@ -262,7 +262,7 @@ static int HttpGetBody(lua_State *luastate, int dir) { HtpBody *body = NULL; - if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP))) + if (!(LuaStateNeedProto(luastate, ALPROTO_HTTP1))) return LuaCallbackError(luastate, "error: protocol not http"); htp_tx_t *tx = LuaStateGetTX(luastate);