TODO SMB2 NegotiateContext....
[metze/wireshark/wip.git] / wiretap / pcapng.h
1 /* pcapng.h
2  *
3  * Wiretap Library
4  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8
9 #ifndef __W_PCAPNG_H__
10 #define __W_PCAPNG_H__
11
12 #include <glib.h>
13 #include "wtap.h"
14 #include "ws_symbol_export.h"
15
16 #define PCAPNG_MAGIC         0x1A2B3C4D
17 #define PCAPNG_SWAPPED_MAGIC 0xD4C3B2A1
18
19 #define PCAPNG_MAJOR_VERSION 1
20 #define PCAPNG_MINOR_VERSION 0
21
22 /* pcapng: common block header file encoding for every block type */
23 typedef struct pcapng_block_header_s {
24     guint32 block_type;
25     guint32 block_total_length;
26     /* x bytes block_body */
27     /* guint32 block_total_length */
28 } pcapng_block_header_t;
29
30 /* pcapng: section header block file encoding */
31 typedef struct pcapng_section_header_block_s {
32     /* pcapng_block_header_t */
33     guint32 magic;
34     guint16 version_major;
35     guint16 version_minor;
36     guint64 section_length; /* might be -1 for unknown */
37     /* ... Options ... */
38 } pcapng_section_header_block_t;
39
40 /* pcapng: interface description block file encoding */
41 typedef struct pcapng_interface_description_block_s {
42     guint16 linktype;
43     guint16 reserved;
44     guint32 snaplen;
45     /* ... Options ... */
46 } pcapng_interface_description_block_t;
47
48 /* pcapng: interface statistics block file encoding */
49 typedef struct pcapng_interface_statistics_block_s {
50     guint32 interface_id;
51     guint32 timestamp_high;
52     guint32 timestamp_low;
53     /* ... Options ... */
54 } pcapng_interface_statistics_block_t;
55
56 struct pcapng_option_header {
57     guint16 type;
58     guint16 value_length;
59 };
60
61 /*
62  * Minimum IDB size = minimum block size + size of fixed length portion of IDB.
63  */
64 #define MIN_IDB_SIZE    ((guint32)(MIN_BLOCK_SIZE + sizeof(pcapng_interface_description_block_t)))
65
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);
69
70 #endif