diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-01-18 21:49:47 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-01-18 21:49:47 +0000 |
commit | b5b17f5994f17cf9b313fc1d2afc5a549ef8419b (patch) | |
tree | c50b56a45e65cddff9bc5e5c6a89f6e1ce51d25f /epan/dissectors | |
parent | a0daeafa7ea5c4b399c4940e7582e97d726cb873 (diff) |
Fix a number of gcc _Wshadow warnings
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31557 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-bacapp.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-dcm.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-dhcpv6.c | 18 | ||||
-rw-r--r-- | epan/dissectors/packet-dtn.c | 82 | ||||
-rw-r--r-- | epan/dissectors/packet-egd.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-fp_hint.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ftp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_bssmap.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_dtap.c | 24 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_gm.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_rr.c | 54 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_bssmap_le.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 80 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee802154.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-ipsec.c | 46 | ||||
-rw-r--r-- | epan/dissectors/packet-isakmp.c | 20 |
16 files changed, 202 insertions, 204 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c index 1879816530..93f08bb83c 100644 --- a/epan/dissectors/packet-bacapp.c +++ b/epan/dissectors/packet-bacapp.c @@ -3899,15 +3899,15 @@ static const fragment_items msg_frag_items = { static const guint MaxAPDUSize [] = { 50,128,206,480,1024,1476 }; static guint -fGetMaxAPDUSize(guint8 index) +fGetMaxAPDUSize(guint8 idx) { /* only 16 values are defined, so use & 0x0f */ /* check the size of the Array, deliver either the entry - or the first entry if index is outside of the array (bug 3736 comment#7) */ - if ((index & 0x0f) >= (gint)(sizeof(MaxAPDUSize)/sizeof(guint))) + or the first entry if idx is outside of the array (bug 3736 comment#7) */ + if ((idx & 0x0f) >= (gint)(sizeof(MaxAPDUSize)/sizeof(guint))) return MaxAPDUSize[0]; else - return MaxAPDUSize[index & 0x0f]; + return MaxAPDUSize[idx & 0x0f]; } /* Used when there are ranges of reserved and proprietary enumerations */ diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c index f36e4598df..6b665af128 100644 --- a/epan/dissectors/packet-dcm.c +++ b/epan/dissectors/packet-dcm.c @@ -5770,7 +5770,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Sequence or Item Start */ guint32 endpos_item = 0; - gboolean end_of_seq_or_item = FALSE; + gboolean local_end_of_seq_or_item = FALSE; gboolean is_first_desc = TRUE; gchar *item_description = NULL; /* Will be allocated as ep_ memory in dissect_dcm_tag() */ @@ -5778,10 +5778,10 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (vl == 0xFFFFFFFF) { /* Undefined length */ - while ((!end_of_seq_or_item) && (!pdv->open_tag.is_header_fragmented) && (offset < endpos)) { + while ((!local_end_of_seq_or_item) && (!pdv->open_tag.is_header_fragmented) && (offset < endpos)) { offset = dissect_dcm_tag(tvb, pinfo, seq_ptree, pdv, offset, endpos, FALSE, - &item_description, &end_of_seq_or_item); + &item_description, &local_end_of_seq_or_item); if (item_description && global_dcm_seq_subtree) { proto_item_append_text(tag_pitem, (is_first_desc ? " %s" : ", %s"), item_description); @@ -5796,7 +5796,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, while (offset < endpos_item) { offset = dissect_dcm_tag(tvb, pinfo, seq_ptree, pdv, offset, endpos_item, FALSE, - &item_description, &end_of_seq_or_item); + &item_description, &local_end_of_seq_or_item); if (item_description && global_dcm_seq_subtree) { proto_item_append_text(tag_pitem, (is_first_desc ? " %s" : ", %s"), item_description); @@ -5804,7 +5804,7 @@ dissect_dcm_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } } } - } + } /* if ((is_sequence || is_item) && (vl > 0)) */ else if ((grp == 0xFFFE) && (elm == 0xE00D)) { /* Item delimitation for items with undefined length */ *end_of_seq_or_item = TRUE; diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index f8a847b097..7b89f16428 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -1523,12 +1523,12 @@ dissect_packetcable_ccc_option(proto_tree *v_tree, tvbuff_t *tvb, int optoff, guint8 fetch_tgt, timer_val, type; proto_item *vti; proto_tree *pkt_s_tree; - guint32 ipv4_addr; - guchar kr_name; /** A character in the kerberos realm name option */ - guint8 kr_value; /* The integer value of the character currently being tested */ + guint32 ipv4_address; + guchar kr_name; /** A character in the kerberos realm name option */ + guint8 kr_value; /* The integer value of the character currently being tested */ int kr_fail_flag = 0; /* Flag indicating an invalid character was found */ - int kr_pos = 0; /* The position of the first invalid character */ - int i =0; + int kr_pos = 0; /* The position of the first invalid character */ + int i = 0; char bit_fld[24]; subopt = tvb_get_ntohs(tvb, optoff); @@ -1554,9 +1554,9 @@ dissect_packetcable_ccc_option(proto_tree *v_tree, tvbuff_t *tvb, int optoff, case PKT_CCC_PRI_DHCP: /* IPv4 address values */ case PKT_CCC_SEC_DHCP: if (subopt_len == 4) { - ipv4_addr = tvb_get_ipv4(tvb, suboptoff); + ipv4_address = tvb_get_ipv4(tvb, suboptoff); proto_item_append_text(vti, "%s (%u byte%s%s)", - ip_to_str((guint8 *)&ipv4_addr), subopt_len, + ip_to_str((guint8 *)&ipv4_address), subopt_len, plurality(subopt_len, "", "s"), subopt_len != 4 ? " [Invalid]" : ""); } @@ -1580,9 +1580,9 @@ dissect_packetcable_ccc_option(proto_tree *v_tree, tvbuff_t *tvb, int optoff, /** Type 0 is IPv4 **/ else if (type == 1) { if (subopt_len == 5) { - ipv4_addr = tvb_get_ipv4(tvb, suboptoff+1); + ipv4_address = tvb_get_ipv4(tvb, suboptoff+1); proto_item_append_text(vti, "%s (%u byte%s%s)", - ip_to_str((guint8 *)&ipv4_addr), subopt_len, + ip_to_str((guint8 *)&ipv4_address), subopt_len, plurality(subopt_len, "", "s"), subopt_len != 5 ? " [Invalid]" : ""); } diff --git a/epan/dissectors/packet-dtn.c b/epan/dissectors/packet-dtn.c index 0a38fd12d3..e64be30ec2 100644 --- a/epan/dissectors/packet-dtn.c +++ b/epan/dissectors/packet-dtn.c @@ -64,9 +64,9 @@ static int add_sdnv_time_to_tree(proto_tree *tree, tvbuff_t *tvb, int offset, ch static GHashTable *msg_fragment_table = NULL; static GHashTable *msg_reassembled_table = NULL; -static int segment_length; -static int bundle_header_length; -static int bundle_header_dict_length; +static int gbl_segment_length; +static int gbl_bundle_header_length; +static int gbl_bundle_header_dict_length; static char magic[] = {'d', 't', 'n', '!'}; @@ -300,16 +300,16 @@ dissect_tcp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } fixed = 1; - segment_length = evaluate_sdnv(tvb, fixed + frame_offset, &sdnv_length); - if(segment_length < 0) { + gbl_segment_length = evaluate_sdnv(tvb, fixed + frame_offset, &sdnv_length); + if(gbl_segment_length < 0) { col_set_str(pinfo->cinfo, COL_INFO, "Protocol Error (Length)"); return; } convergence_hdr_size = sdnv_length + fixed; - if((buffer_size - frame_offset - convergence_hdr_size) < segment_length) { + if((buffer_size - frame_offset - convergence_hdr_size) < gbl_segment_length) { /*Segment not complete -- wait for the rest of it*/ pinfo->desegment_len = - segment_length - (buffer_size - frame_offset + gbl_segment_length - (buffer_size - frame_offset - convergence_hdr_size); pinfo->desegment_offset = frame_offset; return; @@ -342,7 +342,7 @@ dissect_tcp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) frag_msg = fragment_add_seq_next(tvb, frame_offset + convergence_hdr_size, pinfo, 0, msg_fragment_table, - msg_reassembled_table, segment_length, + msg_reassembled_table, gbl_segment_length, more_frags); if(frag_msg && !more_frags) { ti = proto_tree_add_item(tree, proto_bundle, tvb, @@ -383,7 +383,7 @@ dissect_tcp_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * frame_offset indicates everything in the buffer has been processed. */ - frame_offset += (segment_length + convergence_hdr_size); + frame_offset += (gbl_segment_length + convergence_hdr_size); } else { /*Else this is not a Data Segment*/ @@ -750,15 +750,15 @@ dissect_primary_header(packet_info *pinfo, proto_tree *primary_tree, tvbuff_t *t proto_tree_add_boolean(srr_flag_tree, hf_bundle_srrflags_report_ack, tvb, offset, 1, srrflags); ++offset; - bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length); + gbl_bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length); hdr_length_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if(bundle_header_length < 0) { + if(gbl_bundle_header_length < 0) { proto_item_set_text(hdr_length_item, "Bundle Header Length: Error"); return 0; } proto_item_set_text(hdr_length_item, - "Bundle Header Length: %d", bundle_header_length); - tvb_ensure_bytes_exist(tvb, offset + sdnv_length, bundle_header_length); + "Bundle Header Length: %d", gbl_bundle_header_length); + tvb_ensure_bytes_exist(tvb, offset + sdnv_length, gbl_bundle_header_length); offset += sdnv_length; /* @@ -824,33 +824,33 @@ dissect_primary_header(packet_info *pinfo, proto_tree *primary_tree, tvbuff_t *t proto_tree_add_item(primary_tree, hf_bundle_lifetime, tvb, offset, 4, FALSE); offset += 4; - bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length); + gbl_bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length); dict_length_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if(bundle_header_dict_length < 0) { + if(gbl_bundle_header_dict_length < 0) { proto_item_set_text(dict_length_item, "Dictionary Length: Error"); return 0; } proto_item_set_text(dict_length_item, "Dictionary Length: %d", - bundle_header_dict_length); + gbl_bundle_header_dict_length); offset += sdnv_length; - tvb_ensure_bytes_exist(tvb, offset, bundle_header_dict_length); + tvb_ensure_bytes_exist(tvb, offset, gbl_bundle_header_dict_length); /* * Pull out stuff from the dictionary */ dict_item = proto_tree_add_text(primary_tree, tvb, offset, - bundle_header_dict_length, "Dictionary"); + gbl_bundle_header_dict_length, "Dictionary"); dict_tree = proto_item_add_subtree(dict_item, ett_dictionary); - dict_ptr = (guint8 *) tvb_get_ptr(tvb, offset, bundle_header_dict_length); + dict_ptr = (guint8 *) tvb_get_ptr(tvb, offset, gbl_bundle_header_dict_length); /* * If the dictionary length is 0, then the CBHE block compression method is applied. * So the scheme offset is the node number and the ssp offset is the service number. * If destination scheme offset is 2 and destination ssp offset is 1, then the EID is * ipn:2.1 */ - if(bundle_header_dict_length == 0) + if(gbl_bundle_header_dict_length == 0) { /* * Destination info @@ -1014,7 +1014,7 @@ dissect_primary_header(packet_info *pinfo, proto_tree *primary_tree, tvbuff_t *t dict_ptr + dest_scheme_offset, dict_ptr + dest_ssp_offset); } - offset += bundle_header_dict_length; /*Skip over dictionary*/ + offset += gbl_bundle_header_dict_length; /*Skip over dictionary*/ /* * Do this only if Fragment Flag is set */ @@ -1171,15 +1171,15 @@ dissect_version_5_primary_header(packet_info *pinfo, tvb, offset, sdnv_length, srrflags); offset += sdnv_length; - bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length); + gbl_bundle_header_length = evaluate_sdnv(tvb, offset, &sdnv_length); hdr_length_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if(bundle_header_length < 0) { + if(gbl_bundle_header_length < 0) { proto_item_set_text(hdr_length_item, "Bundle Header Length: Error"); return 0; } proto_item_set_text(hdr_length_item, - "Bundle Header Length: %d", bundle_header_length); - tvb_ensure_bytes_exist(tvb, offset + sdnv_length, bundle_header_length); + "Bundle Header Length: %d", gbl_bundle_header_length); + tvb_ensure_bytes_exist(tvb, offset + sdnv_length, gbl_bundle_header_length); offset += sdnv_length; /* @@ -1191,7 +1191,7 @@ dissect_version_5_primary_header(packet_info *pinfo, dst_scheme_pos = offset; dst_scheme_len = sdnv_length; dest_scheme_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((dest_scheme_offset < 0) || (dest_scheme_offset > bundle_header_length)) { + if((dest_scheme_offset < 0) || (dest_scheme_offset > gbl_bundle_header_length)) { proto_item_set_text(dest_scheme_offset_item, "Destination Scheme Offset: Error"); return 0; } @@ -1202,7 +1202,7 @@ dissect_version_5_primary_header(packet_info *pinfo, dest_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length); dst_ssp_len = sdnv_length; dest_ssp_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((dest_ssp_offset < 0) || (dest_ssp_offset > bundle_header_length)) { + if((dest_ssp_offset < 0) || (dest_ssp_offset > gbl_bundle_header_length)) { proto_item_set_text(dest_ssp_offset_item, "Destination SSP Offset: Error"); return 0; } @@ -1214,7 +1214,7 @@ dissect_version_5_primary_header(packet_info *pinfo, src_scheme_pos = offset; src_scheme_len = sdnv_length; source_scheme_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((source_scheme_offset < 0) || (source_scheme_offset > bundle_header_length)) { + if((source_scheme_offset < 0) || (source_scheme_offset > gbl_bundle_header_length)) { proto_item_set_text(source_scheme_offset_item, "Source Scheme Offset: Error"); return 0; } @@ -1225,7 +1225,7 @@ dissect_version_5_primary_header(packet_info *pinfo, source_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length); src_ssp_len = sdnv_length; source_ssp_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((source_ssp_offset < 0) || (source_ssp_offset > bundle_header_length)) { + if((source_ssp_offset < 0) || (source_ssp_offset > gbl_bundle_header_length)) { proto_item_set_text(source_ssp_offset_item, "Source SSP Offset: Error"); return 0; } @@ -1237,7 +1237,7 @@ dissect_version_5_primary_header(packet_info *pinfo, rpt_scheme_pos = offset; rpt_scheme_len = sdnv_length; report_scheme_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((report_scheme_offset < 0) || (report_scheme_offset > bundle_header_length)) { + if((report_scheme_offset < 0) || (report_scheme_offset > gbl_bundle_header_length)) { proto_item_set_text(report_scheme_offset_item, "Report Scheme Offset: Error"); return 0; } @@ -1248,7 +1248,7 @@ dissect_version_5_primary_header(packet_info *pinfo, report_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length); rpt_ssp_len = sdnv_length; report_ssp_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((report_ssp_offset < 0) || (report_ssp_offset > bundle_header_length)) { + if((report_ssp_offset < 0) || (report_ssp_offset > gbl_bundle_header_length)) { proto_item_set_text(report_ssp_offset_item, "Report SSP Offset: Error"); return 0; } @@ -1260,7 +1260,7 @@ dissect_version_5_primary_header(packet_info *pinfo, cust_scheme_pos = offset; cust_scheme_len = sdnv_length; cust_scheme_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((cust_scheme_offset < 0) || (cust_scheme_offset > bundle_header_length)) { + if((cust_scheme_offset < 0) || (cust_scheme_offset > gbl_bundle_header_length)) { proto_item_set_text(cust_scheme_offset_item, "Custodian Scheme Offset: Error"); return 0; } @@ -1271,7 +1271,7 @@ dissect_version_5_primary_header(packet_info *pinfo, cust_ssp_offset = evaluate_sdnv(tvb, offset, &sdnv_length); cust_ssp_len = sdnv_length; cust_ssp_offset_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if((cust_ssp_offset < 0) || (cust_ssp_offset > bundle_header_length)) { + if((cust_ssp_offset < 0) || (cust_ssp_offset > gbl_bundle_header_length)) { proto_item_set_text(cust_ssp_offset_item, "Custodian SSP Offset: Error"); return 0; } @@ -1321,28 +1321,28 @@ dissect_version_5_primary_header(packet_info *pinfo, proto_item_set_text(lifetime_item, "Lifetime: %d", lifetime); offset += sdnv_length; - bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length); + gbl_bundle_header_dict_length = evaluate_sdnv(tvb, offset, &sdnv_length); dict_length_item = proto_tree_add_text(primary_tree, tvb, offset, sdnv_length, " "); - if(bundle_header_dict_length < 0) { + if(gbl_bundle_header_dict_length < 0) { proto_item_set_text(dict_length_item, "Dictionary Length: Error"); return 0; } proto_item_set_text(dict_length_item, "Dictionary Length: %d", - bundle_header_dict_length); + gbl_bundle_header_dict_length); offset += sdnv_length; - tvb_ensure_bytes_exist(tvb, offset, bundle_header_dict_length); + tvb_ensure_bytes_exist(tvb, offset, gbl_bundle_header_dict_length); /* * Pull out stuff from the dictionary */ dict_item = proto_tree_add_text(primary_tree, tvb, offset, - bundle_header_dict_length, "Dictionary"); + gbl_bundle_header_dict_length, "Dictionary"); dict_tree = proto_item_add_subtree(dict_item, ett_dictionary); - dict_ptr = (guint8 *) tvb_get_ptr(tvb, offset, bundle_header_dict_length); + dict_ptr = (guint8 *) tvb_get_ptr(tvb, offset, gbl_bundle_header_dict_length); - if(bundle_header_dict_length == 0) + if(gbl_bundle_header_dict_length == 0) { /* * Destination info @@ -1493,7 +1493,7 @@ dissect_version_5_primary_header(packet_info *pinfo, dict_ptr + source_scheme_offset, dict_ptr + source_ssp_offset, dict_ptr + dest_scheme_offset, dict_ptr + dest_ssp_offset); } - offset += bundle_header_dict_length; /*Skip over dictionary*/ + offset += gbl_bundle_header_dict_length; /*Skip over dictionary*/ /* * Do this only if Fragment Flag is set diff --git a/epan/dissectors/packet-egd.c b/epan/dissectors/packet-egd.c index 48a56f8207..09eadc8545 100644 --- a/epan/dissectors/packet-egd.c +++ b/epan/dissectors/packet-egd.c @@ -109,7 +109,7 @@ static void dissect_egd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *egd_tree = NULL; tvbuff_t *next_tvb = NULL; gint offset, data_length; - guint32 stime; + guint32 sectime; nstime_t egd_time; memset(&egd_time, 0, sizeof(nstime_t)); @@ -129,8 +129,8 @@ static void dissect_egd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) offset += 4; /* time */ - stime = tvb_get_ntohl(tvb, offset); - if (0 == stime) + sectime = tvb_get_ntohl(tvb, offset); + if (0 == sectime) { notime = proto_tree_add_item(egd_tree, hf_egd_notime, tvb, offset, 8, FALSE); proto_item_append_text(notime, "--No TimeStamp"); diff --git a/epan/dissectors/packet-fp_hint.c b/epan/dissectors/packet-fp_hint.c index 8bed2cd2a3..87fd76183d 100644 --- a/epan/dissectors/packet-fp_hint.c +++ b/epan/dissectors/packet-fp_hint.c @@ -324,8 +324,7 @@ static void assign_fph_dch(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, fp } offset += 4; if (i > MAX_FP_CHANS) { - proto_item *pi; - pi = proto_tree_add_text(tree, tvb, offset, -1, + proto_tree_add_text(tree, tvb, offset, -1, "Frame contains more FP channels than currently supported (%u supported)", MAX_FP_CHANS); return; @@ -410,8 +409,7 @@ static void assign_fph_edch(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, f } i++; if (i >= MAX_EDCH_DDIS) { - proto_item *pi; - pi = proto_tree_add_text(tree, tvb, offset, -1, + proto_tree_add_text(tree, tvb, offset, -1, "Frame contains more FP channels than currently supported (%u supported)", MAX_FP_CHANS); return; diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c index 76e1c2248b..e535a5ef5e 100644 --- a/epan/dissectors/packet-ftp.c +++ b/epan/dissectors/packet-ftp.c @@ -187,7 +187,7 @@ parse_port_pasv(const guchar *line, int linelen, guint32 *ftp_ip, char *p; guchar c; int i; - int address[4], port[2]; + int ip_address[4], port[2]; gboolean ret = FALSE; /* @@ -214,14 +214,14 @@ parse_port_pasv(const guchar *line, int linelen, guint32 *ftp_ip, * See if we have six numbers. */ i = sscanf(p, "%d,%d,%d,%d,%d,%d", - &address[0], &address[1], &address[2], &address[3], + &ip_address[0], &ip_address[1], &ip_address[2], &ip_address[3], &port[0], &port[1]); if (i == 6) { /* * We have a winner! */ *ftp_port = ((port[0] & 0xFF)<<8) | (port[1] & 0xFF); - *ftp_ip = g_htonl((address[0] << 24) | (address[1] <<16) | (address[2] <<8) | address[3]); + *ftp_ip = g_htonl((ip_address[0] << 24) | (ip_address[1] <<16) | (ip_address[2] <<8) | ip_address[3]); ret = TRUE; break; } diff --git a/epan/dissectors/packet-gsm_a_bssmap.c b/epan/dissectors/packet-gsm_a_bssmap.c index 65f9c8774f..8003b1cb1f 100644 --- a/epan/dissectors/packet-gsm_a_bssmap.c +++ b/epan/dissectors/packet-gsm_a_bssmap.c @@ -5802,12 +5802,12 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *bssmap_item = NULL; proto_tree *bssmap_tree = NULL; const gchar *str; - sccp_msg_info_t* sccp_msg; + sccp_msg_info_t* sccp_msg_p; - sccp_msg = pinfo->sccp_info; + sccp_msg_p = pinfo->sccp_info; - if (!(sccp_msg && sccp_msg->data.co.assoc)) { - sccp_msg = NULL; + if (!(sccp_msg_p && sccp_msg_p->data.co.assoc)) { + sccp_msg_p = NULL; } col_append_str(pinfo->cinfo, COL_INFO, "(BSSMAP) "); @@ -5838,8 +5838,8 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) str = match_strval_idx((guint32) oct, gsm_a_bssmap_msg_strings, &idx); - if (sccp_msg && !sccp_msg->data.co.label) { - sccp_msg->data.co.label = se_strdup(val_to_str((guint32) oct, gsm_a_bssmap_msg_strings, "BSSMAP (0x%02x)")); + if (sccp_msg_p && !sccp_msg_p->data.co.label) { + sccp_msg_p->data.co.label = se_strdup(val_to_str((guint32) oct, gsm_a_bssmap_msg_strings, "BSSMAP (0x%02x)")); } /* diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index 0e8f3ae93f..da2eb83618 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -5895,7 +5895,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static gsm_a_tap_rec_t tap_rec[4]; static gsm_a_tap_rec_t *tap_p; static guint tap_current=0; - void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len); + void (*dtap_msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len); guint8 oct; guint8 pd; guint32 offset; @@ -5965,7 +5965,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) msg_str = NULL; ett_tree = -1; hf_idx = -1; - msg_fcn = NULL; + dtap_msg_fcn = NULL; nsd = FALSE; col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str(pd,gsm_a_pd_short_str_vals,"unknown")); @@ -5978,7 +5978,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) msg_str = match_strval_idx((guint32) (oct & DTAP_CC_IEI_MASK), gsm_a_dtap_msg_cc_strings, &idx); ett_tree = ett_gsm_dtap_msg_cc[idx]; hf_idx = hf_gsm_a_dtap_msg_cc_type; - msg_fcn = dtap_msg_cc_fcn[idx]; + dtap_msg_fcn = dtap_msg_cc_fcn[idx]; ti = (oct_1 & DTAP_TI_MASK) >> 4; nsd = TRUE; break; @@ -5987,28 +5987,28 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) msg_str = match_strval_idx((guint32) (oct & DTAP_MM_IEI_MASK), gsm_a_dtap_msg_mm_strings, &idx); ett_tree = ett_gsm_dtap_msg_mm[idx]; hf_idx = hf_gsm_a_dtap_msg_mm_type; - msg_fcn = dtap_msg_mm_fcn[idx]; + dtap_msg_fcn = dtap_msg_mm_fcn[idx]; nsd = TRUE; break; case 6: - get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn); + get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &dtap_msg_fcn); break; case 8: - get_gmm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn); + get_gmm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &dtap_msg_fcn); break; case 9: msg_str = match_strval_idx((guint32) (oct & DTAP_SMS_IEI_MASK), gsm_a_dtap_msg_sms_strings, &idx); ett_tree = ett_gsm_dtap_msg_sms[idx]; hf_idx = hf_gsm_a_dtap_msg_sms_type; - msg_fcn = dtap_msg_sms_fcn[idx]; + dtap_msg_fcn = dtap_msg_sms_fcn[idx]; ti = (oct_1 & DTAP_TI_MASK) >> 4; break; case 10: - get_sm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn); + get_sm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &dtap_msg_fcn); ti = (oct_1 & DTAP_TI_MASK) >> 4; break; @@ -6016,7 +6016,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) msg_str = match_strval_idx((guint32) (oct & DTAP_SS_IEI_MASK), gsm_a_dtap_msg_ss_strings, &idx); ett_tree = ett_gsm_dtap_msg_ss[idx]; hf_idx = hf_gsm_a_dtap_msg_ss_type; - msg_fcn = dtap_msg_ss_fcn[idx]; + dtap_msg_fcn = dtap_msg_ss_fcn[idx]; ti = (oct_1 & DTAP_TI_MASK) >> 4; nsd = TRUE; break; @@ -6025,7 +6025,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) msg_str = match_strval_idx((guint32) (oct & DTAP_TP_IEI_MASK), gsm_a_dtap_msg_tp_strings, &idx); ett_tree = ett_gsm_dtap_msg_tp[idx]; hf_idx = hf_gsm_a_dtap_msg_tp_type; - msg_fcn = dtap_msg_tp_fcn[idx]; + dtap_msg_fcn = dtap_msg_tp_fcn[idx]; ti = (oct_1 & DTAP_TI_MASK) >> 4; nsd = TRUE; break; @@ -6173,7 +6173,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * decode elements */ - if (msg_fcn == NULL) + if (dtap_msg_fcn == NULL) { proto_tree_add_text(dtap_tree, tvb, offset, len - offset, @@ -6181,7 +6181,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else { - (*msg_fcn)(tvb, dtap_tree, offset, len - offset); + (*dtap_msg_fcn)(tvb, dtap_tree, offset, len - offset); } } diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c index 2d4aa1000f..fb5100f91b 100644 --- a/epan/dissectors/packet-gsm_a_gm.c +++ b/epan/dissectors/packet-gsm_a_gm.c @@ -5487,26 +5487,26 @@ static void (*dtap_msg_sm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset NULL, /* NONE */ }; -void get_gmm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn) +void get_gmm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *dtap_msg_fcn) { gint idx; *msg_str = match_strval_idx((guint32) (oct & DTAP_GMM_IEI_MASK), gsm_a_dtap_msg_gmm_strings, &idx); *ett_tree = ett_gsm_dtap_msg_gmm[idx]; *hf_idx = hf_gsm_a_dtap_msg_gmm_type; - *msg_fcn = dtap_msg_gmm_fcn[idx]; + *dtap_msg_fcn = dtap_msg_gmm_fcn[idx]; return; } -void get_sm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn) +void get_sm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *dtap_msg_fcn) { gint idx; *msg_str = match_strval_idx((guint32) (oct & DTAP_SM_IEI_MASK), gsm_a_dtap_msg_sm_strings, &idx); *ett_tree = ett_gsm_dtap_msg_sm[idx]; *hf_idx = hf_gsm_a_dtap_msg_sm_type; - *msg_fcn = dtap_msg_sm_fcn[idx]; + *dtap_msg_fcn = dtap_msg_sm_fcn[idx]; return; } diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c index ba899afb71..23802bec9b 100644 --- a/epan/dissectors/packet-gsm_a_rr.c +++ b/epan/dissectors/packet-gsm_a_rr.c @@ -798,35 +798,35 @@ static void display_channel_list(guint8 *list, tvbuff_t *tvb, proto_tree *tree, return; } -static gint greatest_power_of_2_lesser_or_equal_to(gint index) +static gint greatest_power_of_2_lesser_or_equal_to(gint idx) { gint j = 1; do { j<<=1; - } while (j<=index); + } while (j<=idx); j >>= 1; return j; } static gint f_k(gint k, gint *w, gint range) { - gint index, n, j; + gint idx, n, j; - index = k; + idx = k; range -= 1; - range = range/greatest_power_of_2_lesser_or_equal_to(index); - n = w[index]-1; + range = range/greatest_power_of_2_lesser_or_equal_to(idx); + n = w[idx]-1; - while (index>1) { - j = greatest_power_of_2_lesser_or_equal_to(index); + while (idx>1) { + j = greatest_power_of_2_lesser_or_equal_to(idx); range = 2*range+1; - if ((2*index) < 3*j){ /* left child */ - index -= j/2; - n = (n+w[index]-1+((range-1)/2)+1)%range; + if ((2*idx) < 3*j){ /* left child */ + idx -= j/2; + n = (n+w[idx]-1+((range-1)/2)+1)%range; } else { /* right child */ - index -= j; - n = (n+w[index]-1+1)%range; + idx -= j; + n = (n+w[idx]-1+1)%range; } } @@ -8492,7 +8492,7 @@ static void (*dtap_msg_rr_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset NULL, /* NONE */ }; -void get_rr_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn) +void get_rr_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p) { gint idx; @@ -8500,7 +8500,7 @@ void get_rr_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf *hf_idx = hf_gsm_a_dtap_msg_rr_type; if (*msg_str != NULL) { *ett_tree = ett_gsm_dtap_msg_rr[idx]; - *msg_fcn = dtap_msg_rr_fcn[idx]; + *msg_fcn_p = dtap_msg_rr_fcn[idx]; } return; @@ -8518,7 +8518,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static gsm_a_tap_rec_t *tap_p; static guint tap_current=0; - void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len); + void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len); guint8 oct; guint8 pd; guint32 offset, saved_offset; @@ -8587,7 +8587,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) msg_str = NULL; ett_tree = -1; hf_idx = -1; - msg_fcn = NULL; + msg_fcn_p = NULL; nsd = FALSE; col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",val_to_str(pd,gsm_a_pd_short_str_vals,"Unknown (%u)")); @@ -8596,7 +8596,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ switch (pd){ case 6: - get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn); + get_rr_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p); break; default: @@ -8711,11 +8711,11 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * decode elements */ - if (msg_fcn == NULL){ + if (msg_fcn_p == NULL){ proto_tree_add_text(ccch_tree, tvb, offset, len - offset, "Message Elements"); }else{ - (*msg_fcn)(tvb, ccch_tree, offset, len - offset); + (*msg_fcn_p)(tvb, ccch_tree, offset, len - offset); } } @@ -8747,7 +8747,7 @@ static void (*sacch_msg_rr_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offse NULL, /* NONE */ }; -void get_rr_short_pd_msg_params(guint8 mess_type, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn) +void get_rr_short_pd_msg_params(guint8 mess_type, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p) { gint idx; @@ -8755,7 +8755,7 @@ void get_rr_short_pd_msg_params(guint8 mess_type, const gchar **msg_str, int *et *hf_idx = hf_gsm_a_sacch_msg_rr_type; if (*msg_str != NULL) { *ett_tree = ett_gsm_sacch_msg_rr[idx]; - *msg_fcn = sacch_msg_rr_fcn[idx]; + *msg_fcn_p = sacch_msg_rr_fcn[idx]; } } @@ -8771,7 +8771,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static gsm_a_tap_rec_t *tap_p; static guint tap_current=0; - void (*msg_fcn)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len); + void (*msg_fcn_p)(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len); guint8 oct, short_pd, mess_type; guint32 offset; guint32 len; @@ -8802,7 +8802,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) msg_str = NULL; ett_tree = -1; hf_idx = -1; - msg_fcn = NULL; + msg_fcn_p = NULL; short_pd = (oct & 0x80) >> 7; mess_type = (oct & 0x7c) >> 2; @@ -8810,7 +8810,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (short_pd == 0) { col_append_fstr(pinfo->cinfo, COL_INFO, "(RR) "); - get_rr_short_pd_msg_params(mess_type, &msg_str, &ett_tree, &hf_idx, &msg_fcn); + get_rr_short_pd_msg_params(mess_type, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p); } else { @@ -8866,11 +8866,11 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * decode elements */ - if (msg_fcn == NULL){ + if (msg_fcn_p == NULL){ proto_tree_add_text(sacch_tree, tvb, offset, len - offset, "Message Elements"); }else{ - (*msg_fcn)(tvb, sacch_tree, offset, len - offset); + (*msg_fcn_p)(tvb, sacch_tree, offset, len - offset); } } diff --git a/epan/dissectors/packet-gsm_bssmap_le.c b/epan/dissectors/packet-gsm_bssmap_le.c index 270ec0db0a..9851942059 100644 --- a/epan/dissectors/packet-gsm_bssmap_le.c +++ b/epan/dissectors/packet-gsm_bssmap_le.c @@ -865,12 +865,12 @@ dissect_bssmap_le(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *bssmap_le_item = NULL; proto_tree *bssmap_le_tree = NULL; const gchar *str; - sccp_msg_info_t* sccp_msg; + sccp_msg_info_t* sccp_msg_p; - sccp_msg = pinfo->sccp_info; + sccp_msg_p = pinfo->sccp_info; - if (!(sccp_msg && sccp_msg->data.co.assoc)) { - sccp_msg = NULL; + if (!(sccp_msg_p && sccp_msg_p->data.co.assoc)) { + sccp_msg_p = NULL; } col_append_str(pinfo->cinfo, COL_INFO, "(BSSMAP LE) "); @@ -901,8 +901,8 @@ dissect_bssmap_le(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) str = match_strval_idx((guint32) oct, gsm_bssmap_le_msg_strings, &idx); - if (sccp_msg && !sccp_msg->data.co.label) { - sccp_msg->data.co.label = se_strdup(val_to_str((guint32) oct, gsm_bssmap_le_msg_strings, "BSSMAP LE(0x%02x)")); + if (sccp_msg_p && !sccp_msg_p->data.co.label) { + sccp_msg_p->data.co.label = se_strdup(val_to_str((guint32) oct, gsm_bssmap_le_msg_strings, "BSSMAP LE(0x%02x)")); } /* diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index c8425d6af0..b7cb8a2a88 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -2780,7 +2780,7 @@ add_fixed_field(proto_tree * tree, tvbuff_t * tvb, int offset, int lfcode) case FIELD_MIMO_CNTRL: { guint16 mimo; - guint32 time; + guint32 timestamp; proto_item *mimo_item; proto_tree *mimo_tree; @@ -2799,8 +2799,8 @@ add_fixed_field(proto_tree * tree, tvbuff_t * tvb, int offset, int lfcode) proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_reserved, tvb, offset+1, 1, mimo); offset+=2; - time = tvb_get_letohl (tvb, offset); - proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_sounding_timestamp, tvb, offset, 4, time); + timestamp = tvb_get_letohl (tvb, offset); + proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_sounding_timestamp, tvb, offset, 4, timestamp); length +=6; break; } @@ -4519,7 +4519,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of tvbuff_t *tag_tvb; const guint8 *tag_data_ptr; guint32 tag_no, tag_len; - unsigned int i; + unsigned int ii; int n, ret; char out_buff[SHORT_STR]; char print_buff[SHORT_STR]; @@ -4606,14 +4606,14 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of } tag_data_ptr = tvb_get_ptr (tvb, offset + 2, tag_len); - for (i = 0, n = 0; i < tag_len && n < SHORT_STR; i++) { - if (tag_data_ptr[i] == 0xFF){ - proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2 + i, + for (ii = 0, n = 0; ii < tag_len && n < SHORT_STR; ii++) { + if (tag_data_ptr[ii] == 0xFF){ + proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2 + ii, 1, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)"); } else { ret = g_snprintf (print_buff + n, SHORT_STR - n, "%2.1f%s ", - (tag_data_ptr[i] & 0x7F) * 0.5, - (tag_data_ptr[i] & 0x80) ? "(B)" : ""); + (tag_data_ptr[ii] & 0x7F) * 0.5, + (tag_data_ptr[ii] & 0x80) ? "(B)" : ""); if (ret >= SHORT_STR - n) { /* ret = <buf_size> or greater. means buffer truncated */ break; @@ -4779,19 +4779,19 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of proto_item_append_text(ti, ": %s", out_buff); proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,3, out_buff); - for (i = 3; (i + 3) <= tag_len; i += 3) + for (ii = 3; (ii + 3) <= tag_len; ii += 3) { guint8 val1, val2, val3; - val1 = tvb_get_guint8(tvb, offset + 2 + i); - val2 = tvb_get_guint8(tvb, offset + 3 + i); - val3 = tvb_get_guint8(tvb, offset + 4 + i); + val1 = tvb_get_guint8(tvb, offset + 2 + ii); + val2 = tvb_get_guint8(tvb, offset + 3 + ii); + val3 = tvb_get_guint8(tvb, offset + 4 + ii); if (val1 <= 200) { /* 802.11d */ - proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+i,3, out_buff, + proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+ii,3, out_buff, " Start Channel: %u, Channels: %u, Max TX Power: %d dBm", val1, val2, (gint) val3); } else { /* 802.11j */ - proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+i,3, out_buff, + proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+ii,3, out_buff, " Reg Extension Id: %u, Regulatory Class: %u, Coverage Class: %u", val1, val2, val3); } @@ -5593,7 +5593,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of { guint tag_offset; guint8 info_exchange; - proto_item *ti; + proto_item *tii; proto_tree *ex_cap_tree; if (tag_len < 1) @@ -5606,8 +5606,8 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of tag_offset = offset; info_exchange = tvb_get_guint8 (tvb, offset); - ti = proto_tree_add_item (tree, hf_tag_extended_capabilities, tvb, offset, 1, FALSE); - ex_cap_tree = proto_item_add_subtree (ti, ett_tag_ex_cap); + tii = proto_tree_add_item (tree, hf_tag_extended_capabilities, tvb, offset, 1, FALSE); + ex_cap_tree = proto_item_add_subtree (tii, ett_tag_ex_cap); proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b0, tvb, offset, 1, FALSE); proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b1, tvb, offset, 1, FALSE); proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b2, tvb, offset, 1, FALSE); @@ -6004,14 +6004,14 @@ dissect_ieee80211_mgt (guint16 fcf, tvbuff_t * tvb, packet_info * pinfo, case MGT_ACTION: { - proto_item *fixed_hdr; - proto_tree *fixed_tree; - fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters"); - fixed_tree = proto_item_add_subtree (fixed_hdr, ett_fixed_parameters); + proto_item *lcl_fixed_hdr; + proto_tree *lcl_fixed_tree; + lcl_fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters"); + lcl_fixed_tree = proto_item_add_subtree (lcl_fixed_hdr, ett_fixed_parameters); - offset += add_fixed_field(fixed_tree, tvb, 0, FIELD_ACTION); + offset += add_fixed_field(lcl_fixed_tree, tvb, 0, FIELD_ACTION); - proto_item_set_len(fixed_hdr, offset); + proto_item_set_len(lcl_fixed_hdr, offset); tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset); if (tagged_parameter_tree_len != 0) { @@ -6024,14 +6024,14 @@ dissect_ieee80211_mgt (guint16 fcf, tvbuff_t * tvb, packet_info * pinfo, } case MGT_ACTION_NO_ACK: { - proto_item *fixed_hdr; - proto_tree *fixed_tree; - fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters"); - fixed_tree = proto_item_add_subtree (fixed_hdr, ett_fixed_parameters); + proto_item *lcl_fixed_hdr; + proto_tree *lcl_fixed_tree; + lcl_fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters"); + lcl_fixed_tree = proto_item_add_subtree (lcl_fixed_hdr, ett_fixed_parameters); - offset += add_fixed_field(fixed_tree, tvb, 0, FIELD_ACTION); + offset += add_fixed_field(lcl_fixed_tree, tvb, 0, FIELD_ACTION); - proto_item_set_len(fixed_hdr, offset); + proto_item_set_len(lcl_fixed_hdr, offset); tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset); if (tagged_parameter_tree_len != 0) { @@ -6162,7 +6162,7 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, guint offset; const gchar *fts_str; gchar flag_str[] = "opmPRMFTC"; - gint i; + gint ii; wlan_hdr *volatile whdr; static wlan_hdr whdrs[4]; @@ -6197,9 +6197,9 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, flags = FCF_FLAGS (fcf); more_frags = HAVE_FRAGMENTS (flags); - for (i = 0; i < 8; i++) { - if (! (flags & 0x80 >> i)) { - flag_str[i] = '.'; + for (ii = 0; ii < 8; ii++) { + if (! (flags & 0x80 >> ii)) { + flag_str[ii] = '.'; } } @@ -7456,8 +7456,8 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, tvbuff_t *volatile msdu_tvb = NULL; guint32 msdu_offset = 0; guint16 i = 1; - const guint8 *src = NULL; - const guint8 *dst = NULL; + const guint8 *lcl_src = NULL; + const guint8 *lcl_dst = NULL; guint16 msdu_length; proto_item *parent_item; proto_tree *mpdu_tree; @@ -7468,8 +7468,8 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree); do { - dst = tvb_get_ptr (next_tvb, msdu_offset, 6); - src = tvb_get_ptr (next_tvb, msdu_offset+6, 6); + lcl_dst = tvb_get_ptr (next_tvb, msdu_offset, 6); + lcl_src = tvb_get_ptr (next_tvb, msdu_offset+6, 6); msdu_length = tvb_get_ntohs (next_tvb, msdu_offset+12); parent_item = proto_tree_add_uint_format(mpdu_tree, amsdu_msdu_header_text, next_tvb, @@ -7478,8 +7478,8 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree); i++; - proto_tree_add_ether(subframe_tree, hf_addr_da, next_tvb, msdu_offset, 6, dst); - proto_tree_add_ether(subframe_tree, hf_addr_sa, next_tvb, msdu_offset+6, 6, src); + proto_tree_add_ether(subframe_tree, hf_addr_da, next_tvb, msdu_offset, 6, lcl_dst); + proto_tree_add_ether(subframe_tree, hf_addr_sa, next_tvb, msdu_offset+6, 6, lcl_src); proto_tree_add_uint_format(subframe_tree, mcsset_highest_data_rate, next_tvb, msdu_offset+12, 2, msdu_length, "MSDU length: 0x%04X", msdu_length); diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index cc46f4dc74..eb306fe1ec 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -815,7 +815,7 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g */ /* The Auxiliary Security Header only exists in IEEE 802.15.4-2006 */ if (packet->security_enable && (packet->version == 1)) { - proto_item *ti; + proto_item *tii; proto_tree *header_tree, *field_tree; guint key_length = 0; @@ -845,12 +845,12 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g break; } - ti = proto_tree_add_text(ieee802154_tree, tvb, offset, 5 + key_length, "Auxiliary Security Header"); - header_tree = proto_item_add_subtree(ti, ett_ieee802154_auxiliary_security); + tii = proto_tree_add_text(ieee802154_tree, tvb, offset, 5 + key_length, "Auxiliary Security Header"); + header_tree = proto_item_add_subtree(tii, ett_ieee802154_auxiliary_security); /* Security Control Field */ - ti = proto_tree_add_text(header_tree, tvb, offset, sizeof (guint8), "Security Control Field (0x%02x)", security_control); - field_tree = proto_item_add_subtree(ti, ett_ieee802154_aux_sec_control); + tii = proto_tree_add_text(header_tree, tvb, offset, sizeof (guint8), "Security Control Field (0x%02x)", security_control); + field_tree = proto_item_add_subtree(tii, ett_ieee802154_aux_sec_control); proto_tree_add_uint(field_tree, hf_ieee802154_security_level, tvb, offset, sizeof(guint8), sec_level); proto_tree_add_uint(field_tree, hf_ieee802154_key_id_mode, tvb, offset, sizeof(guint8), key_id_mode); @@ -878,8 +878,8 @@ dissect_ieee802154_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g break; } - ti = proto_tree_add_text(header_tree, tvb, offset, key_length, "Key Identifier Field"); - field_tree = proto_item_add_subtree(ti, ett_ieee802154_aux_sec_key_id); + tii = proto_tree_add_text(header_tree, tvb, offset, key_length, "Key Identifier Field"); + field_tree = proto_item_add_subtree(tii, ett_ieee802154_aux_sec_key_id); /* Key Source Field */ if ((key_id_mode >> 3) > KEY_ID_MODE_KEY_INDEX) { diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 16d112d986..aaefeef9e6 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -429,7 +429,7 @@ get_full_ipv6_addr(char* ipv6_addr_expanded, char *ipv6_addr) */ #ifdef HAVE_LIBGCRYPT static gboolean -get_full_ipv4_addr(char* ipv4_addr_expanded, char *ipv4_addr) +get_full_ipv4_addr(char* ipv4_address_expanded, char *ipv4_address) { char addr_byte_string_tmp[4]; char addr_byte_string[4]; @@ -441,15 +441,15 @@ get_full_ipv4_addr(char* ipv4_addr_expanded, char *ipv4_addr) guint cpt = 0; gboolean done_flag = FALSE; - if((ipv4_addr == NULL) || (strcmp(ipv4_addr, "") == 0)) return done_flag; + if((ipv4_address == NULL) || (strcmp(ipv4_address, "") == 0)) return done_flag; - if((strlen(ipv4_addr) == 1) && (ipv4_addr[0] == IPSEC_SA_WILDCARDS_ANY)) + if((strlen(ipv4_address) == 1) && (ipv4_address[0] == IPSEC_SA_WILDCARDS_ANY)) { for(i = 0; i <= IPSEC_STRLEN_IPV4; i++) { - ipv4_addr_expanded[i] = IPSEC_SA_WILDCARDS_ANY; + ipv4_address_expanded[i] = IPSEC_SA_WILDCARDS_ANY; } - ipv4_addr_expanded[IPSEC_STRLEN_IPV4] = '\0'; + ipv4_address_expanded[IPSEC_STRLEN_IPV4] = '\0'; done_flag = TRUE; } @@ -457,16 +457,16 @@ get_full_ipv4_addr(char* ipv4_addr_expanded, char *ipv4_addr) j = 0; cpt = 0; k = 0; - while((done_flag == FALSE) && (j <= strlen(ipv4_addr)) && (cpt < IPSEC_STRLEN_IPV4)) + while((done_flag == FALSE) && (j <= strlen(ipv4_address)) && (cpt < IPSEC_STRLEN_IPV4)) { - if(j == strlen(ipv4_addr)) + if(j == strlen(ipv4_address)) { addr_byte_string_tmp[k] = '\0'; if((strlen(addr_byte_string_tmp) == 1) && (addr_byte_string_tmp[0] == IPSEC_SA_WILDCARDS_ANY)) { for(i = 0; i < 2; i++) { - ipv4_addr_expanded[cpt] = IPSEC_SA_WILDCARDS_ANY; + ipv4_address_expanded[cpt] = IPSEC_SA_WILDCARDS_ANY; cpt ++; } } @@ -477,21 +477,21 @@ get_full_ipv4_addr(char* ipv4_addr_expanded, char *ipv4_addr) else g_snprintf(addr_byte_string,4,"%X",addr_byte); for(i = 0; i < strlen(addr_byte_string); i++) { - ipv4_addr_expanded[cpt] = addr_byte_string[i]; + ipv4_address_expanded[cpt] = addr_byte_string[i]; cpt ++; } } done_flag = TRUE; } - else if(ipv4_addr[j] == '.') + else if(ipv4_address[j] == '.') { addr_byte_string_tmp[k] = '\0'; if((strlen(addr_byte_string_tmp) == 1) && (addr_byte_string_tmp[0] == IPSEC_SA_WILDCARDS_ANY)) { for(i = 0; i < 2; i++) { - ipv4_addr_expanded[cpt] = IPSEC_SA_WILDCARDS_ANY; + ipv4_address_expanded[cpt] = IPSEC_SA_WILDCARDS_ANY; cpt ++; } } @@ -502,7 +502,7 @@ get_full_ipv4_addr(char* ipv4_addr_expanded, char *ipv4_addr) else g_snprintf(addr_byte_string,4,"%X",addr_byte); for(i = 0; i < strlen(addr_byte_string); i++) { - ipv4_addr_expanded[cpt] = addr_byte_string[i]; + ipv4_address_expanded[cpt] = addr_byte_string[i]; cpt ++; } } @@ -514,13 +514,13 @@ get_full_ipv4_addr(char* ipv4_addr_expanded, char *ipv4_addr) if(k >= 3) { /* Incorrect IPv4 Address. Erase previous Values in the Byte. (LRU mechanism) */ - addr_byte_string_tmp[0] = ipv4_addr[j]; + addr_byte_string_tmp[0] = ipv4_address[j]; k = 1; j++; } else { - addr_byte_string_tmp[k] = ipv4_addr[j]; + addr_byte_string_tmp[k] = ipv4_address[j]; k++; j++; } @@ -528,7 +528,7 @@ get_full_ipv4_addr(char* ipv4_addr_expanded, char *ipv4_addr) } - ipv4_addr_expanded[cpt] = '\0'; + ipv4_address_expanded[cpt] = '\0'; } return done_flag; @@ -1053,18 +1053,18 @@ esp_sa_parse_filter(const gchar *sa_src, gint *pt_protocol_typ, gchar **pt_src, /* - Name : static goolean filter_address_match(gchar *address, gchar *filter, gint len, gint typ) + Name : static goolean filter_address_match(gchar *addr, gchar *filter, gint len, gint typ) Description : check the matching of an address with a filter Return : Return TRUE if the filter and the address match Params: - - gchar *address : the address to check + - gchar *addr : the address to check - gchar *filter : the filter - gint len : the len of the address that should match the filter - gint typ : the Address type : either IPv6 or IPv4 (IPSEC_SA_IPV6, IPSEC_SA_IPV4) */ #ifdef HAVE_LIBGCRYPT static gboolean -filter_address_match(gchar *address, gchar *filter, gint len, gint typ) +filter_address_match(gchar *addr, gchar *filter, gint len, gint typ) { gint i = 0; guint filter_tmp = 0; @@ -1072,15 +1072,15 @@ filter_address_match(gchar *address, gchar *filter, gint len, gint typ) char filter_string_tmp[3]; char addr_string_tmp[3]; - if(strlen(address) != strlen(filter)) return FALSE; + if(strlen(addr) != strlen(filter)) return FALSE; /* No length specified */ if((len < 0) || ((typ == IPSEC_SA_IPV6) && (len > IPSEC_IPV6_ADDR_LEN)) || ((typ == IPSEC_SA_IPV4) && (len > IPSEC_IPV4_ADDR_LEN))) { - for(i = 0; (guint)i < strlen(address); i++) + for(i = 0; (guint)i < strlen(addr); i++) { - if((filter[i] != IPSEC_SA_WILDCARDS_ANY) && (filter[i] != address[i])) return FALSE; + if((filter[i] != IPSEC_SA_WILDCARDS_ANY) && (filter[i] != addr[i])) return FALSE; } return TRUE; } @@ -1088,7 +1088,7 @@ filter_address_match(gchar *address, gchar *filter, gint len, gint typ) { for(i = 0; i < (len/ 4); i++) { - if((filter[i] != IPSEC_SA_WILDCARDS_ANY) && (filter[i] != address[i])) return FALSE; + if((filter[i] != IPSEC_SA_WILDCARDS_ANY) && (filter[i] != addr[i])) return FALSE; } if(filter[i] == IPSEC_SA_WILDCARDS_ANY) return TRUE; @@ -1097,7 +1097,7 @@ filter_address_match(gchar *address, gchar *filter, gint len, gint typ) /* take the end of the Netmask/Prefixlen into account */ filter_string_tmp[0] = filter[i]; filter_string_tmp[1] = '\0'; - addr_string_tmp[0] = address[i]; + addr_string_tmp[0] = addr[i]; addr_string_tmp[1] = '\0'; sscanf(filter_string_tmp,"%x",&filter_tmp); diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index a853d4ae40..81745dee55 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -268,7 +268,7 @@ static GHashTable *isakmp_hash = NULL; static GMemChunk *isakmp_key_data = NULL; static GMemChunk *isakmp_decrypt_data = NULL; #endif -static FILE *logf = NULL; +static FILE *log_f = NULL; static const char *pluto_log_path = "insert pluto log path here"; /* Specifications of encryption algorithms for IKEv2 decryption */ @@ -439,8 +439,8 @@ scan_pluto_log(void) { SET_ADDRESS(&null_addr, AT_NONE, 0, NULL); - if (logf) { - while (fgets(line, MAX_PLUTO_LINE, logf)) { + if (log_f) { + while (fgets(line, MAX_PLUTO_LINE, log_f)) { if (strncmp(line, icookie_pfx, icpfx_len) == 0) { secret_len = 0; pos = line + icpfx_len; @@ -2467,7 +2467,7 @@ dissect_config(tvbuff_t *tvb, int offset, int length, proto_tree *tree, while(length>0) { guint16 aft = tvb_get_ntohs(tvb, offset); - guint16 type = aft & 0x7fff; + guint16 typex = aft & 0x7fff; guint16 len; guint32 val; guint pack_len; @@ -2476,7 +2476,7 @@ dissect_config(tvbuff_t *tvb, int offset, int length, proto_tree *tree, val = tvb_get_ntohs(tvb, offset + 2); proto_tree_add_text(tree, tvb, offset, 4, "%s (%u)", - cfgattr2str(isakmp_version, type), val); + cfgattr2str(isakmp_version, typex), val); offset += 4; length -= 4; } @@ -2486,11 +2486,11 @@ dissect_config(tvbuff_t *tvb, int offset, int length, proto_tree *tree, if (!get_num(tvb, offset + 4, len, &val)) { proto_tree_add_text(tree, tvb, offset, pack_len, "%s: <too big (%u bytes)>", - cfgattr2str(isakmp_version, type), len); + cfgattr2str(isakmp_version, typex), len); } else { proto_tree_add_text(tree, tvb, offset, 4, "%s (%ue)", - cfgattr2str(isakmp_version, type), val); + cfgattr2str(isakmp_version, typex), val); } offset += pack_len; length -= pack_len; @@ -3673,9 +3673,9 @@ isakmp_init_protocol(void) { G_ALLOC_AND_FREE); #endif isakmp_hash = g_hash_table_new(isakmp_hash_func, isakmp_equal_func); - if (logf) - fclose(logf); - logf = ws_fopen(pluto_log_path, "r"); + if (log_f) + fclose(log_f); + log_f = ws_fopen(pluto_log_path, "r"); scan_pluto_log(); |