diff options
author | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-29 18:59:06 +0000 |
---|---|---|
committer | Jakub Zawadzki <darkjames-ws@darkjames.pl> | 2013-11-29 18:59:06 +0000 |
commit | 5ac6474c945133a8415fb3be917859e5d42b6256 (patch) | |
tree | ee20c73dfaf23171bd739a6a3d7558db0f451097 /epan/dissectors | |
parent | 288efa5128341fab8907f3a2969a0bed95ae65cf (diff) |
Rename some of pint.h macros to match common style (bits number on the end).
pntohs -> pntoh16
pntohl -> pntoh32
pletohs -> pletoh16
pletohl -> pletoh32
phtons -> phton16
phtonl -> phton32
svn path=/trunk/; revision=53652
Diffstat (limited to 'epan/dissectors')
27 files changed, 49 insertions, 49 deletions
diff --git a/epan/dissectors/packet-ap1394.c b/epan/dissectors/packet-ap1394.c index b9836e739f..67af76528d 100644 --- a/epan/dissectors/packet-ap1394.c +++ b/epan/dissectors/packet-ap1394.c @@ -60,7 +60,7 @@ capture_ap1394(const guchar *pd, int offset, int len, packet_counts *ld) /* Skip destination and source addresses */ offset += 16; - etype = pntohs(&pd[offset]); + etype = pntoh16(&pd[offset]); offset += 2; capture_ethertype(etype, pd, offset, len, ld); } diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index d1a6028ab9..a9b253dd9a 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -1147,11 +1147,11 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, { call_dissector(llc_handle, next_tvb, pinfo, tree); } - else if ((pntohs(octet) & 0xff) == PPP_IP) + else if ((pntoh16(octet) & 0xff) == PPP_IP) { call_dissector(ppp_handle, next_tvb, pinfo, tree); } - else if (pntohs(octet) == 0x00) + else if (pntoh16(octet) == 0x00) { /* assume vc muxed bridged ethernet */ proto_tree_add_text(tree, tvb, 0, 2, "Pad: 0x0000"); diff --git a/epan/dissectors/packet-chdlc.c b/epan/dissectors/packet-chdlc.c index d126166370..384046a6e5 100644 --- a/epan/dissectors/packet-chdlc.c +++ b/epan/dissectors/packet-chdlc.c @@ -113,7 +113,7 @@ capture_chdlc( const guchar *pd, int offset, int len, packet_counts *ld ) { ld->other++; return; } - switch (pntohs(&pd[offset + 2])) { + switch (pntoh16(&pd[offset + 2])) { case ETHERTYPE_IP: capture_ip(pd, offset + 4, len, ld); break; diff --git a/epan/dissectors/packet-cipsafety.c b/epan/dissectors/packet-cipsafety.c index 01e414b7c4..d436f01c16 100644 --- a/epan/dissectors/packet-cipsafety.c +++ b/epan/dissectors/packet-cipsafety.c @@ -1460,7 +1460,7 @@ static void dissect_cip_safety_data( proto_tree *tree, proto_item *item, tvbuff_t *tvb, int item_length, packet_info *pinfo) { int base_length, io_data_size; - gboolean multicast = (((pntohl(pinfo->dst.data)) & 0xf0000000) == 0xe0000000); + gboolean multicast = (((pntoh32(pinfo->dst.data)) & 0xf0000000) == 0xe0000000); gboolean server_dir = FALSE; enum enip_connid_type conn_type = ECIDT_UNKNOWN; enum cip_safety_format_type format = CIP_SAFETY_BASE_FORMAT; diff --git a/epan/dissectors/packet-enc.c b/epan/dissectors/packet-enc.c index 0ffffaad45..b45a151ee4 100644 --- a/epan/dissectors/packet-enc.c +++ b/epan/dissectors/packet-enc.c @@ -76,7 +76,7 @@ capture_enc(const guchar *pd, int len, packet_counts *ld) return; } - af = pntohl(pd + offsetof(struct enchdr, af)); + af = pntoh32(pd + offsetof(struct enchdr, af)); switch (af) { case BSD_AF_INET: diff --git a/epan/dissectors/packet-esis.c b/epan/dissectors/packet-esis.c index 7dd41a9836..9b2d24a805 100644 --- a/epan/dissectors/packet-esis.c +++ b/epan/dissectors/packet-esis.c @@ -327,12 +327,12 @@ dissect_esis(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { (ehdr.esis_type&BIT_7) ? "1" : "0", (ehdr.esis_type&BIT_6) ? "1" : "0"); - tmp_uint = pntohs( ehdr.esis_holdtime ); + tmp_uint = pntoh16( ehdr.esis_holdtime ); proto_tree_add_uint_format_value(esis_tree, hf_esis_holdtime, tvb, 5, 2, tmp_uint, "%u seconds", tmp_uint ); - tmp_uint = pntohs( ehdr.esis_checksum ); + tmp_uint = pntoh16( ehdr.esis_checksum ); switch (calc_checksum( tvb, 0, ehdr.esis_length, tmp_uint )) { diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index b6c89c28a7..fe0861e226 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -133,7 +133,7 @@ capture_eth(const guchar *pd, int offset, int len, packet_counts *ld) return; } - etype = pntohs(&pd[offset+12]); + etype = pntoh16(&pd[offset+12]); if (etype <= IEEE_802_3_MAX_LEN) { /* Oh, yuck. Cisco ISL frames require special interpretation of the diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c index d76df034d7..368bdb8be6 100644 --- a/epan/dissectors/packet-giop.c +++ b/epan/dissectors/packet-giop.c @@ -1954,9 +1954,9 @@ static gboolean try_heuristic_giop_dissector(tvbuff_t *tvb, packet_info *pinfo, gboolean stream_is_big_endian = is_big_endian (header); if (stream_is_big_endian) - message_size = pntohl (&header->message_size); + message_size = pntoh32 (&header->message_size); else - message_size = pletohl (&header->message_size); + message_size = pletoh32 (&header->message_size); if (*offset > message_size) return FALSE; diff --git a/epan/dissectors/packet-gmhdr.c b/epan/dissectors/packet-gmhdr.c index a78b524ee7..285e37ea4a 100644 --- a/epan/dissectors/packet-gmhdr.c +++ b/epan/dissectors/packet-gmhdr.c @@ -371,7 +371,7 @@ dissect_gmtrailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void vec.ptr = tvb_get_ptr(tvb, offset, vec.len); comp_cksum = in_cksum(&vec, 1); - if (pntohs(&comp_cksum) != cksum) { + if (pntoh16(&comp_cksum) != cksum) { return 0; } } diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c index cb122b7f40..8eacd7a752 100644 --- a/epan/dissectors/packet-h245.c +++ b/epan/dissectors/packet-h245.c @@ -3739,7 +3739,7 @@ dissect_h245_T_unsignedMin(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ gefx = gef_ctx_get(actx->private_data); if (gefx) { buf = (guint8 *)wmem_new(actx->pinfo->pool, guint16); - phtons(buf, value); + phton16(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ add_new_data_source(actx->pinfo, value_tvb, "unsignedMin"); @@ -3766,7 +3766,7 @@ dissect_h245_T_unsignedMax(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ gefx = gef_ctx_get(actx->private_data); if (gefx) { buf = (guint8 *)wmem_new(actx->pinfo->pool, guint16); - phtons(buf, value); + phton16(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint16), sizeof(guint16)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ add_new_data_source(actx->pinfo, value_tvb, "unsignedMax"); @@ -3793,7 +3793,7 @@ dissect_h245_T_unsigned32Min(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx gefx = gef_ctx_get(actx->private_data); if (gefx) { buf = (guint8 *)wmem_new(actx->pinfo->pool, guint32); - phtonl(buf, value); + phton32(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ add_new_data_source(actx->pinfo, value_tvb, "unsigned32Min"); @@ -3820,7 +3820,7 @@ dissect_h245_T_unsigned32Max(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx gefx = gef_ctx_get(actx->private_data); if (gefx) { buf = (guint8 *)wmem_new(actx->pinfo->pool, guint32); - phtonl(buf, value); + phton32(buf, value); value_tvb = tvb_new_child_real_data(tvb, buf, sizeof(guint32), sizeof(guint32)); /* DEBUG */ /*proto_tree_add_text(tree, tvb, offset>>3, 0, "*** DEBUG dissector_try_string: %s", gefx->key);*/ add_new_data_source(actx->pinfo, value_tvb, "unsigned32Max"); diff --git a/epan/dissectors/packet-ieee80211-prism.c b/epan/dissectors/packet-ieee80211-prism.c index b7e7fbaaea..ed8fa6fe65 100644 --- a/epan/dissectors/packet-ieee80211-prism.c +++ b/epan/dissectors/packet-ieee80211-prism.c @@ -244,7 +244,7 @@ capture_prism(const guchar *pd, int offset, int len, packet_counts *ld) } /* Some captures with DLT_PRISM have the AVS WLAN header */ - cookie = pntohl(pd); + cookie = pntoh32(pd); if ((cookie == WLANCAP_MAGIC_COOKIE_V1) || (cookie == WLANCAP_MAGIC_COOKIE_V2)) { capture_wlancap(pd, offset, len, ld); diff --git a/epan/dissectors/packet-ieee80211-radiotap-iter.c b/epan/dissectors/packet-ieee80211-radiotap-iter.c index c2f8635d63..a0a7711ddc 100644 --- a/epan/dissectors/packet-ieee80211-radiotap-iter.c +++ b/epan/dissectors/packet-ieee80211-radiotap-iter.c @@ -35,8 +35,8 @@ #define le16_to_cpu GINT16_FROM_LE #define le32_to_cpu GINT32_FROM_LE -#define get_unaligned_le16 pletohs -#define get_unaligned_le32 pletohl +#define get_unaligned_le16 pletoh16 +#define get_unaligned_le32 pletoh32 #include "packet-ieee80211-radiotap-iter.h" diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index 98ea388ae9..db50f25348 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -880,7 +880,7 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld) return; } hdr = (struct ieee80211_radiotap_header *)pd; - it_len = pletohs(&hdr->it_len); + it_len = pletoh16(&hdr->it_len); if (!BYTES_ARE_IN_FRAME(offset, len, it_len)) { ld->other++; return; @@ -898,7 +898,7 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld) return; } - present = pletohl(&hdr->it_present); + present = pletoh32(&hdr->it_present); offset += (int)sizeof(struct ieee80211_radiotap_header); it_len -= (int)sizeof(struct ieee80211_radiotap_header); @@ -909,7 +909,7 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld) ld->other++; return; } - xpresent = pletohl(pd + offset); + xpresent = pletoh32(pd + offset); offset += 4; it_len -= 4; } @@ -1058,7 +1058,7 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) ENC_NA); for (i = 0; i < n_bitmaps; i++) { - guint32 bmap = pletohl(bmap_start + 4 * i); + guint32 bmap = pletoh32(bmap_start + 4 * i); rtap_ns_offset = rtap_ns_offset_next; rtap_ns_offset_next += 32; diff --git a/epan/dissectors/packet-ieee80211-wlancap.c b/epan/dissectors/packet-ieee80211-wlancap.c index 7b9c8c9b34..4f898f62f8 100644 --- a/epan/dissectors/packet-ieee80211-wlancap.c +++ b/epan/dissectors/packet-ieee80211-wlancap.c @@ -75,7 +75,7 @@ capture_wlancap(const guchar *pd, int offset, int len, packet_counts *ld) return; } - length = pntohl(pd+sizeof(guint32)); + length = pntoh32(pd+sizeof(guint32)); if (!BYTES_ARE_IN_FRAME(offset, len, length)) { ld->other++; diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 216aa87273..21f2cc574b 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -4815,7 +4815,7 @@ capture_ieee80211_common (const guchar * pd, int offset, int len, return; } - fcf = pletohs (&pd[offset]); + fcf = pletoh16 (&pd[offset]); if (IS_PROTECTED(FCF_FLAGS(fcf)) && (wlan_ignore_wep == WLAN_IGNORE_WEP_NO)) { ld->other += 1; @@ -4841,7 +4841,7 @@ capture_ieee80211_common (const guchar * pd, int offset, int len, guint8 mesh_flags = pd[hdr_length]; guint16 qosoff = hdr_length - 2; qosoff -= (is_ht ? 4 : 0); - if (has_mesh_control(fcf, pletohs(&pd[qosoff]), mesh_flags)) { + if (has_mesh_control(fcf, pletoh16(&pd[qosoff]), mesh_flags)) { hdr_length += find_mesh_control_length(mesh_flags); } } diff --git a/epan/dissectors/packet-ieee8021ah.c b/epan/dissectors/packet-ieee8021ah.c index 7b1e767601..8ad9c309a4 100644 --- a/epan/dissectors/packet-ieee8021ah.c +++ b/epan/dissectors/packet-ieee8021ah.c @@ -86,7 +86,7 @@ capture_ieee8021ah(const guchar *pd, int offset, int len, packet_counts *ld) ld->other++; return; } - encap_proto = pntohs( &pd[offset + IEEE8021AH_LEN - 2] ); + encap_proto = pntoh16( &pd[offset + IEEE8021AH_LEN - 2] ); if (encap_proto <= IEEE_802_3_MAX_LEN) { if ( pd[offset + IEEE8021AH_LEN] == 0xff && pd[offset + IEEE8021AH_LEN + 1] == 0xff ) { diff --git a/epan/dissectors/packet-ixiatrailer.c b/epan/dissectors/packet-ixiatrailer.c index bebba40642..a106575c42 100644 --- a/epan/dissectors/packet-ixiatrailer.c +++ b/epan/dissectors/packet-ixiatrailer.c @@ -114,7 +114,7 @@ dissect_ixiatrailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, voi vec.len = trailer_length + 3; vec.ptr = tvb_get_ptr(tvb, offset, vec.len); comp_cksum = in_cksum(&vec, 1); - if (pntohs(&comp_cksum) != cksum) { + if (pntoh16(&comp_cksum) != cksum) { return 0; } diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c index 7818e43fd4..6fe9f4f14b 100644 --- a/epan/dissectors/packet-k12.c +++ b/epan/dissectors/packet-k12.c @@ -90,7 +90,7 @@ fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint32 length) { guint adj = 0; /* 0x11=control frame 0x30=data frame */ - guint info_type = pntohs(extra_info); + guint info_type = pntoh16(extra_info); /* 1=FDD, 2=TDD 3.84, 3=TDD 1.28 */ guchar radio_mode = extra_info[14]; guchar channel_type = 0; @@ -103,7 +103,7 @@ fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint32 length) p_fp_info->division = (enum division_type)radio_mode; /* Format used by K15, later fields are shifted by 8 bytes. */ - if (pntohs(extra_info+2) == 5) + if (pntoh16(extra_info+2) == 5) adj = 8; p_fp_info->iface_type = IuB_Interface; @@ -172,10 +172,10 @@ fill_fp_info(fp_info *p_fp_info, guchar *extra_info, guint32 length) /* For each channel */ for (i = 0; i < (guint)p_fp_info->num_chans && (36+i*104+adj) <= length; ++i) { /* Read TB size */ - p_fp_info->chan_tf_size[i] = pntohl(extra_info+28+i*104+adj); + p_fp_info->chan_tf_size[i] = pntoh32(extra_info+28+i*104+adj); if (p_fp_info->chan_tf_size[i]) /* Work out number of TBs on this channel */ - p_fp_info->chan_num_tbs[i] = pntohl(extra_info+32+i*104+adj) + p_fp_info->chan_num_tbs[i] = pntoh32(extra_info+32+i*104+adj) / p_fp_info->chan_tf_size[i]; } } diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c index afa3e05905..415f34368a 100644 --- a/epan/dissectors/packet-llc.c +++ b/epan/dissectors/packet-llc.c @@ -353,7 +353,7 @@ capture_snap(const guchar *pd, int offset, int len, packet_counts *ld) } oui = pd[offset] << 16 | pd[offset+1] << 8 | pd[offset+2]; - etype = pntohs(&pd[offset+3]); + etype = pntoh16(&pd[offset+3]); switch (oui) { case OUI_ENCAP_ETHER: diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c index 29e12a318c..efc834eec6 100644 --- a/epan/dissectors/packet-ppi.c +++ b/epan/dissectors/packet-ppi.c @@ -392,18 +392,18 @@ capture_ppi(const guchar *pd, int len, packet_counts *ld) guint offset = PPI_V0_HEADER_LEN; gboolean is_htc = FALSE; - ppi_len = pletohs(pd+2); + ppi_len = pletoh16(pd+2); if(ppi_len < PPI_V0_HEADER_LEN || !BYTES_ARE_IN_FRAME(0, len, ppi_len)) { ld->other++; return; } - dlt = pletohl(pd+4); + dlt = pletoh32(pd+4); /* Figure out if we're +HTC */ while (offset < ppi_len) { - data_type = pletohs(pd+offset); - data_len = pletohs(pd+offset+2) + 4; + data_type = pletoh16(pd+offset); + data_len = pletoh16(pd+offset+2) + 4; offset += data_len; if (data_type == PPI_80211N_MAC || data_type == PPI_80211N_MAC_PHY) { diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c index 4c4887c459..3f3be3c0b2 100644 --- a/epan/dissectors/packet-ppp.c +++ b/epan/dissectors/packet-ppp.c @@ -1734,7 +1734,7 @@ capture_ppp_hdlc(const guchar *pd, int offset, int len, packet_counts *ld) ld->other++; return; } - switch (pntohs(&pd[offset + 2])) { + switch (pntoh16(&pd[offset + 2])) { case PPP_IP: capture_ip(pd, offset + 4, len, ld); break; diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index d13ffd742e..f2ad3ca325 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -3560,8 +3560,8 @@ find_rpc_over_tcp_reply_start(tvbuff_t *tvb, int offset) /* got a match in zero-fill region, verify reply ID and * record mark fields */ - ulMsgType = pntohl (pbWholeBuf + ibSearchStart - 4); - ulRecMark = pntohl (pbWholeBuf + ibSearchStart - ibPatternStart); + ulMsgType = pntoh32 (pbWholeBuf + ibSearchStart - 4); + ulRecMark = pntoh32 (pbWholeBuf + ibSearchStart - ibPatternStart); if ((ulMsgType == RPC_REPLY) && ((ulRecMark & ~0x80000000) <= (unsigned) max_rpc_tcp_pdu_size)) { diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c index 3fdc645a63..de972ec7c4 100644 --- a/epan/dissectors/packet-rtmpt.c +++ b/epan/dissectors/packet-rtmpt.c @@ -2013,7 +2013,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_ id = id & 0x3f; if (id==0) id = tf->saved.d[1] + 64; - else if (id==1) id = pletohs(tf->saved.d+1) + 64; + else if (id==1) id = pletoh16(tf->saved.d+1) + 64; } /* Calculate header values, defaulting from previous packets with same id */ @@ -2021,7 +2021,7 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_ if (id<=RTMPT_ID_MAX) ti = (rtmpt_id_t *)wmem_tree_lookup32(rconv->ids[cdir], id); if (ti) tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(ti->packets, seq+offset-1); - if (header_type==0) src = tf ? pntohl(tf->saved.d+basic_hlen+7) : tvb_get_ntohl(tvb, offset+basic_hlen+7); + if (header_type==0) src = tf ? pntoh32(tf->saved.d+basic_hlen+7) : tvb_get_ntohl(tvb, offset+basic_hlen+7); else if (ti) src = ti->src; else src = 0; @@ -2069,13 +2069,13 @@ dissect_rtmpt_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rtmpt_ if (header_type==0) { ts = tf ? pntoh24(tf->saved.d+basic_hlen) : tvb_get_ntoh24(tvb, offset+basic_hlen); if (ts==0xffffff) { - ts = tf ? pntohl(tf->saved.d+basic_hlen+11) : tvb_get_ntohl(tvb, offset+basic_hlen+11); + ts = tf ? pntoh32(tf->saved.d+basic_hlen+11) : tvb_get_ntohl(tvb, offset+basic_hlen+11); } tsd = ts - ti->ts; } else if (header_type<3) { tsd = tf ? pntoh24(tf->saved.d+basic_hlen) : tvb_get_ntoh24(tvb, offset+basic_hlen); if (tsd==0xffffff) { - ts = tf ? pntohl(tf->saved.d+basic_hlen+message_hlen-4) : tvb_get_ntohl(tvb, offset+basic_hlen+message_hlen-4); + ts = tf ? pntoh32(tf->saved.d+basic_hlen+message_hlen-4) : tvb_get_ntohl(tvb, offset+basic_hlen+message_hlen-4); tsd = ti->tsd; /* questionable */ } else { ts = ti->ts + tsd; diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c index e2cef0e148..5f4d61c34a 100644 --- a/epan/dissectors/packet-sll.c +++ b/epan/dissectors/packet-sll.c @@ -146,7 +146,7 @@ capture_sll(const guchar *pd, int len, packet_counts *ld) ld->other++; return; } - protocol = pntohs(&pd[14]); + protocol = pntoh16(&pd[14]); if (protocol <= 1536) { /* yes, 1536 - that's how Linux does it */ /* * "proto" is *not* a length field, it's a Linux internal diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c index 5e61797bac..63b7e0d5fe 100644 --- a/epan/dissectors/packet-tr.c +++ b/epan/dissectors/packet-tr.c @@ -243,7 +243,7 @@ capture_tr(const guchar *pd, int offset, int len, packet_counts *ld) { */ if (!source_routed && trn_rif_bytes > 0) { if (pd[offset + 0x0e] != pd[offset + 0x0f]) { - first2_sr = pntohs(&pd[offset + 0xe0 + trn_rif_bytes]); + first2_sr = pntoh16(&pd[offset + 0xe0 + trn_rif_bytes]); if ( (first2_sr == 0xaaaa && pd[offset + 0x10 + trn_rif_bytes] == 0x03) || diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c index 951219f31c..b075b2b925 100644 --- a/epan/dissectors/packet-vlan.c +++ b/epan/dissectors/packet-vlan.c @@ -106,7 +106,7 @@ capture_vlan(const guchar *pd, int offset, int len, packet_counts *ld ) { ld->other++; return; } - encap_proto = pntohs( &pd[offset+2] ); + encap_proto = pntoh16( &pd[offset+2] ); if ( encap_proto <= IEEE_802_3_MAX_LEN) { if ( pd[offset+4] == 0xff && pd[offset+5] == 0xff ) { capture_ipx(ld); diff --git a/epan/dissectors/packet-wcp.c b/epan/dissectors/packet-wcp.c index c18044adf6..9d411d3e27 100644 --- a/epan/dissectors/packet-wcp.c +++ b/epan/dissectors/packet-wcp.c @@ -522,7 +522,7 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin offset, 3, ENC_NA); sub_tree = proto_item_add_subtree(ti, ett_wcp_field); proto_tree_add_uint(sub_tree, hf_wcp_offset, src_tvb, - offset, 2, pntohs(src)); + offset, 2, pntoh16(src)); proto_tree_add_item( sub_tree, hf_wcp_long_len, src_tvb, offset+2, 1, ENC_BIG_ENDIAN); @@ -537,7 +537,7 @@ static tvbuff_t *wcp_uncompress( tvbuff_t *src_tvb, int offset, packet_info *pin proto_tree_add_uint( sub_tree, hf_wcp_short_len, src_tvb, offset, 1, *src); proto_tree_add_uint(sub_tree, hf_wcp_offset, src_tvb, - offset, 2, pntohs(src)); + offset, 2, pntoh16(src)); } src += 2; offset += 2; |