diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-05-24 13:57:11 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-05-24 20:57:57 +0000 |
commit | 1b6cc6320ee8d07293b3741738ee601bc86ba068 (patch) | |
tree | f35044e157310e4207ddbd0fca6c090b8770268a /wiretap/pcapng_module.h | |
parent | 6db77b000fe58173eeed23b91b32c92c681feda2 (diff) | |
download | wireshark-1b6cc6320ee8d07293b3741738ee601bc86ba068.tar.gz |
Add support for plugins to handle pcap-ng block types.
We rename "file format" plugins to "libwiretap" plugins, as they can
register as read handlers for a new file type, read/write handlers for a
pcap-ng block type (or both).
To register as a pcap-ng block type handler, in the
register_wtap_module() routine of your plugin, call
register_pcapng_block_type_handler() with the pcap-ng block type and
pointers to your routines to read and write those blocks. Those
routines should read and write REC_TYPE_FILE_TYPE_SPECIFIC records, with
the block type in the pseudo-header for the record in the struct
wtap_pkthdr structure, with time stamps stored in that structure, and
with a blob of data for the rest of the record.
This is for bug 8590.
Change-Id: I71847d834854a29ceb85894fd094c2ae91a04273
Reviewed-on: https://code.wireshark.org/review/1775
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/pcapng_module.h')
-rw-r--r-- | wiretap/pcapng_module.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/wiretap/pcapng_module.h b/wiretap/pcapng_module.h new file mode 100644 index 0000000000..226a8dd7b1 --- /dev/null +++ b/wiretap/pcapng_module.h @@ -0,0 +1,40 @@ +/* pcap_module.h + * + * Wiretap Library + * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __PCAP_MODULE_H__ +#define __PCAP_MODULE_H__ + +/* + * Reader and writer routines for pcap-ng block types. + */ +typedef gboolean (*block_reader)(FILE_T, int, gboolean, struct wtap_pkthdr *, + Buffer *, int *, gchar **); +typedef gboolean (*block_writer)(wtap_dumper *, const struct wtap_pkthdr *, + const guint8 *, int *); + +/* + * Register a handler for a pcap-ng block type. + */ +WS_DLL_PUBLIC +void register_pcapng_block_type_handler(guint block_type, block_reader read, + block_writer write); + +#endif /* __PCAP_MODULE_H__ */ + |