]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: remove version logic
authorVictor Julien <victor@inliniac.net>
Tue, 28 Feb 2017 08:38:00 +0000 (09:38 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 25 Mar 2017 08:12:57 +0000 (09:12 +0100)
src/app-layer-parser.c
src/app-layer-parser.h

index d16391d07e222e55a0649a7397d726a9e8c84acf..49975175ebae55b88b4ea0b746e897a09c06410b 100644 (file)
@@ -136,8 +136,6 @@ typedef struct AppLayerParserCtx_ {
 struct AppLayerParserState_ {
     uint8_t flags;
 
-    /* State version, incremented for each update.  Can wrap around. */
-    uint8_t version;
     /* Indicates the current transaction that is being inspected.
      * We have a var per direction. */
     uint64_t inspect_id[2];
@@ -682,12 +680,6 @@ AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alp
     SCReturnPtr(ptr, "AppLayerDecoderEvents *");
 }
 
-uint16_t AppLayerParserGetStateVersion(AppLayerParserState *pstate)
-{
-    SCEnter();
-    SCReturnCT((pstate == NULL) ? 0 : pstate->version, "uint8_t");
-}
-
 FileContainer *AppLayerParserGetFiles(uint8_t ipproto, AppProto alproto,
                            void *alstate, uint8_t direction)
 {
@@ -969,9 +961,6 @@ int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *alp_tctx, Flow
         if (pstate == NULL)
             goto error;
     }
-    pstate->version++;
-    SCLogDebug("app layer parser state version incremented to %"PRIu8,
-               pstate->version);
 
     if (flags & STREAM_EOF)
         AppLayerParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF);
@@ -1074,9 +1063,6 @@ void AppLayerParserSetEOF(AppLayerParserState *pstate)
         goto end;
 
     AppLayerParserStateSetFlag(pstate, APP_LAYER_PARSER_EOF);
-    /* increase version so we will inspect it one more time
-     * with the EOF flags now set */
-    pstate->version++;
 
  end:
     SCReturn;
@@ -1304,10 +1290,9 @@ void AppLayerParserStatePrintDetails(AppLayerParserState *pstate)
                "p->inspect_id[0](%"PRIu64"), "
                "p->inspect_id[1](%"PRIu64"), "
                "p->log_id(%"PRIu64"), "
-               "p->version(%"PRIu8"), "
                "p->decoder_events(%p).",
                pstate, p->inspect_id[0], p->inspect_id[1], p->log_id,
-               p->version, p->decoder_events);
+               p->decoder_events);
 
     SCReturn;
 }
index 9cd6d99192f7feadb213778a8075af49123ea2dd..29e668ce7f1412b0685e198f5fe2e9bd6ae14aec 100644 (file)
@@ -175,7 +175,6 @@ AppLayerDecoderEvents *AppLayerParserGetDecoderEvents(AppLayerParserState *pstat
 void AppLayerParserSetDecoderEvents(AppLayerParserState *pstate, AppLayerDecoderEvents *devents);
 AppLayerDecoderEvents *AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alproto, void *alstate,
                                         uint64_t tx_id);
-uint16_t AppLayerParserGetStateVersion(AppLayerParserState *pstate);
 FileContainer *AppLayerParserGetFiles(uint8_t ipproto, AppProto alproto,
                            void *alstate, uint8_t direction);
 int AppLayerParserGetStateProgress(uint8_t ipproto, AppProto alproto,