From 13ec77a9fc3af3b0b502820d0b55796c89997896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Thu, 26 Nov 2015 04:44:52 +0000 Subject: Add free_address_wmem() and other extensions to address API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Try to improve 'address' API (to be easier/safer) and also avoid some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Change-Id: I7456516b12c67620ceadac447907c12f5905bd49 Reviewed-on: https://code.wireshark.org/review/13463 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- epan/dissectors/packet-nbap.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'epan/dissectors/packet-nbap.c') diff --git a/epan/dissectors/packet-nbap.c b/epan/dissectors/packet-nbap.c index ec34e0d838..0383e53609 100644 --- a/epan/dissectors/packet-nbap.c +++ b/epan/dissectors/packet-nbap.c @@ -10293,7 +10293,7 @@ int i; } /*Find the conversations assoicated with the HS-DSCH flows in this packet and set proper H-RNTI*/ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); for (i = 0; i < maxNrOfMACdFlows; i++) { if (nbap_hsdsch_channel_info[i].crnc_port != 0){ conversation = find_conversation(actx->pinfo->num, &(nbap_hsdsch_channel_info[i].crnc_address), &null_addr, @@ -18225,7 +18225,7 @@ guint32 no_ddi_entries, i; } /* Check if we have conversation info */ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); p_conv = find_conversation(actx->pinfo->num, &nbap_edch_channel_info[e_dch_macdflow_id].crnc_address, &null_addr, PT_UDP, nbap_edch_channel_info[e_dch_macdflow_id].crnc_port, 0, NO_ADDR_B); @@ -18520,7 +18520,7 @@ num_items = 1; /*Do the configurations*/ /* Check if we have conversation info */ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); p_conv = find_conversation(actx->pinfo->num, &nbap_edch_channel_info[e_dch_macdflow_id].crnc_address, &null_addr, PT_UDP, nbap_edch_channel_info[e_dch_macdflow_id].crnc_port, 0, NO_ADDR_B); @@ -18632,7 +18632,7 @@ BindingID_port = 0; * Basically the idea here is that we create a new converation (Which is ok? maybe?) * And then hijack the old conversation and let lower tree items configure that hijacked data. * */ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &transportLayerAddress_ipv4); @@ -23340,7 +23340,7 @@ int i; return offset; } /* Set port to zero use that as an indication of whether we have data or not */ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); for (i = 0; i < maxNrOfCommonMACFlows; i++) { if (nbap_common_channel_info[i].crnc_port != 0){ @@ -23785,7 +23785,7 @@ dissect_nbap_HSDSCH_FDD_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_ } /* Set port to zero use that as an indication of whether we have data or not */ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); for (i = 0; i < maxNrOfMACdFlows; i++) { if (nbap_hsdsch_channel_info[i].crnc_port != 0){ nbap_debug("Frame %u HSDSCH-MACdFlows-Information:hsdsch_macdflow_id %u Look for conv on IP %s Port %u", @@ -24119,7 +24119,7 @@ dissect_nbap_HSDSCH_Information_to_Modify(tvbuff_t *tvb _U_, int offset _U_, asn } /* Set port to zero use that as an indication of whether we have data or not */ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); nbap_debug("Frame %u HSDSCH-MACdFlows-Information Start", actx->pinfo->num); @@ -28660,7 +28660,7 @@ dch_id = 0xFFFFFFFF; return offset; } - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &transportLayerAddress_ipv4); @@ -28798,7 +28798,7 @@ BindingID_port = 0; { return offset; } - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &transportLayerAddress_ipv4); @@ -32367,7 +32367,7 @@ transportFormatSet_type = NBAP_CPCH; { return offset; } - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &transportLayerAddress_ipv4); @@ -32532,7 +32532,7 @@ num_items = 1; { return offset; } - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &transportLayerAddress_ipv4); @@ -32675,7 +32675,7 @@ transportFormatSet_type = NBAP_CPCH; { return offset; } - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); set_address(&dst_addr, AT_IPv4, 4, &transportLayerAddress_ipv4); @@ -55205,7 +55205,7 @@ static void add_hsdsch_bind(packet_info *pinfo){ } /* Set port to zero use that as an indication of whether we have data or not */ - set_address(&null_addr, AT_NONE, 0, NULL); + clear_address(&null_addr); for (i = 0; i < maxNrOfMACdFlows; i++) { if (nbap_hsdsch_channel_info[i].crnc_port != 0){ conversation = find_conversation(pinfo->num, &(nbap_hsdsch_channel_info[i].crnc_address), &null_addr, -- cgit v1.2.3