Add string encoding values for various BCD encodings, and use them.

Add some ENC_ values for various flavors of packed BCD, and use that
instead of explicitly calling tvb_bcd_dig_to_wmem_packet_str() and
adding the result.

Change-Id: I07511d9d09c9231b610c121cd6ffb3b16fb017a9
Reviewed-on: https://code.wireshark.org/review/36952
Reviewed-by: Guy Harris <gharris@sonic.net>
This commit is contained in:
Guy Harris 2020-04-26 16:33:20 -07:00 committed by Guy Harris
parent 94556ca7a2
commit 524baee94f
34 changed files with 274 additions and 316 deletions

View File

@ -1720,6 +1720,7 @@ libwireshark.so.0 libwireshark0 #MINVER#
tvb_free@Base 1.9.1
tvb_free_chain@Base 1.12.0~rc1
tvb_get_ascii_7bits_string@Base 1.12.0~rc1
tvb_get_bcd_string@Base 3.3.0
tvb_get_bits16@Base 1.9.1
tvb_get_bits32@Base 1.9.1
tvb_get_bits64@Base 1.9.1

View File

@ -1748,6 +1748,9 @@ currently supported are:
ENC_CP866 - DOS code page 866
ENC_ASCII_7BITS - 7 bits ASCII
ENC_T61 - ITU T.61
ENC_BCD_DIGITS_0_9 - packed BCD (one digit per nibble), digits 0-9
ENC_KEYPAD_ABC_TBCD - keypad-with-a/b/c "telephony packed BCD" = 0-9, *, #, a, b, c
ENC_KEYPAD_BC_TBCD - keypad-with-B/C "telephony packed BCD" = 0-9, B, C, *, #
Other encodings will be added in the future.

View File

@ -184,7 +184,6 @@ static const ain_err_t ain_err_tab[] = {
#.FN_BODY AINDigits VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb;
proto_tree *subtree;
const char *digit_str;
%(DEFAULT_BODY)s
@ -197,13 +196,11 @@ static const ain_err_t ain_err_tab[] = {
proto_tree_add_item(subtree, hf_ain_numbering_plan, parameter_tvb, 1, 1, ENC_BIG_ENDIAN);
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb,2), NULL, FALSE);
proto_tree_add_string(subtree, hf_ain_bcd_digits, parameter_tvb, 2, -1, digit_str);
proto_tree_add_item(subtree, hf_ain_bcd_digits, parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb, 2), ENC_BCD_DIGITS_0_9);
#.FN_BODY CarrierFormat VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb;
proto_tree *subtree;
const char *digit_str;
%(DEFAULT_BODY)s
@ -218,13 +215,11 @@ static const ain_err_t ain_err_tab[] = {
proto_tree_add_item(subtree, hf_ain_nr_digits, parameter_tvb, 1, 1, ENC_BIG_ENDIAN);
/* 2nd Digit 1st Digit .. */
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb,2), NULL, FALSE);
proto_tree_add_string(subtree, hf_ain_carrier_bcd_digits, parameter_tvb, 2, -1, digit_str);
proto_tree_add_item(subtree, hf_ain_carrier_bcd_digits, parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb, 2), ENC_BCD_DIGITS_0_9);
#.FN_BODY AMAslpID VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb;
proto_tree *subtree;
const char *digit_str;
%(DEFAULT_BODY)s
@ -233,8 +228,7 @@ static const ain_err_t ain_err_tab[] = {
subtree = proto_item_add_subtree(actx->created_item, ett_ain_amaslpid);
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb,0), NULL, FALSE);
proto_tree_add_string(subtree, hf_ain_amaslpid, parameter_tvb, 0, -1, digit_str);
proto_tree_add_item(subtree, hf_ain_amaslpid, parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb, 0), ENC_BCD_DIGITS_0_9);
#.END

View File

@ -544,13 +544,6 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_
static int dissect_returnData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx);
static int dissect_ansi_map_SystemMyTypeCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
'0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
/* Type of Digits (octet 1, bits A-H) */
static const value_string ansi_map_type_of_digits_vals[] = {
{ 0, "Not Used" },
@ -616,7 +609,7 @@ static const value_string ansi_map_np_vals[] = {
static void
dissect_ansi_map_min_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx _U_){
const char *digit_str;
char *digit_str;
int offset = 0;
proto_tree *subtree;
@ -624,8 +617,7 @@ dissect_ansi_map_min_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
subtree = proto_item_add_subtree(actx->created_item, ett_mintype);
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), NULL, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
}
@ -635,7 +627,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
guint8 octet , octet_len;
guint8 b1,b2,b3,b4;
int offset = 0;
const char *digit_str;
char *digit_str;
proto_tree *subtree;
@ -669,8 +661,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if(octet_len == 0)
return;
offset++;
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:
@ -711,8 +702,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
switch ((octet&0xf)){
case 1:
/* BCD Coding */
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:

View File

@ -283,14 +283,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
#.FN_BODY TBCD-STRING VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb;
const char *digit_str;
proto_tree *subtree;
static const dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
'0','1','2','3','4','5','6','7','8','9','*','#','a','b','c', 0
}
};
%(DEFAULT_BODY)s
@ -301,8 +294,7 @@ MAP-DialoguePDU B "0.4.0.0.1.1.1.1" "map-DialogueAS"
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_tbcd_digits);
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 0, -1, &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_gsm_map_TBCD_digits, parameter_tvb, 0, -1, digit_str);
proto_tree_add_item(subtree, hf_gsm_map_TBCD_digits, parameter_tvb, 0, -1, ENC_KEYPAD_ABC_TBCD);
#----------------------------------------------------------------------------------------
#.FN_BODY LongSignalInfo VAL_PTR = &parameter_tvb

View File

@ -1000,7 +1000,6 @@ dissect_cbs_data_coding_scheme(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
void
dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
const char *digit_str;
guint8 octet;
guint8 na;
guint8 np;
@ -1026,8 +1025,7 @@ dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_e164_msisdn(tvb, tree, 1, tvb_reported_length(tvb)-1, E164_ENC_BCD);
break;
default:
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, 1, -1, NULL, FALSE);
proto_tree_add_string(tree, hf_gsm_map_address_digits, tvb, 1, -1, digit_str);
proto_tree_add_item(tree, hf_gsm_map_address_digits, tvb, 1, -1, ENC_BCD_DIGITS_0_9);
break;
}
break;
@ -1036,8 +1034,7 @@ dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_e212_imsi(tvb, pinfo, tree, 1, tvb_reported_length(tvb)-1, FALSE);
break;
default:
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, 1, -1, NULL, FALSE);
proto_tree_add_string(tree, hf_gsm_map_address_digits, tvb, 1, -1, digit_str);
proto_tree_add_item(tree, hf_gsm_map_address_digits, tvb, 1, -1, ENC_BCD_DIGITS_0_9);
break;
}

View File

@ -83,7 +83,7 @@ guint32 IlpMessage;
proto_tree *subtree;
subtree = proto_item_add_subtree(actx->created_item, ett_ilp_setid);
proto_tree_add_string(subtree, hf_ilp_mobile_directory_number, mdn_tvb, 0, 8, tvb_bcd_dig_to_wmem_packet_str(mdn_tvb, 0, 8, NULL, FALSE));
proto_tree_add_item(subtree, hf_ilp_mobile_directory_number, mdn_tvb, 0, 8, ENC_BCD_DIGITS_0_9);
}
#.FN_BODY SETId/imsi VAL_PTR=&imsi_tvb

View File

