diff options
| author | Mosder <xmosder12@gmail.com> | 2026-07-06 10:06:10 +0200 |
|---|---|---|
| committer | Mosder <xmosder12@gmail.com> | 2026-07-06 10:06:10 +0200 |
| commit | f57066460f7c914b07a612d037eb5e57f617d5b2 (patch) | |
| tree | 703a7b21c24fa1ab002349a6979da53158d161b2 /analyzer/parser/parser.h | |
| parent | f1d1feabec428bf9ffc2c786d28ce7cc95725d48 (diff) | |
feat: added basic structures for fight results parsing and base functionallity of finding only the necessary data. Still need to do tcp stream reassembly and the actual parsing of the data.
Diffstat (limited to 'analyzer/parser/parser.h')
| -rw-r--r-- | analyzer/parser/parser.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/analyzer/parser/parser.h b/analyzer/parser/parser.h new file mode 100644 index 0000000..18b4b83 --- /dev/null +++ b/analyzer/parser/parser.h @@ -0,0 +1,21 @@ +// parser/parser.h +// main parser file + +#include "fight_results.h" + +// "generic" type for parsed data +typedef struct { + enum { FIGHT_RESULTS } data_type; + union { + FightResults fight_results; + } data; +} ParsedData; + +// parse a stream of TCP data +// params: +// - stream - the stream to parse +// - stream_len - length of the stream to parse +// - parsed_len - pointer to inform how much of the stream was parsed (not all if e.g. start of data is there, but the end isn't yet) +// returns: +// pointer to the array of parsed data +extern ParsedData *parse_stream(char *stream, int stream_len, int *parsed_len); |
