GSM MAP:Use ENC_APN_STR

This commit is contained in:
Anders Broman 2021-05-24 08:07:37 +02:00 committed by Wireshark GitLab Utility
parent 7f6c5d0137
commit 96ed53bb68
2 changed files with 14 additions and 40 deletions

View File

@ -1083,28 +1083,15 @@ MAP interfaces
#.FN_BODY APN VAL_PTR = &parameter_tvb
tvbuff_t *parameter_tvb;
proto_tree *subtree;
int length, name_len, tmp;
guint8 *apn_str = NULL;
const guint8 *apn_str = NULL;
%(DEFAULT_BODY)s
if (!parameter_tvb)
return offset;
length = tvb_reported_length(parameter_tvb);
name_len = tvb_get_guint8(parameter_tvb, 0);
apn_str = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 1, length - 1, ENC_ASCII|ENC_NA);
if (name_len < length-1) {
for (;;) {
if (name_len >= length - 1)
break;
tmp = name_len;
name_len = name_len + apn_str[tmp] + 1;
apn_str[tmp] = '.';
}
}
proto_item_append_text(actx->created_item, " - %%s", apn_str);
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_apn_str);
proto_tree_add_string(subtree, hf_gsm_apn_str, parameter_tvb, 0, -1, apn_str);
proto_tree_add_item_ret_string(subtree, hf_gsm_apn_str, parameter_tvb, 0, -1, ENC_APN_STR | ENC_NA, wmem_packet_scope(), &apn_str);
proto_item_append_text(actx->created_item, " - %%s", apn_str);
#.FN_BODY LocationNumber VAL_PTR = &parameter_tvb

View File

@ -4631,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 1156 "./asn1/gsm_map/gsm_map.cnf"
#line 1143 "./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,
@ -4662,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 1166 "./asn1/gsm_map/gsm_map.cnf"
#line 1153 "./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,
@ -6588,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 1146 "./asn1/gsm_map/gsm_map.cnf"
#line 1133 "./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);
@ -8553,7 +8553,7 @@ dissect_gsm_map_ms_ADD_Info(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
static int
dissect_gsm_map_ms_LAC(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 1198 "./asn1/gsm_map/gsm_map.cnf"
#line 1185 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb = NULL;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, -1,
&parameter_tvb);
@ -8744,7 +8744,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 1176 "./asn1/gsm_map/gsm_map.cnf"
#line 1163 "./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,
@ -8765,7 +8765,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 1111 "./asn1/gsm_map/gsm_map.cnf"
#line 1098 "./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,
@ -8796,7 +8796,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 1186 "./asn1/gsm_map/gsm_map.cnf"
#line 1173 "./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,8 +9533,7 @@ dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
#line 1084 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
int length, name_len, tmp;
guint8 *apn_str = NULL;
const guint8 *apn_str = NULL;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index,
&parameter_tvb);
@ -9542,21 +9541,9 @@ dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
if (!parameter_tvb)
return offset;
length = tvb_reported_length(parameter_tvb);
name_len = tvb_get_guint8(parameter_tvb, 0);
apn_str = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 1, length - 1, ENC_ASCII|ENC_NA);
if (name_len < length-1) {
for (;;) {
if (name_len >= length - 1)
break;
tmp = name_len;
name_len = name_len + apn_str[tmp] + 1;
apn_str[tmp] = '.';
}
}
proto_item_append_text(actx->created_item, " - %s", apn_str);
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_apn_str);
proto_tree_add_string(subtree, hf_gsm_apn_str, parameter_tvb, 0, -1, apn_str);
proto_tree_add_item_ret_string(subtree, hf_gsm_apn_str, parameter_tvb, 0, -1, ENC_APN_STR | ENC_NA, wmem_packet_scope(), &apn_str);
proto_item_append_text(actx->created_item, " - %s", apn_str);
@ -20161,7 +20148,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 1121 "./asn1/gsm_map/gsm_map.cnf"
#line 1108 "./asn1/gsm_map/gsm_map.cnf"
tvbuff_t *parameter_tvb;
proto_tree *subtree;
guint8 rat;