4 * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef __W_PCAPNG_H__
22 #define __W_PCAPNG_H__
26 #include "ws_symbol_export.h"
28 /* pcapng: common block header file encoding for every block type */
29 typedef struct pcapng_block_header_s {
31 guint32 block_total_length;
32 /* x bytes block_body */
33 /* guint32 block_total_length */
34 } pcapng_block_header_t;
36 /* pcapng: section header block file encoding */
37 typedef struct pcapng_section_header_block_s {
38 /* pcapng_block_header_t */
40 guint16 version_major;
41 guint16 version_minor;
42 guint64 section_length; /* might be -1 for unknown */
44 } pcapng_section_header_block_t;
46 /* pcapng: interface description block file encoding */
47 typedef struct pcapng_interface_description_block_s {
52 } pcapng_interface_description_block_t;
54 /* pcapng: interface statistics block file encoding */
55 typedef struct pcapng_interface_statistics_block_s {
57 guint32 timestamp_high;
58 guint32 timestamp_low;
60 } pcapng_interface_statistics_block_t;
62 struct pcapng_option_header {
68 * Minimum IDB size = minimum block size + size of fixed length portion of IDB.
70 #define MIN_IDB_SIZE ((guint32)(MIN_BLOCK_SIZE + sizeof(pcapng_interface_description_block_t)))
72 wtap_open_return_val pcapng_open(wtap *wth, int *err, gchar **err_info);
73 gboolean pcapng_dump_open(wtap_dumper *wdh, int *err);
74 int pcapng_dump_can_write_encap(int encap);