aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-09-25 21:55:39 +0000
committerGuy Harris <guy@alum.mit.edu>2009-09-25 21:55:39 +0000
commit7be78a2d55ae1aacf0c3e11325e14dd54770cb0e (patch)
treeea9942697022aedacf7b73bf326de70420b6ddd8 /wiretap
parent3a92e1e456ac6a2cbcd4e145584131a1e685d608 (diff)
Treat 13 as if it came from OpenBSD except on BSD/OS, so that if there
are any BSD/OS users still out there using Wireshark to read RFC 1483 ATM captures from BSD/OS, they can still do so, but all other users get to read OpenBSD DLT_ENC captures, not just users *on* OpenBSD. That also lets us simplify some hacks to deal with a link-layer type of 13 on Nokia IPSO captures. svn path=/trunk/; revision=30159
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/libpcap.c39
-rw-r--r--wiretap/pcap-common.c10
2 files changed, 20 insertions, 29 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index c9a94c13cc..e961750a8d 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -230,18 +230,8 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
}
}
- /*
- * We treat a DLT_ value of 13 specially - it appears that in
- * Nokia libpcap format, it's some form of ATM with what I
- * suspect is a pseudo-header (even though Nokia's IPSO is
- * based on FreeBSD, which #defines DLT_SLIP_BSDOS as 13).
- *
- * We don't yet know whether this is a Nokia capture, so if
- * "wtap_pcap_encap_to_wtap_encap()" returned WTAP_ENCAP_UNKNOWN
- * but "hdr.network" is 13, we don't treat that as an error yet.
- */
file_encap = wtap_pcap_encap_to_wtap_encap(hdr.network);
- if (file_encap == WTAP_ENCAP_UNKNOWN && hdr.network != 13) {
+ if (file_encap == WTAP_ENCAP_UNKNOWN) {
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
*err_info = g_strdup_printf("pcap: network type %u unknown or unsupported",
hdr.network);
@@ -481,22 +471,17 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
}
}
- if (hdr.network == 13) {
- /*
- * OK, if this was a Nokia capture, make it
- * WTAP_ENCAP_ATM_PDUS, otherwise return
- * an error.
- */
- if (wth->file_type == WTAP_FILE_PCAP_NOKIA)
- wth->file_encap = WTAP_ENCAP_ATM_PDUS;
- else {
- *err = WTAP_ERR_UNSUPPORTED_ENCAP;
- *err_info = g_strdup_printf("pcap: network type %u unknown or unsupported",
- hdr.network);
- g_free(wth->capture.pcap);
- return -1;
- }
- }
+ /*
+ * We treat a DLT_ value of 13 specially - it appears that in
+ * Nokia libpcap format, it's some form of ATM with what I
+ * suspect is a pseudo-header (even though Nokia's IPSO is
+ * based on FreeBSD, which #defines DLT_SLIP_BSDOS as 13).
+ *
+ * If this is a Nokia capture, treat 13 as WTAP_ENCAP_ATM_PDUS,
+ * rather than as what we normally treat it.
+ */
+ if (wth->file_type == WTAP_FILE_PCAP_NOKIA && hdr.network == 13)
+ wth->file_encap = WTAP_ENCAP_ATM_PDUS;
return 1;
}
diff --git a/wiretap/pcap-common.c b/wiretap/pcap-common.c
index e872745b44..a7b830cbd2 100644
--- a/wiretap/pcap-common.c
+++ b/wiretap/pcap-common.c
@@ -443,11 +443,17 @@ static const struct {
* 13 is DLT_ATM_RFC1483 on BSD/OS.
*
* 13 is DLT_ENC in OpenBSD, which is, I suspect, some kind
- * of decrypted IPSEC traffic.
+ * of decrypted IPsec traffic.
+ *
+ * We treat 13 as WTAP_ENCAP_ENC on all systems except those
+ * that define DLT_ATM_RFC1483 as 13 - presumably only
+ * BSD/OS does so - so that, on BSD/OS systems, we still
+ * treate 13 as WTAP_ENCAP_ATM_RFC1483, but, on all other
+ * systems, we can read OpenBSD DLT_ENC captures.
*/
#if defined(DLT_ATM_RFC1483) && (DLT_ATM_RFC1483 == 13)
{ 13, WTAP_ENCAP_ATM_RFC1483 },
-#elif defined(DLT_ENC) && (DLT_ENC == 13)
+#else
{ 13, WTAP_ENCAP_ENC },
#endif