diff options
author | Michael Mann <mmann78@netscape.net> | 2016-03-04 08:52:48 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-03-06 12:53:36 +0000 |
commit | f2de3c7778c8712ddeef877055db4cba82a9b40a (patch) | |
tree | d255ae50f4120d28efae497c5aeac0657e3af290 /wiretap/pcapng.h | |
parent | 32d60ac2f55f38f2d29a57fea8be008432846367 (diff) |
Improve wiretap block capabilities.
Make a more formal method for registering options within a block and do it all with a single function (wtap_optionblock_add_block).
Add ability for block to be able to write itself, refactored out of pcapng.c. This was implemented for SHB, ISB, and IDB blocks. Name resolution (NRB), while possible, seemed a little messy for the moment.
Change-Id: Ie855c8550c7c7d96cfc188c0cd90bfbc4d5f0ee8
Reviewed-on: https://code.wireshark.org/review/14357
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'wiretap/pcapng.h')
-rw-r--r-- | wiretap/pcapng.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/wiretap/pcapng.h b/wiretap/pcapng.h index 7827a83482..49a896a0f4 100644 --- a/wiretap/pcapng.h +++ b/wiretap/pcapng.h @@ -112,6 +112,50 @@ #define OPT_ISB_OSDROP 0x0007 #define OPT_ISB_USRDELIV 0x0008 +/* pcapng: common block header file encoding for every block type */ +typedef struct pcapng_block_header_s { + guint32 block_type; + guint32 block_total_length; + /* x bytes block_body */ + /* guint32 block_total_length */ +} pcapng_block_header_t; + +/* pcapng: section header block file encoding */ +typedef struct pcapng_section_header_block_s { + /* pcapng_block_header_t */ + guint32 magic; + guint16 version_major; + guint16 version_minor; + guint64 section_length; /* might be -1 for unknown */ + /* ... Options ... */ +} pcapng_section_header_block_t; + +/* pcapng: interface description block file encoding */ +typedef struct pcapng_interface_description_block_s { + guint16 linktype; + guint16 reserved; + guint32 snaplen; + /* ... Options ... */ +} pcapng_interface_description_block_t; + +/* pcapng: interface statistics block file encoding */ +typedef struct pcapng_interface_statistics_block_s { + guint32 interface_id; + guint32 timestamp_high; + guint32 timestamp_low; + /* ... Options ... */ +} pcapng_interface_statistics_block_t; + +struct pcapng_option_header { + guint16 type; + guint16 value_length; +}; + +/* + * Minimum IDB size = minimum block size + size of fixed length portion of IDB. + */ +#define MIN_IDB_SIZE ((guint32)(MIN_BLOCK_SIZE + sizeof(pcapng_interface_description_block_t))) + wtap_open_return_val pcapng_open(wtap *wth, int *err, gchar **err_info); gboolean pcapng_dump_open(wtap_dumper *wdh, int *err); int pcapng_dump_can_write_encap(int encap); |