summaryrefslogtreecommitdiff
path: root/epan/dissectors
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2010-01-18 23:16:10 +0000
committerBill Meier <wmeier@newsguy.com>2010-01-18 23:16:10 +0000
commitc5614625ee36aaec31e716a2879a2492984a1fed (patch)
treedc072ea64d05386e4ee2e0239b9cf90f63272e20 /epan/dissectors
parentf1d4716d18e43916cfa96d1cc3d9832409a3f470 (diff)
downloadwireshark-c5614625ee36aaec31e716a2879a2492984a1fed.tar.gz
Fix some gcc -Wshadow warnings ....
svn path=/trunk/; revision=31559
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-iwarp-mpa.c8
-rw-r--r--epan/dissectors/packet-kerberos.c60
-rw-r--r--epan/dissectors/packet-l2tp.c684
-rw-r--r--epan/dissectors/packet-lapd.c26
-rw-r--r--epan/dissectors/packet-lapdm.c18
-rw-r--r--epan/dissectors/packet-ldss.c10
-rw-r--r--epan/dissectors/packet-mac-lte.c10
-rw-r--r--epan/dissectors/packet-mgcp.c4
-rw-r--r--epan/dissectors/packet-mmse.c12
-rw-r--r--epan/dissectors/packet-mp2t.c38
-rw-r--r--epan/dissectors/packet-mpls-echo.c24
-rw-r--r--epan/dissectors/packet-mq.c6
-rw-r--r--epan/dissectors/packet-multipart.c3
-rw-r--r--epan/dissectors/packet-mysql.c22
-rw-r--r--epan/dissectors/packet-nas_eps.c28
-rw-r--r--epan/dissectors/packet-nasdaq-itch.c4
-rw-r--r--epan/dissectors/packet-nbns.c10
17 files changed, 483 insertions, 484 deletions
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c
index 666c0f3e34..07baaae128 100644
--- a/epan/dissectors/packet-iwarp-mpa.c
+++ b/epan/dissectors/packet-iwarp-mpa.c
@@ -596,17 +596,17 @@ fpdu_pad_length(guint16 ulpdu_length)
/* returns offset for PAD */
guint32
-pad_offset(struct tcpinfo *tcpinfo, guint32 fpdu_total_length,
- guint8 pad_length)
+pad_offset(struct tcpinfo *tcpinfo, guint32 fpdu_total_len,
+ guint8 pad_len)
{
if ((tcpinfo->nxtseq - MPA_CRC_LEN - MPA_MARKER_LEN) % MPA_MARKER_INTERVAL
== 0) {
/* covers the case where a Marker resides between the padding
* and CRC.
*/
- return fpdu_total_length - MPA_CRC_LEN - MPA_MARKER_LEN - pad_length;
+ return fpdu_total_len - MPA_CRC_LEN - MPA_MARKER_LEN - pad_len;
} else {
- return fpdu_total_length - MPA_CRC_LEN - pad_length;
+ return fpdu_total_len - MPA_CRC_LEN - pad_len;
}
}
diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c
index 6c62150c6d..13294ecb5e 100644
--- a/epan/dissectors/packet-kerberos.c
+++ b/epan/dissectors/packet-kerberos.c
@@ -355,7 +355,7 @@ guint32 krb5_errorcode;
static dissector_handle_t krb4_handle=NULL;
-static gboolean do_col_info;
+static gboolean gbl_do_col_info;
static void
@@ -1907,12 +1907,12 @@ dissect_krb5_msg_type(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *a
offset=dissect_ber_integer(FALSE, actx, tree, tvb, offset, hf_krb_msg_type, &msgtype);
- if (do_col_info & check_col(actx->pinfo->cinfo, COL_INFO)) {
+ if (gbl_do_col_info & check_col(actx->pinfo->cinfo, COL_INFO)) {
col_add_str(actx->pinfo->cinfo, COL_INFO,
val_to_str(msgtype, krb5_msg_types,
"Unknown msg type %#x"));
}
- do_col_info=FALSE;
+ gbl_do_col_info=FALSE;
/* append the application type to the subtree */
proto_item_append_text(tree, " %s", val_to_str(msgtype, krb5_msg_types, "Unknown:0x%x"));
@@ -3696,16 +3696,16 @@ dissect_krb5_decrypt_EncKrbCredPart (proto_tree *tree, tvbuff_t *tvb, int offset
}
if(plaintext){
- tvbuff_t *next_tvb;
- next_tvb = tvb_new_child_real_data(tvb, plaintext,
+ tvbuff_t *child_tvb;
+ child_tvb = tvb_new_child_real_data(tvb, plaintext,
length,
length);
- tvb_set_free_cb(next_tvb, g_free);
+ tvb_set_free_cb(child_tvb, g_free);
/* Add the decrypted data to the data source list. */
- add_new_data_source(actx->pinfo, next_tvb, "EncKrbCredPart");
+ add_new_data_source(actx->pinfo, child_tvb, "EncKrbCredPart");
- offset=dissect_ber_old_choice(actx, tree, next_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
+ offset=dissect_ber_old_choice(actx, tree, child_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
}
return offset;
}
@@ -3857,17 +3857,17 @@ dissect_krb5_decrypt_enc_authorization_data(proto_tree *tree, tvbuff_t *tvb, int
}
if(plaintext){
- tvbuff_t *next_tvb;
- next_tvb = tvb_new_child_real_data(tvb, plaintext,
+ tvbuff_t *child_tvb;
+ child_tvb = tvb_new_child_real_data(tvb, plaintext,
length,
length);
- tvb_set_free_cb(next_tvb, g_free);
+ tvb_set_free_cb(child_tvb, g_free);
/* Add the decrypted data to the data source list. */
- add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5");
+ add_new_data_source(actx->pinfo, child_tvb, "Decrypted Krb5");
- proto_tree_add_text(tree, next_tvb, 0, length, "AtuhorizationData for TGS_REQ not implemented yet");
+ proto_tree_add_text(tree, child_tvb, 0, length, "AtuhorizationData for TGS_REQ not implemented yet");
}
return offset;
@@ -4053,17 +4053,17 @@ dissect_krb5_decrypt_authenticator_data (proto_tree *tree, tvbuff_t *tvb, int of
}
if(plaintext){
- tvbuff_t *next_tvb;
- next_tvb = tvb_new_child_real_data(tvb, plaintext,
+ tvbuff_t *child_tvb;
+ child_tvb = tvb_new_child_real_data(tvb, plaintext,
length,
length);
- tvb_set_free_cb(next_tvb, g_free);
+ tvb_set_free_cb(child_tvb, g_free);
/* Add the decrypted data to the data source list. */
- add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5");
+ add_new_data_source(actx->pinfo, child_tvb, "Decrypted Krb5");
- offset=dissect_ber_old_choice(actx, tree, next_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
+ offset=dissect_ber_old_choice(actx, tree, child_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
}
return offset;
@@ -4133,17 +4133,17 @@ dissect_krb5_decrypt_Ticket_data (proto_tree *tree, tvbuff_t *tvb, int offset, a
* All Ticket encrypted parts use usage == 2
*/
if( (plaintext=decrypt_krb5_data(tree, actx->pinfo, 2, next_tvb, Ticket_etype, NULL)) ){
- tvbuff_t *next_tvb;
- next_tvb = tvb_new_child_real_data(tvb, plaintext,
+ tvbuff_t *child_tvb;
+ child_tvb = tvb_new_child_real_data(tvb, plaintext,
length,
length);
- tvb_set_free_cb(next_tvb, g_free);
+ tvb_set_free_cb(child_tvb, g_free);
/* Add the decrypted data to the data source list. */
- add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5");
+ add_new_data_source(actx->pinfo, child_tvb, "Decrypted Krb5");
- offset=dissect_ber_old_choice(actx, tree, next_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
+ offset=dissect_ber_old_choice(actx, tree, child_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
}
return offset;
@@ -4386,17 +4386,17 @@ dissect_krb5_decrypt_KDC_REP_data (proto_tree *tree, tvbuff_t *tvb, int offset,
}
if(plaintext){
- tvbuff_t *next_tvb;
- next_tvb = tvb_new_child_real_data(tvb, plaintext,
+ tvbuff_t *child_tvb;
+ child_tvb = tvb_new_child_real_data(tvb, plaintext,
length,
length);
- tvb_set_free_cb(next_tvb, g_free);
+ tvb_set_free_cb(child_tvb, g_free);
/* Add the decrypted data to the data source list. */
- add_new_data_source(actx->pinfo, next_tvb, "Decrypted Krb5");
+ add_new_data_source(actx->pinfo, child_tvb, "Decrypted Krb5");
- offset=dissect_ber_old_choice(actx, tree, next_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
+ offset=dissect_ber_old_choice(actx, tree, child_tvb, 0, kerberos_applications_choice, -1, -1, NULL);
}
return offset;
@@ -4710,7 +4710,7 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
saved_private_data=pinfo->private_data;
pinfo->private_data=cb;
- do_col_info=dci;
+ gbl_do_col_info=dci;
if (have_rm) {
krb_rm = tvb_get_ntohl(tvb, offset);
@@ -4773,7 +4773,7 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (do_col_protocol) {
col_set_str(pinfo->cinfo, COL_PROTOCOL, "KRB5");
}
- if (do_col_info) {
+ if (gbl_do_col_info) {
col_clear(pinfo->cinfo, COL_INFO);
}
if (tree) {
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c
index 2b4c60f542..790624067a 100644
--- a/epan/dissectors/packet-l2tp.c
+++ b/epan/dissectors/packet-l2tp.c
@@ -593,7 +593,7 @@ static dissector_handle_t data_handle;
static void process_control_avps(tvbuff_t *tvb,
packet_info *pinfo,
proto_tree *l2tp_tree,
- int index,
+ int idx,
int length)
{
proto_tree *l2tp_lcp_avp_tree, *l2tp_avp_tree, *l2tp_avp_tree_sub;
@@ -612,29 +612,29 @@ static void process_control_avps(tvbuff_t *tvb,
guint32 bits;
guint16 firmware_rev;
- while (index < length) { /* Process AVP's */
- ver_len_hidden = tvb_get_ntohs(tvb, index);
+ while (idx < length) { /* Process AVP's */
+ ver_len_hidden = tvb_get_ntohs(tvb, idx);
avp_len = AVP_LENGTH(ver_len_hidden);
- avp_vendor_id = tvb_get_ntohs(tvb, index + 2);
- avp_type = tvb_get_ntohs(tvb, index + 4);
+ avp_vendor_id = tvb_get_ntohs(tvb, idx + 2);
+ avp_type = tvb_get_ntohs(tvb, idx + 4);
if (avp_len < 1) {
- proto_tree_add_text(l2tp_tree, tvb, index, 0,
+ proto_tree_add_text(l2tp_tree, tvb, idx, 0,
"AVP length must be >= 1");
return;
}
if (avp_vendor_id == VENDOR_IETF) {
- tf = proto_tree_add_text(l2tp_tree, tvb, index,
+ tf = proto_tree_add_text(l2tp_tree, tvb, idx,
avp_len, "%s AVP",
val_to_str(avp_type, avp_type_vals, "Unknown (%u)"));
} else if (avp_vendor_id == VENDOR_CISCO) { /* Vendor-Specific AVP */
- tf = proto_tree_add_text(l2tp_tree, tvb, index,
+ tf = proto_tree_add_text(l2tp_tree, tvb, idx,
avp_len, "Vendor %s: %s AVP",
val_to_str(avp_vendor_id, sminmpec_values, "Unknown (%u)"),
val_to_str(avp_type, cisco_avp_type_vals, "Unknown (%u)"));
} else { /* Vendor-Specific AVP */
- tf = proto_tree_add_text(l2tp_tree, tvb, index,
+ tf = proto_tree_add_text(l2tp_tree, tvb, idx,
avp_len, "Vendor %s AVP Type %u",
val_to_str(avp_vendor_id, sminmpec_values, "Unknown (%u)"),
avp_type);
@@ -643,172 +643,172 @@ static void process_control_avps(tvbuff_t *tvb,
l2tp_avp_tree = proto_item_add_subtree(tf, ett_l2tp_avp);
- proto_tree_add_boolean_format(l2tp_avp_tree,hf_l2tp_avp_mandatory, tvb, index, 1,
+ proto_tree_add_boolean_format(l2tp_avp_tree,hf_l2tp_avp_mandatory, tvb, idx, 1,
rhcode, "Mandatory: %s",
(MANDATORY_BIT(ver_len_hidden)) ? "True" : "False" );
- proto_tree_add_boolean_format(l2tp_avp_tree,hf_l2tp_avp_hidden, tvb, index, 1,
+ proto_tree_add_boolean_format(l2tp_avp_tree,hf_l2tp_avp_hidden, tvb, idx, 1,
rhcode, "Hidden: %s",
(HIDDEN_BIT(ver_len_hidden)) ? "True" : "False" );
- proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_avp_length, tvb, index, 2,
+ proto_tree_add_uint_format(l2tp_avp_tree,hf_l2tp_avp_length, tvb, idx, 2,
rhcode, "Length: %u", avp_len);
if (HIDDEN_BIT(ver_len_hidden)) { /* don't try do display hidden */
- index += avp_len;
+ idx += avp_len;
continue;
}
if (avp_len < 6) {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 0,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 0,
"AVP length must be >= 6");
return;
}
- index += 2;
+ idx += 2;
avp_len -= 2;
/* Special Case for handling Extended Vendor Id */
if (avp_type == EXTENDED_VENDOR_ID) {
- index += 2;
+ idx += 2;
avp_len -= 2;
proto_tree_add_item(l2tp_avp_tree, hf_l2tp_avp_vendor_id,
- tvb, index, 4, FALSE);
+ tvb, idx, 4, FALSE);
- avp_vendor_id = tvb_get_ntohl(tvb, index);
+ avp_vendor_id = tvb_get_ntohl(tvb, idx);
- index += 4;
+ idx += 4;
avp_len -= 4;
continue;
}
else {
proto_tree_add_item(l2tp_avp_tree, hf_l2tp_avp_vendor_id,
- tvb, index, 2, FALSE);
- index += 2;
+ tvb, idx, 2, FALSE);
+ idx += 2;
avp_len -= 2;
}
if (avp_vendor_id == VENDOR_CISCO) {
proto_tree_add_uint(l2tp_avp_tree, hf_l2tp_cisco_avp_type,
- tvb, index, 2, avp_type);
- index += 2;
+ tvb, idx, 2, avp_type);
+ idx += 2;
avp_len -= 2;
/* For the time being, we don't decode any Vendor-
specific AVP. */
switch (avp_type) {
case CISCO_ASSIGNED_CONNECTION_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Assigned Control Connection ID: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case CISCO_PW_CAPABILITY_LIST:
- te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ te = proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Pseudowire Capabilities List");
l2tp_avp_tree_sub = proto_item_add_subtree(te, ett_l2tp_avp_sub);
while (avp_len >= 2) {
- int pw_type = tvb_get_ntohs(tvb, index);
+ int pw_type = tvb_get_ntohs(tvb, idx);
- proto_tree_add_text(l2tp_avp_tree_sub, tvb, index,
+ proto_tree_add_text(l2tp_avp_tree_sub, tvb, idx,
2, "PW Type: (%u) %s",
pw_type,
val_to_str(pw_type, pw_types_vals,
"Unknown (0x%04x)"));
- index += 2;
+ idx += 2;
avp_len -= 2;
}
break;
case CISCO_LOCAL_SESSION_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Local Session ID: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case CISCO_REMOTE_SESSION_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Remote Session ID: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case CISCO_ASSIGNED_COOKIE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Assigned Cookie: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case CISCO_REMOTE_END_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Remote End ID: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case CISCO_PW_TYPE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Pseudowire Type: %u - %s",
- tvb_get_ntohs(tvb, index),
- val_to_str(tvb_get_ntohs(tvb, index),
+ tvb_get_ntohs(tvb, idx),
+ val_to_str(tvb_get_ntohs(tvb, idx),
pw_types_vals, "Unknown (0x%04x)"));
break;
case CISCO_CIRCUIT_STATUS:
- bits = tvb_get_ntohs(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ bits = tvb_get_ntohs(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Circuit Status: %s",
(CIRCUIT_STATUS_BIT(bits)) ? "Up" : "Down");
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Circuit Type: %s",
(CIRCUIT_TYPE_BIT(bits)) ? "New" : "Existing");
break;
case CISCO_SESSION_TIE_BREAKER:
proto_tree_add_item(l2tp_avp_tree, hf_l2tp_tie_breaker,
- tvb, index, 8, FALSE);
+ tvb, idx, 8, FALSE);
break;
case CISCO_DRAFT_AVP_VERSION:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Draft AVP Version: %u",
- tvb_get_ntohs(tvb, index));
+ tvb_get_ntohs(tvb, idx));
break;
case CISCO_MESSAGE_DIGEST:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Message Digest: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case CISCO_AUTH_NONCE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Nonce: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case CISCO_INTERFACE_MTU:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Interface MTU: %u",
- tvb_get_ntohs(tvb, index));
+ tvb_get_ntohs(tvb, idx));
break;
default:
- proto_tree_add_text(l2tp_avp_tree, tvb, index,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx,
avp_len, "Vendor-Specific AVP");
break;
}
- index += avp_len;
+ idx += avp_len;
continue;
} else if (avp_vendor_id != VENDOR_IETF) {
if (avp_len >= 2) {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Type: %u", avp_type);
- index += 2;
+ idx += 2;
avp_len -= 2;
if (avp_len > 0) {
- proto_tree_add_text(l2tp_avp_tree, tvb, index,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx,
avp_len, "Vendor-Specific AVP");
}
}
- index += avp_len;
+ idx += avp_len;
continue;
}
proto_tree_add_uint(l2tp_avp_tree, hf_l2tp_avp_type,
- tvb, index, 2, avp_type);
- index += 2;
+ tvb, idx, 2, avp_type);
+ idx += 2;
avp_len -= 2;
switch (avp_type) {
case CONTROL_MESSAGE:
- msg_type = tvb_get_ntohs(tvb, index);
- proto_tree_add_text(l2tp_avp_tree,tvb, index, 2,
+ msg_type = tvb_get_ntohs(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree,tvb, idx, 2,
"Control Message Type: (%u) %s", msg_type,
((NUM_CONTROL_CALL_TYPES + 1 ) > msg_type) ?
calltypestr[msg_type] : "Unknown");
@@ -821,105 +821,105 @@ static void process_control_avps(tvbuff_t *tvb,
case RESULT_ERROR_CODE:
if (avp_len < 2)
break;
- result_code = tvb_get_ntohs(tvb, index);
+ result_code = tvb_get_ntohs(tvb, idx);
if (isStopCcn) {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Result code: %u - %s", result_code,
val_to_str(result_code, result_code_stopccn_vals, "Unknown (%u)"));
}
else {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Result code: %u - %s", result_code,
val_to_str(result_code, result_code_cdn_vals, "Unknown (%u)"));
}
- index += 2;
+ idx += 2;
avp_len -= 2;
if (avp_len < 2)
break;
- error_code = tvb_get_ntohs(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ error_code = tvb_get_ntohs(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Error code: %u - %s", error_code,
val_to_str(error_code, error_code_vals, "Unknown (%u)"));
- index += 2;
+ idx += 2;
avp_len -= 2;
if (avp_len == 0)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Error Message: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case PROTOCOL_VERSION:
if (avp_len < 1)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 1,
- "Version: %u", tvb_get_guint8(tvb, index));
- index += 1;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 1,
+ "Version: %u", tvb_get_guint8(tvb, idx));
+ idx += 1;
avp_len -= 1;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 1,
- "Revision: %u", tvb_get_guint8(tvb, index));
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 1,
+ "Revision: %u", tvb_get_guint8(tvb, idx));
break;
case FRAMING_CAPABILITIES:
- bits = tvb_get_ntohl(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ bits = tvb_get_ntohl(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Async Framing Supported: %s",
(FRAMING_ASYNC(bits)) ? "True" : "False");
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Sync Framing Supported: %s",
(FRAMING_SYNC(bits)) ? "True" : "False");
break;
case BEARER_CAPABILITIES:
- bits = tvb_get_ntohl(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ bits = tvb_get_ntohl(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Analog Access Supported: %s",
(BEARER_ANALOG(bits)) ? "True" : "False");
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Digital Access Supported: %s",
(BEARER_DIGITAL(bits)) ? "True" : "False");
break;
case TIE_BREAKER:
- proto_tree_add_item(l2tp_avp_tree, hf_l2tp_tie_breaker, tvb, index, 8, FALSE);
+ proto_tree_add_item(l2tp_avp_tree, hf_l2tp_tie_breaker, tvb, idx, 8, FALSE);
break;
case FIRMWARE_REVISION:
- firmware_rev = tvb_get_ntohs(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ firmware_rev = tvb_get_ntohs(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Firmware Revision: %d 0x%x", firmware_rev,firmware_rev );
break;
case HOST_NAME:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Host Name: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case VENDOR_NAME:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Vendor Name: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case ASSIGNED_TUNNEL_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
- "Tunnel ID: %u", tvb_get_ntohs(tvb, index));
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
+ "Tunnel ID: %u", tvb_get_ntohs(tvb, idx));
break;
case RECEIVE_WINDOW_SIZE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Receive Window Size: %u",
- tvb_get_ntohs(tvb, index));
+ tvb_get_ntohs(tvb, idx));
break;
case CHALLENGE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"CHAP Challenge: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case CAUSE_CODE:
@@ -930,73 +930,73 @@ static void process_control_avps(tvbuff_t *tvb,
*/
if (avp_len < 2)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Cause Code: %u",
- tvb_get_ntohs(tvb, index));
- index += 2;
+ tvb_get_ntohs(tvb, idx));
+ idx += 2;
avp_len -= 2;
if (avp_len < 1)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 1,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 1,
"Cause Msg: %u",
- tvb_get_guint8(tvb, index));
- index += 1;
+ tvb_get_guint8(tvb, idx));
+ idx += 1;
avp_len -= 1;
if (avp_len == 0)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Advisory Msg: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case CHALLENGE_RESPONSE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 16,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 16,
"CHAP Challenge Response: %s",
- tvb_bytes_to_str(tvb, index, 16));
+ tvb_bytes_to_str(tvb, idx, 16));
break;
case ASSIGNED_SESSION:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Assigned Session: %u",
- tvb_get_ntohs(tvb, index));
+ tvb_get_ntohs(tvb, idx));
break;
case CALL_SERIAL_NUMBER:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Call Serial Number: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case MINIMUM_BPS:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Minimum BPS: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case MAXIMUM_BPS:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Maximum BPS: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case BEARER_TYPE:
- bits = tvb_get_ntohl(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ bits = tvb_get_ntohl(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Analog Bearer Type: %s",
(BEARER_ANALOG(bits)) ? "True" : "False");
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Digital Bearer Type: %s",
(BEARER_DIGITAL(bits)) ? "True" : "False");
break;
case FRAMING_TYPE:
- bits = tvb_get_ntohl(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ bits = tvb_get_ntohl(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Async Framing Type: %s",
(FRAMING_ASYNC(bits)) ? "True" : "False");
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Sync Framing Type: %s",
(FRAMING_SYNC(bits)) ? "True" : "False");
break;
@@ -1004,69 +1004,69 @@ static void process_control_avps(tvbuff_t *tvb,
case CALLED_NUMBER:
if (avp_len == 0)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Called Number: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case CALLING_NUMBER:
if (avp_len == 0)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Calling Number: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case SUB_ADDRESS:
if (avp_len == 0)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Sub-Address: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case TX_CONNECT_SPEED:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Connect Speed: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case PHYSICAL_CHANNEL:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Physical Channel: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case INITIAL_RECEIVED_LCP_CONFREQ:
- te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ te = proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Initial Received LCP CONFREQ: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp);
- next_tvb = tvb_new_subset(tvb, index, avp_len, avp_len);
+ next_tvb = tvb_new_subset(tvb, idx, avp_len, avp_len);
call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree );
break;
case LAST_SENT_LCP_CONFREQ:
- te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ te = proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Last Sent LCP CONFREQ: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp);
- next_tvb = tvb_new_subset(tvb, index, avp_len, avp_len);
+ next_tvb = tvb_new_subset(tvb, idx, avp_len, avp_len);
call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree );
break;
case LAST_RECEIVED_LCP_CONFREQ:
- te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ te = proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Last Received LCP CONFREQ: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
l2tp_lcp_avp_tree = proto_item_add_subtree(te, ett_l2tp_lcp);
- next_tvb = tvb_new_subset(tvb, index, avp_len, avp_len);
+ next_tvb = tvb_new_subset(tvb, idx, avp_len, avp_len);
call_dissector(ppp_lcp_options_handle, next_tvb, pinfo, l2tp_lcp_avp_tree );
break;
case PROXY_AUTHEN_TYPE:
- msg_type = tvb_get_ntohs(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ msg_type = tvb_get_ntohs(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Proxy Authen Type: %s",
val_to_str(msg_type, authen_type_vals, "Unknown (%u)"));
break;
@@ -1074,239 +1074,239 @@ static void process_control_avps(tvbuff_t *tvb,
case PROXY_AUTHEN_NAME:
if (avp_len == 0)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Proxy Authen Name: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case PROXY_AUTHEN_CHALLENGE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Proxy Authen Challenge: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case PROXY_AUTHEN_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index + 1, 1,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx + 1, 1,
"Proxy Authen ID: %u",
- tvb_get_guint8(tvb, index + 1));
+ tvb_get_guint8(tvb, idx + 1));
break;
case PROXY_AUTHEN_RESPONSE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Proxy Authen Response: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case CALL_STATUS_AVPS:
if (avp_len < 2)
break;
- index += 2;
+ idx += 2;
avp_len -= 2;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "CRC Errors: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "CRC Errors: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "Framing Errors: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "Framing Errors: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "Hardware Overruns: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "Hardware Overruns: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "Buffer Overruns: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "Buffer Overruns: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "Time-out Errors: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "Time-out Errors: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "Alignment Errors: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "Alignment Errors: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
break;
case ACCM:
if (avp_len < 2)
break;
- index += 2;
+ idx += 2;
avp_len -= 2;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "Send ACCM: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "Send ACCM: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
if (avp_len < 4)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
- "Receive ACCM: %u", tvb_get_ntohl(tvb, index));
- index += 4;
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
+ "Receive ACCM: %u", tvb_get_ntohl(tvb, idx));
+ idx += 4;
avp_len -= 4;
break;
case RANDOM_VECTOR:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Random Vector: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case PRIVATE_GROUP_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Private Group ID: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case RX_CONNECT_SPEED:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Rx Connect Speed: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case PPP_DISCONNECT_CAUSE_CODE:
if (avp_len < 2)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Disconnect Code: %u",
- tvb_get_ntohs(tvb, index));
- index += 2;
+ tvb_get_ntohs(tvb, idx));
+ idx += 2;
avp_len -= 2;
if (avp_len < 2)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Control Protocol Number: %u",
- tvb_get_ntohs(tvb, index));
- index += 2;
+ tvb_get_ntohs(tvb, idx));
+ idx += 2;
avp_len -= 2;
if (avp_len < 1)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 1,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 1,
"Direction: %s",
- val_to_str(tvb_get_guint8(tvb, index),
+ val_to_str(tvb_get_guint8(tvb, idx),
cause_code_direction_vals,
"Reserved (%u)"));
- index += 1;
+ idx += 1;
avp_len -= 1;
if (avp_len == 0)
break;
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Message: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case MESSAGE_DIGEST:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Message Digest: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case ROUTER_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Router ID: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case ASSIGNED_CONTROL_CONN_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Assigned Control Connection ID: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case PW_CAPABILITY_LIST:
- te = proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ te = proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Pseudowire Capabilities List");
l2tp_avp_tree_sub = proto_item_add_subtree(te, ett_l2tp_avp_sub);
while (avp_len >= 2) {
- int pw_type = tvb_get_ntohs(tvb, index);
- proto_tree_add_text(l2tp_avp_tree_sub, tvb, index,
+ int pw_type = tvb_get_ntohs(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree_sub, tvb, idx,
2, "PW Type: (%u) %s",
pw_type,
val_to_str(pw_type, pw_types_vals,
"Unknown (0x%04x)"));
- index += 2;
+ idx += 2;
avp_len -= 2;
}
break;
case LOCAL_SESSION_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Local Session ID: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case REMOTE_SESSION_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 4,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 4,
"Remote Session ID: %u",
- tvb_get_ntohl(tvb, index));
+ tvb_get_ntohl(tvb, idx));
break;
case ASSIGNED_COOKIE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Assigned Cookie: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case REMOTE_END_ID:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Remote End ID: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case PW_TYPE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Pseudowire Type: %u - %s",
- tvb_get_ntohs(tvb, index),
- val_to_str(tvb_get_ntohs(tvb, index),
+ tvb_get_ntohs(tvb, idx),
+ val_to_str(tvb_get_ntohs(tvb, idx),
pw_types_vals, "Unknown (0x%04x)"));
break;
case L2_SPECIFIC_SUBLAYER:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Layer2 Specific Sublayer: %s",
- val_to_str(tvb_get_ntohs(tvb, index),
+ val_to_str(tvb_get_ntohs(tvb, idx),
l2_sublayer_vals, "Invalid (%u)"));
break;
case DATA_SEQUENCING:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Data Sequencing: %s",
- val_to_str(tvb_get_ntohs(tvb, index),
+ val_to_str(tvb_get_ntohs(tvb, idx),
data_sequencing_vals, "Invalid (%u)"));
break;
case CIRCUIT_STATUS:
- bits = tvb_get_ntohs(tvb, index);
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ bits = tvb_get_ntohs(tvb, idx);
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Circuit Status: %s",
(CIRCUIT_STATUS_BIT(bits)) ? "Up" : "Down");
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 2,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 2,
"Circuit Type: %s",
(CIRCUIT_TYPE_BIT(bits)) ? "New" : "Existing");
break;
case PREFERRED_LANGUAGE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Preferred Language: %s",
- tvb_format_text(tvb, index, avp_len));
+ tvb_format_text(tvb, idx, avp_len));
break;
case CTL_MSG_AUTH_NONCE:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Nonce: %s",
- tvb_bytes_to_str(tvb, index, avp_len));
+ tvb_bytes_to_str(tvb, idx, avp_len));
break;
case TX_CONNECT_SPEED_V3:
{
@@ -1314,14 +1314,14 @@ static void process_control_avps(tvbuff_t *tvb,
if (avp_len < 8)
break;
- h_int = tvb_get_ntohl(tvb, index);
- l_int = tvb_get_ntohl(tvb, index+4);
+ h_int = tvb_get_ntohl(tvb, idx);
+ l_int = tvb_get_ntohl(tvb, idx+4);
if (!h_int && !l_int) {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 8,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 8,
"Tx Connect Speed v3: indeterminable or no physical p2p link");
}
else {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 8,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 8,
"Tx Connect Speed v3: %#x%04x",
h_int, l_int);
}
@@ -1333,26 +1333,26 @@ static void process_control_avps(tvbuff_t *tvb,
if (avp_len < 8)
break;
- h_int = tvb_get_ntohl(tvb, index);
- l_int = tvb_get_ntohl(tvb, index+4);
+ h_int = tvb_get_ntohl(tvb, idx);
+ l_int = tvb_get_ntohl(tvb, idx+4);
if (!h_int && !l_int) {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 8,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 8,
"Rx Connect Speed v3: indeterminable or no physical p2p link");
}
else {
- proto_tree_add_text(l2tp_avp_tree, tvb, index, 8,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, 8,
"Rx Connect Speed v3: %#x%04x",
h_int, l_int);
}
break;
}
default:
- proto_tree_add_text(l2tp_avp_tree, tvb, index, avp_len,
+ proto_tree_add_text(l2tp_avp_tree, tvb, idx, avp_len,
"Unknown AVP");
break;
}
- index += avp_len;
+ idx += avp_len;
}
}
@@ -1364,9 +1364,9 @@ static void process_control_avps(tvbuff_t *tvb,
*/
static void
process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_tree *l2tp_tree, proto_item *l2tp_item, int *pIndex)
+ proto_tree *l2tp_tree, proto_item *l2tp_item, int *pIdx)
{
- int index = *pIndex;
+ int idx = *pIdx;
int sid;
guint8 oam_cell = 0;
proto_tree *l2_specific = NULL;
@@ -1374,8 +1374,8 @@ process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvbuff_t *next_tvb;
/* Get Session ID */
- sid = tvb_get_ntohl(tvb, index);
- index += 4;
+ sid = tvb_get_ntohl(tvb, idx);
+ idx += 4;
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo,COL_INFO,
@@ -1384,82 +1384,82 @@ process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_sid, tvb, index-4, 4, FALSE);
- proto_item_set_len(l2tp_item, index);
- if (!(tvb_offset_exists(tvb, index)))
+ proto_tree_add_item(l2tp_tree, hf_l2tp_sid, tvb, idx-4, 4, FALSE);
+ proto_item_set_len(l2tp_item, idx);
+ if (!(tvb_offset_exists(tvb, idx)))
return;
if (l2tpv3_cookie != 0)
- proto_tree_add_item(l2tp_tree, hf_l2tp_cookie, tvb, index, l2tpv3_cookie, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_cookie, tvb, idx, l2tpv3_cookie, FALSE);
}
switch(l2tpv3_l2_specific){
case L2TPv3_L2_SPECIFIC_DEFAULT:
if (tree) {
ti = proto_tree_add_item(tree, hf_l2tp_l2_spec_def,
- tvb, index + l2tpv3_cookie, 4, FALSE);
+ tvb, idx + l2tpv3_cookie, 4, FALSE);
l2_specific = proto_item_add_subtree(ti, ett_l2tp_l2_spec);
- proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_s, tvb, index + l2tpv3_cookie,
+ proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_s, tvb, idx + l2tpv3_cookie,
1, FALSE);
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_sequence, tvb,
- index + l2tpv3_cookie + 1, 3, FALSE);
+ idx + l2tpv3_cookie + 1, 3, FALSE);
}
- next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie + 4);
+ next_tvb = tvb_new_subset_remaining(tvb, idx + l2tpv3_cookie + 4);
break;
case L2TPv3_L2_SPECIFIC_DOCSIS_DMPT:
if (tree) {
ti = proto_tree_add_item(tree, hf_l2tp_l2_spec_docsis_dmpt,
- tvb, index + l2tpv3_cookie, 4, FALSE);
+ tvb, idx + l2tpv3_cookie, 4, FALSE);
l2_specific = proto_item_add_subtree(ti, ett_l2tp_l2_spec);
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_v, tvb,
- index + l2tpv3_cookie,1, FALSE);
+ idx + l2tpv3_cookie,1, FALSE);
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_s, tvb,
- index + l2tpv3_cookie,1, FALSE);
+ idx + l2tpv3_cookie,1, FALSE);
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_flow_id, tvb,
- index + l2tpv3_cookie,1, FALSE);
+ idx + l2tpv3_cookie,1, FALSE);
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_sequence, tvb,
- index + l2tpv3_cookie + 2,2, FALSE);
+ idx + l2tpv3_cookie + 2,2, FALSE);
}
- next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie + 4);
+ next_tvb = tvb_new_subset_remaining(tvb, idx + l2tpv3_cookie + 4);
break;
case L2TPv3_L2_SPECIFIC_ATM:
if (tree) {
ti = proto_tree_add_item(tree, hf_l2tp_l2_spec_atm,
- tvb, index + l2tpv3_cookie, 4, FALSE);
+ tvb, idx + l2tpv3_cookie, 4, FALSE);
l2_specific = proto_item_add_subtree(ti, ett_l2tp_l2_spec);
- proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_s, tvb, index + l2tpv3_cookie,
+ proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_s, tvb, idx + l2tpv3_cookie,
1, FALSE);
- proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_t, tvb, index + l2tpv3_cookie,
+ proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_t, tvb, idx + l2tpv3_cookie,
1, FALSE);
/*
* As per RFC 4454, the T bit specifies whether
* we're transporting an OAM cell or an AAL5 frame.
*/
- oam_cell = tvb_get_guint8(tvb, index + l2tpv3_cookie) & 0x08;
- proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_g, tvb, index + l2tpv3_cookie,
+ oam_cell = tvb_get_guint8(tvb, idx + l2tpv3_cookie) & 0x08;
+ proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_g, tvb, idx + l2tpv3_cookie,
1, FALSE);
- proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_c, tvb, index + l2tpv3_cookie,
+ proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_c, tvb, idx + l2tpv3_cookie,
1, FALSE);
- proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_u, tvb, index + l2tpv3_cookie,
+ proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_u, tvb, idx + l2tpv3_cookie,
1, FALSE);
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_sequence, tvb,
- index + l2tpv3_cookie + 1, 3, FALSE);
+ idx + l2tpv3_cookie + 1, 3, FALSE);
}
- next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie + 4);
+ next_tvb = tvb_new_subset_remaining(tvb, idx + l2tpv3_cookie + 4);
break;
case L2TPv3_L2_SPECIFIC_LAPD:
if (tree)
- proto_tree_add_text(tree, tvb, index + l2tpv3_cookie + 4, 3,"LAPD info");
- next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie+4+3);
+ proto_tree_add_text(tree, tvb, idx + l2tpv3_cookie + 4, 3,"LAPD info");
+ next_tvb = tvb_new_subset_remaining(tvb, idx + l2tpv3_cookie+4+3);
break;
case L2TPv3_L2_SPECIFIC_NONE:
default:
- next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie);
+ next_tvb = tvb_new_subset_remaining(tvb, idx + l2tpv3_cookie);
break;
}
@@ -1516,14 +1516,14 @@ process_l2tpv3_data_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *l2tp_tree = NULL, *ctrl_tree;
proto_item *l2tp_item = NULL, *ti;
- int index = 0;
+ int idx = 0;
int control;
int sid;
- control = tvb_get_ntohs(tvb, index);
- index += 2; /* skip ahead */
- index += 2; /* Skip the reserved */
- sid = tvb_get_ntohl(tvb, index);
+ control = tvb_get_ntohs(tvb, idx);
+ idx += 2; /* skip ahead */
+ idx += 2; /* Skip the reserved */
+ sid = tvb_get_ntohl(tvb, idx);
if (tree) {
l2tp_item = proto_tree_add_item(tree, proto_l2tp, tvb, 0, -1, FALSE);
@@ -1543,8 +1543,8 @@ process_l2tpv3_data_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(l2tp_tree, hf_l2tp_res, tvb, 2, 2, FALSE);
}
- /* Call process_l2tpv3_data from Session ID (offset in index of 4) */
- process_l2tpv3_data(tvb, pinfo, tree, l2tp_tree, l2tp_item, &index);
+ /* Call process_l2tpv3_data from Session ID (offset in idx of 4) */
+ process_l2tpv3_data(tvb, pinfo, tree, l2tp_tree, l2tp_item, &idx);
}
/*
@@ -1557,10 +1557,10 @@ process_l2tpv3_data_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *l2tp_tree = NULL;
proto_item *l2tp_item = NULL, *ti;
- int index = 0;
+ int idx = 0;
int sid;
- sid = tvb_get_ntohl(tvb, index);
+ sid = tvb_get_ntohl(tvb, idx);
if (tree) {
l2tp_item = proto_tree_add_item(tree, proto_l2tp, tvb, 0, -1, FALSE);
@@ -1572,8 +1572,8 @@ process_l2tpv3_data_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
data_msg, sid);
}
- /* Call process_l2tpv3_data from Session ID (offset in index of 0) */
- process_l2tpv3_data(tvb, pinfo, tree, l2tp_tree, l2tp_item, &index);
+ /* Call process_l2tpv3_data from Session ID (offset in idx of 0) */
+ process_l2tpv3_data(tvb, pinfo, tree, l2tp_tree, l2tp_item, &idx);
}
/*
@@ -1581,32 +1581,32 @@ process_l2tpv3_data_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* to then call process_control_avps after dissecting the control.
*/
static void
-process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int baseIndex)
+process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int baseIdx)
{
proto_tree *l2tp_tree=NULL, *ctrl_tree;
proto_item *l2tp_item = NULL, *ti;
- int index = baseIndex;
- int tmp_index;
+ int idx = baseIdx;
+ int tmp_idx;
guint16 length = 0; /* Length field */
guint32 ccid = 0; /* Control Connection ID */
guint16 avp_type;
guint16 msg_type;
guint16 control = 0;
- control = tvb_get_ntohs(tvb, index);
- index += 2; /* skip ahead */
+ control = tvb_get_ntohs(tvb, idx);
+ idx += 2; /* skip ahead */
if (LENGTH_BIT(control)) { /* length field included ? */
- length = tvb_get_ntohs(tvb, index);
- index += 2;
+ length = tvb_get_ntohs(tvb, idx);
+ idx += 2;
}
/* Get Control Channel ID */
- ccid = tvb_get_ntohl(tvb, index);
- index += 4;
+ ccid = tvb_get_ntohl(tvb, idx);
+ idx += 4;
if (check_col(pinfo->cinfo, COL_INFO)) {
- tmp_index = index;
+ tmp_idx = idx;
if ((LENGTH_BIT(control))&&(length==12)) /* ZLB Message */
col_add_fstr(pinfo->cinfo, COL_INFO,
@@ -1615,18 +1615,18 @@ process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
else
{
if (SEQUENCE_BIT(control)) {
- tmp_index += 4;
+ tmp_idx += 4;
}
- tmp_index+=4;
+ tmp_idx+=4;
- avp_type = tvb_get_ntohs(tvb, tmp_index);
- tmp_index += 2;
+ avp_type = tvb_get_ntohs(tvb, tmp_idx);
+ tmp_idx += 2;
if (avp_type == CONTROL_MESSAGE) {
/* We print message type */
- msg_type = tvb_get_ntohs(tvb, tmp_index);
- tmp_index += 2;
+ msg_type = tvb_get_ntohs(tvb, tmp_idx);
+ tmp_idx += 2;
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s - %s (tunnel id=%u)",
control_msg ,
@@ -1655,7 +1655,7 @@ process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
* the tvbuff? Have "set_actual_length()" return a Boolean
* and have its callers check the result?
*/
- set_actual_length(tvb, length+baseIndex);
+ set_actual_length(tvb, length+baseIdx);
}
if (tree) {
@@ -1663,41 +1663,41 @@ process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
l2tp_tree = proto_item_add_subtree(l2tp_item, ett_l2tp);
proto_item_append_text(l2tp_item, " version 3");
- if (baseIndex) {
+ if (baseIdx) {
proto_tree_add_item(l2tp_tree, hf_l2tp_sid, tvb, 0, 4, FALSE);
}
- ti = proto_tree_add_text(l2tp_tree, tvb, baseIndex, 2,
+ ti = proto_tree_add_text(l2tp_tree, tvb, baseIdx, 2,
"Packet Type: %s Control Connection Id=%d",
(CONTROL_BIT(control) ? control_msg : data_msg), ccid);
ctrl_tree = proto_item_add_subtree(ti, ett_l2tp_ctrl);
- proto_tree_add_uint(ctrl_tree, hf_l2tp_type, tvb, baseIndex, 2, control);
- proto_tree_add_boolean(ctrl_tree, hf_l2tp_length_bit, tvb, baseIndex, 2, control);
- proto_tree_add_boolean(ctrl_tree, hf_l2tp_seq_bit, tvb, baseIndex, 2, control);
- proto_tree_add_uint(ctrl_tree, hf_l2tp_version, tvb, baseIndex, 2, control);
+ proto_tree_add_uint(ctrl_tree, hf_l2tp_type, tvb, baseIdx, 2, control);
+ proto_tree_add_boolean(ctrl_tree, hf_l2tp_length_bit, tvb, baseIdx, 2, control);
+ proto_tree_add_boolean(ctrl_tree, hf_l2tp_seq_bit, tvb, baseIdx, 2, control);
+ proto_tree_add_uint(ctrl_tree, hf_l2tp_version, tvb, baseIdx, 2, control);
}
- index = baseIndex + 2;
+ idx = baseIdx + 2;
if (LENGTH_BIT(control)) {
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_length, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_length, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
}
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_ccid, tvb, index, 4, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_ccid, tvb, idx, 4, FALSE);
}
- index += 4;
+ idx += 4;
if (SEQUENCE_BIT(control)) {
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_Ns, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_Ns, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_Nr, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_Nr, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
}
if (tree && (LENGTH_BIT(control))&&(length==12)) {
@@ -1708,7 +1708,7 @@ process_l2tpv3_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
return;
}
- process_control_avps(tvb, pinfo, l2tp_tree, index, length+baseIndex);
+ process_control_avps(tvb, pinfo, l2tp_tree, idx, length+baseIdx);
}
/*
@@ -1722,8 +1722,8 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *l2tp_tree=NULL, *ctrl_tree;
proto_item *l2tp_item = NULL, *ti;
- int index = 0;
- int tmp_index;
+ int idx = 0;
+ int tmp_idx;
guint16 length = 0; /* Length field */
guint16 tid; /* Tunnel ID */
guint16 cid; /* Call ID */
@@ -1773,20 +1773,20 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (LENGTH_BIT(control)) { /* length field included ? */
- index += 2; /* skip ahead */
- length = tvb_get_ntohs(tvb, index);
+ idx += 2; /* skip ahead */
+ length = tvb_get_ntohs(tvb, idx);
}
/* collect the tunnel id & call id */
- index += 2;
- tid = tvb_get_ntohs(tvb, index);
- index += 2;
- cid = tvb_get_ntohs(tvb, index);
+ idx += 2;
+ tid = tvb_get_ntohs(tvb, idx);
+ idx += 2;
+ cid = tvb_get_ntohs(tvb, idx);
if (check_col(pinfo->cinfo, COL_INFO)) {
if (CONTROL_BIT(control)) {
/* CONTROL MESSAGE */
- tmp_index = index;
+ tmp_idx = idx;
if ((LENGTH_BIT(control))&&(length==12)) /* ZLB Message */
col_add_fstr(pinfo->cinfo, COL_INFO,
@@ -1795,16 +1795,16 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
if (SEQUENCE_BIT(control)) {
- tmp_index += 4;
+ tmp_idx += 4;
}
- tmp_index+=4;
+ tmp_idx+=4;
- avp_type = tvb_get_ntohs(tvb, (tmp_index+=2));
+ avp_type = tvb_get_ntohs(tvb, (tmp_idx+=2));
if (avp_type == CONTROL_MESSAGE) {
/* We print message type */
- msg_type = tvb_get_ntohs(tvb, (tmp_index+=2));
+ msg_type = tvb_get_ntohs(tvb, (tmp_idx+=2));
col_add_fstr(pinfo->cinfo, COL_INFO,
"%s - %s (tunnel id=%u, session id=%u)",
control_msg,
@@ -1861,45 +1861,45 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_boolean(ctrl_tree, hf_l2tp_priority, tvb, 0, 2, control);
proto_tree_add_uint(ctrl_tree, hf_l2tp_version, tvb, 0, 2, control);
}
- index = 2;
+ idx = 2;
if (LENGTH_BIT(control)) {
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_length, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_length, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
}
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_tunnel, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_tunnel, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_session, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_session, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
if (SEQUENCE_BIT(control)) {
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_Ns, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_Ns, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
if (tree) {
- proto_tree_add_item(l2tp_tree, hf_l2tp_Nr, tvb, index, 2, FALSE);
+ proto_tree_add_item(l2tp_tree, hf_l2tp_Nr, tvb, idx, 2, FALSE);
}
- index += 2;
+ idx += 2;
}
if (OFFSET_BIT(control)) {
- offset_size = tvb_get_ntohs(tvb, index);
+ offset_size = tvb_get_ntohs(tvb, idx);
if (tree) {
- proto_tree_add_uint(l2tp_tree, hf_l2tp_offset, tvb, index, 2,
+ proto_tree_add_uint(l2tp_tree, hf_l2tp_offset, tvb, idx, 2,
offset_size);
}
- index += 2;
+ idx += 2;
if (offset_size != 0) {
if (tree) {
- proto_tree_add_text(l2tp_tree, tvb, index, offset_size, "Offset Padding");
+ proto_tree_add_text(l2tp_tree, tvb, idx, offset_size, "Offset Padding");
}
- index += offset_size;
+ idx += offset_size;
}
}
@@ -1909,17 +1909,17 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!CONTROL_BIT(control)) { /* Data Messages so we are done */
if (tree)
- proto_item_set_len(l2tp_item, index);
+ proto_item_set_len(l2tp_item, idx);
/* If we have data, signified by having a length bit, dissect it */
- if (tvb_offset_exists(tvb, index)) {
- next_tvb = tvb_new_subset_remaining(tvb, index);
+ if (tvb_offset_exists(tvb, idx)) {
+ next_tvb = tvb_new_subset_remaining(tvb, idx);
call_dissector(ppp_hdlc_handle, next_tvb, pinfo, tree);
}
return tvb_length(tvb);
}
if (LENGTH_BIT(control))
- process_control_avps(tvb, pinfo, l2tp_tree, index, length);
+ process_control_avps(tvb, pinfo, l2tp_tree, idx, length);
return tvb_length(tvb);
}
@@ -1934,7 +1934,7 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static void
dissect_l2tp_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- int index = 0;
+ int idx = 0;
guint32 sid; /* Session ID */
/* Only L2TPv3 runs directly over IP */
@@ -1942,7 +1942,7 @@ dissect_l2tp_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_clear(pinfo->cinfo, COL_INFO);
- sid = tvb_get_ntohl(tvb, index);
+ sid = tvb_get_ntohl(tvb, idx);
if (sid == 0) {
/* This is control message */
/* Call to process l2tp v3 control message */
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index 05e390000a..246bb781a4 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -387,7 +387,7 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int direction;
guint16 control, checksum, checksum_calculated;
int lapd_header_len, checksum_offset;
- guint16 address, cr, sapi, tei;
+ guint16 addr, cr, sapi, tei;
gboolean is_response = 0;
tvbuff_t *next_tvb;
const char *srcname = "?";
@@ -396,11 +396,11 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LAPD");
col_clear(pinfo->cinfo, COL_INFO);
- address = tvb_get_ntohs(tvb, 0);
- cr = address & LAPD_CR;
- tei = (address & LAPD_TEI) >> LAPD_TEI_SHIFT;
- sapi = (address & LAPD_SAPI) >> LAPD_SAPI_SHIFT;
- lapd_header_len = 2; /* address */
+ addr = tvb_get_ntohs(tvb, 0);
+ cr = addr & LAPD_CR;
+ tei = (addr & LAPD_TEI) >> LAPD_TEI_SHIFT;
+ sapi = (addr & LAPD_SAPI) >> LAPD_SAPI_SHIFT;
+ lapd_header_len = 2; /* addr */
if (check_col(pinfo->cinfo, COL_TEI))
col_add_fstr(pinfo->cinfo, COL_TEI, "%u", tei);
@@ -475,18 +475,18 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
addr_ti = proto_tree_add_uint(lapd_tree, hf_lapd_address, tvb,
- 0, 2, address);
+ 0, 2, addr);
addr_tree = proto_item_add_subtree(addr_ti, ett_lapd_address);
if(global_lapd_gsm_sapis){
- proto_tree_add_uint(addr_tree, hf_lapd_gsm_sapi,tvb, 0, 1, address);
+ proto_tree_add_uint(addr_tree, hf_lapd_gsm_sapi,tvb, 0, 1, addr);
}else{
- proto_tree_add_uint(addr_tree, hf_lapd_sapi,tvb, 0, 1, address);
+ proto_tree_add_uint(addr_tree, hf_lapd_sapi,tvb, 0, 1, addr);
}
- proto_tree_add_uint(addr_tree, hf_lapd_cr, tvb, 0, 1, address);
- proto_tree_add_uint(addr_tree, hf_lapd_ea1, tvb, 0, 1, address);
- proto_tree_add_uint(addr_tree, hf_lapd_tei, tvb, 1, 1, address);
- proto_tree_add_uint(addr_tree, hf_lapd_ea2, tvb, 1, 1, address);
+ proto_tree_add_uint(addr_tree, hf_lapd_cr, tvb, 0, 1, addr);
+ proto_tree_add_uint(addr_tree, hf_lapd_ea1, tvb, 0, 1, addr);
+ proto_tree_add_uint(addr_tree, hf_lapd_tei, tvb, 1, 1, addr);
+ proto_tree_add_uint(addr_tree, hf_lapd_ea2, tvb, 1, 1, addr);
}
else {
lapd_ti = NULL;
diff --git a/epan/dissectors/packet-lapdm.c b/epan/dissectors/packet-lapdm.c
index 1081268f50..cf05fdffbd 100644
--- a/epan/dissectors/packet-lapdm.c
+++ b/epan/dissectors/packet-lapdm.c
@@ -212,7 +212,7 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *lapdm_tree, *addr_tree, *length_tree;
proto_item *lapdm_ti, *addr_ti, *length_ti;
- guint8 address, length, cr, sapi, len, n_s;
+ guint8 addr, length, cr, sapi, len, n_s;
int control;
gboolean m;
tvbuff_t *payload;
@@ -225,10 +225,10 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LAPDm");
- address = tvb_get_guint8(tvb, 0);
+ addr = tvb_get_guint8(tvb, 0);
length = tvb_get_guint8(tvb, 2);
- cr = address & LAPDM_CR;
+ cr = addr & LAPDM_CR;
if (pinfo->p2p_dir == P2P_DIR_RECV) {
is_response = cr ? FALSE : TRUE;
}
@@ -240,13 +240,13 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
lapdm_ti = proto_tree_add_item(tree, proto_lapdm, tvb, 0, LAPDM_HEADER_LEN, FALSE);
lapdm_tree = proto_item_add_subtree(lapdm_ti, ett_lapdm);
- addr_ti = proto_tree_add_uint(lapdm_tree, hf_lapdm_address, tvb, 0, 1, address);
+ addr_ti = proto_tree_add_uint(lapdm_tree, hf_lapdm_address, tvb, 0, 1, addr);
addr_tree = proto_item_add_subtree(addr_ti, ett_lapdm_address);
- proto_tree_add_uint(addr_tree, hf_lapdm_lpd, tvb, 0, 1, address);
- proto_tree_add_uint(addr_tree, hf_lapdm_sapi, tvb, 0, 1, address);
- proto_tree_add_uint(addr_tree, hf_lapdm_cr, tvb, 0, 1, address);
- proto_tree_add_uint(addr_tree, hf_lapdm_ea, tvb, 0, 1, address);
+ proto_tree_add_uint(addr_tree, hf_lapdm_lpd, tvb, 0, 1, addr);
+ proto_tree_add_uint(addr_tree, hf_lapdm_sapi, tvb, 0, 1, addr);
+ proto_tree_add_uint(addr_tree, hf_lapdm_cr, tvb, 0, 1, addr);
+ proto_tree_add_uint(addr_tree, hf_lapdm_ea, tvb, 0, 1, addr);
}
else {
lapdm_ti = NULL;
@@ -267,7 +267,7 @@ dissect_lapdm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(length_tree, hf_lapdm_el, tvb, 2, 1, length);
}
- sapi = (address & LAPDM_SAPI) >> LAPDM_SAPI_SHIFT;
+ sapi = (addr & LAPDM_SAPI) >> LAPDM_SAPI_SHIFT;
len = (length & LAPDM_LEN) >> LAPDM_LEN_SHIFT;
n_s = (control & XDLC_N_S_MASK) >> XDLC_N_S_SHIFT;
m = (length & LAPDM_M) >> LAPDM_M_SHIFT;
diff --git a/epan/dissectors/packet-ldss.c b/epan/dissectors/packet-ldss.c
index ea8a906f3c..05996b7fc9 100644
--- a/epan/dissectors/packet-ldss.c
+++ b/epan/dissectors/packet-ldss.c
@@ -614,15 +614,15 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
g_byte_array_free(digest_bytes, TRUE);
}
if (tree) {
- proto_item *ti = NULL;
+ proto_item *tii = NULL;
- ti = proto_tree_add_uint(line_tree, hf_ldss_digest_type,
+ tii = proto_tree_add_uint(line_tree, hf_ldss_digest_type,
tvb, offset, digest_type_len, transfer_info->file->digest_type);
- PROTO_ITEM_SET_GENERATED(ti);
- ti = proto_tree_add_bytes(line_tree, hf_ldss_digest,
+ PROTO_ITEM_SET_GENERATED(tii);
+ tii = proto_tree_add_bytes(line_tree, hf_ldss_digest,
tvb, offset+digest_type_len, linelen-digest_type_len,
transfer_info->file->digest);
- PROTO_ITEM_SET_GENERATED(ti);
+ PROTO_ITEM_SET_GENERATED(tii);
}
}
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 9ceeac50d7..5ae0b61515 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -935,14 +935,14 @@ static void dissect_rar(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
/* Backoff Indicator (BI) case */
guint8 reserved;
- proto_item *ti;
+ proto_item *tii;
proto_item *bi_ti;
/* 2 Reserved bits */
reserved = (tvb_get_guint8(tvb, offset) & 0x30) >> 4;
- ti = proto_tree_add_item(rar_header_tree, hf_mac_lte_rar_reserved, tvb, offset, 1, FALSE);
+ tii = proto_tree_add_item(rar_header_tree, hf_mac_lte_rar_reserved, tvb, offset, 1, FALSE);
if (reserved != 0) {
- expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
+ expert_add_info_format(pinfo, tii, PI_MALFORMED, PI_ERROR,
"RAR header Reserved bits not zero (found 0x%x)", reserved);
}
@@ -2405,10 +2405,10 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Can't dissect anything without it... */
if (p_mac_lte_info == NULL) {
- proto_item *ti =
+ proto_item *tii =
proto_tree_add_text(mac_lte_tree, tvb, offset, -1,
"Can't dissect LTE MAC frame because no per-frame info was attached!");
- PROTO_ITEM_SET_GENERATED(ti);
+ PROTO_ITEM_SET_GENERATED(tii);
return;
}
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index 91aa4f67e5..5d4b589590 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -390,9 +390,9 @@ static int dissect_mgcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (mgcp_tree)
{
- proto_item *ti = proto_tree_add_uint(mgcp_tree, hf_mgcp_messagecount, tvb,
+ proto_item *tii = proto_tree_add_uint(mgcp_tree, hf_mgcp_messagecount, tvb,
0 ,0 , num_messages);
- PROTO_ITEM_SET_HIDDEN(ti);
+ PROTO_ITEM_SET_HIDDEN(tii);
}
/*
diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c
index 3eda0363cd..f057005860 100644
--- a/epan/dissectors/packet-mmse.c
+++ b/epan/dissectors/packet-mmse.c
@@ -1165,7 +1165,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
if (tree) {
guint32 fwd_count, count1, count2;
proto_tree *subtree = NULL;
- proto_item *ti = NULL;
+ proto_item *tii = NULL;
/* 1. Forwarded-count-value := Integer-value */
fwd_count = get_integer_value(tvb, offset + count,
&count1);
@@ -1173,13 +1173,13 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
count2 = get_encoded_strval(tvb,
offset + count + count1, &strval);
/* Now render the fields */
- ti = proto_tree_add_string_format(mmse_tree,
+ tii = proto_tree_add_string_format(mmse_tree,
hf_mmse_prev_sent_by,
tvb, offset - 1, 1 + count + length,
strval, "%s (Forwarded-count=%u)",
format_text(strval, strlen(strval)),
fwd_count);
- subtree = proto_item_add_subtree(ti,
+ subtree = proto_item_add_subtree(tii,
ett_mmse_hdr_details);
proto_tree_add_uint(subtree,
hf_mmse_prev_sent_by_fwd_count,
@@ -1198,7 +1198,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
guint tval;
nstime_t tmptime;
proto_tree *subtree = NULL;
- proto_item *ti = NULL;
+ proto_item *tii = NULL;
/* 1. Forwarded-count-value := Integer-value */
fwd_count = get_integer_value(tvb, offset + count,
&count1);
@@ -1210,13 +1210,13 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
strval = abs_time_to_str(&tmptime, FALSE);
/* Now render the fields */
tvb_ensure_bytes_exist(tvb, offset - 1, length + count + 1);
- ti = proto_tree_add_string_format(mmse_tree,
+ tii = proto_tree_add_string_format(mmse_tree,
hf_mmse_prev_sent_date,
tvb, offset - 1, 1 + count + length,
strval, "%s (Forwarded-count=%u)",
format_text(strval, strlen(strval)),
fwd_count);
- subtree = proto_item_add_subtree(ti,
+ subtree = proto_item_add_subtree(tii,
ett_mmse_hdr_details);
proto_tree_add_uint(subtree,
hf_mmse_prev_sent_date_fwd_count,
diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c
index bf0828b827..f654863fbe 100644
--- a/epan/dissectors/packet-mp2t.c
+++ b/epan/dissectors/packet-mp2t.c
@@ -581,26 +581,26 @@ get_mp2t_conversation_data(conversation_t *conv)
static frame_analysis_data_t *
init_frame_analysis_data(mp2t_analysis_data_t *mp2t_data, packet_info *pinfo)
{
- frame_analysis_data_t *frame_data = NULL;
+ frame_analysis_data_t *frame_analysis_data_p = NULL;
- frame_data = se_alloc0(sizeof(struct frame_analysis_data));
- frame_data->ts_table =
+ frame_analysis_data_p = se_alloc0(sizeof(struct frame_analysis_data));
+ frame_analysis_data_p->ts_table =
se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK,
"mp2t_frame_pid_table");
/* Insert into mp2t tree */
se_tree_insert32(mp2t_data->frame_table, pinfo->fd->num,
- (void *)frame_data);
+ (void *)frame_analysis_data_p);
- return frame_data;
+ return frame_analysis_data_p;
}
static frame_analysis_data_t *
get_frame_analysis_data(mp2t_analysis_data_t *mp2t_data, packet_info *pinfo)
{
- frame_analysis_data_t *frame_data = NULL;
- frame_data = se_tree_lookup32(mp2t_data->frame_table, pinfo->fd->num);
- return frame_data;
+ frame_analysis_data_t *frame_analysis_data_p = NULL;
+ frame_analysis_data_p = se_tree_lookup32(mp2t_data->frame_table, pinfo->fd->num);
+ return frame_analysis_data_p;
}
static pid_analysis_data_t *
@@ -655,10 +655,10 @@ detect_cc_drops(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
guint32 pid, gint32 cc_curr, conversation_t *conv)
{
gint32 cc_prev = -1;
- pid_analysis_data_t *pid_data = NULL;
- ts_analysis_data_t *ts_data = NULL;
- mp2t_analysis_data_t *mp2t_data = NULL;
- frame_analysis_data_t *frame_data = NULL;
+ pid_analysis_data_t *pid_data = NULL;
+ ts_analysis_data_t *ts_data = NULL;
+ mp2t_analysis_data_t *mp2t_data = NULL;
+ frame_analysis_data_t *frame_analysis_data_p = NULL;
proto_item *flags_item;
guint32 detected_drop = 0;
@@ -703,9 +703,9 @@ detect_cc_drops(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
if (detected_drop && !pinfo->fd->flags.visited) {
/* Lookup frame data, contains TS pid data objects */
- frame_data = get_frame_analysis_data(mp2t_data, pinfo);
- if (!frame_data)
- frame_data = init_frame_analysis_data(mp2t_data, pinfo);
+ frame_analysis_data_p = get_frame_analysis_data(mp2t_data, pinfo);
+ if (!frame_analysis_data_p)
+ frame_analysis_data_p = init_frame_analysis_data(mp2t_data, pinfo);
/* Create and store a new TS frame pid_data object.
This indicate that we have a drop
@@ -714,7 +714,7 @@ detect_cc_drops(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
ts_data->cc_prev = cc_prev;
ts_data->pid = pid;
ts_data->skips = skips;
- se_tree_insert32(frame_data->ts_table, KEY(pid, cc_curr),
+ se_tree_insert32(frame_analysis_data_p->ts_table, KEY(pid, cc_curr),
(void *)ts_data);
}
@@ -722,11 +722,11 @@ detect_cc_drops(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
if (pinfo->fd->flags.visited) {
/* Lookup frame data, contains TS pid data objects */
- frame_data = get_frame_analysis_data(mp2t_data, pinfo);
- if (!frame_data)
+ frame_analysis_data_p = get_frame_analysis_data(mp2t_data, pinfo);
+ if (!frame_analysis_data_p)
return 0; /* No stored frame data -> no drops*/
else {
- ts_data = se_tree_lookup32(frame_data->ts_table,
+ ts_data = se_tree_lookup32(frame_analysis_data_p->ts_table,
KEY(pid, cc_curr));
if (ts_data) {
diff --git a/epan/dissectors/packet-mpls-echo.c b/epan/dissectors/packet-mpls-echo.c
index 3514f88afc..d54ebd618a 100644
--- a/epan/dissectors/packet-mpls-echo.c
+++ b/epan/dissectors/packet-mpls-echo.c
@@ -311,7 +311,7 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
{
proto_tree *ti = NULL, *tlv_fec_tree = NULL;
proto_item *hidden_item;
- guint16 index = 1, nil_index = 1, type, saved_type;
+ guint16 idx = 1, nil_idx = 1, type, saved_type;
int length, nil_length, pad;
guint32 label;
guint8 exp, bos, ttl;
@@ -326,7 +326,7 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
length = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(tree, tvb, offset, length + 4, "FEC Element %u: %s",
- index, val_to_str(type, mpls_echo_tlv_fec_names,
+ idx, val_to_str(type, mpls_echo_tlv_fec_names,
"Unknown FEC type (0x%04X)"));
tlv_fec_tree = proto_item_add_subtree(ti, ett_mpls_echo_tlv_fec);
if(tlv_fec_tree == NULL) return;
@@ -486,15 +486,15 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
decode_mpls_label(tvb, offset + 4, &label, &exp, &bos, &ttl);
if (label <= LABEL_MAX_RESERVED){
proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_nil_label,
- tvb, offset + 4, 3, label, "Label %u: %u (%s)", nil_index, label,
+ tvb, offset + 4, 3, label, "Label %u: %u (%s)", nil_idx, label,
val_to_str(label, special_labels, "Reserved - Unknown"));
} else {
proto_tree_add_uint_format(tlv_fec_tree, hf_mpls_echo_tlv_fec_nil_label,
- tvb, offset + 4, 3, label, "Label %u: %u", nil_index, label);
+ tvb, offset + 4, 3, label, "Label %u: %u", nil_idx, label);
}
nil_length -= 4;
offset += 4;
- nil_index++;
+ nil_idx++;
}
break;
@@ -528,7 +528,7 @@ dissect_mpls_echo_tlv_fec(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem
rem -= 4 + length;
offset += 4 + length;
- index++;
+ idx++;
}
}
}
@@ -540,7 +540,7 @@ static void
dissect_mpls_echo_tlv_ds_map(tvbuff_t *tvb, guint offset, proto_tree *tree, int rem)
{
proto_tree *ti = NULL, *tlv_ds_map_tree = NULL;
- guint16 mplen, index = 1;
+ guint16 mplen, idx = 1;
guint32 label;
guint8 exp, bos, proto;
guint8 hash_type, addr_type;
@@ -671,7 +671,7 @@ dissect_mpls_echo_tlv_ds_map(tvbuff_t *tvb, guint offset, proto_tree *tree, int
while (rem >= 4){
decode_mpls_label(tvb, offset, &label, &exp, &bos, &proto);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Downstream Label Element %u",
- index);
+ idx);
tlv_ds_map_tree = proto_item_add_subtree(ti, ett_mpls_echo_tlv_ds_map);
proto_item_append_text(ti, ", Label: %u", label);
if (label <= LABEL_MAX_RESERVED){
@@ -695,7 +695,7 @@ dissect_mpls_echo_tlv_ds_map(tvbuff_t *tvb, guint offset, proto_tree *tree, int
mpls_echo_tlv_ds_map_mp_proto, "Unknown"));
rem -= 4;
offset += 4;
- index++;
+ idx++;
}
}
@@ -707,7 +707,7 @@ dissect_mpls_echo_tlv_ilso(tvbuff_t *tvb, guint offset, proto_tree *tree, int re
{
proto_tree *ti = NULL, *tlv_ilso = NULL;
guint8 type;
- guint16 index = 1;
+ guint16 idx = 1;
guint32 label;
guint8 exp, bos, ttl;
@@ -762,7 +762,7 @@ dissect_mpls_echo_tlv_ilso(tvbuff_t *tvb, guint offset, proto_tree *tree, int re
while (rem >= 4){
decode_mpls_label(tvb, offset, &label, &exp, &bos, &ttl);
ti = proto_tree_add_text(tree, tvb, offset, 4, "Label Stack Element %u",
- index);
+ idx);
tlv_ilso = proto_item_add_subtree(ti, ett_mpls_echo_tlv_ilso);
proto_item_append_text(ti, ", Label: %u", label);
if (label <= LABEL_MAX_RESERVED){
@@ -785,7 +785,7 @@ dissect_mpls_echo_tlv_ilso(tvbuff_t *tvb, guint offset, proto_tree *tree, int re
tvb, offset + 3, 1, FALSE);
rem -= 4;
offset += 4;
- index++;
+ idx++;
}
}
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index 0eeda8b46d..f1b26c4401 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -1237,7 +1237,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 opcode;
guint32 iSegmentLength = 0;
guint32 iSizePayload = 0;
- gint iSizeMD = 0;
+ gint iSizeMD_gbl = 0;
gboolean bLittleEndian = FALSE;
gboolean bPayload = FALSE;
gboolean bEBCDIC = FALSE;
@@ -2006,11 +2006,11 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 4;
structId = (tvb_length_remaining(tvb, offset) >= 4) ? tvb_get_ntohl(tvb, offset) : MQ_STRUCTID_NULL;
}
- if ((iSizeMD = dissect_mq_md(tvb, mqroot_tree, bLittleEndian, offset, &tMsgProps)) != 0)
+ if ((iSizeMD_gbl = dissect_mq_md(tvb, mqroot_tree, bLittleEndian, offset, &tMsgProps)) != 0)
{
gint iSizeGMO = 0;
gint iSizePMO = 0;
- offset += iSizeMD;
+ offset += iSizeMD_gbl;
if ((iSizeGMO = dissect_mq_gmo(tvb, pinfo, mqroot_tree, bLittleEndian, offset)) != 0)
{
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index 1b5280a521..9bad7c49de 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -543,9 +543,8 @@ static gint
process_preamble(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
gint boundary_len, gboolean *last_boundary)
{
- gint boundary_start, boundary_line_len, body_part_start;
+ gint boundary_start, boundary_line_len;
- body_part_start = 0;
boundary_start = find_first_boundary(tvb, 0, boundary, boundary_len,
&boundary_line_len, last_boundary);
if (boundary_start == 0) {
diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c
index bbd215a515..e5d9c1e5bc 100644
--- a/epan/dissectors/packet-mysql.c
+++ b/epan/dissectors/packet-mysql.c
@@ -1141,7 +1141,7 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint64 generation;
proto_item *pi;
#endif
- struct mysql_frame_data *frame_data;
+ struct mysql_frame_data *mysql_frame_data_p;
/* get conversation, create if neccessary*/
conversation= find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
@@ -1169,22 +1169,22 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
conversation_add_proto_data(conversation, proto_mysql, conn_data);
}
- frame_data = p_get_proto_data(pinfo->fd, proto_mysql);
- if (!frame_data) {
+ mysql_frame_data_p = p_get_proto_data(pinfo->fd, proto_mysql);
+ if (!mysql_frame_data_p) {
/* We haven't seen this frame before. Store the state of the
* conversation now so if/when we dissect the frame again
* we'll start with the same state.
*/
- frame_data = se_alloc(sizeof(struct mysql_frame_data));
- frame_data->state = conn_data->state;
- p_add_proto_data(pinfo->fd, proto_mysql, frame_data);
+ mysql_frame_data_p = se_alloc(sizeof(struct mysql_frame_data));
+ mysql_frame_data_p->state = conn_data->state;
+ p_add_proto_data(pinfo->fd, proto_mysql, mysql_frame_data_p);
} else {
/* We have seen this frame before. Set the connection state
* to whatever state it had the first time we saw this frame
* (e.g., based on whatever frames came before it).
* The state may change as we dissect this packet.
*/
- conn_data->state= frame_data->state;
+ conn_data->state= mysql_frame_data_p->state;
}
if (tree) {
@@ -1210,7 +1210,7 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
#ifdef CTDEBUG
conn_state_in= conn_data->state;
- frame_state = frame_data->state;
+ frame_state = mysql_frame_data_p->state;
generation= conn_data->generation;
if (tree) {
pi= proto_tree_add_text(mysql_tree, tvb, offset, 0, "conversation: %p", conversation);
@@ -1581,13 +1581,13 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
case MYSQL_REFRESH:
{
- proto_item *tf;
+ proto_item *tff;
proto_item *rfsh_tree;
gint refresh= tvb_get_guint8(tvb, offset);
if (req_tree) {
- tf= proto_tree_add_uint_format(req_tree, hf_mysql_refresh, tvb, offset, 1, refresh, "Refresh Bitmap: 0x%02X ", refresh);
- rfsh_tree= proto_item_add_subtree(tf, ett_refresh);
+ tff= proto_tree_add_uint_format(req_tree, hf_mysql_refresh, tvb, offset, 1, refresh, "Refresh Bitmap: 0x%02X ", refresh);
+ rfsh_tree= proto_item_add_subtree(tff, ett_refresh);
proto_tree_add_boolean(rfsh_tree, hf_mysql_rfsh_grants, tvb, offset, 1, refresh);
proto_tree_add_boolean(rfsh_tree, hf_mysql_rfsh_log, tvb, offset, 1, refresh);
proto_tree_add_boolean(rfsh_tree, hf_mysql_rfsh_tables, tvb, offset, 1, refresh);
diff --git a/epan/dissectors/packet-nas_eps.c b/epan/dissectors/packet-nas_eps.c
index 0b4d1a3dc5..fe6629c023 100644
--- a/epan/dissectors/packet-nas_eps.c
+++ b/epan/dissectors/packet-nas_eps.c
@@ -3765,14 +3765,14 @@ static void (*nas_msg_esm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset
NULL, /* NONE */
};
-void get_nas_esm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
+void get_nas_esm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
{
gint idx;
*msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_esm_strings, &idx);
*ett_tree = ett_nas_msg_esm[idx];
*hf_idx = hf_nas_eps_msg_esm_type;
- *msg_fcn = nas_msg_esm_fcn[idx];
+ *msg_fcn_p = nas_msg_esm_fcn[idx];
return;
}
@@ -3818,14 +3818,14 @@ static void (*nas_msg_emm_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset
};
-void get_nas_emm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn)
+void get_nas_emm_msg_params(guint8 oct, const gchar **msg_str, int *ett_tree, int *hf_idx, msg_fcn *msg_fcn_p)
{
gint idx;
*msg_str = match_strval_idx((guint32) (oct & 0xff), nas_msg_emm_strings, &idx);
*ett_tree = ett_nas_msg_emm[idx];
*hf_idx = hf_nas_eps_msg_emm_type;
- *msg_fcn = nas_msg_emm_fcn[idx];
+ *msg_fcn_p = nas_msg_emm_fcn[idx];
return;
}
@@ -3841,7 +3841,7 @@ disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
guint32 len;
gint ett_tree;
int hf_idx;
- 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;
len = tvb_length(tvb);
@@ -3861,12 +3861,12 @@ disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
/*messge type IE*/
oct = tvb_get_guint8(tvb,offset);
- msg_fcn = NULL;
+ msg_fcn_p = NULL;
ett_tree = -1;
hf_idx = -1;
msg_str = NULL;
- get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
+ get_nas_esm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
if(msg_str){
if (check_col(pinfo->cinfo, COL_INFO)){
@@ -3887,7 +3887,7 @@ disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
/*
* decode elements
*/
- if (msg_fcn == NULL)
+ if (msg_fcn_p == NULL)
{
proto_tree_add_text(tree, tvb, offset, len - offset,
"Message Elements");
@@ -3896,7 +3896,7 @@ disect_nas_eps_esm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
{
/* If calling any "gsm" ie dissectors needing pinfo */
gsm_a_dtap_pinfo = pinfo;
- (*msg_fcn)(tvb, tree, offset, len - offset);
+ (*msg_fcn_p)(tvb, tree, offset, len - offset);
}
}
@@ -3910,7 +3910,7 @@ dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
guint32 len;
gint ett_tree;
int hf_idx;
- 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 security_header_type, oct;
len = tvb_length(tvb);
@@ -3938,12 +3938,12 @@ dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
}
/* Messge type IE*/
oct = tvb_get_guint8(tvb,offset);
- msg_fcn = NULL;
+ msg_fcn_p = NULL;
ett_tree = -1;
hf_idx = -1;
msg_str = NULL;
- get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn);
+ get_nas_emm_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p);
if(msg_str){
if (check_col(pinfo->cinfo, COL_INFO)){
@@ -3964,7 +3964,7 @@ dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
/*
* decode elements
*/
- if (msg_fcn == NULL)
+ if (msg_fcn_p == NULL)
{
proto_tree_add_text(tree, tvb, offset, len - offset,
"Message Elements");
@@ -3973,7 +3973,7 @@ dissect_nas_eps_emm_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
{
/* If calling any "gsm" ie dissectors needing pinfo */
gsm_a_dtap_pinfo = pinfo;
- (*msg_fcn)(tvb, tree, offset, len - offset);
+ (*msg_fcn_p)(tvb, tree, offset, len - offset);
}
}
diff --git a/epan/dissectors/packet-nasdaq-itch.c b/epan/dissectors/packet-nasdaq-itch.c
index 164a7b80f2..ce050e94f2 100644
--- a/epan/dissectors/packet-nasdaq-itch.c
+++ b/epan/dissectors/packet-nasdaq-itch.c
@@ -273,11 +273,11 @@ stock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *nasdaq_itch_tree, int offse
{
gint col_info = PINFO_COL(pinfo);
if (nasdaq_itch_tree || col_info) {
- char *stock = tvb_get_ephemeral_string(tvb, offset, 6);
+ char *stock_p = tvb_get_ephemeral_string(tvb, offset, 6);
proto_tree_add_item(nasdaq_itch_tree, hf_nasdaq_itch_stock, tvb, offset, 6, FALSE);
if (col_info) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "<%s> ", stock);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "<%s> ", stock_p);
}
}
return offset+6;
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index 23657ac158..1715ffbc3a 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -285,7 +285,7 @@ get_nbns_name(tvbuff_t *tvb, int offset, int nbns_data_offset,
char cname, cnbname;
int name_type;
char *pname_ret;
- size_t index = 0;
+ size_t idx = 0;
nbname_buf=ep_alloc(NBNAME_BUF_LEN);
nbname = nbname_buf;
@@ -330,17 +330,17 @@ get_nbns_name(tvbuff_t *tvb, int offset, int nbns_data_offset,
pname++;
/* Do we have room to store the character? */
- if (index < NETBIOS_NAME_LEN) {
+ if (idx < NETBIOS_NAME_LEN) {
/* Yes - store the character. */
- nbname_buf[index++] = cnbname;
+ nbname_buf[idx++] = cnbname;
}
}
/* NetBIOS names are supposed to be exactly 16 bytes long. */
- if (index != NETBIOS_NAME_LEN) {
+ if (idx != NETBIOS_NAME_LEN) {
/* It's not. */
g_snprintf(nbname_buf, NBNAME_BUF_LEN, "Illegal NetBIOS name (%lu bytes long)",
- (unsigned long)index);
+ (unsigned long)idx);
goto bad;
}