]> git.ipfire.org Git - people/ms/suricata.git/commitdiff
App Layer cleanup
authorVictor Julien <victor@inliniac.net>
Sat, 26 Nov 2011 13:36:34 +0000 (14:36 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 26 Nov 2011 13:36:34 +0000 (14:36 +0100)
Removal of per flow 'aldata' array. It contained a ptr for each ALPROTO. Instead now we have 2 ptrs in the flow: alparser and alstate.
Various cleanups and dead code removal from the app layer API.
Should safe 100+ bytes memory per flow on 64 bit.
Updated lots of unittests to reflect these changes.

48 files changed:
src/app-layer-dcerpc-udp.c
src/app-layer-dcerpc.c
src/app-layer-detect-proto.c
src/app-layer-ftp.c
src/app-layer-htp.c
src/app-layer-parser.c
src/app-layer-parser.h
src/app-layer-smb.c
src/app-layer-smb2.c
src/app-layer-smtp.c
src/app-layer-ssh.c
src/app-layer-ssl.c
src/app-layer.c
src/detect-dce-iface.c
src/detect-dce-opnum.c
src/detect-dce-stub-data.c
src/detect-engine-dcepayload.c
src/detect-engine-hcbd.c
src/detect-engine-hcd.c
src/detect-engine-hhd.c
src/detect-engine-hmd.c
src/detect-engine-hrhd.c
src/detect-engine-hrud.c
src/detect-engine-state.c
src/detect-engine-uri.c
src/detect-ftpbounce.c
src/detect-http-client-body.c
src/detect-http-cookie.c
src/detect-http-header.c
src/detect-http-method.c
src/detect-http-raw-header.c
src/detect-http-stat-code.c
src/detect-http-stat-msg.c
src/detect-pcre.c
src/detect-ssh-proto-version.c
src/detect-ssh-software-version.c
src/detect-ssl-state.c
src/detect-ssl-version.c
src/detect-tls-version.c
src/detect-uricontent.c
src/detect-urilen.c
src/detect.c
src/flow-util.c
src/flow-util.h
src/flow.c
src/flow.h
src/stream-tcp-private.h
src/stream-tcp.c

index 919628779ec94280d52f35fb8030d6d7ca0f76b0..25585ba2ddb7ecd78ff6fa34b5fbedcde149e557 100644 (file)
@@ -926,7 +926,6 @@ int DCERPCUDPParserTest01(void) {
     FLOW_INITIALIZE(&f);
 
        StreamTcpInitConfig(TRUE);
-       FlowL7DataPtrInit(&f);
 
        int r = AppLayerParse(&f, ALPROTO_DCERPC_UDP, STREAM_TOSERVER|STREAM_START, dcerpcrequest, requestlen);
        if (r != 0) {
@@ -935,7 +934,7 @@ int DCERPCUDPParserTest01(void) {
                goto end;
        }
 
-       DCERPCUDPState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC_UDP)];
+       DCERPCUDPState *dcerpc_state = f.alstate;
        if (dcerpc_state == NULL) {
                printf("no dcerpc state: ");
                result = 0;
@@ -966,7 +965,6 @@ int DCERPCUDPParserTest01(void) {
        }
 
 end:
-       FlowL7DataPtrFree(&f);
        StreamTcpFreeConfig(TRUE);
        return result;
 }
index dae2d9bbe93ee9eb273c9db19b4120933d2deeb3..b88d8e23285920a5b9c388fae2d95cbcbcd3a82b 100644 (file)
@@ -2210,7 +2210,6 @@ int DCERPCParserTest01(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER|STREAM_START, dcerpcbind, bindlen);
     if (r != 0) {
@@ -2219,7 +2218,7 @@ int DCERPCParserTest01(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -2278,7 +2277,6 @@ int DCERPCParserTest01(void) {
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -2430,7 +2428,6 @@ int DCERPCParserTest02(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER|STREAM_START, dcerpcrequest, requestlen);
     if (r != 0) {
@@ -2439,7 +2436,7 @@ int DCERPCParserTest02(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -2472,7 +2469,6 @@ int DCERPCParserTest02(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -2624,7 +2620,6 @@ int DCERPCParserTest03(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER|STREAM_START, dcerpcrequest, requestlen);
     if (r != 0) {
@@ -2633,7 +2628,7 @@ int DCERPCParserTest03(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -2659,7 +2654,6 @@ int DCERPCParserTest03(void) {
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -3790,7 +3784,6 @@ int DCERPCParserTest04(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     /* bind */
     int r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER|STREAM_START,
@@ -3801,7 +3794,7 @@ int DCERPCParserTest04(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4008,7 +4001,6 @@ int DCERPCParserTest04(void) {
         goto end;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -4055,7 +4047,6 @@ int DCERPCParserTest05(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER | STREAM_START,
                       bind1, bind1_len);
@@ -4065,7 +4056,7 @@ int DCERPCParserTest05(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4100,7 +4091,6 @@ int DCERPCParserTest05(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4221,7 +4211,6 @@ int DCERPCParserTest06(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER|STREAM_START,
                       bind1, bind1_len);
@@ -4231,7 +4220,7 @@ int DCERPCParserTest06(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4257,7 +4246,6 @@ int DCERPCParserTest06(void) {
     result &= (dcerpc_state->dcerpc.dcerpcbindbindack.numctxitemsleft == 0);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4298,7 +4286,6 @@ int DCERPCParserTest07(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER|STREAM_START,
                       request1, request1_len);
@@ -4308,7 +4295,7 @@ int DCERPCParserTest07(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4347,7 +4334,6 @@ int DCERPCParserTest07(void) {
     result &= (dcerpc_state->dcerpc.pdu_fragged == 0);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4378,7 +4364,6 @@ int DCERPCParserTest08(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER | STREAM_START,
                       request, request_len);
@@ -4388,7 +4373,7 @@ int DCERPCParserTest08(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4401,7 +4386,6 @@ int DCERPCParserTest08(void) {
     result &= (dcerpc_state->dcerpc.pdu_fragged == 0);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4432,7 +4416,6 @@ int DCERPCParserTest09(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER | STREAM_START,
                       request, request_len);
@@ -4442,7 +4425,7 @@ int DCERPCParserTest09(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4455,7 +4438,6 @@ int DCERPCParserTest09(void) {
     result &= (dcerpc_state->dcerpc.pdu_fragged == 1);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4500,7 +4482,6 @@ int DCERPCParserTest10(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER|STREAM_START,
                       fault, fault_len);
@@ -4510,7 +4491,7 @@ int DCERPCParserTest10(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4543,7 +4524,6 @@ int DCERPCParserTest10(void) {
     result &= (dcerpc_state->dcerpc.pdu_fragged == 0);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4589,7 +4569,6 @@ int DCERPCParserTest11(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER,
                       request1, request1_len);
@@ -4599,7 +4578,7 @@ int DCERPCParserTest11(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4636,7 +4615,6 @@ int DCERPCParserTest11(void) {
     result &= (dcerpc_state->dcerpc.pdu_fragged == 0);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4676,7 +4654,6 @@ int DCERPCParserTest12(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER,
                       bind_ack1, bind_ack1_len);
@@ -4686,7 +4663,7 @@ int DCERPCParserTest12(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4708,7 +4685,6 @@ int DCERPCParserTest12(void) {
     result &= (dcerpc_state->dcerpc.pdu_fragged == 0);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4745,7 +4721,6 @@ int DCERPCParserTest13(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER,
                       bind, bind_len);
@@ -4755,7 +4730,7 @@ int DCERPCParserTest13(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4788,7 +4763,6 @@ int DCERPCParserTest13(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4830,7 +4804,6 @@ int DCERPCParserTest14(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER,
                       bind, bind_len);
@@ -4840,7 +4813,7 @@ int DCERPCParserTest14(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4848,7 +4821,6 @@ int DCERPCParserTest14(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4886,7 +4858,6 @@ int DCERPCParserTest15(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOCLIENT,
                       bind_ack, bind_ack_len);
@@ -4896,7 +4867,7 @@ int DCERPCParserTest15(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -4904,7 +4875,6 @@ int DCERPCParserTest15(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -5342,7 +5312,6 @@ int DCERPCParserTest16(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER,
                       bind1, bind1_len);
@@ -5352,7 +5321,7 @@ int DCERPCParserTest16(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -5481,7 +5450,6 @@ int DCERPCParserTest16(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -5567,7 +5535,6 @@ int DCERPCParserTest17(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER,
                       bind, bind_len);
@@ -5577,7 +5544,7 @@ int DCERPCParserTest17(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -5660,7 +5627,6 @@ int DCERPCParserTest17(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -5697,7 +5663,6 @@ int DCERPCParserTest18(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_DCERPC, STREAM_TOSERVER,
                       request1, request1_len);
@@ -5707,7 +5672,7 @@ int DCERPCParserTest18(void) {
         goto end;
     }
 
-    DCERPCState *dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    DCERPCState *dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         result = 0;
@@ -5733,7 +5698,6 @@ int DCERPCParserTest18(void) {
     result &= (dcerpc_state->dcerpc.dcerpcrequest.opnum == 2);
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
index 53f57debec39e631761a432dba01f988d3ab3fa6..f2990d1324f836021a16cedc8443a742b9fbd951 100644 (file)
@@ -1551,7 +1551,6 @@ static int AlpDetectTestSig1(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1576,7 +1575,7 @@ static int AlpDetectTestSig1(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1642,7 +1641,6 @@ static int AlpDetectTestSig2(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1667,7 +1665,7 @@ static int AlpDetectTestSig2(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1733,7 +1731,6 @@ static int AlpDetectTestSig3(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1758,7 +1755,7 @@ static int AlpDetectTestSig3(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1794,7 +1791,6 @@ static int AlpDetectTestSig4(void)
 {
     int result = 0;
     Flow f;
-    HtpState *http_state = NULL;
     uint8_t http_buf1[] = "MPUT one\r\n";
     uint32_t http_buf1_len = sizeof(http_buf1) - 1;
     TcpSession ssn;
@@ -1821,7 +1817,6 @@ static int AlpDetectTestSig4(void)
     f.alproto = ALPROTO_FTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1846,12 +1841,6 @@ static int AlpDetectTestSig4(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
-    if (http_state != NULL) {
-        printf("this is not http: ");
-        goto end;
-    }
-
     /* do detect */
     SigMatchSignatures(&tv, de_ctx, det_ctx, p);
 
@@ -1918,7 +1907,6 @@ static int AlpDetectTestSig5(void)
     }
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     StreamMsg *stream_msg = StreamMsgGetFromPool();
     if (stream_msg == NULL) {
index e2f97f3cbaf77ecf9014f1e41cf8b76e3acf68a0..9ec1575c1f6ea1b7a98dd3a659a69c57a47aacb3 100644 (file)
@@ -303,7 +303,6 @@ int FTPParserTest01(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_FTP, STREAM_TOSERVER|STREAM_EOF, ftpbuf, ftplen);
     if (r != 0) {
@@ -312,7 +311,7 @@ int FTPParserTest01(void) {
         goto end;
     }
 
-    FtpState *ftp_state = f.aldata[AlpGetStateIdx(ALPROTO_FTP)];
+    FtpState *ftp_state = f.alstate;
     if (ftp_state == NULL) {
         SCLogDebug("no ftp state: ");
         result = 0;
@@ -326,7 +325,6 @@ int FTPParserTest01(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -349,7 +347,6 @@ int FTPParserTest03(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_FTP, STREAM_TOSERVER|STREAM_START, ftpbuf1, ftplen1);
     if (r != 0) {
@@ -372,7 +369,7 @@ int FTPParserTest03(void) {
         goto end;
     }
 
-    FtpState *ftp_state = f.aldata[AlpGetStateIdx(ALPROTO_FTP)];
+    FtpState *ftp_state = f.alstate;
     if (ftp_state == NULL) {
         SCLogDebug("no ftp state: ");
         result = 0;
@@ -386,7 +383,6 @@ int FTPParserTest03(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -406,7 +402,6 @@ int FTPParserTest06(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_FTP, STREAM_TOSERVER|STREAM_START|STREAM_EOF, ftpbuf1, ftplen1);
     if (r != 0) {
@@ -415,7 +410,7 @@ int FTPParserTest06(void) {
         goto end;
     }
 
-    FtpState *ftp_state = f.aldata[AlpGetStateIdx(ALPROTO_FTP)];
+    FtpState *ftp_state = f.alstate;
     if (ftp_state == NULL) {
         SCLogDebug("no ftp state: ");
         result = 0;
@@ -429,7 +424,6 @@ int FTPParserTest06(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -452,7 +446,6 @@ int FTPParserTest07(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_FTP, STREAM_TOSERVER|STREAM_START, ftpbuf1, ftplen1);
     if (r != 0) {
@@ -468,7 +461,7 @@ int FTPParserTest07(void) {
         goto end;
     }
 
-    FtpState *ftp_state = f.aldata[AlpGetStateIdx(ALPROTO_FTP)];
+    FtpState *ftp_state = f.alstate;
     if (ftp_state == NULL) {
         SCLogDebug("no ftp state: ");
         result = 0;
@@ -482,7 +475,6 @@ int FTPParserTest07(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -504,7 +496,6 @@ int FTPParserTest10(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     uint32_t u;
     for (u = 0; u < ftplen1; u++) {
@@ -522,7 +513,7 @@ int FTPParserTest10(void) {
         }
     }
 
-    FtpState *ftp_state = f.aldata[AlpGetStateIdx(ALPROTO_FTP)];
+    FtpState *ftp_state = f.alstate;
     if (ftp_state == NULL) {
         SCLogDebug("no ftp state: ");
         result = 0;
@@ -536,7 +527,6 @@ int FTPParserTest10(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
index c81ce0ec41772f8cf7f194f011c8ca8f04ec4e76..f694ef45c2ac2e0fdc593fa8192fc73b93b404b6 100644 (file)
@@ -599,14 +599,8 @@ int HtpTransactionGetLoggableId(Flow *f)
 {
     SCEnter();
 
-    /* Get the parser state (if any) */
-    if (f->aldata == NULL) {
-        SCLogDebug("no aldata");
-        goto error;
-    }
-
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f->aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f->alparser;
 
     if (parser_state_store == NULL) {
         SCLogDebug("no state store");
@@ -615,7 +609,7 @@ int HtpTransactionGetLoggableId(Flow *f)
 
     int id = 0;
 
-    HtpState *http_state = f->aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *http_state = f->alstate;
     if (http_state == NULL || http_state->connp == NULL ||
             http_state->connp->conn == NULL) {
         SCLogDebug("no (void) http state");
@@ -1266,7 +1260,6 @@ int HTPParserTest01(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     uint32_t u;
     for (u = 0; u < httplen1; u++) {
@@ -1285,7 +1278,7 @@ int HTPParserTest01(void) {
         }
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1312,7 +1305,6 @@ int HTPParserTest01(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -1335,7 +1327,6 @@ int HTPParserTest02(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START|
                           STREAM_EOF, httpbuf1, httplen1);
@@ -1345,7 +1336,7 @@ int HTPParserTest02(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1366,7 +1357,6 @@ int HTPParserTest02(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (http_state != NULL)
         HTPStateFree(http_state);
@@ -1391,7 +1381,6 @@ int HTPParserTest03(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     uint32_t u;
     for (u = 0; u < httplen1; u++) {
@@ -1409,7 +1398,7 @@ int HTPParserTest03(void) {
             goto end;
         }
     }
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1433,7 +1422,6 @@ int HTPParserTest03(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -1457,7 +1445,6 @@ int HTPParserTest04(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START|
                           STREAM_EOF, httpbuf1, httplen1);
@@ -1465,7 +1452,7 @@ int HTPParserTest04(void) {
         goto end;
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1489,7 +1476,6 @@ int HTPParserTest04(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -1524,7 +1510,6 @@ int HTPParserTest05(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START,
                           httpbuf1, httplen1);
@@ -1572,7 +1557,7 @@ int HTPParserTest05(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1604,7 +1589,6 @@ int HTPParserTest05(void) {
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (http_state != NULL)
         HTPStateFree(http_state);
@@ -1669,7 +1653,6 @@ int HTPParserTest06(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START,
                           httpbuf1, httplen1);
@@ -1687,7 +1670,7 @@ int HTPParserTest06(void) {
         goto end;
     }
 
-    http_state =  f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1721,7 +1704,6 @@ int HTPParserTest06(void) {
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (http_state != NULL)
         HTPStateFree(http_state);
@@ -1746,7 +1728,6 @@ int HTPParserTest07(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     uint32_t u;
     for (u = 0; u < httplen1; u++) {
@@ -1767,7 +1748,7 @@ int HTPParserTest07(void) {
         }
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1799,7 +1780,6 @@ int HTPParserTest07(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -1842,7 +1822,6 @@ libhtp:\n\
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     uint8_t flags = 0;
     flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF;
@@ -1855,7 +1834,7 @@ libhtp:\n\
         goto end;
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1871,7 +1850,6 @@ libhtp:\n\
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -1917,7 +1895,6 @@ libhtp:\n\
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     uint8_t flags = 0;
     flags = STREAM_TOSERVER|STREAM_START|STREAM_EOF;
@@ -1930,7 +1907,7 @@ libhtp:\n\
         goto end;
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1946,7 +1923,6 @@ libhtp:\n\
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -2302,7 +2278,6 @@ libhtp:\n\
     }
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     uint32_t u;
     for (u = 0; u < httplen1; u++) {
@@ -2321,7 +2296,7 @@ libhtp:\n\
         }
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -2342,7 +2317,6 @@ end:
     ConfRestoreContextBackup();
     HtpConfigRestoreBackup();
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
index 00a5b4bae31af63e429e6ae029e0cabe26604f20..6d76fb0ddca698e95b35e80db142167bddd2ec6d 100644 (file)
 
 #include "util-debug.h"
 
-uint16_t app_layer_sid = 0;
 static AppLayerProto al_proto_table[ALPROTO_MAX];   /**< Application layer protocol
-                                                       table mapped to their
-                                                       corresponding parsers */
+                                                         table mapped to their
+                                                         corresponding parsers */
 
 #define MAX_PARSERS 100
 static AppLayerParserTableElement al_parser_table[MAX_PARSERS];
@@ -176,11 +175,11 @@ static int AlpStoreField(AppLayerParserResult *output, uint16_t idx,
 
 void AppLayerSetEOF(Flow *f)
 {
-    if (f == NULL || f->aldata == NULL)
+    if (f == NULL)
         return;
 
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f->aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f->alparser;
     if (parser_state_store != NULL) {
         parser_state_store->id_flags |= APP_LAYER_TRANSACTION_EOF;
         parser_state_store->to_client.flags |= APP_LAYER_PARSER_EOF;
@@ -484,30 +483,6 @@ int AlpParseFieldByDelimiter(AppLayerParserResult *output, AppLayerParserState *
     SCReturnInt(0);
 }
 
-/** app layer id counter */
-static uint8_t al_module_id = 0;
-
-/** \brief Get a unique app layer id
- */
-uint8_t AppLayerRegisterModule(void) {
-    uint8_t id = al_module_id;
-    al_module_id++;
-    return id;
-}
-
-uint8_t AppLayerGetStorageSize(void) {
-    return al_module_id;
-}
-
-/** \brief Get the Parsers id for storing the parser state.
- *
- * \retval Parser subsys id
- */
-uint16_t AppLayerParserGetStorageId(void)
-{
-    return app_layer_sid;
-}
-
 uint16_t AppLayerGetProtoByName(const char *name)
 {
     uint8_t u = 1;
@@ -535,7 +510,6 @@ uint16_t AppLayerGetProtoByName(const char *name)
  * \todo do we need recursive, so a "http" and a "request_line" where the engine
  *       knows it's actually "http.request_line"... same difference maybe.
  * \param AppLayerParser pointer to the parser function
- * \param max_outputs max number of unique outputs the parser can generate
  *
  * \retval 0 on success
  * \retval -1 on error
@@ -560,9 +534,9 @@ int AppLayerRegisterParser(char *name, uint16_t proto, uint16_t parser_id,
     al_parser_table[al_max_parsers].AppLayerParser = AppLayerParser;
 
     SCLogDebug("registered %p at proto %" PRIu32 ", al_proto_table idx "
-               "%" PRIu32 ", storage_id %" PRIu32 ", parser_local_id %" PRIu32 "",
+               "%" PRIu32 ", parser_local_id %" PRIu32 "",
                 AppLayerParser, proto, al_max_parsers,
-                al_proto_table[proto].storage_id, parser_id);
+                parser_id);
     return 0;
 }
 
@@ -601,13 +575,9 @@ int AppLayerRegisterProto(char *name, uint8_t proto, uint8_t flags,
         al_proto_table[proto].to_client = al_max_parsers;
     }
 
-    if (al_proto_table[proto].storage_id == 0) {
-        al_proto_table[proto].storage_id = AppLayerRegisterModule();
-    }
-
     SCLogDebug("registered %p at proto %" PRIu32 " flags %02X, al_proto_table "
-                "idx %" PRIu32 ", storage_id %" PRIu32 " %s", AppLayerParser, proto,
-                flags, al_max_parsers, al_proto_table[proto].storage_id, name);
+                "idx %" PRIu32 ", %s", AppLayerParser, proto,
+                flags, al_max_parsers, name);
     return 0;
 }
 
@@ -633,11 +603,6 @@ void AppLayerRegisterLogger(uint16_t proto) {
 }
 
 
-uint16_t AlpGetStateIdx(uint16_t proto)
-{
-    return al_proto_table[proto].storage_id;
-}
-
 AppLayerParserStateStore *AppLayerParserStateStoreAlloc(void)
 {
     AppLayerParserStateStore *s = (AppLayerParserStateStore *)SCMalloc
@@ -701,8 +666,12 @@ static int AppLayerDoParse(Flow *f, void *app_layer_state, AppLayerParserState *
         if (r == -1) {
             AppLayerParserResultCleanup(&result);
             SCReturnInt(-1);
+#ifdef DEBUG
         } else {
             BUG_ON(r);  /* this is not supposed to happen!! */
+#else
+            SCReturnInt(-1);
+#endif
         }
     }
 
@@ -741,8 +710,12 @@ static int AppLayerDoParse(Flow *f, void *app_layer_state, AppLayerParserState *
             if (r == -1) {
                 retval = -1;
                 break;
+#ifdef DEBUG
             } else {
-                BUG_ON(r);
+                BUG_ON(r);  /* this is not supposed to happen!! */
+#else
+                SCReturnInt(-1);
+#endif
             }
         }
     }
@@ -824,25 +797,13 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
     }
 
     /* Get the parser state (if any) */
-    AppLayerParserStateStore *parser_state_store = NULL;
-
-    if (f->aldata != NULL) {
-        parser_state_store = (AppLayerParserStateStore *)
-                                                    f->aldata[app_layer_sid];
-        if (parser_state_store == NULL) {
-            parser_state_store = AppLayerParserStateStoreAlloc();
-            if (parser_state_store == NULL)
-                goto error;
-
-            f->aldata[app_layer_sid] = (void *)parser_state_store;
-        }
-    } else {
-        SCLogDebug("No App Layer Data");
-        /* Nothing is there to clean up, so just return from here after setting
-         * up the no reassembly flags */
-        FlowSetSessionNoApplayerInspectionFlag(f);
+    AppLayerParserStateStore *parser_state_store = f->alparser;
+    if (parser_state_store == NULL) {
+        parser_state_store = AppLayerParserStateStoreAlloc();
+        if (parser_state_store == NULL)
+            goto error;
 
-        SCReturnInt(-1);
+        f->alparser = (void *)parser_state_store;
     }
 
     parser_state_store->version++;
@@ -887,9 +848,7 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
         parser_state->flags |= APP_LAYER_PARSER_EOF;
 
     /* See if we already have a 'app layer' state */
-    void *app_layer_state = NULL;
-    app_layer_state = f->aldata[p->storage_id];
-
+    void *app_layer_state = f->alstate;
     if (app_layer_state == NULL) {
         /* lock the allocation of state as we may
          * alloc more than one otherwise */
@@ -898,12 +857,12 @@ int AppLayerParse(Flow *f, uint8_t proto, uint8_t flags, uint8_t *input,
             goto error;
         }
 
-        f->aldata[p->storage_id] = app_layer_state;
-        SCLogDebug("alloced new app layer state %p (p->storage_id %u, name %s)",
-                app_layer_state, p->storage_id, al_proto_table[f->alproto].name);
+        f->alstate = app_layer_state;
+        SCLogDebug("alloced new app layer state %p (name %s)",
+                app_layer_state, al_proto_table[f->alproto].name);
     } else {
-        SCLogDebug("using existing app layer state %p (p->storage_id %u, name %s))",
-                app_layer_state, p->storage_id, al_proto_table[f->alproto].name);
+        SCLogDebug("using existing app layer state %p (name %s))",
+                app_layer_state, al_proto_table[f->alproto].name);
     }
 
     /* invoke the recursive parser, but only on data. We may get empty msgs on EOF */
@@ -997,14 +956,8 @@ error:
 int AppLayerTransactionGetBaseId(Flow *f) {
     SCEnter();
 
-    /* Get the parser state (if any) */
-    if (f->aldata == NULL) {
-        SCLogDebug("no aldata");
-        goto error;
-    }
-
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f->aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f->alparser;
 
     if (parser_state_store == NULL) {
         SCLogDebug("no state store");
@@ -1021,14 +974,8 @@ error:
 int AppLayerTransactionGetInspectId(Flow *f) {
     SCEnter();
 
-    /* Get the parser state (if any) */
-    if (f->aldata == NULL) {
-        SCLogDebug("no aldata");
-        goto error;
-    }
-
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f->aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f->alparser;
 
     if (parser_state_store == NULL) {
         SCLogDebug("no state store");
@@ -1045,14 +992,8 @@ error:
 int AppLayerTransactionGetLoggableId(Flow *f) {
     SCEnter();
 
-    /* Get the parser state (if any) */
-    if (f->aldata == NULL) {
-        SCLogDebug("no aldata");
-        goto error;
-    }
-
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f->aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f->alparser;
 
     if (parser_state_store == NULL) {
         SCLogDebug("no state store");
@@ -1078,14 +1019,8 @@ error:
 void AppLayerTransactionUpdateLoggedId(Flow *f) {
     SCEnter();
 
-    /* Get the parser state (if any) */
-    if (f->aldata == NULL) {
-        SCLogDebug("no aldata");
-        goto error;
-    }
-
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f->aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f->alparser;
 
     if (parser_state_store == NULL) {
         SCLogDebug("no state store");
@@ -1102,14 +1037,8 @@ error:
 int AppLayerTransactionGetLoggedId(Flow *f) {
     SCEnter();
 
-    /* Get the parser state (if any) */
-    if (f->aldata == NULL) {
-        SCLogDebug("no aldata");
-        goto error;
-    }
-
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f->aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f->alparser;
 
     if (parser_state_store == NULL) {
         SCLogDebug("no state store");
@@ -1133,12 +1062,9 @@ uint16_t AppLayerGetStateVersion(Flow *f) {
     uint16_t version = 0;
     AppLayerParserStateStore *parser_state_store = NULL;
 
-    /* Get the parser state (if any) */
-    if (f->aldata != NULL) {
-        parser_state_store = (AppLayerParserStateStore *)f->aldata[app_layer_sid];
-        if (parser_state_store != NULL) {
-            version = parser_state_store->version;
-        }
+    parser_state_store = (AppLayerParserStateStore *)f->alparser;
+    if (parser_state_store != NULL) {
+        version = parser_state_store->version;
     }
 
     SCReturnUInt(version);
@@ -1157,47 +1083,43 @@ int AppLayerTransactionUpdateInspectId(Flow *f, char direction)
     SCEnter();
 
     int r = 0;
-
-    /* Get the parser state (if any) */
     AppLayerParserStateStore *parser_state_store = NULL;
 
-    if (f->aldata != NULL) {
-        parser_state_store = (AppLayerParserStateStore *)f->aldata[app_layer_sid];
-        if (parser_state_store != NULL) {
-            /* update inspect_id and see if it there are other transactions
-             * as well */
+    parser_state_store = (AppLayerParserStateStore *)f->alparser;
+    if (parser_state_store != NULL) {
+        /* update inspect_id and see if it there are other transactions
+         * as well */
 
-            SCLogDebug("avail_id %"PRIu16", inspect_id %"PRIu16,
-                    parser_state_store->avail_id, parser_state_store->inspect_id);
+        SCLogDebug("avail_id %"PRIu16", inspect_id %"PRIu16,
+                parser_state_store->avail_id, parser_state_store->inspect_id);
 
-            if (direction == STREAM_TOSERVER)
-                parser_state_store->id_flags |= APP_LAYER_TRANSACTION_TOSERVER;
-            else
-                parser_state_store->id_flags |= APP_LAYER_TRANSACTION_TOCLIENT;
-
-            if ((parser_state_store->inspect_id+1) < parser_state_store->avail_id &&
-                    (parser_state_store->id_flags & APP_LAYER_TRANSACTION_TOCLIENT) &&
-                    (parser_state_store->id_flags & APP_LAYER_TRANSACTION_TOSERVER))
-            {
-                parser_state_store->id_flags &=~ APP_LAYER_TRANSACTION_TOCLIENT;
-                parser_state_store->id_flags &=~ APP_LAYER_TRANSACTION_TOSERVER;
-
-                parser_state_store->inspect_id = parser_state_store->avail_id - 1;
-                if (parser_state_store->inspect_id < parser_state_store->avail_id) {
-                    /* done and more transactions available */
-                    r = 2;
-
-                    SCLogDebug("inspect_id %"PRIu16", avail_id %"PRIu16,
-                            parser_state_store->inspect_id,
-                            parser_state_store->avail_id);
-                } else {
-                    /* done but no more transactions available */
-                    r = 1;
-
-                    SCLogDebug("inspect_id %"PRIu16", avail_id %"PRIu16,
-                            parser_state_store->inspect_id,
-                            parser_state_store->avail_id);
-                }
+        if (direction == STREAM_TOSERVER)
+            parser_state_store->id_flags |= APP_LAYER_TRANSACTION_TOSERVER;
+        else
+            parser_state_store->id_flags |= APP_LAYER_TRANSACTION_TOCLIENT;
+
+        if ((parser_state_store->inspect_id+1) < parser_state_store->avail_id &&
+                (parser_state_store->id_flags & APP_LAYER_TRANSACTION_TOCLIENT) &&
+                (parser_state_store->id_flags & APP_LAYER_TRANSACTION_TOSERVER))
+        {
+            parser_state_store->id_flags &=~ APP_LAYER_TRANSACTION_TOCLIENT;
+            parser_state_store->id_flags &=~ APP_LAYER_TRANSACTION_TOSERVER;
+
+            parser_state_store->inspect_id = parser_state_store->avail_id - 1;
+            if (parser_state_store->inspect_id < parser_state_store->avail_id) {
+                /* done and more transactions available */
+                r = 2;
+
+                SCLogDebug("inspect_id %"PRIu16", avail_id %"PRIu16,
+                        parser_state_store->inspect_id,
+                        parser_state_store->avail_id);
+            } else {
+                /* done but no more transactions available */
+                r = 1;
+
+                SCLogDebug("inspect_id %"PRIu16", avail_id %"PRIu16,
+                        parser_state_store->inspect_id,
+                        parser_state_store->avail_id);
             }
         }
     }
@@ -1211,8 +1133,6 @@ void RegisterAppLayerParsers(void)
     memset(&al_proto_table, 0, sizeof(al_proto_table));
     memset(&al_parser_table, 0, sizeof(al_parser_table));
 
-    app_layer_sid = AppLayerRegisterModule();
-
     /** setup result pool
      * \todo Per thread pool */
     al_result_pool = PoolInit(1000,250,AlpResultElmtPoolAlloc,NULL,AlpResultElmtPoolFree);
@@ -1254,25 +1174,17 @@ void AppLayerParserCleanupState(Flow *f)
 
     /* free the parser protocol state */
     AppLayerProto *p = &al_proto_table[f->alproto];
-    if (p->StateFree != NULL && f->aldata != NULL) {
-        if (f->aldata[p->storage_id] != NULL) {
-            SCLogDebug("calling StateFree");
-            p->StateFree(f->aldata[p->storage_id]);
-            f->aldata[p->storage_id] = NULL;
-        }
+    if (p->StateFree != NULL && f->alstate != NULL) {
+        SCLogDebug("calling StateFree");
+        p->StateFree(f->alstate);
+        f->alstate = NULL;
     }
 
     /* free the app layer parser api state */
-    if (f->aldata != NULL) {
-        if (f->aldata[app_layer_sid] != NULL) {
-            SCLogDebug("calling AppLayerParserStateStoreFree");
-            AppLayerParserStateStoreFree(f->aldata[app_layer_sid]);
-            f->aldata[app_layer_sid] = NULL;
-        }
-
-        //StreamTcpDecrMemuse((uint32_t)(StreamL7GetStorageSize() * sizeof(void *)));
-        SCFree(f->aldata);
-        f->aldata = NULL;
+    if (f->alparser != NULL) {
+        SCLogDebug("calling AppLayerParserStateStoreFree");
+        AppLayerParserStateStoreFree(f->alparser);
+        f->alparser = NULL;
     }
 }
 
@@ -1952,7 +1864,6 @@ static int AppLayerParserTest01 (void)
     f.proto = IPPROTO_TCP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TEST, STREAM_TOSERVER|STREAM_EOF, testbuf,
                           testlen);
@@ -1969,7 +1880,6 @@ static int AppLayerParserTest01 (void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -2014,7 +1924,6 @@ static int AppLayerParserTest02 (void)
     f.proto = IPPROTO_UDP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TEST, STREAM_TOSERVER|STREAM_EOF, testbuf,
                           testlen);
@@ -2025,7 +1934,6 @@ static int AppLayerParserTest02 (void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
index 92fa761d5358027bbe0683190f88314b1eab0e47..3e2c486ce9ca86bd98e0be84b942a01d91514d07 100644 (file)
@@ -39,17 +39,16 @@ typedef struct AppLayerProto_ {
 
     uint16_t to_server;
     uint16_t to_client;
-    uint8_t storage_id;
+    uint16_t map_size;
+    char logger; /**< does this proto have a logger enabled? */
 
     AppLayerLocalMap **map;
-    uint16_t map_size;
 
     void *(*StateAlloc)(void);
     void (*StateFree)(void *);
     void (*StateUpdateTransactionId)(void *, uint16_t *);
     void (*StateTransactionFree)(void *, uint16_t);
 
-    char logger; /**< does this proto have a logger enabled? */
 } AppLayerProto;
 
 /** flags for the result elmts */
@@ -123,16 +122,14 @@ typedef struct AppLayerParserStateStore_ {
 } AppLayerParserStateStore;
 
 typedef struct AppLayerParserTableElement_ {
-    char *name;
-    uint16_t proto;
-    uint16_t parser_local_id; /** local id of the parser in the parser itself. */
-    uint8_t flags;
     int (*AppLayerParser)(Flow *f, void *protocol_state, AppLayerParserState
                           *parser_state, uint8_t *input, uint32_t input_len,
                           AppLayerParserResult *output);
-    uint16_t max_outputs; /* rationele is that if we know the max outputs of all
-                             parsers, we can statically define our output array
-                             to be a certain size */
+
+    char *name;
+
+    uint16_t proto;
+    uint16_t parser_local_id; /**< local id of the parser in the parser itself. */
 } AppLayerParserTableElement;
 
 typedef struct AppLayerProbingParserElement_ {
@@ -211,16 +208,14 @@ AppLayerProbingParserInfo *AppLayerGetProbingParserInfo(AppLayerProbingParserInf
 
     return NULL;
 }
-extern uint16_t app_layer_sid;
-
 struct AlpProtoDetectCtx_;
 
-extern uint16_t app_layer_sid;
-
 /* prototypes */
 void AppLayerParsersInitPostProcess(void);
 void RegisterAppLayerParsers(void);
+void AppLayerParserRegisterTests(void);
 
+/* registration */
 int AppLayerRegisterProto(char *name, uint8_t proto, uint8_t flags,
                           int (*AppLayerParser)(Flow *f, void *protocol_state,
                           AppLayerParserState *parser_state, uint8_t *input,
@@ -241,7 +236,9 @@ void AppLayerRegisterTransactionIdFuncs(uint16_t proto,
         void (*StateTransactionId)(void *, uint16_t *),
         void (*StateTransactionFree)(void *, uint16_t id));
 void AppLayerRegisterLogger(uint16_t proto);
+uint16_t AppLayerGetProtoByName(const char *);
 
+/* parsing */
 int AppLayerParse(Flow *, uint8_t proto, uint8_t flags, uint8_t *input,
                   uint32_t input_len);
 
@@ -252,29 +249,23 @@ int AlpParseFieldByEOF(AppLayerParserResult *, AppLayerParserState *, uint16_t,
 int AlpParseFieldByDelimiter(AppLayerParserResult *, AppLayerParserState *,
                              uint16_t, const uint8_t *, uint8_t, uint8_t *,
                              uint32_t, uint32_t *);
-uint16_t AlpGetStateIdx(uint16_t);
-void AppLayerSetEOF(Flow *);
 
-uint16_t AppLayerGetProtoByName(const char *);
 
+/* transaction handling */
 int AppLayerTransactionUpdateInspectId(Flow *, char);
 void AppLayerTransactionUpdateLoggedId(Flow *);
-
 int AppLayerTransactionGetLoggableId(Flow *f);
 int AppLayerTransactionGetLoggedId(Flow *f);
 int AppLayerTransactionGetBaseId(Flow *f);
 int AppLayerTransactionGetInspectId(Flow *f);
+void AppLayerSetEOF(Flow *);
 
-void AppLayerParserRegisterTests(void);
+uint16_t AppLayerGetStateVersion(Flow *f);
 
+/* cleanup */
 void AppLayerParserCleanupState(Flow *);
-
-uint8_t AppLayerRegisterModule(void);
-uint8_t AppLayerGetStorageSize(void);
 void AppLayerFreeProbingParsers(AppLayerProbingParser *);
 void AppLayerFreeProbingParsersInfo(AppLayerProbingParserInfo *);
 void AppLayerPrintProbingParsers(AppLayerProbingParser *);
 
-uint16_t AppLayerGetStateVersion(Flow *f);
-
 #endif /* __APP_LAYER_PARSER_H__ */
index 8c20e37af6846f1c65913c19985fd7c6c5ebaa02..2c179e28c9d34204b77b5c602708e8d598177a65 100644 (file)
@@ -1425,7 +1425,6 @@ int SMBParserTest01(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SMB, STREAM_TOSERVER|STREAM_EOF, smbbuf, smblen);
     if (r != 0) {
@@ -1433,7 +1432,7 @@ int SMBParserTest01(void) {
         goto end;
     }
 
-    SMBState *smb_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB)];
+    SMBState *smb_state = f.alstate;
     if (smb_state == NULL) {
         printf("no smb state: ");
         goto end;
@@ -1456,7 +1455,6 @@ int SMBParserTest01(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1496,7 +1494,6 @@ int SMBParserTest02(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SMB, STREAM_TOSERVER|STREAM_EOF, smbbuf, smblen);
     if (r != 0) {
@@ -1504,7 +1501,7 @@ int SMBParserTest02(void) {
         goto end;
     }
 
-    SMBState *smb_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB)];
+    SMBState *smb_state = f.alstate;
     if (smb_state == NULL) {
         printf("no smb state: ");
         goto end;
@@ -1528,7 +1525,6 @@ int SMBParserTest02(void) {
     printUUID("BIND", smb_state->dcerpc.dcerpcbindbindack.uuid_entry);
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1786,7 +1782,6 @@ int SMBParserTest03(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMB, STREAM_TOSERVER|STREAM_START, smbbuf1, smblen1);
     if (r != 0) {
@@ -1794,7 +1789,7 @@ int SMBParserTest03(void) {
         goto end;
     }
 
-    SMBState *smb_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB)];
+    SMBState *smb_state = f.alstate;
     if (smb_state == NULL) {
         printf("no smb state: ");
         goto end;
@@ -1818,7 +1813,6 @@ int SMBParserTest03(void) {
     printUUID("BIND", smb_state->dcerpc.dcerpcbindbindack.uuid_entry);
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1891,7 +1885,6 @@ int SMBParserTest04(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMB, STREAM_TOSERVER|STREAM_START, smbbuf1, smblen1);
     if (r != 0) {
@@ -1899,7 +1892,7 @@ int SMBParserTest04(void) {
         goto end;
     }
 
-    SMBState *smb_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB)];
+    SMBState *smb_state = f.alstate;
     if (smb_state == NULL) {
         printf("no smb state: ");
         goto end;
@@ -1928,7 +1921,6 @@ int SMBParserTest04(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2133,7 +2125,6 @@ int SMBParserTest07(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMB, STREAM_TOCLIENT | STREAM_START, smbbuf1, smblen1);
     if (r != 0) {
@@ -2141,7 +2132,7 @@ int SMBParserTest07(void) {
         goto end;
     }
 
-    SMBState *smb_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB)];
+    SMBState *smb_state = f.alstate;
     if (smb_state == NULL) {
         printf("no smb state: ");
         goto end;
@@ -2165,7 +2156,6 @@ int SMBParserTest07(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2201,7 +2191,6 @@ int SMBParserTest08(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMB, STREAM_TOCLIENT | STREAM_START, smbbuf1, smblen1);
     if (r != 0) {
@@ -2209,7 +2198,7 @@ int SMBParserTest08(void) {
         goto end;
     }
 
-    SMBState *smb_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB)];
+    SMBState *smb_state = f.alstate;
     if (smb_state == NULL) {
         printf("no smb state: ");
         goto end;
@@ -2256,7 +2245,6 @@ int SMBParserTest08(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2306,7 +2294,6 @@ int SMBParserTest09(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMB, STREAM_TOSERVER | STREAM_START, smbbuf1, smblen1);
     if (r != 0) {
@@ -2314,7 +2301,7 @@ int SMBParserTest09(void) {
         goto end;
     }
 
-    SMBState *smb_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB)];
+    SMBState *smb_state = f.alstate;
     if (smb_state == NULL) {
         printf("no smb state: ");
         goto end;
@@ -2361,7 +2348,6 @@ int SMBParserTest09(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
index 2c72a9f1873b22e8c64c2a2f5614eb998ccb4cd7..6df35f41d6118f358534af3646c69cd65bf88396 100644 (file)
@@ -470,7 +470,6 @@ int SMB2ParserTest01(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SMB2, STREAM_TOSERVER|STREAM_EOF, smb2buf, smb2len);
     if (r != 0) {
@@ -479,7 +478,7 @@ int SMB2ParserTest01(void) {
         goto end;
     }
 
-    SMB2State *smb2_state = f.aldata[AlpGetStateIdx(ALPROTO_SMB2)];
+    SMB2State *smb2_state = f.alstate;
     if (smb2_state == NULL) {
         printf("no smb2 state: ");
         result = 0;
@@ -505,7 +504,6 @@ int SMB2ParserTest01(void) {
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
index 345922baa17afe63391ff72529e3cfddb67d7d38..80b1a73515f99b357f8b4950c0c9810e6f44d430 100644 (file)
@@ -736,7 +736,6 @@ int SMTPParserTest01(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMTP, STREAM_TOSERVER,
                       request1, request1_len);
@@ -744,7 +743,7 @@ int SMTPParserTest01(void)
         printf("smtp check returned %" PRId32 ", expected 0: ", r);
         goto end;
     }
-    SMTPState *smtp_state = f.aldata[AlpGetStateIdx(ALPROTO_SMTP)];
+    SMTPState *smtp_state = f.alstate;
     if (smtp_state == NULL) {
         printf("no smtp state: ");
         goto end;
@@ -826,7 +825,6 @@ int SMTPParserTest01(void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -1078,7 +1076,6 @@ int SMTPParserTest02(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMTP, STREAM_TOSERVER,
                       request1, request1_len);
@@ -1086,7 +1083,7 @@ int SMTPParserTest02(void)
         printf("smtp check returned %" PRId32 ", expected 0: ", r);
         goto end;
     }
-    SMTPState *smtp_state = f.aldata[AlpGetStateIdx(ALPROTO_SMTP)];
+    SMTPState *smtp_state = f.alstate;
     if (smtp_state == NULL) {
         printf("no smtp state: ");
         goto end;
@@ -1522,7 +1519,6 @@ int SMTPParserTest02(void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -1624,7 +1620,6 @@ int SMTPParserTest03(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMTP, STREAM_TOSERVER,
                       request1, request1_len);
@@ -1632,7 +1627,7 @@ int SMTPParserTest03(void)
         printf("smtp check returned %" PRId32 ", expected 0: ", r);
         goto end;
     }
-    SMTPState *smtp_state = f.aldata[AlpGetStateIdx(ALPROTO_SMTP)];
+    SMTPState *smtp_state = f.alstate;
     if (smtp_state == NULL) {
         printf("no smtp state: ");
         goto end;
@@ -1709,7 +1704,6 @@ int SMTPParserTest03(void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -1755,7 +1749,6 @@ int SMTPParserTest04(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMTP, STREAM_TOSERVER,
                       request1, request1_len);
@@ -1763,7 +1756,7 @@ int SMTPParserTest04(void)
         printf("smtp check returned %" PRId32 ", expected 0: ", r);
         goto end;
     }
-    SMTPState *smtp_state = f.aldata[AlpGetStateIdx(ALPROTO_SMTP)];
+    SMTPState *smtp_state = f.alstate;
     if (smtp_state == NULL) {
         printf("no smtp state: ");
         goto end;
@@ -1794,7 +1787,6 @@ int SMTPParserTest04(void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -1895,7 +1887,6 @@ int SMTPParserTest05(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMTP, STREAM_TOSERVER,
                       request1, request1_len);
@@ -1903,7 +1894,7 @@ int SMTPParserTest05(void)
         printf("smtp check returned %" PRId32 ", expected 0: ", r);
         goto end;
     }
-    SMTPState *smtp_state = f.aldata[AlpGetStateIdx(ALPROTO_SMTP)];
+    SMTPState *smtp_state = f.alstate;
     if (smtp_state == NULL) {
         printf("no smtp state: ");
         goto end;
@@ -2013,7 +2004,6 @@ int SMTPParserTest05(void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -2169,7 +2159,6 @@ int SMTPParserTest06(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_SMTP, STREAM_TOSERVER,
                       request1, request1_len);
@@ -2177,7 +2166,7 @@ int SMTPParserTest06(void)
         printf("smtp check returned %" PRId32 ", expected 0: ", r);
         goto end;
     }
-    SMTPState *smtp_state = f.aldata[AlpGetStateIdx(ALPROTO_SMTP)];
+    SMTPState *smtp_state = f.alstate;
     if (smtp_state == NULL) {
         printf("no smtp state: ");
         goto end;
@@ -2331,7 +2320,6 @@ int SMTPParserTest06(void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
index 2cfdb467f07ea3ef946db17b83ea2dcaa5e47f05..0c371446fbf16502ba61528edf16b22359546e59 100644 (file)
@@ -774,7 +774,6 @@ static int SSHParserTest01(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOSERVER|STREAM_EOF, sshbuf, sshlen);
     if (r != 0) {
@@ -783,7 +782,7 @@ static int SSHParserTest01(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         result = 0;
@@ -823,7 +822,6 @@ static int SSHParserTest01(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -843,7 +841,6 @@ static int SSHParserTest02(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOSERVER|STREAM_EOF, sshbuf, sshlen);
     if (r != 0) {
@@ -852,7 +849,7 @@ static int SSHParserTest02(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         result = 0;
@@ -892,7 +889,6 @@ static int SSHParserTest02(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -912,7 +908,6 @@ static int SSHParserTest03(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOSERVER|STREAM_EOF, sshbuf, sshlen);
     if (r == 0) {
@@ -922,7 +917,7 @@ static int SSHParserTest03(void) {
     }
     /* Ok, it returned an error. Let's make sure we didn't parse the string at all */
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         result = 0;
@@ -948,7 +943,6 @@ static int SSHParserTest03(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -966,7 +960,6 @@ static int SSHParserTest04(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOCLIENT|STREAM_EOF, sshbuf, sshlen);
     if (r != 0) {
@@ -975,7 +968,7 @@ static int SSHParserTest04(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         result = 0;
@@ -1015,7 +1008,6 @@ static int SSHParserTest04(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1035,7 +1027,6 @@ static int SSHParserTest05(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOCLIENT|STREAM_EOF, sshbuf, sshlen);
     if (r != 0) {
@@ -1044,7 +1035,7 @@ static int SSHParserTest05(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         result = 0;
@@ -1084,7 +1075,6 @@ static int SSHParserTest05(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1104,7 +1094,6 @@ static int SSHParserTest06(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOCLIENT|STREAM_EOF, sshbuf, sshlen);
     if (r == 0) {
@@ -1114,7 +1103,7 @@ static int SSHParserTest06(void) {
     }
     /* Ok, it returned an error. Let's make sure we didn't parse the string at all */
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         result = 0;
@@ -1140,7 +1129,6 @@ static int SSHParserTest06(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1159,7 +1147,6 @@ static int SSHParserTest07(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOSERVER, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1173,7 +1160,7 @@ static int SSHParserTest07(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1207,7 +1194,6 @@ static int SSHParserTest07(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1229,7 +1215,6 @@ static int SSHParserTest08(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOSERVER, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1249,7 +1234,7 @@ static int SSHParserTest08(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1282,7 +1267,6 @@ static int SSHParserTest08(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1301,7 +1285,6 @@ static int SSHParserTest09(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOCLIENT, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1315,7 +1298,7 @@ static int SSHParserTest09(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1349,7 +1332,6 @@ static int SSHParserTest09(void) {
     result = 1;
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1371,7 +1353,6 @@ static int SSHParserTest10(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOCLIENT, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1391,7 +1372,7 @@ static int SSHParserTest10(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1424,7 +1405,6 @@ static int SSHParserTest10(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1446,7 +1426,6 @@ static int SSHParserTest11(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOSERVER, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1466,7 +1445,7 @@ static int SSHParserTest11(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1504,7 +1483,6 @@ static int SSHParserTest11(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1528,7 +1506,6 @@ static int SSHParserTest12(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOSERVER, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1554,7 +1531,7 @@ static int SSHParserTest12(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1592,7 +1569,6 @@ static int SSHParserTest12(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1614,7 +1590,6 @@ static int SSHParserTest13(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOCLIENT, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1634,7 +1609,7 @@ static int SSHParserTest13(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1672,7 +1647,6 @@ static int SSHParserTest13(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1696,7 +1670,6 @@ static int SSHParserTest14(void) {
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_SSH, STREAM_TOCLIENT, sshbuf1, sshlen1);
     if (r != 0) {
@@ -1722,7 +1695,7 @@ static int SSHParserTest14(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -1760,7 +1733,6 @@ static int SSHParserTest14(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
index 3a1cbf5d1b88940b67d6758bb31bb83e85ebeddc..0eee5a1bd0588dec80131aaedd7e741686550d7a 100644 (file)
@@ -902,8 +902,6 @@ void RegisterSSLParsers(void)
 
 #ifdef UNITTESTS
 
-extern uint16_t AppLayerParserGetStorageId (void);
-
 /**
  *\test Send a get request in one chunk.
  */
@@ -920,7 +918,6 @@ static int SSLParserTest01(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER | STREAM_EOF, tlsbuf, tlslen);
     if (r != 0) {
@@ -929,7 +926,7 @@ static int SSLParserTest01(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -950,7 +947,6 @@ static int SSLParserTest01(void)
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -971,7 +967,6 @@ static int SSLParserTest02(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf1, tlslen1);
     if (r != 0) {
@@ -987,7 +982,7 @@ static int SSLParserTest02(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1008,7 +1003,6 @@ static int SSLParserTest02(void)
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1031,7 +1025,6 @@ static int SSLParserTest03(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf1, tlslen1);
     if (r != 0) {
@@ -1054,7 +1047,7 @@ static int SSLParserTest03(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1075,7 +1068,6 @@ static int SSLParserTest03(void)
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1100,7 +1092,6 @@ static int SSLParserTest04(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf1, tlslen1);
     if (r != 0) {
@@ -1130,7 +1121,7 @@ static int SSLParserTest04(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1151,7 +1142,6 @@ static int SSLParserTest04(void)
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1172,7 +1162,6 @@ static int SSLParserTest05(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf, tlslen);
     if (r != 0) {
@@ -1215,7 +1204,7 @@ static int SSLParserTest05(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1236,9 +1225,8 @@ static int SSLParserTest05(void)
         goto end;
     }
 
-    uint16_t app_layer_sid = AppLayerParserGetStorageId();
     AppLayerParserStateStore *parser_state_store = (AppLayerParserStateStore *)
-                                                    f.aldata[app_layer_sid];
+                                                    ssn.alparser;
     AppLayerParserState *parser_state = &parser_state_store->to_server;
 
     if (!(parser_state->flags & APP_LAYER_PARSER_NO_INSPECTION) &&
@@ -1257,7 +1245,6 @@ static int SSLParserTest05(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1280,7 +1267,6 @@ static int SSLParserTest06(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf, tlslen);
     if (r != 0) {
@@ -1314,7 +1300,7 @@ static int SSLParserTest06(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1335,9 +1321,8 @@ static int SSLParserTest06(void)
         goto end;
     }
 
-    uint16_t app_layer_sid = AppLayerParserGetStorageId();
     AppLayerParserStateStore *parser_state_store = (AppLayerParserStateStore *)
-                                                    f.aldata[app_layer_sid];
+                                                    ssn.alparser;
     AppLayerParserState *parser_state = &parser_state_store->to_server;
 
     if ((parser_state->flags & APP_LAYER_PARSER_NO_INSPECTION) ||
@@ -1381,7 +1366,6 @@ static int SSLParserTest06(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1428,7 +1412,6 @@ static int SSLParserMultimsgTest01(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf1, tlslen1);
     if (r != 0) {
@@ -1437,7 +1420,7 @@ static int SSLParserMultimsgTest01(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1458,7 +1441,6 @@ static int SSLParserMultimsgTest01(void)
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1504,7 +1486,6 @@ static int SSLParserMultimsgTest02(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOCLIENT, tlsbuf1, tlslen1);
     if (r != 0) {
@@ -1513,7 +1494,7 @@ static int SSLParserMultimsgTest02(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1534,7 +1515,6 @@ static int SSLParserMultimsgTest02(void)
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1569,7 +1549,6 @@ static int SSLParserTest07(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf, tlslen);
     if (r != 0) {
@@ -1578,7 +1557,7 @@ static int SSLParserTest07(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1600,7 +1579,6 @@ static int SSLParserTest07(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1621,7 +1599,6 @@ static int SSLParserTest08(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, tlsbuf, tlslen);
     if (r != 0) {
@@ -1664,7 +1641,7 @@ static int SSLParserTest08(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1685,9 +1662,8 @@ static int SSLParserTest08(void)
         goto end;
     }
 
-    uint16_t app_layer_sid = AppLayerParserGetStorageId();
     AppLayerParserStateStore *parser_state_store = (AppLayerParserStateStore *)
-                                                    f.aldata[app_layer_sid];
+                                                    ssn.alparser;
     AppLayerParserState *parser_state = &parser_state_store->to_server;
 
     if (!(parser_state->flags & APP_LAYER_PARSER_NO_INSPECTION) &&
@@ -1705,7 +1681,6 @@ static int SSLParserTest08(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1749,7 +1724,6 @@ static int SSLParserTest09(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -1765,7 +1739,7 @@ static int SSLParserTest09(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1794,7 +1768,6 @@ static int SSLParserTest09(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1836,7 +1809,6 @@ static int SSLParserTest10(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -1852,7 +1824,7 @@ static int SSLParserTest10(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1881,7 +1853,6 @@ static int SSLParserTest10(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -1922,7 +1893,6 @@ static int SSLParserTest11(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -1938,7 +1908,7 @@ static int SSLParserTest11(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -1967,7 +1937,6 @@ static int SSLParserTest11(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2013,7 +1982,6 @@ static int SSLParserTest12(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2036,7 +2004,7 @@ static int SSLParserTest12(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2065,7 +2033,6 @@ static int SSLParserTest12(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2116,7 +2083,6 @@ static int SSLParserTest13(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2146,7 +2112,7 @@ static int SSLParserTest13(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2175,7 +2141,6 @@ static int SSLParserTest13(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2205,7 +2170,6 @@ static int SSLParserTest14(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2221,7 +2185,7 @@ static int SSLParserTest14(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2229,7 +2193,6 @@ static int SSLParserTest14(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2259,7 +2222,6 @@ static int SSLParserTest15(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2275,7 +2237,7 @@ static int SSLParserTest15(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2283,7 +2245,6 @@ static int SSLParserTest15(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2313,7 +2274,6 @@ static int SSLParserTest16(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2329,7 +2289,7 @@ static int SSLParserTest16(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2337,7 +2297,6 @@ static int SSLParserTest16(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2367,7 +2326,6 @@ static int SSLParserTest17(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2383,7 +2341,7 @@ static int SSLParserTest17(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2391,7 +2349,6 @@ static int SSLParserTest17(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2422,7 +2379,6 @@ static int SSLParserTest18(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2438,7 +2394,7 @@ static int SSLParserTest18(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2446,7 +2402,6 @@ static int SSLParserTest18(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2472,7 +2427,6 @@ static int SSLParserTest19(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2481,7 +2435,7 @@ static int SSLParserTest19(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2489,7 +2443,6 @@ static int SSLParserTest19(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2515,7 +2468,6 @@ static int SSLParserTest20(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -2524,7 +2476,7 @@ static int SSLParserTest20(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -2532,7 +2484,6 @@ static int SSLParserTest20(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
@@ -2559,7 +2510,6 @@ static int SSLParserTest21(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER | STREAM_EOF, buf,
                           buf_len);
@@ -2568,7 +2518,7 @@ static int SSLParserTest21(void)
         goto end;
     }
 
-    SSLState *app_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *app_state = f.alstate;
     if (app_state == NULL) {
         printf("no ssl state: ");
         goto end;
@@ -2588,8 +2538,6 @@ static int SSLParserTest21(void)
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
-    StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
 }
@@ -2620,7 +2568,6 @@ static int SSLParserTest22(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOCLIENT | STREAM_EOF, buf,
                           buf_len);
@@ -2630,7 +2577,7 @@ static int SSLParserTest22(void)
         goto end;
     }
 
-    SSLState *app_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *app_state = f.alstate;
     if (app_state == NULL) {
         printf("no ssl state: ");
         result = 0;
@@ -2651,7 +2598,6 @@ static int SSLParserTest22(void)
         goto end;
     }
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -2919,7 +2865,6 @@ static int SSLParserTest23(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER | STREAM_START, chello_buf,
                           chello_buf_len);
@@ -2929,7 +2874,7 @@ static int SSLParserTest23(void)
         goto end;
     }
 
-    SSLState *app_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *app_state = f.alstate;
     if (app_state == NULL) {
         printf("no ssl state: ");
         result = 0;
@@ -3091,9 +3036,8 @@ static int SSLParserTest23(void)
         goto end;
     }
 
-    uint16_t app_layer_sid = AppLayerParserGetStorageId();
     AppLayerParserStateStore *parser_state_store =
-        (AppLayerParserStateStore *)f.aldata[app_layer_sid];
+        (AppLayerParserStateStore *)f.alparser;
     AppLayerParserState *parser_state = &parser_state_store->to_server;
     if (!(parser_state->flags & APP_LAYER_PARSER_NO_INSPECTION) &&
         !(ssn.client.flags & STREAMTCP_STREAM_FLAG_NOREASSEMBLY) &&
@@ -3110,7 +3054,6 @@ static int SSLParserTest23(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -3153,7 +3096,6 @@ static int SSLParserTest24(void)
     f.protoctx = (void *)&ssn;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     int r = AppLayerParse(&f, ALPROTO_TLS, STREAM_TOSERVER, buf1, buf1_len);
     if (r != 0) {
@@ -3169,7 +3111,7 @@ static int SSLParserTest24(void)
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         result = 0;
@@ -3198,7 +3140,6 @@ static int SSLParserTest24(void)
     }
 
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     return result;
 }
index 2ce73f745d584b4ff3097264e5da65516a1f3318..768ce032e3667f2e99a5303f73b628c3a9a427d1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2011 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -49,10 +49,6 @@ uint16_t AppLayerGetProtoFromPacket(Packet *p) {
         SCReturnUInt(ALPROTO_UNKNOWN);
     }
 
-    if (p->flow->aldata == NULL) {
-        SCReturnUInt(ALPROTO_UNKNOWN);
-    }
-
     SCLogDebug("p->flow->alproto %"PRIu16"", p->flow->alproto);
 
     SCReturnUInt(p->flow->alproto);
@@ -69,16 +65,10 @@ void *AppLayerGetProtoStateFromPacket(Packet *p) {
         SCReturnPtr(NULL, "void");
     }
 
-    if (p->flow->aldata == NULL) {
-        SCReturnPtr(NULL, "void");
-    }
-
     SCLogDebug("p->flow->alproto %"PRIu16"", p->flow->alproto);
 
-    void *alstate = p->flow->aldata[AlpGetStateIdx(p->flow->alproto)];
-
     SCLogDebug("p->flow %p", p->flow);
-    SCReturnPtr(alstate, "void");
+    SCReturnPtr(p->flow->alstate, "void");
 }
 
 /** \brief Get the active app layer state from the flow
@@ -92,14 +82,9 @@ void *AppLayerGetProtoStateFromFlow(Flow *f) {
         SCReturnPtr(NULL, "void");
     }
 
-    if (f->aldata == NULL) {
-        SCReturnPtr(NULL, "void");
-    }
-
     SCLogDebug("f->alproto %"PRIu16"", f->alproto);
 
-    void *alstate = f->aldata[AlpGetStateIdx(f->alproto)];
-    SCReturnPtr(alstate, "void");
+    SCReturnPtr(f->alstate, "void");
 }
 
 /** global app layer detection context */
@@ -125,13 +110,12 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f,
 {
     SCEnter();
 
-    uint16_t alproto = ALPROTO_UNKNOWN;
     int r = 0;
 
+#if DEBUG
     BUG_ON(f == NULL);
     BUG_ON(ssn == NULL);
-
-    alproto = f->alproto;
+#endif
 
     SCLogDebug("data_len %u flags %02X", data_len, flags);
     if (!(f->flags & FLOW_NO_APPLAYER_INSPECTION)) {
@@ -139,11 +123,11 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f,
          * initializer message, we run proto detection.
          * We receive 2 stream init msgs (one for each direction) but we
          * only run the proto detection once. */
-        if (alproto == ALPROTO_UNKNOWN && flags & STREAM_GAP) {
+        if (f->alproto == ALPROTO_UNKNOWN && flags & STREAM_GAP) {
             ssn->flags |= STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED;
             SCLogDebug("ALPROTO_UNKNOWN flow %p, due to GAP in stream start", f);
             StreamTcpSetSessionNoReassemblyFlag(ssn, 0);
-        } else if (alproto == ALPROTO_UNKNOWN && flags & STREAM_START) {
+        } else if (f->alproto == ALPROTO_UNKNOWN && flags & STREAM_START) {
             SCLogDebug("Stream initializer (len %" PRIu32 ")", data_len);
 #ifdef PRINT
             if (data_len > 0) {
@@ -156,19 +140,16 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f,
 #endif
 
             PACKET_PROFILING_APP_PD_START(dp_ctx);
-            alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, f,
+            f->alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, f,
                     data, data_len, flags, IPPROTO_TCP);
             PACKET_PROFILING_APP_PD_END(dp_ctx);
 
-            if (alproto != ALPROTO_UNKNOWN) {
-                /* store the proto and setup the L7 data array */
-                FlowL7DataPtrInit(f);
-                f->alproto = alproto;
+            if (f->alproto != ALPROTO_UNKNOWN) {
                 ssn->flags |= STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED;
 
-                PACKET_PROFILING_APP_START(dp_ctx, alproto);
-                r = AppLayerParse(f, alproto, flags, data, data_len);
-                PACKET_PROFILING_APP_END(dp_ctx, alproto);
+                PACKET_PROFILING_APP_START(dp_ctx, f->alproto);
+                r = AppLayerParse(f, f->alproto, flags, data, data_len);
+                PACKET_PROFILING_APP_END(dp_ctx, f->alproto);
             } else {
                 if (f->flags & FLOW_TS_PM_PP_ALPROTO_DETECT_DONE &&
                     f->flags & FLOW_TC_PM_PP_ALPROTO_DETECT_DONE) {
@@ -178,7 +159,7 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f,
             }
         } else {
             SCLogDebug("stream data (len %" PRIu32 " alproto "
-                    "%"PRIu16" (flow %p)", data_len, alproto, f);
+                    "%"PRIu16" (flow %p)", data_len, f->alproto, f);
 #ifdef PRINT
             if (data_len > 0) {
                 printf("=> Stream Data (app layer) -- start %s%s\n",
@@ -190,10 +171,10 @@ int AppLayerHandleTCPData(AlpProtoDetectThreadCtx *dp_ctx, Flow *f,
 #endif
             /* if we don't have a data object here we are not getting it
              * a start msg should have gotten us one */
-            if (alproto != ALPROTO_UNKNOWN) {
-                PACKET_PROFILING_APP_START(dp_ctx, alproto);
-                r = AppLayerParse(f, alproto, flags, data, data_len);
-                PACKET_PROFILING_APP_END(dp_ctx, alproto);
+            if (f->alproto != ALPROTO_UNKNOWN) {
+                PACKET_PROFILING_APP_START(dp_ctx, f->alproto);
+                r = AppLayerParse(f, f->alproto, flags, data, data_len);
+                PACKET_PROFILING_APP_END(dp_ctx, f->alproto);
             } else {
                 SCLogDebug(" smsg not start, but no l7 data? Weird");
             }
@@ -287,154 +268,6 @@ int AppLayerHandleTCPMsg(AlpProtoDetectThreadCtx *dp_ctx, StreamMsg *smsg)
     SCReturnInt(0);
 }
 
-#if 0
-/**
- *  \brief Handle a app layer TCP message
- *
- *  If the protocol is yet unknown, the proto detection code is run first.
- *
- *  \param dp_ctx Thread app layer detect context
- *  \param smsg Stream message
- *
- *  \retval 0 ok
- *  \retval -1 error
- */
-int AppLayerHandleMsg(AlpProtoDetectThreadCtx *dp_ctx, StreamMsg *smsg)
-{
-    SCEnter();
-
-    uint16_t alproto = ALPROTO_UNKNOWN;
-    int r = 0;
-
-    SCLogDebug("smsg %p", smsg);
-
-    BUG_ON(smsg->flow == NULL);
-
-    TcpSession *ssn = smsg->flow->protoctx;
-    if (ssn != NULL) {
-        alproto = smsg->flow->alproto;
-
-        if (!(smsg->flow->flags & FLOW_NO_APPLAYER_INSPECTION)) {
-            /* if we don't know the proto yet and we have received a stream
-             * initializer message, we run proto detection.
-             * We receive 2 stream init msgs (one for each direction) but we
-             * only run the proto detection once. */
-            if (alproto == ALPROTO_UNKNOWN && smsg->flags & STREAM_START) {
-                SCLogDebug("Stream initializer (len %" PRIu32 " (%" PRIu32 "))",
-                        smsg->data.data_len, MSG_DATA_SIZE);
-
-                //printf("=> Init Stream Data -- start\n");
-                //PrintRawDataFp(stdout, smsg->init.data, smsg->init.data_len);
-                //printf("=> Init Stream Data -- end\n");
-
-                alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, f
-                        smsg->data.data, smsg->data.data_len, smsg->flow->alflags, IPPROTO_TCP);
-                if (alproto != ALPROTO_UNKNOWN) {
-                    /* store the proto and setup the L7 data array */
-                    FlowL7DataPtrInit(smsg->flow);
-                    smsg->flow->alproto = alproto;
-                    ssn->flags |= STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED;
-
-                    r = AppLayerParse(smsg->flow, alproto, smsg->flow->alflags,
-                            smsg->data.data, smsg->data.data_len);
-                } else {
-                    if (smsg->flags & STREAM_TOSERVER) {
-                        if (smsg->data.data_len >= alp_proto_ctx.toserver.max_len) {
-                            /* protocol detection has failed */
-                            ssn->flags |= STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED;
-                            smsg->flow->alflags |= FLOW_AL_NO_APPLAYER_INSPECTION;
-                            SCLogDebug("ALPROTO_UNKNOWN flow %p", smsg->flow);
-                        }
-                    } else if (smsg->flags & STREAM_TOCLIENT) {
-                        if (smsg->data.data_len >= alp_proto_ctx.toclient.max_len) {
-                            /* protocol detection has failed */
-                            ssn->flags |= STREAMTCP_FLAG_APPPROTO_DETECTION_COMPLETED;
-                            smsg->flow->alflags |= FLOW_AL_NO_APPLAYER_INSPECTION;
-                            SCLogDebug("ALPROTO_UNKNOWN flow %p", smsg->flow);
-                        }
-                    }
-                }
-            } else {
-                SCLogDebug("stream data (len %" PRIu32 " (%" PRIu32 ")), alproto "
-                        "%"PRIu16" (flow %p)", smsg->data.data_len, MSG_DATA_SIZE,
-                        alproto, smsg->flow);
-
-                //printf("=> Stream Data -- start\n");
-                //PrintRawDataFp(stdout, smsg->data.data, smsg->data.data_len);
-                //printf("=> Stream Data -- end\n");
-
-                /* if we don't have a data object here we are not getting it
-                 * a start msg should have gotten us one */
-                if (alproto != ALPROTO_UNKNOWN) {
-                    r = AppLayerParse(smsg->flow, alproto, smsg->flags,
-                            smsg->data.data, smsg->data.data_len);
-                } else {
-                    SCLogDebug(" smsg not start, but no l7 data? Weird");
-                }
-            }
-        }
-
-        SCLogDebug("storing smsg %p in the tcp session", smsg);
-
-        /* store the smsg in the tcp stream */
-        if (smsg->flags & STREAM_TOSERVER) {
-            SCLogDebug("storing smsg in the to_server");
-#if 0
-            PrintRawDataFp(stdout,smsg->data.data,smsg->data.data_len);
-#endif
-            /* put the smsg in the stream list */
-            if (ssn->toserver_smsg_head == NULL) {
-                ssn->toserver_smsg_head = smsg;
-                ssn->toserver_smsg_tail = smsg;
-                smsg->next = NULL;
-                smsg->prev = NULL;
-            } else {
-                StreamMsg *cur = ssn->toserver_smsg_tail;
-                cur->next = smsg;
-                smsg->prev = cur;
-                smsg->next = NULL;
-                ssn->toserver_smsg_tail = smsg;
-            }
-        } else {
-            SCLogDebug("storing smsg in the to_client");
-
-            /* put the smsg in the stream list */
-            if (ssn->toclient_smsg_head == NULL) {
-                ssn->toclient_smsg_head = smsg;
-                ssn->toclient_smsg_tail = smsg;
-                smsg->next = NULL;
-                smsg->prev = NULL;
-            } else {
-                StreamMsg *cur = ssn->toclient_smsg_tail;
-                cur->next = smsg;
-                smsg->prev = cur;
-                smsg->next = NULL;
-                ssn->toclient_smsg_tail = smsg;
-            }
-        }
-
-        /* flow is free again */
-        FlowDecrUsecnt(smsg->flow);
-        /* dereference the flow */
-        smsg->flow = NULL;
-
-    } else { /* no ssn ptr */
-
-        /* if there is no ssn ptr we won't
-         * be inspecting this msg in detect
-         * so return it to the pool. */
-
-        /* flow is free again */
-        FlowDecrUsecnt(smsg->flow);
-
-        /* return the used message to the queue */
-        StreamMsgReturnToPool(smsg);
-    }
-
-    SCReturnInt(r);
-}
-#endif
-
 /**
  *  \brief Handle a app layer UDP message
  *
@@ -451,7 +284,6 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
 {
     SCEnter();
 
-    uint16_t alproto = ALPROTO_UNKNOWN;
     int r = 0;
 
     if (f == NULL) {
@@ -460,8 +292,6 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
 
     SCMutexLock(&f->m);
 
-    alproto = f->alproto;
-
     uint8_t flags = 0;
     if (p->flowflags & FLOW_PKT_TOSERVER) {
         flags |= STREAM_TOSERVER;
@@ -473,7 +303,7 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
      * initializer message, we run proto detection.
      * We receive 2 stream init msgs (one for each direction) but we
      * only run the proto detection once. */
-    if (alproto == ALPROTO_UNKNOWN && !(f->flags & FLOW_ALPROTO_DETECT_DONE)) {
+    if (f->alproto == ALPROTO_UNKNOWN && !(f->flags & FLOW_ALPROTO_DETECT_DONE)) {
         SCLogDebug("Detecting AL proto on udp mesg (len %" PRIu32 ")",
                     p->payload_len);
 
@@ -481,15 +311,12 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
         //PrintRawDataFp(stdout, smsg->init.data, smsg->init.data_len);
         //printf("=> Init Stream Data -- end\n");
 
-        alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, f,
+        f->alproto = AppLayerDetectGetProto(&alp_proto_ctx, dp_ctx, f,
                         p->payload, p->payload_len, flags, IPPROTO_UDP);
-        if (alproto != ALPROTO_UNKNOWN) {
-            /* store the proto and setup the L7 data array */
-            FlowL7DataPtrInit(f);
-            f->alproto = alproto;
+        if (f->alproto != ALPROTO_UNKNOWN) {
             f->flags |= FLOW_ALPROTO_DETECT_DONE;
 
-            r = AppLayerParse(f, alproto, flags,
+            r = AppLayerParse(f, f->alproto, flags,
                            p->payload, p->payload_len);
         } else {
             f->flags |= FLOW_ALPROTO_DETECT_DONE;
@@ -497,7 +324,7 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
         }
     } else {
         SCLogDebug("stream data (len %" PRIu32 " ), alproto "
-                  "%"PRIu16" (flow %p)", p->payload_len, alproto, f);
+                  "%"PRIu16" (flow %p)", p->payload_len, f->alproto, f);
 
         //printf("=> Stream Data -- start\n");
         //PrintRawDataFp(stdout, smsg->data.data, smsg->data.data_len);
@@ -505,8 +332,8 @@ int AppLayerHandleUdp(AlpProtoDetectThreadCtx *dp_ctx, Flow *f, Packet *p)
 
         /* if we don't have a data object here we are not getting it
          * a start msg should have gotten us one */
-        if (alproto != ALPROTO_UNKNOWN) {
-            r = AppLayerParse(f, alproto, flags,
+        if (f->alproto != ALPROTO_UNKNOWN) {
+            r = AppLayerParse(f, f->alproto, flags,
                         p->payload, p->payload_len);
         } else {
             SCLogDebug(" udp session not start, but no l7 data? Weird");
index e2c86da7476a444f9c84d2a4c679ac561fadd16d..3f1f2d2b46867e393646110b4f0b164508f83896 100644 (file)
@@ -874,7 +874,6 @@ static int DetectDceIfaceTestParse12(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -901,7 +900,7 @@ static int DetectDceIfaceTestParse12(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -956,7 +955,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1106,7 +1104,6 @@ static int DetectDceIfaceTestParse13(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1131,7 +1128,7 @@ static int DetectDceIfaceTestParse13(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1289,7 +1286,6 @@ static int DetectDceIfaceTestParse13(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -1362,7 +1358,6 @@ static int DetectDceIfaceTestParse14(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1387,7 +1382,7 @@ static int DetectDceIfaceTestParse14(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1438,7 +1433,6 @@ static int DetectDceIfaceTestParse14(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1553,7 +1547,6 @@ static int DetectDceIfaceTestParse15(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1585,7 +1578,7 @@ static int DetectDceIfaceTestParse15(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1722,7 +1715,6 @@ static int DetectDceIfaceTestParse15(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index e5975f93f790c45134abb6a8dbda999f22a98d4f..ab2934d95000a7aaa88c9d5921eaba0c01409075 100644 (file)
@@ -1157,7 +1157,6 @@ static int DetectDceOpnumTestParse08(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1183,7 +1182,7 @@ static int DetectDceOpnumTestParse08(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1203,7 +1202,7 @@ static int DetectDceOpnumTestParse08(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1224,7 +1223,6 @@ static int DetectDceOpnumTestParse08(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -1684,7 +1682,6 @@ static int DetectDceOpnumTestParse09(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1710,7 +1707,7 @@ static int DetectDceOpnumTestParse09(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1731,7 +1728,6 @@ static int DetectDceOpnumTestParse09(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -1882,7 +1878,6 @@ static int DetectDceOpnumTestParse10(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1909,7 +1904,7 @@ static int DetectDceOpnumTestParse10(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -2051,7 +2046,6 @@ static int DetectDceOpnumTestParse10(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -2175,7 +2169,6 @@ static int DetectDceOpnumTestParse11(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2203,7 +2196,7 @@ static int DetectDceOpnumTestParse11(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         printf("no dcerpc state: ");
@@ -2312,7 +2305,6 @@ static int DetectDceOpnumTestParse11(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -2451,7 +2443,6 @@ static int DetectDceOpnumTestParse12(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2477,7 +2468,7 @@ static int DetectDceOpnumTestParse12(void)
     p->flowflags |= FLOW_PKT_TOSERVER;
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2503,7 +2494,7 @@ static int DetectDceOpnumTestParse12(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2533,7 +2524,7 @@ static int DetectDceOpnumTestParse12(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2563,7 +2554,7 @@ static int DetectDceOpnumTestParse12(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2593,7 +2584,7 @@ static int DetectDceOpnumTestParse12(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2624,7 +2615,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -2736,7 +2726,6 @@ static int DetectDceOpnumTestParse13(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2763,7 +2752,7 @@ static int DetectDceOpnumTestParse13(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2791,7 +2780,7 @@ static int DetectDceOpnumTestParse13(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2820,7 +2809,7 @@ static int DetectDceOpnumTestParse13(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2848,7 +2837,7 @@ static int DetectDceOpnumTestParse13(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         printf("no dcerpc state: ");
         goto end;
@@ -2877,7 +2866,6 @@ static int DetectDceOpnumTestParse13(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
index bf694cafbdd9ad0f94830cade21eecc9f53a53d4..749cdfe520bb6efdcc1c34ff77030996ce8a711c 100644 (file)
@@ -648,7 +648,6 @@ static int DetectDceStubDataTestParse02(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -674,7 +673,7 @@ static int DetectDceStubDataTestParse02(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -731,7 +730,6 @@ static int DetectDceStubDataTestParse02(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -1191,7 +1189,6 @@ static int DetectDceStubDataTestParse03(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1217,7 +1214,7 @@ static int DetectDceStubDataTestParse03(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1240,7 +1237,6 @@ static int DetectDceStubDataTestParse03(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -1387,7 +1383,6 @@ static int DetectDceStubDataTestParse04(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1413,7 +1408,7 @@ static int DetectDceStubDataTestParse04(void)
     p->flowflags |= FLOW_PKT_TOSERVER;
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1534,7 +1529,6 @@ static int DetectDceStubDataTestParse04(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -1654,7 +1648,6 @@ static int DetectDceStubDataTestParse05(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1681,7 +1674,7 @@ static int DetectDceStubDataTestParse05(void)
         goto end;
     }
 
-    dcerpc_state = f.aldata[AlpGetStateIdx(ALPROTO_DCERPC)];
+    dcerpc_state = f.alstate;
     if (dcerpc_state == NULL) {
         SCLogDebug("no dcerpc state: ");
         goto end;
@@ -1784,7 +1777,6 @@ static int DetectDceStubDataTestParse05(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
index ec2fae16ace2765c27a0aa00dcb17d2e42a54ce9..8d059e58b061834a16a016e136a95b80b44b14a2 100644 (file)
@@ -1704,7 +1704,6 @@ int DcePayloadTest01(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2221,7 +2220,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 11);
@@ -2569,7 +2567,6 @@ int DcePayloadTest02(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2668,7 +2665,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 4);
@@ -3015,7 +3011,6 @@ int DcePayloadTest03(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3114,7 +3109,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 4);
@@ -3461,7 +3455,6 @@ int DcePayloadTest04(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3560,7 +3553,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 4);
@@ -3906,7 +3898,6 @@ int DcePayloadTest05(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -4005,7 +3996,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 4);
@@ -4352,7 +4342,6 @@ int DcePayloadTest06(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -4451,7 +4440,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 4);
@@ -4797,7 +4785,6 @@ int DcePayloadTest07(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -4896,7 +4883,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 4);
@@ -5079,7 +5065,6 @@ int DcePayloadTest08(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -5118,7 +5103,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 1);
@@ -5301,7 +5285,6 @@ int DcePayloadTest09(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -5340,7 +5323,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 1);
@@ -5523,7 +5505,6 @@ int DcePayloadTest10(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -5562,7 +5543,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 1);
@@ -5880,7 +5860,6 @@ int DcePayloadTest11(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -5932,7 +5911,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 2);
@@ -6251,7 +6229,6 @@ int DcePayloadTest12(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -6303,7 +6280,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 2);
@@ -6437,7 +6413,6 @@ int DcePayloadTest13(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -6561,7 +6536,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 8);
@@ -6677,7 +6651,6 @@ int DcePayloadTest14(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -6782,7 +6755,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(p, 6);
@@ -6847,7 +6819,6 @@ int DcePayloadTest15(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -6894,7 +6865,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -6959,7 +6929,6 @@ int DcePayloadTest16(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7006,7 +6975,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7071,7 +7039,6 @@ int DcePayloadTest17(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7118,7 +7085,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7183,7 +7149,6 @@ int DcePayloadTest18(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7230,7 +7195,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7295,7 +7259,6 @@ int DcePayloadTest19(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7342,7 +7305,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7407,7 +7369,6 @@ int DcePayloadTest20(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7454,7 +7415,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7511,7 +7471,6 @@ int DcePayloadTest21(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7551,7 +7510,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7608,7 +7566,6 @@ int DcePayloadTest22(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7648,7 +7605,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7706,7 +7662,6 @@ int DcePayloadTest23(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7746,7 +7701,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -7802,7 +7756,6 @@ int DcePayloadTest24(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -7842,7 +7795,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -10000,7 +9952,6 @@ int DcePayloadTest42(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -10040,7 +9991,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -10098,7 +10048,6 @@ int DcePayloadTest43(void)
     f.alproto = ALPROTO_DCERPC;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -10138,7 +10087,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
index e2c7115a475330c39cbedb493cf8261506ca661d..2093ef3e5b42d632c05526d8226eed602ed25a61 100644 (file)
@@ -593,7 +593,6 @@ static int DetectEngineHttpClientBodyTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -618,7 +617,7 @@ static int DetectEngineHttpClientBodyTest01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -658,7 +657,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -710,7 +708,6 @@ static int DetectEngineHttpClientBodyTest02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -735,7 +732,7 @@ static int DetectEngineHttpClientBodyTest02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -760,7 +757,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -815,7 +811,6 @@ static int DetectEngineHttpClientBodyTest03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -840,7 +835,7 @@ static int DetectEngineHttpClientBodyTest03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -880,7 +875,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -935,7 +929,6 @@ static int DetectEngineHttpClientBodyTest04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -960,7 +953,7 @@ static int DetectEngineHttpClientBodyTest04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1000,7 +993,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1054,7 +1046,6 @@ static int DetectEngineHttpClientBodyTest05(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1079,7 +1070,7 @@ static int DetectEngineHttpClientBodyTest05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1119,7 +1110,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1173,7 +1163,6 @@ static int DetectEngineHttpClientBodyTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1198,7 +1187,7 @@ static int DetectEngineHttpClientBodyTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1238,7 +1227,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1292,7 +1280,6 @@ static int DetectEngineHttpClientBodyTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1317,7 +1304,7 @@ static int DetectEngineHttpClientBodyTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1357,7 +1344,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1411,7 +1397,6 @@ static int DetectEngineHttpClientBodyTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1436,7 +1421,7 @@ static int DetectEngineHttpClientBodyTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1476,7 +1461,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1530,7 +1514,6 @@ static int DetectEngineHttpClientBodyTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1556,7 +1539,7 @@ static int DetectEngineHttpClientBodyTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1596,7 +1579,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1650,7 +1632,6 @@ static int DetectEngineHttpClientBodyTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1676,7 +1657,7 @@ static int DetectEngineHttpClientBodyTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1716,7 +1697,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1770,7 +1750,6 @@ static int DetectEngineHttpClientBodyTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1796,7 +1775,7 @@ static int DetectEngineHttpClientBodyTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1836,7 +1815,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1890,7 +1868,6 @@ static int DetectEngineHttpClientBodyTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1916,7 +1893,7 @@ static int DetectEngineHttpClientBodyTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1956,7 +1933,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2010,7 +1986,6 @@ static int DetectEngineHttpClientBodyTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2036,7 +2011,7 @@ static int DetectEngineHttpClientBodyTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2076,7 +2051,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2130,7 +2104,6 @@ static int DetectEngineHttpClientBodyTest14(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2156,7 +2129,7 @@ static int DetectEngineHttpClientBodyTest14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2196,7 +2169,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2250,7 +2222,6 @@ static int DetectEngineHttpClientBodyTest15(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2276,7 +2247,7 @@ static int DetectEngineHttpClientBodyTest15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2316,7 +2287,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2370,7 +2340,6 @@ static int DetectEngineHttpClientBodyTest16(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2396,7 +2365,7 @@ static int DetectEngineHttpClientBodyTest16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2436,7 +2405,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2474,7 +2442,6 @@ static int DetectEngineHttpClientBodyTest17(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2511,7 +2478,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2548,7 +2514,6 @@ static int DetectEngineHttpClientBodyTest18(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2585,7 +2550,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2622,7 +2586,6 @@ static int DetectEngineHttpClientBodyTest19(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2659,7 +2622,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2696,7 +2658,6 @@ static int DetectEngineHttpClientBodyTest20(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2733,7 +2694,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2786,7 +2746,6 @@ static int DetectEngineHttpClientBodyTest21(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2812,7 +2771,7 @@ static int DetectEngineHttpClientBodyTest21(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2852,7 +2811,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2906,7 +2864,6 @@ static int DetectEngineHttpClientBodyTest22(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2932,7 +2889,7 @@ static int DetectEngineHttpClientBodyTest22(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2972,7 +2929,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3026,7 +2982,6 @@ static int DetectEngineHttpClientBodyTest23(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3052,7 +3007,7 @@ static int DetectEngineHttpClientBodyTest23(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3092,7 +3047,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3146,7 +3100,6 @@ static int DetectEngineHttpClientBodyTest24(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3172,7 +3125,7 @@ static int DetectEngineHttpClientBodyTest24(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3212,7 +3165,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3266,7 +3218,6 @@ static int DetectEngineHttpClientBodyTest25(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3292,7 +3243,7 @@ static int DetectEngineHttpClientBodyTest25(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3332,7 +3283,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3386,7 +3336,6 @@ static int DetectEngineHttpClientBodyTest26(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3412,7 +3361,7 @@ static int DetectEngineHttpClientBodyTest26(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3452,7 +3401,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3506,7 +3454,6 @@ static int DetectEngineHttpClientBodyTest27(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3532,7 +3479,7 @@ static int DetectEngineHttpClientBodyTest27(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3572,7 +3519,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3626,7 +3572,6 @@ static int DetectEngineHttpClientBodyTest28(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3652,7 +3597,7 @@ static int DetectEngineHttpClientBodyTest28(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3692,7 +3637,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
index 253946c221bc0f569c41e84568edc14e2bd2346c..139a982f3d2023d383ffe04f209e0377c0cd038e 100644 (file)
@@ -461,7 +461,6 @@ static int DetectEngineHttpCookieTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -486,7 +485,7 @@ static int DetectEngineHttpCookieTest01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -511,7 +510,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -555,7 +553,6 @@ static int DetectEngineHttpCookieTest02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -580,7 +577,7 @@ static int DetectEngineHttpCookieTest02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -605,7 +602,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -649,7 +645,6 @@ static int DetectEngineHttpCookieTest03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -674,7 +669,7 @@ static int DetectEngineHttpCookieTest03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -699,7 +694,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -743,7 +737,6 @@ static int DetectEngineHttpCookieTest04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -768,7 +761,7 @@ static int DetectEngineHttpCookieTest04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -793,7 +786,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -837,7 +829,6 @@ static int DetectEngineHttpCookieTest05(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -862,7 +853,7 @@ static int DetectEngineHttpCookieTest05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -887,7 +878,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -931,7 +921,6 @@ static int DetectEngineHttpCookieTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -956,7 +945,7 @@ static int DetectEngineHttpCookieTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -981,7 +970,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1025,7 +1013,6 @@ static int DetectEngineHttpCookieTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1050,7 +1037,7 @@ static int DetectEngineHttpCookieTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1075,7 +1062,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1119,7 +1105,6 @@ static int DetectEngineHttpCookieTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1144,7 +1129,7 @@ static int DetectEngineHttpCookieTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1169,7 +1154,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1213,7 +1197,6 @@ static int DetectEngineHttpCookieTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1238,7 +1221,7 @@ static int DetectEngineHttpCookieTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1263,7 +1246,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1307,7 +1289,6 @@ static int DetectEngineHttpCookieTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1333,7 +1314,7 @@ static int DetectEngineHttpCookieTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1358,7 +1339,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1402,7 +1382,6 @@ static int DetectEngineHttpCookieTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1428,7 +1407,7 @@ static int DetectEngineHttpCookieTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1453,7 +1432,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1497,7 +1475,6 @@ static int DetectEngineHttpCookieTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1523,7 +1500,7 @@ static int DetectEngineHttpCookieTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1548,7 +1525,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1592,7 +1568,6 @@ static int DetectEngineHttpCookieTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1618,7 +1593,7 @@ static int DetectEngineHttpCookieTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1643,7 +1618,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1687,7 +1661,6 @@ static int DetectEngineHttpCookieTest14(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1713,7 +1686,7 @@ static int DetectEngineHttpCookieTest14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1738,7 +1711,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1782,7 +1754,6 @@ static int DetectEngineHttpCookieTest15(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1808,7 +1779,7 @@ static int DetectEngineHttpCookieTest15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1833,7 +1804,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1877,7 +1847,6 @@ static int DetectEngineHttpCookieTest16(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1903,7 +1872,7 @@ static int DetectEngineHttpCookieTest16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1928,7 +1897,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1972,7 +1940,6 @@ static int DetectEngineHttpCookieTest17(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1998,7 +1965,7 @@ static int DetectEngineHttpCookieTest17(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -2023,7 +1990,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index fb3cc927afb94c73a4dfeaff574e11d6cf17853f..59544aad22e71c1dbbd49a5547896363bff838a7 100644 (file)
@@ -543,7 +543,6 @@ static int DetectEngineHttpHeaderTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -568,7 +567,7 @@ static int DetectEngineHttpHeaderTest01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -592,7 +591,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -635,7 +633,6 @@ static int DetectEngineHttpHeaderTest02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -660,7 +657,7 @@ static int DetectEngineHttpHeaderTest02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -684,7 +681,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -727,7 +723,6 @@ static int DetectEngineHttpHeaderTest03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -752,7 +747,7 @@ static int DetectEngineHttpHeaderTest03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -776,7 +771,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -819,7 +813,6 @@ static int DetectEngineHttpHeaderTest04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -844,7 +837,7 @@ static int DetectEngineHttpHeaderTest04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -868,7 +861,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -911,7 +903,6 @@ static int DetectEngineHttpHeaderTest05(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -936,7 +927,7 @@ static int DetectEngineHttpHeaderTest05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -960,7 +951,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1003,7 +993,6 @@ static int DetectEngineHttpHeaderTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1028,7 +1017,7 @@ static int DetectEngineHttpHeaderTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1052,7 +1041,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1095,7 +1083,6 @@ static int DetectEngineHttpHeaderTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1120,7 +1107,7 @@ static int DetectEngineHttpHeaderTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1144,7 +1131,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1187,7 +1173,6 @@ static int DetectEngineHttpHeaderTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1212,7 +1197,7 @@ static int DetectEngineHttpHeaderTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1236,7 +1221,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1279,7 +1263,6 @@ static int DetectEngineHttpHeaderTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1304,7 +1287,7 @@ static int DetectEngineHttpHeaderTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1328,7 +1311,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1371,7 +1353,6 @@ static int DetectEngineHttpHeaderTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1396,7 +1377,7 @@ static int DetectEngineHttpHeaderTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1420,7 +1401,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1463,7 +1443,6 @@ static int DetectEngineHttpHeaderTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1488,7 +1467,7 @@ static int DetectEngineHttpHeaderTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1512,7 +1491,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1555,7 +1533,6 @@ static int DetectEngineHttpHeaderTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1580,7 +1557,7 @@ static int DetectEngineHttpHeaderTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1604,7 +1581,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1647,7 +1623,6 @@ static int DetectEngineHttpHeaderTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1672,7 +1647,7 @@ static int DetectEngineHttpHeaderTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1696,7 +1671,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1739,7 +1713,6 @@ static int DetectEngineHttpHeaderTest14(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1764,7 +1737,7 @@ static int DetectEngineHttpHeaderTest14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1788,7 +1761,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1831,7 +1803,6 @@ static int DetectEngineHttpHeaderTest15(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1856,7 +1827,7 @@ static int DetectEngineHttpHeaderTest15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1880,7 +1851,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1923,7 +1893,6 @@ static int DetectEngineHttpHeaderTest16(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1948,7 +1917,7 @@ static int DetectEngineHttpHeaderTest16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1972,7 +1941,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -2015,7 +1983,6 @@ static int DetectEngineHttpHeaderTest17(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2040,7 +2007,7 @@ static int DetectEngineHttpHeaderTest17(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -2064,7 +2031,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -2105,7 +2071,6 @@ static int DetectEngineHttpHeaderTest18(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2141,7 +2106,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -2182,7 +2146,6 @@ static int DetectEngineHttpHeaderTest19(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2218,7 +2181,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -2268,7 +2230,6 @@ static int DetectEngineHttpHeaderTest20(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2294,7 +2255,7 @@ static int DetectEngineHttpHeaderTest20(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2334,7 +2295,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2385,7 +2345,6 @@ static int DetectEngineHttpHeaderTest21(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2411,7 +2370,7 @@ static int DetectEngineHttpHeaderTest21(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2451,7 +2410,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2502,7 +2460,6 @@ static int DetectEngineHttpHeaderTest22(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2528,7 +2485,7 @@ static int DetectEngineHttpHeaderTest22(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2568,7 +2525,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2619,7 +2575,6 @@ static int DetectEngineHttpHeaderTest23(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2645,7 +2600,7 @@ static int DetectEngineHttpHeaderTest23(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2685,7 +2640,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2736,7 +2690,6 @@ static int DetectEngineHttpHeaderTest24(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2762,7 +2715,7 @@ static int DetectEngineHttpHeaderTest24(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2802,7 +2755,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2853,7 +2805,6 @@ static int DetectEngineHttpHeaderTest25(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2879,7 +2830,7 @@ static int DetectEngineHttpHeaderTest25(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2919,7 +2870,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2970,7 +2920,6 @@ static int DetectEngineHttpHeaderTest26(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2996,7 +2945,7 @@ static int DetectEngineHttpHeaderTest26(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3036,7 +2985,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3087,7 +3035,6 @@ static int DetectEngineHttpHeaderTest27(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3113,7 +3060,7 @@ static int DetectEngineHttpHeaderTest27(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3153,7 +3100,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
index a5ad7c75ba6c2d3a28e8a2ef02e1622c9510e5e8..7c71cf771de78496e2c65d664446c27880a9665f 100644 (file)
@@ -447,7 +447,6 @@ static int DetectEngineHttpMethodTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -472,7 +471,7 @@ static int DetectEngineHttpMethodTest01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -497,7 +496,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -540,7 +538,6 @@ static int DetectEngineHttpMethodTest02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -565,7 +562,7 @@ static int DetectEngineHttpMethodTest02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -590,7 +587,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -633,7 +629,6 @@ static int DetectEngineHttpMethodTest03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -658,7 +653,7 @@ static int DetectEngineHttpMethodTest03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -683,7 +678,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -726,7 +720,6 @@ static int DetectEngineHttpMethodTest04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -751,7 +744,7 @@ static int DetectEngineHttpMethodTest04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -776,7 +769,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -819,7 +811,6 @@ static int DetectEngineHttpMethodTest05(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -844,7 +835,7 @@ static int DetectEngineHttpMethodTest05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -869,7 +860,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -912,7 +902,6 @@ static int DetectEngineHttpMethodTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -937,7 +926,7 @@ static int DetectEngineHttpMethodTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -962,7 +951,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1005,7 +993,6 @@ static int DetectEngineHttpMethodTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1030,7 +1017,7 @@ static int DetectEngineHttpMethodTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1055,7 +1042,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1098,7 +1084,6 @@ static int DetectEngineHttpMethodTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1123,7 +1108,7 @@ static int DetectEngineHttpMethodTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1148,7 +1133,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1191,7 +1175,6 @@ static int DetectEngineHttpMethodTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1216,7 +1199,7 @@ static int DetectEngineHttpMethodTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1241,7 +1224,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1284,7 +1266,6 @@ static int DetectEngineHttpMethodTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1310,7 +1291,7 @@ static int DetectEngineHttpMethodTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1335,7 +1316,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1378,7 +1358,6 @@ static int DetectEngineHttpMethodTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1404,7 +1383,7 @@ static int DetectEngineHttpMethodTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1429,7 +1408,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1472,7 +1450,6 @@ static int DetectEngineHttpMethodTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1498,7 +1475,7 @@ static int DetectEngineHttpMethodTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1523,7 +1500,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1566,7 +1542,6 @@ static int DetectEngineHttpMethodTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1592,7 +1567,7 @@ static int DetectEngineHttpMethodTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1617,7 +1592,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1660,7 +1634,6 @@ static int DetectEngineHttpMethodTest14(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1686,7 +1659,7 @@ static int DetectEngineHttpMethodTest14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1711,7 +1684,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1754,7 +1726,6 @@ static int DetectEngineHttpMethodTest15(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1780,7 +1751,7 @@ static int DetectEngineHttpMethodTest15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1805,7 +1776,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1848,7 +1818,6 @@ static int DetectEngineHttpMethodTest16(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1874,7 +1843,7 @@ static int DetectEngineHttpMethodTest16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1899,7 +1868,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1942,7 +1910,6 @@ static int DetectEngineHttpMethodTest17(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1968,7 +1935,7 @@ static int DetectEngineHttpMethodTest17(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1993,7 +1960,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index 13fa9a904d27ec3c2e3cd3bd6e5f740fa74f515f..0c682fda0744432944c96a6dec7a9a8a658b4e00 100644 (file)
@@ -454,7 +454,6 @@ static int DetectEngineHttpRawHeaderTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -479,7 +478,7 @@ static int DetectEngineHttpRawHeaderTest01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -503,7 +502,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -546,7 +544,6 @@ static int DetectEngineHttpRawHeaderTest02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -571,7 +568,7 @@ static int DetectEngineHttpRawHeaderTest02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -595,7 +592,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -638,7 +634,6 @@ static int DetectEngineHttpRawHeaderTest03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -663,7 +658,7 @@ static int DetectEngineHttpRawHeaderTest03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -687,7 +682,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -730,7 +724,6 @@ static int DetectEngineHttpRawHeaderTest04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -755,7 +748,7 @@ static int DetectEngineHttpRawHeaderTest04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -779,7 +772,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -822,7 +814,6 @@ static int DetectEngineHttpRawHeaderTest05(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -847,7 +838,7 @@ static int DetectEngineHttpRawHeaderTest05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -871,7 +862,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -914,7 +904,6 @@ static int DetectEngineHttpRawHeaderTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -939,7 +928,7 @@ static int DetectEngineHttpRawHeaderTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -963,7 +952,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1006,7 +994,6 @@ static int DetectEngineHttpRawHeaderTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1031,7 +1018,7 @@ static int DetectEngineHttpRawHeaderTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1055,7 +1042,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1098,7 +1084,6 @@ static int DetectEngineHttpRawHeaderTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1123,7 +1108,7 @@ static int DetectEngineHttpRawHeaderTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1147,7 +1132,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1190,7 +1174,6 @@ static int DetectEngineHttpRawHeaderTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1215,7 +1198,7 @@ static int DetectEngineHttpRawHeaderTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1239,7 +1222,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1282,7 +1264,6 @@ static int DetectEngineHttpRawHeaderTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1307,7 +1288,7 @@ static int DetectEngineHttpRawHeaderTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1331,7 +1312,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1374,7 +1354,6 @@ static int DetectEngineHttpRawHeaderTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1399,7 +1378,7 @@ static int DetectEngineHttpRawHeaderTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1423,7 +1402,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1466,7 +1444,6 @@ static int DetectEngineHttpRawHeaderTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1491,7 +1468,7 @@ static int DetectEngineHttpRawHeaderTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1515,7 +1492,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1558,7 +1534,6 @@ static int DetectEngineHttpRawHeaderTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1583,7 +1558,7 @@ static int DetectEngineHttpRawHeaderTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1607,7 +1582,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1650,7 +1624,6 @@ static int DetectEngineHttpRawHeaderTest14(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1675,7 +1648,7 @@ static int DetectEngineHttpRawHeaderTest14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1699,7 +1672,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1742,7 +1714,6 @@ static int DetectEngineHttpRawHeaderTest15(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1767,7 +1738,7 @@ static int DetectEngineHttpRawHeaderTest15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1791,7 +1762,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1834,7 +1804,6 @@ static int DetectEngineHttpRawHeaderTest16(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1859,7 +1828,7 @@ static int DetectEngineHttpRawHeaderTest16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1883,7 +1852,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1926,7 +1894,6 @@ static int DetectEngineHttpRawHeaderTest17(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1951,7 +1918,7 @@ static int DetectEngineHttpRawHeaderTest17(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1975,7 +1942,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -2016,7 +1982,6 @@ static int DetectEngineHttpRawHeaderTest18(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2052,7 +2017,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -2093,7 +2057,6 @@ static int DetectEngineHttpRawHeaderTest19(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2129,7 +2092,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -2179,7 +2141,6 @@ static int DetectEngineHttpRawHeaderTest20(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2205,7 +2166,7 @@ static int DetectEngineHttpRawHeaderTest20(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2245,7 +2206,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2296,7 +2256,6 @@ static int DetectEngineHttpRawHeaderTest21(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2322,7 +2281,7 @@ static int DetectEngineHttpRawHeaderTest21(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2362,7 +2321,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2413,7 +2371,6 @@ static int DetectEngineHttpRawHeaderTest22(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2439,7 +2396,7 @@ static int DetectEngineHttpRawHeaderTest22(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2479,7 +2436,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2530,7 +2486,6 @@ static int DetectEngineHttpRawHeaderTest23(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2556,7 +2511,7 @@ static int DetectEngineHttpRawHeaderTest23(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2596,7 +2551,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2647,7 +2601,6 @@ static int DetectEngineHttpRawHeaderTest24(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2673,7 +2626,7 @@ static int DetectEngineHttpRawHeaderTest24(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2713,7 +2666,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2764,7 +2716,6 @@ static int DetectEngineHttpRawHeaderTest25(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2790,7 +2741,7 @@ static int DetectEngineHttpRawHeaderTest25(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2830,7 +2781,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2881,7 +2831,6 @@ static int DetectEngineHttpRawHeaderTest26(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2907,7 +2856,7 @@ static int DetectEngineHttpRawHeaderTest26(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2947,7 +2896,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2998,7 +2946,6 @@ static int DetectEngineHttpRawHeaderTest27(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3024,7 +2971,7 @@ static int DetectEngineHttpRawHeaderTest27(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3064,7 +3011,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
index 56fe961a86d26f48b6ff28303f8eeb43cdd85e93..0760b5c7ca694c68ee5a74f5670bf303ae7c7251 100644 (file)
@@ -503,7 +503,6 @@ static int DetectEngineHttpRawUriTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -528,7 +527,7 @@ static int DetectEngineHttpRawUriTest01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -568,7 +567,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -620,7 +618,6 @@ static int DetectEngineHttpRawUriTest02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -645,7 +642,7 @@ static int DetectEngineHttpRawUriTest02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -670,7 +667,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -726,7 +722,6 @@ static int DetectEngineHttpRawUriTest03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -751,7 +746,7 @@ static int DetectEngineHttpRawUriTest03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -791,7 +786,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -847,7 +841,6 @@ static int DetectEngineHttpRawUriTest04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -872,7 +865,7 @@ static int DetectEngineHttpRawUriTest04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -912,7 +905,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -967,7 +959,6 @@ static int DetectEngineHttpRawUriTest05(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -992,7 +983,7 @@ static int DetectEngineHttpRawUriTest05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1032,7 +1023,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1087,7 +1077,6 @@ static int DetectEngineHttpRawUriTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1112,7 +1101,7 @@ static int DetectEngineHttpRawUriTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1152,7 +1141,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1207,7 +1195,6 @@ static int DetectEngineHttpRawUriTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1232,7 +1219,7 @@ static int DetectEngineHttpRawUriTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1272,7 +1259,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1327,7 +1313,6 @@ static int DetectEngineHttpRawUriTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1352,7 +1337,7 @@ static int DetectEngineHttpRawUriTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1392,7 +1377,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1447,7 +1431,6 @@ static int DetectEngineHttpRawUriTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1473,7 +1456,7 @@ static int DetectEngineHttpRawUriTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1513,7 +1496,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1568,7 +1550,6 @@ static int DetectEngineHttpRawUriTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1594,7 +1575,7 @@ static int DetectEngineHttpRawUriTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1634,7 +1615,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1689,7 +1669,6 @@ static int DetectEngineHttpRawUriTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1715,7 +1694,7 @@ static int DetectEngineHttpRawUriTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1755,7 +1734,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1810,7 +1788,6 @@ static int DetectEngineHttpRawUriTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1836,7 +1813,7 @@ static int DetectEngineHttpRawUriTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1876,7 +1853,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1931,7 +1907,6 @@ static int DetectEngineHttpRawUriTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1957,7 +1932,7 @@ static int DetectEngineHttpRawUriTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -1997,7 +1972,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2052,7 +2026,6 @@ static int DetectEngineHttpRawUriTest14(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2078,7 +2051,7 @@ static int DetectEngineHttpRawUriTest14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2118,7 +2091,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2173,7 +2145,6 @@ static int DetectEngineHttpRawUriTest15(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2199,7 +2170,7 @@ static int DetectEngineHttpRawUriTest15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2239,7 +2210,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2294,7 +2264,6 @@ static int DetectEngineHttpRawUriTest16(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2320,7 +2289,7 @@ static int DetectEngineHttpRawUriTest16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2360,7 +2329,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2398,7 +2366,6 @@ static int DetectEngineHttpRawUriTest17(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2435,7 +2402,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2472,7 +2438,6 @@ static int DetectEngineHttpRawUriTest18(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2509,7 +2474,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2546,7 +2510,6 @@ static int DetectEngineHttpRawUriTest19(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2583,7 +2546,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2620,7 +2582,6 @@ static int DetectEngineHttpRawUriTest20(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2657,7 +2618,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2711,7 +2671,6 @@ static int DetectEngineHttpRawUriTest21(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2737,7 +2696,7 @@ static int DetectEngineHttpRawUriTest21(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2777,7 +2736,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2832,7 +2790,6 @@ static int DetectEngineHttpRawUriTest22(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2858,7 +2815,7 @@ static int DetectEngineHttpRawUriTest22(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -2898,7 +2855,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2953,7 +2909,6 @@ static int DetectEngineHttpRawUriTest23(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -2979,7 +2934,7 @@ static int DetectEngineHttpRawUriTest23(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3019,7 +2974,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3074,7 +3028,6 @@ static int DetectEngineHttpRawUriTest24(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3100,7 +3053,7 @@ static int DetectEngineHttpRawUriTest24(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3140,7 +3093,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3195,7 +3147,6 @@ static int DetectEngineHttpRawUriTest25(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3221,7 +3172,7 @@ static int DetectEngineHttpRawUriTest25(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3261,7 +3212,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3316,7 +3266,6 @@ static int DetectEngineHttpRawUriTest26(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3342,7 +3291,7 @@ static int DetectEngineHttpRawUriTest26(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3382,7 +3331,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3437,7 +3385,6 @@ static int DetectEngineHttpRawUriTest27(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3463,7 +3410,7 @@ static int DetectEngineHttpRawUriTest27(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3503,7 +3450,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3558,7 +3504,6 @@ static int DetectEngineHttpRawUriTest28(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -3584,7 +3529,7 @@ static int DetectEngineHttpRawUriTest28(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -3624,7 +3569,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -3666,7 +3610,6 @@ static int DetectEngineHttpRawUriTest29(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3692,7 +3635,7 @@ static int DetectEngineHttpRawUriTest29(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3756,7 +3699,6 @@ static int DetectEngineHttpRawUriTest30(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3781,7 +3723,7 @@ static int DetectEngineHttpRawUriTest30(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
index c6de7452a009a879e7a2e4e0567da01a7236d8cd..e0238820a96c37e9a4ead86729a4e3bc3254ea76 100644 (file)
@@ -1000,7 +1000,6 @@ static int DeStateSigTest01(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1084,7 +1083,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePacket(p);
@@ -1134,7 +1132,6 @@ static int DeStateSigTest02(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1261,7 +1258,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePacket(p);
index fdb7430418fa038029f27e6510dc5c15ad712dbd..2e38d4d0d21a7d8ee6f35e1e90c123e06629d423 100644 (file)
@@ -533,7 +533,6 @@ static int UriTestSig01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -558,7 +557,7 @@ static int UriTestSig01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -580,7 +579,7 @@ static int UriTestSig01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -648,7 +647,6 @@ static int UriTestSig02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -673,7 +671,7 @@ static int UriTestSig02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -695,7 +693,7 @@ static int UriTestSig02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -763,7 +761,6 @@ static int UriTestSig03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -788,7 +785,7 @@ static int UriTestSig03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -810,7 +807,7 @@ static int UriTestSig03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -878,7 +875,6 @@ static int UriTestSig04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -903,7 +899,7 @@ static int UriTestSig04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -925,7 +921,7 @@ static int UriTestSig04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -993,7 +989,6 @@ static int UriTestSig05(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1018,7 +1013,7 @@ static int UriTestSig05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1040,7 +1035,7 @@ static int UriTestSig05(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1108,7 +1103,6 @@ static int UriTestSig06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1133,7 +1127,7 @@ static int UriTestSig06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1155,7 +1149,7 @@ static int UriTestSig06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1223,7 +1217,6 @@ static int UriTestSig07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1248,7 +1241,7 @@ static int UriTestSig07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1270,7 +1263,7 @@ static int UriTestSig07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1338,7 +1331,6 @@ static int UriTestSig08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1363,7 +1355,7 @@ static int UriTestSig08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1385,7 +1377,7 @@ static int UriTestSig08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1453,7 +1445,6 @@ static int UriTestSig09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1478,7 +1469,7 @@ static int UriTestSig09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1500,7 +1491,7 @@ static int UriTestSig09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1568,7 +1559,6 @@ static int UriTestSig10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1593,7 +1583,7 @@ static int UriTestSig10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1615,7 +1605,7 @@ static int UriTestSig10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1683,7 +1673,6 @@ static int UriTestSig11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1709,7 +1698,7 @@ static int UriTestSig11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1731,7 +1720,7 @@ static int UriTestSig11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1799,7 +1788,6 @@ static int UriTestSig12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1825,7 +1813,7 @@ static int UriTestSig12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1847,7 +1835,7 @@ static int UriTestSig12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1915,7 +1903,6 @@ static int UriTestSig13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1940,7 +1927,7 @@ static int UriTestSig13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1962,7 +1949,7 @@ static int UriTestSig13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2031,7 +2018,6 @@ static int UriTestSig14(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2056,7 +2042,7 @@ static int UriTestSig14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2078,7 +2064,7 @@ static int UriTestSig14(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2147,7 +2133,6 @@ static int UriTestSig15(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2172,7 +2157,7 @@ static int UriTestSig15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2194,7 +2179,7 @@ static int UriTestSig15(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2263,7 +2248,6 @@ static int UriTestSig16(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2286,7 +2270,7 @@ static int UriTestSig16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2311,7 +2295,7 @@ static int UriTestSig16(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2375,7 +2359,6 @@ static int UriTestSig17(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2402,7 +2385,7 @@ static int UriTestSig17(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2466,7 +2449,6 @@ static int UriTestSig18(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2493,7 +2475,7 @@ static int UriTestSig18(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2557,7 +2539,6 @@ static int UriTestSig19(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2585,7 +2566,7 @@ static int UriTestSig19(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2649,7 +2630,6 @@ static int UriTestSig20(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2676,7 +2656,7 @@ static int UriTestSig20(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2740,7 +2720,6 @@ static int UriTestSig21(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2766,7 +2745,7 @@ static int UriTestSig21(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2831,7 +2810,6 @@ static int UriTestSig22(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2856,7 +2834,7 @@ static int UriTestSig22(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2920,7 +2898,6 @@ static int UriTestSig23(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2945,7 +2922,7 @@ static int UriTestSig23(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3009,7 +2986,6 @@ static int UriTestSig24(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3034,7 +3010,7 @@ static int UriTestSig24(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3098,7 +3074,6 @@ static int UriTestSig25(void)
     p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3123,7 +3098,7 @@ static int UriTestSig25(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3187,7 +3162,6 @@ static int UriTestSig26(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3212,7 +3186,7 @@ static int UriTestSig26(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3276,7 +3250,6 @@ static int UriTestSig27(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3301,7 +3274,7 @@ static int UriTestSig27(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3397,7 +3370,6 @@ static int UriTestSig28(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3424,7 +3396,7 @@ static int UriTestSig28(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3485,7 +3457,6 @@ static int UriTestSig29(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3512,7 +3483,7 @@ static int UriTestSig29(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3573,7 +3544,6 @@ static int UriTestSig30(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3600,7 +3570,7 @@ static int UriTestSig30(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3661,7 +3631,6 @@ static int UriTestSig31(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3688,7 +3657,7 @@ static int UriTestSig31(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -3749,7 +3718,6 @@ static int UriTestSig32(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3776,7 +3744,7 @@ static int UriTestSig32(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
index c559a1523cf005d40128fc4da066862f594f6c00..f598a38cb386828c5b6618ae44b6c99ccdc0b2e7 100644 (file)
@@ -347,7 +347,6 @@ static int DetectFtpbounceTestALMatch02(void) {
     f.alproto = ALPROTO_FTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -365,7 +364,6 @@ static int DetectFtpbounceTestALMatch02(void) {
     SigGroupBuild(de_ctx);
     DetectEngineThreadCtxInit(&th_v,(void *)de_ctx,(void *)&det_ctx);
 
-    FlowL7DataPtrInit(&f);
     int r = AppLayerParse(&f, ALPROTO_FTP, STREAM_TOSERVER, ftpbuf1, ftplen1);
     if (r != 0) {
         SCLogDebug("toserver chunk 1 returned %" PRId32 ", expected 0: ", r);
@@ -394,7 +392,7 @@ static int DetectFtpbounceTestALMatch02(void) {
         goto end;
     }
 
-    FtpState *ftp_state = f.aldata[AlpGetStateIdx(ALPROTO_FTP)];
+    FtpState *ftp_state = f.alstate;
     if (ftp_state == NULL) {
         SCLogDebug("no ftp state: ");
         result = 0;
@@ -422,7 +420,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v,(void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -480,7 +477,6 @@ static int DetectFtpbounceTestALMatch03(void) {
     f.alproto = ALPROTO_FTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -526,7 +522,7 @@ static int DetectFtpbounceTestALMatch03(void) {
         goto end;
     }
 
-    FtpState *ftp_state = f.aldata[AlpGetStateIdx(ALPROTO_FTP)];
+    FtpState *ftp_state = f.alstate;
     if (ftp_state == NULL) {
         SCLogDebug("no ftp state: ");
         result = 0;
@@ -556,7 +552,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v,(void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     SCFree(p);
index 17860729b3aa69d603bdaf0024c03dd958f80d5c..1135402f252b6bfa63cecf52d0895421d0f7df6c 100644 (file)
@@ -408,7 +408,6 @@ static int DetectHttpClientBodyTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -433,7 +432,7 @@ static int DetectHttpClientBodyTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -457,7 +456,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -515,7 +513,6 @@ static int DetectHttpClientBodyTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -540,7 +537,7 @@ static int DetectHttpClientBodyTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -576,7 +573,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -636,7 +632,6 @@ static int DetectHttpClientBodyTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -661,7 +656,7 @@ static int DetectHttpClientBodyTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -700,7 +695,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -760,7 +754,6 @@ static int DetectHttpClientBodyTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -785,7 +778,7 @@ static int DetectHttpClientBodyTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -824,7 +817,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -883,7 +875,6 @@ static int DetectHttpClientBodyTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -908,7 +899,7 @@ static int DetectHttpClientBodyTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: \n");
         result = 0;
@@ -947,7 +938,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -997,7 +987,6 @@ static int DetectHttpClientBodyTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1022,7 +1011,7 @@ static int DetectHttpClientBodyTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1046,7 +1035,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1095,7 +1083,6 @@ static int DetectHttpClientBodyTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1120,7 +1107,7 @@ static int DetectHttpClientBodyTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1144,7 +1131,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1194,7 +1180,6 @@ static int DetectHttpClientBodyTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1219,7 +1204,7 @@ static int DetectHttpClientBodyTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1243,7 +1228,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1293,7 +1277,6 @@ static int DetectHttpClientBodyTest14(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1417,7 +1400,7 @@ static int DetectHttpClientBodyTest14(void) {
     }
     p->alerts.cnt = 0;
 
-    HtpState *htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1439,7 +1422,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePacket(p);
@@ -1489,7 +1471,6 @@ static int DetectHttpClientBodyTest15(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1613,7 +1594,7 @@ static int DetectHttpClientBodyTest15(void) {
     }
     p->alerts.cnt = 0;
 
-    HtpState *htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1665,7 +1646,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePacket(p);
index 06c1082748b641ad27a25edf714b1fa0f9d6ecdd..a9e0e8baa95e89aa0c8eb3b8dd0f60a1a44683aa 100644 (file)
@@ -664,7 +664,6 @@ static int DetectHttpCookieSigTest01(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -697,7 +696,7 @@ static int DetectHttpCookieSigTest01(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -726,7 +725,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -765,7 +763,6 @@ static int DetectHttpCookieSigTest02(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -791,7 +788,7 @@ static int DetectHttpCookieSigTest02(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -815,7 +812,6 @@ end:
         SigGroupCleanup(de_ctx);
         DetectEngineCtxFree(de_ctx);
     }
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -853,7 +849,6 @@ static int DetectHttpCookieSigTest03(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -879,7 +874,7 @@ static int DetectHttpCookieSigTest03(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -903,7 +898,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -942,7 +936,6 @@ static int DetectHttpCookieSigTest04(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -968,7 +961,7 @@ static int DetectHttpCookieSigTest04(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -992,7 +985,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -1031,7 +1023,6 @@ static int DetectHttpCookieSigTest05(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1057,7 +1048,7 @@ static int DetectHttpCookieSigTest05(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1081,7 +1072,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -1120,7 +1110,6 @@ static int DetectHttpCookieSigTest06(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1146,7 +1135,7 @@ static int DetectHttpCookieSigTest06(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1170,7 +1159,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -1208,7 +1196,6 @@ static int DetectHttpCookieSigTest07(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1234,7 +1221,7 @@ static int DetectHttpCookieSigTest07(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1258,7 +1245,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
index db60a29bc9cd2f11bc827a88b0e12bc06208a624..8cbaca8292fc6e2a89a86bf20372563cd4c8a81a 100644 (file)
@@ -422,7 +422,6 @@ static int DetectHttpHeaderTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -447,7 +446,7 @@ static int DetectHttpHeaderTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -471,7 +470,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -528,7 +526,6 @@ static int DetectHttpHeaderTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -553,7 +550,7 @@ static int DetectHttpHeaderTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -592,7 +589,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -648,7 +644,6 @@ static int DetectHttpHeaderTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -673,7 +668,7 @@ static int DetectHttpHeaderTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -712,7 +707,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -769,7 +763,6 @@ static int DetectHttpHeaderTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -795,7 +788,7 @@ static int DetectHttpHeaderTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -834,7 +827,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -891,7 +883,6 @@ static int DetectHttpHeaderTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -916,7 +907,7 @@ static int DetectHttpHeaderTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -955,7 +946,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1004,7 +994,6 @@ static int DetectHttpHeaderTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1029,7 +1018,7 @@ static int DetectHttpHeaderTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1053,7 +1042,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1101,7 +1089,6 @@ static int DetectHttpHeaderTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1126,7 +1113,7 @@ static int DetectHttpHeaderTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1150,7 +1137,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1199,7 +1185,6 @@ static int DetectHttpHeaderTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1224,7 +1209,7 @@ static int DetectHttpHeaderTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1248,7 +1233,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index 915ce618f404b181855079a5efec97074e5fca3a..5769c3e9937afa7e10e8764a596e3a3c5cafa61a 100644 (file)
@@ -662,7 +662,6 @@ static int DetectHttpMethodSigTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -698,7 +697,7 @@ static int DetectHttpMethodSigTest01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         SCLogDebug("no http state: ");
         goto end;
@@ -721,7 +720,6 @@ end:
     if (de_ctx != NULL) SigCleanSignatures(de_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -762,7 +760,6 @@ static int DetectHttpMethodSigTest02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -798,7 +795,7 @@ static int DetectHttpMethodSigTest02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         SCLogDebug("no http state: ");
         goto end;
@@ -822,7 +819,6 @@ end:
     if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, (void *) det_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -861,7 +857,6 @@ static int DetectHttpMethodSigTest03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -889,7 +884,7 @@ static int DetectHttpMethodSigTest03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         SCLogDebug("no http state: ");
         goto end;
@@ -909,7 +904,6 @@ end:
     if (de_ctx != NULL) SigCleanSignatures(de_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -950,7 +944,6 @@ static int DetectHttpMethodSigTest04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -982,7 +975,7 @@ static int DetectHttpMethodSigTest04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         SCLogDebug("no http state: ");
         goto end;
@@ -1014,7 +1007,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index 63f18f7de08e08ffb427c407127a820757167b69..51ea0ebf138177605b887fd004c5ce2a4e58da63 100644 (file)
@@ -419,7 +419,6 @@ static int DetectHttpRawHeaderTest06(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -444,7 +443,7 @@ static int DetectHttpRawHeaderTest06(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -468,7 +467,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -525,7 +523,6 @@ static int DetectHttpRawHeaderTest07(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -550,7 +547,7 @@ static int DetectHttpRawHeaderTest07(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -589,7 +586,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -645,7 +641,6 @@ static int DetectHttpRawHeaderTest08(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -670,7 +665,7 @@ static int DetectHttpRawHeaderTest08(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -709,7 +704,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -766,7 +760,6 @@ static int DetectHttpRawHeaderTest09(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -791,7 +784,7 @@ static int DetectHttpRawHeaderTest09(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -830,7 +823,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -887,7 +879,6 @@ static int DetectHttpRawHeaderTest10(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -912,7 +903,7 @@ static int DetectHttpRawHeaderTest10(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -951,7 +942,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -1000,7 +990,6 @@ static int DetectHttpRawHeaderTest11(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1025,7 +1014,7 @@ static int DetectHttpRawHeaderTest11(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1049,7 +1038,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1097,7 +1085,6 @@ static int DetectHttpRawHeaderTest12(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1122,7 +1109,7 @@ static int DetectHttpRawHeaderTest12(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1146,7 +1133,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1195,7 +1181,6 @@ static int DetectHttpRawHeaderTest13(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -1220,7 +1205,7 @@ static int DetectHttpRawHeaderTest13(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1244,7 +1229,6 @@ end:
     if (de_ctx != NULL)
         DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index e935d28a7de174356cc75ba07ecb2414d91b0d75..4bebea322b04ff2e6e8c796a2998d8f537af8b51 100644 (file)
@@ -431,7 +431,6 @@ static int DetectHttpStatCodeSigTest01(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -463,7 +462,7 @@ static int DetectHttpStatCodeSigTest01(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -487,7 +486,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -527,7 +525,6 @@ static int DetectHttpStatCodeSigTest02(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -567,7 +564,7 @@ static int DetectHttpStatCodeSigTest02(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -596,7 +593,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -637,7 +633,6 @@ static int DetectHttpStatCodeSigTest03(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -677,7 +672,7 @@ static int DetectHttpStatCodeSigTest03(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -706,7 +701,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -747,7 +741,6 @@ static int DetectHttpStatCodeSigTest04(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -787,7 +780,7 @@ static int DetectHttpStatCodeSigTest04(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -816,7 +809,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
index 4c3d3e3845e96079b9cecc31c96737542f1f5288..726b579843569bd30ad7c9d17f06f17fa5138315 100644 (file)
@@ -418,7 +418,6 @@ static int DetectHttpStatMsgSigTest01(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -458,7 +457,7 @@ static int DetectHttpStatMsgSigTest01(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -487,7 +486,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -527,7 +525,6 @@ static int DetectHttpStatMsgSigTest02(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -560,7 +557,7 @@ static int DetectHttpStatMsgSigTest02(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -585,7 +582,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
@@ -626,7 +622,6 @@ static int DetectHttpStatMsgSigTest03(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -666,7 +661,7 @@ static int DetectHttpStatMsgSigTest03(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -695,7 +690,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     UTHFreePackets(&p, 1);
index b20ec820723bdc1de3c487b70dc22d79d641f321..34896132a91d677900cb129ec8badab44aff2de9 100644 (file)
@@ -1555,7 +1555,6 @@ static int DetectPcreTestSig01Real(int mpm_type) {
     p->flags |= PKT_HAS_FLOW|PKT_STREAM_EST;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1592,7 +1591,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
 
     FLOW_DESTROY(&f);
@@ -1800,7 +1798,6 @@ static int DetectPcreModifPTest04(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1832,7 +1829,7 @@ static int DetectPcreModifPTest04(void) {
         goto end;
     }
 
-    HtpState *http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -1857,7 +1854,6 @@ end:
     if (de_ctx != NULL) SigCleanSignatures(de_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1930,7 +1926,6 @@ static int DetectPcreModifPTest05(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1965,7 +1960,7 @@ static int DetectPcreModifPTest05(void) {
     /* do detect for p1 */
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p1);
 
-    HtpState *http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -2010,7 +2005,6 @@ end:
     if (de_ctx != NULL) SigCleanSignatures(de_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p1, 1);
@@ -2113,7 +2107,6 @@ static int DetectPcreTestSig09(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2139,7 +2132,7 @@ static int DetectPcreTestSig09(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2163,7 +2156,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -2204,7 +2196,6 @@ static int DetectPcreTestSig10(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2230,7 +2221,7 @@ static int DetectPcreTestSig10(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2254,7 +2245,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -2295,7 +2285,6 @@ static int DetectPcreTestSig11(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2321,7 +2310,7 @@ static int DetectPcreTestSig11(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2345,7 +2334,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -2386,7 +2374,6 @@ static int DetectPcreTestSig12(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2412,7 +2399,7 @@ static int DetectPcreTestSig12(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2436,7 +2423,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -2477,7 +2463,6 @@ static int DetectPcreTestSig13(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2503,7 +2488,7 @@ static int DetectPcreTestSig13(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2527,7 +2512,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -2568,7 +2552,6 @@ static int DetectPcreTestSig14(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2594,7 +2577,7 @@ static int DetectPcreTestSig14(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -2618,7 +2601,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     UTHFreePackets(&p, 1);
     return result;
@@ -2664,7 +2646,6 @@ static int DetectPcreTxBodyChunksTest01(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     AppLayerHtpEnableRequestBodyCallback();
 
@@ -2714,7 +2695,7 @@ static int DetectPcreTxBodyChunksTest01(void) {
     /* Now we should have 2 transactions, each with it's own list
      * of request body chunks (let's test it) */
 
-    HtpState *htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -2760,7 +2741,6 @@ static int DetectPcreTxBodyChunksTest01(void) {
         goto end;
     }
 
-    FlowL7DataPtrFree(&f);
 
     result = 1;
 end:
@@ -2814,7 +2794,6 @@ static int DetectPcreTxBodyChunksTest02(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -2938,7 +2917,7 @@ static int DetectPcreTxBodyChunksTest02(void) {
     }
     p->alerts.cnt = 0;
 
-    HtpState *htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -2990,7 +2969,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePacket(p);
@@ -3040,7 +3018,6 @@ static int DetectPcreTxBodyChunksTest03(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -3164,7 +3141,7 @@ static int DetectPcreTxBodyChunksTest03(void) {
     }
     p->alerts.cnt = 0;
 
-    HtpState *htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -3186,7 +3163,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePacket(p);
index ddc3cff2ebfb4e6d4d61d8e9de13c288b794be3e..bb1ff625d10d22b58b22b50db7b1188a633e9c75 100644 (file)
@@ -374,7 +374,6 @@ static int DetectSshVersionTestDetect01(void) {
     f.alproto = ALPROTO_SSH;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -415,7 +414,7 @@ static int DetectSshVersionTestDetect01(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -437,7 +436,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -478,7 +476,6 @@ static int DetectSshVersionTestDetect02(void) {
     f.alproto = ALPROTO_SSH;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -519,7 +516,7 @@ static int DetectSshVersionTestDetect02(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -541,7 +538,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -582,7 +578,6 @@ static int DetectSshVersionTestDetect03(void) {
     f.alproto = ALPROTO_SSH;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -623,7 +618,7 @@ static int DetectSshVersionTestDetect03(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -645,7 +640,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
index 6dd3896e9151b5935971444f8ec1ea2cef4681a4..8fa16ba299b43adef3939ab67b96127c8436d393 100644 (file)
@@ -335,7 +335,6 @@ static int DetectSshSoftwareVersionTestDetect01(void) {
     f.alproto = ALPROTO_SSH;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -376,7 +375,7 @@ static int DetectSshSoftwareVersionTestDetect01(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -398,7 +397,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -439,7 +437,6 @@ static int DetectSshSoftwareVersionTestDetect02(void) {
     f.alproto = ALPROTO_SSH;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -480,7 +477,7 @@ static int DetectSshSoftwareVersionTestDetect02(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -502,7 +499,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -543,7 +539,6 @@ static int DetectSshSoftwareVersionTestDetect03(void) {
     f.alproto = ALPROTO_SSH;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -584,7 +579,7 @@ static int DetectSshSoftwareVersionTestDetect03(void) {
         goto end;
     }
 
-    SshState *ssh_state = f.aldata[AlpGetStateIdx(ALPROTO_SSH)];
+    SshState *ssh_state = f.alstate;
     if (ssh_state == NULL) {
         printf("no ssh state: ");
         goto end;
@@ -606,7 +601,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
index 28171d558a146647273da1da9758f452d4d2dce7..a4f39a3c4fbb1abe4bb9304a9f8d84f254ce5085 100644 (file)
@@ -716,7 +716,6 @@ static int DetectSslStateTest07(void)
     f.alproto = ALPROTO_TLS;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL)
@@ -761,7 +760,7 @@ static int DetectSslStateTest07(void)
         goto end;
     }
 
-    ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no ssl state: ");
         goto end;
@@ -867,7 +866,6 @@ static int DetectSslStateTest07(void)
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index 25ad5ab36d5e27b6bb4738968fa1378a234b73ca..5134eaaf089ecab471d551e542e6e8992e0ed808 100644 (file)
@@ -431,7 +431,6 @@ static int DetectSslVersionTestDetect01(void)
     f.alproto = ALPROTO_TLS;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -472,7 +471,7 @@ static int DetectSslVersionTestDetect01(void)
         goto end;
     }
 
-    SSLState *app_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *app_state = f.alstate;
     if (app_state == NULL) {
         printf("no ssl state: ");
         goto end;
@@ -507,7 +506,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -548,7 +546,6 @@ static int DetectSslVersionTestDetect02(void)
     f.alproto = ALPROTO_TLS;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -589,7 +586,7 @@ static int DetectSslVersionTestDetect02(void)
         goto end;
     }
 
-    SSLState *app_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *app_state = f.alstate;
     if (app_state == NULL) {
         printf("no ssl state: ");
         goto end;
@@ -620,7 +617,6 @@ end:
     SigCleanSignatures(de_ctx);
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -663,7 +659,6 @@ static int DetectSslVersionTestDetect03(void)
     f.proto = p->proto;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     StreamMsg *stream_msg = StreamMsgGetFromPool();
     if (stream_msg == NULL) {
@@ -720,7 +715,7 @@ static int DetectSslVersionTestDetect03(void)
         goto end;
     }
 
-    SSLState *app_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *app_state = f.alstate;
     if (app_state == NULL) {
         printf("no ssl state: ");
         goto end;
@@ -754,7 +749,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index 20874af2dc23fa5fb974a9a764184ec4947c7607..997df0f0db0f1ec415564977e2a16c2e00b2def9 100644 (file)
@@ -341,7 +341,6 @@ static int DetectTlsVersionTestDetect01(void) {
     f.alproto = ALPROTO_TLS;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -382,7 +381,7 @@ static int DetectTlsVersionTestDetect01(void) {
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         goto end;
@@ -416,7 +415,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -456,7 +454,6 @@ static int DetectTlsVersionTestDetect02(void) {
     f.alproto = ALPROTO_TLS;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -497,7 +494,7 @@ static int DetectTlsVersionTestDetect02(void) {
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         goto end;
@@ -529,7 +526,6 @@ end:
     DetectEngineThreadCtxDeinit(&th_v, (void *)det_ctx);
     DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
 
@@ -572,7 +568,6 @@ static int DetectTlsVersionTestDetect03(void) {
     f.proto = p->proto;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     StreamMsg *stream_msg = StreamMsgGetFromPool();
     if (stream_msg == NULL) {
@@ -629,7 +624,7 @@ static int DetectTlsVersionTestDetect03(void) {
         goto end;
     }
 
-    SSLState *ssl_state = f.aldata[AlpGetStateIdx(ALPROTO_TLS)];
+    SSLState *ssl_state = f.alstate;
     if (ssl_state == NULL) {
         printf("no tls state: ");
         goto end;
@@ -662,7 +657,6 @@ end:
         DetectEngineCtxFree(de_ctx);
     }
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index bcfdf08e86380e2435316826065e89afc2656bf3..054838383911d355f7eff342cbf64ff4d31c2ba9 100644 (file)
@@ -526,7 +526,6 @@ static int HTTPUriTest01(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START|
                           STREAM_EOF, httpbuf1, httplen1);
@@ -535,7 +534,7 @@ static int HTTPUriTest01(void) {
         goto end;
     }
 
-    HtpState *htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -570,7 +569,6 @@ static int HTTPUriTest01(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -596,7 +594,6 @@ static int HTTPUriTest02(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START|
                           STREAM_EOF, httpbuf1, httplen1);
@@ -605,7 +602,7 @@ static int HTTPUriTest02(void) {
         goto end;
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -640,7 +637,6 @@ static int HTTPUriTest02(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -668,7 +664,6 @@ static int HTTPUriTest03(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START|
                           STREAM_EOF, httpbuf1, httplen1);
@@ -677,7 +672,7 @@ static int HTTPUriTest03(void) {
         goto end;
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -712,7 +707,6 @@ static int HTTPUriTest03(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -741,7 +735,6 @@ static int HTTPUriTest04(void) {
     f.dst.family = AF_INET;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     r = AppLayerParse(&f, ALPROTO_HTTP, STREAM_TOSERVER|STREAM_START|
                           STREAM_EOF, httpbuf1, httplen1);
@@ -750,7 +743,7 @@ static int HTTPUriTest04(void) {
         goto end;
     }
 
-    htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    htp_state = f.alstate;
     if (htp_state == NULL) {
         printf("no http state: ");
         result = 0;
@@ -789,7 +782,6 @@ static int HTTPUriTest04(void) {
 
     result = 1;
 end:
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     if (htp_state != NULL)
         HTPStateFree(htp_state);
@@ -875,7 +867,6 @@ static int DetectUriSigTest02(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -915,7 +906,7 @@ static int DetectUriSigTest02(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -943,7 +934,6 @@ end:
     if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, det_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -986,7 +976,6 @@ static int DetectUriSigTest03(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1047,7 +1036,7 @@ static int DetectUriSigTest03(void) {
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1075,7 +1064,6 @@ end:
     if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, det_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    //FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1317,7 +1305,6 @@ static int DetectUriSigTest05(void) {
     f.proto = p->proto;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     StreamMsg *stream_msg = StreamMsgGetFromPool();
     if (stream_msg == NULL) {
@@ -1370,7 +1357,7 @@ static int DetectUriSigTest05(void) {
     /* do detect */
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1394,7 +1381,6 @@ end:
     if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, det_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1441,7 +1427,6 @@ static int DetectUriSigTest06(void) {
     f.proto = p->proto;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     StreamMsg *stream_msg = StreamMsgGetFromPool();
     if (stream_msg == NULL) {
@@ -1506,7 +1491,7 @@ static int DetectUriSigTest06(void) {
    /* do detect */
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1531,7 +1516,6 @@ end:
     if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, det_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
@@ -1572,7 +1556,6 @@ static int DetectUriSigTest07(void) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -1625,7 +1608,7 @@ static int DetectUriSigTest07(void) {
     /* do detect */
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -1650,7 +1633,6 @@ end:
     if (det_ctx != NULL) DetectEngineThreadCtxDeinit(&th_v, det_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index 5aab988327d2ac6b3851717275095fe726681f23..192234b3089bd6b2876e93b33351d548a75809a5 100644 (file)
@@ -531,7 +531,6 @@ static int DetectUrilenSigTest01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -565,7 +564,7 @@ static int DetectUrilenSigTest01(void)
         goto end;
     }
 
-    HtpState *htp_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    HtpState *htp_state = f.alstate;
     if (htp_state == NULL) {
         SCLogDebug("no http state: ");
         goto end;
@@ -589,7 +588,6 @@ end:
     if (de_ctx != NULL) SigCleanSignatures(de_ctx);
     if (de_ctx != NULL) DetectEngineCtxFree(de_ctx);
 
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     UTHFreePackets(&p, 1);
index 47102843f2719145333bb76189c5fc9add0f1d11..5ed54747f927d4d74c89bb8d2b6ace9011a33f0b 100644 (file)
@@ -4677,7 +4677,6 @@ static int SigTest06Real (int mpm_type) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -4724,7 +4723,6 @@ static int SigTest06Real (int mpm_type) {
     DetectEngineCtxFree(de_ctx);
 end:
     UTHFreePackets(&p, 1);
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4773,7 +4771,6 @@ static int SigTest07Real (int mpm_type) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -4812,7 +4809,6 @@ static int SigTest07Real (int mpm_type) {
 
 end:
     UTHFreePackets(&p, 1);
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     AppLayerParserCleanupState(&f);
     FLOW_DESTROY(&f);
@@ -4869,7 +4865,6 @@ static int SigTest08Real (int mpm_type) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -4916,7 +4911,6 @@ static int SigTest08Real (int mpm_type) {
     DetectEngineCtxFree(de_ctx);
 end:
     UTHFreePackets(&p, 1);
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -4965,7 +4959,6 @@ static int SigTest09Real (int mpm_type) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -5009,7 +5002,6 @@ static int SigTest09Real (int mpm_type) {
     DetectEngineCtxFree(de_ctx);
 end:
     UTHFreePackets(&p, 1);
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -5053,7 +5045,6 @@ static int SigTest10Real (int mpm_type) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -5097,7 +5088,6 @@ static int SigTest10Real (int mpm_type) {
     DetectEngineCtxFree(de_ctx);
 end:
     UTHFreePackets(&p, 1);
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -5140,7 +5130,6 @@ static int SigTest11Real (int mpm_type) {
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -5172,7 +5161,6 @@ static int SigTest11Real (int mpm_type) {
     DetectEngineCtxFree(de_ctx);
 end:
     UTHFreePackets(&p, 1);
-    FlowL7DataPtrFree(&f);
     StreamTcpFreeConfig(TRUE);
     FLOW_DESTROY(&f);
     return result;
@@ -10036,7 +10024,6 @@ static int SigTestDropFlow01(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -10061,7 +10048,7 @@ static int SigTestDropFlow01(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -10134,7 +10121,6 @@ static int SigTestDropFlow02(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -10159,7 +10145,7 @@ static int SigTestDropFlow02(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -10250,7 +10236,6 @@ static int SigTestDropFlow03(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -10285,7 +10270,7 @@ static int SigTestDropFlow03(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
@@ -10415,7 +10400,6 @@ static int SigTestDropFlow04(void)
     f.alproto = ALPROTO_HTTP;
 
     StreamTcpInitConfig(TRUE);
-    FlowL7DataPtrInit(&f);
 
     DetectEngineCtx *de_ctx = DetectEngineCtxInit();
     if (de_ctx == NULL) {
@@ -10449,7 +10433,7 @@ static int SigTestDropFlow04(void)
         goto end;
     }
 
-    http_state = f.aldata[AlpGetStateIdx(ALPROTO_HTTP)];
+    http_state = f.alstate;
     if (http_state == NULL) {
         printf("no http state: ");
         goto end;
index f0443bc77eaf3e31c9fcea897320fb532b3592fb..6a172e88ad5bf3b2a594d74036ed783584657fb0 100644 (file)
@@ -146,7 +146,6 @@ void FlowInit(Flow *f, Packet *p)
         printf("FIXME: %s:%s:%" PRId32 "\n", __FILE__, __FUNCTION__, __LINE__);
     }
 
-    FlowL7DataPtrInit(f);
     COPY_TIMESTAMP(&p->ts, &f->startts);
 
     f->protomap = FlowGetProtoMapping(f->proto);
index 8716862eac31828ede924e7c7601bbdae3c37526..9c5c1f089174922722011ae1190f6ba0ebef30aa 100644 (file)
@@ -49,7 +49,8 @@
         (f)->alproto = 0; \
         (f)->probing_parser_toserver_al_proto_masks = 0; \
         (f)->probing_parser_toclient_al_proto_masks = 0; \
-        (f)->aldata = NULL; \
+        (f)->alparser = NULL; \
+        (f)->alstate = NULL; \
         (f)->de_state = NULL; \
         (f)->sgh_toserver = NULL; \
         (f)->sgh_toclient = NULL; \
@@ -75,7 +76,9 @@
         (f)->flags = 0; \
         (f)->lastts_sec = 0; \
         (f)->protoctx = NULL; \
-        FlowL7DataPtrFree(f); \
+        FlowCleanupAppLayer((f)); \
+        (f)->alparser = NULL; \
+        (f)->alstate = NULL; \
         (f)->alproto = 0; \
         (f)->probing_parser_toserver_al_proto_masks = 0; \
         (f)->probing_parser_toclient_al_proto_masks = 0; \
         SC_ATOMIC_DESTROY((f)->use_cnt); \
         \
         SCMutexDestroy(&(f)->m); \
+        FlowCleanupAppLayer((f)); \
         if ((f)->de_state != NULL) { \
             DetectEngineStateFree((f)->de_state); \
         } \
-        /* clear app layer related memory */ \
-        FlowL7DataPtrFree(f); \
         DetectTagDataListFree((f)->tag_list); \
         GenericVarFree((f)->flowvar); \
         SCMutexDestroy(&(f)->de_state_m); \
index a696daf53a2e3f8d2916eb21526dde282cad42de..93ce1d3a8ea42e05e5d5f144f1ccc998254899ba 100644 (file)
@@ -86,51 +86,12 @@ int FlowKill(FlowQueue *);
 /* Run mode selected at suricata.c */
 extern int run_mode;
 
-/** \brief Initialize the l7data ptr in the Flow session used by the L7 Modules
- *         for data storage.
- *
- *  \param f Flow to init the ptrs for
- *  \param cnt number of items in the array
- *
- *  \todo VJ use a pool?
- */
-void FlowL7DataPtrInit(Flow *f)
-{
-    if (f->aldata != NULL)
-        return;
-
-    uint32_t size = (uint32_t)(sizeof (void *) * AppLayerGetStorageSize());
-
-    // XXXPR pass to flow memcap   if (StreamTcpCheckMemcap(size) == 0)
-    // XXXPR pass to flow memcap        return;
-
-    f->aldata = (void **) SCMalloc(size);
-    if (f->aldata != NULL) {
-        // StreamTcpIncrMemuse(size);
-        uint8_t u;
-        for (u = 0; u < AppLayerGetStorageSize(); u++) {
-            f->aldata[u] = NULL;
-        }
-    }
-
-    return;
-}
-
-void FlowL7DataPtrFree(Flow *f)
+void FlowCleanupAppLayer(Flow *f)
 {
     if (f == NULL)
         return;
 
-    if (f->aldata == NULL)
-        return;
-
     AppLayerParserCleanupState(f);
-    SCFree(f->aldata);
-    f->aldata = NULL;
-
-    // uint32_t size = (uint32_t)(sizeof (void *) * StreamL7GetStorageSize());
-    // StreamTcpDecrMemuse(size);
-
     return;
 }
 
index 29b0111874eaaaa80d4a9cbcaac5ce638060234e..2c11a79d109f62c356591abab5f3c5742ac452af 100644 (file)
@@ -194,17 +194,12 @@ typedef struct Flow_
 
     uint16_t alproto; /**< \brief application level protocol */
 
-    /** \brief array of application level storage ptrs.
+    /** application level storage ptrs.
      *
-     * The size of array is ALPROTO_MAX and thus depends on the number of protocol
-     * supported. Regarding the memeber of the arrays, for an HTTP flow member
-     * can point to a ::HtpState.
-     *
-     * Use AppLayerGetProtoStateFromPacket() to get a pointer to the application
-     * layer the packet belongs to.
      */
+    void *alparser;     /**< parser internal state */
+    void *alstate;      /**< application layer state */
 
-    void **aldata;
     /** detection engine state */
     struct DetectEngineState_ *de_state;
 
@@ -290,8 +285,7 @@ static inline void FlowSetSessionNoApplayerInspectionFlag(Flow *);
 
 int FlowGetPacketDirection(Flow *, Packet *);
 
-void FlowL7DataPtrInit(Flow *);
-void FlowL7DataPtrFree(Flow *);
+void FlowCleanupAppLayer(Flow *);
 
 /** ----- Inline functions ----- */
 
index d4abee9e4491eabe105c147faa9691a1911e73df..2dcb6fa9f2636237176e13284166422c76f2c5e4 100644 (file)
@@ -169,10 +169,10 @@ typedef struct TcpSession_ {
     uint16_t flags;
     TcpStream server;
     TcpStream client;
-    struct StreamMsg_ *toserver_smsg_head; /**< list of stream msgs (for detection inspection) */
-    struct StreamMsg_ *toserver_smsg_tail; /**< list of stream msgs (for detection inspection) */
-    struct StreamMsg_ *toclient_smsg_head; /**< list of stream msgs (for detection inspection) */
-    struct StreamMsg_ *toclient_smsg_tail; /**< list of stream msgs (for detection inspection) */
+    struct StreamMsg_ *toserver_smsg_head;  /**< list of stream msgs (for detection inspection) */
+    struct StreamMsg_ *toserver_smsg_tail;  /**< list of stream msgs (for detection inspection) */
+    struct StreamMsg_ *toclient_smsg_head;  /**< list of stream msgs (for detection inspection) */
+    struct StreamMsg_ *toclient_smsg_tail;  /**< list of stream msgs (for detection inspection) */
 } TcpSession;
 
 #endif /* __STREAM_TCP_PRIVATE_H__ */
index 327a581cc38ffc6edeb8600782c8c3240ac50ed2..2aff488faaa6975155cc22f1f57ef90f2a133ccd 100644 (file)
@@ -3616,7 +3616,6 @@ static int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,
                     StreamTcpSackFreeList(&ssn->server);
                     /* reset the app layer state */
                     AppLayerParserCleanupState(p->flow);
-                    FlowL7DataPtrInit(p->flow);
 
                     ssn->state = 0;
                     ssn->flags = 0;
@@ -4703,7 +4702,7 @@ static int StreamTcpTest01 (void) {
     }
     f.protoctx = ssn;
 
-    if (f.aldata != NULL) {
+    if (f.alparser != NULL) {
         printf("AppLayer field not set to NULL: ");
         goto end;
     }