diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-04-25 08:39:49 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-04-25 08:39:49 +0000 |
commit | 323585c2e3149ff74d39e43fb0a2e0f05528e2d7 (patch) | |
tree | 748584c465d18cb91a1b2261099047c5b68a60f1 /asn1/m3ap | |
parent | 56add1934d3cf44200614ea7055818467b3d4265 (diff) |
From David Wei:
Significantly improve M3AP dissection and MBMS related GTPv2 dissection.
svn path=/trunk/; revision=42228
Diffstat (limited to 'asn1/m3ap')
-rw-r--r-- | asn1/m3ap/m3ap.cnf | 98 | ||||
-rw-r--r-- | asn1/m3ap/packet-m3ap-template.c | 15 |
2 files changed, 108 insertions, 5 deletions
diff --git a/asn1/m3ap/m3ap.cnf b/asn1/m3ap/m3ap.cnf index a1acc4a209..7ec47d5b38 100644 --- a/asn1/m3ap/m3ap.cnf +++ b/asn1/m3ap/m3ap.cnf @@ -7,6 +7,10 @@ PER ALIGNED #.END +#.USE_VALS_EXT +ProcedureCode +ProtocolIE-ID + #.EXPORTS #.PDU_NEW @@ -16,9 +20,8 @@ M3AP-PDU ProcedureCode ProtocolIE-ID -#.USE_VALS_EXT -ProcedureCode -ProtocolIE-ID +#.NO_EMIT +# TBCD-STRING #.OMIT_ASSIGNMENT # Get rid of unused code warnings @@ -55,7 +58,7 @@ ProtocolIE-Field/value ie_field_value # FN_PARS ProtocolIE-FieldPair/firstValue FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_ProtocolIEFieldPairFirstValue # FN_PARS ProtocolIE-FieldPair/secondValue FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_ProtocolIEFieldPairSecondValue -#.FN_PARS ProtocolExtensionID VAL_PTR=&ProtocolExtensionID +# FN_PARS ProtocolExtensionID VAL_PTR=&ProtocolExtensionID #.FN_PARS ProtocolExtensionField/extensionValue FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_ProtocolExtensionFieldExtensionValue #.FN_PARS ProcedureCode VAL_PTR = &ProcedureCode @@ -112,6 +115,92 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound") # Handle 64 bit constraint #.FN_PARS BitRate FN_VARIANT = _64b +# following construction is not supported by asn2wrs +# PLMNidentity ::= TBCD-STRING (SIZE (3)) + +#.FN_BODY PLMN-Identity VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, + 3, 3, FALSE, ¶meter_tvb); + + if (!parameter_tvb) + return offset; + dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, tree, 0, FALSE); +#.END + +#.FN_BODY IPAddress VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + gint tvb_len; + +%(DEFAULT_BODY)s + + if (!parameter_tvb) + return offset; + + tvb_len = tvb_length(parameter_tvb); + proto_tree_add_item(tree, hf_m3ap_IPAddress, parameter_tvb, 0, tvb_len, ENC_BIG_ENDIAN); +#.END + +#.FN_BODY Absolute-Time-ofMBMS-Data VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + const gchar *time_str; + gint tvb_len; + +%(DEFAULT_BODY)s + + if (!parameter_tvb) + return offset; + + tvb_len = tvb_length(parameter_tvb); + + time_str = tvb_ntp_fmt_ts(parameter_tvb, 0); + proto_tree_add_string(tree, hf_m3ap_Absolute_Time_ofMBMS_Data_value, parameter_tvb, 0, tvb_len, time_str); +#.END + +#.FN_BODY MBMS-Service-Area VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + guint16 tvb_len; + +%(DEFAULT_BODY)s + + if (!parameter_tvb) + return offset; + + tvb_len = tvb_length(parameter_tvb); + + dissect_gtpv2_mbms_service_area(parameter_tvb, actx->pinfo, tree, actx->created_item, tvb_len, 0, 0); +#.END + +#.FN_BODY MBMS-Session-Duration VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + guint16 tvb_len; + + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, + 3, 3, FALSE, ¶meter_tvb); + + if (!parameter_tvb) + return offset; + + tvb_len = tvb_length(parameter_tvb); + + proto_item_append_text(actx->created_item, " "); + dissect_gtpv2_mbms_session_duration(parameter_tvb, actx->pinfo, tree, actx->created_item, tvb_len, 0, 0); +#.END + +#.FN_BODY MinimumTimeToMBMSDataTransfer VAL_PTR = ¶meter_tvb + tvbuff_t *parameter_tvb=NULL; + guint16 tvb_len; + +%(DEFAULT_BODY)s + + if (!parameter_tvb) + return offset; + + tvb_len = tvb_length(parameter_tvb); + dissect_gtpv2_mbms_time_to_data_xfer(parameter_tvb, actx->pinfo, tree, actx->created_item, tvb_len, 0, 0); +#.END + #.ASSIGN_VALUE_TO_TYPE # M3AP does not have constants assigned to types, they are pure INTEGER # ProcedureCode id-mBMSsessionStart ProcedureCode @@ -147,7 +236,6 @@ id-MCEname ProtocolIE-ID id-MBMSServiceAreaList ProtocolIE-ID id-Time-ofMBMS-DataTransfer ProtocolIE-ID id-Time-ofMBMS-DataStop ProtocolIE-ID -#.END #.REGISTER_NEW diff --git a/asn1/m3ap/packet-m3ap-template.c b/asn1/m3ap/packet-m3ap-template.c index 66f40345b2..db89c66f09 100644 --- a/asn1/m3ap/packet-m3ap-template.c +++ b/asn1/m3ap/packet-m3ap-template.c @@ -39,6 +39,8 @@ #include "packet-ber.h" #include "packet-per.h" #include "packet-e212.h" +#include "packet-gtpv2.h" +#include "packet-ntp.h" #define PNAME "M3 Application Protocol" #define PSNAME "M3AP" @@ -53,6 +55,9 @@ static dissector_handle_t m3ap_handle=NULL; /* Initialize the protocol and registered fields */ static int proto_m3ap = -1; +static int hf_m3ap_Absolute_Time_ofMBMS_Data_value = -1; +static int hf_m3ap_IPAddress = -1; + #include "packet-m3ap-hf.c" /* Initialize the subtree pointers */ @@ -137,6 +142,16 @@ void proto_register_m3ap(void) { /* List of fields */ static hf_register_info hf[] = { + { &hf_m3ap_Absolute_Time_ofMBMS_Data_value, + { "Absolute-Time-ofMBMS-Data-value", "m3ap.Absolute_Time_ofMBMS_Data_value", + FT_STRING, BASE_NONE, NULL, 0, + NULL, HFILL } + }, + { &hf_m3ap_IPAddress, + { "IPAddress", "m3ap.IPAddress", + FT_IPv6, BASE_NONE, NULL, 0, + NULL, HFILL } + }, #include "packet-m3ap-hfarr.c" }; |