aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-11-30 16:30:19 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-01 00:31:03 +0000
commit846bb5394812c39359dfdbbf7e8755a7e3cf5326 (patch)
tree70dcf5a08a04abe66c1ef766ce15c634e87a6cf2 /wiretap/wtap.h
parent35b1bc5ec61260bc1890a2c991cdb7218946ae1f (diff)
Add a Buffer to wtap_pkthdr to hold file-type-specific packet metadata.
For example, this can be used for pcap-ng options not mapped to file-type-independent metadata values. Change-Id: I398b324c62c1cc1cc61eb5e9631de00481b4aadc Reviewed-on: https://code.wireshark.org/review/5549 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/wtap.h')
-rw-r--r--wiretap/wtap.h37
1 files changed, 23 insertions, 14 deletions
diff --git a/wiretap/wtap.h b/wiretap/wtap.h
index 26c6c9e477..55b35448c3 100644
--- a/wiretap/wtap.h
+++ b/wiretap/wtap.h
@@ -1007,20 +1007,21 @@ union wtap_pseudo_header {
#define REC_TYPE_FT_SPECIFIC_REPORT 2 /**< file-type-specific report */
struct wtap_pkthdr {
- guint rec_type; /* what type of record is this? */
- guint32 presence_flags; /* what stuff do we have? */
- nstime_t ts;
- guint32 caplen; /* data length in the file */
- guint32 len; /* data length on the wire */
- int pkt_encap; /* WTAP_ENCAP_ value for this packet */
- int pkt_tsprec; /* WTAP_TSPREC_ value for this packet */
- /* pcapng variables */
- guint32 interface_id; /* identifier of the interface. */
- /* options */
- gchar *opt_comment; /* NULL if not available */
- guint64 drop_count; /* number of packets lost (by the interface and the
- operating system) between this packet and the preceding one. */
- guint32 pack_flags; /* XXX - 0 for now (any value for "we don't have it"?) */
+ guint rec_type; /* what type of record is this? */
+ guint32 presence_flags; /* what stuff do we have? */
+ nstime_t ts; /* time stamp */
+ guint32 caplen; /* data length in the file */
+ guint32 len; /* data length on the wire */
+ int pkt_encap; /* WTAP_ENCAP_ value for this packet */
+ int pkt_tsprec; /* WTAP_TSPREC_ value for this packet */
+ /* pcapng variables */
+ guint32 interface_id; /* identifier of the interface. */
+ /* options */
+ gchar *opt_comment; /* NULL if not available */
+ guint64 drop_count; /* number of packets lost (by the interface and the
+ operating system) between this packet and the preceding one. */
+ guint32 pack_flags; /* XXX - 0 for now (any value for "we don't have it"?) */
+ Buffer ft_specific_data; /* file-type specific data */
union wtap_pseudo_header pseudo_header;
};
@@ -1464,6 +1465,14 @@ struct wtap_pkthdr *wtap_phdr(wtap *wth);
WS_DLL_PUBLIC
guint8 *wtap_buf_ptr(wtap *wth);
+/*** initialize a wtap_pkthdr structure ***/
+WS_DLL_PUBLIC
+void wtap_phdr_init(struct wtap_pkthdr *phdr);
+
+/*** clean up a wtap_pkthdr structure, freeing what wtap_phdr_init() allocated */
+WS_DLL_PUBLIC
+void wtap_phdr_cleanup(struct wtap_pkthdr *phdr);
+
/*** get various information snippets about the current file ***/
/** Return an approximation of the amount of data we've read sequentially