summaryrefslogtreecommitdiff
path: root/epan/epan.c
diff options
context:
space:
mode:
authorChristopher Kilgour <techie@whiterocker.com>2014-02-23 17:30:57 -0800
committerAnders Broman <a.broman58@gmail.com>2014-03-20 09:54:01 +0000
commit7b13a3b0f6a5617e0e352f87cc5a20afea226aa8 (patch)
tree774432cd1876744b5038ea291f10b012bd7f8288 /epan/epan.c
parentf65513291333b5912a16b45bfa09eed05eee3a6d (diff)
downloadwireshark-7b13a3b0f6a5617e0e352f87cc5a20afea226aa8.tar.gz
Allow pcapng interface options to be available to dissectors.
Interface options[1], and more generally pcapng options[2], are useful information that can provide improved dissector output. Prior to this change, only certain pcapng interface options were interpreted and made available to dissectors, e.g. the interface name or description. This change augments the situation by providing epan_get_interface_option( ), which returns an array of byte arrays if the option code exists (otherwise NULL). Each element of the array is a byte buffer containing the raw data of the option. An array-of-buffers is used because pcapng allows for multiple instances of the same option to be present in the file. All interface options found in a pcapng file are thus made available to the dissector. The implementation also provides infrastructure to collect options from other pcapng blocks such as the section header. Currently these options are discarded, but could be retained in the future to support more features. [1] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionidb [2] http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html#sectionopt Change-Id: I944b6f0f03dde9b8e7d1348b76acde6f9d312f37 Reviewed-on: https://code.wireshark.org/review/331 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/epan.c')
-rw-r--r--epan/epan.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/epan/epan.c b/epan/epan.c
index e83864121d..4426981b2f 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -178,6 +178,15 @@ epan_get_interface_name(const epan_t *session, guint32 interface_id)
return NULL;
}
+const GArray *
+epan_get_interface_option(const epan_t *session, guint32 interface_id, guint16 option_code)
+{
+ if (session->get_interface_option)
+ return session->get_interface_option(session->data, interface_id, option_code);
+
+ return NULL;
+}
+
const nstime_t *
epan_get_frame_ts(const epan_t *session, guint32 frame_num)
{