diff options
author | Michael Mann <mmann78@netscape.net> | 2014-12-21 08:02:26 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-12-26 21:17:10 +0000 |
commit | 3d3f97320b90296bdb3649929bcc73a55823dee9 (patch) | |
tree | 4b906cf0a1e6e25371fc6eecbef89461d90c0cff /epan/dissectors/packet-lldp.c | |
parent | b68fb9b659b0debd7286195f9ad194be998cc3ff (diff) |
Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-lldp.c')
-rw-r--r-- | epan/dissectors/packet-lldp.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index 3bd0ca3c0f..6efcf1c5d6 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -1104,7 +1104,6 @@ dissect_lldp_chassis_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui guint16 tempShort; guint32 dataLen = 0; const char *strPtr=NULL; - guint32 ip_addr = 0; struct e_in6_addr ip6_addr; guint8 addr_family = 0; @@ -1177,15 +1176,14 @@ dissect_lldp_chassis_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui switch(addr_family){ case AFNUM_INET: if (dataLen == 6){ - ip_addr = tvb_get_ipv4(tvb, offset); - strPtr = ip_to_str((guint8 *)&ip_addr); + strPtr = tvb_ip_to_str(tvb, offset); }else{ expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, "Invalid Chassis ID Length (%u) for Type (%s, %s), expected (6)", dataLen, val_to_str_const(tlvsubType, chassis_id_subtypes, ""), val_to_str_const(addr_family, afn_vals, "")); return -1; } - proto_tree_add_ipv4(chassis_tree, hf_chassis_id_ip4, tvb, offset, 4, ip_addr); + proto_tree_add_item(chassis_tree, hf_chassis_id_ip4, tvb, offset, 4, ENC_BIG_ENDIAN); break; case AFNUM_INET6: @@ -1264,7 +1262,6 @@ dissect_lldp_port_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint3 guint16 tempShort; guint32 dataLen = 0; const char *strPtr=NULL; - guint32 ip_addr = 0; struct e_in6_addr ip6_addr; guint8 addr_family = 0; @@ -1333,15 +1330,14 @@ dissect_lldp_port_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint3 switch(addr_family){ case AFNUM_INET: if (dataLen == 6){ - ip_addr = tvb_get_ipv4(tvb, offset); - strPtr = ip_to_str((guint8 *)&ip_addr); + strPtr = tvb_ip_to_str(tvb, offset); }else{ expert_add_info_format(pinfo, lf, &ei_lldp_bad_length, "Invalid Port ID Length (%u) for Type (%s, %s), expected (6)", dataLen, val_to_str_const(tlvsubType, port_id_subtypes, ""), val_to_str_const(addr_family, afn_vals, "")); return -1; } - proto_tree_add_ipv4(port_tree, hf_port_id_ip4, tvb, offset, 4, ip_addr); + proto_tree_add_item(port_tree, hf_port_id_ip4, tvb, offset, 4, ENC_BIG_ENDIAN); break; case AFNUM_INET6: |