diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2018-08-28 21:13:15 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2018-08-29 19:36:43 +0000 |
commit | 9d9a873d9a4b71b12623afeff1bd46fbfa7eb211 (patch) | |
tree | 50d6199c3df2794c22c2da1a42b1537d81271028 /epan/dissectors/packet-vines.c | |
parent | 389339cab294b1200ce9139e34c517150bb1cd9c (diff) |
Make AT_VINES a built-in type
Change-Id: I5c11cf4c7bee1b2b7072a6a0db5344a6b8a569ac
Reviewed-on: https://code.wireshark.org/review/29326
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/dissectors/packet-vines.c')
-rw-r--r-- | epan/dissectors/packet-vines.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c index c14f103461..e59fb4f47b 100644 --- a/epan/dissectors/packet-vines.c +++ b/epan/dissectors/packet-vines.c @@ -254,8 +254,6 @@ static int hf_vines_icp_packet_type = -1; static gint ett_vines_icp = -1; -static int vines_address_type = -1; - /* VINES IP structs and definitions */ enum { @@ -548,9 +546,9 @@ dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data val_to_str_const(vip_tctl, proto_vals, "Unknown VIP protocol"), vip_tctl); - set_address_tvb(&pinfo->net_src, vines_address_type, VINES_ADDR_LEN, tvb, offset+12); + set_address_tvb(&pinfo->net_src, AT_VINES, VINES_ADDR_LEN, tvb, offset+12); copy_address_shallow(&pinfo->src, &pinfo->net_src); - set_address_tvb(&pinfo->net_dst, vines_address_type, VINES_ADDR_LEN, tvb, offset+6); + set_address_tvb(&pinfo->net_dst, AT_VINES, VINES_ADDR_LEN, tvb, offset+6); copy_address_shallow(&pinfo->dst, &pinfo->net_dst); /* helpers to transport control */ @@ -609,29 +607,6 @@ dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data return tvb_captured_length(tvb); } -static int vines_to_str(const address* addr, gchar *buf, int buf_len _U_) -{ - const guint8 *addr_data = (const guint8 *)addr->data; - gchar *bufp = buf; - - bufp = dword_to_hex(bufp, pntoh32(&addr_data[0])); /* 8 bytes */ - *bufp++ = '.'; /* 1 byte */ - bufp = word_to_hex(bufp, pntoh16(&addr_data[4])); /* 4 bytes */ - *bufp++ = '\0'; /* NULL terminate */ - - return (int)(bufp - buf); -} - -static int vines_str_len(const address* addr _U_) -{ - return 14; -} - -static int vines_len(void) -{ - return VINES_ADDR_LEN; -} - void proto_register_vines_ip(void) { @@ -713,8 +688,6 @@ proto_register_vines_ip(void) vines_ip_handle = create_dissector_handle(dissect_vines_ip, proto_vines_ip); - - vines_address_type = address_type_dissector_register("AT_VINES", "Banyan Vines address", vines_to_str, vines_str_len, NULL, NULL, vines_len, NULL, NULL); } void @@ -1246,7 +1219,7 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat if (packet_type == VARP_ASSIGNMENT_RESP) { col_append_fstr(pinfo->cinfo, COL_INFO, ", Address = %s", - tvb_address_to_str(wmem_packet_scope(), tvb, vines_address_type, 2)); + tvb_address_to_str(wmem_packet_scope(), tvb, AT_VINES, 2)); proto_tree_add_item(vines_arp_tree, hf_vines_arp_address, tvb, 2, VINES_ADDR_LEN, ENC_NA); } proto_tree_add_item(vines_arp_tree, hf_vines_arp_sequence_number, tvb, 2+VINES_ADDR_LEN, 4, ENC_BIG_ENDIAN); @@ -1268,7 +1241,7 @@ dissect_vines_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat if (packet_type == VARP_ASSIGNMENT_RESP) { col_append_fstr(pinfo->cinfo, COL_INFO, ", Address = %s", - tvb_address_to_str(wmem_packet_scope(), tvb, vines_address_type, 2)); + tvb_address_to_str(wmem_packet_scope(), tvb, AT_VINES, 2)); proto_tree_add_item(vines_arp_tree, hf_vines_arp_address, tvb, 2, VINES_ADDR_LEN, ENC_NA); } |