Skip to content

Commit

Permalink
app-layer: extract out a simple function type to simple header
Browse files Browse the repository at this point in the history
Extract a simple function function to a simple header with no circular
dependencies.

Next we'll use bindgen to generate Rust bindings for this function.

Ticket: OISF#7341
  • Loading branch information
jasonish committed Oct 24, 2024
1 parent 0216af5 commit de28619
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ noinst_HEADERS = \
app-layer-dnp3-objects.h \
app-layer-events.h \
app-layer-expectation.h \
app-layer-ext.h \
app-layer-frames.h \
app-layer-ftp.h \
app-layer.h \
Expand Down
8 changes: 8 additions & 0 deletions src/app-layer-ext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef SURICATA_APP_LAYER_EXT_H
#define SURICATA_APP_LAYER_EXT_H

#include <stdint.h>

typedef int (*SCAppLayerStateGetProgressFn)(void *alstate, uint8_t direction);

#endif /* SURICATA_APP_LAYER_EXT_H */
3 changes: 2 additions & 1 deletion src/app-layer-register.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define SURICATA_APP_LAYER_REGISTER_H

#include "app-layer-detect-proto.h"
#include "app-layer-ext.h"

typedef struct AppLayerParser {
const char *name;
Expand All @@ -49,7 +50,7 @@ typedef struct AppLayerParser {

const int complete_ts;
const int complete_tc;
int (*StateGetProgress)(void *alstate, uint8_t direction);
SCAppLayerStateGetProgressFn StateGetProgress;

int (*StateGetEventInfo)(const char *event_name,
int *event_id, AppLayerEventType *event_type);
Expand Down

0 comments on commit de28619

Please sign in to comment.