packet-dcerpc: nca_s_fault_sec_pkg_error
[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  * 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.
10  *
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.
15  *
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.
19  */
20
21 #ifndef __W_PCAPNG_H__
22 #define __W_PCAPNG_H__
23
24 #include <glib.h>
25 #include "wtap.h"
26 #include "ws_symbol_export.h"
27
28 /* pcapng: common block header file encoding for every block type */
29 typedef struct pcapng_block_header_s {
30     guint32 block_type;
31     guint32 block_total_length;
32     /* x bytes block_body */
33     /* guint32 block_total_length */
34 } pcapng_block_header_t;
35
36 /* pcapng: section header block file encoding */
37 typedef struct pcapng_section_header_block_s {
38     /* pcapng_block_header_t */
39     guint32 magic;
40     guint16 version_major;
41     guint16 version_minor;
42     guint64 section_length; /* might be -1 for unknown */
43     /* ... Options ... */
44 } pcapng_section_header_block_t;
45
46 /* pcapng: interface description block file encoding */
47 typedef struct pcapng_interface_description_block_s {
48     guint16 linktype;
49     guint16 reserved;
50     guint32 snaplen;
51     /* ... Options ... */
52 } pcapng_interface_description_block_t;
53
54 /* pcapng: interface statistics block file encoding */
55 typedef struct pcapng_interface_statistics_block_s {
56     guint32 interface_id;
57     guint32 timestamp_high;
58     guint32 timestamp_low;
59     /* ... Options ... */
60 } pcapng_interface_statistics_block_t;
61
62 struct pcapng_option_header {
63     guint16 type;
64     guint16 value_length;
65 };
66
67 /*
68  * Minimum IDB size = minimum block size + size of fixed length portion of IDB.
69  */
70 #define MIN_IDB_SIZE    ((guint32)(MIN_BLOCK_SIZE + sizeof(pcapng_interface_description_block_t)))
71
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);
75
76 #endif