From 4f39c603c2f0a2e429afedd18cd5c796bbbf8916 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 23 Oct 2015 11:14:34 -0700 Subject: More ADDRESS macro to address function conversions. Replace remaining calls to SET_ADDRESS, CMP_ADDRESS, ADDRESSES_EQUAL, COPY_ADDRESS, and COPY_ADDRESS_SHALLOW with their lower-case equivalents. Replace all ADD_ADDRESS_TO_HASH calls with add_address_to_hash. Change-Id: I4cff857d7a84085abe0bccd52d2605d2a468bf6f Reviewed-on: https://code.wireshark.org/review/11229 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- plugins/docsis/packet-macmgmt.c | 4 ++-- plugins/profinet/packet-dcerpc-pn-io.c | 12 ++++++------ plugins/profinet/packet-dcom-cba-acco.c | 4 ++-- plugins/profinet/packet-pn-dcp.c | 6 +++--- plugins/unistim/packet-unistim.c | 14 +++++++------- plugins/wimax/packet-wmx.c | 2 +- plugins/wimax/wimax_fch_decoder.c | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) (limited to 'plugins') diff --git a/plugins/docsis/packet-macmgmt.c b/plugins/docsis/packet-macmgmt.c index 2dae3da8f6..e7da2a2eec 100644 --- a/plugins/docsis/packet-macmgmt.c +++ b/plugins/docsis/packet-macmgmt.c @@ -157,9 +157,9 @@ dissect_macmgmt (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) col_clear(pinfo->cinfo, COL_INFO); TVB_SET_ADDRESS (&pinfo->dl_src, AT_ETHER, tvb, 6, 6); - COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->dl_src); + copy_address_shallow(&pinfo->src, &pinfo->dl_src); TVB_SET_ADDRESS (&pinfo->dl_dst, AT_ETHER, tvb, 0, 6); - COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->dl_dst); + copy_address_shallow(&pinfo->dst, &pinfo->dl_dst); if (tree) { diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c index 3016b4e3f8..69ebaceb97 100644 --- a/plugins/profinet/packet-dcerpc-pn-io.c +++ b/plugins/profinet/packet-dcerpc-pn-io.c @@ -2676,8 +2676,8 @@ pnio_ar_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pnio_ar_t *ar) proto_tree *sub_tree; address controllermac_addr, devicemac_addr; - SET_ADDRESS(&controllermac_addr, AT_ETHER, 6, ar->controllermac); - SET_ADDRESS(&devicemac_addr, AT_ETHER, 6, ar->devicemac); + set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac); + set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac); sub_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_pn_io_ar_info, &sub_item, "ARUUID:%s ContrMAC:%s ContrAlRef:0x%x DevMAC:%s DevAlRef:0x%x InCR:0x%x OutCR=0x%x", @@ -9683,8 +9683,8 @@ pn_io_ar_conv_filter(packet_info *pinfo) return NULL; } - SET_ADDRESS(&controllermac_addr, AT_ETHER, 6, ar->controllermac); - SET_ADDRESS(&devicemac_addr, AT_ETHER, 6, ar->devicemac); + set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac); + set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac); guid_str = guid_to_str(wmem_packet_scope(), (const e_guid_t*) &ar->aruuid); buf = g_strdup_printf( @@ -9710,8 +9710,8 @@ pn_io_ar_conv_data_filter(packet_info *pinfo) return NULL; } - SET_ADDRESS(&controllermac_addr, AT_ETHER, 6, ar->controllermac); - SET_ADDRESS(&devicemac_addr, AT_ETHER, 6, ar->devicemac); + set_address(&controllermac_addr, AT_ETHER, 6, ar->controllermac); + set_address(&devicemac_addr, AT_ETHER, 6, ar->devicemac); controllermac_str = address_to_str(wmem_packet_scope(), &controllermac_addr); devicemac_str = address_to_str(wmem_packet_scope(), &devicemac_addr); diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c index adf1882042..94de1f9ae2 100644 --- a/plugins/profinet/packet-dcom-cba-acco.c +++ b/plugins/profinet/packet-dcom-cba-acco.c @@ -425,7 +425,7 @@ cba_object_dump(void) for(pdevs = cba_pdevs; pdevs != NULL; pdevs = g_list_next(pdevs)) { pdev = pdevs->data; - SET_ADDRESS(&addr, AT_IPv4, 4, pdev->ip); + set_address(&addr, AT_IPv4, 4, pdev->ip); g_warning("PDev #%5u: %s IFs:%u", pdev->first_packet, address_to_str(wmem_packet_scope(), &addr), pdev->object ? g_list_length(pdev->object->interfaces) : 0); @@ -641,7 +641,7 @@ cba_acco_add(packet_info *pinfo, const char *acco) return NULL; } - SET_ADDRESS(&addr, AT_IPv4, 4, &ip); + set_address(&addr, AT_IPv4, 4, &ip); pdev = cba_pdev_add(pinfo, &addr); delim++; diff --git a/plugins/profinet/packet-pn-dcp.c b/plugins/profinet/packet-pn-dcp.c index 4bb89bbec9..df681aa603 100644 --- a/plugins/profinet/packet-pn-dcp.c +++ b/plugins/profinet/packet-pn-dcp.c @@ -439,17 +439,17 @@ dissect_PNDCP_Suboption_IP(tvbuff_t *tvb, int offset, packet_info *pinfo, /* IPAddress */ offset = dissect_pn_ipv4(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_ip_ip, &ip); - SET_ADDRESS(&addr, AT_IPv4, 4, &ip); + set_address(&addr, AT_IPv4, 4, &ip); proto_item_append_text(block_item, ", IP: %s", address_to_str(wmem_packet_scope(), &addr)); /* Subnetmask */ offset = dissect_pn_ipv4(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_ip_subnetmask, &ip); - SET_ADDRESS(&addr, AT_IPv4, 4, &ip); + set_address(&addr, AT_IPv4, 4, &ip); proto_item_append_text(block_item, ", Subnet: %s", address_to_str(wmem_packet_scope(), &addr)); /* StandardGateway */ offset = dissect_pn_ipv4(tvb, offset, pinfo, tree, hf_pn_dcp_suboption_ip_standard_gateway, &ip); - SET_ADDRESS(&addr, AT_IPv4, 4, &ip); + set_address(&addr, AT_IPv4, 4, &ip); proto_item_append_text(block_item, ", Gateway: %s", address_to_str(wmem_packet_scope(), &addr)); break; default: diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c index a509b63b15..7858f78ee4 100644 --- a/plugins/unistim/packet-unistim.c +++ b/plugins/unistim/packet-unistim.c @@ -231,8 +231,8 @@ dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree,void *data _U_ uinfo->set_termid = -1; uinfo->string_data = NULL; uinfo->key_buffer = NULL; - SET_ADDRESS(&uinfo->it_ip, AT_NONE, 0, NULL); - SET_ADDRESS(&uinfo->ni_ip, AT_NONE, 0, NULL); + set_address(&uinfo->it_ip, AT_NONE, 0, NULL); + set_address(&uinfo->ni_ip, AT_NONE, 0, NULL); uinfo->it_port = 0; offset+=4; @@ -288,15 +288,15 @@ dissect_payload(proto_tree *overall_unistim_tree,tvbuff_t *tvb, gint offset, pac /*UNISTIM only so no term id but further payload work*/ /* Collect info for tap */ /* If no term id then packet sourced from NI */ - COPY_ADDRESS(&(uinfo->ni_ip), &(pinfo->src)); - COPY_ADDRESS(&(uinfo->it_ip), &(pinfo->dst)); + copy_address(&(uinfo->ni_ip), &(pinfo->src)); + copy_address(&(uinfo->it_ip), &(pinfo->dst)); uinfo->it_port = pinfo->destport; break; case 0x02: /*UNISTIM with term id*/ /* Termid packs are always sourced from the it, so collect relevant infos */ - COPY_ADDRESS(&(uinfo->ni_ip),&(pinfo->dst)); - COPY_ADDRESS(&(uinfo->it_ip),&(pinfo->src)); + copy_address(&(uinfo->ni_ip),&(pinfo->dst)); + copy_address(&(uinfo->it_ip),&(pinfo->src)); uinfo->it_port = pinfo->srcport; uinfo->termid = tvb_get_ntohl(tvb,offset); @@ -2314,7 +2314,7 @@ dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo, guint16 far_port; far_ip_addr = tvb_get_ipv4(tvb, offset-4); - SET_ADDRESS(&far_addr, AT_IPv4, 4, &far_ip_addr); + set_address(&far_addr, AT_IPv4, 4, &far_ip_addr); far_port = tvb_get_ntohs(tvb, offset-8); rtp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num, FALSE, NULL); diff --git a/plugins/wimax/packet-wmx.c b/plugins/wimax/packet-wmx.c index 9fc792419e..621ef44220 100644 --- a/plugins/wimax/packet-wmx.c +++ b/plugins/wimax/packet-wmx.c @@ -267,7 +267,7 @@ gboolean is_down_link(packet_info *pinfo) if (pinfo->p2p_dir == P2P_DIR_RECV) return TRUE; if (pinfo->p2p_dir == P2P_DIR_UNKNOWN) - if(bs_address.len && !CMP_ADDRESS(&bs_address, &pinfo->src)) + if(bs_address.len && !cmp_address(&bs_address, &pinfo->src)) return TRUE; return FALSE; } diff --git a/plugins/wimax/wimax_fch_decoder.c b/plugins/wimax/wimax_fch_decoder.c index afa3d19a28..2e9d6d213e 100644 --- a/plugins/wimax/wimax_fch_decoder.c +++ b/plugins/wimax/wimax_fch_decoder.c @@ -106,7 +106,7 @@ static void dissect_wimax_fch_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t /* save the base station address (once) */ if(!bs_address.len) - COPY_ADDRESS(&bs_address, &(pinfo->src)); + copy_address(&bs_address, &(pinfo->src)); /* update the info column */ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "FCH"); if (tree) -- cgit v1.2.3