diff --git a/asn1/s1ap/s1ap.cnf b/asn1/s1ap/s1ap.cnf index f4c8ee05e9..443cbed8cc 100644 --- a/asn1/s1ap/s1ap.cnf +++ b/asn1/s1ap/s1ap.cnf @@ -134,7 +134,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound") # PLMNidentity ::= TBCD-STRING (SIZE (3)) # TBCD-STRING ::= OCTET STRING -#.FN_BODY PLMNidentity VAL_PTR = +#.FN_BODY PLMNidentity VAL_PTR = parameter_tvb tvbuff_t *parameter_tvb=NULL; offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, @@ -145,6 +145,32 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound") dissect_e212_mcc_mnc(parameter_tvb, tree, 0); #.END +#.FN_BODY ENBname VAL_PTR = parameter_tvb + tvbuff_t *parameter_tvb=NULL; + int length; + int p_offset; + gboolean is_ascii; + + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, + NO_BOUND, NO_BOUND, FALSE, ¶meter_tvb); + +if (!parameter_tvb) + return offset; + + length = tvb_length(parameter_tvb); + + for (p_offset=0; p_offset < length; p_offset++){ + if(!isalpha(tvb_get_guint8(parameter_tvb, p_offset ))){ + is_ascii = FALSE; + break; + } + is_ascii = TRUE; + } + if (is_ascii) + proto_item_append_text(actx->created_item,"(%%s)",tvb_format_text(parameter_tvb, 0, length)); + +#.END + #.TYPE_ATTR ProtocolExtensionID TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(s1ap_ProtocolIE_ID_vals) diff --git a/epan/dissectors/packet-s1ap.c b/epan/dissectors/packet-s1ap.c index ee12d5d14c..c22cf0c850 100644 --- a/epan/dissectors/packet-s1ap.c +++ b/epan/dissectors/packet-s1ap.c @@ -1758,8 +1758,31 @@ dissect_s1ap_ENB_Global_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ static int dissect_s1ap_ENBname(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { +#line 149 "s1ap.cnf" + tvbuff_t *parameter_tvb=NULL; + int length; + int p_offset; + gboolean is_ascii; + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, - NO_BOUND, NO_BOUND, FALSE, NULL); + NO_BOUND, NO_BOUND, FALSE, ¶meter_tvb); + +if (!parameter_tvb) + return offset; + + length = tvb_length(parameter_tvb); + + for (p_offset=0; p_offset < length; p_offset++){ + if(!isalpha(tvb_get_guint8(parameter_tvb, p_offset ))){ + is_ascii = FALSE; + break; + } + is_ascii = TRUE; + } + if (is_ascii) + proto_item_append_text(actx->created_item,"(%s)",tvb_format_text(parameter_tvb, 0, length)); + + return offset; }