4 * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
6 * SPDX-License-Identifier: GPL-2.0-or-later
10 #define __W_PCAPNG_H__
14 #include "ws_symbol_export.h"
16 #define PCAPNG_MAGIC 0x1A2B3C4D
17 #define PCAPNG_SWAPPED_MAGIC 0xD4C3B2A1
19 #define PCAPNG_MAJOR_VERSION 1
20 #define PCAPNG_MINOR_VERSION 0
22 /* pcapng: common block header file encoding for every block type */
23 typedef struct pcapng_block_header_s {
25 guint32 block_total_length;
26 /* x bytes block_body */
27 /* guint32 block_total_length */
28 } pcapng_block_header_t;
30 /* pcapng: section header block file encoding */
31 typedef struct pcapng_section_header_block_s {
32 /* pcapng_block_header_t */
34 guint16 version_major;
35 guint16 version_minor;
36 guint64 section_length; /* might be -1 for unknown */
38 } pcapng_section_header_block_t;
40 /* pcapng: interface description block file encoding */
41 typedef struct pcapng_interface_description_block_s {
46 } pcapng_interface_description_block_t;
48 /* pcapng: interface statistics block file encoding */
49 typedef struct pcapng_interface_statistics_block_s {
51 guint32 timestamp_high;
52 guint32 timestamp_low;
54 } pcapng_interface_statistics_block_t;
56 struct pcapng_option_header {
62 * Minimum IDB size = minimum block size + size of fixed length portion of IDB.
64 #define MIN_IDB_SIZE ((guint32)(MIN_BLOCK_SIZE + sizeof(pcapng_interface_description_block_t)))
66 wtap_open_return_val pcapng_open(wtap *wth, int *err, gchar **err_info);
67 gboolean pcapng_dump_open(wtap_dumper *wdh, int *err);
68 int pcapng_dump_can_write_encap(int encap);