aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/nettl.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-09-04 20:35:29 +0000
committerGuy Harris <guy@alum.mit.edu>2004-09-04 20:35:29 +0000
commita686d1b9539e7a6575c7566cf8ac5997a040ee2e (patch)
tree9b02eed17353d7c41c305aba7325629a244e1306 /wiretap/nettl.c
parent6968bc1c0d170aa29d1675d0e8fbab7568d03bfc (diff)
From Mark C. Brown:
1) Change nettl subsystem ID's to decimal so as to match /etc/nettlgen.conf and ease maintenance 2) Add support for hp_apaport (PAgP), hp_apalacp, and IPv6 subsystem trace records 3) Correct handling of LOOPBACK trace records svn path=/trunk/; revision=11901
Diffstat (limited to 'wiretap/nettl.c')
-rw-r--r--wiretap/nettl.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/wiretap/nettl.c b/wiretap/nettl.c
index c7aa7f18a7..702b0e8f0e 100644
--- a/wiretap/nettl.c
+++ b/wiretap/nettl.c
@@ -302,14 +302,19 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
case NETTL_SUBSYS_NS_LS_LOOPBACK :
case NETTL_SUBSYS_NS_LS_TCP :
case NETTL_SUBSYS_NS_LS_UDP :
+ case NETTL_SUBSYS_HP_APAPORT :
+ case NETTL_SUBSYS_HP_APALACP :
+ case NETTL_SUBSYS_NS_LS_IPV6 :
+ case NETTL_SUBSYS_NS_LS_ICMPV6 :
case NETTL_SUBSYS_NS_LS_ICMP :
if( (encap[3] == NETTL_SUBSYS_NS_LS_IP)
|| (encap[3] == NETTL_SUBSYS_NS_LS_LOOPBACK)
|| (encap[3] == NETTL_SUBSYS_NS_LS_UDP)
- || (encap[3] == NETTL_SUBSYS_NS_LS_TCP) ) {
+ || (encap[3] == NETTL_SUBSYS_NS_LS_TCP)
+ || (encap[3] == NETTL_SUBSYS_NS_LS_ICMP)
+ || (encap[3] == NETTL_SUBSYS_NS_LS_IPV6)
+ || (encap[3] == NETTL_SUBSYS_NS_LS_ICMPV6) ) {
phdr->pkt_encap = WTAP_ENCAP_RAW_IP;
- } else if (encap[3] == NETTL_SUBSYS_NS_LS_ICMP) {
- phdr->pkt_encap = WTAP_ENCAP_UNKNOWN;
} else if (encap[3] == NETTL_SUBSYS_PCI_FDDI) {
phdr->pkt_encap = WTAP_ENCAP_FDDI;
} else if( (encap[3] == NETTL_SUBSYS_PCI_TR)
@@ -371,6 +376,26 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr,
phdr->len = length - 3;
length = pntohl(&ip_hdr.caplen);
phdr->caplen = length - 3;
+ } else if (encap[3] == NETTL_SUBSYS_NS_LS_LOOPBACK) {
+ /* LOOPBACK has an extra 26 bytes of padding */
+ bytes_read = file_read(dummy, 1, 26, fh);
+ if (bytes_read != 26) {
+ *err = file_error(fh);
+ if (*err != 0)
+ return -1;
+ if (bytes_read != 0) {
+ *err = WTAP_ERR_SHORT_READ;
+ return -1;
+ }
+ return 0;
+ }
+ offset += 26;
+ length = pntohl(&ip_hdr.length);
+ if (length <= 0)
+ return 0;
+ phdr->len = length - 26;
+ length = pntohl(&ip_hdr.caplen);
+ phdr->caplen = length - 26;
} else {
length = pntohl(&ip_hdr.length);
if (length <= 0)