diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-02-15 14:46:30 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-02-15 22:47:03 +0000 |
commit | fea325d2ba86cee47bb6bf89a068906744701c88 (patch) | |
tree | 403c99ed077e31fee09090b2ce689e8ed8aac0b7 /wiretap | |
parent | 1917023fc157b896a23349c0eca8c95f22f2fb6f (diff) |
Handle DLT_LOOP differently from DLT_NULL.
That's a little cleaner, and lets us preserve the LINKTYPE_ value for
DLT_LOOP captures. ("Preserve" here doesn't mean "write files with a
link-layer header type of 12", as that's ambiguous; we write it with a
link-layer header type of LINKTYPE_LOOP, i.e. 108. If programs on
OpenBSD don't recognize that as DLT_LOOP, that's a bug in OpenBSD's
libpcap or in the program.)
Change-Id: I48a2e04aed41c013823ffb5c588d2a8e8b376e15
Reviewed-on: https://code.wireshark.org/review/7143
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/pcap-common.c | 10 | ||||
-rw-r--r-- | wiretap/wtap.c | 5 | ||||
-rw-r--r-- | wiretap/wtap.h | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c index 3f4a25a599..5fb0be384f 100644 --- a/wiretap/pcap-common.c +++ b/wiretap/pcap-common.c @@ -206,7 +206,7 @@ static const struct { { 105, WTAP_ENCAP_IEEE_802_11 }, /* IEEE 802.11 */ { 106, WTAP_ENCAP_LINUX_ATM_CLIP }, { 107, WTAP_ENCAP_FRELAY }, /* Frame Relay */ - { 108, WTAP_ENCAP_NULL }, /* OpenBSD loopback */ + { 108, WTAP_ENCAP_LOOP }, /* OpenBSD loopback */ { 109, WTAP_ENCAP_ENC }, /* OpenBSD IPSEC enc */ #if 0 { 110, WTAP_ENCAP_LANE_802_3 },/* ATM LANE 802.3 */ @@ -481,12 +481,12 @@ static const struct { * (it's just like DLT_NULL, only with the AF_ value in network * rather than host byte order - Wireshark figures out the * byte order from the data, so we don't care what byte order - * it's in), so if DLT_LOOP is defined as 12, interpret 12 - * as WTAP_ENCAP_NULL, otherwise, unless DLT_C_HDLC is defined - * as 12, interpret it as WTAP_ENCAP_RAW_IP. + * it's in), so, on OpenBSD, interpret 12 as WTAP_ENCAP_LOOP, + * otherwise, if we're not on BSD/OS, interpret it as + * WTAP_ENCAP_RAW_IP. */ #if defined(__OpenBSD__) - { 12, WTAP_ENCAP_NULL }, + { 12, WTAP_ENCAP_LOOP }, #elif defined(__bsdi__) /* BSD/OS */ /* * Put entry for Cisco HDLC here. diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 6dc8a5c150..6b0cf92610 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -259,7 +259,7 @@ static struct encap_type_info encap_table_base[] = { { "ATM PDUs - untruncated", "atm-pdus-untruncated" }, /* WTAP_ENCAP_NULL */ - { "NULL", "null" }, + { "NULL/Loopback", "null" }, /* WTAP_ENCAP_ASCEND */ { "Lucent/Ascend access equipment", "ascend" }, @@ -737,6 +737,9 @@ static struct encap_type_info encap_table_base[] = { /* WTAP_ENCAP_IPMI_TRACE */ { "IPMI Trace Data Collection", "ipmi-trace" }, + + /* WTAP_ENCAP_LOOP */ + { "OpenBSD loopback", "loop" }, }; WS_DLL_LOCAL diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 348d3a9495..1570466579 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -265,6 +265,7 @@ extern "C" { #define WTAP_ENCAP_PKTAP 172 #define WTAP_ENCAP_EPON 173 #define WTAP_ENCAP_IPMI_TRACE 174 +#define WTAP_ENCAP_LOOP 175 /* After adding new item here, please also add new item to encap_table_base array */ #define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types() |