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 __PCAP_MODULE_H__
22 #define __PCAP_MODULE_H__
24 /* Block type codes in the file */
25 #define BLOCK_TYPE_IDB 0x00000001 /* Interface Description Block */
26 #define BLOCK_TYPE_PB 0x00000002 /* Packet Block (obsolete) */
27 #define BLOCK_TYPE_SPB 0x00000003 /* Simple Packet Block */
28 #define BLOCK_TYPE_NRB 0x00000004 /* Name Resolution Block */
29 #define BLOCK_TYPE_ISB 0x00000005 /* Interface Statistics Block */
30 #define BLOCK_TYPE_EPB 0x00000006 /* Enhanced Packet Block */
31 #define BLOCK_TYPE_SYSDIG_EVENT 0x00000204 /* Sysdig Event Block */
32 #define BLOCK_TYPE_SYSDIG_EVF 0x00000208 /* Sysdig Event Block with flags */
33 #define BLOCK_TYPE_SHB 0x0A0D0D0A /* Section Header Block */
34 /* TODO: the following are not yet well defined in the draft spec:
39 * Traffic Statistics and Monitoring Blocks
40 * Event/Security Block
44 * Reader and writer routines for pcap-ng block types.
46 typedef gboolean (*block_reader)(FILE_T, guint32, gboolean, struct wtap_pkthdr *,
47 Buffer *, int *, gchar **);
48 typedef gboolean (*block_writer)(wtap_dumper *, const struct wtap_pkthdr *,
49 const guint8 *, int *);
52 * Register a handler for a pcap-ng block type.
55 void register_pcapng_block_type_handler(guint block_type, block_reader read,
59 * Handler routine for pcap-ng option type.
61 typedef gboolean (*option_handler_fn)(gboolean, guint, guint8 *, int *, gchar **);
64 * Register a handler for a pcap-ng option code for a particular block
68 void register_pcapng_option_handler(guint block_type, guint option_code,
69 option_handler_fn hfunc);
71 #endif /* __PCAP_MODULE_H__ */