9#ifndef __PCAP_MODULE_H__
10#define __PCAP_MODULE_H__
14#include "ws_symbol_export.h"
27#define BLOCK_TYPE_SHB 0x0A0D0D0A
28#define BLOCK_TYPE_IDB 0x00000001
29#define BLOCK_TYPE_PB 0x00000002
30#define BLOCK_TYPE_SPB 0x00000003
31#define BLOCK_TYPE_NRB 0x00000004
32#define BLOCK_TYPE_ISB 0x00000005
33#define BLOCK_TYPE_EPB 0x00000006
34#define BLOCK_TYPE_IRIG_TS 0x00000007
35#define BLOCK_TYPE_ARINC_429 0x00000008
36#define BLOCK_TYPE_SYSTEMD_JOURNAL_EXPORT 0x00000009
37#define BLOCK_TYPE_DSB 0x0000000A
38#define BLOCK_TYPE_HP_MIB 0x00000101
39#define BLOCK_TYPE_HP_CEB 0x00000102
40#define BLOCK_TYPE_SYSDIG_MI 0x00000201
41#define BLOCK_TYPE_SYSDIG_PL_V1 0x00000202
42#define BLOCK_TYPE_SYSDIG_FDL_V1 0x00000203
43#define BLOCK_TYPE_SYSDIG_EVENT 0x00000204
44#define BLOCK_TYPE_SYSDIG_IL_V1 0x00000205
45#define BLOCK_TYPE_SYSDIG_UL_V1 0x00000206
46#define BLOCK_TYPE_SYSDIG_PL_V2 0x00000207
47#define BLOCK_TYPE_SYSDIG_EVF 0x00000208
48#define BLOCK_TYPE_SYSDIG_PL_V3 0x00000209
49#define BLOCK_TYPE_SYSDIG_PL_V4 0x00000210
50#define BLOCK_TYPE_SYSDIG_PL_V5 0x00000211
51#define BLOCK_TYPE_SYSDIG_PL_V6 0x00000212
52#define BLOCK_TYPE_SYSDIG_PL_V7 0x00000213
53#define BLOCK_TYPE_SYSDIG_PL_V8 0x00000214
54#define BLOCK_TYPE_SYSDIG_PL_V9 0x00000215
55#define BLOCK_TYPE_SYSDIG_EVENT_V2 0x00000216
56#define BLOCK_TYPE_SYSDIG_EVF_V2 0x00000217
57#define BLOCK_TYPE_SYSDIG_FDL_V2 0x00000218
58#define BLOCK_TYPE_SYSDIG_IL_V2 0x00000219
59#define BLOCK_TYPE_SYSDIG_UL_V2 0x00000220
60#define BLOCK_TYPE_SYSDIG_EVENT_V2_LARGE 0x00000221
61#define BLOCK_TYPE_SYSDIG_EVF_V2_LARGE 0x00000222
62#define BLOCK_TYPE_CB_COPY 0x00000BAD
63#define BLOCK_TYPE_CB_NO_COPY 0x40000BAD
106#define BT_INDEX_SHB 0
107#define BT_INDEX_IDB 1
108#define BT_INDEX_PBS 2
109#define BT_INDEX_NRB 3
110#define BT_INDEX_ISB 4
111#define BT_INDEX_EVT 5
112#define BT_INDEX_DSB 6
114#define NUM_BT_INDICES 7
119typedef bool (*block_reader)(
wtap* wth,
FILE_T fh, uint32_t block_size,
120 uint32_t block_content_size,
123 int *err,
char **err_info);
125 int *err,
char **err_info);
133 block_processor processor;
147typedef bool (*option_parser)(
wtap_block_t block,
bool byte_swapped,
148 unsigned option_length,
149 const uint8_t *option_content,
150 int *err,
char **err_info);
151typedef uint32_t (*option_sizer)(
unsigned option_id,
wtap_optval_t *optval);
152typedef bool (*option_writer)(
wtap_dumper *wdh,
unsigned option_id,
160void register_pcapng_option_handler(
unsigned block_type,
unsigned option_code,
161 option_parser parser,
163 option_writer writer);
180 OPT_SECTION_BYTE_ORDER,
183} pcapng_opt_byte_order_e;
194 unsigned opt_cont_buf_len,
200 pcapng_opt_byte_order_e byte_order,
201 int *err,
char **err_info);
209 uint16_t option_code, uint16_t option_length,
210 const uint8_t *option_content);
215 pcapng_opt_byte_order_e byte_order,
216 uint16_t option_code, uint16_t option_length,
217 const uint8_t *option_content);
222 pcapng_opt_byte_order_e byte_order,
223 uint16_t option_code, uint16_t option_length,
224 const uint8_t *option_content);
229 pcapng_opt_byte_order_e byte_order,
230 uint16_t option_code, uint16_t option_length,
231 const uint8_t *option_content);
236 pcapng_opt_byte_order_e byte_order,
237 uint16_t option_code, uint16_t option_length,
238 const uint8_t *option_content);
241void pcapng_process_string_option(
wtapng_block_t *wblock, uint16_t option_code,
242 uint16_t option_length,
const uint8_t *option_content);
245void pcapng_process_bytes_option(
wtapng_block_t *wblock, uint16_t option_code,
246 uint16_t option_length,
const uint8_t *option_content);
253 compute_option_size_func compute_option_size;
257uint32_t pcapng_compute_options_size(
wtap_block_t block, compute_option_size_func compute_option_size);
261 wtap_opttype_e option_type,
263 int *err,
char **err_info);
266bool pcapng_write_options(
wtap_dumper *wdh, pcapng_opt_byte_order_e byte_order,
268 int *err,
char **err_info);
275 int* err,
char** err_info);
278 const uint8_t* value, uint16_t length);
282 custom_option_parser parser;
283 custom_option_processor processor;
301bool pcapng_write_block_header(
wtap_dumper *wdh, uint32_t block_type,
302 uint32_t block_content_length,
int *err);
308pcapng_write_padding(
wtap_dumper *wdh,
size_t pad,
int *err)
311 const uint32_t zero_pad = 0;
312 if (!wtap_dump_file_write(wdh, &zero_pad, pad, err))
323bool pcapng_write_block_footer(
wtap_dumper *wdh, uint32_t block_content_length,
340void *pcapng_get_cb_section_info_data(
section_info_t *section_info,
349void *pcapng_get_lb_section_info_data(
section_info_t *section_info,
Definition pcapng_module.h:251
Definition pcapng_module.h:129
Definition pcapng_module.h:281
Definition pcapng_module.h:330
Definition pcapng_module.h:89
uint16_t version_major
Definition pcapng_module.h:91
int64_t shb_off
Definition pcapng_module.h:94
uint16_t version_minor
Definition pcapng_module.h:92
GHashTable * local_block_data
Definition pcapng_module.h:96
GHashTable * custom_block_data
Definition pcapng_module.h:95
GArray * interfaces
Definition pcapng_module.h:93
bool byte_swapped
Definition pcapng_module.h:90
Definition wtap_opttypes.h:228
Definition file_wrappers.c:215
Definition pcapng_module.h:77
Definition wtap_opttypes.h:458