From 01e08ae582b9e01bd5d236e748f43b4a2cedee43 Mon Sep 17 00:00:00 2001 From: Jakub Zawadzki Date: Tue, 3 Dec 2013 20:35:50 +0000 Subject: wiretap: start using svn path=/trunk/; revision=53764 --- wiretap/nettl.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'wiretap/nettl.c') diff --git a/wiretap/nettl.c b/wiretap/nettl.c index 6c0d9e11c2..ee193592d9 100644 --- a/wiretap/nettl.c +++ b/wiretap/nettl.c @@ -384,11 +384,11 @@ nettl_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, if (file_seek(fh, hdr_len, SEEK_CUR, err) == -1) return FALSE; - if ( (pntohl(&rec_hdr.kind) & NETTL_HDR_PDU_MASK) == 0 ) { + if ( (pntoh32(&rec_hdr.kind) & NETTL_HDR_PDU_MASK) == 0 ) { /* not actually a data packet (PDU) trace record */ phdr->pkt_encap = WTAP_ENCAP_NETTL_RAW_IP; - length = pntohl(&rec_hdr.length); - caplen = pntohl(&rec_hdr.caplen); + length = pntoh32(&rec_hdr.length); + caplen = pntoh32(&rec_hdr.caplen); padlen = 0; } else switch (subsys) { case NETTL_SUBSYS_LAN100 : @@ -452,12 +452,12 @@ nettl_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, phdr->pkt_encap = WTAP_ENCAP_NETTL_ETHERNET; } - length = pntohl(&rec_hdr.length); - caplen = pntohl(&rec_hdr.caplen); + length = pntoh32(&rec_hdr.length); + caplen = pntoh32(&rec_hdr.caplen); /* HPPB FDDI has different inbound vs outbound trace records */ if (subsys == NETTL_SUBSYS_HPPB_FDDI) { - if (pntohl(&rec_hdr.kind) == NETTL_HDR_PDUIN) { + if (pntoh32(&rec_hdr.kind) == NETTL_HDR_PDUIN) { /* inbound is very strange... there are an extra 3 bytes after the DSAP and SSAP for SNAP frames ??? @@ -523,8 +523,8 @@ nettl_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, return FALSE; } - length = pntohs(&drv_eth_hdr.length); - caplen = pntohs(&drv_eth_hdr.caplen); + length = pntoh16(&drv_eth_hdr.length); + caplen = pntoh16(&drv_eth_hdr.caplen); /* * XXX - is there a length field that would give the length * of this header, so that we don't have to check for @@ -559,8 +559,8 @@ nettl_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, * And is "from_dce" at xxa[0] in the nettlrec_hdr structure? */ phdr->pkt_encap = WTAP_ENCAP_NETTL_X25; - length = pntohl(&rec_hdr.length); - caplen = pntohl(&rec_hdr.caplen); + length = pntoh32(&rec_hdr.length); + caplen = pntoh32(&rec_hdr.caplen); padlen = 24; /* sizeof (struct nettlrec_sx25l2_hdr) - NETTL_REC_HDR_LEN + 4 */ if (file_seek(fh, padlen, SEEK_CUR, err) == -1) return FALSE; @@ -571,8 +571,8 @@ nettl_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, subsystem -- We'll probably spew junks and core if it isn't... */ wth->file_encap = WTAP_ENCAP_PER_PACKET; phdr->pkt_encap = WTAP_ENCAP_NETTL_ETHERNET; - length = pntohl(&rec_hdr.length); - caplen = pntohl(&rec_hdr.caplen); + length = pntoh32(&rec_hdr.length); + caplen = pntoh32(&rec_hdr.caplen); padlen = 0; break; } @@ -593,14 +593,14 @@ nettl_read_rec(wtap *wth, FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, } datalen = caplen - padlen; phdr->caplen = datalen; - phdr->ts.secs = pntohl(&rec_hdr.sec); - phdr->ts.nsecs = pntohl(&rec_hdr.usec) * 1000; + phdr->ts.secs = pntoh32(&rec_hdr.sec); + phdr->ts.nsecs = pntoh32(&rec_hdr.usec) * 1000; pseudo_header->nettl.subsys = subsys; - pseudo_header->nettl.devid = pntohl(&rec_hdr.devid); - pseudo_header->nettl.kind = pntohl(&rec_hdr.kind); - pseudo_header->nettl.pid = pntohl(&rec_hdr.pid); - pseudo_header->nettl.uid = pntohs(&rec_hdr.uid); + pseudo_header->nettl.devid = pntoh32(&rec_hdr.devid); + pseudo_header->nettl.kind = pntoh32(&rec_hdr.kind); + pseudo_header->nettl.pid = pntoh32(&rec_hdr.pid); + pseudo_header->nettl.uid = pntoh16(&rec_hdr.uid); if (phdr->caplen > WTAP_MAX_PACKET_SIZE) { /* -- cgit v1.2.1