1 | |
---|
2 | #define PCAPNG_SECTION_TYPE 0x0A0D0D0A |
---|
3 | #define PCAPNG_INTERFACE_TYPE 0x00000001 |
---|
4 | #define PCAPNG_OLD_PACKET_TYPE 0x00000002 |
---|
5 | #define PCAPNG_SIMPLE_PACKET_TYPE 0x00000003 |
---|
6 | #define PCAPNG_NAME_RESOLUTION_TYPE 0x00000004 |
---|
7 | #define PCAPNG_INTERFACE_STATS_TYPE 0x00000005 |
---|
8 | #define PCAPNG_ENHANCED_PACKET_TYPE 0x00000006 |
---|
9 | #define PCAPNG_CUSTOM_TYPE 0x00000BAD |
---|
10 | #define PCAPNG_CUSTOM_NONCOPY_TYPE 0x40000BAD |
---|
11 | #define PCAPNG_DECRYPTION_SECRETS_TYPE 0x0000000A |
---|
12 | |
---|
13 | #define PCAPNG_NRB_RECORD_END 0x0000 |
---|
14 | #define PCAPNG_NRB_RECORD_IP4 0x0001 |
---|
15 | #define PCAPNG_NRB_RECORD_IP6 0x0002 |
---|
16 | |
---|
17 | #define PCAPNG_CUSTOM_OPTION_UTF8 0xBAC |
---|
18 | #define PCAPNG_CUSTOM_OPTION_BIN 0xBAD |
---|
19 | #define PCAPNG_CUSTOM_OPTION_UTF8_NONCOPY 0x4BAC |
---|
20 | #define PCAPNG_CUSTOM_OPTION_BIN_NONCOPY 0x4BAD |
---|
21 | |
---|
22 | |
---|
23 | #define PCAPNG_OPTION_END 0x0000 |
---|
24 | #define PCAPNG_OPTION_COMMENT 1 |
---|
25 | /* Custom option code containing a UTF-8 string */ |
---|
26 | #define PCAPNG_OPTION_CUSTOM_1 2988 |
---|
27 | /* Custom option code containing binary octets */ |
---|
28 | #define PCAPNG_OPTION_CUSTOM_2 2989 |
---|
29 | /* Custom option code containing a UTF-8 string |
---|
30 | * Should not be copied to a new file if manipulated */ |
---|
31 | #define PCAPNG_OPTION_CUSTOM_3 19372 |
---|
32 | /* Custom option code containing binary octets |
---|
33 | * Should not be copied to a new file if manipulated */ |
---|
34 | #define PCAPNG_OPTION_CUSTOM_4 19373 |
---|
35 | |
---|
36 | #define PACKET_IS_SECTION (pcapng_get_record_type(packet) == PCAPNG_SECTION__TYPE) |
---|
37 | #define PACKET_IS_INTERFACE (pcapng_get_record_type(packet) == PCAPNG_INTERFACE_TYPE) |
---|
38 | #define PACKET_IS_OLD (pcapng_get_record_type(packet) == PCAPNG_OLD_PACKET_TYPE) |
---|
39 | #define PACKET_IS_SIMPLE (pcapng_get_record_type(packet) == PCAPNG_SIMPLE_PACKET_TYPE) |
---|
40 | #define PACKET_IS_NAME_RESOLUTION (pcapng_get_record_type(packet) == PCAPNG_NAME_RESOLUTION_TYPE) |
---|
41 | #define PACKET_IS_INTERFACE_STATS_TYPE (pcapng_get_record_type(packet) == PCAPNG_INTERFACE_STATS_TYPE) |
---|
42 | #define PACKET_IS_ENHANCED (pcapng_get_record_type(packet) == PCAPNG_ENHANCED_PACKET_TYPE) |
---|
43 | #define PACKET_IS_CUSTOM_TYPE (pcapng_get_record_type(packet) == PCAPNG_CUSTOM_TYPE) |
---|
44 | #define PCAPNG_IS_CUSTOM_NONCOPY_TYPE (pcapng_get_record_type(packet) == PCAPNG_CUSTOM_NONCOPY_TYPE) |
---|
45 | #define PCAPNG_DECRYPTION_SECRETS_TYPE (pcapng_get_record_type(packet) == PCAPNG_DECRYPTION_SECRETS_TYPE) |
---|
46 | |
---|
47 | #define PCAPNG_IFOPT_TSRESOL 9 |
---|
48 | |
---|
49 | #define PCAPNG_PKTOPT_DROPCOUNT 4 |
---|
50 | |
---|
51 | #define PCAPNG_STATOPT_START 2 |
---|
52 | #define PCAPNG_STATOPT_END 3 |
---|
53 | #define PCAPNG_STATOPT_IFRECV 4 |
---|
54 | #define PCAPNG_STATOPT_IFDROP 5 |
---|
55 | #define PCAPNG_STATOPT_FILTERACCEPT 6 |
---|
56 | #define PCAPNG_STATOPT_OSDROP 7 |
---|
57 | #define PCAPNG_STATOPT_USRDELIV 8 |
---|
58 | |
---|
59 | /* PCAPNG meta tag type codes */ |
---|
60 | /* SHB - Section header block */ |
---|
61 | #define PCAPNG_META_SHB_HARDWARE 2 |
---|
62 | #define PCAPNG_META_SHB_OS 3 |
---|
63 | #define PCAPNG_META_SHB_USERAPPL 4 |
---|
64 | /* Interface description block */ |
---|
65 | #define PCAPNG_META_IF_NAME 2 |
---|
66 | #define PCAPNG_META_IF_DESCR 3 |
---|
67 | #define PCAPNG_META_IF_IP4 4 |
---|
68 | #define PCAPNG_META_IF_IP6 5 |
---|
69 | #define PCAPNG_META_IF_MAC 6 |
---|
70 | #define PCAPNG_META_IF_EUI 7 |
---|
71 | #define PCAPNG_META_IF_SPEED 8 |
---|
72 | #define PCAPNG_META_IF_TSRESOL 9 |
---|
73 | #define PCAPNG_META_IF_TZONE 10 |
---|
74 | #define PCAPNG_META_IF_FILTER 11 |
---|
75 | #define PCAPNG_META_IF_OS 12 |
---|
76 | #define PCAPNG_META_IF_FCSLEN 13 |
---|
77 | #define PCAPNG_META_IF_TSOFFSET 14 |
---|
78 | #define PCAPNG_META_IF_HARDWARE 15 |
---|
79 | /* Enhanced block */ |
---|
80 | #define PCAPNG_META_EPB_FLAGS 2 |
---|
81 | #define PCAPNG_META_EPB_HASH 3 |
---|
82 | #define PCAPNG_META_EPB_DROPCOUNT 4 |
---|
83 | /* Name Resolution block */ |
---|
84 | #define PCAPNG_META_NRB_RECORD_END 0x0000 |
---|
85 | #define PCAPNG_META_NRB_RECORD_IP4 0x0001 |
---|
86 | #define PCAPNG_META_NRB_RECORD_IP6 0x0002 |
---|
87 | #define PCAPNG_META_NS_DNSNAME 2 |
---|
88 | #define PCAPNG_META_NS_DNS_IP4_ADDR 3 |
---|
89 | #define PCAPNG_META_NS_DNS_IP6_ADDR 4 |
---|
90 | /* Interface stats block */ |
---|
91 | #define PCAPNG_META_ISB_STARTTIME 2 |
---|
92 | #define PCAPNG_META_ISB_ENDTIME 3 |
---|
93 | #define PCAPNG_META_ISB_IFRECV 4 |
---|
94 | #define PCAPNG_META_ISB_IFDROP 5 |
---|
95 | #define PCAPNG_META_ISB_FILTERACCEPT 6 |
---|
96 | #define PCAPNG_META_ISB_OSDROP 7 |
---|
97 | #define PCAPNG_META_ISB_USRDELIV 8 |
---|
98 | |
---|
99 | void *pcapng_get_meta_section(libtrace_packet_t *packet, uint32_t section); |
---|
100 | void *pcapng_get_meta_section_option(libtrace_packet_t *packet, uint32_t section, |
---|
101 | uint16_t option); |
---|