diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-02-17 19:31:14 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-02-17 21:19:32 +0000 |
commit | eca4d29235aac4cd17323abc87a2a7a2983cd0a0 (patch) | |
tree | cf5c0b6d9f54a021c77b8505ff358dbf0e1491d4 /epan/dissectors | |
parent | 47f27e3cc6ea730b1a5f1528e3eeaddf92ad3671 (diff) | |
download | wireshark-eca4d29235aac4cd17323abc87a2a7a2983cd0a0.tar.gz |
STUN : fix indent (use 4spaces)
Change-Id: Ifbaf0f396b24d5506722f0e0df0dd17c1969a435
Reviewed-on: https://code.wireshark.org/review/7202
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-stun.c | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c index 402ae44ac2..a8dc531324 100644 --- a/epan/dissectors/packet-stun.c +++ b/epan/dissectors/packet-stun.c @@ -518,7 +518,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole wmem_tree_key_t transaction_id_key[2]; guint32 transaction_id[3]; heur_dtbl_entry_t *hdtbl_entry; - guint reported_length; + guint reported_length; /* * Check if the frame is really meant for us. @@ -526,7 +526,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole /* First, make sure we have enough data to do the check. */ captured_length = tvb_captured_length(tvb); - reported_length = tvb_reported_length(tvb); + reported_length = tvb_reported_length(tvb); if (captured_length < MIN_HDR_LEN) return 0; @@ -573,7 +573,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole return 0; /* check if payload enough */ - if (reported_length != (msg_length + STUN_HDR_LEN)) + if (reported_length != (msg_length + STUN_HDR_LEN)) return 0; /* The message seems to be a valid STUN message! */ @@ -732,7 +732,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole if (msg_length != 0) { guint offset; - const gchar *attribute_name_str; + const gchar *attribute_name_str; ti = proto_tree_add_item(stun_tree, hf_stun_attributes, tvb, STUN_HDR_LEN, msg_length, ENC_NA); att_all_tree = proto_item_add_subtree(ti, ett_stun_att_all); @@ -742,11 +742,11 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole while (offset < (STUN_HDR_LEN + msg_length)) { att_type = tvb_get_ntohs(tvb, offset); /* Type field in attribute header */ att_length = tvb_get_ntohs(tvb, offset+2); /* Length field in attribute header */ - attribute_name_str = val_to_str_ext_const(att_type, &attributes_ext, "Unknown"); + attribute_name_str = val_to_str_ext_const(att_type, &attributes_ext, "Unknown"); if(att_all_tree){ ti = proto_tree_add_uint_format(att_all_tree, hf_stun_attr, tvb, offset, ATTR_HDR_LEN+att_length, - att_type, "%s", attribute_name_str); + att_type, "%s", attribute_name_str); att_tree = proto_item_add_subtree(ti, ett_stun_att); ti = proto_tree_add_uint(att_tree, hf_stun_att_type, tvb, offset, 2, att_type); @@ -818,9 +818,9 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole case RESPONSE_ORIGIN: case OTHER_ADDRESS: case MS_ALT_MAPPED_ADDRESS: - { + { const gchar *addr_str; - guint16 att_port; + guint16 att_port; if (att_length < 1) break; @@ -831,21 +831,21 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole if (att_length < 4) break; proto_tree_add_item(att_tree, hf_stun_att_port, tvb, offset+2, 2, ENC_BIG_ENDIAN); - att_port = tvb_get_ntohs(tvb, offset + 2); + att_port = tvb_get_ntohs(tvb, offset + 2); switch (tvb_get_guint8(tvb, offset+1)) { case 1: if (att_length < 8) break; - addr_str = tvb_ip_to_str(tvb, offset + 4); + addr_str = tvb_ip_to_str(tvb, offset + 4); proto_tree_add_item(att_tree, hf_stun_att_ipv4, tvb, offset+4, 4, ENC_BIG_ENDIAN); - proto_item_append_text(att_tree, ": %s:%d", addr_str, att_port); + proto_item_append_text(att_tree, ": %s:%d", addr_str, att_port); col_append_fstr( pinfo->cinfo, COL_INFO, " %s: %s:%d", - attribute_name_str, - addr_str, - att_port + attribute_name_str, + addr_str, + att_port ); break; @@ -856,7 +856,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole break; } break; - } + } case CHANGE_REQUEST: if (att_length < 4) break; @@ -865,22 +865,22 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole break; case USERNAME: - { - const gchar *user_name_str; + { + const gchar *user_name_str; proto_tree_add_item(att_tree, hf_stun_att_username, tvb, offset, att_length, ENC_UTF_8|ENC_NA); - user_name_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8 | ENC_NA); - proto_item_append_text(att_tree, ": %s", user_name_str); + user_name_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8 | ENC_NA); + proto_item_append_text(att_tree, ": %s", user_name_str); col_append_fstr( pinfo->cinfo, COL_INFO, " user: %s", - user_name_str); + user_name_str); if (att_length % 4 != 0) proto_tree_add_uint(att_tree, hf_stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4)); break; - } + } case MESSAGE_INTEGRITY: if (att_length < 20) break; @@ -899,33 +899,33 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole proto_tree_add_item(att_tree, hf_stun_att_error_number, tvb, offset+3, 1, ENC_BIG_ENDIAN); { int human_error_num = tvb_get_guint8(tvb, offset+2) * 100 + tvb_get_guint8(tvb, offset+3); - const gchar *error_str = val_to_str_ext_const(human_error_num, &error_code_ext, "*Unknown error code*"); + const gchar *error_str = val_to_str_ext_const(human_error_num, &error_code_ext, "*Unknown error code*"); proto_item_append_text( att_tree, " %d (%s)", human_error_num, /* human readable error code */ - error_str + error_str ); col_append_fstr( pinfo->cinfo, COL_INFO, " error-code: %d (%s)", human_error_num, - error_str + error_str ); } if (att_length < 5) break; - proto_tree_add_item(att_tree, hf_stun_att_error_reason, tvb, offset + 4, att_length - 4, ENC_UTF_8 | ENC_NA); - { - const gchar *error_reas_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, att_length - 4, ENC_UTF_8 | ENC_NA); - - proto_item_append_text(att_tree, ": %s", error_reas_str); - col_append_fstr( - pinfo->cinfo, COL_INFO, - " %s", - error_reas_str - ); - } + proto_tree_add_item(att_tree, hf_stun_att_error_reason, tvb, offset + 4, att_length - 4, ENC_UTF_8 | ENC_NA); + { + const gchar *error_reas_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, att_length - 4, ENC_UTF_8 | ENC_NA); + + proto_item_append_text(att_tree, ": %s", error_reas_str); + col_append_fstr( + pinfo->cinfo, COL_INFO, + " %s", + error_reas_str + ); + } if (att_length % 4 != 0) proto_tree_add_uint(att_tree, hf_stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4)); @@ -939,19 +939,19 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole break; case REALM: - { - const gchar *realm_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8 | ENC_NA); + { + const gchar *realm_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8 | ENC_NA); proto_tree_add_item(att_tree, hf_stun_att_realm, tvb, offset, att_length, ENC_UTF_8|ENC_NA); - proto_item_append_text(att_tree, ": %s", realm_str); + proto_item_append_text(att_tree, ": %s", realm_str); col_append_fstr( pinfo->cinfo, COL_INFO, " realm: %s", - realm_str + realm_str ); if (att_length % 4 != 0) proto_tree_add_uint(att_tree, hf_stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4)); break; - } + } case NONCE: proto_tree_add_item(att_tree, hf_stun_att_nonce, tvb, offset, att_length, ENC_UTF_8|ENC_NA); proto_item_append_text(att_tree, ": %s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, att_length, ENC_UTF_8|ENC_NA)); @@ -1016,7 +1016,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole col_append_fstr( pinfo->cinfo, COL_INFO, " %s: %s:%d", - attribute_name_str, + attribute_name_str, ipstr, port ); @@ -1133,13 +1133,13 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole { guint8 protoCode = tvb_get_guint8(tvb, offset); - const gchar *protoCode_str = val_to_str(protoCode, transportnames, "Unknown (0x%8x)"); + const gchar *protoCode_str = val_to_str(protoCode, transportnames, "Unknown (0x%8x)"); - proto_item_append_text(att_tree, ": %s", protoCode_str); + proto_item_append_text(att_tree, ": %s", protoCode_str); col_append_fstr( pinfo->cinfo, COL_INFO, " %s", - protoCode_str + protoCode_str ); } proto_tree_add_item(att_tree, hf_stun_att_reserved, tvb, offset+1, 3, ENC_NA); @@ -1259,7 +1259,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole } } - return reported_length; + return reported_length; } static int |