@ -132,12 +132,6 @@ static const value_string lnpdqp_np_vals[] = {
{ 0, NULL }
};
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
'0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
}
};
/*
* OriginatingStationType ::= OCTET STRING (SIZE(1))
* The following codes are used in the originating line information field:
@ -172,7 +166,7 @@ dissect_lnpdqp_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
guint8 octet , no_of_digits;
int offset = 0;
const char *digit_str;
char *digit_str;
proto_tree *subtree;
@ -199,8 +193,7 @@ dissect_lnpdqp_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
if(no_of_digits == 0)
return;
offset++;
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_lnpdqp_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_lnpdqp_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:

View File

@ -306,7 +306,7 @@ ExtendedEphemeris/validity DISPLAY=BASE_CUSTOM STRINGS=CF_FUNC(ulp_ExtendedEphem
proto_tree *subtree;
subtree = proto_item_add_subtree(actx->created_item, ett_ulp_setid);
proto_tree_add_string(subtree, hf_ulp_mobile_directory_number, mdn_tvb, 0, 8, tvb_bcd_dig_to_wmem_packet_str(mdn_tvb, 0, 8, NULL, FALSE));
proto_tree_add_item(subtree, hf_ulp_mobile_directory_number, mdn_tvb, 0, 8, ENC_BCD_DIGITS_0_9);
}
#.FN_BODY SETId/imsi VAL_PTR=&imsi_tvb

View File

@ -946,7 +946,6 @@ dissect_ain_AINDigits(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
#line 185 "./asn1/ain/ain.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
const char *digit_str;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
@ -961,8 +960,7 @@ dissect_ain_AINDigits(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
proto_tree_add_item(subtree, hf_ain_numbering_plan, parameter_tvb, 1, 1, ENC_BIG_ENDIAN);
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb,2), NULL, FALSE);
proto_tree_add_string(subtree, hf_ain_bcd_digits, parameter_tvb, 2, -1, digit_str);
proto_tree_add_item(subtree, hf_ain_bcd_digits, parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb, 2), ENC_BCD_DIGITS_0_9);
@ -1548,10 +1546,9 @@ dissect_ain_CollectedAddressInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
static int
dissect_ain_CarrierFormat(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 204 "./asn1/ain/ain.cnf"
#line 202 "./asn1/ain/ain.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
const char *digit_str;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
@ -1568,8 +1565,7 @@ dissect_ain_CarrierFormat(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
proto_tree_add_item(subtree, hf_ain_nr_digits, parameter_tvb, 1, 1, ENC_BIG_ENDIAN);
/* 2nd Digit 1st Digit .. */
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb,2), NULL, FALSE);
proto_tree_add_string(subtree, hf_ain_carrier_bcd_digits, parameter_tvb, 2, -1, digit_str);
proto_tree_add_item(subtree, hf_ain_carrier_bcd_digits, parameter_tvb, 2, tvb_reported_length_remaining(parameter_tvb, 2), ENC_BCD_DIGITS_0_9);
@ -3214,10 +3210,9 @@ dissect_ain_SEQUENCE_SIZE_1_2_OF_AMALineNumber(gboolean implicit_tag _U_, tvbuff
static int
dissect_ain_AMAslpID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 225 "./asn1/ain/ain.cnf"
#line 221 "./asn1/ain/ain.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
const char *digit_str;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
@ -3228,8 +3223,7 @@ dissect_ain_AMAslpID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
subtree = proto_item_add_subtree(actx->created_item, ett_ain_amaslpid);
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb,0), NULL, FALSE);
proto_tree_add_string(subtree, hf_ain_amaslpid, parameter_tvb, 0, -1, digit_str);
proto_tree_add_item(subtree, hf_ain_amaslpid, parameter_tvb, 0, tvb_reported_length_remaining(parameter_tvb, 0), ENC_BCD_DIGITS_0_9);

View File

@ -958,8 +958,8 @@ for_param_block_val_spc(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, gui
{
EXACT_DATA_CHECK(len, 3);
proto_tree_add_string(tree, hf_ansi_683_service_programming_code,
tvb, offset, len, tvb_bcd_dig_to_wmem_packet_str(tvb, offset, 3, NULL, FALSE));
proto_tree_add_item(tree, hf_ansi_683_service_programming_code,
tvb, offset, len, ENC_BCD_DIGITS_0_9);
}
/*

View File

@ -1332,13 +1332,6 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_
static int dissect_returnData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx);
static int dissect_ansi_map_SystemMyTypeCode(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, asn1_ctx_t *actx, proto_tree *tree, int hf_index _U_);
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
'0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
/* Type of Digits (octet 1, bits A-H) */
static const value_string ansi_map_type_of_digits_vals[] = {
{ 0, "Not Used" },
@ -1404,7 +1397,7 @@ static const value_string ansi_map_np_vals[] = {
static void
dissect_ansi_map_min_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, asn1_ctx_t *actx _U_){
const char *digit_str;
char *digit_str;
int offset = 0;
proto_tree *subtree;
@ -1412,8 +1405,7 @@ dissect_ansi_map_min_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
subtree = proto_item_add_subtree(actx->created_item, ett_mintype);
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), NULL, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
}
@ -1423,7 +1415,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
guint8 octet , octet_len;
guint8 b1,b2,b3,b4;
int offset = 0;
const char *digit_str;
char *digit_str;
proto_tree *subtree;
@ -1457,8 +1449,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if(octet_len == 0)
return;
offset++;
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:
@ -1499,8 +1490,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
switch ((octet&0xf)){
case 1:
/* BCD Coding */
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:
@ -15261,7 +15251,7 @@ dissect_ansi_map_QualificationRequest2Res(gboolean implicit_tag _U_, tvbuff_t *t
/*--- End of included file: packet-ansi_map-fn.c ---*/
#line 3616 "./asn1/ansi_map/packet-ansi_map-template.c"
#line 3606 "./asn1/ansi_map/packet-ansi_map-template.c"
/*
* 6.5.2.dk N.S0013-0 v 1.0,X.S0004-550-E v1.0 2.301
@ -19209,7 +19199,7 @@ void proto_register_ansi_map(void) {
NULL, HFILL }},
/*--- End of included file: packet-ansi_map-hfarr.c ---*/
#line 5371 "./asn1/ansi_map/packet-ansi_map-template.c"
#line 5361 "./asn1/ansi_map/packet-ansi_map-template.c"
};
/* List of subtrees */
@ -19470,7 +19460,7 @@ void proto_register_ansi_map(void) {
&ett_ansi_map_ReturnData,
/*--- End of included file: packet-ansi_map-ettarr.c ---*/
#line 5404 "./asn1/ansi_map/packet-ansi_map-template.c"
#line 5394 "./asn1/ansi_map/packet-ansi_map-template.c"
};
static ei_register_info ei[] = {

View File

@ -583,15 +583,6 @@ dissect_bssap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
* BSSAP+ Routines
*/
#ifdef REMOVED
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
'0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
#endif
static gboolean
check_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, guint8 expected_ie)
{
@ -895,7 +886,6 @@ dissect_bssap_imei(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree *ie_tree;
guint8 ie_len;
tvbuff_t *ie_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb, offset+1);
item = proto_tree_add_item(tree, hf_bssap_imei_ie, tvb, offset, ie_len+2, ENC_NA);
@ -909,8 +899,7 @@ dissect_bssap_imei(tvbuff_t *tvb, proto_tree *tree, int offset)
* The IMEI consists of 15 digits (see 3GPP TS 23.003).
*/
ie_tvb = tvb_new_subset_length(tvb, offset, ie_len);
digit_str = tvb_bcd_dig_to_wmem_packet_str(ie_tvb, 0, -1, NULL, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_imei, ie_tvb, 0, -1, digit_str);
proto_tree_add_item(ie_tree, hf_bssap_imei, ie_tvb, 0, -1, ENC_BCD_DIGITS_0_9);
return offset + ie_len;
@ -928,7 +917,6 @@ dissect_bssap_imeisv(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree *ie_tree;
guint8 ie_len;
tvbuff_t *ie_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb, offset+1);
item = proto_tree_add_item(tree, hf_bssap_imeisv_ie, tvb, offset, ie_len+2, ENC_NA);
@ -942,8 +930,7 @@ dissect_bssap_imeisv(tvbuff_t *tvb, proto_tree *tree, int offset)
* The IMEISV consists of 16 digits (see 3GPP TS 23.003).
*/
ie_tvb = tvb_new_subset_length(tvb, offset, ie_len);
digit_str = tvb_bcd_dig_to_wmem_packet_str(ie_tvb, 0, -1, NULL, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_imeisv, ie_tvb, 0, -1, digit_str);
proto_tree_add_item(ie_tree, hf_bssap_imeisv, ie_tvb, 0, -1, ENC_BCD_DIGITS_0_9);
return offset + ie_len;
@ -1328,7 +1315,6 @@ dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree *ie_tree;
guint8 ie_len;
tvbuff_t *number_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb, offset+1);
item = proto_tree_add_item(tree, hf_bssap_sgsn_nr_ie, tvb, offset, ie_len+2, ENC_NA);
@ -1349,8 +1335,7 @@ dissect_bssap_sgsn_number(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(ie_tree, hf_bssap_numbering_plan_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
number_tvb = tvb_new_subset_length(tvb, offset, ie_len-1);
digit_str = tvb_bcd_dig_to_wmem_packet_str(number_tvb, 0, -1, NULL, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_sgsn_number, number_tvb, 0, -1, digit_str);
proto_tree_add_item(ie_tree, hf_bssap_sgsn_number, number_tvb, 0, -1, ENC_BCD_DIGITS_0_9);
return offset + ie_len-1;
@ -1479,7 +1464,6 @@ dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree *ie_tree;
guint8 ie_len;
tvbuff_t *number_tvb;
const char *digit_str;
ie_len = tvb_get_guint8(tvb, offset+1);
item = proto_tree_add_item(tree, hf_bssap_vlr_number_ie, tvb, offset, ie_len+2, ENC_NA);
@ -1501,8 +1485,7 @@ dissect_bssap_vlr_number(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(ie_tree, hf_bssap_numbering_plan_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
number_tvb = tvb_new_subset_length(tvb, offset, ie_len - 1);
digit_str = tvb_bcd_dig_to_wmem_packet_str(number_tvb, 0, -1, NULL, FALSE);
proto_tree_add_string(ie_tree, hf_bssap_sgsn_number, number_tvb, 0, -1, digit_str);
proto_tree_add_item(ie_tree, hf_bssap_sgsn_number, number_tvb, 0, -1, ENC_BCD_DIGITS_0_9);
return offset + ie_len - 1;

View File

@ -802,21 +802,22 @@ dissect_e164_msisdn(tvbuff_t *tvb, proto_tree *tree, int offset, int length, e16
{
proto_item *pi;
proto_tree *subtree;
const gchar *msisdn_str;
guint str_encoding;
char *msisdn_str;
switch (encoding) {
case E164_ENC_UTF8:
msisdn_str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_UTF_8);
str_encoding = ENC_UTF_8;
break;
case E164_ENC_BCD:
msisdn_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, length, NULL, FALSE);
str_encoding = ENC_BCD_DIGITS_0_9;
break;
case E164_ENC_BINARY:
default:
DISSECTOR_ASSERT_NOT_REACHED();
}
pi = proto_tree_add_string(tree, hf_E164_number, tvb, offset, length, msisdn_str);
pi = proto_tree_add_item_ret_display_string(tree, hf_E164_number, tvb, offset, length, str_encoding, wmem_packet_scope(), &msisdn_str);
subtree = proto_item_add_subtree(pi, ett_e164_msisdn);

View File

@ -778,13 +778,6 @@ static guint8 epc_test_loop_mode;
#define NUM_GSM_DTAP_ELEM (sizeof(gsm_dtap_elem_strings)/sizeof(value_string))
gint ett_gsm_dtap_elem[NUM_GSM_DTAP_ELEM];
static dgt_set_t Dgt_mbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
'0','1','2','3','4','5','6','7','8','9','*','#','a','b','c','?'
}
};
/*
* [9] 10.5.3.1 Authentication parameter RAND
*/
@ -1183,7 +1176,7 @@ de_emerg_num_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 o
guint8 count;
proto_tree *subtree;
proto_item *item;
const char *digit_str;
char *digit_str;
curr_offset = offset;
@ -1214,8 +1207,7 @@ de_emerg_num_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 o
curr_offset++;
en_len--;
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, curr_offset, en_len, NULL, FALSE);
item = proto_tree_add_string(subtree, hf_gsm_a_dtap_emergency_bcd_num, tvb, curr_offset, en_len, digit_str);
item = proto_tree_add_item_ret_display_string(subtree, hf_gsm_a_dtap_emergency_bcd_num, tvb, curr_offset, en_len, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str);
/* Check for values that aren't digits; they get mapped to '?' */
if(strchr(digit_str,'?')){
@ -2247,7 +2239,7 @@ const value_string gsm_a_dtap_screening_ind_values[] = {
};
static guint16
de_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, int header_field, const gchar **extracted_address)
de_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, int header_field, gchar **extracted_address)
{
guint8 extension;
guint32 curr_offset, num_string_len;
@ -2275,8 +2267,7 @@ de_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
num_string_len = len - (curr_offset - offset);
*extracted_address = tvb_bcd_dig_to_wmem_packet_str(tvb, curr_offset, num_string_len, &Dgt_mbcd, FALSE);
item = proto_tree_add_string(tree, header_field, tvb, curr_offset, num_string_len, *extracted_address);
item = proto_tree_add_item_ret_display_string(tree, header_field, tvb, curr_offset, num_string_len, ENC_KEYPAD_ABC_TBCD, wmem_packet_scope(), extracted_address);
/* Check for an end mark, which gets mapped to '?' */
if(strchr(*extracted_address,'?')){
@ -2371,7 +2362,7 @@ de_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset,
guint16
de_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len)
{
const gchar *extr_addr;
gchar *extr_addr;
de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_cld_party_bcd_num, &extr_addr);
@ -2409,7 +2400,7 @@ de_cld_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint
static guint16
de_clg_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len)
{
const gchar *extr_addr;
gchar *extr_addr;
de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_clg_party_bcd_num, &extr_addr);
@ -2620,7 +2611,7 @@ de_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, gu
static guint16
de_conn_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len)
{
const gchar *extr_addr;
gchar *extr_addr;
de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_conn_num, &extr_addr);
@ -2873,7 +2864,7 @@ de_recall_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
static guint16
de_red_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint len, gchar *add_string, int string_len)
{
const gchar *extr_addr;
gchar *extr_addr;
de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_red_party_bcd_num, &extr_addr);

