aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap-int.h
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-01-25 20:17:21 -0500
committerMichael Mann <mmann78@netscape.net>2016-02-23 00:39:38 +0000
commit08d49ff2e06cb35dc9084735aa60c83686afdd9c (patch)
tree93d55773a42d4a1cf64b6544c6e2f3ec03ef4f4e /wiretap/wtap-int.h
parent37acf433dbb2ef1d443c9ee09a315b0b4ce136d8 (diff)
Making wiretap option blocks more generic.
This was inspired by https://code.wireshark.org/review/9729/, but takes it in a different direction where all options are put into an array, regardless of whether they are "standard" or "custom". It should be easier to add "custom" options in this design. Some, but not all blocks have been converted. Descriptions of some of the block options have been moved from wtap.h to pcapng.h as it seems to be the one that implements the description of the blocks. Also what could be added/refactored is registering block behavior. Change-Id: I3dffa38f0bb088f98749a4f97a3b7655baa4aa6a Reviewed-on: https://code.wireshark.org/review/13667 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/wtap-int.h')
-rw-r--r--wiretap/wtap-int.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h
index 332d836c57..89726ece9e 100644
--- a/wiretap/wtap-int.h
+++ b/wiretap/wtap-int.h
@@ -31,6 +31,7 @@
#include <wsutil/file_util.h>
#include "wtap.h"
+#include "wtap_opttypes.h"
WS_DLL_PUBLIC
int wtap_fstat(wtap *wth, ws_statb64 *statb, int *err);
@@ -39,6 +40,7 @@ typedef gboolean (*subtype_read_func)(struct wtap*, int*, char**, gint64*);
typedef gboolean (*subtype_seek_read_func)(struct wtap*, gint64,
struct wtap_pkthdr *, Buffer *buf,
int *, char **);
+
/**
* Struct holding data of the currently read file.
*/
@@ -49,9 +51,9 @@ struct wtap {
guint snapshot_length;
struct Buffer *frame_buffer;
struct wtap_pkthdr phdr;
- struct wtapng_section_s shb_hdr;
+ wtap_optionblock_t shb_hdr;
GArray *interface_data; /**< An array holding the interface data from pcapng IDB:s or equivalent(?)*/
- wtapng_name_res_t *nrb_hdr; /**< holds the Name Res Block's comment/custom_opts, or NULL */
+ wtap_optionblock_t nrb_hdr; /**< holds the Name Res Block's comment/custom_opts, or NULL */
void *priv; /* this one holds per-file state and is free'd automatically by wtap_close() */
void *wslua_data; /* this one holds wslua state info and is not free'd */
@@ -112,8 +114,8 @@ struct wtap_dumper {
* e.g. WTAP_TSPREC_USEC
*/
addrinfo_lists_t *addrinfo_lists; /**< Struct containing lists of resolved addresses */
- wtapng_section_t *shb_hdr;
- wtapng_name_res_t *nrb_hdr; /**< name resolution comment/custom_opt, or NULL */
+ wtap_optionblock_t shb_hdr;
+ wtap_optionblock_t nrb_hdr; /**< name resolution comment/custom_opt, or NULL */
GArray *interface_data; /**< An array holding the interface data from pcapng IDB:s or equivalent(?) NULL if not present.*/
};