From 8d16ac46d50445f4e0ce567acb8e265db08a7576 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Thu, 12 Feb 2015 12:03:49 -0500 Subject: Add name resolution support to address type. Add address_with_resolution_to_str API that returns address string + name resolution in the format %s (%s), first string is resolved name (if available) and second string is raw address string. Convert AT_FCWWN to using proper name resolution format First use of address_with_resolution_to_str with field types in proto.c Change-Id: I2ae77c29a4ffc30bb919fbec00f06629830898c2 Reviewed-on: https://code.wireshark.org/review/7196 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-tipc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-tipc.c') diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c index a9dc4cb05c..68baf63281 100644 --- a/epan/dissectors/packet-tipc.c +++ b/epan/dissectors/packet-tipc.c @@ -605,7 +605,7 @@ tipc_addr_to_str(guint tipc_address) return tipc_addr_value_to_buf(tipc_address, buf, MAX_TIPC_ADDRESS_STR_LEN); } -static gboolean +static int tipc_addr_to_str_buf(const address* addr, gchar *buf, int buf_len) { const guint8 *data = (const guint8 *)addr->data; @@ -617,7 +617,7 @@ tipc_addr_to_str_buf(const address* addr, gchar *buf, int buf_len) tipc_address = (tipc_address << 8) ^ data[3]; tipc_addr_value_to_buf(tipc_address, buf, buf_len); - return TRUE; + return strlen(buf)+1; } static int tipc_addr_str_len(const address* addr _U_) @@ -2962,7 +2962,7 @@ proto_register_tipc(void) tipc_module = prefs_register_protocol(proto_tipc, proto_reg_handoff_tipc); tipc_address_type = address_type_dissector_register("tipc_address_type", "TIPC Address Zone,Subnetwork,Processor", - tipc_addr_to_str_buf, tipc_addr_str_len, NULL, NULL); + tipc_addr_to_str_buf, tipc_addr_str_len, NULL, NULL, NULL, NULL); /* Set default ports */ range_convert_str(&global_tipc_udp_port_range, DEFAULT_TIPC_PORT_RANGE, MAX_TCP_PORT); -- cgit v1.2.3