View File

@ -3602,7 +3602,6 @@ dissect_cbs_data_coding_scheme(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
void
dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
const char *digit_str;
guint8 octet;
guint8 na;
guint8 np;
@ -3628,8 +3627,7 @@ dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_e164_msisdn(tvb, tree, 1, tvb_reported_length(tvb)-1, E164_ENC_BCD);
break;
default:
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, 1, -1, NULL, FALSE);
proto_tree_add_string(tree, hf_gsm_map_address_digits, tvb, 1, -1, digit_str);
proto_tree_add_item(tree, hf_gsm_map_address_digits, tvb, 1, -1, ENC_BCD_DIGITS_0_9);
break;
}
break;
@ -3638,8 +3636,7 @@ dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_e212_imsi(tvb, pinfo, tree, 1, tvb_reported_length(tvb)-1, FALSE);
break;
default:
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, 1, -1, NULL, FALSE);
proto_tree_add_string(tree, hf_gsm_map_address_digits, tvb, 1, -1, digit_str);
proto_tree_add_item(tree, hf_gsm_map_address_digits, tvb, 1, -1, ENC_BCD_DIGITS_0_9);
break;
}
@ -3846,14 +3843,7 @@ int
dissect_gsm_map_TBCD_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 285 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
const char *digit_str;
proto_tree *subtree;
static const dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
'0','1','2','3','4','5','6','7','8','9','*','#','a','b','c', 0
}
};
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -3866,8 +3856,7 @@ dissect_gsm_map_TBCD_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_tbcd_digits);
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, 0, -1, &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_gsm_map_TBCD_digits, parameter_tvb, 0, -1, digit_str);
proto_tree_add_item(subtree, hf_gsm_map_TBCD_digits, parameter_tvb, 0, -1, ENC_KEYPAD_ABC_TBCD);
@ -3960,7 +3949,7 @@ dissect_gsm_map_ProtocolId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
static int
dissect_gsm_map_SignalInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 515 "./asn1/gsm_map/gsm_map.cnf"
#line 507 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
@ -3986,7 +3975,7 @@ static const ber_sequence_t gsm_map_ExternalSignalInfo_sequence[] = {
int
dissect_gsm_map_ExternalSignalInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 976 "./asn1/gsm_map/gsm_map.cnf"
#line 968 "./asn1/gsm_map/gsm_map.cnf"
/*
-- Information about the internal structure is given in
-- clause 7.6.9.
@ -4126,7 +4115,7 @@ dissect_gsm_map_AccessNetworkProtocolId(gboolean implicit_tag _U_, tvbuff_t *tvb
static int
dissect_gsm_map_LongSignalInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 315 "./asn1/gsm_map/gsm_map.cnf"
#line 307 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
guint8 octet;
@ -4208,7 +4197,7 @@ dissect_gsm_map_AlertingPattern(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
int
dissect_gsm_map_GSN_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 799 "./asn1/gsm_map/gsm_map.cnf"
#line 791 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
guint8 octet;
@ -4385,7 +4374,7 @@ dissect_gsm_map_HLR_List(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
int
dissect_gsm_map_GlobalCellId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1058 "./asn1/gsm_map/gsm_map.cnf"
#line 1050 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
@ -4642,7 +4631,7 @@ dissect_gsm_map_PLMN_Id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_gsm_map_E_UTRAN_CGI(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1164 "./asn1/gsm_map/gsm_map.cnf"
#line 1156 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -4673,7 +4662,7 @@ dissect_gsm_map_NR_CGI(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_gsm_map_TA_Id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1174 "./asn1/gsm_map/gsm_map.cnf"
#line 1166 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -4694,7 +4683,7 @@ dissect_gsm_map_TA_Id(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
int
dissect_gsm_map_RAIdentity(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 823 "./asn1/gsm_map/gsm_map.cnf"
#line 815 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
@ -4742,7 +4731,7 @@ dissect_gsm_map_CellGlobalIdOrServiceAreaIdFixedLength(gboolean implicit_tag _U_
int
dissect_gsm_map_LAIFixedLength(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 835 "./asn1/gsm_map/gsm_map.cnf"
#line 827 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
@ -4868,7 +4857,7 @@ dissect_gsm_map_EMLPP_Info(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
static int
dissect_gsm_map_Ext_SS_Status(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 645 "./asn1/gsm_map/gsm_map.cnf"
#line 637 "./asn1/gsm_map/gsm_map.cnf"
/* Note Ext-SS-Status can have more than one byte */
tvbuff_t *parameter_tvb;
@ -5001,7 +4990,7 @@ dissect_gsm_map_ss_RegisterSS_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
int
dissect_gsm_map_ss_SS_Status(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 625 "./asn1/gsm_map/gsm_map.cnf"
#line 617 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
guint8 octet;
@ -5035,7 +5024,7 @@ dissect_gsm_map_ss_ForwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
NULL);
#line 712 "./asn1/gsm_map/gsm_map.cnf"
#line 704 "./asn1/gsm_map/gsm_map.cnf"
proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN);
@ -5354,7 +5343,7 @@ dissect_gsm_map_ss_InterrogateSS_Res(gboolean implicit_tag _U_, tvbuff_t *tvb _U
int
dissect_gsm_map_ss_USSD_DataCodingScheme(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 668 "./asn1/gsm_map/gsm_map.cnf"
#line 660 "./asn1/gsm_map/gsm_map.cnf"
/*The structure of the USSD-DataCodingScheme is defined by
* the Cell Broadcast Data Coding Scheme as described in
* TS 3GPP TS 23.038
@ -5380,7 +5369,7 @@ dissect_gsm_map_ss_USSD_DataCodingScheme(gboolean implicit_tag _U_, tvbuff_t *tv
int
dissect_gsm_map_ss_USSD_String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 683 "./asn1/gsm_map/gsm_map.cnf"
#line 675 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
guint length;
@ -5831,7 +5820,7 @@ static const ber_sequence_t gsm_map_er_SM_DeliveryFailureCause_sequence[] = {
static int
dissect_gsm_map_er_SM_DeliveryFailureCause(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 524 "./asn1/gsm_map/gsm_map.cnf"
#line 516 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
guint8 oct;
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
@ -6599,7 +6588,7 @@ dissect_gsm_map_sm_SM_RP_MTI(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
static int
dissect_gsm_map_sm_SM_RP_SMEA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1154 "./asn1/gsm_map/gsm_map.cnf"
#line 1146 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *payload_tvb;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
&payload_tvb);
@ -6783,7 +6772,7 @@ dissect_gsm_map_sm_RoutingInfoForSM_Res(gboolean implicit_tag _U_, tvbuff_t *tvb
static int
dissect_gsm_map_sm_T_imsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 406 "./asn1/gsm_map/gsm_map.cnf"
#line 398 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_SENT;
offset = dissect_gsm_map_IMSI(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -6804,7 +6793,7 @@ dissect_gsm_map_sm_T_imsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
static int
dissect_gsm_map_sm_T_lmsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 417 "./asn1/gsm_map/gsm_map.cnf"
#line 409 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_SENT;
offset = dissect_gsm_map_LMSI(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -6825,7 +6814,7 @@ dissect_gsm_map_sm_T_lmsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
static int
dissect_gsm_map_sm_T_serviceCentreAddressDA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 460 "./asn1/gsm_map/gsm_map.cnf"
#line 452 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_RECV;
offset = dissect_gsm_map_AddressString(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -6846,7 +6835,7 @@ dissect_gsm_map_sm_T_serviceCentreAddressDA(gboolean implicit_tag _U_, tvbuff_t
static int
dissect_gsm_map_sm_T_noSM_RP_DA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 504 "./asn1/gsm_map/gsm_map.cnf"
#line 496 "./asn1/gsm_map/gsm_map.cnf"
offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
if (!PINFO_FD_VISITED(actx->pinfo)) {
@ -6893,7 +6882,7 @@ dissect_gsm_map_sm_SM_RP_DA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
static int
dissect_gsm_map_sm_T_msisdn(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 439 "./asn1/gsm_map/gsm_map.cnf"
#line 431 "./asn1/gsm_map/gsm_map.cnf"
actx->pinfo->p2p_dir = P2P_DIR_RECV;
offset = dissect_gsm_map_ISDN_AddressString(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -6913,7 +6902,7 @@ dissect_gsm_map_sm_T_msisdn(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
static int
dissect_gsm_map_sm_T_serviceCentreAddressOA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 373 "./asn1/gsm_map/gsm_map.cnf"
#line 365 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_SENT;
offset = dissect_gsm_map_AddressString(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -6934,7 +6923,7 @@ dissect_gsm_map_sm_T_serviceCentreAddressOA(gboolean implicit_tag _U_, tvbuff_t
static int
dissect_gsm_map_sm_T_noSM_RP_OA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 482 "./asn1/gsm_map/gsm_map.cnf"
#line 474 "./asn1/gsm_map/gsm_map.cnf"
offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
if (!PINFO_FD_VISITED(actx->pinfo)) {
@ -7006,7 +6995,7 @@ static const ber_sequence_t gsm_map_sm_MO_ForwardSM_Arg_sequence[] = {
static int
dissect_gsm_map_sm_MO_ForwardSM_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 553 "./asn1/gsm_map/gsm_map.cnf"
#line 545 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
@ -7034,7 +7023,7 @@ static const ber_sequence_t gsm_map_sm_MO_ForwardSM_Res_sequence[] = {
static int
dissect_gsm_map_sm_MO_ForwardSM_Res(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 565 "./asn1/gsm_map/gsm_map.cnf"
#line 557 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
@ -7072,7 +7061,7 @@ static const ber_sequence_t gsm_map_sm_MT_ForwardSM_Arg_sequence[] = {
static int
dissect_gsm_map_sm_MT_ForwardSM_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 577 "./asn1/gsm_map/gsm_map.cnf"
#line 569 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
@ -7100,7 +7089,7 @@ static const ber_sequence_t gsm_map_sm_MT_ForwardSM_Res_sequence[] = {
static int
dissect_gsm_map_sm_MT_ForwardSM_Res(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 589 "./asn1/gsm_map/gsm_map.cnf"
#line 581 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
@ -7305,7 +7294,7 @@ static const ber_sequence_t gsm_map_sm_MT_ForwardSM_VGCS_Arg_sequence[] = {
static int
dissect_gsm_map_sm_MT_ForwardSM_VGCS_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 601 "./asn1/gsm_map/gsm_map.cnf"
#line 593 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
@ -7362,7 +7351,7 @@ static const ber_sequence_t gsm_map_sm_MT_ForwardSM_VGCS_Res_sequence[] = {
static int
dissect_gsm_map_sm_MT_ForwardSM_VGCS_Res(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 613 "./asn1/gsm_map/gsm_map.cnf"
#line 605 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
@ -8747,7 +8736,7 @@ dissect_gsm_map_ms_CancelLocationRes(gboolean implicit_tag _U_, tvbuff_t *tvb _U
int
dissect_gsm_map_ms_GeographicalInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1184 "./asn1/gsm_map/gsm_map.cnf"
#line 1176 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -8768,7 +8757,7 @@ dissect_gsm_map_ms_GeographicalInformation(gboolean implicit_tag _U_, tvbuff_t *
static int
dissect_gsm_map_ms_LocationNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1119 "./asn1/gsm_map/gsm_map.cnf"
#line 1111 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -8799,7 +8788,7 @@ dissect_gsm_map_ms_LSAIdentity(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
static int
dissect_gsm_map_ms_GeodeticInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1194 "./asn1/gsm_map/gsm_map.cnf"
#line 1186 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
@ -9533,7 +9522,7 @@ dissect_gsm_map_ms_SGSN_Capability(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
static int
dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1092 "./asn1/gsm_map/gsm_map.cnf"
#line 1084 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
int length, name_len, tmp;
@ -9769,7 +9758,7 @@ dissect_gsm_map_ms_UpdateGprsLocationRes(gboolean implicit_tag _U_, tvbuff_t *tv
static int
dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 871 "./asn1/gsm_map/gsm_map.cnf"
#line 863 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
asn1_ctx_t asn1_ctx;
@ -9792,7 +9781,7 @@ dissect_gsm_map_ms_IntegrityProtectionInformation(gboolean implicit_tag _U_, tvb
static int
dissect_gsm_map_ms_EncryptionInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 883 "./asn1/gsm_map/gsm_map.cnf"
#line 875 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
asn1_ctx_t asn1_ctx;
@ -9877,7 +9866,7 @@ dissect_gsm_map_ms_AllowedUMTS_Algorithms(gboolean implicit_tag _U_, tvbuff_t *t
static int
dissect_gsm_map_ms_RadioResourceInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 847 "./asn1/gsm_map/gsm_map.cnf"
#line 839 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
@ -9948,7 +9937,7 @@ dissect_gsm_map_ms_BSSMAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *t
static int
dissect_gsm_map_ms_RANAP_ServiceHandover(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 859 "./asn1/gsm_map/gsm_map.cnf"
#line 851 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
asn1_ctx_t asn1_ctx;
@ -10897,7 +10886,7 @@ static int
dissect_gsm_map_ms_T_forwardingOptions(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_gsm_map_ms_Ext_ForwOptions(implicit_tag, tvb, offset, actx, tree, hf_index);
#line 718 "./asn1/gsm_map/gsm_map.cnf"
#line 710 "./asn1/gsm_map/gsm_map.cnf"
proto_tree_add_item(tree, hf_gsm_map_notification_to_forwarding_party, tvb, 0,1,ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gsm_map_redirecting_presentation, tvb, 0,1,ENC_BIG_ENDIAN);
@ -12060,7 +12049,7 @@ dissect_gsm_map_ms_VlrCamelSubscriptionInfo(gboolean implicit_tag _U_, tvbuff_t
static int
dissect_gsm_map_ms_PDP_Type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 726 "./asn1/gsm_map/gsm_map.cnf"
#line 718 "./asn1/gsm_map/gsm_map.cnf"
guint8 pdp_type_org;
tvbuff_t *parameter_tvb;
@ -12093,7 +12082,7 @@ dissect_gsm_map_ms_PDP_Type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
int
dissect_gsm_map_ms_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 748 "./asn1/gsm_map/gsm_map.cnf"
#line 740 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
@ -12115,7 +12104,7 @@ dissect_gsm_map_ms_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
int
dissect_gsm_map_ms_Ext_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 759 "./asn1/gsm_map/gsm_map.cnf"
#line 751 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
@ -12146,7 +12135,7 @@ dissect_gsm_map_ms_ChargingCharacteristics(gboolean implicit_tag _U_, tvbuff_t *
int
dissect_gsm_map_ms_Ext2_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 769 "./asn1/gsm_map/gsm_map.cnf"
#line 761 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
@ -12167,7 +12156,7 @@ dissect_gsm_map_ms_Ext2_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb
int
dissect_gsm_map_ms_Ext3_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 779 "./asn1/gsm_map/gsm_map.cnf"
#line 771 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
@ -12188,7 +12177,7 @@ dissect_gsm_map_ms_Ext3_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb
static int
dissect_gsm_map_ms_Ext4_QoS_Subscribed(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 789 "./asn1/gsm_map/gsm_map.cnf"
#line 781 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
@ -16646,7 +16635,7 @@ dissect_gsm_map_lcs_ProvideSubscriberLocation_Arg(gboolean implicit_tag _U_, tvb
int
dissect_gsm_map_lcs_Ext_GeographicalInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1070 "./asn1/gsm_map/gsm_map.cnf"
#line 1062 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
@ -18113,7 +18102,7 @@ static const ber_sequence_t gsm_old_Bss_APDU_sequence[] = {
static int
dissect_gsm_old_Bss_APDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 896 "./asn1/gsm_map/gsm_map.cnf"
#line 888 "./asn1/gsm_map/gsm_map.cnf"
guint8 octet;
guint8 length;
tvbuff_t *next_tvb;
@ -18698,7 +18687,7 @@ dissect_gsm_old_PlmnContainer(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
static int
dissect_gsm_old_T_imsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 384 "./asn1/gsm_map/gsm_map.cnf"
#line 376 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_SENT;
offset = dissect_gsm_map_IMSI(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -18719,7 +18708,7 @@ dissect_gsm_old_T_imsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_gsm_old_T_lmsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 395 "./asn1/gsm_map/gsm_map.cnf"
#line 387 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_SENT;
offset = dissect_gsm_map_LMSI(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -18740,7 +18729,7 @@ dissect_gsm_old_T_lmsi(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
static int
dissect_gsm_old_T_serviceCentreAddressDA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 449 "./asn1/gsm_map/gsm_map.cnf"
#line 441 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_RECV;
offset = dissect_gsm_map_AddressString(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -18761,7 +18750,7 @@ dissect_gsm_old_T_serviceCentreAddressDA(gboolean implicit_tag _U_, tvbuff_t *tv
static int
dissect_gsm_old_T_noSM_RP_DA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 493 "./asn1/gsm_map/gsm_map.cnf"
#line 485 "./asn1/gsm_map/gsm_map.cnf"
offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
if (!PINFO_FD_VISITED(actx->pinfo)) {
@ -18808,7 +18797,7 @@ dissect_gsm_old_SM_RP_DAold(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
static int
dissect_gsm_old_T_msisdn(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 428 "./asn1/gsm_map/gsm_map.cnf"
#line 420 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_RECV;
offset = dissect_gsm_map_ISDN_AddressString(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -18829,7 +18818,7 @@ dissect_gsm_old_T_msisdn(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
static int
dissect_gsm_old_T_serviceCentreAddressOA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 362 "./asn1/gsm_map/gsm_map.cnf"
#line 354 "./asn1/gsm_map/gsm_map.cnf"
actx->private_data = NULL;
actx->pinfo->p2p_dir = P2P_DIR_SENT;
offset = dissect_gsm_map_AddressString(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -18850,7 +18839,7 @@ dissect_gsm_old_T_serviceCentreAddressOA(gboolean implicit_tag _U_, tvbuff_t *tv
static int
dissect_gsm_old_T_noSM_RP_OA(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 471 "./asn1/gsm_map/gsm_map.cnf"
#line 463 "./asn1/gsm_map/gsm_map.cnf"
offset = dissect_ber_null(implicit_tag, actx, tree, tvb, offset, hf_index);
if (!PINFO_FD_VISITED(actx->pinfo)) {
@ -18902,7 +18891,7 @@ static const ber_sequence_t gsm_old_ForwardSM_Arg_sequence[] = {
static int
dissect_gsm_old_ForwardSM_Arg(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 537 "./asn1/gsm_map/gsm_map.cnf"
#line 529 "./asn1/gsm_map/gsm_map.cnf"
/* dissect_gsm_map_SignalInfo will return parameter_tvb in actx */
gsm_map_private_info_t *gsm_map_priv = (gsm_map_private_info_t*)actx->value_ptr;
offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
@ -20164,7 +20153,7 @@ dissect_gsm_ss_LCS_PeriodicTriggeredInvokeRes(gboolean implicit_tag _U_, tvbuff_
static int
dissect_gsm_map_ericsson_T_locationInformation(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 1129 "./asn1/gsm_map/gsm_map.cnf"
#line 1121 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
guint8 rat;
@ -21980,7 +21969,7 @@ dissect_NokiaMAP_Extensions_AllowedServiceData(gboolean implicit_tag _U_, tvbuff
/*--- End of included file: packet-gsm_map-fn.c ---*/
#line 1047 "./asn1/gsm_map/packet-gsm_map-template.c"
#line 1044 "./asn1/gsm_map/packet-gsm_map-template.c"
/* Specific translation for MAP V3 */
const value_string gsm_map_V1V2_opr_code_strings[] = {
@ -22203,7 +22192,7 @@ const value_string gsm_map_opr_code_strings[] = {
/* Unknown or empty loop list OPERATION */
/*--- End of included file: packet-gsm_map-table.c ---*/
#line 1058 "./asn1/gsm_map/packet-gsm_map-template.c"
#line 1055 "./asn1/gsm_map/packet-gsm_map-template.c"
{ 0, NULL }
};
@ -22421,7 +22410,7 @@ static const value_string gsm_map_err_code_string_vals[] = {
/* Unknown or empty loop list OPERATION */
/*--- End of included file: packet-gsm_map-table.c ---*/
#line 1064 "./asn1/gsm_map/packet-gsm_map-template.c"
#line 1061 "./asn1/gsm_map/packet-gsm_map-template.c"
{ 0, NULL }
};
#endif
@ -32014,7 +32003,7 @@ void proto_register_gsm_map(void) {
NULL, HFILL }},
/*--- End of included file: packet-gsm_map-hfarr.c ---*/
#line 3327 "./asn1/gsm_map/packet-gsm_map-template.c"
#line 3324 "./asn1/gsm_map/packet-gsm_map-template.c"
};
/* List of subtrees */
@ -32769,7 +32758,7 @@ void proto_register_gsm_map(void) {
&ett_NokiaMAP_Extensions_AllowedServiceData,
/*--- End of included file: packet-gsm_map-ettarr.c ---*/
#line 3366 "./asn1/gsm_map/packet-gsm_map-template.c"
#line 3363 "./asn1/gsm_map/packet-gsm_map-template.c"
};
static ei_register_info ei[] = {
@ -32913,7 +32902,7 @@ void proto_register_gsm_map(void) {
/*--- End of included file: packet-gsm_map-dis-tab.c ---*/
#line 3426 "./asn1/gsm_map/packet-gsm_map-template.c"
#line 3423 "./asn1/gsm_map/packet-gsm_map-template.c"
oid_add_from_string("ericsson-gsm-Map-Ext","1.2.826.0.1249.58.1.0" );
oid_add_from_string("accessTypeNotAllowed-id","1.3.12.2.1107.3.66.1.2");
/*oid_add_from_string("map-ac networkLocUp(1) version3(3)","0.4.0.0.1.0.1.3" );

View File

@ -192,7 +192,6 @@ de_gsm_r_uus1_chpc_forward(tvbuff_t *tvb, proto_tree *tree, guint32 offset)
guint32 len;
guint32 t_dur;
guint32 t_rel;
const gchar *gref_str;
proto_item *item;
proto_tree *sub_tree;
@ -233,8 +232,7 @@ de_gsm_r_uus1_chpc_forward(tvbuff_t *tvb, proto_tree *tree, guint32 offset)
proto_tree_add_bitmask(sub_tree, tvb, curr_offset, hf_gsm_r_uus1_chpc_cause, ett_gsm_r_uus1_chpc_cause, cause_flags, ENC_NA);
curr_offset += 1;
gref_str = tvb_bcd_dig_to_wmem_packet_str(tvb, curr_offset, 4, NULL, FALSE);
proto_tree_add_string(sub_tree, hf_gsm_r_uus1_chpc_gref, tvb, curr_offset, 4, gref_str);
proto_tree_add_item(sub_tree, hf_gsm_r_uus1_chpc_gref, tvb, curr_offset, 4, ENC_BCD_DIGITS_0_9);
curr_offset += 4;
return (curr_offset - offset);
@ -540,9 +538,9 @@ de_gsm_r_uus1_alert_controller(tvbuff_t *tvb, proto_tree *tree, packet_info *pin
{
guint32 curr_offset;
guint32 len;
const gchar *gref_str;
proto_item *item;
proto_tree *sub_tree;
char *gref_str;
curr_offset = offset;
@ -555,8 +553,7 @@ de_gsm_r_uus1_alert_controller(tvbuff_t *tvb, proto_tree *tree, packet_info *pin
proto_tree_add_item(sub_tree, hf_gsm_r_uus1_elem_len, tvb, curr_offset+1, 1, ENC_NA);
curr_offset += 2;
gref_str = tvb_bcd_dig_to_wmem_packet_str(tvb, curr_offset, 4, NULL, FALSE);
proto_tree_add_string(sub_tree, hf_gsm_r_uus1_alert_controller_gref, tvb, curr_offset, 4, gref_str);
proto_tree_add_item_ret_display_string(sub_tree, hf_gsm_r_uus1_alert_controller_gref, tvb, curr_offset, 4, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &gref_str);
proto_item_append_text(item, ": %s", gref_str);
curr_offset += 4;

View File

@ -6806,7 +6806,7 @@ decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tre
proto_tree *ext_imeisv;
proto_item *te;
tvbuff_t *next_tvb;
const char *digit_str;
char *digit_str;
length = tvb_get_ntohs(tvb, offset + 1);
ext_imeisv = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_IMEISV], &te,
@ -6823,8 +6823,7 @@ decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tre
* set to '1111'. Both IMEI and IMEISV are BCD encoded.
*/
next_tvb = tvb_new_subset_length(tvb, offset, length);
digit_str = tvb_bcd_dig_to_wmem_packet_str(next_tvb, 0, -1, NULL, FALSE);
proto_tree_add_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str);
proto_tree_add_item_ret_display_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str);
proto_item_append_text(te, ": %s", digit_str);
return 3 + length;

View File

@ -2273,15 +2273,13 @@ static void
dissect_gtpv2_mei(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_, session_args_t * args _U_)
{
int offset = 0;
const gchar *mei_str;
gchar *mei_str;
/* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
* a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
* allocated string will be returned.
*/
mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, 0, length, NULL, FALSE);
proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, length, mei_str);
proto_tree_add_item_ret_display_string(tree, hf_gtpv2_mei, tvb, offset, length, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &mei_str);
proto_item_append_text(item, "%s", mei_str);
}
@ -4065,10 +4063,7 @@ dissect_gtpv2_mm_context_common_data(tvbuff_t *tvb, packet_info *pinfo, proto_tr
offset += 1;
/* (m+2) to r Mobile Equipment Identity (MEI) */
if (mei_len) {
const gchar *mei_str;
mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, mei_len, NULL, FALSE);
proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, mei_len, mei_str);
proto_tree_add_item(tree, hf_gtpv2_mei, tvb, offset, mei_len, ENC_BCD_DIGITS_0_9);
offset += mei_len;
}
return offset;

View File

@ -848,7 +848,7 @@ dissect_ilp_T_mdn(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto
proto_tree *subtree;
subtree = proto_item_add_subtree(actx->created_item, ett_ilp_setid);
proto_tree_add_string(subtree, hf_ilp_mobile_directory_number, mdn_tvb, 0, 8, tvb_bcd_dig_to_wmem_packet_str(mdn_tvb, 0, 8, NULL, FALSE));
proto_tree_add_item(subtree, hf_ilp_mobile_directory_number, mdn_tvb, 0, 8, ENC_BCD_DIGITS_0_9);
}

View File

@ -4963,18 +4963,14 @@ dissect_notif(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_t
}
/* Payload Octet 8-n - Identity value */
const gchar *imei_str;
const gchar *imeisv_str;
switch (octet) {
case 1:
/* IMEI */
imei_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, length, NULL, FALSE);
proto_tree_add_string(tree, hf_isakmp_notify_data_3gpp_device_identity_imei, tvb, offset, length, imei_str);
proto_tree_add_item(tree, hf_isakmp_notify_data_3gpp_device_identity_imei, tvb, offset, length, ENC_BCD_DIGITS_0_9);
break;
case 2:
/* IMEISV */
imeisv_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, length, NULL, FALSE);
proto_tree_add_string(tree, hf_isakmp_notify_data_3gpp_device_identity_imeisv, tvb, offset, length, imeisv_str);
proto_tree_add_item(tree, hf_isakmp_notify_data_3gpp_device_identity_imeisv, tvb, offset, length, ENC_BCD_DIGITS_0_9);
break;
default:
proto_tree_add_expert(tree, pinfo, &ei_isakmp_notify_data_3gpp_unknown_device_identity, tvb, offset, length);
@ -5029,7 +5025,7 @@ dissect_notif(tvbuff_t *tvb, packet_info *pinfo, int offset, int length, proto_t
/*IE Octet 5 to j | Digit_N+1 | Digit_N | */
current_em_num_len -= 2; //Not counting octets 3 and 4
proto_tree_add_string(current_emergency_call_number_tree, hf_iskamp_notify_data_3gpp_emergency_call_number, tvb, offset, current_em_num_len, tvb_bcd_dig_to_wmem_packet_str(tvb, offset, current_em_num_len, NULL, FALSE));
proto_tree_add_item(current_emergency_call_number_tree, hf_iskamp_notify_data_3gpp_emergency_call_number, tvb, offset, current_em_num_len, ENC_BCD_DIGITS_0_9);
offset += current_em_num_len; //moving to the next number in the list
}
}

