diff options
author | Guy Harris <guy@alum.mit.edu> | 2009-09-25 21:55:39 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2009-09-25 21:55:39 +0000 |
commit | 7be78a2d55ae1aacf0c3e11325e14dd54770cb0e (patch) | |
tree | ea9942697022aedacf7b73bf326de70420b6ddd8 /wiretap/libpcap.c | |
parent | 3a92e1e456ac6a2cbcd4e145584131a1e685d608 (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/libpcap.c')
-rw-r--r-- | wiretap/libpcap.c | 39 |
1 files changed, 12 insertions, 27 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; } |