diff options
author | Bill Meier <wmeier@newsguy.com> | 2013-10-13 18:14:59 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2013-10-13 18:14:59 +0000 |
commit | 76d4b43a292ec42aeb91e7c81169ef1d017c6b17 (patch) | |
tree | 835719465e739bdd8c2d5b96ab0589513200b054 /epan/dissectors | |
parent | ee6916b838f68b21c762293ad46390b5a137c964 (diff) |
Minor whitespace, formatting & etc changes.
svn path=/trunk/; revision=52588
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/file-mp4.c | 32 | ||||
-rw-r--r-- | epan/dissectors/packet-3g-a11.c | 385 | ||||
-rw-r--r-- | epan/dissectors/packet-actrace.h | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-buddylist.c | 22 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-icq.c | 28 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-location.c | 76 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-oft.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-amr.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-ansi_637.c | 2455 | ||||
-rw-r--r-- | epan/dissectors/packet-ansi_a.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ansi_a.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-arp.c | 400 |
12 files changed, 1695 insertions, 1733 deletions
diff --git a/epan/dissectors/file-mp4.c b/epan/dissectors/file-mp4.c index 53a7060abd..add3cd93a0 100644 --- a/epan/dissectors/file-mp4.c +++ b/epan/dissectors/file-mp4.c @@ -136,8 +136,8 @@ dissect_mp4_mvhd_body(tvbuff_t *tvb, gint offset, gint len _U_, offset_start = offset; proto_tree_add_item(tree, hf_mp4_full_box_ver, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - offset+=3; + offset += 1; + offset += 3; return offset-offset_start; } @@ -151,12 +151,12 @@ dissect_mp4_mfhd_body(tvbuff_t *tvb, gint offset, gint len _U_, offset_start = offset; proto_tree_add_item(tree, hf_mp4_full_box_ver, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; - offset+=3; + offset += 1; + offset += 3; proto_tree_add_item(tree, hf_mp4_mfhd_seq_num, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; + offset += 4; return offset-offset_start; } @@ -176,13 +176,13 @@ dissect_mp4_ftyp_body(tvbuff_t *tvb, gint offset, gint len, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; - while (offset-offset_start<len) { + while ((offset-offset_start) < len) { proto_tree_add_item(tree, hf_mp4_ftyp_add_brand, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; } - return offset-offset_start; + return offset - offset_start; } /* dissect a box, return its (standard or extended) length or 0 for error */ @@ -207,7 +207,7 @@ dissect_mp4_box(guint32 parent_box_type _U_, - extended box types */ box_size = (guint64)tvb_get_ntohl(tvb, offset); - if (box_size!=BOX_SIZE_EXTENDED && box_size<MIN_BOX_SIZE) + if ((box_size != BOX_SIZE_EXTENDED) && (box_size < MIN_BOX_SIZE)) return -1; box_type = tvb_get_ntohl(tvb, offset+4); @@ -219,7 +219,7 @@ dissect_mp4_box(guint32 parent_box_type _U_, size_pi = proto_tree_add_item(box_tree, hf_mp4_box_size, tvb, offset, 4, ENC_BIG_ENDIAN); - if (box_size==BOX_SIZE_EXTENDED) + if (box_size == BOX_SIZE_EXTENDED) proto_item_append_text(size_pi, " (actual size is in largesize)"); offset += 4; @@ -227,7 +227,7 @@ dissect_mp4_box(guint32 parent_box_type _U_, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; - if (box_size==BOX_SIZE_EXTENDED) { + if (box_size == BOX_SIZE_EXTENDED) { box_size = tvb_get_ntoh64(tvb, offset); ext_size_pi = proto_tree_add_item(box_tree, hf_mp4_box_largesize, tvb, offset, 8, ENC_BIG_ENDIAN); @@ -263,9 +263,9 @@ dissect_mp4_box(guint32 parent_box_type _U_, case BOX_TYPE_MVEX: case BOX_TYPE_DINF: case BOX_TYPE_UDTA: - while (offset-offset_start<(gint)box_size) { + while (offset-offset_start < (gint)box_size) { ret = dissect_mp4_box(box_type, tvb, offset, pinfo, box_tree); - if (ret<=0) + if (ret <= 0) break; offset += ret; } @@ -293,7 +293,7 @@ dissect_mp4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) this detection should be safe as long as the dissector is only called for the video/mp4 mime type when we read mp4 files directly, we might need stricter checks here */ - if (tvb_reported_length(tvb)<MIN_BOX_SIZE) + if (tvb_reported_length(tvb) < MIN_BOX_SIZE) return 0; box_type = tvb_get_ntohl(tvb, 4); if (try_val_to_str(box_type, box_types) == NULL) @@ -308,7 +308,7 @@ dissect_mp4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) while (tvb_reported_length_remaining(tvb, offset) > 0) { ret = dissect_mp4_box(BOX_TYPE_NONE, tvb, offset, pinfo, mp4_tree); - if (ret<=0) + if (ret <= 0) break; offset += ret; } @@ -357,8 +357,8 @@ proto_register_mp4(void) "box size too large, dissection of this box is not supported", EXPFILL }} }; - expert_module_t* expert_mp4; - + expert_module_t *expert_mp4; + proto_mp4 = proto_register_protocol("MP4 / ISOBMFF file format", "mp4", "mp4"); proto_register_field_array(proto_mp4, hf, array_length(hf)); diff --git a/epan/dissectors/packet-3g-a11.c b/epan/dissectors/packet-3g-a11.c index 57ab7e20cb..c5b290fdd0 100644 --- a/epan/dissectors/packet-3g-a11.c +++ b/epan/dissectors/packet-3g-a11.c @@ -252,7 +252,7 @@ static const value_string a11_types[] = { {SESSION_ACK, "Session Update Ack"}, {CAPABILITIES_INFO, "Capabilities Info"}, {CAPABILITIES_INFO_ACK, "Capabilities Info Ack"}, - {BC_SERVICE_REQUEST, "BC Service Request"}, + {BC_SERVICE_REQUEST, "BC Service Request"}, {BC_SERVICE_REPLY, "BC Service Response"}, {BC_REGISTRATION_REQUEST, "BC Registration RequestT"}, {BC_REGISTRATION_REPLY, "BC Registration Reply"}, @@ -343,7 +343,7 @@ typedef enum { MF_CHALLENGE_EXT = 132, /* RFC 3012 */ OLD_NVSE_EXT = 133, /* RFC 3115 */ NVSE_EXT = 134, /* RFC 3115 */ - BCMCS_EXT = 0xb0 /* 3GPP2 A.S0019-A v2.0 */ + BCMCS_EXT = 0xb0 /* 3GPP2 A.S0019-A v2.0 */ } MIP_EXTS; @@ -406,8 +406,8 @@ static const value_string a11_ext_dormant[]= { static const true_false_string a11_tfs_ehrpd_mode = { - "eAT is operating in evolved mode", - "eAT is operating in legacy mode" + "eAT is operating in evolved mode", + "eAT is operating in legacy mode" }; /* 3GPP2 A.S0022-0 v2.0, section 4.2.14 */ @@ -550,78 +550,71 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) gboolean odd_even_ind; /* Decode Protocol Type */ - if (ext_len < 2) - { + if (ext_len < 2) { proto_tree_add_text(ext_tree, tvb, offset, 0, "Cannot decode Protocol Type - SSE too short"); return; } proto_tree_add_item(ext_tree, hf_a11_ses_ptype, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; + offset += 2; ext_len -= 2; /* Decode Session Key */ - if (ext_len < 4) - { + if (ext_len < 4) { proto_tree_add_text(ext_tree, tvb, offset, 0, "Cannot decode Session Key - SSE too short"); return; } proto_tree_add_item(ext_tree, hf_a11_ses_key, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; + offset += 4; ext_len -= 4; /* Decode Session Id Version */ - if (ext_len < 2) - { + if (ext_len < 2) { proto_tree_add_text(ext_tree, tvb, offset, 0, "Cannot decode Session Id Version - SSE too short"); return; } proto_tree_add_item(ext_tree, hf_a11_ses_sidver, tvb, offset+1, 1, ENC_BIG_ENDIAN); - offset += 2; + offset += 2; ext_len -= 2; /* Decode SRID */ - if (ext_len < 2) - { + if (ext_len < 2) { proto_tree_add_text(ext_tree, tvb, offset, 0, "Cannot decode SRID - SSE too short"); return; } proto_tree_add_item(ext_tree, hf_a11_ses_mnsrid, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; + offset += 2; ext_len -= 2; /* MSID Type */ - if (ext_len < 2) - { + if (ext_len < 2) { proto_tree_add_text(ext_tree, tvb, offset, 0, "Cannot decode MSID Type - SSE too short"); return; } proto_tree_add_item(ext_tree, hf_a11_ses_msid_type, tvb, offset, 2, ENC_BIG_ENDIAN); - offset += 2; + offset += 2; ext_len -= 2; /* MSID Len */ - if (ext_len < 1) - { + if (ext_len < 1) { proto_tree_add_text(ext_tree, tvb, offset, 0, "Cannot decode MSID Length - SSE too short"); return; } msid_len = tvb_get_guint8(tvb, offset); proto_tree_add_item(ext_tree, hf_a11_ses_msid_len, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; + offset += 1; ext_len -= 1; /* Decode MSID */ - if (ext_len < msid_len) - { + if (ext_len < msid_len) { proto_tree_add_text(ext_tree, tvb, offset, 0, "Cannot decode MSID - SSE too short"); return; @@ -630,19 +623,15 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) msid_digits = (char *)wmem_alloc(wmem_packet_scope(), A11_MSG_MSID_LEN_MAX+2); msid_start_offset = offset; - if (msid_len > A11_MSG_MSID_ELEM_LEN_MAX) - { + if (msid_len > A11_MSG_MSID_ELEM_LEN_MAX) { p_msid = "MSID is too long"; - }else if (msid_len == 0) - { + } else if (msid_len == 0) { p_msid = "MSID is too short"; - }else - { + } else { /* Decode the BCD digits */ - for(msid_index=0; msid_index<msid_len; msid_index++) - { + for (msid_index=0; msid_index<msid_len; msid_index++) { guint8 msid_digit = tvb_get_guint8(tvb, offset); - offset += 1; + offset += 1; ext_len -= 1; msid_digits[msid_index*2] = (msid_digit & 0x0F) + '0'; @@ -651,11 +640,9 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) odd_even_ind = (msid_digits[0] == '1'); - if (odd_even_ind) - { + if (odd_even_ind) { msid_num_digits = ((msid_len-1) * 2) + 1; - }else - { + } else { msid_num_digits = (msid_len-1) * 2; } @@ -674,50 +661,49 @@ static void decode_bcmcs(proto_tree* ext_tree, tvbuff_t* tvb, int offset, guint ext_len) { - guint8 bc_stype, entry_len; + guint8 bc_stype, entry_len; - /* Decode Protocol Type */ - if (ext_len < 2) - { + /* Decode Protocol Type */ + if (ext_len < 2) { proto_tree_add_text(ext_tree, tvb, offset, 0, - "Cannot decode Protocol Type - BCMCS too short"); + "Cannot decode Protocol Type - BCMCS too short"); return; } bc_stype=tvb_get_guint8(tvb, offset); proto_tree_add_item(ext_tree, hf_a11_bcmcs_stype, tvb, offset, 1, ENC_BIG_ENDIAN); - offset += 1; + offset += 1; ext_len -= 1; - switch(bc_stype) { - case 1: - { - int i = 0; - proto_item *ti; - proto_tree *entry_tree; - while (ext_len > 0){ - i++; - entry_len = tvb_get_guint8(tvb, offset); - if(entry_len == 0){ - ext_len -= 1; - entry_len = 1; - }else{ - ext_len = ext_len - entry_len; - } - ti = proto_tree_add_text(ext_tree, tvb, offset, entry_len, "BCMCS Information Entry %u", i); - entry_tree = proto_item_add_subtree(ti, ett_a11_bcmcs_entry); - proto_tree_add_item(entry_tree, hf_a11_bcmcs_entry_len, tvb, offset, 1, ENC_BIG_ENDIAN); - - proto_tree_add_text(ext_tree, tvb, offset, entry_len -1, "Entry Data, Not dissected yet"); - offset = offset+entry_len; - } - } - break; - default: - proto_tree_add_text(ext_tree, tvb, offset, -1, "Session Data Type %u Not dissected yet",bc_stype); - return; - break; - } + switch (bc_stype) { + case 1: + { + int i = 0; + proto_item *ti; + proto_tree *entry_tree; + while (ext_len > 0) { + i++; + entry_len = tvb_get_guint8(tvb, offset); + if (entry_len == 0) { + ext_len -= 1; + entry_len = 1; + } else { + ext_len = ext_len - entry_len; + } + ti = proto_tree_add_text(ext_tree, tvb, offset, entry_len, "BCMCS Information Entry %u", i); + entry_tree = proto_item_add_subtree(ti, ett_a11_bcmcs_entry); + proto_tree_add_item(entry_tree, hf_a11_bcmcs_entry_len, tvb, offset, 1, ENC_BIG_ENDIAN); + + proto_tree_add_text(ext_tree, tvb, offset, entry_len -1, "Entry Data, Not dissected yet"); + offset = offset+entry_len; + } + } + break; + default: + proto_tree_add_text(ext_tree, tvb, offset, -1, "Session Data Type %u Not dissected yet",bc_stype); + return; + break; + } } @@ -759,27 +745,27 @@ dissect_3gpp2_service_option_profile(proto_tree *tree, tvbuff_t *tvb, packet_i proto_tree_add_item(tree, hf_a11_serv_opt_prof_max_serv, tvb, offset, 4, ENC_BIG_ENDIAN); offset+=4; - while (tvb_length_remaining(tvb,offset)>0){ + while (tvb_length_remaining(tvb,offset) > 0) { sub_type_length = tvb_get_guint8(tvb,offset+1); sub_type = tvb_get_guint8(tvb,offset); proto_tree_add_item(tree, hf_a11_sub_type, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; pi = proto_tree_add_item(tree, hf_a11_sub_type_length, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; if (sub_type_length < 2) { expert_add_info(pinfo, pi, &ei_a11_sub_type_length_not2); sub_type_length = 2; } - if (sub_type==1){ + if (sub_type == 1) { proto_tree_add_item(tree, hf_a11_serv_opt, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; /* Max number of service instances of Service Option n */ proto_tree_add_item(tree, hf_a11_max_num_serv_opt, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; } - offset = offset+sub_type_length-2; + offset = offset + sub_type_length-2; } return ""; @@ -803,7 +789,7 @@ dissect_3gpp2_radius_aut_flow_profile_ids(proto_tree *tree, tvbuff_t *tvb, pac guint8 sub_type, sub_type_length; guint32 value; - while (tvb_length_remaining(tvb,offset)>0){ + while (tvb_length_remaining(tvb,offset) > 0) { sub_type = tvb_get_guint8(tvb,offset); sub_type_length = tvb_get_guint8(tvb,offset+1); /* value is 2 octets */ @@ -813,16 +799,16 @@ dissect_3gpp2_radius_aut_flow_profile_ids(proto_tree *tree, tvbuff_t *tvb, pac sub_tree = proto_item_add_subtree(item, ett_a11_aut_flow_profile_ids); proto_tree_add_item(sub_tree, hf_a11_aut_flow_prof_sub_type, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; item = proto_tree_add_item(sub_tree, hf_a11_aut_flow_prof_sub_type_len, tvb, offset, 1, ENC_BIG_ENDIAN); if (sub_type_length < 2) { expert_add_info(pinfo, item, &ei_a11_sub_type_length_not2); sub_type_length = 2; } - offset++; + offset += 1; proto_tree_add_item(sub_tree, hf_a11_aut_flow_prof_sub_type_value, tvb, offset, 2, ENC_BIG_ENDIAN); - offset = offset+sub_type_length-2; + offset = offset+sub_type_length - 2; } return ""; @@ -834,8 +820,7 @@ dissect_ase(tvbuff_t *tvb, int offset, guint ase_len, proto_tree *ext_tree) { guint clen = 0; /* consumed length */ - while (clen < ase_len) - { + while (clen < ase_len) { proto_tree *exts_tree; guint8 srid = tvb_get_guint8(tvb, offset+1); guint16 service_option = tvb_get_ntohs(tvb, offset+2); @@ -847,7 +832,7 @@ dissect_ase(tvbuff_t *tvb, int offset, guint ase_len, proto_tree *ext_tree) entry_start_offset = offset; entry_lenght = tvb_get_guint8(tvb, offset); - if (registration_request_msg && (service_option==64 || service_option==67)) + if (registration_request_msg && ((service_option == 64) || (service_option == 67))) ti = proto_tree_add_text(ext_tree, tvb, offset, entry_lenght+1, "GRE Key Entry (SRID: %d)", srid); else ti = proto_tree_add_text(ext_tree, tvb, offset, entry_lenght, "GRE Key Entry (SRID: %d)", srid); @@ -855,60 +840,60 @@ dissect_ase(tvbuff_t *tvb, int offset, guint ase_len, proto_tree *ext_tree) exts_tree = proto_item_add_subtree(ti, ett_a11_ase); proto_tree_add_item(exts_tree, hf_a11_ase_len_type, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; /* SRID */ proto_tree_add_item(exts_tree, hf_a11_ase_srid_type, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; /* Service Option */ proto_tree_add_item(exts_tree, hf_a11_ase_servopt_type, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; + offset += 2; /* GRE Protocol Type*/ proto_tree_add_item(exts_tree, hf_a11_ase_gre_proto_type, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; + offset += 2; /* GRE Key */ proto_tree_add_item(exts_tree, hf_a11_ase_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; + offset += 4; /* PCF IP Address */ proto_tree_add_item(exts_tree, hf_a11_ase_pcf_addr_key, tvb, offset, 4, ENC_BIG_ENDIAN); - offset+=4; + offset += 4; - if ((entry_lenght>14)&&(registration_request_msg)){ - if (service_option == 0x0043){ + if ((entry_lenght>14)&&(registration_request_msg)) { + if (service_option == 0x0043) { proto_item *tl; proto_tree *extv_tree; - guint8 profile_count=tvb_get_guint8(tvb, offset+6); - guint8 profile_index=0; - guint8 reverse_profile_count; + guint8 profile_count = tvb_get_guint8(tvb, offset+6); + guint8 profile_index = 0; + guint8 reverse_profile_count; proto_item *tj = proto_tree_add_text(exts_tree, tvb, offset,6+(profile_count*2)+1, "Forward ROHC Info"); proto_tree *extt_tree = proto_item_add_subtree(tj, ett_a11_forward_rohc); proto_tree_add_item(extt_tree, hf_a11_ase_forward_rohc_info_len, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; proto_tree_add_item(extt_tree, hf_a11_ase_forward_maxcid, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; + offset += 2; proto_tree_add_item(extt_tree, hf_a11_ase_forward_mrru, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; + offset += 2; proto_tree_add_item(extt_tree, hf_a11_ase_forward_large_cids, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; profile_count=tvb_get_guint8(tvb, offset); proto_tree_add_item(extt_tree, hf_a11_ase_forward_profile_count, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; - for(profile_index=0; profile_index<profile_count; profile_index++){ + for (profile_index=0; profile_index<profile_count; profile_index++) { proto_item *tk = proto_tree_add_text (extt_tree, tvb, offset, (2*profile_count), "Forward Profile : %d", profile_index); proto_tree *extu_tree = proto_item_add_subtree(tk, ett_a11_forward_profile); proto_tree_add_item(extu_tree, hf_a11_ase_forward_profile, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; + offset += 2; }/*for*/ @@ -919,36 +904,34 @@ dissect_ase(tvbuff_t *tvb, int offset, guint ase_len, proto_tree *ext_tree) extv_tree = proto_item_add_subtree(tl, ett_a11_reverse_rohc); proto_tree_add_item(extv_tree, hf_a11_ase_reverse_rohc_info_len, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; proto_tree_add_item(extv_tree, hf_a11_ase_reverse_maxcid, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; + offset += 2; proto_tree_add_item(extv_tree, hf_a11_ase_reverse_mrru, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; + offset += 2; proto_tree_add_item(extv_tree, hf_a11_ase_reverse_large_cids, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; profile_count=tvb_get_guint8(tvb, offset); proto_tree_add_item(extv_tree, hf_a11_ase_reverse_profile_count, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; - for(profile_index=0; profile_index<reverse_profile_count; profile_index++){ + for (profile_index=0; profile_index<reverse_profile_count; profile_index++) { proto_item *tm = proto_tree_add_text(extv_tree, tvb, offset, (2*profile_count), "Reverse Profile : %d", profile_index); proto_tree *extw_tree = proto_item_add_subtree(tm, ett_a11_reverse_profile); proto_tree_add_item(extw_tree, hf_a11_ase_reverse_profile, tvb, offset, 2, ENC_BIG_ENDIAN); - offset+=2; - - + offset += 2; }/*for*/ }/* Service option */ }/* if */ - clen+=entry_lenght+1; + clen += entry_lenght + 1; /* Set offset = start of next entry in case of padding */ offset = entry_start_offset + entry_lenght+1; @@ -972,11 +955,9 @@ dissect_fwd_qosinfo_flags(tvbuff_t *tvb, int offset, proto_tree *ext_tree, guint proto_tree_add_item(flags_tree, hf_a11_fqi_flags_ip_flow, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flags_tree, hf_a11_fqi_flags_dscp, tvb, offset, 1, ENC_BIG_ENDIAN); - if (flags & A11_FQI_DSCP_INCLUDED) - { + if (flags & A11_FQI_DSCP_INCLUDED) { *p_dscp_included = 1; - }else - { + } else { *p_dscp_included = 0; } } @@ -987,8 +968,7 @@ dissect_fqi_entry_flags(tvbuff_t *tvb, int offset, proto_tree *ext_tree, guint8 proto_item *ti = proto_tree_add_item(ext_tree, hf_a11_fqi_entry_flag, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree *flags_tree = proto_item_add_subtree(ti, ett_a11_fqi_entry_flags); - if (dscp_enabled) - { + if (dscp_enabled) { proto_tree_add_item(flags_tree, hf_a11_fqi_entry_flag_dscp, tvb, offset, 1, ENC_BIG_ENDIAN); } @@ -1027,13 +1007,12 @@ dissect_fwd_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) proto_tree_add_item(ext_tree, hf_a11_fqi_flowcount, tvb, offset+clen, 1, ENC_BIG_ENDIAN); clen++; - for(flow_index=0; flow_index<flow_count; flow_index++) - { + for (flow_index=0; flow_index<flow_count; flow_index++) { guint8 requested_qos_len = 0; - guint8 granted_qos_len = 0; + guint8 granted_qos_len = 0; guint8 entry_len = tvb_get_guint8(tvb, offset+clen); - guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1); + guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1); proto_item *ti = proto_tree_add_text (ext_tree, tvb, offset+clen, entry_len+1, "Forward Flow Entry (Flow Id: %d)", flow_id); @@ -1059,8 +1038,7 @@ dissect_fwd_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) clen++; /* Requested QoS Blob */ - if (requested_qos_len) - { + if (requested_qos_len) { proto_item *ti2; proto_tree *exts_tree2; @@ -1102,8 +1080,7 @@ dissect_fwd_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) clen++; /* Granted QoS Blob */ - if (granted_qos_len) - { + if (granted_qos_len) { proto_item *ti3; proto_tree *exts_tree3; @@ -1117,7 +1094,7 @@ dissect_fwd_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) proto_tree_add_item(exts_tree3, hf_a11_fqi_qos_granted_attribute_setid, tvb, offset+clen, 1, ENC_BIG_ENDIAN); clen++; } - }/*for(flow_index...) */ + } /* for (flow_index...) */ } /* Code to dissect Reverse QoS Info */ @@ -1138,13 +1115,12 @@ dissect_rev_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) proto_tree_add_item(ext_tree, hf_a11_rqi_flowcount, tvb, offset+clen, 1, ENC_BIG_ENDIAN); clen++; - for(flow_index=0; flow_index<flow_count; flow_index++) - { + for (flow_index=0; flow_index<flow_count; flow_index++) { guint8 requested_qos_len; guint8 granted_qos_len; guint8 entry_len = tvb_get_guint8(tvb, offset+clen); - guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1); + guint8 flow_id = tvb_get_guint8(tvb, offset+clen+1); proto_item *ti = proto_tree_add_text (ext_tree, tvb, offset+clen, entry_len+1, "Reverse Flow Entry (Flow Id: %d)", flow_id); @@ -1169,8 +1145,7 @@ dissect_rev_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) clen++; /* Requested QoS Blob */ - if (requested_qos_len) - { + if (requested_qos_len) { proto_item *ti1, *ti2; proto_tree *exts_tree1, *exts_tree2; @@ -1212,8 +1187,7 @@ dissect_rev_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) clen++; /* Granted QoS Blob */ - if (granted_qos_len) - { + if (granted_qos_len) { proto_item *ti3; proto_tree *exts_tree3; @@ -1246,8 +1220,7 @@ dissect_subscriber_qos_profile(tvbuff_t *tvb, packet_info *pinfo, int offset, in exts_tree = proto_item_add_subtree(ti, ett_a11_subscriber_profile); /* Subscriber QoS profile */ - if (qos_profile_len) - { + if (qos_profile_len) { proto_tree_add_item (exts_tree, hf_a11_subsciber_profile, tvb, offset, qos_profile_len, ENC_NA); @@ -1269,8 +1242,7 @@ dissect_fwd_qosupdate_info(tvbuff_t *tvb, int offset, proto_tree *ext_tree) proto_tree_add_item(ext_tree, hf_a11_fqui_flowcount, tvb, offset+clen, 1, ENC_BIG_ENDIAN); clen++; - for(flow_index=0; flow_index<flow_count; flow_index++) - { + for (flow_index=0; flow_index<flow_count; flow_index++) { proto_tree *exts_tree; guint8 granted_qos_len; @@ -1289,8 +1261,7 @@ dissect_fwd_qosupdate_info(tvbuff_t *tvb, int offset, proto_tree *ext_tree) clen++; /* Forward QoS Sub Blob */ - if (granted_qos_len) - { + if (granted_qos_len) { proto_tree_add_item (exts_tree, hf_a11_fqui_updated_qos, tvb, offset+clen, granted_qos_len, ENC_NA); @@ -1313,8 +1284,7 @@ dissect_rev_qosupdate_info(tvbuff_t *tvb, int offset, proto_tree *ext_tree) proto_tree_add_item(ext_tree, hf_a11_rqui_flowcount, tvb, offset+clen, 1, ENC_BIG_ENDIAN); clen++; - for(flow_index=0; flow_index<flow_count; flow_index++) - { + for (flow_index=0; flow_index<flow_count; flow_index++) { proto_tree *exts_tree; guint8 granted_qos_len; @@ -1332,8 +1302,7 @@ dissect_rev_qosupdate_info(tvbuff_t *tvb, int offset, proto_tree *ext_tree) clen++; /* Reverse QoS Sub Blob */ - if (granted_qos_len) - { + if (granted_qos_len) { proto_tree_add_item (exts_tree, hf_a11_rqui_updated_qos, tvb, offset+clen, granted_qos_len, ENC_NA); @@ -1389,24 +1358,24 @@ dissect_a11_extensions( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tre ext_tree = proto_item_add_subtree(ti, ett_a11_ext); proto_tree_add_uint(ext_tree, hf_a11_ext_type, tvb, offset, 1, ext_type); - offset++; + offset += 1; if (ext_type == SS_EXT) { proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len); - offset++; + offset += 1; } else if ((ext_type == CVSE_EXT) || (ext_type == OLD_CVSE_EXT)) { - offset++; + offset += 1; proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len); - offset+=2; + offset += 2; } else if (ext_type != GEN_AUTH_EXT) { /* Another nasty hack since GEN_AUTH_EXT broke everything */ proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len); - offset++; + offset += 1; } - switch(ext_type) { + switch (ext_type) { case SS_EXT: decode_sse(ext_tree, tvb, offset, ext_len); offset += ext_len; @@ -1445,9 +1414,9 @@ dissect_a11_extensions( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tre * in the wrong place :( */ proto_tree_add_uint(ext_tree, hf_a11_ext_stype, tvb, offset, 1, ext_subtype); - offset++; + offset += 1; proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len); - offset+=2; + offset += 2; /* SPI */ if (ext_len < 4) break; @@ -1494,7 +1463,7 @@ dissect_a11_extensions( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tre apptype = tvb_get_ntohs(tvb, offset); offset += 2; ext_len -= 2; - switch(apptype) { + switch (apptype) { case 0x0401: if (ext_len < 5) break; @@ -1633,7 +1602,7 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* flags */ flags = tvb_get_guint8(tvb, offset); @@ -1647,7 +1616,7 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ proto_tree_add_boolean(flags_tree, hf_a11_g, tvb, offset, 1, flags); proto_tree_add_boolean(flags_tree, hf_a11_v, tvb, offset, 1, flags); proto_tree_add_boolean(flags_tree, hf_a11_t, tvb, offset, 1, flags); - offset++; + offset += 1; /* lifetime */ proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -1682,11 +1651,11 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reply Code */ proto_tree_add_item(a11_tree, hf_a11_code, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; /* Registration Lifetime */ proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -1716,10 +1685,10 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=3; + offset += 3; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1746,14 +1715,14 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=2; + offset += 2; /* Ack Status */ proto_tree_add_item(a11_tree, hf_a11_status, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1779,10 +1748,10 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=3; + offset += 3; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1809,14 +1778,14 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=2; + offset += 2; /* Ack Status */ proto_tree_add_item(a11_tree, hf_a11_status, tvb, offset, 1, ENC_BIG_ENDIAN); - offset++; + offset += 1; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1843,10 +1812,10 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=3; + offset += 3; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1876,10 +1845,10 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=3; + offset += 3; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -1896,74 +1865,74 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ } /* if tree */ break; case BC_SERVICE_REQUEST: - col_add_fstr(pinfo->cinfo, COL_INFO, "Service Request: PCF=%s ", + col_add_fstr(pinfo->cinfo, COL_INFO, "Service Request: PCF=%s ", tvb_ip_to_str(tvb, offset + 8)); - + if (tree) { ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE); a11_tree = proto_item_add_subtree(ti, ett_a11); - + /* type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset+=4; - + offset += 4; + /* home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE); offset += 4; - + /* Care-of-Address */ proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE); offset += 4; - + /* Identifier - assumed to be an NTP time here */ proto_tree_add_item(a11_tree, hf_a11_ident, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); offset += 8; - + } /* if tree */ break; case BC_SERVICE_REPLY: col_add_fstr(pinfo->cinfo, COL_INFO, "Service Response: BSN=%s ", tvb_ip_to_str(tvb, offset + 8)); - + if (tree) { ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE); a11_tree = proto_item_add_subtree(ti, ett_a11); - + /* type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset+=3; - + offset += 3; + /* Reply Code */ proto_tree_add_item(a11_tree, hf_a11_code, tvb, offset, 1, FALSE); - offset++; - + offset += 1; + /* home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE); offset += 4; - + /* Home Agent */ proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE); offset += 4; - + /* Identifier - assumed to be an NTP time here */ proto_tree_add_item(a11_tree, hf_a11_ident, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); offset += 8; - + } /* if tree */ break; case BC_REGISTRATION_REQUEST: col_add_fstr(pinfo->cinfo, COL_INFO, "BC Reg Request: BSN=%s ", tvb_ip_to_str(tvb, offset + 8)); - + if (tree) { ti = proto_tree_add_item(tree, proto_a11, tvb, offset, -1, FALSE); a11_tree = proto_item_add_subtree(ti, ett_a11); - + /* type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset+=1; - + offset += 1; + /* flags */ flags = tvb_get_guint8(tvb, offset); tf = proto_tree_add_uint(a11_tree, hf_a11_flags, tvb, @@ -1976,29 +1945,29 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ proto_tree_add_boolean(flags_tree, hf_a11_g, tvb, offset, 1, flags); proto_tree_add_boolean(flags_tree, hf_a11_v, tvb, offset, 1, flags); proto_tree_add_boolean(flags_tree, hf_a11_t, tvb, offset, 1, flags); - offset++; - + offset += 1; + /* lifetime */ proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, FALSE); offset +=2; - + /* home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE); offset += 4; - + /* Home Agent */ proto_tree_add_item(a11_tree, hf_a11_haaddr, tvb, offset, 4, FALSE); offset += 4; - + /* Care-of-Address */ proto_tree_add_item(a11_tree, hf_a11_coa, tvb, offset, 4, FALSE); offset += 4; - + /* Identifier - assumed to be an NTP time here */ proto_tree_add_item(a11_tree, hf_a11_ident, tvb, offset, 8, ENC_TIME_NTP|ENC_BIG_ENDIAN); offset += 8; - + } /* if tree */ break; @@ -2015,11 +1984,11 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reply Code */ proto_tree_add_item(a11_tree, hf_a11_code, tvb, offset, 1, FALSE); - offset++; + offset += 1; /* Registration Lifetime */ proto_tree_add_item(a11_tree, hf_a11_life, tvb, offset, 2, FALSE); @@ -2050,10 +2019,10 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=3; + offset += 3; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE); @@ -2080,14 +2049,14 @@ dissect_a11( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ /* Type */ proto_tree_add_uint(a11_tree, hf_a11_type, tvb, offset, 1, type); - offset++; + offset += 1; /* Reserved */ - offset+=2; + offset += 2; /* Ack Status */ proto_tree_add_item(a11_tree, hf_a11_status, tvb, offset, 1, FALSE); - offset++; + offset += 1; /* Home address */ proto_tree_add_item(a11_tree, hf_a11_homeaddr, tvb, offset, 4, FALSE); diff --git a/epan/dissectors/packet-actrace.h b/epan/dissectors/packet-actrace.h index b87275f2f4..2bda05d172 100644 --- a/epan/dissectors/packet-actrace.h +++ b/epan/dissectors/packet-actrace.h @@ -23,14 +23,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + /* Container for tapping relevant data */ typedef struct _actrace_info_t { - int type; /* ACTRACE_CAS=1 ACTRACE_ISDN=2 */ - int direction; /* direction BLADE_TO_PSTN=0 PSTN_TO_BLADE=1 */ - int trunk; - gint32 cas_bchannel; - const gchar *cas_frame_label; + int type; /* ACTRACE_CAS=1 ACTRACE_ISDN=2 */ + int direction; /* direction BLADE_TO_PSTN=0 PSTN_TO_BLADE=1 */ + int trunk; + gint32 cas_bchannel; + const gchar *cas_frame_label; } actrace_info_t; diff --git a/epan/dissectors/packet-aim-buddylist.c b/epan/dissectors/packet-aim-buddylist.c index fbb5d36298..a42321f019 100644 --- a/epan/dissectors/packet-aim-buddylist.c +++ b/epan/dissectors/packet-aim-buddylist.c @@ -60,13 +60,13 @@ static gint ett_aim_buddylist = -1; static int dissect_aim_buddylist_buddylist(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree) { int offset = 0; - while(tvb_length_remaining(tvb, offset) > 0) { + while (tvb_length_remaining(tvb, offset) > 0) { offset = dissect_aim_buddyname( tvb, pinfo, offset, buddy_tree); } return offset; } -static int dissect_aim_buddylist_rights_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree) +static int dissect_aim_buddylist_rights_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree) { return dissect_aim_tlv_sequence(tvb, pinfo, 0, buddy_tree, aim_buddylist_tlvs); } @@ -79,8 +79,8 @@ static int dissect_aim_buddylist_reject(tvbuff_t *tvb, packet_info *pinfo, proto static int dissect_aim_buddylist_oncoming(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree) { guchar buddyname[MAX_BUDDYNAME_LENGTH+1]; - int offset = 0; - int buddyname_length = aim_get_buddyname( buddyname, tvb, offset, offset + 1 ); + int offset = 0; + int buddyname_length = aim_get_buddyname( buddyname, tvb, offset, offset + 1 ); col_set_str(pinfo->cinfo, COL_INFO, "Oncoming Buddy"); col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", @@ -89,7 +89,7 @@ static int dissect_aim_buddylist_oncoming(tvbuff_t *tvb, packet_info *pinfo, pro offset += dissect_aim_buddyname(tvb, pinfo, offset, buddy_tree); /* Warning level */ - proto_tree_add_item(buddy_tree, hf_aim_userinfo_warninglevel, tvb, offset, + proto_tree_add_item(buddy_tree, hf_aim_userinfo_warninglevel, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -98,12 +98,12 @@ static int dissect_aim_buddylist_oncoming(tvbuff_t *tvb, packet_info *pinfo, pro return offset; } -static int dissect_aim_buddylist_offgoing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree) +static int dissect_aim_buddylist_offgoing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree) { guchar buddyname[MAX_BUDDYNAME_LENGTH+1]; - int offset = 0; - int buddyname_length = aim_get_buddyname( buddyname, tvb, offset, offset + 1 ); + int offset = 0; + int buddyname_length = aim_get_buddyname( buddyname, tvb, offset, offset + 1 ); col_set_str(pinfo->cinfo, COL_INFO, "Offgoing Buddy"); col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", @@ -112,7 +112,7 @@ static int dissect_aim_buddylist_offgoing(tvbuff_t *tvb, packet_info *pinfo, pro offset += dissect_aim_buddyname(tvb, pinfo, offset, buddy_tree); /* Warning level */ - proto_tree_add_item(buddy_tree, hf_aim_userinfo_warninglevel, tvb, offset, + proto_tree_add_item(buddy_tree, hf_aim_userinfo_warninglevel, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -127,7 +127,7 @@ static const aim_subtype aim_fnac_family_buddylist[] = { { 0x0005, "Remove Buddy", dissect_aim_buddylist_buddylist }, { 0x0006, "Watchers List Request", NULL }, { 0x0007, "Watchers List Reply", dissect_aim_buddylist_buddylist }, - { 0x000a, "Reject Buddy", dissect_aim_buddylist_reject }, + { 0x000a, "Reject Buddy", dissect_aim_buddylist_reject }, { 0x000b, "Oncoming Buddy", dissect_aim_buddylist_oncoming }, { 0x000c, "Offgoing Buddy", dissect_aim_buddylist_offgoing }, { 0, NULL, NULL } @@ -141,7 +141,7 @@ proto_register_aim_buddylist(void) /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_aim_userinfo_warninglevel, - { "Warning Level", "aim_buddylist.userinfo.warninglevel", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, + { "Warning Level", "aim_buddylist.userinfo.warninglevel", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, }; diff --git a/epan/dissectors/packet-aim-icq.c b/epan/dissectors/packet-aim-icq.c index f71580c2ea..9b5c9c26b1 100644 --- a/epan/dissectors/packet-aim-icq.c +++ b/epan/dissectors/packet-aim-icq.c @@ -47,11 +47,11 @@ void proto_reg_handoff_aim_icq(void); static const value_string aim_icq_data_types[] = { { ICQ_CLI_OFFLINE_MESSAGE_REQ, "Offline Message Request" }, - { ICQ_SRV_OFFLINE_MSGS, "Offline Messages Reply" }, + { ICQ_SRV_OFFLINE_MSGS, "Offline Messages Reply" }, { ICQ_SRV_END_OF_OFFLINE_MSGS, "End Of Offline Messages Reply" }, { ICQ_CLI_DELETE_OFFLINE_MSGS, "Delete Offline Messages Request" }, - { ICQ_CLI_META_INFO_REQ, "Metainfo Request" }, - { ICQ_SRV_META_INFO_REPL, "Metainfo Reply" }, + { ICQ_CLI_META_INFO_REQ, "Metainfo Request" }, + { ICQ_SRV_META_INFO_REPL, "Metainfo Reply" }, { 0, NULL } }; @@ -143,15 +143,15 @@ static struct static int dissect_aim_tlv_value_icq(proto_item *ti _U_, guint16 subtype _U_, tvbuff_t *tvb _U_, packet_info *pinfo) { - int offset = 0; - int i; + int offset = 0; + int i; proto_item *subtype_item; - guint16 req_type, req_subtype; - proto_tree *t = proto_item_add_subtree(ti, ett_aim_icq_tlv); + guint16 req_type, req_subtype; + proto_tree *t = proto_item_add_subtree(ti, ett_aim_icq_tlv); proto_tree_add_item(t, hf_icq_tlv_data_chunk_size, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; - + proto_tree_add_item(t, hf_icq_tlv_request_owner_uid, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; @@ -162,29 +162,29 @@ static int dissect_aim_tlv_value_icq(proto_item *ti _U_, guint16 subtype _U_, tv proto_tree_add_item(t, hf_icq_tlv_request_seq_num, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; - switch(req_type) { + switch (req_type) { case ICQ_CLI_OFFLINE_MESSAGE_REQ: return offset; case ICQ_CLI_DELETE_OFFLINE_MSGS: return offset; case ICQ_SRV_OFFLINE_MSGS: /* FIXME */ break; - case ICQ_SRV_END_OF_OFFLINE_MSGS: + case ICQ_SRV_END_OF_OFFLINE_MSGS: proto_tree_add_item(t, hf_icq_dropped_msg_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN); return offset+1; case ICQ_CLI_META_INFO_REQ: case ICQ_SRV_META_INFO_REPL: req_subtype = tvb_get_letohs(tvb, offset); subtype_item = proto_tree_add_item(t, hf_icq_meta_subtype, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset+=2; - - for(i = 0; icq_calls[i].name; i++) { - if(icq_calls[i].subtype == req_subtype) break; + + for (i = 0; icq_calls[i].name; i++) { + if (icq_calls[i].subtype == req_subtype) break; } col_set_str(pinfo->cinfo, COL_INFO, icq_calls[i].name?icq_calls[i].name:"Unknown ICQ Meta Call"); proto_item_append_text(subtype_item, " (%s)", icq_calls[i].name?icq_calls[i].name:"Unknown"); - if(icq_calls[i].dissector) + if (icq_calls[i].dissector) return icq_calls[i].dissector(tvb_new_subset_remaining(tvb, offset), pinfo, t); default: diff --git a/epan/dissectors/packet-aim-location.c b/epan/dissectors/packet-aim-location.c index 227a850551..a64c86b1c8 100644 --- a/epan/dissectors/packet-aim-location.c +++ b/epan/dissectors/packet-aim-location.c @@ -43,9 +43,9 @@ void proto_reg_handoff_aim_location(void); #define AIM_LOCATION_RIGHTS_TLV_MAX_CAPABILITIES 0x0002 static const aim_tlv aim_location_rights_tlvs[] = { - { AIM_LOCATION_RIGHTS_TLV_MAX_PROFILE_LENGTH, "Max Profile Length", dissect_aim_tlv_value_uint16 }, - { AIM_LOCATION_RIGHTS_TLV_MAX_CAPABILITIES, "Max capabilities", dissect_aim_tlv_value_uint16 }, - { 0, NULL, NULL } + { AIM_LOCATION_RIGHTS_TLV_MAX_PROFILE_LENGTH, "Max Profile Length", dissect_aim_tlv_value_uint16 }, + { AIM_LOCATION_RIGHTS_TLV_MAX_CAPABILITIES, "Max capabilities", dissect_aim_tlv_value_uint16 }, + { 0, NULL, NULL } }; #define AIM_LOCATE_TAG_TLV_SIG_TYPE 0x0001 @@ -60,16 +60,16 @@ static const aim_tlv aim_location_rights_tlvs[] = { #define AIM_LOCATE_TAG_TLV_HTML_INFO_DATA 0x000E static const aim_tlv aim_locate_tags_tlvs[] = { - { AIM_LOCATE_TAG_TLV_SIG_TYPE, "Signature MIME Type", dissect_aim_tlv_value_string }, - { AIM_LOCATE_TAG_TLV_SIG_DATA, "Signature Data", dissect_aim_tlv_value_string }, - { AIM_LOCATE_TAG_TLV_UNAVAILABLE_TYPE, "Away Message MIME Type", dissect_aim_tlv_value_string }, - { AIM_LOCATE_TAG_TLV_UNAVAILABLE_DATA, "Away Message Data", dissect_aim_tlv_value_string }, - { AIM_LOCATE_TAG_TLV_CAPABILITIES, "Client Capabilities", dissect_aim_tlv_value_client_capabilities }, - { AIM_LOCATE_TAG_TLV_SIG_TIME, "Signature Time", dissect_aim_tlv_value_time }, - { AIM_LOCATE_TAG_TLV_UNAVAILABLE_TIME, "Away Message Time", dissect_aim_tlv_value_time }, - { AIM_LOCATE_TAG_TLV_SUPPORT_HOST_SIG, "Enable Server Based Profiles", dissect_aim_tlv_value_uint8 }, - { AIM_LOCATE_TAG_TLV_HTML_INFO_TYPE, "Host Based Buddy MIME Type", dissect_aim_tlv_value_string }, - { AIM_LOCATE_TAG_TLV_HTML_INFO_DATA, "Host Bases Buddy Data", dissect_aim_tlv_value_string }, + { AIM_LOCATE_TAG_TLV_SIG_TYPE, "Signature MIME Type" , dissect_aim_tlv_value_string }, + { AIM_LOCATE_TAG_TLV_SIG_DATA, "Signature Data" , dissect_aim_tlv_value_string }, + { AIM_LOCATE_TAG_TLV_UNAVAILABLE_TYPE, "Away Message MIME Type" , dissect_aim_tlv_value_string }, + { AIM_LOCATE_TAG_TLV_UNAVAILABLE_DATA, "Away Message Data" , dissect_aim_tlv_value_string }, + { AIM_LOCATE_TAG_TLV_CAPABILITIES, "Client Capabilities" , dissect_aim_tlv_value_client_capabilities }, + { AIM_LOCATE_TAG_TLV_SIG_TIME, "Signature Time" , dissect_aim_tlv_value_time }, + { AIM_LOCATE_TAG_TLV_UNAVAILABLE_TIME, "Away Message Time" , dissect_aim_tlv_value_time }, + { AIM_LOCATE_TAG_TLV_SUPPORT_HOST_SIG, "Enable Server Based Profiles" , dissect_aim_tlv_value_uint8 }, + { AIM_LOCATE_TAG_TLV_HTML_INFO_TYPE, "Host Based Buddy MIME Type" , dissect_aim_tlv_value_string }, + { AIM_LOCATE_TAG_TLV_HTML_INFO_DATA, "Host Bases Buddy Data" , dissect_aim_tlv_value_string }, { 0, NULL, NULL } }; @@ -78,10 +78,10 @@ static const aim_tlv aim_locate_tags_tlvs[] = { #define FAMILY_LOCATION_USERINFO_INFOTYPE_CAPS 0x0005 static const value_string aim_snac_location_request_user_info_infotypes[] = { - { FAMILY_LOCATION_USERINFO_INFOTYPE_GENERALINFO, "Request General Info" }, - { FAMILY_LOCATION_USERINFO_INFOTYPE_AWAYMSG, "Request Away Message" }, - { FAMILY_LOCATION_USERINFO_INFOTYPE_CAPS, "Request Capabilities" }, - { 0, NULL } + { FAMILY_LOCATION_USERINFO_INFOTYPE_GENERALINFO, "Request General Info" }, + { FAMILY_LOCATION_USERINFO_INFOTYPE_AWAYMSG, "Request Away Message" }, + { FAMILY_LOCATION_USERINFO_INFOTYPE_CAPS, "Request Capabilities" }, + { 0, NULL } }; /* Initialize the protocol and registered fields */ @@ -107,7 +107,7 @@ static int dissect_aim_location_setuserinfo(tvbuff_t *tvb, packet_info *pinfo, p static int dissect_aim_location_watcher_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *loc_tree) { int offset = 0; - while(tvb_length_remaining(tvb, offset) > 0) { + while (tvb_length_remaining(tvb, offset) > 0) { offset = dissect_aim_buddyname(tvb, pinfo, offset, loc_tree); } return offset; @@ -118,15 +118,13 @@ static int dissect_aim_location_user_info_query(tvbuff_t *tvb, packet_info *pinf return dissect_aim_buddyname(tvb, pinfo, 4, loc_tree); } -static int dissect_aim_snac_location_request_user_information(tvbuff_t *tvb, - packet_info *pinfo _U_, - proto_tree *tree) +static int dissect_aim_snac_location_request_user_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { - int offset = 0; + int offset = 0; guint8 buddyname_length = 0; /* Info Type */ - proto_tree_add_item(tree, hf_aim_snac_location_request_user_info_infotype, + proto_tree_add_item(tree, hf_aim_snac_location_request_user_info_infotype, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -142,11 +140,9 @@ static int dissect_aim_snac_location_request_user_information(tvbuff_t *tvb, return offset; } -static int dissect_aim_snac_location_user_information(tvbuff_t *tvb, - packet_info *pinfo _U_, - proto_tree *tree) +static int dissect_aim_snac_location_user_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { - int offset = 0; + int offset = 0; guint8 buddyname_length = 0; /* Buddy Name length */ @@ -168,15 +164,15 @@ static int dissect_aim_snac_location_user_information(tvbuff_t *tvb, } static const aim_subtype aim_fnac_family_location[] = { - { 0x0001, "Error", dissect_aim_snac_error }, - { 0x0002, "Request Rights", NULL }, - { 0x0003, "Rights Info", dissect_aim_location_rightsinfo }, - { 0x0004, "Set User Info", dissect_aim_location_setuserinfo }, - { 0x0005, "Request User Info", dissect_aim_snac_location_request_user_information }, - { 0x0006, "User Info", dissect_aim_snac_location_user_information }, - { 0x0007, "Watcher Subrequest", NULL }, - { 0x0008, "Watcher Notification", dissect_aim_location_watcher_notification }, - { 0x0015, "User Info Query", dissect_aim_location_user_info_query }, + { 0x0001, "Error" , dissect_aim_snac_error }, + { 0x0002, "Request Rights" , NULL }, + { 0x0003, "Rights Info" , dissect_aim_location_rightsinfo }, + { 0x0004, "Set User Info" , dissect_aim_location_setuserinfo }, + { 0x0005, "Request User Info" , dissect_aim_snac_location_request_user_information }, + { 0x0006, "User Info" , dissect_aim_snac_location_user_information }, + { 0x0007, "Watcher Subrequest" , NULL }, + { 0x0008, "Watcher Notification" , dissect_aim_location_watcher_notification }, + { 0x0015, "User Info Query" , dissect_aim_location_user_info_query }, { 0, NULL, NULL } }; @@ -189,16 +185,16 @@ proto_register_aim_location(void) /* Setup list of header fields */ static hf_register_info hf[] = { { &hf_aim_buddyname_len, - { "Buddyname len", "aim_location.buddynamelen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } + { "Buddyname len", "aim_location.buddynamelen", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_aim_buddyname, - { "Buddy Name", "aim_location.buddyname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } + { "Buddy Name", "aim_location.buddyname", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, { &hf_aim_userinfo_warninglevel, - { "Warning Level", "aim_location.userinfo.warninglevel", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, + { "Warning Level", "aim_location.userinfo.warninglevel", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, }, { &hf_aim_snac_location_request_user_info_infotype, - { "Infotype", "aim_location.snac.request_user_info.infotype", FT_UINT16, BASE_HEX, VALS(aim_snac_location_request_user_info_infotypes), 0x0, + { "Infotype", "aim_location.snac.request_user_info.infotype", FT_UINT16, BASE_HEX, VALS(aim_snac_location_request_user_info_infotypes), 0x0, NULL, HFILL } }, }; diff --git a/epan/dissectors/packet-aim-oft.c b/epan/dissectors/packet-aim-oft.c index 25eb364890..5706d60f47 100644 --- a/epan/dissectors/packet-aim-oft.c +++ b/epan/dissectors/packet-aim-oft.c @@ -43,7 +43,7 @@ static int proto_aim_oft = -1; /*static int ett_aim_recvfile = -1; static int ett_aim_sendfile = -1;*/ -/* +/* * cookie (8 chars) * encrypt (uint16) * compress (uint16) @@ -70,7 +70,7 @@ static int ett_aim_sendfile = -1;*/ * nencode (uint16) * nlanguage (uint16) * filename (raw, 64 chars) - * + * * length of file (uint16) * file data */ @@ -102,7 +102,7 @@ proto_reg_handoff_aim_oft(void) { /* dissector_handle_t aim_handle;*/ - /* FIXME + /* FIXME aim_handle = new_create_dissector_handle(dissect_aim, proto_aim); dissector_add_uint("tcp.port", TCP_PORT_AIM, aim_handle);*/ } diff --git a/epan/dissectors/packet-amr.c b/epan/dissectors/packet-amr.c index e1f702b702..3314a6d383 100644 --- a/epan/dissectors/packet-amr.c +++ b/epan/dissectors/packet-amr.c @@ -395,7 +395,7 @@ dissect_amr_be(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint amr /* Check if we have enough data available for our frames */ if (tvb_reported_length_remaining(tvb, bitcount/8) < bytes_needed_for_frames) { - item = proto_tree_add_text(tree, tvb, bitcount/8, bytes_needed_for_frames, + item = proto_tree_add_text(tree, tvb, bitcount/8, bytes_needed_for_frames, "Error: %d Bytes available, %d would be needed!", tvb_reported_length_remaining(tvb, bitcount/8), bytes_needed_for_frames); @@ -596,7 +596,7 @@ dissect_amr_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree) actx = get_asn1_ctx(pinfo->private_data); DISSECTOR_ASSERT(actx != NULL); - if (tree && actx != NULL) { + if (tree && (actx != NULL)) { amr_capability_t *ftr; ftr = find_cap(pinfo->match_string); if (ftr) { diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c index f541dfc137..c396126041 100644 --- a/epan/dissectors/packet-ansi_637.c +++ b/epan/dissectors/packet-ansi_637.c @@ -4,10 +4,10 @@ * Copyright 2003, Michael Lum <mlum [AT] telostech.com> * In association with Telos Technology Inc. * - * Title 3GPP2 Other + * Title 3GPP2 Other * * Short Message Service - * 3GPP2 C.S0015-0 TIA/EIA-637-A + * 3GPP2 C.S0015-0 TIA/EIA-637-A * * $Id$ * @@ -46,124 +46,124 @@ static const char *ansi_proto_name_trans = "ANSI IS-637-A (SMS) Transport Layer" static const char *ansi_proto_name_short = "IS-637-A"; static const value_string ansi_srvc_cat_strings[] = { - { 0x0000, "Unknown or unspecified" }, - { 0x0001, "Emergency Broadcasts" }, - { 0x0002, "Administrative" }, - { 0x0003, "Maintenance" }, - { 0x0004, "General News - Local" }, - { 0x0005, "General News - Regional" }, - { 0x0006, "General News - National" }, - { 0x0007, "General News - International" }, - { 0x0008, "Business/Financial News - Local" }, - { 0x0009, "Business/Financial News - Regional" }, - { 0x000A, "Business/Financial News - National" }, - { 0x000B, "Business/Financial News - International" }, - { 0x000C, "Sports News - Local" }, - { 0x000D, "Sports News - Regional" }, - { 0x000E, "Sports News - National" }, - { 0x000F, "Sports News - International" }, - { 0x0010, "Entertainment News - Local" }, - { 0x0011, "Entertainment News - Regional" }, - { 0x0012, "Entertainment News - National" }, - { 0x0013, "Entertainment News - International" }, - { 0x0014, "Local Weather" }, - { 0x0015, "Area Traffic Reports" }, - { 0x0016, "Local Airport Flight Schedules" }, - { 0x0017, "Restaurants" }, - { 0x0018, "Lodgings" }, - { 0x0019, "Retail Directory" }, - { 0x001A, "Advertisements" }, - { 0x001B, "Stock Quotes" }, - { 0x001C, "Employment Opportunities" }, - { 0x001D, "Medical/Health/Hospitals" }, - { 0x001E, "Technology News" }, - { 0x001F, "Multi-category" }, + { 0x0000, "Unknown or unspecified" }, + { 0x0001, "Emergency Broadcasts" }, + { 0x0002, "Administrative" }, + { 0x0003, "Maintenance" }, + { 0x0004, "General News - Local" }, + { 0x0005, "General News - Regional" }, + { 0x0006, "General News - National" }, + { 0x0007, "General News - International" }, + { 0x0008, "Business/Financial News - Local" }, + { 0x0009, "Business/Financial News - Regional" }, + { 0x000A, "Business/Financial News - National" }, + { 0x000B, "Business/Financial News - International" }, + { 0x000C, "Sports News - Local" }, + { 0x000D, "Sports News - Regional" }, + { 0x000E, "Sports News - National" }, + { 0x000F, "Sports News - International" }, + { 0x0010, "Entertainment News - Local" }, + { 0x0011, "Entertainment News - Regional" }, + { 0x0012, "Entertainment News - National" }, + { 0x0013, "Entertainment News - International" }, + { 0x0014, "Local Weather" }, + { 0x0015, "Area Traffic Reports" }, + { 0x0016, "Local Airport Flight Schedules" }, + { 0x0017, "Restaurants" }, + { 0x0018, "Lodgings" }, + { 0x0019, "Retail Directory" }, + { 0x001A, "Advertisements" }, + { 0x001B, "Stock Quotes" }, + { 0x001C, "Employment Opportunities" }, + { 0x001D, "Medical/Health/Hospitals" }, + { 0x001E, "Technology News" }, + { 0x001F, "Multi-category" }, { 0, NULL }, }; static const value_string ansi_tele_msg_type_strings[] = { - { 1, "Deliver (mobile-terminated only)" }, - { 2, "Submit (mobile-originated only)" }, - { 3, "Cancellation (mobile-originated only)" }, - { 4, "Delivery Acknowledgement (mobile-terminated only)" }, - { 5, "User Acknowledgement (either direction)" }, + { 1, "Deliver (mobile-terminated only)" }, + { 2, "Submit (mobile-originated only)" }, + { 3, "Cancellation (mobile-originated only)" }, + { 4, "Delivery Acknowledgement (mobile-terminated only)" }, + { 5, "User Acknowledgement (either direction)" }, { 0, NULL }, }; static const value_string ansi_tele_msg_status_strings[] = { - {0x00,"Message accepted"}, - {0x01,"Message deposited to Internet"}, - {0x02,"Message delivered"}, - {0x03,"Message cancelled"}, - {0x84,"Network congestion"}, - {0x85,"Network error"}, - {0x9f,"Unknown error"}, - {0xc4,"Network congestion"}, - {0xc5,"Network error"}, - {0xc6,"Cancel failed"}, - {0xc7,"Blocked destination"}, - {0xc8,"Text too long"}, - {0xc9,"Duplicate message"}, - {0xca,"Invalid destination"}, - {0xcd,"Message expired"}, - {0xdf,"Unknown error"}, + {0x00, "Message accepted"}, + {0x01, "Message deposited to Internet"}, + {0x02, "Message delivered"}, + {0x03, "Message cancelled"}, + {0x84, "Network congestion"}, + {0x85, "Network error"}, + {0x9f, "Unknown error"}, + {0xc4, "Network congestion"}, + {0xc5, "Network error"}, + {0xc6, "Cancel failed"}, + {0xc7, "Blocked destination"}, + {0xc8, "Text too long"}, + {0xc9, "Duplicate message"}, + {0xca, "Invalid destination"}, + {0xcd, "Message expired"}, + {0xdf, "Unknown error"}, { 0, NULL } }; static const value_string ansi_tele_id_strings[] = { - { 1, "Reserved for maintenance" }, - { 4096, "AMPS Extended Protocol Enhanced Services" }, - { 4097, "CDMA Cellular Paging Teleservice" }, - { 4098, "CDMA Cellular Messaging Teleservice" }, - { 4099, "CDMA Voice Mail Notification" }, - { 4100, "CDMA Wireless Application Protocol (WAP)" }, - { 4101, "CDMA Wireless Enhanced Messaging Teleservice (WEMT)" }, - { 65535, "(Reserved) Being used for Broadcast" }, + { 1, "Reserved for maintenance" }, + { 4096, "AMPS Extended Protocol Enhanced Services" }, + { 4097, "CDMA Cellular Paging Teleservice" }, + { 4098, "CDMA Cellular Messaging Teleservice" }, + { 4099, "CDMA Voice Mail Notification" }, + { 4100, "CDMA Wireless Application Protocol (WAP)" }, + { 4101, "CDMA Wireless Enhanced Messaging Teleservice (WEMT)" }, + { 65535, "(Reserved) Being used for Broadcast" }, { 0, NULL }, }; static const value_string ansi_tele_param_strings[] = { - { 0x00, "Message Identifier" }, - { 0x01, "User Data" }, - { 0x02, "User Response Code" }, - { 0x03, "Message Center Time Stamp" }, - { 0x04, "Validity Period - Absolute" }, - { 0x05, "Validity Period - Relative" }, - { 0x06, "Deferred Delivery Time - Absolute" }, - { 0x07, "Deferred Delivery Time - Relative" }, - { 0x08, "Priority Indicator" }, - { 0x09, "Privacy Indicator" }, - { 0x0a, "Reply Option" }, - { 0x0b, "Number of Messages" }, - { 0x0c, "Alert on Message Delivery" }, - { 0x0d, "Language Indicator" }, - { 0x0e, "Call-Back Number" }, - { 0x0f, "Message Display Mode" }, - { 0x10, "Multiple Encoding User Data" }, - { 0x14, "Message Status" }, + { 0x00, "Message Identifier" }, + { 0x01, "User Data" }, + { 0x02, "User Response Code" }, + { 0x03, "Message Center Time Stamp" }, + { 0x04, "Validity Period - Absolute" }, + { 0x05, "Validity Period - Relative" }, + { 0x06, "Deferred Delivery Time - Absolute" }, + { 0x07, "Deferred Delivery Time - Relative" }, + { 0x08, "Priority Indicator" }, + { 0x09, "Privacy Indicator" }, + { 0x0a, "Reply Option" }, + { 0x0b, "Number of Messages" }, + { 0x0c, "Alert on Message Delivery" }, + { 0x0d, "Language Indicator" }, + { 0x0e, "Call-Back Number" }, + { 0x0f, "Message Display Mode" }, + { 0x10, "Multiple Encoding User Data" }, + { 0x14, "Message Status" }, { 0, NULL }, }; -#define ANSI_TRANS_MSG_TYPE_BROADCAST 1 +#define ANSI_TRANS_MSG_TYPE_BROADCAST 1 static const value_string ansi_trans_msg_type_strings[] = { - { 0, "Point-to-Point" }, - { 1, "Broadcast" }, - { 2, "Acknowledge" }, + { 0, "Point-to-Point" }, + { 1, "Broadcast" }, + { 2, "Acknowledge" }, { 0, NULL }, }; static const value_string ansi_trans_param_strings[] = { - { 0x00, "Teleservice Identifier" }, - { 0x01, "Service Category" }, - { 0x02, "Originating Address" }, - { 0x03, "Originating Subaddress" }, - { 0x04, "Destination Address" }, - { 0x05, "Destination Subaddress" }, - { 0x06, "Bearer Reply Option" }, - { 0x07, "Cause Codes" }, - { 0x08, "Bearer Data" }, + { 0x00, "Teleservice Identifier" }, + { 0x01, "Service Category" }, + { 0x02, "Originating Address" }, + { 0x03, "Originating Subaddress" }, + { 0x04, "Destination Address" }, + { 0x05, "Destination Subaddress" }, + { 0x06, "Bearer Reply Option" }, + { 0x07, "Cause Codes" }, + { 0x08, "Bearer Data" }, { 0, NULL }, }; @@ -214,9 +214,9 @@ static proto_tree *g_tree; static int decode_7_bits(tvbuff_t *tvb, guint32 *offset, guint8 num_fields, guint8 *last_oct, guint8 *last_bit, gchar *buf) { - guint8 oct, oct2, bit; - /* guint32 saved_offset; */ - guint32 i; + guint8 oct, oct2, bit; + /* guint32 saved_offset; */ + guint32 i; if (num_fields == 0) @@ -230,65 +230,65 @@ decode_7_bits(tvbuff_t *tvb, guint32 *offset, guint8 num_fields, guint8 *last_oc if (bit == 1) { - oct2 = tvb_get_guint8(tvb, *offset); - (*offset)++; + oct2 = tvb_get_guint8(tvb, *offset); + (*offset) += 1; } for (i=0; i < num_fields; i++) { - if (bit != 1) - { - oct = oct2; - - /* - * cannot grab an octet if we are getting - * the last field and bit is 7 or 8 - * because there may not be another octet - */ - if (((i + 1) != num_fields) || - ((bit != 7) && (bit != 8))) - { - oct2 = tvb_get_guint8(tvb, *offset); - (*offset)++; - } - } - - switch (bit) - { - case 1: - buf[i] = ((oct & 0x01) << 6) | ((oct2 & 0xfc) >> 2); - break; - - case 2: - buf[i] = ((oct & 0x03) << 5) | ((oct2 & 0xf8) >> 3); - break; - - case 3: - buf[i] = ((oct & 0x07) << 4) | ((oct2 & 0xf0) >> 4); - break; - - case 4: - buf[i] = ((oct & 0x0f) << 3) | ((oct2 & 0xe0) >> 5); - break; - - case 5: - buf[i] = ((oct & 0x1f) << 2) | ((oct2 & 0xc0) >> 6); - break; - - case 6: - buf[i] = ((oct & 0x3f) << 1) | ((oct2 & 0x80) >> 7); - break; - - case 7: - buf[i] = oct & 0x7f; - break; - - case 8: - buf[i] = (oct & 0xfe) >> 1; - break; - } - - bit = (bit % 8) + 1; + if (bit != 1) + { + oct = oct2; + + /* + * cannot grab an octet if we are getting + * the last field and bit is 7 or 8 + * because there may not be another octet + */ + if (((i + 1) != num_fields) || + ((bit != 7) && (bit != 8))) + { + oct2 = tvb_get_guint8(tvb, *offset); + (*offset) += 1; + } + } + + switch (bit) + { + case 1: + buf[i] = ((oct & 0x01) << 6) | ((oct2 & 0xfc) >> 2); + break; + + case 2: + buf[i] = ((oct & 0x03) << 5) | ((oct2 & 0xf8) >> 3); + break; + + case 3: + buf[i] = ((oct & 0x07) << 4) | ((oct2 & 0xf0) >> 4); + break; + + case 4: + buf[i] = ((oct & 0x0f) << 3) | ((oct2 & 0xe0) >> 5); + break; + + case 5: + buf[i] = ((oct & 0x1f) << 2) | ((oct2 & 0xc0) >> 6); + break; + + case 6: + buf[i] = ((oct & 0x3f) << 1) | ((oct2 & 0x80) >> 7); + break; + + case 7: + buf[i] = oct & 0x7f; + break; + + case 8: + buf[i] = (oct & 0xfe) >> 1; + break; + } + + bit = (bit % 8) + 1; } buf[i] = '\0'; @@ -299,27 +299,27 @@ decode_7_bits(tvbuff_t *tvb, guint32 *offset, guint8 num_fields, guint8 *last_oc /* PARAM FUNCTIONS */ -#define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \ +#define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \ if ((edc_len) > (edc_max_len)) \ { \ - proto_tree_add_text(tree, tvb, offset, \ - (edc_len) - (edc_max_len), "Extraneous Data"); \ + proto_tree_add_text(tree, tvb, offset, \ + (edc_len) - (edc_max_len), "Extraneous Data"); \ } -#define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \ +#define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \ if ((sdc_len) < (sdc_min_len)) \ { \ - proto_tree_add_text(tree, tvb, offset, \ - (sdc_len), "Short Data (?)"); \ - return; \ + proto_tree_add_text(tree, tvb, offset, \ + (sdc_len), "Short Data (?)"); \ + return; \ } -#define EXACT_DATA_CHECK(edc_len, edc_eq_len) \ +#define EXACT_DATA_CHECK(edc_len, edc_eq_len) \ if ((edc_len) != (edc_eq_len)) \ { \ - proto_tree_add_text(tree, tvb, offset, \ - (edc_len), "Unexpected Data Length"); \ - return; \ + proto_tree_add_text(tree, tvb, offset, \ + (edc_len), "Unexpected Data Length"); \ + return; \ } static void @@ -344,10 +344,9 @@ static void tele_param_msg_status(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { /* Declare some variables */ - - guint8 oct; - guint8 error_class; - guint8 msg_status_code; + guint8 oct; + guint8 error_class; + guint8 msg_status_code; const gchar *str = NULL; /* Chceck if the exact length */ @@ -386,16 +385,16 @@ tele_param_msg_status(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset msg_status_code = (oct & 0x3f); if (error_class == 0x00){ - switch (msg_status_code) - { - case 0x00: str = "Message accepted";break; + switch (msg_status_code) + { + case 0x00: str = "Message accepted";break; case 0x01: str = "Message deposited to internet";break; case 0x02: str = "Message delivered";break; case 0x03: str = "Message cancelled";break; default: str = "Reserved";break; } - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); - proto_tree_add_text(tree, tvb, offset, 1, + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); + proto_tree_add_text(tree, tvb, offset, 1, "%s : Message status code: %s", ansi_637_bigbuf, str); @@ -443,18 +442,18 @@ tele_param_msg_status(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, oct2; - guint8 encoding; - guint8 msg_type; - guint8 num_fields; - guint8 used; - guint8 bit; - guint32 required_octs; - guint32 saved_offset; - guint32 i , out_len; - const gchar *str = NULL; - gchar *buf; - tvbuff_t * tvb_out = NULL; + guint8 oct, oct2; + guint8 encoding; + guint8 msg_type; + guint8 num_fields; + guint8 used; + guint8 bit; + guint32 required_octs; + guint32 saved_offset; + guint32 i , out_len; + const gchar *str = NULL; + gchar *buf; + tvbuff_t *tvb_out = NULL; gchar *utf8_text = NULL; GIConv cd; @@ -465,19 +464,19 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) /* * message encoding */ - oct = tvb_get_guint8(tvb, offset); - oct2 = 0; + oct = tvb_get_guint8(tvb, offset); + oct2 = 0; msg_type = 0; - used = 0; + used = 0; encoding = ((oct & 0xf8) >> 3); switch (encoding) { case 0x00: str = "Octet, unspecified"; break; case 0x01: str = "Extended Protocol Message"; - oct2 = tvb_get_guint8(tvb, offset+1); - msg_type = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); - break; + oct2 = tvb_get_guint8(tvb, offset+1); + msg_type = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); + break; case 0x02: str = "7-bit ASCII"; break; case 0x03: str = "IA5"; break; case 0x04: str = "UCS-2"; break; @@ -491,30 +490,30 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xf8, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Encoding: %s", - ansi_637_bigbuf, - str); + "%s : Encoding: %s", + ansi_637_bigbuf, + str); if (encoding == 0x01) { - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Message type: see TIA/EIA/IS-91 (%d)", - ansi_637_bigbuf, - msg_type); - - other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xf8, 8); - proto_tree_add_text(tree, tvb, offset+1, 1, - "%s : Message type", - ansi_637_bigbuf); - - oct = oct2; - offset++; - used++; + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Message type: see TIA/EIA/IS-91 (%d)", + ansi_637_bigbuf, + msg_type); + + other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xf8, 8); + proto_tree_add_text(tree, tvb, offset+1, 1, + "%s : Message type", + ansi_637_bigbuf); + + oct = oct2; + offset += 1; + used += 1; } - offset++; - used++; + offset += 1; + used += 1; /* * number of fields @@ -524,22 +523,22 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); proto_tree_add_text(tree, tvb, offset-1, 1, - "%s : Number of fields (MSB): %d", - ansi_637_bigbuf, - num_fields); + "%s : Number of fields (MSB): %d", + ansi_637_bigbuf, + num_fields); other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xf8, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number of fields (LSB)", - ansi_637_bigbuf); + "%s : Number of fields (LSB)", + ansi_637_bigbuf); other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x07, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Most significant bits of first field", - ansi_637_bigbuf); + "%s : Most significant bits of first field", + ansi_637_bigbuf); - offset++; - used++; + offset += 1; + used += 1; oct = oct2; /* NOTE: there are now 3 bits remaining in 'oct' */ @@ -551,71 +550,71 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) */ if (encoding == 0x02) { - /* - * magic numbers: - * 3 bits remaining from last octet - * 7 bit encoding - * 8 bits per octet - */ - i = (num_fields * 7) - 3; - required_octs = (i / 8) + ((i % 8) ? 1 : 0); - - if (required_octs + used > len) - { - proto_tree_add_text(tree, tvb, offset, 1, - "Missing %d octet(s) for number of fields", - (required_octs + used) - len); - - return; - } - - saved_offset = offset - 1; - i = num_fields * 7; - required_octs = (i / 8) + ((i % 8) ? 1 : 0); - buf = (gchar*)wmem_alloc(g_pinfo->pool, required_octs); - for (i=0; i < required_octs; i++) - { - oct = tvb_get_guint8(tvb, saved_offset); - oct2 = tvb_get_guint8(tvb, saved_offset + 1); - buf[i] = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); - saved_offset++; - } - tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); - add_new_data_source(g_pinfo, tvb_out, "Characters"); - offset = 0; - bit = 0; - if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { - dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, TRUE, &bit); - } - - saved_offset = offset; - bit = bit ? bit : 8; - oct = tvb_get_guint8(tvb_out, offset); - offset++; - - decode_7_bits(tvb_out, &offset, num_fields, &oct, &bit, ansi_637_bigbuf); - - proto_tree_add_unicode_string(tree, hf_ansi_637_tele_user_data_text, tvb_out, saved_offset, - offset - saved_offset, ansi_637_bigbuf); - - switch (bit) - { - case 1: oct2 = 0x01; break; - case 2: oct2 = 0x03; break; - case 3: oct2 = 0x07; break; - case 4: oct2 = 0x0f; break; - case 5: oct2 = 0x1f; break; - case 6: oct2 = 0x3f; break; - case 7: oct2 = 0x7f; break; - } - - if (bit != 8) - { - other_decode_bitfield_value(ansi_637_bigbuf, oct, oct2, 8); - proto_tree_add_text(tree, tvb, offset - 1, 1, - "%s : Reserved", - ansi_637_bigbuf); - } + /* + * magic numbers: + * 3 bits remaining from last octet + * 7 bit encoding + * 8 bits per octet + */ + i = (num_fields * 7) - 3; + required_octs = (i / 8) + ((i % 8) ? 1 : 0); + + if (required_octs + used > len) + { + proto_tree_add_text(tree, tvb, offset, 1, + "Missing %d octet(s) for number of fields", + (required_octs + used) - len); + + return; + } + + saved_offset = offset - 1; + i = num_fields * 7; + required_octs = (i / 8) + ((i % 8) ? 1 : 0); + buf = (gchar*)wmem_alloc(g_pinfo->pool, required_octs); + for (i=0; i < required_octs; i++) + { + oct = tvb_get_guint8(tvb, saved_offset); + oct2 = tvb_get_guint8(tvb, saved_offset + 1); + buf[i] = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); + saved_offset += 1; + } + tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); + add_new_data_source(g_pinfo, tvb_out, "Characters"); + offset = 0; + bit = 0; + if (g_pinfo->private_data && (GPOINTER_TO_UINT(g_pinfo->private_data) == TRUE)) { + dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, TRUE, &bit); + } + + saved_offset = offset; + bit = bit ? bit : 8; + oct = tvb_get_guint8(tvb_out, offset); + offset += 1; + + decode_7_bits(tvb_out, &offset, num_fields, &oct, &bit, ansi_637_bigbuf); + + proto_tree_add_unicode_string(tree, hf_ansi_637_tele_user_data_text, tvb_out, saved_offset, + offset - saved_offset, ansi_637_bigbuf); + + switch (bit) + { + case 1: oct2 = 0x01; break; + case 2: oct2 = 0x03; break; + case 3: oct2 = 0x07; break; + case 4: oct2 = 0x0f; break; + case 5: oct2 = 0x1f; break; + case 6: oct2 = 0x3f; break; + case 7: oct2 = 0x7f; break; + } + + if (bit != 8) + { + other_decode_bitfield_value(ansi_637_bigbuf, oct, oct2, 8); + proto_tree_add_text(tree, tvb, offset - 1, 1, + "%s : Reserved", + ansi_637_bigbuf); + } } else if (encoding == 0x03)/* IA5 */ { @@ -640,7 +639,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct = tvb_get_guint8(tvb, saved_offset); oct2 = tvb_get_guint8(tvb, saved_offset + 1); buf[i] = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); - saved_offset++; + saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); add_new_data_source(g_pinfo, tvb_out, "Characters"); @@ -652,7 +651,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) saved_offset = offset; bit = bit ? bit : 8; oct = tvb_get_guint8(tvb_out, offset); - offset++; + offset += 1; out_len = decode_7_bits(tvb_out, &offset, num_fields, &oct, &bit, ansi_637_bigbuf); IA5_7BIT_decode(ia5_637_bigbuf, ansi_637_bigbuf, out_len); @@ -670,7 +669,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct = tvb_get_guint8(tvb, saved_offset); oct2 = tvb_get_guint8(tvb, saved_offset + 1); buf[i] = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); - saved_offset++; + saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); add_new_data_source(g_pinfo, tvb_out, "Characters"); @@ -682,7 +681,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) if ((cd = g_iconv_open("UTF-8","UCS-2BE")) != (GIConv)-1) { utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb_out, offset, required_octs), required_octs , cd , NULL , NULL , &l_conv_error); - if(!l_conv_error) + if (!l_conv_error) { proto_tree_add_unicode_string(tree, hf_ansi_637_tele_user_data_text, tvb_out, offset, required_octs, utf8_text); @@ -691,7 +690,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { proto_tree_add_text(tree, tvb_out, offset, required_octs, "%s", "Failed on UCS-2BE contact Wireshark developers"); } - if(utf8_text) + if (utf8_text) g_free(utf8_text); g_iconv_close(cd); } @@ -705,7 +704,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct = tvb_get_guint8(tvb, saved_offset); oct2 = tvb_get_guint8(tvb, saved_offset + 1); buf[i] = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); - saved_offset++; + saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, num_fields, num_fields); add_new_data_source(g_pinfo, tvb_out, "Characters"); @@ -718,7 +717,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) if ((cd = g_iconv_open("UTF-8","iso-8859-8")) != (GIConv)-1) { utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb_out, offset, num_fields), num_fields , cd , NULL , NULL , &l_conv_error); - if(!l_conv_error) + if (!l_conv_error) { proto_tree_add_unicode_string(tree, hf_ansi_637_tele_user_data_text, tvb_out, offset, num_fields, utf8_text); @@ -727,7 +726,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { proto_tree_add_text(tree, tvb_out, offset, num_fields, "%s", "Failed on iso-8859-8 contact Wireshark developers"); } - if(utf8_text) + if (utf8_text) g_free(utf8_text); g_iconv_close(cd); } @@ -741,7 +740,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct = tvb_get_guint8(tvb, saved_offset); oct2 = tvb_get_guint8(tvb, saved_offset + 1); buf[i] = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); - saved_offset++; + saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, num_fields, num_fields); add_new_data_source(g_pinfo, tvb_out, "Characters"); @@ -754,7 +753,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) if ((cd = g_iconv_open("UTF-8","iso-8859-1")) != (GIConv)-1) { utf8_text = g_convert_with_iconv(tvb_get_ptr(tvb_out, offset, num_fields) , num_fields , cd , NULL , NULL , &l_conv_error); - if(!l_conv_error) + if (!l_conv_error) { proto_tree_add_unicode_string(tree, hf_ansi_637_tele_user_data_text, tvb_out, offset, num_fields, utf8_text); @@ -763,7 +762,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { proto_tree_add_text(tree, tvb_out, offset, num_fields, "%s", "Failed on iso-8859-1 contact Wireshark developers"); } - if(utf8_text) + if (utf8_text) g_free(utf8_text); g_iconv_close(cd); } @@ -791,7 +790,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct = tvb_get_guint8(tvb, saved_offset); oct2 = tvb_get_guint8(tvb, saved_offset + 1); buf[i] = ((oct & 0x07) << 5) | ((oct2 & 0xf8) >> 3); - saved_offset++; + saved_offset += 1; } tvb_out = tvb_new_child_real_data(tvb, buf, required_octs, required_octs); add_new_data_source(g_pinfo, tvb_out, "Characters"); @@ -801,7 +800,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, TRUE, &bit); } - out_len = gsm_sms_char_7bit_unpack(bit, required_octs, num_fields, + out_len = gsm_sms_char_7bit_unpack(bit, required_octs, num_fields, tvb_get_ptr(tvb_out, offset, required_octs), gsm_637_bigbuf); gsm_637_bigbuf[out_len] = '\0'; @@ -818,7 +817,7 @@ tele_param_user_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void tele_param_rsp_code(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; + guint8 oct; EXACT_DATA_CHECK(len, 1); @@ -828,14 +827,14 @@ tele_param_rsp_code(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct = tvb_get_guint8(tvb, offset); proto_tree_add_text(tree, tvb, offset, 1, - "Response code: %d", - oct); + "Response code: %d", + oct); } static void tele_param_timestamp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, oct2, oct3; + guint8 oct, oct2, oct3; EXACT_DATA_CHECK(len, 6); @@ -844,13 +843,13 @@ tele_param_timestamp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct3 = tvb_get_guint8(tvb, offset+2); proto_tree_add_text(tree, tvb, offset, 3, - "Year %d%d, Month %d%d, Day %d%d", - (oct & 0xf0) >> 4, - oct & 0x0f, - (oct2 & 0xf0) >> 4, - oct2 & 0x0f, - (oct3 & 0xf0) >> 4, - oct3 & 0x0f); + "Year %d%d, Month %d%d, Day %d%d", + (oct & 0xf0) >> 4, + oct & 0x0f, + (oct2 & 0xf0) >> 4, + oct2 & 0x0f, + (oct3 & 0xf0) >> 4, + oct3 & 0x0f); offset += 3; @@ -859,22 +858,22 @@ tele_param_timestamp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct3 = tvb_get_guint8(tvb, offset+2); proto_tree_add_text(tree, tvb, offset, 3, - "Hour %d%d, Minutes %d%d, Seconds %d%d", - (oct & 0xf0) >> 4, - oct & 0x0f, - (oct2 & 0xf0) >> 4, - oct2 & 0x0f, - (oct3 & 0xf0) >> 4, - oct3 & 0x0f); + "Hour %d%d, Minutes %d%d, Seconds %d%d", + (oct & 0xf0) >> 4, + oct & 0x0f, + (oct2 & 0xf0) >> 4, + oct2 & 0x0f, + (oct3 & 0xf0) >> 4, + oct3 & 0x0f); } static void tele_param_rel_timestamp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - guint32 value = 0; - const gchar *str = NULL; - const gchar *str2 = NULL; + guint8 oct; + guint32 value = 0; + const gchar *str = NULL; + const gchar *str2 = NULL; EXACT_DATA_CHECK(len, 1); @@ -887,39 +886,39 @@ tele_param_rel_timestamp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off case 247: str = "Valid until mobile becomes inactive/Deliver when mobile next becomes active"; break; case 248: str = "Valid until registration area changes, discard if not registered" ; break; default: - if (oct <= 143) { value = (oct + 1) * 5; str2 = "Minutes"; break; } - else if ((oct >= 144) && (oct <= 167)) { value = (oct - 143) * 30; str2 = "Minutes + 12 Hours"; break; } - else if ((oct >= 168) && (oct <= 196)) { value = oct - 166; str2 = "Days"; break; } - else if ((oct >= 197) && (oct <= 244)) { value = oct - 192; str2 = "Weeks"; break; } - else { str = "Reserved"; break; } + if (oct <= 143) { value = (oct + 1) * 5; str2 = "Minutes"; break; } + else if ((oct >= 144) && (oct <= 167)) { value = (oct - 143) * 30; str2 = "Minutes + 12 Hours"; break; } + else if ((oct >= 168) && (oct <= 196)) { value = oct - 166; str2 = "Days"; break; } + else if ((oct >= 197) && (oct <= 244)) { value = oct - 192; str2 = "Weeks"; break; } + else { str = "Reserved"; break; } } if (str == NULL) { - proto_tree_add_text(tree, tvb, offset, 1, - "%s", str2); + proto_tree_add_text(tree, tvb, offset, 1, + "%s", str2); } else { - proto_tree_add_text(tree, tvb, offset, 1, - "%d %s", - value, str2); + proto_tree_add_text(tree, tvb, offset, 1, + "%d %s", + value, str2); } } static const value_string tele_param_pri_ind_strings[] = { - { 0, "Normal" }, - { 1, "Interactive" }, - { 2, "Urgent" }, - { 3, "Emergency" }, + { 0, "Normal" }, + { 1, "Interactive" }, + { 2, "Urgent" }, + { 3, "Emergency" }, { 0, NULL } }; static void tele_param_pri_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; + guint8 oct; + const gchar *str = NULL; EXACT_DATA_CHECK(len, 1); @@ -929,21 +928,21 @@ tele_param_pri_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xc0, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : %s", - ansi_637_bigbuf, - str); + "%s : %s", + ansi_637_bigbuf, + str); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + "%s : Reserved", + ansi_637_bigbuf); } static void tele_param_priv_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; + guint8 oct; + const gchar *str = NULL; EXACT_DATA_CHECK(len, 1); @@ -959,20 +958,20 @@ tele_param_priv_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xc0, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : %s", - ansi_637_bigbuf, - str); + "%s : %s", + ansi_637_bigbuf, + str); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + "%s : Reserved", + ansi_637_bigbuf); } static void tele_param_reply_opt(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; + guint8 oct; EXACT_DATA_CHECK(len, 1); @@ -980,42 +979,42 @@ tele_param_reply_opt(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x80, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : %s (manual) acknowledgment is requested", - ansi_637_bigbuf, - (oct & 0x80) ? "User" : "No user"); + "%s : %s (manual) acknowledgment is requested", + ansi_637_bigbuf, + (oct & 0x80) ? "User" : "No user"); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x40, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : %s acknowledgment requested", - ansi_637_bigbuf, - (oct & 0x40) ? "Delivery" : "No delivery"); + "%s : %s acknowledgment requested", + ansi_637_bigbuf, + (oct & 0x40) ? "Delivery" : "No delivery"); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + "%s : Reserved", + ansi_637_bigbuf); } static void tele_param_num_messages(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; + guint8 oct; EXACT_DATA_CHECK(len, 1); oct = tvb_get_guint8(tvb, offset); proto_tree_add_text(tree, tvb, offset, 1, - "Number of voice mail messages: %d%d", - (oct & 0xf0) >> 4, - oct & 0x0f); + "Number of voice mail messages: %d%d", + (oct & 0xf0) >> 4, + oct & 0x0f); } static void tele_param_alert(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; + guint8 oct; + const gchar *str = NULL; EXACT_DATA_CHECK(len, 1); @@ -1031,21 +1030,21 @@ tele_param_alert(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xc0, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : %s", - ansi_637_bigbuf, - str); + "%s : %s", + ansi_637_bigbuf, + str); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + "%s : Reserved", + ansi_637_bigbuf); } static void tele_param_lang_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; + guint8 oct; + const gchar *str = NULL; EXACT_DATA_CHECK(len, 1); @@ -1065,16 +1064,16 @@ tele_param_lang_ind(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) } proto_tree_add_text(tree, tvb, offset, 1, - "%s", str); + "%s", str); } static void tele_param_cb_num(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, oct2, num_fields, odd; - guint32 saved_offset; - guint32 required_octs; - guint32 i; + guint8 oct, oct2, num_fields, odd; + guint32 saved_offset; + guint32 required_octs; + guint32 i; SHORT_DATA_CHECK(len, 2); @@ -1082,135 +1081,135 @@ tele_param_cb_num(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x80, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Digit mode: %s", - ansi_637_bigbuf, - (oct & 0x80) ? "8-bit ASCII" : "4-bit DTMF"); + "%s : Digit mode: %s", + ansi_637_bigbuf, + (oct & 0x80) ? "8-bit ASCII" : "4-bit DTMF"); if (oct & 0x80) { - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x70, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Type of number: (%d)", - ansi_637_bigbuf, - (oct & 0x70) >> 4); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x0f, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Numbering plan: (%d)", - ansi_637_bigbuf, - oct & 0x0f); - - offset++; - num_fields = tvb_get_guint8(tvb, offset); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xff, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number of fields: (%d)", - ansi_637_bigbuf, - num_fields); - - if (num_fields == 0) return; - - if (num_fields > (len - 2)) - { - proto_tree_add_text(tree, tvb, offset, 1, - "Missing %d octet(s) for number of fields", - (num_fields + 2) - len); - - return; - } - - offset++; - - i = 0; - while (i < num_fields) - { - ansi_637_bigbuf[i] = tvb_get_guint8(tvb, offset+i) & 0x7f; - i++; - } - ansi_637_bigbuf[i] = '\0'; - - proto_tree_add_text(tree, tvb, offset, num_fields, - "Number: %s", - ansi_637_bigbuf); + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x70, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Type of number: (%d)", + ansi_637_bigbuf, + (oct & 0x70) >> 4); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x0f, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Numbering plan: (%d)", + ansi_637_bigbuf, + oct & 0x0f); + + offset += 1; + num_fields = tvb_get_guint8(tvb, offset); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xff, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Number of fields: (%d)", + ansi_637_bigbuf, + num_fields); + + if (num_fields == 0) return; + + if (num_fields > (len - 2)) + { + proto_tree_add_text(tree, tvb, offset, 1, + "Missing %d octet(s) for number of fields", + (num_fields + 2) - len); + + return; + } + + offset += 1; + + i = 0; + while (i < num_fields) + { + ansi_637_bigbuf[i] = tvb_get_guint8(tvb, offset+i) & 0x7f; + i += 1; + } + ansi_637_bigbuf[i] = '\0'; + + proto_tree_add_text(tree, tvb, offset, num_fields, + "Number: %s", + ansi_637_bigbuf); } else { - offset++; - num_fields = (oct & 0x7f) << 1; - oct2 = tvb_get_guint8(tvb, offset); - num_fields |= ((oct2 & 0x80) >> 7); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x7f, 8); - proto_tree_add_text(tree, tvb, offset-1, 1, - "%s : Number of fields (MSB): (%d)", - ansi_637_bigbuf, - num_fields); - - other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x80, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number of fields (LSB)", - ansi_637_bigbuf); - - oct = oct2; - odd = FALSE; - - if (num_fields > 0) - { - i = (num_fields - 1) * 4; - required_octs = (i / 8) + ((i % 8) ? 1 : 0); - - if (required_octs + 2 > len) - { - proto_tree_add_text(tree, tvb, offset, 1, - "Missing %d octet(s) for number of fields", - (required_octs + 2) - len); - - return; - } - - odd = num_fields & 0x01; - memset((void *) ansi_637_bigbuf, 0, sizeof(ansi_637_bigbuf)); - saved_offset = offset; - offset++; - - i = 0; - while (i < num_fields) - { - ansi_637_bigbuf[i] = - air_digits[(oct & 0x78) >> 3]; - - i++; - if (i >= num_fields) break; - - oct2 = tvb_get_guint8(tvb, offset); - offset++; - - ansi_637_bigbuf[i] = - air_digits[((oct & 0x07) << 1) | ((oct2 & 0x80) >> 7)]; - - oct = oct2; - - i++; - } - - proto_tree_add_text(tree, tvb, saved_offset, offset - saved_offset, - "Number: %s", - ansi_637_bigbuf); - } - - other_decode_bitfield_value(ansi_637_bigbuf, oct, odd ? 0x07: 0x7f, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + offset += 1; + num_fields = (oct & 0x7f) << 1; + oct2 = tvb_get_guint8(tvb, offset); + num_fields |= ((oct2 & 0x80) >> 7); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x7f, 8); + proto_tree_add_text(tree, tvb, offset-1, 1, + "%s : Number of fields (MSB): (%d)", + ansi_637_bigbuf, + num_fields); + + other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x80, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Number of fields (LSB)", + ansi_637_bigbuf); + + oct = oct2; + odd = FALSE; + + if (num_fields > 0) + { + i = (num_fields - 1) * 4; + required_octs = (i / 8) + ((i % 8) ? 1 : 0); + + if (required_octs + 2 > len) + { + proto_tree_add_text(tree, tvb, offset, 1, + "Missing %d octet(s) for number of fields", + (required_octs + 2) - len); + + return; + } + + odd = num_fields & 0x01; + memset((void *) ansi_637_bigbuf, 0, sizeof(ansi_637_bigbuf)); + saved_offset = offset; + offset += 1; + + i = 0; + while (i < num_fields) + { + ansi_637_bigbuf[i] = + air_digits[(oct & 0x78) >> 3]; + + i += 1; + if (i >= num_fields) break; + + oct2 = tvb_get_guint8(tvb, offset); + offset += 1; + + ansi_637_bigbuf[i] = + air_digits[((oct & 0x07) << 1) | ((oct2 & 0x80) >> 7)]; + + oct = oct2; + + i += 1; + } + + proto_tree_add_text(tree, tvb, saved_offset, offset - saved_offset, + "Number: %s", + ansi_637_bigbuf); + } + + other_decode_bitfield_value(ansi_637_bigbuf, oct, odd ? 0x07: 0x7f, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Reserved", + ansi_637_bigbuf); } } static void tele_param_disp_mode(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; + guint8 oct; + const gchar *str = NULL; EXACT_DATA_CHECK(len, 1); @@ -1226,44 +1225,44 @@ tele_param_disp_mode(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xc0, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : %s", - ansi_637_bigbuf, - str); + "%s : %s", + ansi_637_bigbuf, + str); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + "%s : Reserved", + ansi_637_bigbuf); } -#define NUM_TELE_PARAM (sizeof(ansi_tele_param_strings)/sizeof(value_string)) +#define NUM_TELE_PARAM (sizeof(ansi_tele_param_strings)/sizeof(value_string)) static gint ett_ansi_637_tele_param[NUM_TELE_PARAM]; static void (*ansi_637_tele_param_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = { - tele_param_msg_id, /* Message Identifier */ - tele_param_user_data, /* User Data */ - tele_param_rsp_code, /* User Response Code */ - tele_param_timestamp, /* Message Center Time Stamp */ - tele_param_timestamp, /* Validity Period Absolute */ - tele_param_rel_timestamp, /* Validity Period Relative */ - tele_param_timestamp, /* Deferred Delivery Time - Absolute */ - tele_param_rel_timestamp, /* Deferred Delivery Time - Relative */ - tele_param_pri_ind, /* Priority Indicator */ - tele_param_priv_ind, /* Privacy Indicator */ - tele_param_reply_opt, /* Reply Option */ - tele_param_num_messages, /* Number of Messages */ - tele_param_alert, /* Alert on Message Delivery */ - tele_param_lang_ind, /* Language Indicator */ - tele_param_cb_num, /* Call-Back Number */ - tele_param_disp_mode, /* Message Display Mode */ - NULL, /* Multiple Encoding User Data */ - tele_param_msg_status /* Message status */ + tele_param_msg_id, /* Message Identifier */ + tele_param_user_data, /* User Data */ + tele_param_rsp_code, /* User Response Code */ + tele_param_timestamp, /* Message Center Time Stamp */ + tele_param_timestamp, /* Validity Period Absolute */ + tele_param_rel_timestamp, /* Validity Period Relative */ + tele_param_timestamp, /* Deferred Delivery Time - Absolute */ + tele_param_rel_timestamp, /* Deferred Delivery Time - Relative */ + tele_param_pri_ind, /* Priority Indicator */ + tele_param_priv_ind, /* Privacy Indicator */ + tele_param_reply_opt, /* Reply Option */ + tele_param_num_messages, /* Number of Messages */ + tele_param_alert, /* Alert on Message Delivery */ + tele_param_lang_ind, /* Language Indicator */ + tele_param_cb_num, /* Call-Back Number */ + tele_param_disp_mode, /* Message Display Mode */ + NULL, /* Multiple Encoding User Data */ + tele_param_msg_status /* Message status */ }; static void trans_param_tele_id(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) { - guint32 value; - const gchar *str = NULL; + guint32 value; + const gchar *str = NULL; EXACT_DATA_CHECK(len, 2); @@ -1275,65 +1274,65 @@ trans_param_tele_id(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, if (NULL == str) { - switch (value) - { - case 1: - str = "Reserved for maintenance"; - break; - case 4102: - str = "CDMA Service Category Programming Teleservice (SCPT)"; - break; - case 4103: - str = "CDMA Card Application Toolkit Protocol Teleservice (CATPT)"; - break; - case 32513: - str = "TDMA Cellular Messaging Teleservice"; - break; - case 32514: - str = "TDMA Cellular Paging Teleservice (CPT-136)"; - break; - case 32515: - str = "TDMA Over-the-Air Activation Teleservice (OATS)"; - break; - case 32520: - str = "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)"; - break; - case 32584: - str = "TDMA Segmented System Assisted Mobile Positioning Service"; - break; - default: - if ((value >= 2) && (value <= 4095)) - { - str = "Reserved for assignment by TIA-41"; - } - else if ((value >= 4104) && (value <= 4113)) - { - str = "Reserved for GSM1x Teleservice (CDMA)"; - } - else if ((value >= 4114) && (value <= 32512)) - { - str = "Reserved for assignment by TIA-41"; - } - else if ((value >= 32521) && (value <= 32575)) - { - str = "Reserved for assignment by this Standard for TDMA MS-based SMEs"; - } - else if ((value >= 49152) && (value <= 65535)) - { - str = "Reserved for carrier specific teleservices"; - } - else - { - str = "Unrecognized Teleservice ID"; - } - break; - } + switch (value) + { + case 1: + str = "Reserved for maintenance"; + break; + case 4102: + str = "CDMA Service Category Programming Teleservice (SCPT)"; + break; + case 4103: + str = "CDMA Card Application Toolkit Protocol Teleservice (CATPT)"; + break; + case 32513: + str = "TDMA Cellular Messaging Teleservice"; + break; + case 32514: + str = "TDMA Cellular Paging Teleservice (CPT-136)"; + break; + case 32515: + str = "TDMA Over-the-Air Activation Teleservice (OATS)"; + break; + case 32520: + str = "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)"; + break; + case 32584: + str = "TDMA Segmented System Assisted Mobile Positioning Service"; + break; + default: + if ((value >= 2) && (value <= 4095)) + { + str = "Reserved for assignment by TIA-41"; + } + else if ((value >= 4104) && (value <= 4113)) + { + str = "Reserved for GSM1x Teleservice (CDMA)"; + } + else if ((value >= 4114) && (value <= 32512)) + { + str = "Reserved for assignment by TIA-41"; + } + else if ((value >= 32521) && (value <= 32575)) + { + str = "Reserved for assignment by this Standard for TDMA MS-based SMEs"; + } + else if ((value >= 49152) && (value <= 65535)) + { + str = "Reserved for carrier specific teleservices"; + } + else + { + str = "Unrecognized Teleservice ID"; + } + break; + } } proto_tree_add_text(tree, tvb, offset, 2, - "%s (%d)", - str, - value); + "%s (%d)", + str, + value); g_snprintf(add_string, string_len, " - %s (%d)", str, value); } @@ -1341,8 +1340,8 @@ trans_param_tele_id(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, static void trans_param_srvc_cat(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) { - guint32 value; - const gchar *str = NULL; + guint32 value; + const gchar *str = NULL; EXACT_DATA_CHECK(len, 2); @@ -1351,7 +1350,7 @@ trans_param_srvc_cat(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, str = val_to_str_const(value, ansi_srvc_cat_strings, "Reserved"); proto_tree_add_text(tree, tvb, offset, 2, - "%s", str); + "%s", str); g_snprintf(add_string, string_len, " - %s (%d)", str, value); } @@ -1359,12 +1358,12 @@ trans_param_srvc_cat(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, static void trans_param_address(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) { - guint8 oct, oct2, num_fields, odd; - gboolean email_addr; - guint32 saved_offset; - guint32 required_octs; - guint32 i; - const gchar *str; + guint8 oct, oct2, num_fields, odd; + gboolean email_addr; + guint32 saved_offset; + guint32 required_octs; + guint32 i; + const gchar *str; SHORT_DATA_CHECK(len, 2); @@ -1374,268 +1373,268 @@ trans_param_address(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x80, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Digit mode: %s", - ansi_637_bigbuf, - (oct & 0x80) ? "8-bit ASCII" : "4-bit DTMF"); + "%s : Digit mode: %s", + ansi_637_bigbuf, + (oct & 0x80) ? "8-bit ASCII" : "4-bit DTMF"); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x40, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number mode: %s", - ansi_637_bigbuf, - (oct & 0x40) ? "Data Network Address" : "ANSI T1.607"); + "%s : Number mode: %s", + ansi_637_bigbuf, + (oct & 0x40) ? "Data Network Address" : "ANSI T1.607"); if (oct & 0x80) { - if (oct & 0x40) - { - switch ((oct & 0x38) >> 3) - { - case 0: str = "Unknown"; break; - case 1: str = "Internet Protocol (RFC 791)"; break; - case 2: str = "Internet Email Address (RFC 822)"; email_addr = TRUE; break; - default: - str = "Reserved"; - break; - } - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x38, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Type of number: %s (%d)", - ansi_637_bigbuf, - str, - (oct & 0x38) >> 3); - - offset++; - num_fields = (oct & 0x07) << 5; - oct2 = tvb_get_guint8(tvb, offset); - num_fields |= ((oct2 & 0xf8) >> 3); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); - proto_tree_add_text(tree, tvb, offset-1, 1, - "%s : Number of fields (MSB): (%d)", - ansi_637_bigbuf, - num_fields); - - other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xf8, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number of fields (LSB)", - ansi_637_bigbuf); - - if (num_fields == 0) return; - - if (num_fields > (len - 2)) - { - proto_tree_add_text(tree, tvb, offset, 1, - "Missing %d octet(s) for number of fields", - (num_fields + 2) - len); - - return; - } - - other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x07, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Most significant bits of first field", - ansi_637_bigbuf); - - offset++; - oct = oct2; - - i = 0; - while (i < num_fields) - { - ansi_637_bigbuf[i] = (oct & 0x07) << 5; - ansi_637_bigbuf[i] |= ((oct = tvb_get_guint8(tvb, offset+i)) & 0xf8) >> 3; - i++; - } - ansi_637_bigbuf[i] = '\0'; - - if (email_addr) - { - proto_tree_add_text(tree, tvb, offset, num_fields - 1, - "Number: %s", - ansi_637_bigbuf); - } - else - { - proto_tree_add_bytes(tree, hf_ansi_637_trans_bin_addr, tvb, offset, num_fields - 1, - (guint8*)ansi_637_bigbuf); - } - - offset += (num_fields - 1); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xf8, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Least significant bits of last field", - ansi_637_bigbuf); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); - } - else - { - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x38, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Type of number: (%d)", - ansi_637_bigbuf, - (oct & 0x38) >> 3); - - oct2 = tvb_get_guint8(tvb, offset + 1); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Numbering plan (MSB): (%d)", - ansi_637_bigbuf, - ((oct & 0x07) << 1) | ((oct2 & 0x80) >> 7)); - - offset++; - oct = oct2; - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x80, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Numbering plan (LSB)", - ansi_637_bigbuf); - - offset++; - num_fields = (oct & 0x7f) << 1; - oct2 = tvb_get_guint8(tvb, offset); - num_fields |= ((oct2 & 0x80) >> 7); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x7f, 8); - proto_tree_add_text(tree, tvb, offset-1, 1, - "%s : Number of fields (MSB): (%d)", - ansi_637_bigbuf, - num_fields); - - other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x80, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number of fields (LSB)", - ansi_637_bigbuf); - - if (num_fields == 0) return; - - if (num_fields > (len - 3)) - { - proto_tree_add_text(tree, tvb, offset, 1, - "Missing %d octet(s) for number of fields", - (num_fields + 3) - len); - - return; - } - - other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x7f, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Most significant bits of first field", - ansi_637_bigbuf); - - offset++; - oct = oct2; - - i = 0; - while (i < num_fields) - { - ansi_637_bigbuf[i] = (oct & 0x7f) << 1; - ansi_637_bigbuf[i] |= ((oct = tvb_get_guint8(tvb, offset+i)) & 0x80) >> 7; - i++; - } - ansi_637_bigbuf[i] = '\0'; - - proto_tree_add_text(tree, tvb, offset, num_fields - 1, - "Number: %s", - ansi_637_bigbuf); - - offset += (num_fields - 1); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x80, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Least significant bit of last field", - ansi_637_bigbuf); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x7f, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); - } + if (oct & 0x40) + { + switch ((oct & 0x38) >> 3) + { + case 0: str = "Unknown"; break; + case 1: str = "Internet Protocol (RFC 791)"; break; + case 2: str = "Internet Email Address (RFC 822)"; email_addr = TRUE; break; + default: + str = "Reserved"; + break; + } + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x38, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Type of number: %s (%d)", + ansi_637_bigbuf, + str, + (oct & 0x38) >> 3); + + offset += 1; + num_fields = (oct & 0x07) << 5; + oct2 = tvb_get_guint8(tvb, offset); + num_fields |= ((oct2 & 0xf8) >> 3); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); + proto_tree_add_text(tree, tvb, offset-1, 1, + "%s : Number of fields (MSB): (%d)", + ansi_637_bigbuf, + num_fields); + + other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xf8, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Number of fields (LSB)", + ansi_637_bigbuf); + + if (num_fields == 0) return; + + if (num_fields > (len - 2)) + { + proto_tree_add_text(tree, tvb, offset, 1, + "Missing %d octet(s) for number of fields", + (num_fields + 2) - len); + + return; + } + + other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x07, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Most significant bits of first field", + ansi_637_bigbuf); + + offset += 1; + oct = oct2; + + i = 0; + while (i < num_fields) + { + ansi_637_bigbuf[i] = (oct & 0x07) << 5; + ansi_637_bigbuf[i] |= ((oct = tvb_get_guint8(tvb, offset+i)) & 0xf8) >> 3; + i += 1; + } + ansi_637_bigbuf[i] = '\0'; + + if (email_addr) + { + proto_tree_add_text(tree, tvb, offset, num_fields - 1, + "Number: %s", + ansi_637_bigbuf); + } + else + { + proto_tree_add_bytes(tree, hf_ansi_637_trans_bin_addr, tvb, offset, num_fields - 1, + (guint8*)ansi_637_bigbuf); + } + + offset += (num_fields - 1); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xf8, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Least significant bits of last field", + ansi_637_bigbuf); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Reserved", + ansi_637_bigbuf); + } + else + { + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x38, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Type of number: (%d)", + ansi_637_bigbuf, + (oct & 0x38) >> 3); + + oct2 = tvb_get_guint8(tvb, offset + 1); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x07, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Numbering plan (MSB): (%d)", + ansi_637_bigbuf, + ((oct & 0x07) << 1) | ((oct2 & 0x80) >> 7)); + + offset += 1; + oct = oct2; + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x80, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Numbering plan (LSB)", + ansi_637_bigbuf); + + offset += 1; + num_fields = (oct & 0x7f) << 1; + oct2 = tvb_get_guint8(tvb, offset); + num_fields |= ((oct2 & 0x80) >> 7); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x7f, 8); + proto_tree_add_text(tree, tvb, offset-1, 1, + "%s : Number of fields (MSB): (%d)", + ansi_637_bigbuf, + num_fields); + + other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x80, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Number of fields (LSB)", + ansi_637_bigbuf); + + if (num_fields == 0) return; + + if (num_fields > (len - 3)) + { + proto_tree_add_text(tree, tvb, offset, 1, + "Missing %d octet(s) for number of fields", + (num_fields + 3) - len); + + return; + } + + other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x7f, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Most significant bits of first field", + ansi_637_bigbuf); + + offset += 1; + oct = oct2; + + i = 0; + while (i < num_fields) + { + ansi_637_bigbuf[i] = (oct & 0x7f) << 1; + ansi_637_bigbuf[i] |= ((oct = tvb_get_guint8(tvb, offset+i)) & 0x80) >> 7; + i += 1; + } + ansi_637_bigbuf[i] = '\0'; + + proto_tree_add_text(tree, tvb, offset, num_fields - 1, + "Number: %s", + ansi_637_bigbuf); + + offset += (num_fields - 1); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x80, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Least significant bit of last field", + ansi_637_bigbuf); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x7f, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Reserved", + ansi_637_bigbuf); + } } else { - offset++; - num_fields = (oct & 0x3f) << 2; - oct2 = tvb_get_guint8(tvb, offset); - num_fields |= ((oct2 & 0xc0) >> 6); - - other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); - proto_tree_add_text(tree, tvb, offset-1, 1, - "%s : Number of fields (MSB): (%d)", - ansi_637_bigbuf, - num_fields); - - other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xc0, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number of fields (LSB)", - ansi_637_bigbuf); - - oct = oct2; - odd = FALSE; - - if (num_fields > 0) - { - i = (num_fields - 1) * 4; - required_octs = (i / 8) + ((i % 8) ? 1 : 0); - - if (required_octs + 2 > len) - { - proto_tree_add_text(tree, tvb, offset, 1, - "Missing %d octet(s) for number of fields", - (required_octs + 2) - len); - - return; - } - - odd = num_fields & 0x01; - memset((void *) ansi_637_bigbuf, 0, sizeof(ansi_637_bigbuf)); - saved_offset = offset; - offset++; - - i = 0; - while (i < num_fields) - { - ansi_637_bigbuf[i] = - air_digits[(oct & 0x3c) >> 2]; - - i++; - if (i >= num_fields) break; - - oct2 = tvb_get_guint8(tvb, offset); - offset++; - - ansi_637_bigbuf[i] = - air_digits[((oct & 0x03) << 2) | ((oct2 & 0xc0) >> 6)]; - - oct = oct2; - - i++; - } - - proto_tree_add_text(tree, tvb, saved_offset, offset - saved_offset, - "Number: %s", - ansi_637_bigbuf); - } - - other_decode_bitfield_value(ansi_637_bigbuf, oct, odd ? 0x03: 0x3f, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + offset += 1; + num_fields = (oct & 0x3f) << 2; + oct2 = tvb_get_guint8(tvb, offset); + num_fields |= ((oct2 & 0xc0) >> 6); + + other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x3f, 8); + proto_tree_add_text(tree, tvb, offset-1, 1, + "%s : Number of fields (MSB): (%d)", + ansi_637_bigbuf, + num_fields); + + other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xc0, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Number of fields (LSB)", + ansi_637_bigbuf); + + oct = oct2; + odd = FALSE; + + if (num_fields > 0) + { + i = (num_fields - 1) * 4; + required_octs = (i / 8) + ((i % 8) ? 1 : 0); + + if (required_octs + 2 > len) + { + proto_tree_add_text(tree, tvb, offset, 1, + "Missing %d octet(s) for number of fields", + (required_octs + 2) - len); + + return; + } + + odd = num_fields & 0x01; + memset((void *) ansi_637_bigbuf, 0, sizeof(ansi_637_bigbuf)); + saved_offset = offset; + offset += 1; + + i = 0; + while (i < num_fields) + { + ansi_637_bigbuf[i] = + air_digits[(oct & 0x3c) >> 2]; + + i += 1; + if (i >= num_fields) break; + + oct2 = tvb_get_guint8(tvb, offset); + offset += 1; + + ansi_637_bigbuf[i] = + air_digits[((oct & 0x03) << 2) | ((oct2 & 0xc0) >> 6)]; + + oct = oct2; + + i += 1; + } + + proto_tree_add_text(tree, tvb, saved_offset, offset - saved_offset, + "Number: %s", + ansi_637_bigbuf); + } + + other_decode_bitfield_value(ansi_637_bigbuf, oct, odd ? 0x03: 0x3f, 8); + proto_tree_add_text(tree, tvb, offset, 1, + "%s : Reserved", + ansi_637_bigbuf); } } static void trans_param_subaddress(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) { - guint8 oct, oct2, num_fields; - guint32 i; - const gchar *str; + guint8 oct, oct2, num_fields; + guint32 i; + const gchar *str; SHORT_DATA_CHECK(len, 2); @@ -1646,115 +1645,115 @@ trans_param_subaddress(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offse case 0: str = "NSAP (CCITT Recommendation X.213 or ISO 8348 AD2)"; break; case 1: str = "User-specified"; break; default: - str = "Reserved"; - break; + str = "Reserved"; + break; } other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xe0, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Type: %s", - ansi_637_bigbuf, - str); + "%s : Type: %s", + ansi_637_bigbuf, + str); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x10, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Odd", - ansi_637_bigbuf); + "%s : Odd", + ansi_637_bigbuf); - offset++; + offset += 1; num_fields = (oct & 0x0f) << 4; oct2 = tvb_get_guint8(tvb, offset); num_fields |= ((oct2 & 0xf0) >> 4); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x0f, 8); proto_tree_add_text(tree, tvb, offset-1, 1, - "%s : Number of fields (MSB): (%d)", - ansi_637_bigbuf, - num_fields); + "%s : Number of fields (MSB): (%d)", + ansi_637_bigbuf, + num_fields); other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0xf0, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Number of fields (LSB)", - ansi_637_bigbuf); + "%s : Number of fields (LSB)", + ansi_637_bigbuf); if (num_fields == 0) return; if (num_fields > (len - 2)) { - proto_tree_add_text(tree, tvb, offset, 1, - "Missing %d octet(s) for number of fields", - (num_fields + 2) - len); + proto_tree_add_text(tree, tvb, offset, 1, + "Missing %d octet(s) for number of fields", + (num_fields + 2) - len); - return; + return; } other_decode_bitfield_value(ansi_637_bigbuf, oct2, 0x0f, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Most significant bits of first field", - ansi_637_bigbuf); + "%s : Most significant bits of first field", + ansi_637_bigbuf); - offset++; + offset += 1; oct = oct2; i = 0; while (i < num_fields) { - ansi_637_bigbuf[i] = (oct & 0x0f) << 4; - ansi_637_bigbuf[i] |= ((oct = tvb_get_guint8(tvb, offset+i)) & 0xf0) >> 4; - i++; + ansi_637_bigbuf[i] = (oct & 0x0f) << 4; + ansi_637_bigbuf[i] |= ((oct = tvb_get_guint8(tvb, offset+i)) & 0xf0) >> 4; + i += 1; } ansi_637_bigbuf[i] = '\0'; proto_tree_add_bytes(tree, hf_ansi_637_trans_bin_addr, tvb, offset, num_fields - 1, - (guint8*)ansi_637_bigbuf); + (guint8*)ansi_637_bigbuf); offset += (num_fields - 1); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xf0, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Least significant bits of last field", - ansi_637_bigbuf); + "%s : Least significant bits of last field", + ansi_637_bigbuf); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x0f, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + "%s : Reserved", + ansi_637_bigbuf); } static void trans_param_bearer_reply_opt(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset, gchar *add_string, int string_len) { - guint8 oct; + guint8 oct; oct = tvb_get_guint8(tvb, offset); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xfc, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reply Sequence Number: %d", - ansi_637_bigbuf, - (oct & 0xfc) >> 2); + "%s : Reply Sequence Number: %d", + ansi_637_bigbuf, + (oct & 0xfc) >> 2); g_snprintf(add_string, string_len, " - Reply Sequence Number (%d)", (oct & 0xfc) >> 2); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x03, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - ansi_637_bigbuf); + "%s : Reserved", + ansi_637_bigbuf); } static void trans_param_cause_codes(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) { - guint8 oct; - const gchar *str = NULL; + guint8 oct; + const gchar *str = NULL; oct = tvb_get_guint8(tvb, offset); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0xfc, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reply Sequence Number: %d", - ansi_637_bigbuf, - (oct & 0xfc) >> 2); + "%s : Reply Sequence Number: %d", + ansi_637_bigbuf, + (oct & 0xfc) >> 2); switch (oct & 0x03) { @@ -1762,19 +1761,19 @@ trans_param_cause_codes(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs case 0x02: str = "Temporary Condition"; break; case 0x03: str = "Permanent Condition"; break; default: - str = "Reserved"; - break; + str = "Reserved"; + break; } g_snprintf(add_string, string_len, " - Reply Sequence Number (%d)", (oct & 0xfc) >> 2); other_decode_bitfield_value(ansi_637_bigbuf, oct, 0x03, 8); proto_tree_add_text(tree, tvb, offset, 1, - "%s : Error Class: %s", - ansi_637_bigbuf, - str); + "%s : Error Class: %s", + ansi_637_bigbuf, + str); - offset++; + offset += 1; if (!(oct & 0x03)) return; @@ -1784,29 +1783,29 @@ trans_param_cause_codes(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs switch (oct) { - case 0: str = "Address vacant"; break; - case 1: str = "Address translation failure"; break; - case 2: str = "Network resource shortage"; break; - case 3: str = "Network failure"; break; - case 4: str = "Invalid Teleservice ID"; break; - case 5: str = "Other network problem"; break; - case 6: str = "Unsupported network interface"; break; - case 32: str = "No page response"; break; - case 33: str = "Destination busy"; break; - case 34: str = "No acknowledgement"; break; - case 35: str = "Destination resource shortage"; break; - case 36: str = "SMS delivery postponed"; break; - case 37: str = "Destination out of service"; break; - case 38: str = "Destination no longer at this address"; break; - case 39: str = "Other terminal problem"; break; - case 64: str = "Radio interface resource shortage"; break; - case 65: str = "Radio interface incompatibility"; break; - case 66: str = "Other radio interface problem"; break; - case 67: str = "Unsupported Base Station Capability"; break; - case 96: str = "Encoding problem"; break; - case 97: str = "Service origination denied"; break; - case 98: str = "Service termination denied"; break; - case 99: str = "Supplementary service not supported"; break; + case 0: str = "Address vacant"; break; + case 1: str = "Address translation failure"; break; + case 2: str = "Network resource shortage"; break; + case 3: str = "Network failure"; break; + case 4: str = "Invalid Teleservice ID"; break; + case 5: str = "Other network problem"; break; + case 6: str = "Unsupported network interface"; break; + case 32: str = "No page response"; break; + case 33: str = "Destination busy"; break; + case 34: str = "No acknowledgement"; break; + case 35: str = "Destination resource shortage"; break; + case 36: str = "SMS delivery postponed"; break; + case 37: str = "Destination out of service"; break; + case 38: str = "Destination no longer at this address"; break; + case 39: str = "Other terminal problem"; break; + case 64: str = "Radio interface resource shortage"; break; + case 65: str = "Radio interface incompatibility"; break; + case 66: str = "Other radio interface problem"; break; + case 67: str = "Unsupported Base Station Capability"; break; + case 96: str = "Encoding problem"; break; + case 97: str = "Service origination denied"; break; + case 98: str = "Service termination denied"; break; + case 99: str = "Supplementary service not supported"; break; case 100: str = "Service not supported"; break; case 101: str = "Reserved"; break; case 102: str = "Missing expected parameter"; break; @@ -1817,26 +1816,26 @@ trans_param_cause_codes(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs case 107: str = "Other general problems"; break; case 108: str = "Session not active"; break; default: - if ((oct >= 7) && (oct <= 31)) { str = "Reserved, treat as Other network problem"; } - else if ((oct >= 40) && (oct <= 47)) { str = "Reserved, treat as Other terminal problem"; } - else if ((oct >= 48) && (oct <= 63)) { str = "Reserved, treat as SMS delivery postponed"; } - else if ((oct >= 68) && (oct <= 95)) { str = "Reserved, treat as Other radio interface problem"; } - else if ((oct >= 109) && (oct <= 223)) { str = "Reserved, treat as Other general problems"; } - else { str = "Reserved for protocol extension, treat as Other general problems"; } - break; + if ((oct >= 7) && (oct <= 31)) { str = "Reserved, treat as Other network problem"; } + else if ((oct >= 40) && (oct <= 47)) { str = "Reserved, treat as Other terminal problem"; } + else if ((oct >= 48) && (oct <= 63)) { str = "Reserved, treat as SMS delivery postponed"; } + else if ((oct >= 68) && (oct <= 95)) { str = "Reserved, treat as Other radio interface problem"; } + else if ((oct >= 109) && (oct <= 223)) { str = "Reserved, treat as Other general problems"; } + else { str = "Reserved for protocol extension, treat as Other general problems"; } + break; } proto_tree_add_text(tree, tvb, offset, 1, - "%s", str); + "%s", str); } static void trans_param_bearer_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string _U_, int string_len _U_) { - tvbuff_t *tele_tvb; + tvbuff_t *tele_tvb; proto_tree_add_text(tree, tvb, offset, len, - "Bearer Data"); + "Bearer Data"); /* * dissect the embedded teleservice data @@ -1844,25 +1843,25 @@ trans_param_bearer_data(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs tele_tvb = tvb_new_subset(tvb, offset, len, len); dissector_try_uint(tele_dissector_table, ansi_637_trans_tele_id, - tele_tvb, g_pinfo, g_tree); + tele_tvb, g_pinfo, g_tree); } -#define NUM_TRANS_PARAM (sizeof(ansi_trans_param_strings)/sizeof(value_string)) +#define NUM_TRANS_PARAM (sizeof(ansi_trans_param_strings)/sizeof(value_string)) static gint ett_ansi_637_trans_param[NUM_TRANS_PARAM]; static void (*ansi_637_trans_param_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset, gchar *add_string, int string_len) = { - trans_param_tele_id, /* Teleservice Identifier */ - trans_param_srvc_cat, /* Service Category */ - trans_param_address, /* Originating Address */ - trans_param_subaddress, /* Originating Subaddress */ - trans_param_address, /* Destination Address */ - trans_param_subaddress, /* Destination Subaddress */ - trans_param_bearer_reply_opt, /* Bearer Reply Option */ - trans_param_cause_codes, /* Cause Codes */ - trans_param_bearer_data, /* Bearer Data */ - NULL, /* NONE */ + trans_param_tele_id, /* Teleservice Identifier */ + trans_param_srvc_cat, /* Service Category */ + trans_param_address, /* Originating Address */ + trans_param_subaddress, /* Originating Subaddress */ + trans_param_address, /* Destination Address */ + trans_param_subaddress, /* Destination Subaddress */ + trans_param_bearer_reply_opt, /* Bearer Reply Option */ + trans_param_cause_codes, /* Cause Codes */ + trans_param_bearer_data, /* Bearer Data */ + NULL, /* NONE */ }; -#define NUM_TRANS_MSG_TYPE (sizeof(ansi_trans_msg_type_strings)/sizeof(value_string)) +#define NUM_TRANS_MSG_TYPE (sizeof(ansi_trans_msg_type_strings)/sizeof(value_string)) static gint ett_ansi_637_trans_msg[NUM_TRANS_MSG_TYPE]; /* GENERIC IS-637 DISSECTOR FUNCTIONS */ @@ -1870,14 +1869,14 @@ static gint ett_ansi_637_trans_msg[NUM_TRANS_MSG_TYPE]; static gboolean dissect_ansi_637_tele_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) { - void (*param_fcn)(tvbuff_t *, proto_tree *, guint, guint32) = NULL; - guint8 oct; - guint8 len; - guint32 curr_offset; - gint ett_param_idx, idx; - proto_tree *subtree; - proto_item *item; - const gchar *str = NULL; + void (*param_fcn)(tvbuff_t *, proto_tree *, guint, guint32) = NULL; + guint8 oct; + guint8 len; + guint32 curr_offset; + gint ett_param_idx, idx; + proto_tree *subtree; + proto_item *item; + const gchar *str = NULL; curr_offset = *offset; @@ -1887,44 +1886,44 @@ dissect_ansi_637_tele_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) if (NULL == str) { - return(FALSE); + return(FALSE); } ett_param_idx = ett_ansi_637_tele_param[idx]; param_fcn = ansi_637_tele_param_fcn[idx]; item = - proto_tree_add_text(tree, tvb, curr_offset, -1, "%s", str); + proto_tree_add_text(tree, tvb, curr_offset, -1, "%s", str); subtree = proto_item_add_subtree(item, ett_param_idx); proto_tree_add_uint(subtree, hf_ansi_637_tele_subparam_id, - tvb, curr_offset, 1, oct); + tvb, curr_offset, 1, oct); - curr_offset++; + curr_offset += 1; len = tvb_get_guint8(tvb, curr_offset); proto_item_set_len(item, (curr_offset - *offset) + len + 1); proto_tree_add_uint(subtree, hf_ansi_637_tele_length, - tvb, curr_offset, 1, len); + tvb, curr_offset, 1, len); - curr_offset++; + curr_offset += 1; if (len > 0) { - if (param_fcn == NULL) - { - proto_tree_add_text(subtree, tvb, curr_offset, - len, "Parameter Data"); - } - else - { - (*param_fcn)(tvb, subtree, len, curr_offset); - } - - curr_offset += len; + if (param_fcn == NULL) + { + proto_tree_add_text(subtree, tvb, curr_offset, + len, "Parameter Data"); + } + else + { + (*param_fcn)(tvb, subtree, len, curr_offset); + } + + curr_offset += len; } *offset = curr_offset; @@ -1935,31 +1934,31 @@ dissect_ansi_637_tele_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) static void dissect_ansi_637_tele_message(tvbuff_t *tvb, proto_tree *ansi_637_tree) { - guint8 len; - guint32 curr_offset; + guint8 len; + guint32 curr_offset; curr_offset = 0; len = tvb_length(tvb); while ((len - curr_offset) > 0) { - if (!dissect_ansi_637_tele_param(tvb, ansi_637_tree, &curr_offset)) - { - proto_tree_add_text(ansi_637_tree, tvb, curr_offset, len - curr_offset, - "Unknown Parameter Data"); - break; - } + if (!dissect_ansi_637_tele_param(tvb, ansi_637_tree, &curr_offset)) + { + proto_tree_add_text(ansi_637_tree, tvb, curr_offset, len - curr_offset, + "Unknown Parameter Data"); + break; + } } } static void dissect_ansi_637_tele(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *ansi_637_item; - proto_tree *ansi_637_tree = NULL; - const gchar *str = NULL; - guint32 value; - void* pd_save; + proto_item *ansi_637_item; + proto_tree *ansi_637_tree = NULL; + const gchar *str = NULL; + guint32 value; + void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, ansi_proto_name_short); @@ -1968,110 +1967,110 @@ dissect_ansi_637_tele(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (tree) { - pd_save = pinfo->private_data; - pinfo->private_data = NULL; - g_pinfo = pinfo; - g_tree = tree; - - value = pinfo->match_uint; - - /* - * create the ansi_637 protocol tree - */ - str = try_val_to_str(value, ansi_tele_id_strings); - - if (NULL == str) - { - switch (value) - { - case 1: - str = "Reserved for maintenance"; - break; - case 4102: - str = "CDMA Service Category Programming Teleservice (SCPT)"; - break; - case 4103: - str = "CDMA Card Application Toolkit Protocol Teleservice (CATPT)"; - break; - case 32513: - str = "TDMA Cellular Messaging Teleservice"; - break; - case 32514: - str = "TDMA Cellular Paging Teleservice (CPT-136)"; - break; - case 32515: - str = "TDMA Over-the-Air Activation Teleservice (OATS)"; - break; - case 32520: - str = "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)"; - break; - case 32584: - str = "TDMA Segmented System Assisted Mobile Positioning Service"; - break; - default: - if ((value >= 2) && (value <= 4095)) - { - str = "Reserved for assignment by TIA-41"; - } - else if ((value >= 4104) && (value <= 4113)) - { - str = "Reserved for GSM1x Teleservice (CDMA)"; - } - else if ((value >= 4114) && (value <= 32512)) - { - str = "Reserved for assignment by TIA-41"; - } - else if ((value >= 32521) && (value <= 32575)) - { - str = "Reserved for assignment by this Standard for TDMA MS-based SMEs"; - } - else if ((value >= 49152) && (value < 65535)) - { - str = "Reserved for carrier specific teleservices"; - } - else if (value == 65535) - { - /* - * supposed to be "Reserved for carrier specific teleservices" - * but we are using it to key SMS Broadcast dissection where - * there is no teleservice ID - */ - str = "(Reserved) Being used for Broadcast"; - } - else - { - str = "Unrecognized Teleservice ID"; - } - break; - } - } - - ansi_637_item = - proto_tree_add_protocol_format(tree, proto_ansi_637_tele, tvb, 0, -1, - "%s - %s (%d)", - ansi_proto_name_tele, - str, - pinfo->match_uint); - - ansi_637_tree = - proto_item_add_subtree(ansi_637_item, ett_ansi_637_tele); - - dissect_ansi_637_tele_message(tvb, ansi_637_tree); - pinfo->private_data = pd_save; + pd_save = pinfo->private_data; + pinfo->private_data = NULL; + g_pinfo = pinfo; + g_tree = tree; + + value = pinfo->match_uint; + + /* + * create the ansi_637 protocol tree + */ + str = try_val_to_str(value, ansi_tele_id_strings); + + if (NULL == str) + { + switch (value) + { + case 1: + str = "Reserved for maintenance"; + break; + case 4102: + str = "CDMA Service Category Programming Teleservice (SCPT)"; + break; + case 4103: + str = "CDMA Card Application Toolkit Protocol Teleservice (CATPT)"; + break; + case 32513: + str = "TDMA Cellular Messaging Teleservice"; + break; + case 32514: + str = "TDMA Cellular Paging Teleservice (CPT-136)"; + break; + case 32515: + str = "TDMA Over-the-Air Activation Teleservice (OATS)"; + break; + case 32520: + str = "TDMA System Assisted Mobile Positioning through Satellite (SAMPS)"; + break; + case 32584: + str = "TDMA Segmented System Assisted Mobile Positioning Service"; + break; + default: + if ((value >= 2) && (value <= 4095)) + { + str = "Reserved for assignment by TIA-41"; + } + else if ((value >= 4104) && (value <= 4113)) + { + str = "Reserved for GSM1x Teleservice (CDMA)"; + } + else if ((value >= 4114) && (value <= 32512)) + { + str = "Reserved for assignment by TIA-41"; + } + else if ((value >= 32521) && (value <= 32575)) + { + str = "Reserved for assignment by this Standard for TDMA MS-based SMEs"; + } + else if ((value >= 49152) && (value < 65535)) + { + str = "Reserved for carrier specific teleservices"; + } + else if (value == 65535) + { + /* + * supposed to be "Reserved for carrier specific teleservices" + * but we are using it to key SMS Broadcast dissection where + * there is no teleservice ID + */ + str = "(Reserved) Being used for Broadcast"; + } + else + { + str = "Unrecognized Teleservice ID"; + } + break; + } + } + + ansi_637_item = + proto_tree_add_protocol_format(tree, proto_ansi_637_tele, tvb, 0, -1, + "%s - %s (%d)", + ansi_proto_name_tele, + str, + pinfo->match_uint); + + ansi_637_tree = + proto_item_add_subtree(ansi_637_item, ett_ansi_637_tele); + + dissect_ansi_637_tele_message(tvb, ansi_637_tree); + pinfo->private_data = pd_save; } } static gboolean dissect_ansi_637_trans_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) { - void (*param_fcn)(tvbuff_t *, proto_tree *, guint, guint32, gchar *, int) = NULL; - guint8 oct; - guint8 len; - guint32 curr_offset; - gint ett_param_idx, idx; - proto_tree *subtree; - proto_item *item; - const gchar *str = NULL; + void (*param_fcn)(tvbuff_t *, proto_tree *, guint, guint32, gchar *, int) = NULL; + guint8 oct; + guint8 len; + guint32 curr_offset; + gint ett_param_idx, idx; + proto_tree *subtree; + proto_item *item; + const gchar *str = NULL; curr_offset = *offset; @@ -2080,53 +2079,53 @@ dissect_ansi_637_trans_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) if (NULL == str) { - return(FALSE); + return(FALSE); } ett_param_idx = ett_ansi_637_trans_param[idx]; param_fcn = ansi_637_trans_param_fcn[idx]; item = - proto_tree_add_text(tree, tvb, curr_offset, -1, "%s", str); + proto_tree_add_text(tree, tvb, curr_offset, -1, "%s", str); subtree = proto_item_add_subtree(item, ett_param_idx); proto_tree_add_uint(subtree, hf_ansi_637_trans_param_id, - tvb, curr_offset, 1, oct); + tvb, curr_offset, 1, oct); - curr_offset++; + curr_offset += 1; len = tvb_get_guint8(tvb, curr_offset); proto_item_set_len(item, (curr_offset - *offset) + len + 1); proto_tree_add_uint(subtree, hf_ansi_637_trans_length, - tvb, curr_offset, 1, len); + tvb, curr_offset, 1, len); - curr_offset++; + curr_offset += 1; if (len > 0) { - if (param_fcn == NULL) - { - proto_tree_add_text(subtree, tvb, curr_offset, - len, "Parameter Data"); - } - else - { + if (param_fcn == NULL) + { + proto_tree_add_text(subtree, tvb, curr_offset, + len, "Parameter Data"); + } + else + { gchar *ansi_637_add_string; - ansi_637_add_string = (gchar *)wmem_alloc(wmem_packet_scope(), 1024); - ansi_637_add_string[0] = '\0'; - (*param_fcn)(tvb, subtree, len, curr_offset, ansi_637_add_string, 1024); + ansi_637_add_string = (gchar *)wmem_alloc(wmem_packet_scope(), 1024); + ansi_637_add_string[0] = '\0'; + (*param_fcn)(tvb, subtree, len, curr_offset, ansi_637_add_string, 1024); - if (ansi_637_add_string[0] != '\0') - { - proto_item_append_text(item, "%s", ansi_637_add_string); - } - } + if (ansi_637_add_string[0] != '\0') + { + proto_item_append_text(item, "%s", ansi_637_add_string); + } + } - curr_offset += len; + curr_offset += len; } *offset = curr_offset; @@ -2138,14 +2137,14 @@ dissect_ansi_637_trans_param(tvbuff_t *tvb, proto_tree *tree, guint32 *offset) static void dissect_ansi_637_trans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *ansi_637_item; - proto_tree *ansi_637_tree = NULL; - guint32 curr_offset; - gint idx; - const gchar *str = NULL; - guint8 oct; - guint8 len; - void* pd_save; + proto_item *ansi_637_item; + proto_tree *ansi_637_tree = NULL; + guint32 curr_offset; + gint idx; + const gchar *str = NULL; + guint8 oct; + guint8 len; + void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, ansi_proto_name_short); @@ -2154,71 +2153,71 @@ dissect_ansi_637_trans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (tree) { - pd_save = pinfo->private_data; - pinfo->private_data = NULL; - g_pinfo = pinfo; - g_tree = tree; - - /* - * reset the teleservice ID for each dissection - */ - ansi_637_trans_tele_id = 0; - - /* - * create the ansi_637 protocol tree - */ - oct = tvb_get_guint8(tvb, 0); - - str = try_val_to_str_idx(oct, ansi_trans_msg_type_strings, &idx); - - if (NULL == str) - { - ansi_637_item = - proto_tree_add_protocol_format(tree, proto_ansi_637_trans, tvb, 0, -1, - "%s - Unrecognized Transport Layer Message Type (%d)", - ansi_proto_name_trans, - oct); - - ansi_637_tree = - proto_item_add_subtree(ansi_637_item, ett_ansi_637_trans); - } - else - { - ansi_637_item = - proto_tree_add_protocol_format(tree, proto_ansi_637_trans, tvb, 0, -1, - "%s - %s", - ansi_proto_name_trans, - str); - - ansi_637_tree = - proto_item_add_subtree(ansi_637_item, ett_ansi_637_trans_msg[idx]); - - if (oct == ANSI_TRANS_MSG_TYPE_BROADCAST) - { - /* - * there is no teleservice ID for Broadcast but we want the - * bearer data to be dissected - * - * using a reserved value to key dissector port - */ - ansi_637_trans_tele_id = 65535; - } - } - - curr_offset = 1; - - len = tvb_length(tvb); - - while ((len - curr_offset) > 0) - { - if (!dissect_ansi_637_trans_param(tvb, ansi_637_tree, &curr_offset)) - { - proto_tree_add_text(ansi_637_tree, tvb, curr_offset, len - curr_offset, - "Unknown Parameter Data"); - break; - } - } - pinfo->private_data = pd_save; + pd_save = pinfo->private_data; + pinfo->private_data = NULL; + g_pinfo = pinfo; + g_tree = tree; + + /* + * reset the teleservice ID for each dissection + */ + ansi_637_trans_tele_id = 0; + + /* + * create the ansi_637 protocol tree + */ + oct = tvb_get_guint8(tvb, 0); + + str = try_val_to_str_idx(oct, ansi_trans_msg_type_strings, &idx); + + if (NULL == str) + { + ansi_637_item = + proto_tree_add_protocol_format(tree, proto_ansi_637_trans, tvb, 0, -1, + "%s - Unrecognized Transport Layer Message Type (%d)", + ansi_proto_name_trans, + oct); + + ansi_637_tree = + proto_item_add_subtree(ansi_637_item, ett_ansi_637_trans); + } + else + { + ansi_637_item = + proto_tree_add_protocol_format(tree, proto_ansi_637_trans, tvb, 0, -1, + "%s - %s", + ansi_proto_name_trans, + str); + + ansi_637_tree = + proto_item_add_subtree(ansi_637_item, ett_ansi_637_trans_msg[idx]); + + if (oct == ANSI_TRANS_MSG_TYPE_BROADCAST) + { + /* + * there is no teleservice ID for Broadcast but we want the + * bearer data to be dissected + * + * using a reserved value to key dissector port + */ + ansi_637_trans_tele_id = 65535; + } + } + + curr_offset = 1; + + len = tvb_length(tvb); + + while ((len - curr_offset) > 0) + { + if (!dissect_ansi_637_trans_param(tvb, ansi_637_tree, &curr_offset)) + { + proto_tree_add_text(ansi_637_tree, tvb, curr_offset, len - curr_offset, + "Unknown Parameter Data"); + break; + } + } + pinfo->private_data = pd_save; } } /* Dissect SMS embedded in SIP */ @@ -2233,74 +2232,74 @@ dissect_ansi_637_trans_app(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) void proto_register_ansi_637(void) { - guint i; + guint i; /* Setup list of header fields */ static hf_register_info hf_trans[] = { #if 0 - { &hf_ansi_637_trans_msg_type, - { "Message Type", - "ansi_637_trans.msg_type", - FT_UINT24, BASE_DEC, VALS(ansi_trans_msg_type_strings), 0xf00000, - NULL, HFILL }}, + { &hf_ansi_637_trans_msg_type, + { "Message Type", + "ansi_637_trans.msg_type", + FT_UINT24, BASE_DEC, VALS(ansi_trans_msg_type_strings), 0xf00000, + NULL, HFILL }}, #endif - { &hf_ansi_637_trans_param_id, - { "Transport Param ID", "ansi_637_trans.param_id", - FT_UINT8, BASE_DEC, VALS(ansi_trans_param_strings), 0, - NULL, HFILL }}, - { &hf_ansi_637_trans_length, - { "Length", "ansi_637_trans.len", - FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_ansi_637_trans_bin_addr, - { "Binary Address", "ansi_637_trans.bin_addr", - FT_BYTES, BASE_NONE, 0, 0, - NULL, HFILL }}, - }; + { &hf_ansi_637_trans_param_id, + { "Transport Param ID", "ansi_637_trans.param_id", + FT_UINT8, BASE_DEC, VALS(ansi_trans_param_strings), 0, + NULL, HFILL }}, + { &hf_ansi_637_trans_length, + { "Length", "ansi_637_trans.len", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_ansi_637_trans_bin_addr, + { "Binary Address", "ansi_637_trans.bin_addr", + FT_BYTES, BASE_NONE, 0, 0, + NULL, HFILL }}, + }; static hf_register_info hf_tele[] = { - { &hf_ansi_637_tele_msg_type, - { "Message Type", - "ansi_637_tele.msg_type", - FT_UINT24, BASE_DEC, VALS(ansi_tele_msg_type_strings), 0xf00000, - NULL, HFILL }}, - { &hf_ansi_637_tele_msg_id, - { "Message ID", - "ansi_637_tele.msg_id", - FT_UINT24, BASE_DEC, NULL, 0x0ffff0, - NULL, HFILL }}, - { &hf_ansi_637_tele_msg_status, - { "Message Status", - "ansi_637_tele.msg_status", - FT_UINT8, BASE_DEC, VALS(ansi_tele_msg_status_strings), 0, - NULL, HFILL }}, - { &hf_ansi_637_tele_msg_ind, - { "Header Indicator", - "ansi_637_tele.msg_ind", - FT_UINT24, BASE_DEC, NULL, 0x000008, - NULL, HFILL }}, - { &hf_ansi_637_tele_msg_rsvd, - { "Reserved", - "ansi_637_tele.msg_rsvd", - FT_UINT24, BASE_DEC, NULL, 0x000007, - NULL, HFILL }}, - { &hf_ansi_637_tele_length, - { "Length", "ansi_637_tele.len", - FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL }}, - { &hf_ansi_637_tele_subparam_id, - { "Teleservice Subparam ID", "ansi_637_tele.subparam_id", - FT_UINT8, BASE_DEC, VALS(ansi_tele_param_strings), 0, - NULL, HFILL }}, - { &hf_ansi_637_tele_user_data_text, - { "Encoded user data", "ansi_637_tele.user_data.text", - FT_STRING, BASE_NONE, NULL, 0, - NULL, HFILL }}, + { &hf_ansi_637_tele_msg_type, + { "Message Type", + "ansi_637_tele.msg_type", + FT_UINT24, BASE_DEC, VALS(ansi_tele_msg_type_strings), 0xf00000, + NULL, HFILL }}, + { &hf_ansi_637_tele_msg_id, + { "Message ID", + "ansi_637_tele.msg_id", + FT_UINT24, BASE_DEC, NULL, 0x0ffff0, + NULL, HFILL }}, + { &hf_ansi_637_tele_msg_status, + { "Message Status", + "ansi_637_tele.msg_status", + FT_UINT8, BASE_DEC, VALS(ansi_tele_msg_status_strings), 0, + NULL, HFILL }}, + { &hf_ansi_637_tele_msg_ind, + { "Header Indicator", + "ansi_637_tele.msg_ind", + FT_UINT24, BASE_DEC, NULL, 0x000008, + NULL, HFILL }}, + { &hf_ansi_637_tele_msg_rsvd, + { "Reserved", + "ansi_637_tele.msg_rsvd", + FT_UINT24, BASE_DEC, NULL, 0x000007, + NULL, HFILL }}, + { &hf_ansi_637_tele_length, + { "Length", "ansi_637_tele.len", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + { &hf_ansi_637_tele_subparam_id, + { "Teleservice Subparam ID", "ansi_637_tele.subparam_id", + FT_UINT8, BASE_DEC, VALS(ansi_tele_param_strings), 0, + NULL, HFILL }}, + { &hf_ansi_637_tele_user_data_text, + { "Encoded user data", "ansi_637_tele.user_data.text", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL }}, }; /* Setup protocol subtree array */ -#define NUM_INDIVIDUAL_PARAMS 3 +#define NUM_INDIVIDUAL_PARAMS 3 gint *ett[NUM_INDIVIDUAL_PARAMS+NUM_TELE_PARAM+NUM_TRANS_MSG_TYPE+NUM_TRANS_PARAM]; memset((void *) ett, 0, sizeof(ett)); @@ -2311,28 +2310,28 @@ proto_register_ansi_637(void) for (i=0; i < NUM_TELE_PARAM; i++) { - ett_ansi_637_tele_param[i] = -1; - ett[NUM_INDIVIDUAL_PARAMS+i] = &ett_ansi_637_tele_param[i]; + ett_ansi_637_tele_param[i] = -1; + ett[NUM_INDIVIDUAL_PARAMS+i] = &ett_ansi_637_tele_param[i]; } for (i=0; i < NUM_TRANS_MSG_TYPE; i++) { - ett_ansi_637_trans_msg[i] = -1; - ett[NUM_INDIVIDUAL_PARAMS+NUM_TELE_PARAM+i] = &ett_ansi_637_trans_msg[i]; + ett_ansi_637_trans_msg[i] = -1; + ett[NUM_INDIVIDUAL_PARAMS+NUM_TELE_PARAM+i] = &ett_ansi_637_trans_msg[i]; } for (i=0; i < NUM_TRANS_PARAM; i++) { - ett_ansi_637_trans_param[i] = -1; - ett[NUM_INDIVIDUAL_PARAMS+NUM_TELE_PARAM+NUM_TRANS_MSG_TYPE+i] = &ett_ansi_637_trans_param[i]; + ett_ansi_637_trans_param[i] = -1; + ett[NUM_INDIVIDUAL_PARAMS+NUM_TELE_PARAM+NUM_TRANS_MSG_TYPE+i] = &ett_ansi_637_trans_param[i]; } /* Register the protocol name and description */ proto_ansi_637_tele = - proto_register_protocol(ansi_proto_name_tele, "ANSI IS-637-A Teleservice", "ansi_637_tele"); + proto_register_protocol(ansi_proto_name_tele, "ANSI IS-637-A Teleservice", "ansi_637_tele"); proto_ansi_637_trans = - proto_register_protocol(ansi_proto_name_trans, "ANSI IS-637-A Transport", "ansi_637_trans"); + proto_register_protocol(ansi_proto_name_trans, "ANSI IS-637-A Transport", "ansi_637_trans"); ansi_637_tele_handle = register_dissector("ansi_637_tele", dissect_ansi_637_tele, proto_ansi_637_tele); ansi_637_trans_handle = register_dissector("ansi_637_trans", dissect_ansi_637_trans, proto_ansi_637_trans); @@ -2343,16 +2342,16 @@ proto_register_ansi_637(void) proto_register_subtree_array(ett, array_length(ett)); tele_dissector_table = - register_dissector_table("ansi_637.tele_id", - "ANSI IS-637-A Teleservice ID", FT_UINT8, BASE_DEC); + register_dissector_table("ansi_637.tele_id", + "ANSI IS-637-A Teleservice ID", FT_UINT8, BASE_DEC); } void proto_reg_handoff_ansi_637(void) { - dissector_handle_t ansi_637_trans_app_handle; - guint i; + dissector_handle_t ansi_637_trans_app_handle; + guint i; ansi_637_trans_app_handle = create_dissector_handle(dissect_ansi_637_trans_app, proto_ansi_637_trans); @@ -2366,15 +2365,15 @@ proto_reg_handoff_ansi_637(void) */ for (i=0; i < ((sizeof(ansi_tele_id_strings)/sizeof(value_string))-1); i++) { - /* - * ANSI MAP dissector will push out teleservice ids - */ - dissector_add_uint("ansi_map.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle); - - /* - * we will push out teleservice ids after Transport layer decode - */ - dissector_add_uint("ansi_637.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle); + /* + * ANSI MAP dissector will push out teleservice ids + */ + dissector_add_uint("ansi_map.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle); + + /* + * we will push out teleservice ids after Transport layer decode + */ + dissector_add_uint("ansi_637.tele_id", ansi_tele_id_strings[i].value, ansi_637_tele_handle); } /* diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index 45b4589ed9..01f141c83a 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -6262,7 +6262,7 @@ static const value_string ansi_a_ms_info_rec_signal_type_vals[] = { { 0x3, "Reserved"}, { 0, NULL} }; - + static const value_string ansi_a_ms_info_rec_signal_alert_pitch_vals[] = { { 0x0, "Medium pitch (standard alert)"}, { 0x1, "High pitch"}, @@ -12426,8 +12426,8 @@ proto_reg_handoff_ansi_a(void) dissector_add_uint("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle); dissector_add_uint("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle); - dissector_add_string("media_type", "application/femtointerfacemsg", sip_dtap_bsmap_handle); - dissector_add_string("media_type", "application/vnd.3gpp2.femtointerfacemsg", sip_dtap_bsmap_handle); + dissector_add_string("media_type", "application/femtointerfacemsg", sip_dtap_bsmap_handle); + dissector_add_string("media_type", "application/vnd.3gpp2.femtointerfacemsg", sip_dtap_bsmap_handle); ansi_a_prefs_initialized = TRUE; } diff --git a/epan/dissectors/packet-ansi_a.h b/epan/dissectors/packet-ansi_a.h index 878790e0e6..edb4d97db6 100644 --- a/epan/dissectors/packet-ansi_a.h +++ b/epan/dissectors/packet-ansi_a.h @@ -43,7 +43,7 @@ ext_value_string_t; /* * the following allows TAP code access to the messages - * without having to duplicate it. With MSVC and a + * without having to duplicate it. With MSVC and a * libwireshark.dll, we need a special declaration. */ WS_DLL_PUBLIC const ext_value_string_t *ansi_a_bsmap_strings; diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c index c66ec87c82..b0b2e7d139 100644 --- a/epan/dissectors/packet-arp.c +++ b/epan/dissectors/packet-arp.c @@ -111,8 +111,6 @@ static guint32 arp_request_count = 0; static nstime_t time_at_start_of_count; - - /* Map of (IP address -> MAC address) to detect duplicate IP addresses Key is unsigned32 */ static GHashTable *address_hash_table = NULL; @@ -227,7 +225,7 @@ typedef struct duplicate_result_key { #endif #ifndef ARPOP_MAPOS_UNARP -#define ARPOP_MAPOS_UNARP 23 /*MAPOS UNARP*/ +#define ARPOP_MAPOS_UNARP 23 /*MAPOS UNARP*/ #endif #ifndef ARPOP_EXP1 @@ -237,16 +235,16 @@ typedef struct duplicate_result_key { #define ARPOP_EXP2 25 /* Experimental 2 */ #endif -#ifndef ARPOP_RESERVED1 -#define ARPOP_RESERVED1 0 /*Reserved opcode 1*/ +#ifndef ARPOP_RESERVED1 +#define ARPOP_RESERVED1 0 /*Reserved opcode 1*/ #endif -#ifndef ARPOP_RESERVED2 +#ifndef ARPOP_RESERVED2 #define ARPOP_RESERVED2 65535 /*Reserved opcode 2*/ #endif #ifndef DRARPERR_RESTRICTED -#define DRARPERR_RESTRICTED 1 +#define DRARPERR_RESTRICTED 1 #endif #ifndef DRARPERR_NOADDRESSES @@ -268,66 +266,66 @@ typedef struct duplicate_result_key { static const value_string op_vals[] = { - {ARPOP_REQUEST, "request" }, - {ARPOP_REPLY, "reply" }, - {ARPOP_RREQUEST, "reverse request"}, - {ARPOP_RREPLY, "reverse reply" }, - {ARPOP_DRARPREQUEST, "drarp request"}, - {ARPOP_DRARPREPLY, "drarp reply"}, - {ARPOP_DRARPERROR, "drarp error"}, - {ARPOP_IREQUEST, "inverse request"}, - {ARPOP_IREPLY, "inverse reply" }, - {ATMARPOP_NAK, "arp nak" }, - {ARPOP_MARS_REQUEST, "mars request"}, - {ARPOP_MARS_MULTI, "mars multi"}, - {ARPOP_MARS_MSERV, "mars mserv"}, - {ARPOP_MARS_JOIN, "mars join"}, - {ARPOP_MARS_LEAVE, "mars leave"}, - {ARPOP_MARS_NAK, "mars nak"}, - {ARPOP_MARS_UNSERV, "mars unserv"}, - {ARPOP_MARS_SJOIN, "mars sjoin"}, - {ARPOP_MARS_SLEAVE, "mars sleave"}, - {ARPOP_MARS_GROUPLIST_REQUEST, "mars grouplist request"}, - {ARPOP_MARS_GROUPLIST_REPLY, "mars gruoplist reply"}, - {ARPOP_MARS_REDIRECT_MAP, "mars redirect map"}, - {ARPOP_MAPOS_UNARP, "mapos unarp"}, - {ARPOP_EXP1, "experimental 1" }, - {ARPOP_EXP2, "experimental 2" }, - {ARPOP_RESERVED1, "reserved"}, - {ARPOP_RESERVED2, "reserved"}, + {ARPOP_REQUEST, "request" }, + {ARPOP_REPLY, "reply" }, + {ARPOP_RREQUEST, "reverse request" }, + {ARPOP_RREPLY, "reverse reply" }, + {ARPOP_DRARPREQUEST, "drarp request" }, + {ARPOP_DRARPREPLY, "drarp reply" }, + {ARPOP_DRARPERROR, "drarp error" }, + {ARPOP_IREQUEST, "inverse request" }, + {ARPOP_IREPLY, "inverse reply" }, + {ATMARPOP_NAK, "arp nak" }, + {ARPOP_MARS_REQUEST, "mars request" }, + {ARPOP_MARS_MULTI, "mars multi" }, + {ARPOP_MARS_MSERV, "mars mserv" }, + {ARPOP_MARS_JOIN, "mars join" }, + {ARPOP_MARS_LEAVE, "mars leave" }, + {ARPOP_MARS_NAK, "mars nak" }, + {ARPOP_MARS_UNSERV, "mars unserv" }, + {ARPOP_MARS_SJOIN, "mars sjoin" }, + {ARPOP_MARS_SLEAVE, "mars sleave" }, + {ARPOP_MARS_GROUPLIST_REQUEST, "mars grouplist request" }, + {ARPOP_MARS_GROUPLIST_REPLY, "mars gruoplist reply" }, + {ARPOP_MARS_REDIRECT_MAP, "mars redirect map" }, + {ARPOP_MAPOS_UNARP, "mapos unarp" }, + {ARPOP_EXP1, "experimental 1" }, + {ARPOP_EXP2, "experimental 2" }, + {ARPOP_RESERVED1, "reserved" }, + {ARPOP_RESERVED2, "reserved" }, {0, NULL}}; static const value_string drarp_status[]={ -{DRARPERR_RESTRICTED, "restricted"}, -{DRARPERR_NOADDRESSES, "no address"}, -{DRARPERR_SERVERDOWN, "serverdown"}, -{DRARPERR_MOVED, "moved"}, -{DRARPERR_FAILURE, "failure"}, +{DRARPERR_RESTRICTED, "restricted" }, +{DRARPERR_NOADDRESSES, "no address" }, +{DRARPERR_SERVERDOWN, "serverdown" }, +{DRARPERR_MOVED, "moved" }, +{DRARPERR_FAILURE, "failure" }, {0, NULL}}; static const value_string atmop_vals[] = { - {ARPOP_REQUEST, "request" }, - {ARPOP_REPLY, "reply" }, - {ARPOP_IREQUEST, "inverse request"}, - {ARPOP_IREPLY, "inverse reply" }, - {ATMARPOP_NAK, "nak" }, - {ARPOP_MARS_REQUEST, "mars request"}, - {ARPOP_MARS_MULTI, "mars multi"}, - {ARPOP_MARS_MSERV, "mars mserv"}, - {ARPOP_MARS_JOIN, "mars join"}, - {ARPOP_MARS_LEAVE, "mars leave"}, - {ARPOP_MARS_NAK, "mars nak"}, - {ARPOP_MARS_UNSERV, "mars unserv"}, - {ARPOP_MARS_SJOIN, "mars sjoin"}, - {ARPOP_MARS_SLEAVE, "mars sleave"}, - {ARPOP_MARS_GROUPLIST_REQUEST, "mars grouplist request"}, - {ARPOP_MARS_GROUPLIST_REPLY, "mars gruoplist reply"}, - {ARPOP_MARS_REDIRECT_MAP, "mars redirect map"}, - {ARPOP_MAPOS_UNARP, "mapos unarp"}, - {ARPOP_EXP1, "experimental 1" }, - {ARPOP_EXP2, "experimental 2" }, - {ARPOP_RESERVED1, "reserved"}, - {ARPOP_RESERVED2, "reserved"}, + {ARPOP_REQUEST, "request" }, + {ARPOP_REPLY, "reply" }, + {ARPOP_IREQUEST, "inverse request" }, + {ARPOP_IREPLY, "inverse reply" }, + {ATMARPOP_NAK, "nak" }, + {ARPOP_MARS_REQUEST, "mars request" }, + {ARPOP_MARS_MULTI, "mars multi" }, + {ARPOP_MARS_MSERV, "mars mserv" }, + {ARPOP_MARS_JOIN, "mars join" }, + {ARPOP_MARS_LEAVE, "mars leave" }, + {ARPOP_MARS_NAK, "mars nak" }, + {ARPOP_MARS_UNSERV, "mars unserv" }, + {ARPOP_MARS_SJOIN, "mars sjoin" }, + {ARPOP_MARS_SLEAVE, "mars sleave" }, + {ARPOP_MARS_GROUPLIST_REQUEST, "mars grouplist request" }, + {ARPOP_MARS_GROUPLIST_REPLY, "mars gruoplist reply" }, + {ARPOP_MARS_REDIRECT_MAP, "mars redirect map" }, + {ARPOP_MAPOS_UNARP, "mapos unarp" }, + {ARPOP_EXP1, "experimental 1" }, + {ARPOP_EXP2, "experimental 2" }, + {ARPOP_RESERVED1, "reserved" }, + {ARPOP_RESERVED2, "reserved" }, {0, NULL} }; #define ATMARP_IS_E164 0x40 /* bit in type/length for E.164 format */ @@ -393,8 +391,8 @@ arpproaddr_to_str(const guint8 *ad, int ad_len, guint16 type) static const gchar * atmarpnum_to_str(const guint8 *ad, int ad_tl) { - int ad_len = ad_tl & ATMARP_LEN_MASK; - gchar *cur; + int ad_len = ad_tl & ATMARP_LEN_MASK; + gchar *cur; if (ad_len == 0) return "<No address>"; @@ -426,7 +424,7 @@ atmarpnum_to_str(const guint8 *ad, int ad_tl) static const gchar * atmarpsubaddr_to_str(const guint8 *ad, int ad_tl) { - int ad_len = ad_tl & ATMARP_LEN_MASK; + int ad_len = ad_tl & ATMARP_LEN_MASK; if (ad_len == 0) return "<No address>"; @@ -444,46 +442,46 @@ atmarpsubaddr_to_str(const guint8 *ad, int ad_tl) } const value_string arp_hrd_vals[] = { - {ARPHRD_NETROM, "NET/ROM pseudo" }, - {ARPHRD_ETHER, "Ethernet" }, - {ARPHRD_EETHER, "Experimental Ethernet"}, - {ARPHRD_AX25, "AX.25" }, - {ARPHRD_PRONET, "ProNET" }, - {ARPHRD_CHAOS, "Chaos" }, - {ARPHRD_IEEE802, "IEEE 802" }, - {ARPHRD_ARCNET, "ARCNET" }, - {ARPHRD_HYPERCH, "Hyperchannel" }, - {ARPHRD_LANSTAR, "Lanstar" }, - {ARPHRD_AUTONET, "Autonet Short Address"}, - {ARPHRD_LOCALTLK, "Localtalk" }, - {ARPHRD_LOCALNET, "LocalNet" }, - {ARPHRD_ULTRALNK, "Ultra link" }, - {ARPHRD_SMDS, "SMDS" }, - {ARPHRD_DLCI, "Frame Relay DLCI" }, - {ARPHRD_ATM, "ATM" }, - {ARPHRD_HDLC, "HDLC" }, - {ARPHRD_FIBREC, "Fibre Channel" }, - {ARPHRD_ATM2225, "ATM (RFC 2225)" }, - {ARPHRD_SERIAL, "Serial Line" }, - {ARPHRD_ATM2, "ATM" }, - {ARPHRD_MS188220, "MIL-STD-188-220" }, - {ARPHRD_METRICOM, "Metricom STRIP" }, - {ARPHRD_IEEE1394, "IEEE 1394.1995" }, - {ARPHRD_MAPOS, "MAPOS" }, - {ARPHRD_TWINAX, "Twinaxial" }, - {ARPHRD_EUI_64, "EUI-64" }, - {ARPHRD_HIPARP, "HIPARP" }, - {ARPHRD_IP_ARP_ISO_7816_3, "IP and ARP over ISO 7816-3"}, - {ARPHRD_ARPSEC, "ARPSec" }, - {ARPHRD_IPSEC_TUNNEL, "IPsec tunnel"}, - {ARPHRD_INFINIBAND, "InfiniBand" }, - {ARPHRD_TIA_102_PRJ_25_CAI, "TIA-102 Project 25 CAI"}, - {ARPHRD_WIEGAND_INTERFACE, "Wiegand Interface"}, - {ARPHRD_PURE_IP, "Pure IP" }, - {ARPHDR_HW_EXP1, "Experimental 1"}, - {ARPHDR_HFI, "HFI" }, - {ARPHDR_HW_EXP2, "Experimental 2"}, - {0, NULL } }; + {ARPHRD_NETROM, "NET/ROM pseudo" }, + {ARPHRD_ETHER, "Ethernet" }, + {ARPHRD_EETHER, "Experimental Ethernet" }, + {ARPHRD_AX25, "AX.25" }, + {ARPHRD_PRONET, "ProNET" }, + {ARPHRD_CHAOS, "Chaos" }, + {ARPHRD_IEEE802, "IEEE 802" }, + {ARPHRD_ARCNET, "ARCNET" }, + {ARPHRD_HYPERCH, "Hyperchannel" }, + {ARPHRD_LANSTAR, "Lanstar" }, + {ARPHRD_AUTONET, "Autonet Short Address" }, + {ARPHRD_LOCALTLK, "Localtalk" }, + {ARPHRD_LOCALNET, "LocalNet" }, + {ARPHRD_ULTRALNK, "Ultra link" }, + {ARPHRD_SMDS, "SMDS" }, + {ARPHRD_DLCI, "Frame Relay DLCI" }, + {ARPHRD_ATM, "ATM" }, + {ARPHRD_HDLC, "HDLC" }, + {ARPHRD_FIBREC, "Fibre Channel" }, + {ARPHRD_ATM2225, "ATM (RFC 2225)" }, + {ARPHRD_SERIAL, "Serial Line" }, + {ARPHRD_ATM2, "ATM" }, + {ARPHRD_MS188220, "MIL-STD-188-220" }, + {ARPHRD_METRICOM, "Metricom STRIP" }, + {ARPHRD_IEEE1394, "IEEE 1394.1995" }, + {ARPHRD_MAPOS, "MAPOS" }, + {ARPHRD_TWINAX, "Twinaxial" }, + {ARPHRD_EUI_64, "EUI-64" }, + {ARPHRD_HIPARP, "HIPARP" }, + {ARPHRD_IP_ARP_ISO_7816_3, "IP and ARP over ISO 7816-3" }, + {ARPHRD_ARPSEC, "ARPSec" }, + {ARPHRD_IPSEC_TUNNEL, "IPsec tunnel" }, + {ARPHRD_INFINIBAND, "InfiniBand" }, + {ARPHRD_TIA_102_PRJ_25_CAI, "TIA-102 Project 25 CAI" }, + {ARPHRD_WIEGAND_INTERFACE, "Wiegand Interface" }, + {ARPHRD_PURE_IP, "Pure IP" }, + {ARPHDR_HW_EXP1, "Experimental 1" }, + {ARPHDR_HFI, "HFI" }, + {ARPHDR_HW_EXP2, "Experimental 2" }, + {0, NULL } }; /* Offsets of fields within an ARP packet. */ #define AR_HRD 0 @@ -494,13 +492,13 @@ const value_string arp_hrd_vals[] = { #define MIN_ARP_HEADER_SIZE 8 /* Offsets of fields within an ATMARP packet. */ -#define ATM_AR_HRD 0 -#define ATM_AR_PRO 2 -#define ATM_AR_SHTL 4 -#define ATM_AR_SSTL 5 -#define ATM_AR_OP 6 -#define ATM_AR_SPLN 8 -#define ATM_AR_THTL 9 +#define ATM_AR_HRD 0 +#define ATM_AR_PRO 2 +#define ATM_AR_SHTL 4 +#define ATM_AR_SSTL 5 +#define ATM_AR_OP 6 +#define ATM_AR_SPLN 8 +#define ATM_AR_THTL 9 #define ATM_AR_TSTL 10 #define ATM_AR_TPLN 11 #define MIN_ATMARP_HEADER_SIZE 12 @@ -509,7 +507,7 @@ static void dissect_atm_number(tvbuff_t *tvb, int offset, int tl, int hf_e164, int hf_nsap, proto_tree *tree) { - int len = tl & ATMARP_LEN_MASK; + int len = tl & ATMARP_LEN_MASK; proto_item *ti; proto_tree *nsap_tree; @@ -636,9 +634,9 @@ check_for_duplicate_addresses(packet_info *pinfo, proto_tree *tree, const guint8 *mac, guint32 ip, guint32 *duplicate_ip) { - address_hash_value *value; - address_hash_value *result = NULL; - duplicate_result_key result_key = {pinfo->fd->num, ip}; + address_hash_value *value; + address_hash_value *result = NULL; + duplicate_result_key result_key = {pinfo->fd->num, ip}; /* Look up existing result */ if (pinfo->fd->flags.visited) { @@ -830,31 +828,31 @@ check_for_storm_count(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - guint16 ar_hrd; - guint16 ar_pro; - guint8 ar_shtl; - guint8 ar_shl; - guint8 ar_sstl; - guint8 ar_ssl; - guint16 ar_op; - guint8 ar_spln; - guint8 ar_thtl; - guint8 ar_thl; - guint8 ar_tstl; - guint8 ar_tsl; - guint8 ar_tpln; - int tot_len; - proto_tree *arp_tree; - proto_item *ti; - const gchar *op_str; - int sha_offset, ssa_offset, spa_offset; - int tha_offset, tsa_offset, tpa_offset; - const guint8 *sha_val, *ssa_val, *spa_val; - const guint8 *tha_val, *tsa_val, *tpa_val; - const gchar *sha_str, *ssa_str, *spa_str; - const gchar *tha_str, *tsa_str, *tpa_str; - proto_tree *tl_tree; - proto_item *tl; + guint16 ar_hrd; + guint16 ar_pro; + guint8 ar_shtl; + guint8 ar_shl; + guint8 ar_sstl; + guint8 ar_ssl; + guint16 ar_op; + guint8 ar_spln; + guint8 ar_thtl; + guint8 ar_thl; + guint8 ar_tstl; + guint8 ar_tsl; + guint8 ar_tpln; + int tot_len; + proto_tree *arp_tree; + proto_item *ti; + const gchar *op_str; + int sha_offset, ssa_offset, spa_offset; + int tha_offset, tsa_offset, tpa_offset; + const guint8 *sha_val, *ssa_val, *spa_val; + const guint8 *tha_val, *tsa_val, *tpa_val; + const gchar *sha_str, *ssa_str, *spa_str; + const gchar *tha_str, *tsa_str, *tpa_str; + proto_tree *tl_tree; + proto_item *tl; /* Override the setting to "ARP/RARP". */ pinfo->current_proto = "ATMARP"; @@ -998,14 +996,14 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_MARS_REQUEST: col_add_fstr(pinfo->cinfo, COL_INFO, "MARS request from %s%s%s at %s", sha_str, - ((ssa_str != NULL) ? "," : ""), + ((ssa_str != NULL) ? "," : ""), ((ssa_str != NULL) ? ssa_str : ""), spa_str); break; case ARPOP_MARS_MULTI: col_add_fstr(pinfo->cinfo, COL_INFO, "MARS MULTI request from %s%s%s at %s", - sha_str, + sha_str, ((ssa_str != NULL) ? "," : ""), ((ssa_str != NULL) ? ssa_str : ""), spa_str); @@ -1013,7 +1011,7 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_MARS_MSERV: col_add_fstr(pinfo->cinfo, COL_INFO, "MARS MSERV request from %s%s%s at %s", - sha_str, + sha_str, ((ssa_str != NULL) ? "," : ""), ((ssa_str != NULL) ? ssa_str : ""), spa_str); @@ -1021,7 +1019,7 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_MARS_JOIN: col_add_fstr(pinfo->cinfo, COL_INFO, "MARS JOIN request from %s%s%s at %s", - sha_str, + sha_str, ((ssa_str != NULL) ? "," : ""), ((ssa_str != NULL) ? ssa_str : ""), spa_str); @@ -1029,7 +1027,7 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_MARS_LEAVE: col_add_fstr(pinfo->cinfo, COL_INFO, "MARS LEAVE from %s%s%s at %s", - sha_str, + sha_str, ((ssa_str != NULL) ? "," : ""), ((ssa_str != NULL) ? ssa_str : ""), spa_str); @@ -1220,20 +1218,20 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { -#define ARP_AX25 204 - - guint16 ar_hrd; - guint16 ar_pro; - guint8 ar_hln; - guint8 ar_pln; - guint16 ar_op; - int tot_len; +#define ARP_AX25 204 + + guint16 ar_hrd; + guint16 ar_pro; + guint8 ar_hln; + guint8 ar_pln; + guint16 ar_op; + int tot_len; proto_tree *arp_tree = NULL; proto_item *ti; const gchar *op_str; - int sha_offset, spa_offset, tha_offset, tpa_offset; - const guint8 /* *sha_val, */ *spa_val, /* *tha_val, */ *tpa_val; - gboolean is_gratuitous; + int sha_offset, spa_offset, tha_offset, tpa_offset; + const guint8 /* *sha_val, */ *spa_val, /* *tha_val, */ *tpa_val; + gboolean is_gratuitous; /* Hardware Address Type */ ar_hrd = tvb_get_ntohs(tvb, AR_HRD); @@ -1293,9 +1291,9 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* ARP requests/replies with the same sender and target protocol address are flagged as "gratuitous ARPs", i.e. ARPs sent out as, in effect, an announcement that the machine has MAC address - XX:XX:XX:XX:XX:XX and IPv4 address YY.YY.YY.YY. Requests are to + XX:XX:XX:XX:XX:XX and IPv4 address YY.YY.YY.YY. Requests are to provoke complaints if some other machine has the same IPv4 address, - replies are used to announce relocation of network address, like + replies are used to announce relocation of network address, like in failover solutions. */ if (((ar_op == ARPOP_REQUEST) || (ar_op == ARPOP_REPLY)) && (memcmp(spa_val, tpa_val, ar_pln) == 0)) is_gratuitous = TRUE; @@ -1304,10 +1302,10 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) switch (ar_op) { case ARPOP_REQUEST: - if (is_gratuitous) - col_add_fstr(pinfo->cinfo, COL_INFO, "Gratuitous ARP for %s (Request)", - arpproaddr_to_str(tpa_val, ar_pln, ar_pro)); - else + if (is_gratuitous) + col_add_fstr(pinfo->cinfo, COL_INFO, "Gratuitous ARP for %s (Request)", + arpproaddr_to_str(tpa_val, ar_pln, ar_pro)); + else col_add_fstr(pinfo->cinfo, COL_INFO, "Who has %s? Tell %s", arpproaddr_to_str(tpa_val, ar_pln, ar_pro), arpproaddr_to_str(spa_val, ar_pln, ar_pro)); @@ -1348,16 +1346,16 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } if (tree) { - if ((op_str = try_val_to_str(ar_op, op_vals))) { + if ((op_str = try_val_to_str(ar_op, op_vals))) { if (is_gratuitous && (ar_op == ARPOP_REQUEST)) op_str = "request/gratuitous ARP"; if (is_gratuitous && (ar_op == ARPOP_REPLY)) op_str = "reply/gratuitous ARP"; ti = proto_tree_add_protocol_format(tree, proto_arp, tvb, 0, tot_len, - "Address Resolution Protocol (%s)", op_str); + "Address Resolution Protocol (%s)", op_str); } else ti = proto_tree_add_protocol_format(tree, proto_arp, tvb, 0, tot_len, - "Address Resolution Protocol (opcode 0x%04x)", ar_op); + "Address Resolution Protocol (opcode 0x%04x)", ar_op); arp_tree = proto_item_add_subtree(ti, ett_arp); proto_tree_add_uint(arp_tree, hf_arp_hard_type, tvb, AR_HRD, 2, ar_hrd); proto_tree_add_uint(arp_tree, hf_arp_proto_type, tvb, AR_PRO, 2, ar_pro); @@ -1366,25 +1364,25 @@ dissect_ax25arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(arp_tree, hf_arp_opcode, tvb, AR_OP, 2, ar_op); if (ar_hln != 0) { proto_tree_add_item(arp_tree, - ARP_HW_IS_AX25(ar_hrd, ar_hln) ? hf_arp_src_hw_ax25 : hf_arp_src_hw, - tvb, sha_offset, ar_hln, FALSE); + ARP_HW_IS_AX25(ar_hrd, ar_hln) ? hf_arp_src_hw_ax25 : hf_arp_src_hw, + tvb, sha_offset, ar_hln, FALSE); } if (ar_pln != 0) { proto_tree_add_item(arp_tree, - ARP_PRO_IS_IPv4(ar_pro, ar_pln) ? hf_arp_src_proto_ipv4 - : hf_arp_src_proto, - tvb, spa_offset, ar_pln, FALSE); + ARP_PRO_IS_IPv4(ar_pro, ar_pln) ? hf_arp_src_proto_ipv4 + : hf_arp_src_proto, + tvb, spa_offset, ar_pln, FALSE); } if (ar_hln != 0) { proto_tree_add_item(arp_tree, - ARP_HW_IS_AX25(ar_hrd, ar_hln) ? hf_arp_dst_hw_ax25 : hf_arp_dst_hw, - tvb, tha_offset, ar_hln, FALSE); + ARP_HW_IS_AX25(ar_hrd, ar_hln) ? hf_arp_dst_hw_ax25 : hf_arp_dst_hw, + tvb, tha_offset, ar_hln, FALSE); } if (ar_pln != 0) { proto_tree_add_item(arp_tree, - ARP_PRO_IS_IPv4(ar_pro, ar_pln) ? hf_arp_dst_proto_ipv4 - : hf_arp_dst_proto, - tvb, tpa_offset, ar_pln, FALSE); + ARP_PRO_IS_IPv4(ar_pro, ar_pln) ? hf_arp_dst_proto_ipv4 + : hf_arp_dst_proto, + tvb, tpa_offset, ar_pln, FALSE); } } @@ -1399,20 +1397,20 @@ static const guint8 mac_allzero[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static void dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - guint16 ar_hrd; - guint16 ar_pro; - guint8 ar_hln; - guint8 ar_pln; - guint16 ar_op; - int tot_len; - proto_tree *arp_tree = NULL; - proto_item *ti, *item; - const gchar *op_str; - int sha_offset, spa_offset, tha_offset, tpa_offset; - const guint8 *spa_val, *tpa_val; - gboolean is_gratuitous; - gboolean duplicate_detected = FALSE; - guint32 duplicate_ip = 0; + guint16 ar_hrd; + guint16 ar_pro; + guint8 ar_hln; + guint8 ar_pln; + guint16 ar_op; + int tot_len; + proto_tree *arp_tree = NULL; + proto_item *ti, *item; + const gchar *op_str; + int sha_offset, spa_offset, tha_offset, tpa_offset; + const guint8 *spa_val, *tpa_val; + gboolean is_gratuitous; + gboolean duplicate_detected = FALSE; + guint32 duplicate_ip = 0; /* Call it ARP, for now, so that if we throw an exception before we decide whether it's ARP or RARP or IARP or ATMARP, it shows @@ -1477,7 +1475,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_IREPLY: col_set_str(pinfo->cinfo, COL_PROTOCOL, "Inverse ARP"); break; - + case ARPOP_MARS_REQUEST: case ARPOP_MARS_MULTI: case ARPOP_MARS_MSERV: @@ -1491,7 +1489,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_MARS_GROUPLIST_REPLY: case ARPOP_MARS_REDIRECT_MAP: col_set_str(pinfo->cinfo, COL_PROTOCOL, "MARS"); - break; + break; case ARPOP_MAPOS_UNARP: col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAPOS"); @@ -1609,7 +1607,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_DRARPERROR: col_add_fstr(pinfo->cinfo, COL_INFO, "DRARP Error"); - break; + break; case ARPOP_IREPLY: col_add_fstr(pinfo->cinfo, COL_INFO, "%s is at %s", @@ -1696,7 +1694,7 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case ARPOP_MAPOS_UNARP: col_add_fstr(pinfo->cinfo, COL_INFO, "MAPOS UNARP request from %s at %s", tvb_arphrdaddr_to_str(tvb, sha_offset, ar_hln, ar_hrd), - arpproaddr_to_str(spa_val, ar_pln, ar_pro)); + arpproaddr_to_str(spa_val, ar_pln, ar_pro)); break; case ARPOP_EXP1: @@ -1734,11 +1732,11 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(arp_tree, hf_arp_hard_size, tvb, AR_HLN, 1, ar_hln); proto_tree_add_uint(arp_tree, hf_arp_proto_size, tvb, AR_PLN, 1, ar_pln); proto_tree_add_uint(arp_tree, hf_arp_opcode, tvb, AR_OP, 2, ar_op); - if(is_gratuitous) + if (is_gratuitous) { item = proto_tree_add_boolean(arp_tree, hf_arp_isgratuitous, tvb, 0, 0, is_gratuitous); PROTO_ITEM_SET_GENERATED(item); - } + } if (ar_hln != 0) { proto_tree_add_item(arp_tree, ARP_HW_IS_ETHER(ar_hrd, ar_hln) ? @@ -1882,9 +1880,9 @@ proto_register_arp(void) NULL, HFILL }}, { &hf_arp_src_hw_ax25, - { "Sender AX.25 address", "arp.src.hw_ax25", - FT_AX25, BASE_NONE, NULL, 0x0, - "", HFILL }}, + { "Sender AX.25 address", "arp.src.hw_ax25", + FT_AX25, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, { &hf_atmarp_src_atm_num_e164, { "Sender ATM number (E.164)", "arp.src.atm_num_e164", @@ -1922,9 +1920,9 @@ proto_register_arp(void) NULL, HFILL }}, { &hf_arp_dst_hw_ax25, - { "Target AX.25 address", "arp.dst.hw_ax25", - FT_AX25, BASE_NONE, NULL, 0x0, - "", HFILL }}, + { "Target AX.25 address", "arp.dst.hw_ax25", + FT_AX25, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, { &hf_atmarp_dst_atm_num_e164, { "Target ATM number (E.164)", "arp.dst.atm_num_e164", |