View File

@ -3960,7 +3960,6 @@ static void
dissect_ansi_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo _U_, proto_tree *parameter_tree, proto_item *parameter_item _U_)
{
gint offset = 0;
const char *digit_str;
static const int * indicators_fields[] = {
&hf_ansi_isup_spare_b7,
@ -3972,8 +3971,7 @@ dissect_ansi_isup_transit_network_selection_parameter(tvbuff_t *parameter_tvb, p
proto_tree_add_bitmask_list(parameter_tree, parameter_tvb, 0, 1, indicators_fields, ENC_NA);
offset = 1;
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, offset, 2, NULL, FALSE);
proto_tree_add_string(parameter_tree, hf_ansi_isup_nw_id, parameter_tvb, offset, 2, digit_str);
proto_tree_add_item(parameter_tree, hf_ansi_isup_nw_id, parameter_tvb, offset, 2, ENC_BCD_DIGITS_0_9);
offset += 2;
proto_tree_add_item(parameter_tree, hf_ansi_isup_circuit_code, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
@ -4000,7 +3998,6 @@ static void
dissect_ansi_isup_param_carrier_id(tvbuff_t *parameter_tvb, packet_info *pinfo _U_, proto_tree *parameter_tree, proto_item *parameter_item _U_)
{
int offset = 0;
const char *digit_str;
static const int * flags[] = {
&hf_ansi_isup_spare_b7,
@ -4012,8 +4009,7 @@ dissect_ansi_isup_param_carrier_id(tvbuff_t *parameter_tvb, packet_info *pinfo _
proto_tree_add_bitmask_list(parameter_tree, parameter_tvb, offset, 1, flags, ENC_BIG_ENDIAN);
offset++;
digit_str = tvb_bcd_dig_to_wmem_packet_str(parameter_tvb, offset, 2, NULL, FALSE);
proto_tree_add_string(parameter_tree, hf_ansi_isup_nw_id, parameter_tvb, offset, 2, digit_str);
proto_tree_add_item(parameter_tree, hf_ansi_isup_nw_id, parameter_tvb, offset, 2, ENC_BCD_DIGITS_0_9);
}
@ -7247,7 +7243,7 @@ dissect_japan_isup_contractor_number(tvbuff_t *parameter_tvb, proto_tree *parame
{
int offset = 0;
int parameter_length;
const char *digit_str;
char *digit_str;
parameter_length = tvb_reported_length_remaining(parameter_tvb, offset);
@ -7258,8 +7254,7 @@ dissect_japan_isup_contractor_number(tvbuff_t *parameter_tvb, proto_tree *parame
proto_tree_add_item(parameter_tree, hf_isup_numbering_plan_indicator, parameter_tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
digit_str = tvb_bcd_dig_to_wmem_packet_str( parameter_tvb, offset, parameter_length-2, NULL, FALSE);
proto_tree_add_string(parameter_tree, hf_japan_isup_contractor_number, parameter_tvb, offset, parameter_length-offset, digit_str);
proto_tree_add_item_ret_display_string(parameter_tree, hf_japan_isup_contractor_number, parameter_tvb, offset, parameter_length-2, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str);
proto_item_append_text(parameter_item, " %s", digit_str);

View File

@ -4038,7 +4038,7 @@ dissect_kerberos_KDC_REQ_BODY(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
* accordingly.
*
* Ref: Section 7.2.1 of
* https://tools.ietf.org/html/draft-ietf-krb-wg-kerberos-clarifications-07
* http://www.ietf.org/internet-drafts/draft-ietf-krb-wg-kerberos-clarifications-07.txt
*/
if (actx->pinfo->destport == UDP_PORT_KERBEROS && actx->pinfo->ptype == PT_UDP) {
conversation = find_conversation(actx->pinfo->num, &actx->pinfo->src, &actx->pinfo->dst, ENDPOINT_UDP,

View File

@ -159,12 +159,6 @@ static const value_string lnpdqp_np_vals[] = {
{ 0, NULL }
};
static dgt_set_t Dgt_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e */
'0','1','2','3','4','5','6','7','8','9','?','B','C','*','#'
}
};
/*
* OriginatingStationType ::= OCTET STRING (SIZE(1))
* The following codes are used in the originating line information field:
@ -199,7 +193,7 @@ dissect_lnpdqp_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
guint8 octet , no_of_digits;
int offset = 0;
const char *digit_str;
char *digit_str;
proto_tree *subtree;
@ -226,8 +220,7 @@ dissect_lnpdqp_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
if(no_of_digits == 0)
return;
offset++;
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_reported_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_lnpdqp_bcd_digits, tvb, offset, -1, digit_str);
proto_tree_add_item_ret_display_string(subtree, hf_lnpdqp_bcd_digits, tvb, offset, -1, ENC_KEYPAD_BC_TBCD, wmem_packet_scope(), &digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:
@ -403,7 +396,7 @@ static int dissect_ProvideInstructionArg_PDU(tvbuff_t *tvb _U_, packet_info *pin
/*--- End of included file: packet-lnpdqp-fn.c ---*/
#line 224 "./asn1/lnpdqp/packet-lnpdqp-template.c"
#line 217 "./asn1/lnpdqp/packet-lnpdqp-template.c"
static int
dissect_lnpdqp_cc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
@ -530,7 +523,7 @@ void proto_register_lnpdqp(void) {
"OriginatingStationType", HFILL }},
/*--- End of included file: packet-lnpdqp-hfarr.c ---*/
#line 322 "./asn1/lnpdqp/packet-lnpdqp-template.c"
#line 315 "./asn1/lnpdqp/packet-lnpdqp-template.c"
};
/* List of subtrees */
@ -547,7 +540,7 @@ void proto_register_lnpdqp(void) {
&ett_lnpdqp_ServiceKey,
/*--- End of included file: packet-lnpdqp-ettarr.c ---*/
#line 331 "./asn1/lnpdqp/packet-lnpdqp-template.c"
#line 324 "./asn1/lnpdqp/packet-lnpdqp-template.c"
};
/* Register protocol */

View File

@ -308,9 +308,8 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
guint8 dir, nsapi, rat, aal5proto;
guint16 phylinkid, localdevid, remotedevid, tapgroupid;
guint32 tlli;
guint64 ts, imsi, imei, cell;
guint64 ts, cell;
sscop_payload_info *p_sscop_info;
const gchar *imsi_str, *imei_str;
proto_item *cell_item, *imsi_item, *imei_item;
proto_tree *cell_tree, *imsi_tree, *imei_tree;
@ -342,22 +341,18 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
offs, 1, nsapi);
break;
case META_ID_IMSI:
imsi = tvb_get_letoh64(tvb, offs);
imsi_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offs, 8, NULL, FALSE);
imsi_item = proto_tree_add_string(meta_tree, hf_meta_item_imsi_digits, tvb,
offs, 8, imsi_str);
imsi_item = proto_tree_add_item(meta_tree, hf_meta_item_imsi_digits, tvb,
offs, 8, ENC_BCD_DIGITS_0_9);
imsi_tree = proto_item_add_subtree(imsi_item, ett_meta_imsi);
proto_tree_add_uint64(imsi_tree, hf_meta_item_imsi_value,
tvb, offs, 8, imsi);
proto_tree_add_item(imsi_tree, hf_meta_item_imsi_value,
tvb, offs, 8, ENC_LITTLE_ENDIAN);
break;
case META_ID_IMEI:
imei = tvb_get_letoh64(tvb, offs);
imei_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offs, 8, NULL, FALSE);
imei_item = proto_tree_add_string(meta_tree, hf_meta_item_imei_digits, tvb,
offs, 8, imei_str);
imei_item = proto_tree_add_item(meta_tree, hf_meta_item_imei_digits, tvb,
offs, 8, ENC_BCD_DIGITS_0_9);
imei_tree = proto_item_add_subtree(imei_item, ett_meta_imei);
proto_tree_add_uint64(imei_tree, hf_meta_item_imei_value,
tvb, offs, 8, imei);
proto_tree_add_item(imei_tree, hf_meta_item_imei_value,
tvb, offs, 8, ENC_LITTLE_ENDIAN);
break;
case META_ID_APN:
proto_tree_add_item(meta_tree, hf_meta_item_apn, tvb,
@ -675,7 +670,7 @@ proto_register_meta(void)
},
{ &hf_meta_item_imsi_digits,
{ "IMSI digits", "meta.imsi_digits",
FT_STRINGZ, BASE_NONE, NULL, 0,
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_meta_item_imsi_value,
@ -685,7 +680,7 @@ proto_register_meta(void)
},
{ &hf_meta_item_imei_digits,
{ "IMEI digits", "meta.imei_digits",
FT_STRINGZ, BASE_NONE, NULL, 0,
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_meta_item_imei_value,

View File

@ -1910,10 +1910,10 @@ dissect_mip6_opt_vsm_3gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
int offset = 0;
guint8 sub_type, m_flag;
tvbuff_t *next_tvb;
const gchar *mei_str;
const char *digit_str;
gchar *mei_str;
char *digit_str;
gchar *mcc_mnc_str;
const gchar *imsi_str;
gchar *imsi_str;
/* offset points to the sub type */
sub_type = tvb_get_guint8(tvb,offset);
@ -1998,15 +1998,13 @@ dissect_mip6_opt_vsm_3gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
break;
/* 11, Mobile Equipment Identity (MEI) */
case 11:
mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, len, NULL, FALSE);
proto_tree_add_string(tree, hf_mip6_opt_3gpp_mei, tvb, offset, len, mei_str);
proto_tree_add_item_ret_display_string(tree, hf_mip6_opt_3gpp_mei, tvb, offset, len, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &mei_str);
proto_item_append_text(hdr_item, " %s", mei_str);
break;
/* 12, MSISDN */
case 12:
dissect_e164_cc(tvb, tree, offset, E164_ENC_BCD);
digit_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, len, NULL, FALSE);
proto_tree_add_string(tree, hf_mip6_opt_3gpp_msisdn, tvb, offset, len, digit_str);
proto_tree_add_item_ret_display_string(tree, hf_mip6_opt_3gpp_msisdn, tvb, offset, len, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str);
proto_item_append_text(hdr_item, " %s", digit_str);
break;
/* 13, Serving Network */
@ -2024,8 +2022,7 @@ dissect_mip6_opt_vsm_3gpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
break;
/* 16, Unauthenticated IMSI */
case 16:
imsi_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, len, NULL, FALSE);
proto_tree_add_string(tree, hf_mip6_opt_3gpp_imsi, tvb, offset, len, imsi_str);
proto_tree_add_item_ret_display_string(tree, hf_mip6_opt_3gpp_imsi, tvb, offset, len, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &imsi_str);
proto_item_append_text(hdr_item," %s", imsi_str);
break;
/* 17, PDN Connection ID */

View File

@ -760,8 +760,7 @@ de_nas_5gs_mm_5gs_mobile_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
/* Scheme output octet 12-x */
if (scheme_id == 0) {
new_tvb = tvb_new_subset_length(tvb, offset, len - 8);
digit_str = tvb_bcd_dig_to_wmem_packet_str(new_tvb, 0, -1, NULL, FALSE);
proto_tree_add_string(tree, hf_nas_5gs_mm_suci_msin, new_tvb, 0, -1, digit_str);
proto_tree_add_item(tree, hf_nas_5gs_mm_suci_msin, new_tvb, 0, -1, ENC_BCD_DIGITS_0_9);
} else {
proto_item *pi = proto_tree_add_item(tree, hf_nas_5gs_mm_scheme_output, tvb, offset, len - 8, ENC_NA);
if ((scheme_id == 1 && len >= 49) || (scheme_id == 2 && len >= 50)) {

View File

@ -2349,8 +2349,7 @@ de_emm_ext_emerg_num_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U
tvb, curr_offset, 1, ENC_NA, &length);
curr_offset++;
if (length > 0) {
const char *digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, curr_offset, length, NULL, FALSE);
proto_tree_add_string(sub_tree, hf_eps_emm_ext_emerg_num_list_emerg_num, tvb, curr_offset, length, digit_str);
proto_tree_add_item(sub_tree, hf_eps_emm_ext_emerg_num_list_emerg_num, tvb, curr_offset, length, ENC_BCD_DIGITS_0_9);
curr_offset += length;
}
proto_tree_add_item_ret_uint(sub_tree, hf_eps_emm_ext_emerg_num_list_sub_serv_field_len,

View File

@ -5440,7 +5440,6 @@ static void dissect_pfcp_user_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
int offset = 0;
guint64 flags_val;
guint32 length_imsi, length_imei, length_msisdn, length_nai;
const gchar *mei_str;
static const int * pfcp_user_id_flags[] = {
&hf_pfcp_spare_b7_b3,
@ -5476,8 +5475,7 @@ static void dissect_pfcp_user_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
* a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
* allocated string will be returned.
*/
mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, length_imei, NULL, FALSE);
proto_tree_add_string(tree, hf_pfcp_user_id_imei, tvb, offset, length_imei, mei_str);
proto_tree_add_item(tree, hf_pfcp_user_id_imei, tvb, offset, length_imei, ENC_BCD_DIGITS_0_9);
offset += length_imei;
}

View File

@ -219,13 +219,12 @@ de_sgsap_g_cn_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of
static guint16
de_sgsap_imeisv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
{
const char *imeisv_str;
char *imeisv_str;
guint32 curr_offset;
curr_offset = offset;
imeisv_str = tvb_bcd_dig_to_wmem_packet_str( tvb, curr_offset, len, NULL, FALSE);
proto_tree_add_string(tree, hf_sgsap_imeisv, tvb, curr_offset, len, imeisv_str);
proto_tree_add_item_ret_display_string(tree, hf_sgsap_imeisv, tvb, curr_offset, len, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &imeisv_str);
if (add_string) {
/* (len<<2)+4 = the maximum number of bytes to produce (including the terminating nul character). */
g_snprintf(add_string, (len<<2)+4, " - %s", imeisv_str);

View File

@ -1361,7 +1361,7 @@ dissect_ulp_T_mdn(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto
proto_tree *subtree;
subtree = proto_item_add_subtree(actx->created_item, ett_ulp_setid);
proto_tree_add_string(subtree, hf_ulp_mobile_directory_number, mdn_tvb, 0, 8, tvb_bcd_dig_to_wmem_packet_str(mdn_tvb, 0, 8, NULL, FALSE));
proto_tree_add_item(subtree, hf_ulp_mobile_directory_number, mdn_tvb, 0, 8, ENC_BCD_DIGITS_0_9);
}

View File

@ -491,6 +491,9 @@ void proto_report_dissector_bug(const char *format, ...)
#define ENC_CP855 0x0000003E
#define ENC_CP866 0x00000040
#define ENC_ISO_646_BASIC 0x00000042
#define ENC_BCD_DIGITS_0_9 0x00000044 /* Packed BCD, digits 0-9 */
#define ENC_KEYPAD_ABC_TBCD 0x00000046 /* Keypad-with-a/b/c "telephony BCD" = 0-9, *, #, a, b, c */
#define ENC_KEYPAD_BC_TBCD 0x00000048 /* Keypad-with-B/C "telephony BCD" = 0-9, B, C, *, # */
/*
* TODO:
*

View File

@ -2738,6 +2738,30 @@ tvb_get_t61_string(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset, gint len
return get_t61_string(scope, ptr, length);
}
/*
* Encoding tables for BCD strings.
*/
static const dgt_set_t Dgt0_9_bcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
'0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'
}
};
static const dgt_set_t Dgt_keypad_abc_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
'0','1','2','3','4','5','6','7','8','9','*','#','a','b','c','?'
}
};
static const dgt_set_t Dgt_ansi_tbcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
'0','1','2','3','4','5','6','7','8','9','?','B','C','*','#','?'
}
};
/*
* Given a tvbuff, an offset, a length, and an encoding, allocate a
* buffer big enough to hold a non-null-terminated string of that length
@ -2931,6 +2955,29 @@ tvb_get_string_enc(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset,
case ENC_T61:
strptr = tvb_get_t61_string(scope, tvb, offset, length);
break;
case ENC_BCD_DIGITS_0_9:
/*
* Packed BCD, with digits 0-9.
*/
strptr = tvb_get_bcd_string(scope, tvb, offset, length, &Dgt0_9_bcd, FALSE);
break;
case ENC_KEYPAD_ABC_TBCD:
/*
* Keypad-with-a/b/c "telephony BCD" - packed BCD, with
* digits 0-9 and symbols *, #, a, b, and c.
*/
strptr = tvb_get_bcd_string(scope, tvb, offset, length, &Dgt_keypad_abc_tbcd, FALSE);
break;
case ENC_KEYPAD_BC_TBCD:
/*
* Keypad-with-B/C "telephony BCD" - packed BCD, with
* digits 0-9 and symbols B, C, *, and #.
*/
strptr = tvb_get_bcd_string(scope, tvb, offset, length, &Dgt_ansi_tbcd, FALSE);
break;
}
return strptr;
}
@ -3928,50 +3975,53 @@ tvb_bytes_to_str_punct(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset
return bytestring_to_str(scope, ensure_contiguous(tvb, offset, len), len, punct);
}
/*
* Given a tvbuff, an offset into the tvbuff, and a length that starts
* at that offset (which may be -1 for "all the way to the end of the
* tvbuff"), fetch BCD encoded digits from a tvbuff starting from either
* the low or high half byte, formating the digits according to an input digit set,
* if NUll a default digit set of 0-9 returning "?" for overdecadic digits will be used.
* A pointer to the packet scope allocated string will be returned.
* Note a tvbuff content of 0xf is considered a 'filler' and will end the conversion.
* Given a wmem scope, a tvbuff, an offset, a length, an input digit
* set, and a boolean indicator, fetch BCD-encoded digits from a
* tvbuff starting from either the low or high half byte of the
* first byte depending on the boolean indicator (TRUE means "start
* with the high half byte, ignoring the low half byte", and FALSE
* means "start with the low half byte and proceed to the high half
* byte), formating the digits into characters according to the
* input digit set, and return a pointer to a UTF-8 string, allocated
* using the wmem scope. A high-order nibble of 0xf is considered a
* 'filler' and will end the conversion.
*/
static const dgt_set_t Dgt1_9_bcd = {
{
/* 0 1 2 3 4 5 6 7 8 9 a b c d e f*/
'0','1','2','3','4','5','6','7','8','9','?','?','?','?','?','?'
}
};
const gchar *
tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb, const gint offset, const gint len, const dgt_set_t *dgt, gboolean skip_first)
gchar *
tvb_get_bcd_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, gint len, const dgt_set_t *dgt, gboolean skip_first)
{
int length;
guint8 octet;
int i = 0;
char *digit_str;
gint t_offset = offset;
const guint8 *ptr;
int i = 0;
char *digit_str;
guint8 octet;
DISSECTOR_ASSERT(tvb && tvb->initialized);
if (!dgt)
dgt = &Dgt1_9_bcd;
if (len == -1) {
/*
* Run to the end of the captured data.
*
* XXX - captured, or total?
*/
/*length = tvb_captured_length(tvb);*/
length = tvb->length;
if (length < offset) {
return "";
len = tvb->length;
if (len < offset) {
return (char *)"";
}
} else {
length = offset + len;
len -= offset;
}
digit_str = (char *)wmem_alloc(wmem_packet_scope(), (length - offset)*2+1);
while (t_offset < length) {
ptr = ensure_contiguous(tvb, offset, len);
octet = tvb_get_guint8(tvb,t_offset);
/*
* XXX - map illegal digits (digits that map to 0) to REPLACEMENT
* CHARACTER, and have all the tables in epan/tvbuff.c use 0 rather
* than '?'?
*/
digit_str = (char *)wmem_alloc(scope, len*2 + 1);
while (len > 0) {
octet = *ptr;
if (!skip_first) {
digit_str[i] = dgt->out[octet & 0x0f];
i++;
@ -3983,9 +4033,9 @@ tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb, const gint offset, const gint len,
*/
octet = octet >> 4;
if (t_offset == length - 1 && octet == 0x0f) {
if (len == 1 && octet == 0x0f) {
/*
* This is the last octet, and the low-order
* This is the last octet, and the high-order
* nibble is 0xf, so we have an odd number of
* digits, and this is a filler digit. Ignore
* it.
@ -3995,12 +4045,21 @@ tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb, const gint offset, const gint len,
digit_str[i] = dgt->out[octet & 0x0f];
i++;
t_offset++;
ptr++;
len--;
}
digit_str[i]= '\0';
digit_str[i] = '\0';
return digit_str;
}
const gchar *
tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb, const gint offset, const gint len, const dgt_set_t *dgt, gboolean skip_first)
{
if (!dgt)
dgt = &Dgt0_9_bcd;
return tvb_get_bcd_string(wmem_packet_scope(), tvb, offset, len, dgt, skip_first);
}
/*

View File

@ -889,6 +889,22 @@ WS_DLL_PUBLIC const gchar *tvb_bcd_dig_to_wmem_packet_str(tvbuff_t *tvb,
const gint offset, const gint len, const dgt_set_t *dgt,
gboolean skip_first);
/**
* Given a wmem scope, a tvbuff, an offset, a length, an input digit
* set, and a boolean indicator, fetch BCD-encoded digits from a
* tvbuff starting from either the low or high half byte of the
* first byte depending on the boolean indicator (TRUE means "start
* with the high half byte, ignoring the low half byte", and FALSE
* means "start with the low half byte and proceed to the high half
* byte), formating the digits into characters according to the
* input digit set, and return a pointer to a UTF-8 string, allocated
* using the wmem scope. A high-order nibble of 0xf is considered a
* 'filler' and will end the conversion.
*/
WS_DLL_PUBLIC gchar *tvb_get_bcd_string(wmem_allocator_t *scope, tvbuff_t *tvb,
const gint offset, gint len, const dgt_set_t *dgt,
gboolean skip_first);
/** Locate a sub-tvbuff within another tvbuff, starting at position
* 'haystack_offset'. Returns the index of the beginning of 'needle' within
* 'haystack', or -1 if 'needle' is not found. The index is relative