diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-04-27 16:29:09 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-04-27 16:29:09 +0000 |
commit | 77d86cadf56ee6bdb86272d7306d3763a16547f2 (patch) | |
tree | 1d2cf129b201b30ffb2836bb0f15fa312e80f8b3 /epan/dissectors/packet-ansi_683.c | |
parent | 3db5412ee7dbeb5ee637a3636fc633ee71ae0fec (diff) |
From Yaniv Kaul:
Some fixes for 'set but not used' errors that GCC 4.6 emits.
From me:
Remove uneeded #include <stdlib.h>, <gmodule.h>;
Do some whitespace cleanup.
svn path=/trunk/; revision=36902
Diffstat (limited to 'epan/dissectors/packet-ansi_683.c')
-rw-r--r-- | epan/dissectors/packet-ansi_683.c | 4316 |
1 files changed, 2156 insertions, 2160 deletions
diff --git a/epan/dissectors/packet-ansi_683.c b/epan/dissectors/packet-ansi_683.c index eba55d2178..0cd8524fcf 100644 --- a/epan/dissectors/packet-ansi_683.c +++ b/epan/dissectors/packet-ansi_683.c @@ -34,9 +34,6 @@ # include "config.h" #endif -#include <stdlib.h> -#include <gmodule.h> - #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif @@ -53,8 +50,8 @@ static const char *ansi_proto_name = "ANSI IS-683 (OTA (Mobile))"; static const char *ansi_proto_name_short = "IS-683"; -#define ANSI_683_FORWARD 0 -#define ANSI_683_REVERSE 1 +#define ANSI_683_FORWARD 0 +#define ANSI_683_REVERSE 1 /* Initialize the subtree pointers */ @@ -99,67 +96,67 @@ static const char bcd_digits[16] = {'0','1','2','3','4','5','6','7','8','9','?' /* 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_none_format(tree, hf_ansi_683_none, tvb, \ - offset, (edc_len) - (edc_max_len), "Extraneous Data"); \ + proto_tree_add_none_format(tree, hf_ansi_683_none, 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_none_format(tree, hf_ansi_683_none, tvb, \ - offset, (sdc_len), "Short Data (?)"); \ - return; \ + proto_tree_add_none_format(tree, hf_ansi_683_none, 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_none_format(tree, hf_ansi_683_none, tvb, \ - offset, (edc_len), "Unexpected Data Length"); \ - return; \ + proto_tree_add_none_format(tree, hf_ansi_683_none, tvb, \ + offset, (edc_len), "Unexpected Data Length"); \ + return; \ } static guint32 fresh_handler(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset) { - guint32 value; - guint8 oct; + guint32 value; + guint8 oct; oct = tvb_get_guint8(tvb, offset); if (oct & 0x80) { - value = tvb_get_ntohs(tvb, offset); + value = tvb_get_ntohs(tvb, offset); - other_decode_bitfield_value(bigbuf, value, 0x8000, 16); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : FRESH_INCL : TRUE", - bigbuf); + other_decode_bitfield_value(bigbuf, value, 0x8000, 16); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "%s : FRESH_INCL : TRUE", + bigbuf); - other_decode_bitfield_value(bigbuf, value, 0x7fff, 16); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : FRESH", - bigbuf); + other_decode_bitfield_value(bigbuf, value, 0x7fff, 16); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "%s : FRESH", + bigbuf); - return(2); + return(2); } other_decode_bitfield_value(bigbuf, oct, 0x80, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : FRESH_INCL : FALSE", - bigbuf); + tvb, offset, 1, + "%s : FRESH_INCL : FALSE", + bigbuf); other_decode_bitfield_value(bigbuf, oct, 0x7f, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + tvb, offset, 1, + "%s : Reserved", + bigbuf); return(1); } @@ -170,7 +167,7 @@ fresh_handler(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset) static const gchar * rev_res_code_type(guint8 res_code) { - const gchar *str; + const gchar *str; switch (res_code) { @@ -222,9 +219,9 @@ rev_res_code_type(guint8 res_code) case 45: str = " Rejected - MMS_URI _LENGTH mismatch"; break; case 46: str = " Rejected - Invalid MMS_URI"; break; default: - if ((res_code >= 47) && (res_code <= 127)) { str = "Reserved for future standardization"; break; } - else if ((res_code >= 128) && (res_code <= 254)) { str = "Available for manufacturer-specific Result Code definitions"; break; } - else { str = "Reserved"; break; } + if ((res_code >= 47) && (res_code <= 127)) { str = "Reserved for future standardization"; break; } + else if ((res_code >= 128) && (res_code <= 254)) { str = "Available for manufacturer-specific Result Code definitions"; break; } + else { str = "Reserved"; break; } } return(str); @@ -236,7 +233,7 @@ rev_res_code_type(guint8 res_code) static const gchar * rev_feat_id_type(guint8 feat_id) { - const gchar *str; + const gchar *str; switch (feat_id) { @@ -252,20 +249,20 @@ rev_feat_id_type(guint8 feat_id) case 9: str = "System Tag Download (TAG_P_REV)"; break; case 10: str = "Multimedia Messaging Service (MMS)"; break; default: - if ((feat_id >= 11) && (feat_id <= 191)) { str = "Reserved for future standardization"; break; } - else if ((feat_id >= 192) && (feat_id <= 254)) { str = "Available for manufacturer-specific features"; break; } - else { str = "Reserved"; break; } + if ((feat_id >= 11) && (feat_id <= 191)) { str = "Reserved for future standardization"; break; } + else if ((feat_id >= 192) && (feat_id <= 254)) { str = "Available for manufacturer-specific features"; break; } + else { str = "Reserved"; break; } } return(str); } -#define REV_TYPE_CAP_INFO_OP_MODE 0 -#define REV_TYPE_CAP_INFO_CDMA_BAND 1 -#define REV_TYPE_CAP_INFO_MEID 2 -#define REV_TYPE_CAP_INFO_ICCID 3 -#define REV_TYPE_CAP_INFO_EXT_UIM_ID 4 -#define REV_TYPE_CAP_INFO_MEID_ME 5 +#define REV_TYPE_CAP_INFO_OP_MODE 0 +#define REV_TYPE_CAP_INFO_CDMA_BAND 1 +#define REV_TYPE_CAP_INFO_MEID 2 +#define REV_TYPE_CAP_INFO_ICCID 3 +#define REV_TYPE_CAP_INFO_EXT_UIM_ID 4 +#define REV_TYPE_CAP_INFO_MEID_ME 5 /* * Table 3.5.1.17.1-1 Capability Information Record Types @@ -273,7 +270,7 @@ rev_feat_id_type(guint8 feat_id) static const gchar * rev_cap_info_record_type(guint8 rec_type) { - const gchar *str; + const gchar *str; switch (rec_type) { @@ -284,15 +281,15 @@ rev_cap_info_record_type(guint8 rec_type) case 4: str = "EXT_UIM_ID"; break; case 5: str = "MEID_ME"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); } -#define FOR_BLOCK_VAL_VERIFY_SPC 0 -#define FOR_BLOCK_VAL_CHANGE_SPC 1 -#define FOR_BLOCK_VAL_VALDATE_SPASM 2 +#define FOR_BLOCK_VAL_VERIFY_SPC 0 +#define FOR_BLOCK_VAL_CHANGE_SPC 1 +#define FOR_BLOCK_VAL_VALDATE_SPASM 2 /* * Table 4.5.4-1 Validation Parameter Block Types @@ -300,7 +297,7 @@ rev_cap_info_record_type(guint8 rec_type) static const gchar * for_param_block_val(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -308,17 +305,17 @@ for_param_block_val(guint8 block_type) case 1: str = "Change SPC"; break; case 2: str = "Validate SPASM"; break; default: - if ((block_type >= 3) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 3) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); } -#define REV_BLOCK_SSPR_PRL_DIM 0 -#define REV_BLOCK_SSPR_PRL 1 -#define REV_BLOCK_SSPR_EXT_PRL_DIM 2 +#define REV_BLOCK_SSPR_PRL_DIM 0 +#define REV_BLOCK_SSPR_PRL 1 +#define REV_BLOCK_SSPR_EXT_PRL_DIM 2 /* * Table 3.5.3-1 SSPR Parameter Block Types @@ -326,7 +323,7 @@ for_param_block_val(guint8 block_type) static const gchar * rev_param_block_sspr(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -334,16 +331,16 @@ rev_param_block_sspr(guint8 block_type) case 1: str = "Preferred Roaming List"; break; case 2: str = "Extended Preferred Roaming List Dimensions"; break; default: - if ((block_type >= 3) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 3) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); } -#define FOR_BLOCK_SSPR_PRL 0 -#define FOR_BLOCK_SSPR_EXT_PRL 1 +#define FOR_BLOCK_SSPR_PRL 0 +#define FOR_BLOCK_SSPR_EXT_PRL 1 /* * Table 4.5.3-1 SSPR Parameter Block Types @@ -351,25 +348,25 @@ rev_param_block_sspr(guint8 block_type) static const gchar * for_param_block_sspr(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { case 0: str = "Preferred Roaming List"; break; case 1: str = "Extended Preferred Roaming List with SSPR_P_REV greater than 00000001"; break; default: - if ((block_type >= 2) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 2) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); } -#define REV_BLOCK_NAM_CDMA_ANALOG 0 -#define REV_BLOCK_NAM_MDN 1 -#define REV_BLOCK_NAM_CDMA 2 -#define REV_BLOCK_NAM_IMSI_T 3 +#define REV_BLOCK_NAM_CDMA_ANALOG 0 +#define REV_BLOCK_NAM_MDN 1 +#define REV_BLOCK_NAM_CDMA 2 +#define REV_BLOCK_NAM_IMSI_T 3 /* * Table 3.5.2-1 NAM Parameter Block Types @@ -377,7 +374,7 @@ for_param_block_sspr(guint8 block_type) static const gchar * rev_param_block_nam(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -386,18 +383,18 @@ rev_param_block_nam(guint8 block_type) case 2: str = "CDMA NAM"; break; case 3: str = "IMSI_T"; break; default: - if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); } -#define FOR_BLOCK_NAM_CDMA_ANALOG 0 -#define FOR_BLOCK_NAM_MDN 1 -#define FOR_BLOCK_NAM_CDMA 2 -#define FOR_BLOCK_NAM_IMSI_T 3 +#define FOR_BLOCK_NAM_CDMA_ANALOG 0 +#define FOR_BLOCK_NAM_MDN 1 +#define FOR_BLOCK_NAM_CDMA 2 +#define FOR_BLOCK_NAM_IMSI_T 3 /* * Table 4.5.2-1 NAM Parameter Block Types @@ -405,7 +402,7 @@ rev_param_block_nam(guint8 block_type) static const gchar * for_param_block_nam(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -414,9 +411,9 @@ for_param_block_nam(guint8 block_type) case 2: str = "CDMA NAM Download"; break; case 3: str = "IMSI_T"; break; default: - if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); @@ -428,7 +425,7 @@ for_param_block_nam(guint8 block_type) static const gchar * rev_param_block_puzl(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -437,19 +434,19 @@ rev_param_block_puzl(guint8 block_type) case 2: str = "User Zone"; break; case 3: str = "Preferred User Zone List"; break; default: - if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); } -#define FOR_BLOCK_PUZL_UZ_INS 0 -#define FOR_BLOCK_PUZL_UZ_UPD 1 -#define FOR_BLOCK_PUZL_UZ_DEL 2 -#define FOR_BLOCK_PUZL_UZ_PRI_CHANGE 3 -#define FOR_BLOCK_PUZL_FLAGS 4 +#define FOR_BLOCK_PUZL_UZ_INS 0 +#define FOR_BLOCK_PUZL_UZ_UPD 1 +#define FOR_BLOCK_PUZL_UZ_DEL 2 +#define FOR_BLOCK_PUZL_UZ_PRI_CHANGE 3 +#define FOR_BLOCK_PUZL_FLAGS 4 /* * Table 4.5.6-1 PUZL Parameter Block Types @@ -457,7 +454,7 @@ rev_param_block_puzl(guint8 block_type) static const gchar * for_param_block_puzl(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -467,28 +464,28 @@ for_param_block_puzl(guint8 block_type) case 3: str = "User Zone Priority Change"; break; case 4: str = "PUZL Flags"; break; default: - if ((block_type >= 5) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 5) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); } -#define REV_BLOCK_3GPD_OP_CAP 0 -#define REV_BLOCK_3GPD_OP_MODE 1 -#define REV_BLOCK_3GPD_SIP_CAP 2 -#define REV_BLOCK_3GPD_MIP_CAP 3 -#define REV_BLOCK_3GPD_SIP_USER_PRO 4 -#define REV_BLOCK_3GPD_MIP_USER_PRO 5 -#define REV_BLOCK_3GPD_SIP_STATUS 6 -#define REV_BLOCK_3GPD_MIP_STATUS 7 -#define REV_BLOCK_3GPD_SIP_PAP_SS 8 -#define REV_BLOCK_3GPD_SIP_CHAP_SS 9 -#define REV_BLOCK_3GPD_MIP_SS 10 -#define REV_BLOCK_3GPD_HRPD_ACC_AUTH_CAP 11 -#define REV_BLOCK_3GPD_HRPD_ACC_AUTH_USER 12 -#define REV_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS 13 +#define REV_BLOCK_3GPD_OP_CAP 0 +#define REV_BLOCK_3GPD_OP_MODE 1 +#define REV_BLOCK_3GPD_SIP_CAP 2 +#define REV_BLOCK_3GPD_MIP_CAP 3 +#define REV_BLOCK_3GPD_SIP_USER_PRO 4 +#define REV_BLOCK_3GPD_MIP_USER_PRO 5 +#define REV_BLOCK_3GPD_SIP_STATUS 6 +#define REV_BLOCK_3GPD_MIP_STATUS 7 +#define REV_BLOCK_3GPD_SIP_PAP_SS 8 +#define REV_BLOCK_3GPD_SIP_CHAP_SS 9 +#define REV_BLOCK_3GPD_MIP_SS 10 +#define REV_BLOCK_3GPD_HRPD_ACC_AUTH_CAP 11 +#define REV_BLOCK_3GPD_HRPD_ACC_AUTH_USER 12 +#define REV_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS 13 /* * Table 3.5.8-1 3GPD Parameter Block Types @@ -496,7 +493,7 @@ for_param_block_puzl(guint8 block_type) static const gchar * rev_param_block_3gpd(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -515,22 +512,22 @@ rev_param_block_3gpd(guint8 block_type) case 12: str = "HRPD Access Authentication User Profile Parameters"; break; case 13: str = "HRPD Access Authentication CHAP SS Parameters"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); } -#define FOR_BLOCK_3GPD_OP_MODE 0 -#define FOR_BLOCK_3GPD_SIP_USER_PRO 1 -#define FOR_BLOCK_3GPD_MIP_USER_PRO 2 -#define FOR_BLOCK_3GPD_SIP_STATUS 6 -#define FOR_BLOCK_3GPD_MIP_STATUS 7 -#define FOR_BLOCK_3GPD_SIP_PAP_SS 8 -#define FOR_BLOCK_3GPD_SIP_CHAP_SS 9 -#define FOR_BLOCK_3GPD_MIP_SS 10 -#define FOR_BLOCK_3GPD_HRPD_ACC_AUTH_USER 11 -#define FOR_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS 12 +#define FOR_BLOCK_3GPD_OP_MODE 0 +#define FOR_BLOCK_3GPD_SIP_USER_PRO 1 +#define FOR_BLOCK_3GPD_MIP_USER_PRO 2 +#define FOR_BLOCK_3GPD_SIP_STATUS 6 +#define FOR_BLOCK_3GPD_MIP_STATUS 7 +#define FOR_BLOCK_3GPD_SIP_PAP_SS 8 +#define FOR_BLOCK_3GPD_SIP_CHAP_SS 9 +#define FOR_BLOCK_3GPD_MIP_SS 10 +#define FOR_BLOCK_3GPD_HRPD_ACC_AUTH_USER 11 +#define FOR_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS 12 /* * Table 4.5.7-1 3GPD Parameter Block Types @@ -538,7 +535,7 @@ rev_param_block_3gpd(guint8 block_type) static const gchar * for_param_block_3gpd(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -553,13 +550,13 @@ for_param_block_3gpd(guint8 block_type) case 11: str = "HRPD Access Authentication User Profile Parameters"; break; case 12: str = "HRPD Access Authentication CHAP SS Parameters"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); } -#define REV_BLOCK_MMD_APP 0 +#define REV_BLOCK_MMD_APP 0 /* * Table 3.5.9-1 MMD Parameter Block Types @@ -567,19 +564,19 @@ for_param_block_3gpd(guint8 block_type) static const gchar * rev_param_block_mmd(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { case 0: str = "MMD Application Parameters"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); } -#define FOR_BLOCK_MMD_APP 0 +#define FOR_BLOCK_MMD_APP 0 /* * Table 4.5.8-1 MMD Parameter Block Types @@ -587,25 +584,25 @@ rev_param_block_mmd(guint8 block_type) static const gchar * for_param_block_mmd(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { case 0: str = "MMD Application Parameters"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); } -#define REV_BLOCK_SYSTAG_HOME_SYSTAG 0 -#define REV_BLOCK_SYSTAG_GROUP_TAG_LIST_DIM 1 -#define REV_BLOCK_SYSTAG_GROUP_TAG_LIST 2 -#define REV_BLOCK_SYSTAG_SPEC_TAG_LIST_DIM 3 -#define REV_BLOCK_SYSTAG_SPEC_TAG_LIST 4 -#define REV_BLOCK_SYSTAG_CALL_PROMPT_LIST_DIM 5 -#define REV_BLOCK_SYSTAG_CALL_PROMPT_LIST 6 +#define REV_BLOCK_SYSTAG_HOME_SYSTAG 0 +#define REV_BLOCK_SYSTAG_GROUP_TAG_LIST_DIM 1 +#define REV_BLOCK_SYSTAG_GROUP_TAG_LIST 2 +#define REV_BLOCK_SYSTAG_SPEC_TAG_LIST_DIM 3 +#define REV_BLOCK_SYSTAG_SPEC_TAG_LIST 4 +#define REV_BLOCK_SYSTAG_CALL_PROMPT_LIST_DIM 5 +#define REV_BLOCK_SYSTAG_CALL_PROMPT_LIST 6 /* * Table 3.5.10-1 System Tag Parameter Block Types @@ -613,7 +610,7 @@ for_param_block_mmd(guint8 block_type) static const gchar * rev_param_block_systag(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -625,7 +622,7 @@ rev_param_block_systag(guint8 block_type) case 5: str = "Call Prompt List Dimensions"; break; case 6: str = "Call Prompt List"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); @@ -637,7 +634,7 @@ rev_param_block_systag(guint8 block_type) static const gchar * for_param_block_systag(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { @@ -646,16 +643,16 @@ for_param_block_systag(guint8 block_type) case 2: str = "Specific Tag List"; break; case 3: str = "Call Prompt List"; break; default: - if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } - else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } - else { str = "Reserved"; break; } + if ((block_type >= 4) && (block_type <= 127)) { str = "Reserved for future standardization"; break; } + else if ((block_type >= 128) && (block_type <= 254)) { str = "Available for manufacturer-specific parameter block definitions"; break; } + else { str = "Reserved"; break; } } return(str); } -#define REV_BLOCK_MMS_URI 0 -#define REV_BLOCK_MMS_URI_CAP 1 +#define REV_BLOCK_MMS_URI 0 +#define REV_BLOCK_MMS_URI_CAP 1 /* * Table 3.5.12-1 MMS Parameter Block Types @@ -663,20 +660,20 @@ for_param_block_systag(guint8 block_type) static const gchar * rev_param_block_mms(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { case 0: str = "MMS URI Parameters"; break; case 1: str = "MMS URI Capability Parameters"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); } -#define FOR_BLOCK_MMS_URI 0 +#define FOR_BLOCK_MMS_URI 0 /* * Table 4.5.10-1 MMS Parameter Block Types @@ -684,13 +681,13 @@ rev_param_block_mms(guint8 block_type) static const gchar * for_param_block_mms(guint8 block_type) { - const gchar *str; + const gchar *str; switch (block_type) { case 0: str = "MMS URI Parameters"; break; default: - str = "Reserved"; break; + str = "Reserved"; break; } return(str); @@ -704,12 +701,12 @@ for_param_block_mms(guint8 block_type) static void rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 saved_offset; - guint32 value; - guint32 count; - proto_tree *subtree; - proto_item *item; - const gchar *str = NULL; + guint32 saved_offset; + guint32 value; + guint32 count; + proto_tree *subtree; + proto_item *item; + const gchar *str = NULL; saved_offset = offset; @@ -717,10 +714,10 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0xffe0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : First paging channel (FIRSTCHP) used in the home system (%u)", - bigbuf, - (value & 0xffe0) >> 5); + tvb, offset, 2, + "%s : First paging channel (FIRSTCHP) used in the home system (%u)", + bigbuf, + (value & 0xffe0) >> 5); offset++; @@ -728,16 +725,16 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x1fffc0, 24); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : Home system identification (HOME_SID) (%u)", - bigbuf, - (value & 0x1fffc0) >> 6); + tvb, offset, 3, + "%s : Home system identification (HOME_SID) (%u)", + bigbuf, + (value & 0x1fffc0) >> 6); other_decode_bitfield_value(bigbuf, value, 0x20, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 2, 1, - "%s : Extended address indicator (EX)", - bigbuf); + tvb, offset + 2, 1, + "%s : Extended address indicator (EX)", + bigbuf); offset += 2; @@ -745,11 +742,11 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x1fe0, 16); item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Station class mark (SCM) (%u)", - bigbuf, - (value & 0x1fe0) >> 5); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "%s : Station class mark (SCM) (%u)", + bigbuf, + (value & 0x1fe0) >> 5); /* * following SCM decode is from: @@ -760,51 +757,51 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x1000, 16); proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, + tvb, offset, 2, "%s : Extended SCM Indicator: %s", bigbuf, (value & 0x1000) ? "Band Classes 1,4" : "Other bands"); other_decode_bitfield_value(bigbuf, value, 0x0800, 16); proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, + tvb, offset, 2, "%s : %s", bigbuf, (value & 0x0800) ? "Dual Mode" : "CDMA Only"); other_decode_bitfield_value(bigbuf, value, 0x0400, 16); proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, + tvb, offset, 2, "%s : %s", bigbuf, (value & 0x0400) ? "Slotted" : "Non-Slotted"); if (value & 0x0200) { - str = ""; - proto_item_append_text(item, "%s", " (MEID configured)"); + str = ""; + proto_item_append_text(item, "%s", " (MEID configured)"); } else { - str = "not "; + str = "not "; } other_decode_bitfield_value(bigbuf, value, 0x0200, 16); proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, + tvb, offset, 2, "%s : MEID %sconfigured", bigbuf, - str); + str); other_decode_bitfield_value(bigbuf, value, 0x0100, 16); proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, + tvb, offset, 2, "%s : 25 MHz Bandwidth", bigbuf); other_decode_bitfield_value(bigbuf, value, 0x0080, 16); proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, + tvb, offset, 2, "%s : %s Transmission", bigbuf, (value & 0x0080) ? "Discontinuous" : "Continuous"); @@ -819,7 +816,7 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x0060, 16); proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, + tvb, offset, 2, "%s : Power Class for Band Class 0 Analog Operation: %s", bigbuf, str); @@ -830,25 +827,25 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x1fe0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Mobile station protocol revision number (MOB_P_REV) (%u)", - bigbuf, - (value & 0x1fe0) >> 5); + tvb, offset, 2, + "%s : Mobile station protocol revision number (MOB_P_REV) (%u)", + bigbuf, + (value & 0x1fe0) >> 5); other_decode_bitfield_value(bigbuf, value, 0x10, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 1, 1, - "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", - bigbuf, - (value & 0x10) >> 4); + tvb, offset + 1, 1, + "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", + bigbuf, + (value & 0x10) >> 4); other_decode_bitfield_value(bigbuf, value, 0x0e, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 1, 1, - "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", - bigbuf, - (value & 0x0e) >> 1, - (value & 0x10) ? ((value & 0x0e) >> 1) + 4 : 0); + tvb, offset + 1, 1, + "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", + bigbuf, + (value & 0x0e) >> 1, + (value & 0x10) ? ((value & 0x0e) >> 1) + 4 : 0); offset++; @@ -856,21 +853,21 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x01ff80, 24); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : Mobile country code (MCC_M)", - bigbuf); + tvb, offset, 3, + "%s : Mobile country code (MCC_M)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x7f, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 2, 1, - "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", - bigbuf); + tvb, offset + 2, 1, + "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", + bigbuf); offset += 3; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 5, - "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); + tvb, offset, 5, + "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); offset += 4; @@ -878,22 +875,22 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x3c, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Access overload class (ACCOLC) (%u)", - bigbuf, - (value & 0x3c) >> 2); + tvb, offset, 1, + "%s : Access overload class (ACCOLC) (%u)", + bigbuf, + (value & 0x3c) >> 2); other_decode_bitfield_value(bigbuf, value, 0x02, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Local control status (LOCAL_CONTROL)", - bigbuf); + tvb, offset, 1, + "%s : Local control status (LOCAL_CONTROL)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x01, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Termination indicator for the home system (MOB_TERM_HOME)", - bigbuf); + tvb, offset, 1, + "%s : Termination indicator for the home system (MOB_TERM_HOME)", + bigbuf); offset++; @@ -901,24 +898,24 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x80, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", - bigbuf); + tvb, offset, 1, + "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x40, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", - bigbuf); + tvb, offset, 1, + "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", + bigbuf); value = tvb_get_ntohs(tvb, offset); other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Maximum stored SID/NID pairs (MAX_SID_NID) (%u)", - bigbuf, - (value & 0x3fc0) >> 6); + tvb, offset, 2, + "%s : Maximum stored SID/NID pairs (MAX_SID_NID) (%u)", + bigbuf, + (value & 0x3fc0) >> 6); offset++; @@ -928,22 +925,22 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Number of stored SID/NID pairs (STORED_SID_NID) (%u)", - bigbuf, - count); + tvb, offset, 2, + "%s : Number of stored SID/NID pairs (STORED_SID_NID) (%u)", + bigbuf, + count); other_decode_bitfield_value(bigbuf, value, 0x003f, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : SID/NID pairs (MSB)", - bigbuf); + tvb, offset, 2, + "%s : SID/NID pairs (MSB)", + bigbuf); offset += 2; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, len - (offset - saved_offset), - "SID/NID pairs, Reserved"); + tvb, offset, len - (offset - saved_offset), + "SID/NID pairs, Reserved"); } /* @@ -953,8 +950,8 @@ rev_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin static void param_block_nam_mdn(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 saved_offset; - guint32 value, count, i; + guint32 saved_offset; + guint32 value, count, i; saved_offset = offset; @@ -964,37 +961,37 @@ param_block_nam_mdn(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, value, 0xf0, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Number of digits (N_DIGITS) (%u)", - bigbuf, - count); + tvb, offset, 1, + "%s : Number of digits (N_DIGITS) (%u)", + bigbuf, + count); for (i=0; i < count; i++) { - bigbuf[i] = dtmf_digits[(value & 0x0f)]; - - if ((i + 1) < count) - { - offset++; - value = tvb_get_guint8(tvb, offset); - bigbuf[i+1] = dtmf_digits[(value & 0xf0) >> 4]; - i++; - } + bigbuf[i] = dtmf_digits[(value & 0x0f)]; + + if ((i + 1) < count) + { + offset++; + value = tvb_get_guint8(tvb, offset); + bigbuf[i+1] = dtmf_digits[(value & 0xf0) >> 4]; + i++; + } } bigbuf[i] = '\0'; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, saved_offset, len, - "Mobile directory number, %s", - bigbuf); + tvb, saved_offset, len, + "Mobile directory number, %s", + bigbuf); if (!(count & 0x01)) { - other_decode_bitfield_value(bigbuf, value, 0x0f, 8); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + other_decode_bitfield_value(bigbuf, value, 0x0f, 8); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Reserved", + bigbuf); } } @@ -1004,9 +1001,9 @@ param_block_nam_mdn(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 saved_offset; - guint32 value; - guint32 count; + guint32 saved_offset; + guint32 value; + guint32 count; saved_offset = offset; @@ -1014,21 +1011,21 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0xc0, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + tvb, offset, 1, + "%s : Reserved", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x20, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Slotted Mode", - bigbuf); + tvb, offset, 1, + "%s : Slotted Mode", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x1f, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + tvb, offset, 1, + "%s : Reserved", + bigbuf); offset++; @@ -1036,10 +1033,10 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0xff, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Mobile station protocol revision number (MOB_P_REV) (%u)", - bigbuf, - value); + tvb, offset, 1, + "%s : Mobile station protocol revision number (MOB_P_REV) (%u)", + bigbuf, + value); offset++; @@ -1047,24 +1044,24 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x8000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", - bigbuf, - (value & 0x8000) >> 15); + tvb, offset, 2, + "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", + bigbuf, + (value & 0x8000) >> 15); other_decode_bitfield_value(bigbuf, value, 0x7000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", - bigbuf, - (value & 0x7000) >> 12, - (value & 0x8000) ? ((value & 0x7000) >> 12) + 4 : 0); + tvb, offset, 2, + "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", + bigbuf, + (value & 0x7000) >> 12, + (value & 0x8000) ? ((value & 0x7000) >> 12) + 4 : 0); other_decode_bitfield_value(bigbuf, value, 0x0ffc, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Mobile country code (MCC_M)", - bigbuf); + tvb, offset, 2, + "%s : Mobile country code (MCC_M)", + bigbuf); offset++; @@ -1072,15 +1069,15 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x3f80, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", - bigbuf); + tvb, offset, 2, + "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", + bigbuf); offset++; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 5, - "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); + tvb, offset, 5, + "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); offset += 4; @@ -1088,34 +1085,34 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x01e0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Access overload class (ACCOLC) (%u)", - bigbuf, - (value & 0x01e0) >> 5); + tvb, offset, 2, + "%s : Access overload class (ACCOLC) (%u)", + bigbuf, + (value & 0x01e0) >> 5); other_decode_bitfield_value(bigbuf, value, 0x0010, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Local control status (LOCAL_CONTROL)", - bigbuf); + tvb, offset, 2, + "%s : Local control status (LOCAL_CONTROL)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x0008, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for the home system (MOB_TERM_HOME)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for the home system (MOB_TERM_HOME)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x0004, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x0002, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", + bigbuf); offset++; @@ -1123,10 +1120,10 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x01fe, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Maximum stored SID/NID pairs (MAX_SID_NID) (%u)", - bigbuf, - (value & 0x01fe) >> 1); + tvb, offset, 2, + "%s : Maximum stored SID/NID pairs (MAX_SID_NID) (%u)", + bigbuf, + (value & 0x01fe) >> 1); offset++; @@ -1136,22 +1133,22 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x01fe, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Number of stored SID/NID pairs (STORED_SID_NID) (%u)", - bigbuf, - count); + tvb, offset, 2, + "%s : Number of stored SID/NID pairs (STORED_SID_NID) (%u)", + bigbuf, + count); other_decode_bitfield_value(bigbuf, value, 0x0001, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : SID/NID pairs (MSB)", - bigbuf); + tvb, offset, 2, + "%s : SID/NID pairs (MSB)", + bigbuf); offset += 2; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, len - (offset - saved_offset), - "SID/NID pairs, Reserved"); + tvb, offset, len - (offset - saved_offset), + "SID/NID pairs, Reserved"); } /* @@ -1161,32 +1158,32 @@ rev_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off static void param_block_nam_imsi_t(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 offset) { - guint32 value; + guint32 value; value = tvb_get_guint8(tvb, offset); other_decode_bitfield_value(bigbuf, value, 0x80, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : IMSI_T Class assignment of the mobile station (IMSI_T_CLASS), Class %u", - bigbuf, - (value & 0x80) >> 7); + tvb, offset, 1, + "%s : IMSI_T Class assignment of the mobile station (IMSI_T_CLASS), Class %u", + bigbuf, + (value & 0x80) >> 7); other_decode_bitfield_value(bigbuf, value, 0x70, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Number of IMSI_T address digits (IMSI_T_ADDR_NUM ) (%u), %u digits in NMSI", - bigbuf, - (value & 0x70) >> 4, - (value & 0x80) ? ((value & 0x70) >> 4) + 4 : 0); + tvb, offset, 1, + "%s : Number of IMSI_T address digits (IMSI_T_ADDR_NUM ) (%u), %u digits in NMSI", + bigbuf, + (value & 0x70) >> 4, + (value & 0x80) ? ((value & 0x70) >> 4) + 4 : 0); value = tvb_get_ntohs(tvb, offset); other_decode_bitfield_value(bigbuf, value, 0x0ffc, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Mobile country code (MCC_T)", - bigbuf); + tvb, offset, 2, + "%s : Mobile country code (MCC_T)", + bigbuf); offset++; @@ -1194,15 +1191,15 @@ param_block_nam_imsi_t(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 o other_decode_bitfield_value(bigbuf, value, 0x03f8, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : 11th and 12th digits of the IMSI_T (IMSI__T_11_12)", - bigbuf); + tvb, offset, 2, + "%s : 11th and 12th digits of the IMSI_T (IMSI__T_11_12)", + bigbuf); offset++; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 5, - "The least significant 10 digits of the IMSI_T (IMSI_T_S) (34 bits)"); + tvb, offset, 5, + "The least significant 10 digits of the IMSI_T (IMSI_T_S) (34 bits)"); offset += 4; @@ -1210,9 +1207,9 @@ param_block_nam_imsi_t(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 o other_decode_bitfield_value(bigbuf, value, 0x01, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + tvb, offset, 1, + "%s : Reserved", + bigbuf); } /* @@ -1221,9 +1218,9 @@ param_block_nam_imsi_t(tvbuff_t *tvb, proto_tree *tree, guint len _U_, guint32 o static void for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 saved_offset; - guint32 value; - guint32 count; + guint32 saved_offset; + guint32 value; + guint32 count; saved_offset = offset; @@ -1231,10 +1228,10 @@ for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0xffe0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : First paging channel (FIRSTCHP) used in the home system (%u)", - bigbuf, - (value & 0xffe0) >> 5); + tvb, offset, 2, + "%s : First paging channel (FIRSTCHP) used in the home system (%u)", + bigbuf, + (value & 0xffe0) >> 5); offset++; @@ -1242,31 +1239,31 @@ for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x1fffc0, 24); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : Home system identification (HOME_SID) (%u)", - bigbuf, - (value & 0x1fffc0) >> 6); + tvb, offset, 3, + "%s : Home system identification (HOME_SID) (%u)", + bigbuf, + (value & 0x1fffc0) >> 6); other_decode_bitfield_value(bigbuf, value, 0x20, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 2, 1, - "%s : Extended address indicator (EX)", - bigbuf); + tvb, offset + 2, 1, + "%s : Extended address indicator (EX)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x10, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 2, 1, - "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", - bigbuf, - (value & 0x10) >> 4); + tvb, offset + 2, 1, + "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", + bigbuf, + (value & 0x10) >> 4); other_decode_bitfield_value(bigbuf, value, 0x0e, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 2, 1, - "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", - bigbuf, - (value & 0x0e) >> 1, - (value & 0x10) ? ((value & 0x0e) >> 1) + 4 : 0); + tvb, offset + 2, 1, + "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", + bigbuf, + (value & 0x0e) >> 1, + (value & 0x10) ? ((value & 0x0e) >> 1) + 4 : 0); offset += 2; @@ -1274,21 +1271,21 @@ for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x01ff80, 24); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : Mobile country code (MCC_M)", - bigbuf); + tvb, offset, 3, + "%s : Mobile country code (MCC_M)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x7f, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 2, 1, - "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", - bigbuf); + tvb, offset + 2, 1, + "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", + bigbuf); offset += 3; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 5, - "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); + tvb, offset, 5, + "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); offset += 4; @@ -1296,22 +1293,22 @@ for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x3c, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Access overload class (ACCOLC) (%u)", - bigbuf, - (value & 0x3c) >> 2); + tvb, offset, 1, + "%s : Access overload class (ACCOLC) (%u)", + bigbuf, + (value & 0x3c) >> 2); other_decode_bitfield_value(bigbuf, value, 0x02, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Local control status (LOCAL_CONTROL)", - bigbuf); + tvb, offset, 1, + "%s : Local control status (LOCAL_CONTROL)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x01, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Termination indicator for the home system (MOB_TERM_HOME)", - bigbuf); + tvb, offset, 1, + "%s : Termination indicator for the home system (MOB_TERM_HOME)", + bigbuf); offset++; @@ -1319,36 +1316,36 @@ for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin other_decode_bitfield_value(bigbuf, value, 0x8000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x4000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", + bigbuf); count = (value & 0x3fc0) >> 6; other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Number of SID/NID pairs (N_SID_NID) (%u)", - bigbuf, - count); + tvb, offset, 2, + "%s : Number of SID/NID pairs (N_SID_NID) (%u)", + bigbuf, + count); other_decode_bitfield_value(bigbuf, value, 0x003f, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : SID/NID pairs (MSB)", - bigbuf); + tvb, offset, 2, + "%s : SID/NID pairs (MSB)", + bigbuf); offset += 2; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, len - (offset - saved_offset), - "SID/NID pairs, Reserved"); + tvb, offset, len - (offset - saved_offset), + "SID/NID pairs, Reserved"); } /* @@ -1362,9 +1359,9 @@ for_param_block_nam_cdma_analog(tvbuff_t *tvb, proto_tree *tree, guint len, guin static void for_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 saved_offset; - guint32 value; - guint32 count; + guint32 saved_offset; + guint32 value; + guint32 count; saved_offset = offset; @@ -1372,24 +1369,24 @@ for_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x8000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", - bigbuf, - (value & 0x8000) >> 15); + tvb, offset, 2, + "%s : IMSI_M Class assignment of the mobile station (IMSI_M_CLASS), Class %u", + bigbuf, + (value & 0x8000) >> 15); other_decode_bitfield_value(bigbuf, value, 0x7000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", - bigbuf, - (value & 0x7000) >> 12, - (value & 0x8000) ? ((value & 0x7000) >> 12) + 4 : 0); + tvb, offset, 2, + "%s : Number of IMSI_M address digits (IMSI_M_ADDR_NUM) (%u), %u digits in NMSI", + bigbuf, + (value & 0x7000) >> 12, + (value & 0x8000) ? ((value & 0x7000) >> 12) + 4 : 0); other_decode_bitfield_value(bigbuf, value, 0x0ffc, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Mobile country code (MCC_M)", - bigbuf); + tvb, offset, 2, + "%s : Mobile country code (MCC_M)", + bigbuf); offset++; @@ -1397,15 +1394,15 @@ for_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x3f80, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", - bigbuf); + tvb, offset, 2, + "%s : 11th and 12th digits of the IMSI_M (IMSI__M_11_12)", + bigbuf); offset++; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 5, - "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); + tvb, offset, 5, + "The least significant 10 digits of the IMSI_M (IMSI_M_S) (34 bits)"); offset += 4; @@ -1413,34 +1410,34 @@ for_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x01e0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Access overload class (ACCOLC) (%u)", - bigbuf, - (value & 0x01e0) >> 5); + tvb, offset, 2, + "%s : Access overload class (ACCOLC) (%u)", + bigbuf, + (value & 0x01e0) >> 5); other_decode_bitfield_value(bigbuf, value, 0x0010, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Local control status (LOCAL_CONTROL)", - bigbuf); + tvb, offset, 2, + "%s : Local control status (LOCAL_CONTROL)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x0008, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for the home system (MOB_TERM_HOME)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for the home system (MOB_TERM_HOME)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x0004, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for SID roaming (MOB_TERM_FOR_SID)", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x0002, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", - bigbuf); + tvb, offset, 2, + "%s : Termination indicator for NID roaming (MOB_TERM_FOR_NID)", + bigbuf); offset++; @@ -1450,22 +1447,22 @@ for_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off other_decode_bitfield_value(bigbuf, value, 0x01fe, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Number of SID/NID pairs (N_SID_NID) (%u)", - bigbuf, - count); + tvb, offset, 2, + "%s : Number of SID/NID pairs (N_SID_NID) (%u)", + bigbuf, + count); other_decode_bitfield_value(bigbuf, value, 0x0001, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : SID/NID pairs (MSB)", - bigbuf); + tvb, offset, 2, + "%s : SID/NID pairs (MSB)", + bigbuf); offset += 2; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, len - (offset - saved_offset), - "SID/NID pairs, Reserved"); + tvb, offset, len - (offset - saved_offset), + "SID/NID pairs, Reserved"); } /* @@ -1480,8 +1477,8 @@ for_param_block_nam_cdma(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 off static void for_param_block_val_spc(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 saved_offset; - guint32 value; + guint32 saved_offset; + guint32 value; EXACT_DATA_CHECK(len, 3); @@ -1501,9 +1498,9 @@ for_param_block_val_spc(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs bigbuf[6] = '\0'; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, saved_offset, len, - "Service programming code: %s", - bigbuf); + tvb, saved_offset, len, + "Service programming code: %s", + bigbuf); } /* @@ -1512,68 +1509,68 @@ for_param_block_val_spc(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs static void for_param_block_val_spasm(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 value; + guint32 value; if (len == 1) { - value = tvb_get_guint8(tvb, offset); - - other_decode_bitfield_value(bigbuf, value, 0x80, 8); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : OTAPA SPASM validation signature %sincluded indicator", - bigbuf, - (value & 0x80) ? "" : "not "); - - other_decode_bitfield_value(bigbuf, value, 0x40, 8); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : %s SPASM protection for the active NAM", - bigbuf, - (value & 0x40) ? "Activate" : "Do not activate"); - - other_decode_bitfield_value(bigbuf, value, 0x3f, 8); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); - - offset++; + value = tvb_get_guint8(tvb, offset); + + other_decode_bitfield_value(bigbuf, value, 0x80, 8); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s : OTAPA SPASM validation signature %sincluded indicator", + bigbuf, + (value & 0x80) ? "" : "not "); + + other_decode_bitfield_value(bigbuf, value, 0x40, 8); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s : %s SPASM protection for the active NAM", + bigbuf, + (value & 0x40) ? "Activate" : "Do not activate"); + + other_decode_bitfield_value(bigbuf, value, 0x3f, 8); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Reserved", + bigbuf); + + offset++; } else { - EXACT_DATA_CHECK(len, 3); - - value = tvb_get_ntoh24(tvb, offset); - - other_decode_bitfield_value(bigbuf, value, 0x800000, 24); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : OTAPA SPASM validation signature %sincluded indicator", - bigbuf, - (value & 0x800000) ? "" : "not "); - - other_decode_bitfield_value(bigbuf, value, 0x7fffe0, 24); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : OTAPA SPASM validation signature (0x%x)", - bigbuf, - (value & 0x7fffe0) >> 5); - - other_decode_bitfield_value(bigbuf, value, 0x000010, 24); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : %s SPASM protection for the active NAM", - bigbuf, - (value & 0x000010) ? "Activate" : "Do not activate"); - - other_decode_bitfield_value(bigbuf, value, 0x00000f, 24); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : Reserved", - bigbuf); - - offset += 3; + EXACT_DATA_CHECK(len, 3); + + value = tvb_get_ntoh24(tvb, offset); + + other_decode_bitfield_value(bigbuf, value, 0x800000, 24); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 3, + "%s : OTAPA SPASM validation signature %sincluded indicator", + bigbuf, + (value & 0x800000) ? "" : "not "); + + other_decode_bitfield_value(bigbuf, value, 0x7fffe0, 24); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 3, + "%s : OTAPA SPASM validation signature (0x%x)", + bigbuf, + (value & 0x7fffe0) >> 5); + + other_decode_bitfield_value(bigbuf, value, 0x000010, 24); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 3, + "%s : %s SPASM protection for the active NAM", + bigbuf, + (value & 0x000010) ? "Activate" : "Do not activate"); + + other_decode_bitfield_value(bigbuf, value, 0x00000f, 24); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 3, + "%s : Reserved", + bigbuf); + + offset += 3; } } @@ -1585,9 +1582,9 @@ for_param_block_val_spasm(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 of static void msg_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -1596,9 +1593,9 @@ msg_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -1606,18 +1603,18 @@ msg_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_param_block_nam(oct); + str = rev_param_block_nam(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -1629,11 +1626,11 @@ msg_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 block_id, num_blocks, block_len; - const gchar *str = NULL; - proto_tree *subtree; - proto_item *item; - guint32 i, saved_offset; + guint8 block_id, num_blocks, block_len; + const gchar *str = NULL; + proto_tree *subtree; + proto_item *item; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -1642,76 +1639,76 @@ msg_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = for_param_block_nam(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_for_nam_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case FOR_BLOCK_NAM_CDMA_ANALOG: - for_param_block_nam_cdma_analog(tvb, subtree, block_len, offset); - break; - - case FOR_BLOCK_NAM_MDN: - param_block_nam_mdn(tvb, subtree, block_len, offset); - break; - - case FOR_BLOCK_NAM_CDMA: - for_param_block_nam_cdma(tvb, subtree, block_len, offset); - break; - - case FOR_BLOCK_NAM_IMSI_T: - param_block_nam_imsi_t(tvb, subtree, block_len, offset); - break; - - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } + block_id = tvb_get_guint8(tvb, offset); + + str = for_param_block_nam(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_for_nam_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case FOR_BLOCK_NAM_CDMA_ANALOG: + for_param_block_nam_cdma_analog(tvb, subtree, block_len, offset); + break; + + case FOR_BLOCK_NAM_MDN: + param_block_nam_mdn(tvb, subtree, block_len, offset); + break; + + case FOR_BLOCK_NAM_CDMA: + for_param_block_nam_cdma(tvb, subtree, block_len, offset); + break; + + case FOR_BLOCK_NAM_IMSI_T: + param_block_nam_imsi_t(tvb, subtree, block_len, offset); + break; + + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -1723,11 +1720,11 @@ msg_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_ms_key_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 akey_prev, param_len; - proto_tree *subtree; - proto_item *item; - guint32 saved_offset; - const gchar *str = NULL; + guint8 akey_prev, param_len; + proto_tree *subtree; + proto_item *item; + guint32 saved_offset; + const gchar *str = NULL; SHORT_DATA_CHECK(len, 1); @@ -1745,53 +1742,53 @@ msg_ms_key_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) } proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "A-Key Protocol Revision (%u): %s", - akey_prev, - str); + tvb, offset, 1, + "A-Key Protocol Revision (%u): %s", + akey_prev, + str); offset++; if (akey_prev < 0x03) { - param_len = tvb_get_guint8(tvb, offset); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, param_len + 1, - "Key exchange parameter P"); - subtree = proto_item_add_subtree(item, ett_key_p); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, param_len); - offset++; - - if (param_len > 0) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, param_len, - "Parameter P"); - offset += param_len; - } - - param_len = tvb_get_guint8(tvb, offset); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, param_len + 1, - "Key exchange parameter G"); - subtree = proto_item_add_subtree(item, ett_key_g); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, param_len); - offset++; - - if (param_len > 0) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, param_len, - "Parameter G"); - offset += param_len; - } + param_len = tvb_get_guint8(tvb, offset); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, param_len + 1, + "Key exchange parameter P"); + subtree = proto_item_add_subtree(item, ett_key_p); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, param_len); + offset++; + + if (param_len > 0) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, param_len, + "Parameter P"); + offset += param_len; + } + + param_len = tvb_get_guint8(tvb, offset); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, param_len + 1, + "Key exchange parameter G"); + subtree = proto_item_add_subtree(item, ett_key_g); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, param_len); + offset++; + + if (param_len > 0) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, param_len, + "Parameter G"); + offset += param_len; + } } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -1803,8 +1800,8 @@ msg_ms_key_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_key_gen_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 param_len; - guint32 saved_offset; + guint8 param_len; + guint32 saved_offset; SHORT_DATA_CHECK(len, 2); @@ -1813,17 +1810,17 @@ msg_key_gen_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) param_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_ansi_683_length, - tvb, offset, 1, param_len); + tvb, offset, 1, param_len); offset++; SHORT_DATA_CHECK((len - (offset - saved_offset)), param_len); if (param_len > 0) { - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, param_len, - "Base Station Calculation Result"); - offset += param_len; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, param_len, + "Base Station Calculation Result"); + offset += param_len; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -1839,8 +1836,8 @@ msg_reauth_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) EXACT_DATA_CHECK(len, 4); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 4, - "Random Challenge value"); + tvb, offset, 4, + "Random Challenge value"); } /* @@ -1854,33 +1851,33 @@ msg_reauth_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_protocap_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 i, saved_offset; - guint8 oct, num_cap; - const gchar *str = NULL; + guint32 i, saved_offset; + guint8 oct, num_cap; + const gchar *str = NULL; if (len == 0) { - /* - * if the base station did not request new cap info OR - * this is an earlier release - */ - return; + /* + * if the base station did not request new cap info OR + * this is an earlier release + */ + return; } saved_offset = offset; proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "OTASP protocol revision"); + tvb, offset, 1, + "OTASP protocol revision"); offset++; num_cap = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of Capability Records (%u)", - num_cap); + tvb, offset, 1, + "Number of Capability Records (%u)", + num_cap); offset++; @@ -1888,18 +1885,18 @@ msg_protocap_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_cap; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_cap_info_record_type(oct); + str = rev_cap_info_record_type(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -1911,12 +1908,12 @@ msg_protocap_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_sspr_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; - guint32 saved_offset; - guint32 value; - proto_tree *subtree; - proto_item *item; + guint8 oct; + const gchar *str = NULL; + guint32 saved_offset; + guint32 value; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -1927,40 +1924,40 @@ msg_sspr_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_param_block_sspr(oct); item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); offset++; if (oct == REV_BLOCK_SSPR_PRL) { - subtree = proto_item_add_subtree(item, ett_rev_sspr_block); - - if ((len - (offset - saved_offset)) < 3) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - value = tvb_get_ntohs(tvb, offset); - - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, - "Segment offset (%u)", - value); - offset += 2; - - oct = tvb_get_guint8(tvb, offset); - - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "Maximum segment size (%u)", - oct); - offset++; + subtree = proto_item_add_subtree(item, ett_rev_sspr_block); + + if ((len - (offset - saved_offset)) < 3) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + value = tvb_get_ntohs(tvb, offset); + + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 2, + "Segment offset (%u)", + value); + offset += 2; + + oct = tvb_get_guint8(tvb, offset); + + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "Maximum segment size (%u)", + oct); + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -1972,11 +1969,11 @@ msg_sspr_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_sspr_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_len; - const gchar *str = NULL; - guint32 saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_len; + const gchar *str = NULL; + guint32 saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 2); @@ -1987,11 +1984,11 @@ msg_sspr_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset str = for_param_block_sspr(oct); item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); subtree = proto_item_add_subtree(item, ett_for_sspr_block); offset++; @@ -1999,27 +1996,27 @@ msg_sspr_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset block_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); + tvb, offset, 1, block_len); offset++; if (block_len > (len - (offset - saved_offset))) { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; } if (block_len > 0) { - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - offset += block_len; + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + offset += block_len; } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2031,11 +2028,11 @@ msg_sspr_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_validate_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 block_id, num_blocks, block_len; - const gchar *str = NULL; - proto_tree *subtree; - proto_item *item; - guint32 i, saved_offset, block_offset; + guint8 block_id, num_blocks, block_len; + const gchar *str = NULL; + proto_tree *subtree; + proto_item *item; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2044,9 +2041,9 @@ msg_validate_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -2054,57 +2051,56 @@ msg_validate_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - block_offset = offset; - block_id = tvb_get_guint8(tvb, offset); - - str = for_param_block_val(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_for_val_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case FOR_BLOCK_VAL_VERIFY_SPC: - case FOR_BLOCK_VAL_CHANGE_SPC: - for_param_block_val_spc(tvb, subtree, block_len, offset); - break; - - case FOR_BLOCK_VAL_VALDATE_SPASM: - for_param_block_val_spasm(tvb, subtree, block_len, offset); - break; - - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } + block_id = tvb_get_guint8(tvb, offset); + + str = for_param_block_val(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_for_val_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case FOR_BLOCK_VAL_VERIFY_SPC: + case FOR_BLOCK_VAL_CHANGE_SPC: + for_param_block_val_spc(tvb, subtree, block_len, offset); + break; + + case FOR_BLOCK_VAL_VALDATE_SPASM: + for_param_block_val_spasm(tvb, subtree, block_len, offset); + break; + + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2116,7 +2112,7 @@ msg_validate_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_otapa_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; + guint8 oct; EXACT_DATA_CHECK(len, 1); @@ -2124,16 +2120,16 @@ msg_otapa_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, oct, 0x80, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : %s OTAPA session", - bigbuf, - (oct & 0x80) ? "Start" : "Stop"); + tvb, offset, 1, + "%s : %s OTAPA session", + bigbuf, + (oct & 0x80) ? "Start" : "Stop"); other_decode_bitfield_value(bigbuf, oct, 0x7f, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + tvb, offset, 1, + "%s : Reserved", + bigbuf); offset++; } @@ -2144,11 +2140,11 @@ msg_otapa_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_puzl_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_len; - const gchar *str = NULL; - guint32 saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_len; + const gchar *str = NULL; + guint32 saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -2159,21 +2155,21 @@ msg_puzl_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_param_block_puzl(oct); item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); block_len = len - (offset - saved_offset); if (block_len > 0) { - subtree = proto_item_add_subtree(item, ett_rev_puzl_block); + subtree = proto_item_add_subtree(item, ett_rev_puzl_block); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - offset += block_len; + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + offset += block_len; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2185,11 +2181,11 @@ msg_puzl_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_puzl_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 block_id, num_blocks, block_len; - const gchar *str = NULL; - proto_tree *subtree; - proto_item *item; - guint32 i, saved_offset; + guint8 block_id, num_blocks, block_len; + const gchar *str = NULL; + proto_tree *subtree; + proto_item *item; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2198,65 +2194,65 @@ msg_puzl_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = for_param_block_puzl(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_for_puzl_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case FOR_BLOCK_PUZL_UZ_INS: - case FOR_BLOCK_PUZL_UZ_UPD: - case FOR_BLOCK_PUZL_UZ_DEL: - case FOR_BLOCK_PUZL_UZ_PRI_CHANGE: - case FOR_BLOCK_PUZL_FLAGS: - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } + block_id = tvb_get_guint8(tvb, offset); + + str = for_param_block_puzl(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_for_puzl_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case FOR_BLOCK_PUZL_UZ_INS: + case FOR_BLOCK_PUZL_UZ_UPD: + case FOR_BLOCK_PUZL_UZ_DEL: + case FOR_BLOCK_PUZL_UZ_PRI_CHANGE: + case FOR_BLOCK_PUZL_FLAGS: + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2268,9 +2264,9 @@ msg_puzl_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_3gpd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2279,9 +2275,9 @@ msg_3gpd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -2289,18 +2285,18 @@ msg_3gpd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_param_block_3gpd(oct); + str = rev_param_block_3gpd(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2312,11 +2308,11 @@ msg_3gpd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_3gpd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 block_id, num_blocks, block_len; - const gchar *str = NULL; - proto_tree *subtree; - proto_item *item; - guint32 i, saved_offset; + guint8 block_id, num_blocks, block_len; + const gchar *str = NULL; + proto_tree *subtree; + proto_item *item; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2325,70 +2321,70 @@ msg_3gpd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = for_param_block_3gpd(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_for_3gpd_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case FOR_BLOCK_3GPD_OP_MODE: - case FOR_BLOCK_3GPD_SIP_USER_PRO: - case FOR_BLOCK_3GPD_MIP_USER_PRO: - case FOR_BLOCK_3GPD_SIP_STATUS: - case FOR_BLOCK_3GPD_MIP_STATUS: - case FOR_BLOCK_3GPD_SIP_PAP_SS: - case FOR_BLOCK_3GPD_SIP_CHAP_SS: - case FOR_BLOCK_3GPD_MIP_SS: - case FOR_BLOCK_3GPD_HRPD_ACC_AUTH_USER: - case FOR_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS: - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } + block_id = tvb_get_guint8(tvb, offset); + + str = for_param_block_3gpd(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_for_3gpd_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case FOR_BLOCK_3GPD_OP_MODE: + case FOR_BLOCK_3GPD_SIP_USER_PRO: + case FOR_BLOCK_3GPD_MIP_USER_PRO: + case FOR_BLOCK_3GPD_SIP_STATUS: + case FOR_BLOCK_3GPD_MIP_STATUS: + case FOR_BLOCK_3GPD_SIP_PAP_SS: + case FOR_BLOCK_3GPD_SIP_CHAP_SS: + case FOR_BLOCK_3GPD_MIP_SS: + case FOR_BLOCK_3GPD_HRPD_ACC_AUTH_USER: + case FOR_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS: + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2400,9 +2396,9 @@ msg_3gpd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_secure_mode_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; - guint32 saved_offset; + guint8 oct; + const gchar *str = NULL; + guint32 saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2412,49 +2408,49 @@ msg_secure_mode_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, oct, 0x80, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : %s Secure Mode", - bigbuf, - (oct & 0x80) ? "Start" : "Stop"); + tvb, offset, 1, + "%s : %s Secure Mode", + bigbuf, + (oct & 0x80) ? "Start" : "Stop"); if (oct & 0x80) { - switch ((oct & 0x78) >> 3) - { - case 0x0: str = "SMCK generation using SSD_A and SSD_B"; break; - case 0x1: str = "SMCK generation using 3G Root Key"; break; - default: str = "Key in use indicator"; break; - } + switch ((oct & 0x78) >> 3) + { + case 0x0: str = "SMCK generation using SSD_A and SSD_B"; break; + case 0x1: str = "SMCK generation using 3G Root Key"; break; + default: str = "Key in use indicator"; break; + } } else { - str = "Key in use indicator"; + str = "Key in use indicator"; } other_decode_bitfield_value(bigbuf, oct, 0x78, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : %s", - bigbuf, - str); + tvb, offset, 1, + "%s : %s", + bigbuf, + str); other_decode_bitfield_value(bigbuf, oct, 0x07, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + tvb, offset, 1, + "%s : Reserved", + bigbuf); offset++; if (oct & 0x80) { - SHORT_DATA_CHECK(len, 8); + SHORT_DATA_CHECK(len, 8); - proto_tree_add_text(tree, - tvb, offset, 8, - "Random Number used for SMCK generation"); + proto_tree_add_text(tree, + tvb, offset, 8, + "Random Number used for SMCK generation"); - offset += 8; + offset += 8; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2471,9 +2467,9 @@ msg_secure_mode_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mmd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2482,9 +2478,9 @@ msg_mmd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -2492,18 +2488,18 @@ msg_mmd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_param_block_mmd(oct); + str = rev_param_block_mmd(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2515,11 +2511,11 @@ msg_mmd_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mmd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 block_id, num_blocks, block_len; - const gchar *str = NULL; - proto_tree *subtree; - proto_item *item; - guint32 i, saved_offset; + guint8 block_id, num_blocks, block_len; + const gchar *str = NULL; + proto_tree *subtree; + proto_item *item; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2528,61 +2524,61 @@ msg_mmd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = for_param_block_mmd(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_for_mmd_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case FOR_BLOCK_MMD_APP: - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } + block_id = tvb_get_guint8(tvb, offset); + + str = for_param_block_mmd(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_for_mmd_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case FOR_BLOCK_MMD_APP: + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2594,12 +2590,12 @@ msg_mmd_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_systag_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; - guint32 saved_offset; - guint32 value; - proto_tree *subtree; - proto_item *item; + guint8 oct; + const gchar *str = NULL; + guint32 saved_offset; + guint32 value; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -2610,45 +2606,45 @@ msg_systag_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset str = rev_param_block_systag(oct); item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); offset++; /* * possible values, but unclear in spec - * REV_BLOCK_SYSTAG_HOME_SYSTAG - * REV_BLOCK_SYSTAG_GROUP_TAG_LIST_DIM - * REV_BLOCK_SYSTAG_GROUP_TAG_LIST - * REV_BLOCK_SYSTAG_SPEC_TAG_LIST_DIM - * REV_BLOCK_SYSTAG_SPEC_TAG_LIST - * REV_BLOCK_SYSTAG_CALL_PROMPT_LIST_DIM - * REV_BLOCK_SYSTAG_CALL_PROMPT_LIST + * REV_BLOCK_SYSTAG_HOME_SYSTAG + * REV_BLOCK_SYSTAG_GROUP_TAG_LIST_DIM + * REV_BLOCK_SYSTAG_GROUP_TAG_LIST + * REV_BLOCK_SYSTAG_SPEC_TAG_LIST_DIM + * REV_BLOCK_SYSTAG_SPEC_TAG_LIST + * REV_BLOCK_SYSTAG_CALL_PROMPT_LIST_DIM + * REV_BLOCK_SYSTAG_CALL_PROMPT_LIST */ if (len > (offset - saved_offset)) { - SHORT_DATA_CHECK(len, 3); + SHORT_DATA_CHECK(len, 3); - subtree = proto_item_add_subtree(item, ett_segment); + subtree = proto_item_add_subtree(item, ett_segment); - value = tvb_get_ntohs(tvb, offset); + value = tvb_get_ntohs(tvb, offset); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 2, - "Segment offset (%u)", - value); - offset += 2; + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 2, + "Segment offset (%u)", + value); + offset += 2; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "Maximum segment size (%u)", - oct); - offset++; + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "Maximum segment size (%u)", + oct); + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2660,9 +2656,9 @@ msg_systag_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_systag_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_len; - const gchar *str = NULL; - guint32 saved_offset; + guint8 oct, block_len; + const gchar *str = NULL; + guint32 saved_offset; SHORT_DATA_CHECK(len, 2); @@ -2673,26 +2669,26 @@ msg_systag_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs str = for_param_block_systag(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + tvb, offset, 1, + "%s (%u)", + str, + oct); offset++; block_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_ansi_683_length, - tvb, offset, 1, block_len); + tvb, offset, 1, block_len); offset++; SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len); if (block_len > 0) { - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - offset += block_len; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + offset += block_len; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2705,8 +2701,8 @@ msg_systag_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs static void msg_srvckey_gen_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 saved_offset; - guint32 value; + guint32 saved_offset; + guint32 value; SHORT_DATA_CHECK(len, 2); @@ -2716,33 +2712,33 @@ msg_srvckey_gen_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, value, 0x8000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Key ID: IMS Root Key", - bigbuf); + tvb, offset, 2, + "%s : Key ID: IMS Root Key", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x4000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Key ID: BCMCS Root Key", - bigbuf); + tvb, offset, 2, + "%s : Key ID: BCMCS Root Key", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x2000, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Key ID: WLAN Root Key", - bigbuf); + tvb, offset, 2, + "%s : Key ID: WLAN Root Key", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x1ff0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Key ID: Reserved", - bigbuf); + tvb, offset, 2, + "%s : Key ID: Reserved", + bigbuf); other_decode_bitfield_value(bigbuf, value, 0x000f, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Reserved", - bigbuf); + tvb, offset, 2, + "%s : Reserved", + bigbuf); offset += 2; @@ -2755,9 +2751,9 @@ msg_srvckey_gen_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mms_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2766,9 +2762,9 @@ msg_mms_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -2776,18 +2772,18 @@ msg_mms_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_param_block_mms(oct); + str = rev_param_block_mms(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2799,11 +2795,11 @@ msg_mms_config_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mms_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 block_id, num_blocks, block_len; - const gchar *str = NULL; - proto_tree *subtree; - proto_item *item; - guint32 i, saved_offset; + guint8 block_id, num_blocks, block_len; + const gchar *str = NULL; + proto_tree *subtree; + proto_item *item; + guint32 i, saved_offset; SHORT_DATA_CHECK(len, 1); @@ -2812,61 +2808,61 @@ msg_mms_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = for_param_block_mms(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_for_mms_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case FOR_BLOCK_MMS_URI: - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } + block_id = tvb_get_guint8(tvb, offset); + + str = for_param_block_mms(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_for_mms_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case FOR_BLOCK_MMS_URI: + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2880,11 +2876,11 @@ msg_mms_download_req(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id, num_blocks, block_len; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_id, num_blocks, block_len; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -2893,9 +2889,9 @@ msg_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -2903,86 +2899,86 @@ msg_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = rev_param_block_nam(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_rev_nam_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case REV_BLOCK_NAM_CDMA_ANALOG: - rev_param_block_nam_cdma_analog(tvb, subtree, block_len, offset); - break; - - case REV_BLOCK_NAM_MDN: - param_block_nam_mdn(tvb, subtree, block_len, offset); - break; - - case REV_BLOCK_NAM_CDMA: - rev_param_block_nam_cdma(tvb, subtree, block_len, offset); - break; - - case REV_BLOCK_NAM_IMSI_T: - param_block_nam_imsi_t(tvb, subtree, block_len, offset); - break; - - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } + block_id = tvb_get_guint8(tvb, offset); + + str = rev_param_block_nam(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_rev_nam_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case REV_BLOCK_NAM_CDMA_ANALOG: + rev_param_block_nam_cdma_analog(tvb, subtree, block_len, offset); + break; + + case REV_BLOCK_NAM_MDN: + param_block_nam_mdn(tvb, subtree, block_len, offset); + break; + + case REV_BLOCK_NAM_CDMA: + rev_param_block_nam_cdma(tvb, subtree, block_len, offset); + break; + + case REV_BLOCK_NAM_IMSI_T: + param_block_nam_imsi_t(tvb, subtree, block_len, offset); + break; + + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } } SHORT_DATA_CHECK((len - (offset - saved_offset)), num_blocks); for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - offset++; + offset++; } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2994,11 +2990,11 @@ msg_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -3007,9 +3003,9 @@ msg_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -3017,32 +3013,32 @@ msg_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = for_param_block_nam(oct); + str = for_param_block_nam(oct); - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - subtree = proto_item_add_subtree(item, ett_for_nam_block); - offset++; + subtree = proto_item_add_subtree(item, ett_for_nam_block); + offset++; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3054,8 +3050,8 @@ msg_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_ms_key_rsp(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); @@ -3064,10 +3060,10 @@ msg_ms_key_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Key exchange result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "Key exchange result code, %s (%u)", + str, + oct); offset++; } @@ -3078,9 +3074,9 @@ msg_ms_key_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_key_gen_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, result_len; - const gchar *str = NULL; - guint32 saved_offset; + guint8 oct, result_len; + const gchar *str = NULL; + guint32 saved_offset; SHORT_DATA_CHECK(len, 2); @@ -3091,26 +3087,26 @@ msg_key_gen_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Key exchange result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "Key exchange result code, %s (%u)", + str, + oct); offset++; result_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_ansi_683_length, - tvb, offset, 1, result_len); + tvb, offset, 1, result_len); offset++; SHORT_DATA_CHECK((len - (offset - saved_offset)), result_len); if (result_len > 0) { - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, result_len, "Mobile station calculation result"); - offset += result_len; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, result_len, "Mobile station calculation result"); + offset += result_len; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3122,7 +3118,7 @@ msg_key_gen_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_reauth_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint32 value; + guint32 value; EXACT_DATA_CHECK(len, 7); @@ -3130,10 +3126,10 @@ msg_reauth_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, value, 0xffffc0, 24); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : Authentication signature data (AUTHR) (%u)", - bigbuf, - (value & 0xffffc0) >> 6); + tvb, offset, 3, + "%s : Authentication signature data (AUTHR) (%u)", + bigbuf, + (value & 0xffffc0) >> 6); offset += 2; @@ -3141,17 +3137,17 @@ msg_reauth_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, value, 0x3fc0, 16); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Random challenge value (RANDC) (%u)", - bigbuf, - (value & 0x3fc0) >> 6); + tvb, offset, 2, + "%s : Random challenge value (RANDC) (%u)", + bigbuf, + (value & 0x3fc0) >> 6); other_decode_bitfield_value(bigbuf, value, 0x3f, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset + 1, 1, - "%s : Call history parameter (COUNT) (%u)", - bigbuf, - value & 0x3f); + tvb, offset + 1, 1, + "%s : Call history parameter (COUNT) (%u)", + bigbuf, + value & 0x3f); offset += 2; @@ -3159,10 +3155,10 @@ msg_reauth_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, value, 0xffffff, 24); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 3, - "%s : Authentication Data input parameter (AUTH_DATA) (%u)", - bigbuf, - value); + tvb, offset, 3, + "%s : Authentication Data input parameter (AUTH_DATA) (%u)", + bigbuf, + value); } /* @@ -3171,8 +3167,8 @@ msg_reauth_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_commit_rsp(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); @@ -3181,10 +3177,10 @@ msg_commit_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Data commit result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "Data commit result code, %s (%u)", + str, + oct); offset++; } @@ -3195,12 +3191,12 @@ msg_commit_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_feat, add_len; - const gchar *str = NULL; - guint32 i, saved_offset; - guint32 value; - proto_tree *subtree; - proto_item *item; + guint8 oct, num_feat, add_len; + const gchar *str = NULL; + guint32 i, saved_offset; + guint32 value; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 5); @@ -3209,27 +3205,27 @@ msg_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) value = tvb_get_ntohs(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "Mobile station firmware revision number (%u)", - value); + tvb, offset, 2, + "Mobile station firmware revision number (%u)", + value); offset += 2; oct = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Mobile station manufacturer's model number (%u)", - oct); + tvb, offset, 1, + "Mobile station manufacturer's model number (%u)", + oct); offset++; num_feat = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of features (%u)", - num_feat); + tvb, offset, 1, + "Number of features (%u)", + num_feat); offset++; @@ -3237,95 +3233,95 @@ msg_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_feat; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_feat_id_type(oct); + str = rev_feat_id_type(oct); - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: Feature ID, %s (%u)", - i+1, - str, - oct); + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: Feature ID, %s (%u)", + i+1, + str, + oct); - subtree = proto_item_add_subtree(item, ett_rev_feat); - offset++; + subtree = proto_item_add_subtree(item, ett_rev_feat); + offset++; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "Feature protocol version (%u)", - oct); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "Feature protocol version (%u)", + oct); - offset++; + offset++; } add_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_ansi_683_length, - tvb, offset, 1, add_len); + tvb, offset, 1, add_len); offset++; SHORT_DATA_CHECK((len - (offset - saved_offset)), add_len); if (add_len > 0) { - oct = tvb_get_guint8(tvb, offset); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Band/Mode Capability Information"); - - subtree = proto_item_add_subtree(item, ett_band_cap); - - other_decode_bitfield_value(bigbuf, oct, 0x80, 8); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Band Class 0 Analog", - bigbuf); - - other_decode_bitfield_value(bigbuf, oct, 0x40, 8); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Band Class 0 CDMA", - bigbuf); - - other_decode_bitfield_value(bigbuf, oct, 0x20, 8); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Band Class 1 CDMA", - bigbuf); - - other_decode_bitfield_value(bigbuf, oct, 0x10, 8); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Band Class 3 CDMA", - bigbuf); - - other_decode_bitfield_value(bigbuf, oct, 0x08, 8); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Band Class 6 CDMA", - bigbuf); - - other_decode_bitfield_value(bigbuf, oct, 0x07, 8); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); - - offset++; - - if (add_len > 1) - { - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, add_len - 1, - "More Additional Fields"); - offset += (add_len - 1); - } + oct = tvb_get_guint8(tvb, offset); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "Band/Mode Capability Information"); + + subtree = proto_item_add_subtree(item, ett_band_cap); + + other_decode_bitfield_value(bigbuf, oct, 0x80, 8); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Band Class 0 Analog", + bigbuf); + + other_decode_bitfield_value(bigbuf, oct, 0x40, 8); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Band Class 0 CDMA", + bigbuf); + + other_decode_bitfield_value(bigbuf, oct, 0x20, 8); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Band Class 1 CDMA", + bigbuf); + + other_decode_bitfield_value(bigbuf, oct, 0x10, 8); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Band Class 3 CDMA", + bigbuf); + + other_decode_bitfield_value(bigbuf, oct, 0x08, 8); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Band Class 6 CDMA", + bigbuf); + + other_decode_bitfield_value(bigbuf, oct, 0x07, 8); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Reserved", + bigbuf); + + offset++; + + if (add_len > 1) + { + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, add_len - 1, + "More Additional Fields"); + offset += (add_len - 1); + } } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3337,9 +3333,9 @@ msg_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_sspr_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_len; - const gchar *str = NULL; - guint32 saved_offset; + guint8 oct, block_len; + const gchar *str = NULL; + guint32 saved_offset; SHORT_DATA_CHECK(len, 3); @@ -3350,10 +3346,10 @@ msg_sspr_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_param_block_sspr(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + tvb, offset, 1, + "%s (%u)", + str, + oct); offset++; @@ -3362,32 +3358,32 @@ msg_sspr_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "SSPR Configuration result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "SSPR Configuration result code, %s (%u)", + str, + oct); offset++; block_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_ansi_683_length, - tvb, offset, 1, block_len); + tvb, offset, 1, block_len); offset++; SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len); if (block_len > 0) { - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - offset += block_len; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + offset += block_len; } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3399,9 +3395,9 @@ msg_sspr_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_sspr_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id; - const gchar *str = NULL; - guint32 value; + guint8 oct, block_id; + const gchar *str = NULL; + guint32 value; EXACT_DATA_CHECK(len, 5); @@ -3410,10 +3406,10 @@ msg_sspr_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset str = for_param_block_sspr(block_id); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - block_id); + tvb, offset, 1, + "%s (%u)", + str, + block_id); offset++; @@ -3422,10 +3418,10 @@ msg_sspr_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "SSPR Download result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "SSPR Download result code, %s (%u)", + str, + oct); offset++; @@ -3433,22 +3429,22 @@ msg_sspr_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset { case FOR_BLOCK_SSPR_PRL: case FOR_BLOCK_SSPR_EXT_PRL: - value = tvb_get_ntohs(tvb, offset); - - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "Segment offset (%u)", - value); - offset += 2; - - oct = tvb_get_guint8(tvb, offset); - - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Maximum segment size (%u)", - oct); - offset++; - break; + value = tvb_get_ntohs(tvb, offset); + + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "Segment offset (%u)", + value); + offset += 2; + + oct = tvb_get_guint8(tvb, offset); + + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "Maximum segment size (%u)", + oct); + offset++; + break; } } @@ -3458,11 +3454,11 @@ msg_sspr_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_validate_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_id, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -3471,9 +3467,9 @@ msg_validate_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -3481,32 +3477,32 @@ msg_validate_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); + block_id = tvb_get_guint8(tvb, offset); - str = for_param_block_val(block_id); + str = for_param_block_val(block_id); - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); - subtree = proto_item_add_subtree(item, ett_for_val_block); - offset++; + subtree = proto_item_add_subtree(item, ett_for_val_block); + offset++; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3518,9 +3514,9 @@ msg_validate_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_otapa_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; - const gchar *str = NULL; - guint32 saved_offset; + guint8 oct; + const gchar *str = NULL; + guint32 saved_offset; SHORT_DATA_CHECK(len, 2); @@ -3531,10 +3527,10 @@ msg_otapa_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%d)", - str, - oct); + tvb, offset, 1, + "%s (%d)", + str, + oct); offset++; @@ -3542,26 +3538,26 @@ msg_otapa_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) other_decode_bitfield_value(bigbuf, oct, 0xfe, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); + tvb, offset, 1, + "%s : Reserved", + bigbuf); other_decode_bitfield_value(bigbuf, oct, 0x01, 8); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : NAM_LOCK indicator", - bigbuf); + tvb, offset, 1, + "%s : NAM_LOCK indicator", + bigbuf); offset++; if (oct & 0x01) { - SHORT_DATA_CHECK((len - (offset - saved_offset)), 4); + SHORT_DATA_CHECK((len - (offset - saved_offset)), 4); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 4, - "SPASM random challenge"); - offset += 4; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 4, + "SPASM random challenge"); + offset += 4; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3573,9 +3569,9 @@ msg_otapa_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_puzl_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_len; - const gchar *str = NULL; - guint32 saved_offset; + guint8 oct, block_len; + const gchar *str = NULL; + guint32 saved_offset; SHORT_DATA_CHECK(len, 3); @@ -3586,10 +3582,10 @@ msg_puzl_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_param_block_puzl(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + tvb, offset, 1, + "%s (%u)", + str, + oct); offset++; @@ -3598,32 +3594,32 @@ msg_puzl_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "PUZL Configuration result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "PUZL Configuration result code, %s (%u)", + str, + oct); offset++; block_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_ansi_683_length, - tvb, offset, 1, block_len); + tvb, offset, 1, block_len); offset++; SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len); if (block_len > 0) { - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - offset += block_len; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + offset += block_len; } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3635,12 +3631,12 @@ msg_puzl_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_puzl_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; - guint32 value, temp_value; + guint8 oct, block_id, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; + guint32 value, temp_value; SHORT_DATA_CHECK(len, 1); @@ -3649,9 +3645,9 @@ msg_puzl_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -3660,90 +3656,90 @@ msg_puzl_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = for_param_block_puzl(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_for_puzl_block); - offset++; - - oct = tvb_get_guint8(tvb, offset); - - str = rev_res_code_type(oct); - - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); - - offset++; - - oct = tvb_get_guint8(tvb, offset); - - if (oct & 0x80) - { - SHORT_DATA_CHECK(len, 4); - - value = tvb_get_ntohs(tvb, offset); - - other_decode_bitfield_value(bigbuf, value, 0x8000, 16); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : Identifiers present", - bigbuf); - - other_decode_bitfield_value(bigbuf, value, 0x7fff, 16); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : User Zone ID (MSB)", - bigbuf); - - offset += 2; - - temp_value = (value & 0x7fff) << 1; - value = tvb_get_ntohs(tvb, offset); - - other_decode_bitfield_value(bigbuf, value, 0x8000, 16); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : User Zone ID (%u)", - bigbuf, - temp_value + ((value & 0x8000) >> 15)); - - other_decode_bitfield_value(bigbuf, value, 0x7fff, 16); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "%s : User Zone SID (%u)", - bigbuf, - (value & 0x7fff)); - - offset += 2; - } - else - { - other_decode_bitfield_value(bigbuf, oct, 0x80, 8); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Identifiers not present", - bigbuf); - - other_decode_bitfield_value(bigbuf, oct, 0x7f, 8); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s : Reserved", - bigbuf); - - offset++; - } + block_id = tvb_get_guint8(tvb, offset); + + str = for_param_block_puzl(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_for_puzl_block); + offset++; + + oct = tvb_get_guint8(tvb, offset); + + str = rev_res_code_type(oct); + + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); + + offset++; + + oct = tvb_get_guint8(tvb, offset); + + if (oct & 0x80) + { + SHORT_DATA_CHECK(len, 4); + + value = tvb_get_ntohs(tvb, offset); + + other_decode_bitfield_value(bigbuf, value, 0x8000, 16); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "%s : Identifiers present", + bigbuf); + + other_decode_bitfield_value(bigbuf, value, 0x7fff, 16); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "%s : User Zone ID (MSB)", + bigbuf); + + offset += 2; + + temp_value = (value & 0x7fff) << 1; + value = tvb_get_ntohs(tvb, offset); + + other_decode_bitfield_value(bigbuf, value, 0x8000, 16); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "%s : User Zone ID (%u)", + bigbuf, + temp_value + ((value & 0x8000) >> 15)); + + other_decode_bitfield_value(bigbuf, value, 0x7fff, 16); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "%s : User Zone SID (%u)", + bigbuf, + (value & 0x7fff)); + + offset += 2; + } + else + { + other_decode_bitfield_value(bigbuf, oct, 0x80, 8); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Identifiers not present", + bigbuf); + + other_decode_bitfield_value(bigbuf, oct, 0x7f, 8); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s : Reserved", + bigbuf); + + offset++; + } } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3755,11 +3751,11 @@ msg_puzl_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_3gpd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id, num_blocks, block_len; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_id, num_blocks, block_len; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -3768,9 +3764,9 @@ msg_3gpd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -3779,80 +3775,80 @@ msg_3gpd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = rev_param_block_3gpd(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_rev_3gpd_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { - case REV_BLOCK_3GPD_OP_CAP: - case REV_BLOCK_3GPD_OP_MODE: - case REV_BLOCK_3GPD_SIP_CAP: - case REV_BLOCK_3GPD_MIP_CAP: - case REV_BLOCK_3GPD_SIP_USER_PRO: - case REV_BLOCK_3GPD_MIP_USER_PRO: - case REV_BLOCK_3GPD_SIP_STATUS: - case REV_BLOCK_3GPD_MIP_STATUS: - case REV_BLOCK_3GPD_SIP_PAP_SS: - case REV_BLOCK_3GPD_SIP_CHAP_SS: - case REV_BLOCK_3GPD_MIP_SS: - case REV_BLOCK_3GPD_HRPD_ACC_AUTH_CAP: - case REV_BLOCK_3GPD_HRPD_ACC_AUTH_USER: - case REV_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS: - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } - - offset += block_len; - } - - SHORT_DATA_CHECK(len, 1); - - oct = tvb_get_guint8(tvb, offset); - - str = rev_res_code_type(oct); - - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); - - offset++; + block_id = tvb_get_guint8(tvb, offset); + + str = rev_param_block_3gpd(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_rev_3gpd_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { + case REV_BLOCK_3GPD_OP_CAP: + case REV_BLOCK_3GPD_OP_MODE: + case REV_BLOCK_3GPD_SIP_CAP: + case REV_BLOCK_3GPD_MIP_CAP: + case REV_BLOCK_3GPD_SIP_USER_PRO: + case REV_BLOCK_3GPD_MIP_USER_PRO: + case REV_BLOCK_3GPD_SIP_STATUS: + case REV_BLOCK_3GPD_MIP_STATUS: + case REV_BLOCK_3GPD_SIP_PAP_SS: + case REV_BLOCK_3GPD_SIP_CHAP_SS: + case REV_BLOCK_3GPD_MIP_SS: + case REV_BLOCK_3GPD_HRPD_ACC_AUTH_CAP: + case REV_BLOCK_3GPD_HRPD_ACC_AUTH_USER: + case REV_BLOCK_3GPD_HRPD_ACC_AUTH_CHAP_SS: + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } + + offset += block_len; + } + + SHORT_DATA_CHECK(len, 1); + + oct = tvb_get_guint8(tvb, offset); + + str = rev_res_code_type(oct); + + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); + + offset++; } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3864,11 +3860,11 @@ msg_3gpd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_3gpd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -3877,9 +3873,9 @@ msg_3gpd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -3887,32 +3883,32 @@ msg_3gpd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = for_param_block_3gpd(oct); + str = for_param_block_3gpd(oct); - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - subtree = proto_item_add_subtree(item, ett_for_3gpd_block); - offset++; + subtree = proto_item_add_subtree(item, ett_for_3gpd_block); + offset++; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -3924,8 +3920,8 @@ msg_3gpd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_secure_mode_rsp(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); @@ -3934,10 +3930,10 @@ msg_secure_mode_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Secure Mode result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "Secure Mode result code, %s (%u)", + str, + oct); offset++; } @@ -3948,12 +3944,12 @@ msg_secure_mode_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_ext_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id, num_recs, block_len; - const gchar *str = NULL; - guint32 i, saved_offset; - guint32 value; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_id, num_recs, block_len; + const gchar *str = NULL; + guint32 i, saved_offset; + guint32 value; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 6); @@ -3962,36 +3958,36 @@ msg_ext_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) oct = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "OTASP Mobile Protocol Revision (%u)", - oct); + tvb, offset, 1, + "OTASP Mobile Protocol Revision (%u)", + oct); offset++; value = tvb_get_ntohs(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "Mobile station firmware revision number (%u)", - value); + tvb, offset, 2, + "Mobile station firmware revision number (%u)", + value); offset += 2; oct = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Mobile station manufacturer's model number (%u)", - oct); + tvb, offset, 1, + "Mobile station manufacturer's model number (%u)", + oct); offset++; num_recs = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of features (%u)", - num_recs); + tvb, offset, 1, + "Number of features (%u)", + num_recs); offset++; @@ -3999,29 +3995,29 @@ msg_ext_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_recs; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_feat_id_type(oct); + str = rev_feat_id_type(oct); - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: Feature ID, %s (%u)", - i+1, - str, - oct); + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: Feature ID, %s (%u)", + i+1, + str, + oct); - subtree = proto_item_add_subtree(item, ett_rev_feat); - offset++; + subtree = proto_item_add_subtree(item, ett_rev_feat); + offset++; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "Feature protocol version (%u)", - oct); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "Feature protocol version (%u)", + oct); - offset++; + offset++; } SHORT_DATA_CHECK((len - (offset - saved_offset)), 1); @@ -4029,9 +4025,9 @@ msg_ext_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_recs = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of Capability Records (%u)", - num_recs); + tvb, offset, 1, + "Number of Capability Records (%u)", + num_recs); offset++; @@ -4040,56 +4036,56 @@ msg_ext_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_recs; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = rev_cap_info_record_type(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_rev_cap); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { + block_id = tvb_get_guint8(tvb, offset); + + str = rev_cap_info_record_type(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_rev_cap); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { #ifdef MLUM - case REV_TYPE_CAP_INFO_OP_MODE: - case REV_TYPE_CAP_INFO_CDMA_BAND: - case REV_TYPE_CAP_INFO_MEID: - case REV_TYPE_CAP_INFO_ICCID: - case REV_TYPE_CAP_INFO_EXT_UIM_ID: - rev_param_block_mmd_app(tvb, subtree, block_len, offset); - break; + case REV_TYPE_CAP_INFO_OP_MODE: + case REV_TYPE_CAP_INFO_CDMA_BAND: + case REV_TYPE_CAP_INFO_MEID: + case REV_TYPE_CAP_INFO_ICCID: + case REV_TYPE_CAP_INFO_EXT_UIM_ID: + rev_param_block_mmd_app(tvb, subtree, block_len, offset); + break; #endif - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Capability Data"); - break; - } + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Capability Data"); + break; + } - offset += block_len; - } + offset += block_len; + } } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -4101,11 +4097,11 @@ msg_ext_protocap_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mmd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id, num_blocks, block_len; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_id, num_blocks, block_len; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -4114,9 +4110,9 @@ msg_mmd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -4125,72 +4121,72 @@ msg_mmd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = rev_param_block_mmd(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_rev_mmd_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { + block_id = tvb_get_guint8(tvb, offset); + + str = rev_param_block_mmd(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_rev_mmd_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { #ifdef MLUM - case REV_BLOCK_MMD_APP: - rev_param_block_mmd_app(tvb, subtree, block_len, offset); - break; + case REV_BLOCK_MMD_APP: + rev_param_block_mmd_app(tvb, subtree, block_len, offset); + break; #endif - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } - offset += block_len; - } + offset += block_len; + } - SHORT_DATA_CHECK(len, 1); + SHORT_DATA_CHECK(len, 1); - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); - offset++; + offset++; } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -4202,11 +4198,11 @@ msg_mmd_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mmd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -4215,9 +4211,9 @@ msg_mmd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -4225,32 +4221,32 @@ msg_mmd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = for_param_block_mmd(oct); + str = for_param_block_mmd(oct); - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - subtree = proto_item_add_subtree(item, ett_for_mmd_block); - offset++; + subtree = proto_item_add_subtree(item, ett_for_mmd_block); + offset++; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -4262,9 +4258,9 @@ msg_mmd_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_systag_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_len; - const gchar *str = NULL; - guint32 saved_offset; + guint8 oct, block_len; + const gchar *str = NULL; + guint32 saved_offset; SHORT_DATA_CHECK(len, 3); @@ -4275,10 +4271,10 @@ msg_systag_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset str = rev_param_block_systag(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + tvb, offset, 1, + "%s (%u)", + str, + oct); offset++; @@ -4287,26 +4283,26 @@ msg_systag_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "System Tag result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "System Tag result code, %s (%u)", + str, + oct); offset++; block_len = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree, hf_ansi_683_length, - tvb, offset, 1, block_len); + tvb, offset, 1, block_len); offset++; SHORT_DATA_CHECK((len - (offset - saved_offset)), block_len); if (block_len > 0) { - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - offset += block_len; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + offset += block_len; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -4318,10 +4314,10 @@ msg_systag_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void msg_systag_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id; - const gchar *str = NULL; - guint32 saved_offset; - guint32 value; + guint8 oct, block_id; + const gchar *str = NULL; + guint32 saved_offset; + guint32 value; SHORT_DATA_CHECK(len, 2); @@ -4332,10 +4328,10 @@ msg_systag_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs str = for_param_block_systag(block_id); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - block_id); + tvb, offset, 1, + "%s (%u)", + str, + block_id); offset++; @@ -4344,39 +4340,39 @@ msg_systag_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "System Tag Download result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "System Tag Download result code, %s (%u)", + str, + oct); offset++; switch (block_id) { - case 0x01: /* Group Tag List Parameter */ - case 0x02: /* Specific Tag List Parameter */ - case 0x03: /* Call Prompt List Parameter */ - SHORT_DATA_CHECK(len, 3); + case 0x01: /* Group Tag List Parameter */ + case 0x02: /* Specific Tag List Parameter */ + case 0x03: /* Call Prompt List Parameter */ + SHORT_DATA_CHECK(len, 3); - value = tvb_get_ntohs(tvb, offset); + value = tvb_get_ntohs(tvb, offset); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 2, - "Segment offset (%u)", - value); - offset += 2; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 2, + "Segment offset (%u)", + value); + offset += 2; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Segment size (%u)", - oct); - offset++; - break; + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "Segment size (%u)", + oct); + offset++; + break; default: - break; + break; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -4388,8 +4384,8 @@ msg_systag_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offs static void msg_srvckey_gen_rsp(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); @@ -4398,10 +4394,10 @@ msg_srvckey_gen_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) str = rev_res_code_type(oct); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Service Key Generation result code, %s (%u)", - str, - oct); + tvb, offset, 1, + "Service Key Generation result code, %s (%u)", + str, + oct); offset++; } @@ -4412,11 +4408,11 @@ msg_srvckey_gen_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mms_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, block_id, num_blocks, block_len; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, block_id, num_blocks, block_len; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -4425,9 +4421,9 @@ msg_mms_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -4436,76 +4432,76 @@ msg_mms_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - block_id = tvb_get_guint8(tvb, offset); - - str = rev_param_block_mms(block_id); - - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - block_id); - - subtree = proto_item_add_subtree(item, ett_rev_mms_block); - offset++; - - block_len = tvb_get_guint8(tvb, offset); - - proto_tree_add_uint(subtree, hf_ansi_683_length, - tvb, offset, 1, block_len); - offset++; - - if (block_len > (len - (offset - saved_offset))) - { - proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, - offset, len - (offset - saved_offset), "Short Data (?)"); - return; - } - - if (block_len > 0) - { - switch (block_id) - { + block_id = tvb_get_guint8(tvb, offset); + + str = rev_param_block_mms(block_id); + + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + block_id); + + subtree = proto_item_add_subtree(item, ett_rev_mms_block); + offset++; + + block_len = tvb_get_guint8(tvb, offset); + + proto_tree_add_uint(subtree, hf_ansi_683_length, + tvb, offset, 1, block_len); + offset++; + + if (block_len > (len - (offset - saved_offset))) + { + proto_tree_add_none_format(subtree, hf_ansi_683_none, tvb, + offset, len - (offset - saved_offset), "Short Data (?)"); + return; + } + + if (block_len > 0) + { + switch (block_id) + { #ifdef MLUM - case REV_BLOCK_MMS_URI: - rev_param_block_mms_uri(tvb, subtree, block_len, offset); - break; + case REV_BLOCK_MMS_URI: + rev_param_block_mms_uri(tvb, subtree, block_len, offset); + break; - case REV_BLOCK_MMS_URI_CAP: - rev_param_block_mms_uri_cap(tvb, subtree, block_len, offset); - break; + case REV_BLOCK_MMS_URI_CAP: + rev_param_block_mms_uri_cap(tvb, subtree, block_len, offset); + break; #endif - default: - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, block_len, "Block Data"); - break; - } + default: + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, block_len, "Block Data"); + break; + } - offset += block_len; - } + offset += block_len; + } - SHORT_DATA_CHECK(len, 1); + SHORT_DATA_CHECK(len, 1); - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); - offset++; + offset++; } if (len > (offset - saved_offset)) { - offset += - fresh_handler(tvb, tree, len - (offset - saved_offset), offset); + offset += + fresh_handler(tvb, tree, len - (offset - saved_offset), offset); } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -4517,11 +4513,11 @@ msg_mms_config_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) static void msg_mms_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct, num_blocks; - const gchar *str = NULL; - guint32 i, saved_offset; - proto_tree *subtree; - proto_item *item; + guint8 oct, num_blocks; + const gchar *str = NULL; + guint32 i, saved_offset; + proto_tree *subtree; + proto_item *item; SHORT_DATA_CHECK(len, 1); @@ -4530,9 +4526,9 @@ msg_mms_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) num_blocks = tvb_get_guint8(tvb, offset); proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "Number of parameter blocks (%u)", - num_blocks); + tvb, offset, 1, + "Number of parameter blocks (%u)", + num_blocks); offset++; @@ -4540,156 +4536,156 @@ msg_mms_download_rsp(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) for (i=0; i < num_blocks; i++) { - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = for_param_block_mms(oct); + str = for_param_block_mms(oct); - item = - proto_tree_add_none_format(tree, hf_ansi_683_none, - tvb, offset, 1, - "[%u]: %s (%u)", - i+1, - str, - oct); + item = + proto_tree_add_none_format(tree, hf_ansi_683_none, + tvb, offset, 1, + "[%u]: %s (%u)", + i+1, + str, + oct); - subtree = proto_item_add_subtree(item, ett_for_mms_block); - offset++; + subtree = proto_item_add_subtree(item, ett_for_mms_block); + offset++; - oct = tvb_get_guint8(tvb, offset); + oct = tvb_get_guint8(tvb, offset); - str = rev_res_code_type(oct); + str = rev_res_code_type(oct); - proto_tree_add_none_format(subtree, hf_ansi_683_none, - tvb, offset, 1, - "%s (%u)", - str, - oct); + proto_tree_add_none_format(subtree, hf_ansi_683_none, + tvb, offset, 1, + "%s (%u)", + str, + oct); - offset++; + offset++; } EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); } static const value_string for_msg_type_strings[] = { - { 0, "Configuration Request" }, - { 1, "Download Request" }, - { 2, "MS Key Request" }, - { 3, "Key Generation Request" }, - { 4, "Re-Authenticate Request" }, - { 5, "Commit Request" }, - { 6, "Protocol Capability Request" }, - { 7, "SSPR Configuration Request" }, - { 8, "SSPR Download Request" }, - { 9, "Validation Request" }, - { 10, "OTAPA Request" }, - { 11, "PUZL Configuration Request" }, - { 12, "PUZL Download Request" }, - { 13, "3GPD Configuration Request" }, - { 14, "3GPD Download Request" }, - { 15, "Secure Mode Request" }, - { 16, "Reserved" }, - { 17, "MMD Configuration Request" }, - { 18, "MMD Download Request" }, - { 19, "System Tag Configuration Request" }, - { 20, "System Tag Download Request" }, - { 21, "Service Key Generation Request" }, - { 22, "MMS Configuration Request" }, - { 23, "MMS Download Request" }, + { 0, "Configuration Request" }, + { 1, "Download Request" }, + { 2, "MS Key Request" }, + { 3, "Key Generation Request" }, + { 4, "Re-Authenticate Request" }, + { 5, "Commit Request" }, + { 6, "Protocol Capability Request" }, + { 7, "SSPR Configuration Request" }, + { 8, "SSPR Download Request" }, + { 9, "Validation Request" }, + { 10, "OTAPA Request" }, + { 11, "PUZL Configuration Request" }, + { 12, "PUZL Download Request" }, + { 13, "3GPD Configuration Request" }, + { 14, "3GPD Download Request" }, + { 15, "Secure Mode Request" }, + { 16, "Reserved" }, + { 17, "MMD Configuration Request" }, + { 18, "MMD Download Request" }, + { 19, "System Tag Configuration Request" }, + { 20, "System Tag Download Request" }, + { 21, "Service Key Generation Request" }, + { 22, "MMS Configuration Request" }, + { 23, "MMS Download Request" }, { 0, NULL } }; -#define NUM_FOR_MSGS (sizeof(for_msg_type_strings)/sizeof(value_string)) +#define NUM_FOR_MSGS (sizeof(for_msg_type_strings)/sizeof(value_string)) static void (*ansi_683_for_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = { - msg_config_req, /* Configuration Request */ - msg_download_req, /* Download Request */ - msg_ms_key_req, /* MS Key Request */ - msg_key_gen_req, /* Key Generation Request */ - msg_reauth_req, /* Re-Authenticate Request */ - NULL /* No data */, /* Commit Request */ - msg_protocap_req, /* Protocol Capability Request */ - msg_sspr_config_req, /* SSPR Configuration Request */ - msg_sspr_download_req, /* SSPR Download Request */ - msg_validate_req, /* Validation Request */ - msg_otapa_req, /* OTAPA Request */ - msg_puzl_config_req, /* PUZL Configuration Request */ - msg_puzl_download_req, /* PUZL Download Request */ - msg_3gpd_config_req, /* 3GPD Configuration Request */ - msg_3gpd_download_req, /* 3GPD Download Request */ - msg_secure_mode_req, /* Secure Mode Request */ - NULL, /* Reserved */ - msg_mmd_config_req, /* MMD Configuration Request */ - msg_mmd_download_req, /* MMD Download Request */ - msg_systag_config_req, /* System Tag Configuration Request */ - msg_systag_download_req, /* System Tag Download Request */ - msg_srvckey_gen_req, /* Service Key Generation Request */ - msg_mms_config_req, /* MMS Configuration Request */ - msg_mms_download_req, /* MMS Download Request */ - NULL /* NONE */ + msg_config_req, /* Configuration Request */ + msg_download_req, /* Download Request */ + msg_ms_key_req, /* MS Key Request */ + msg_key_gen_req, /* Key Generation Request */ + msg_reauth_req, /* Re-Authenticate Request */ + NULL /* No data */, /* Commit Request */ + msg_protocap_req, /* Protocol Capability Request */ + msg_sspr_config_req, /* SSPR Configuration Request */ + msg_sspr_download_req, /* SSPR Download Request */ + msg_validate_req, /* Validation Request */ + msg_otapa_req, /* OTAPA Request */ + msg_puzl_config_req, /* PUZL Configuration Request */ + msg_puzl_download_req, /* PUZL Download Request */ + msg_3gpd_config_req, /* 3GPD Configuration Request */ + msg_3gpd_download_req, /* 3GPD Download Request */ + msg_secure_mode_req, /* Secure Mode Request */ + NULL, /* Reserved */ + msg_mmd_config_req, /* MMD Configuration Request */ + msg_mmd_download_req, /* MMD Download Request */ + msg_systag_config_req, /* System Tag Configuration Request */ + msg_systag_download_req, /* System Tag Download Request */ + msg_srvckey_gen_req, /* Service Key Generation Request */ + msg_mms_config_req, /* MMS Configuration Request */ + msg_mms_download_req, /* MMS Download Request */ + NULL /* NONE */ }; static const value_string rev_msg_type_strings[] = { - { 0, "Configuration Response" }, - { 1, "Download Response" }, - { 2, "MS Key Response" }, - { 3, "Key Generation Response" }, - { 4, "Re-Authenticate Response" }, - { 5, "Commit Response" }, - { 6, "Protocol Capability Response" }, - { 7, "SSPR Configuration Response" }, - { 8, "SSPR Download Response" }, - { 9, "Validation Response" }, - { 10, "OTAPA Response" }, - { 11, "PUZL Configuration Response" }, - { 12, "PUZL Download Response" }, - { 13, "3GPD Configuration Response" }, - { 14, "3GPD Download Response" }, - { 15, "Secure Mode Response" }, - { 16, "Extended Protocol Capability Response" }, - { 17, "MMD Configuration Response" }, - { 18, "MMD Download Response" }, - { 19, "System Tag Configuration Response" }, - { 20, "System Tag Download Response" }, - { 21, "Service Key Generation Response" }, - { 22, "MMS Configuration Response" }, - { 23, "MMS Download Response" }, + { 0, "Configuration Response" }, + { 1, "Download Response" }, + { 2, "MS Key Response" }, + { 3, "Key Generation Response" }, + { 4, "Re-Authenticate Response" }, + { 5, "Commit Response" }, + { 6, "Protocol Capability Response" }, + { 7, "SSPR Configuration Response" }, + { 8, "SSPR Download Response" }, + { 9, "Validation Response" }, + { 10, "OTAPA Response" }, + { 11, "PUZL Configuration Response" }, + { 12, "PUZL Download Response" }, + { 13, "3GPD Configuration Response" }, + { 14, "3GPD Download Response" }, + { 15, "Secure Mode Response" }, + { 16, "Extended Protocol Capability Response" }, + { 17, "MMD Configuration Response" }, + { 18, "MMD Download Response" }, + { 19, "System Tag Configuration Response" }, + { 20, "System Tag Download Response" }, + { 21, "Service Key Generation Response" }, + { 22, "MMS Configuration Response" }, + { 23, "MMS Download Response" }, { 0, NULL } }; -#define NUM_REV_MSGS (sizeof(rev_msg_type_strings)/sizeof(value_string)) +#define NUM_REV_MSGS (sizeof(rev_msg_type_strings)/sizeof(value_string)) static void (*ansi_683_rev_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) = { - msg_config_rsp, /* Configuration Response */ - msg_download_rsp, /* Download Response */ - msg_ms_key_rsp, /* MS Key Response */ - msg_key_gen_rsp, /* Key Generation Response */ - msg_reauth_rsp, /* Re-Authenticate Response */ - msg_commit_rsp, /* Commit Response */ - msg_protocap_rsp, /* Protocol Capability Response */ - msg_sspr_config_rsp, /* SSPR Configuration Response */ - msg_sspr_download_rsp, /* SSPR Download Response */ - msg_validate_rsp, /* Validation Response */ - msg_otapa_rsp, /* OTAPA Response */ - msg_puzl_config_rsp, /* PUZL Configuration Response */ - msg_puzl_download_rsp, /* PUZL Download Response */ - msg_3gpd_config_rsp, /* 3GPD Configuration Response */ - msg_3gpd_download_rsp, /* 3GPD Download Response */ - msg_secure_mode_rsp, /* Secure Mode Response */ - msg_ext_protocap_rsp, /* Extended Protocol Capability Response */ - msg_mmd_config_rsp, /* MMD Configuration Response */ - msg_mmd_download_rsp, /* MMD Download Response */ - msg_systag_config_rsp, /* System Tag Configuration Response */ - msg_systag_download_rsp, /* System Tag Download Response */ - msg_srvckey_gen_rsp, /* Service Key Generation Response */ - msg_mms_config_rsp, /* MMS Configuration Response */ - msg_mms_download_rsp, /* MMS Download Response */ - NULL /* NONE */ + msg_config_rsp, /* Configuration Response */ + msg_download_rsp, /* Download Response */ + msg_ms_key_rsp, /* MS Key Response */ + msg_key_gen_rsp, /* Key Generation Response */ + msg_reauth_rsp, /* Re-Authenticate Response */ + msg_commit_rsp, /* Commit Response */ + msg_protocap_rsp, /* Protocol Capability Response */ + msg_sspr_config_rsp, /* SSPR Configuration Response */ + msg_sspr_download_rsp, /* SSPR Download Response */ + msg_validate_rsp, /* Validation Response */ + msg_otapa_rsp, /* OTAPA Response */ + msg_puzl_config_rsp, /* PUZL Configuration Response */ + msg_puzl_download_rsp, /* PUZL Download Response */ + msg_3gpd_config_rsp, /* 3GPD Configuration Response */ + msg_3gpd_download_rsp, /* 3GPD Download Response */ + msg_secure_mode_rsp, /* Secure Mode Response */ + msg_ext_protocap_rsp, /* Extended Protocol Capability Response */ + msg_mmd_config_rsp, /* MMD Configuration Response */ + msg_mmd_download_rsp, /* MMD Download Response */ + msg_systag_config_rsp, /* System Tag Configuration Response */ + msg_systag_download_rsp, /* System Tag Download Response */ + msg_srvckey_gen_rsp, /* Service Key Generation Response */ + msg_mms_config_rsp, /* MMS Configuration Response */ + msg_mms_download_rsp, /* MMS Download Response */ + NULL /* NONE */ }; static void dissect_ansi_683_for_message(tvbuff_t *tvb, proto_tree *ansi_683_tree) { - guint8 msg_type; - gint idx; - const gchar *str = NULL; + guint8 msg_type; + gint idx; + const gchar *str = NULL; msg_type = tvb_get_guint8(tvb, 0); @@ -4698,7 +4694,7 @@ dissect_ansi_683_for_message(tvbuff_t *tvb, proto_tree *ansi_683_tree) if (str == NULL) { - return; + return; } /* @@ -4706,20 +4702,20 @@ dissect_ansi_683_for_message(tvbuff_t *tvb, proto_tree *ansi_683_tree) */ proto_tree_add_uint(ansi_683_tree, hf_ansi_683_for_msg_type, - tvb, 0, 1, msg_type); + tvb, 0, 1, msg_type); if (ansi_683_for_msg_fcn[idx] != NULL) { - (*ansi_683_for_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1); + (*ansi_683_for_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1); } } static void dissect_ansi_683_rev_message(tvbuff_t *tvb, proto_tree *ansi_683_tree) { - guint8 msg_type; - gint idx; - const gchar *str = NULL; + guint8 msg_type; + gint idx; + const gchar *str = NULL; msg_type = tvb_get_guint8(tvb, 0); @@ -4728,7 +4724,7 @@ dissect_ansi_683_rev_message(tvbuff_t *tvb, proto_tree *ansi_683_tree) if (str == NULL) { - return; + return; } /* @@ -4736,7 +4732,7 @@ dissect_ansi_683_rev_message(tvbuff_t *tvb, proto_tree *ansi_683_tree) */ proto_tree_add_uint(ansi_683_tree, hf_ansi_683_rev_msg_type, - tvb, 0, 1, msg_type); + tvb, 0, 1, msg_type); (*ansi_683_rev_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1); } @@ -4744,8 +4740,8 @@ dissect_ansi_683_rev_message(tvbuff_t *tvb, proto_tree *ansi_683_tree) static void dissect_ansi_683(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - proto_item *ansi_683_item; - proto_tree *ansi_683_tree = NULL; + proto_item *ansi_683_item; + proto_tree *ansi_683_tree = NULL; g_pinfo = pinfo; @@ -4756,28 +4752,28 @@ dissect_ansi_683(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (tree) { - g_tree = tree; - - /* - * create the ansi_683 protocol tree - */ - ansi_683_item = - proto_tree_add_protocol_format(tree, proto_ansi_683, tvb, 0, -1, - "%s %s Link", - ansi_proto_name, - (pinfo->match_uint == ANSI_683_FORWARD) ? "Forward" : "Reverse"); - - ansi_683_tree = - proto_item_add_subtree(ansi_683_item, ett_ansi_683); - - if (pinfo->match_uint == ANSI_683_FORWARD) - { - dissect_ansi_683_for_message(tvb, ansi_683_tree); - } - else - { - dissect_ansi_683_rev_message(tvb, ansi_683_tree); - } + g_tree = tree; + + /* + * create the ansi_683 protocol tree + */ + ansi_683_item = + proto_tree_add_protocol_format(tree, proto_ansi_683, tvb, 0, -1, + "%s %s Link", + ansi_proto_name, + (pinfo->match_uint == ANSI_683_FORWARD) ? "Forward" : "Reverse"); + + ansi_683_tree = + proto_item_add_subtree(ansi_683_item, ett_ansi_683); + + if (pinfo->match_uint == ANSI_683_FORWARD) + { + dissect_ansi_683_for_message(tvb, ansi_683_tree); + } + else + { + dissect_ansi_683_rev_message(tvb, ansi_683_tree); + } } } @@ -4790,30 +4786,30 @@ proto_register_ansi_683(void) /* Setup list of header fields */ static hf_register_info hf[] = { - { &hf_ansi_683_for_msg_type, - { "Forward Link Message Type", - "ansi_683.for_msg_type", - FT_UINT8, BASE_DEC, VALS(for_msg_type_strings), 0, - NULL, HFILL }}, - { &hf_ansi_683_rev_msg_type, - { "Reverse Link Message Type", - "ansi_683.rev_msg_type", - FT_UINT8, BASE_DEC, VALS(rev_msg_type_strings), 0, - NULL, HFILL }}, - { &hf_ansi_683_length, - { "Length", "ansi_683.len", - FT_UINT8, BASE_DEC, NULL, 0, - NULL, HFILL } - }, - { &hf_ansi_683_none, - { "Sub tree", "ansi_683.none", - FT_NONE, BASE_NONE, 0, 0, - NULL, HFILL } - }, + { &hf_ansi_683_for_msg_type, + { "Forward Link Message Type", + "ansi_683.for_msg_type", + FT_UINT8, BASE_DEC, VALS(for_msg_type_strings), 0, + NULL, HFILL }}, + { &hf_ansi_683_rev_msg_type, + { "Reverse Link Message Type", + "ansi_683.rev_msg_type", + FT_UINT8, BASE_DEC, VALS(rev_msg_type_strings), 0, + NULL, HFILL }}, + { &hf_ansi_683_length, + { "Length", "ansi_683.len", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL } + }, + { &hf_ansi_683_none, + { "Sub tree", "ansi_683.none", + FT_NONE, BASE_NONE, 0, 0, + NULL, HFILL } + }, }; /* Setup protocol subtree array */ -#define NUM_INDIVIDUAL_PARAMS 21 +#define NUM_INDIVIDUAL_PARAMS 21 static gint *ett[NUM_INDIVIDUAL_PARAMS]; memset((void *) ett, 0, sizeof(ett)); @@ -4842,7 +4838,7 @@ proto_register_ansi_683(void) /* Register the protocol name and description */ proto_ansi_683 = - proto_register_protocol(ansi_proto_name, "ANSI IS-683 (OTA (Mobile))", "ansi_683"); + proto_register_protocol(ansi_proto_name, "ANSI IS-683 (OTA (Mobile))", "ansi_683"); /* Required function calls to register the header fields and subtrees used */ proto_register_field_array(proto_ansi_683, hf, array_length(hf)); @@ -4853,7 +4849,7 @@ proto_register_ansi_683(void) void proto_reg_handoff_ansi_683(void) { - dissector_handle_t ansi_683_handle; + dissector_handle_t ansi_683_handle; ansi_683_handle = create_dissector_handle(dissect_ansi_683, proto_ansi_683); |