4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change
on this file since 756b8f9 was
11a7f9c,
checked in by Perry Lorier <perry@…>, 13 years ago
|
Constification
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | #ifndef _PARSER_H |
---|
2 | #define _PARSER_H |
---|
3 | |
---|
4 | #include <inttypes.h> |
---|
5 | |
---|
6 | enum node_type_t { |
---|
7 | NEXTHEADER, |
---|
8 | FIELD |
---|
9 | }; |
---|
10 | |
---|
11 | enum byte_order_t { |
---|
12 | BIGENDIAN, |
---|
13 | LITTLEENDIAN |
---|
14 | }; |
---|
15 | |
---|
16 | enum display_t { |
---|
17 | DISPLAY_NONE, |
---|
18 | DISPLAY_HEX, |
---|
19 | DISPLAY_INT, |
---|
20 | DISPLAY_IPV4, |
---|
21 | DISPLAY_MAC, |
---|
22 | DISPLAY_FLAG |
---|
23 | }; |
---|
24 | |
---|
25 | /* This is more complicated that I feel it needs to be... */ |
---|
26 | |
---|
27 | typedef struct next { |
---|
28 | char *prefix; /* search prefix for nextheader file */ |
---|
29 | char *fieldname; /* name of the field whose value we use */ |
---|
30 | struct field *target; /* link to the field whose value we use */ |
---|
31 | } next_t; |
---|
32 | |
---|
33 | typedef struct field { |
---|
34 | enum byte_order_t order; /* byte order of field */ |
---|
35 | uint16_t size; /* size of the field in bits */ |
---|
36 | enum display_t display; /* how the data should be displayed */ |
---|
37 | char *identifier; /* display prefix + field identifier */ |
---|
38 | uint64_t value; /* calculated value for this field */ |
---|
39 | } field_t; |
---|
40 | |
---|
41 | typedef union node { |
---|
42 | field_t *field; |
---|
43 | next_t *nextheader; |
---|
44 | } node_t; |
---|
45 | |
---|
46 | typedef struct element { |
---|
47 | enum node_type_t type; |
---|
48 | struct element *next; |
---|
49 | node_t *data; |
---|
50 | } element_t; |
---|
51 | |
---|
52 | element_t *parse_protocol_file(char *filename); |
---|
53 | void decode_protocol_file(uint16_t link_type,const char *packet,int len, element_t* el); |
---|
54 | |
---|
55 | typedef uint64_t bitbuffer_t; |
---|
56 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.