diff options
author | Anders Broman <anders.broman@ericsson.com> | 2007-10-27 15:44:12 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2007-10-27 15:44:12 +0000 |
commit | e6fc9efb622e486da3131c563ce2b87818c3b26e (patch) | |
tree | e576aff3ac109fdac8c70555192ac55ede8d96e7 /wiretap/nettl.c | |
parent | a07530ab2beb4ddfef6af4d4f7a04ea3dfd05772 (diff) | |
download | wireshark-e6fc9efb622e486da3131c563ce2b87818c3b26e.tar.gz |
From Mark C. Brown:
Add support for the new NS_LS_SCTP tracing subsystem.
svn path=/trunk/; revision=23290
Diffstat (limited to 'wiretap/nettl.c')
-rw-r--r-- | wiretap/nettl.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/wiretap/nettl.c b/wiretap/nettl.c index eca0c66a92..efe3ff8dab 100644 --- a/wiretap/nettl.c +++ b/wiretap/nettl.c @@ -410,7 +410,16 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, return -1; offset += hdr_len; - switch (subsys) { + if ( ( (pntohl(&rec_hdr.kind) & ~NETTL_HDR_SUBSYSTEM_BITS_MASK) + & (NETTL_HDR_PROCEDURE_TRACE | + NETTL_HDR_STATE_TRACE | + NETTL_HDR_ERROR_TRACE) ) != 0) { + /* not actually a packet trace record */ + phdr->pkt_encap = WTAP_ENCAP_NETTL_RAW_IP; + length = pntohl(&rec_hdr.length); + caplen = pntohl(&rec_hdr.caplen); + padlen = 0; + } else switch (subsys) { case NETTL_SUBSYS_LAN100 : case NETTL_SUBSYS_EISA100BT : case NETTL_SUBSYS_BASE100 : @@ -440,10 +449,12 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, case NETTL_SUBSYS_NS_LS_ICMPV6 : case NETTL_SUBSYS_NS_LS_ICMP : case NETTL_SUBSYS_NS_LS_TELNET : + case NETTL_SUBSYS_NS_LS_SCTP : if( (subsys == NETTL_SUBSYS_NS_LS_IP) || (subsys == NETTL_SUBSYS_NS_LS_LOOPBACK) || (subsys == NETTL_SUBSYS_NS_LS_UDP) || (subsys == NETTL_SUBSYS_NS_LS_TCP) + || (subsys == NETTL_SUBSYS_NS_LS_SCTP) || (subsys == NETTL_SUBSYS_NS_LS_IPV6)) { phdr->pkt_encap = WTAP_ENCAP_NETTL_RAW_IP; } else if (subsys == NETTL_SUBSYS_NS_LS_ICMP) { @@ -506,6 +517,21 @@ nettl_read_rec_header(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, return -1; padlen = 26; offset += padlen; + } else if (subsys == NETTL_SUBSYS_NS_LS_SCTP) { + /* + * SCTP 8 byte header that we will ignore... + * 32 bit integer defines format + * 1 = Log + * 2 = ASCII + * 3 = Binary (PDUs should be Binary format) + * 32 bit integer defines type + * 1 = Inbound + * 2 = Outbound + */ + if (file_seek(fh, 8, SEEK_CUR, err) == -1) + return -1; + padlen = 8; + offset += padlen; } else { padlen = 0; } |