diff options
author | Anders Broman <anders.broman@ericsson.com> | 2009-10-28 06:18:05 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2009-10-28 06:18:05 +0000 |
commit | d5cfd0edc9170b6af4adf76452cf8d192f38379c (patch) | |
tree | 9ae504e52f76ea13bd99e4771f50700c44c95cb2 /epan/dissectors/packet-x2ap.c | |
parent | 191f468cafee73d7de3339d2b1a77a096610608a (diff) |
- Remove check_col.
- Make x2ap work.
svn path=/trunk/; revision=30746
Diffstat (limited to 'epan/dissectors/packet-x2ap.c')
-rw-r--r-- | epan/dissectors/packet-x2ap.c | 151 |
1 files changed, 82 insertions, 69 deletions
diff --git a/epan/dissectors/packet-x2ap.c b/epan/dissectors/packet-x2ap.c index a82ab0904d..d8b3de8263 100644 --- a/epan/dissectors/packet-x2ap.c +++ b/epan/dissectors/packet-x2ap.c @@ -50,6 +50,7 @@ #include <epan/sctpppids.h> #include "packet-per.h" +#include "packet-e212.h" #ifdef _MSC_VER /* disable: "warning C4146: unary minus operator applied to unsigned type, result still unsigned" */ @@ -84,19 +85,20 @@ #define maxPools 16 #define maxnoofCells 16 -/* enumerated values for ProcedureCode */ -#define X2AP_ID_HANDOVERPREPARATION 0 -#define X2AP_ID_HANDOVERCANCEL 1 -#define X2AP_ID_LOADINDICATION 2 -#define X2AP_ID_ERRORINDICATION 3 -#define X2AP_ID_SNSTATUSTRANSFER 4 -#define X2AP_ID_UECONTEXTRELEASE 5 -#define X2AP_ID_X2SETUP 6 -#define X2AP_ID_RESET 7 -#define X2AP_ID_ENBCONFIGURATIONUPDATE 8 -#define X2AP_ID_RESOURCESTATUSREPORTINGINITIATION 9 -#define X2AP_ID_RESOURCESTATUSREPORTING 10 -#define X2AP_ID_PRIVATEMESSAGE 11 +typedef enum _ProcedureCode_enum { + id_handoverPreparation = 0, + id_handoverCancel = 1, + id_loadIndication = 2, + id_errorIndication = 3, + id_snStatusTransfer = 4, + id_uEContextRelease = 5, + id_x2Setup = 6, + id_reset = 7, + id_eNBConfigurationUpdate = 8, + id_resourceStatusReportingInitiation = 9, + id_resourceStatusReporting = 10, + id_privateMessage = 11 +} ProcedureCode_enum; typedef enum _ProtocolIE_ID_enum { id_E_RABs_Admitted_Item = 0, @@ -143,7 +145,7 @@ typedef enum _ProtocolIE_ID_enum { } ProtocolIE_ID_enum; /*--- End of included file: packet-x2ap-val.h ---*/ -#line 58 "packet-x2ap-template.c" +#line 59 "packet-x2ap-template.c" /* Initialize the protocol and registered fields */ static int proto_x2ap = -1; @@ -377,7 +379,7 @@ static int hf_x2ap_successfulOutcome_value = -1; /* SuccessfulOutcome_value */ static int hf_x2ap_value = -1; /* UnsuccessfulOutcome_value */ /*--- End of included file: packet-x2ap-hf.c ---*/ -#line 63 "packet-x2ap-template.c" +#line 64 "packet-x2ap-template.c" /* Initialize the subtree pointers */ static int ett_x2ap = -1; @@ -487,7 +489,7 @@ static gint ett_x2ap_SuccessfulOutcome = -1; static gint ett_x2ap_UnsuccessfulOutcome = -1; /*--- End of included file: packet-x2ap-ett.c ---*/ -#line 68 "packet-x2ap-template.c" +#line 69 "packet-x2ap-template.c" /* Global variables */ static guint32 ProcedureCode; @@ -570,35 +572,34 @@ dissect_x2ap_PrivateIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U static const value_string x2ap_ProcedureCode_vals[] = { - { X2AP_ID_HANDOVERPREPARATION, "id-handoverPreparation" }, - { X2AP_ID_HANDOVERCANCEL, "id-handoverCancel" }, - { X2AP_ID_LOADINDICATION, "id-loadIndication" }, - { X2AP_ID_ERRORINDICATION, "id-errorIndication" }, - { X2AP_ID_SNSTATUSTRANSFER, "id-snStatusTransfer" }, - { X2AP_ID_UECONTEXTRELEASE, "id-uEContextRelease" }, - { X2AP_ID_X2SETUP, "id-x2Setup" }, - { X2AP_ID_RESET, "id-reset" }, - { X2AP_ID_ENBCONFIGURATIONUPDATE, "id-eNBConfigurationUpdate" }, - { X2AP_ID_RESOURCESTATUSREPORTINGINITIATION, "id-resourceStatusReportingInitiation" }, - { X2AP_ID_RESOURCESTATUSREPORTING, "id-resourceStatusReporting" }, - { X2AP_ID_PRIVATEMESSAGE, "id-privateMessage" }, + { id_handoverPreparation, "id-handoverPreparation" }, + { id_handoverCancel, "id-handoverCancel" }, + { id_loadIndication, "id-loadIndication" }, + { id_errorIndication, "id-errorIndication" }, + { id_snStatusTransfer, "id-snStatusTransfer" }, + { id_uEContextRelease, "id-uEContextRelease" }, + { id_x2Setup, "id-x2Setup" }, + { id_reset, "id-reset" }, + { id_eNBConfigurationUpdate, "id-eNBConfigurationUpdate" }, + { id_resourceStatusReportingInitiation, "id-resourceStatusReportingInitiation" }, + { id_resourceStatusReporting, "id-resourceStatusReporting" }, + { id_privateMessage, "id-privateMessage" }, { 0, NULL } }; static int dissect_x2ap_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { -#line 65 "x2ap.cnf" +#line 67 "x2ap.cnf" ProcedureCode = 0xFFFF; offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, 255U, &ProcedureCode, FALSE); -#line 58 "x2ap.cnf" - if (check_col(actx->pinfo->cinfo, COL_INFO)) - col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", - val_to_str(ProcedureCode, x2ap_ProcedureCode_vals, - "unknown message")); +#line 61 "x2ap.cnf" + col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ", + val_to_str(ProcedureCode, x2ap_ProcedureCode_vals, + "unknown message")); return offset; } @@ -655,6 +656,11 @@ dissect_x2ap_ProtocolIE_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _ offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index, 0U, maxProtocolIEs, &ProtocolIE_ID, FALSE); +#line 50 "x2ap.cnf" + if (tree) { + proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str(ProtocolIE_ID, VALS(x2ap_ProtocolIE_ID_vals), "unknown (%d)")); + } + return offset; } @@ -918,8 +924,18 @@ dissect_x2ap_BitRate(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr static int dissect_x2ap_PLMN_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { +#line 78 "x2ap.cnf" + tvbuff_t *parameter_tvb=NULL; + offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index, - 3, 3, FALSE, NULL); + 3, 3, FALSE, ¶meter_tvb); + if(tvb_length(tvb)==0) + return offset; + + if (!parameter_tvb) + return offset; + dissect_e212_mcc_mnc(parameter_tvb, tree, 0); + return offset; } @@ -3738,7 +3754,7 @@ static void dissect_X2AP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot /*--- End of included file: packet-x2ap-fn.c ---*/ -#line 88 "packet-x2ap-template.c" +#line 89 "packet-x2ap-template.c" static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -3752,20 +3768,17 @@ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_in static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - if (!ProcedureID) return 0; - return (dissector_try_string(x2ap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_port(x2ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; } static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - if (!ProcedureID) return 0; - return (dissector_try_string(x2ap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_port(x2ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; } static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - if (!ProcedureID) return 0; - return (dissector_try_string(x2ap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; + return (dissector_try_port(x2ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0; } static void @@ -4691,7 +4704,7 @@ void proto_register_x2ap(void) { "x2ap.UnsuccessfulOutcome_value", HFILL }}, /*--- End of included file: packet-x2ap-hfarr.c ---*/ -#line 140 "packet-x2ap-template.c" +#line 138 "packet-x2ap-template.c" }; /* List of subtrees */ @@ -4802,7 +4815,7 @@ void proto_register_x2ap(void) { &ett_x2ap_UnsuccessfulOutcome, /*--- End of included file: packet-x2ap-ettarr.c ---*/ -#line 146 "packet-x2ap-template.c" +#line 144 "packet-x2ap-template.c" }; @@ -4818,9 +4831,9 @@ void proto_register_x2ap(void) { /* Register dissector tables */ x2ap_ies_dissector_table = register_dissector_table("x2ap.ies", "X2AP-PROTOCOL-IES", FT_UINT32, BASE_DEC); x2ap_extension_dissector_table = register_dissector_table("x2ap.extension", "X2AP-PROTOCOL-EXTENSION", FT_UINT32, BASE_DEC); - x2ap_proc_imsg_dissector_table = register_dissector_table("x2ap.proc.imsg", "X2AP-ELEMENTARY-PROCEDURE InitiatingMessage", FT_STRING, BASE_NONE); - x2ap_proc_sout_dissector_table = register_dissector_table("x2ap.proc.sout", "X2AP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_STRING, BASE_NONE); - x2ap_proc_uout_dissector_table = register_dissector_table("x2ap.proc.uout", "X2AP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_STRING, BASE_NONE); + x2ap_proc_imsg_dissector_table = register_dissector_table("x2ap.proc.imsg", "X2AP-ELEMENTARY-PROCEDURE InitiatingMessage", FT_UINT32, BASE_DEC); + x2ap_proc_sout_dissector_table = register_dissector_table("x2ap.proc.sout", "X2AP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_UINT32, BASE_DEC); + x2ap_proc_uout_dissector_table = register_dissector_table("x2ap.proc.uout", "X2AP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_UINT32, BASE_DEC); } @@ -4878,31 +4891,31 @@ proto_reg_handoff_x2ap(void) dissector_add("x2ap.ies", id_ENB1_Measurement_ID, new_create_dissector_handle(dissect_Measurement_ID_PDU, proto_x2ap)); dissector_add("x2ap.ies", id_ENB2_Measurement_ID, new_create_dissector_handle(dissect_Measurement_ID_PDU, proto_x2ap)); dissector_add("x2ap.extension", id_Number_of_Antennaports, new_create_dissector_handle(dissect_Number_of_Antennaports_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-handoverPreparation", new_create_dissector_handle(dissect_HandoverRequest_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.sout", "id-handoverPreparation", new_create_dissector_handle(dissect_HandoverRequestAcknowledge_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.uout", "id-handoverPreparation", new_create_dissector_handle(dissect_HandoverPreparationFailure_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-snStatusTransfer", new_create_dissector_handle(dissect_SNStatusTransfer_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-uEContextRelease", new_create_dissector_handle(dissect_UEContextRelease_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-handoverCancel", new_create_dissector_handle(dissect_HandoverCancel_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-errorIndication", new_create_dissector_handle(dissect_ErrorIndication_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-reset", new_create_dissector_handle(dissect_ResetRequest_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.sout", "id-reset", new_create_dissector_handle(dissect_ResetResponse_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-x2Setup", new_create_dissector_handle(dissect_X2SetupRequest_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.sout", "id-x2Setup", new_create_dissector_handle(dissect_X2SetupResponse_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.uout", "id-x2Setup", new_create_dissector_handle(dissect_X2SetupFailure_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-loadIndication", new_create_dissector_handle(dissect_LoadInformation_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-eNBConfigurationUpdate", new_create_dissector_handle(dissect_ENBConfigurationUpdate_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.sout", "id-eNBConfigurationUpdate", new_create_dissector_handle(dissect_ENBConfigurationUpdateAcknowledge_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.uout", "id-eNBConfigurationUpdate", new_create_dissector_handle(dissect_ENBConfigurationUpdateFailure_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-resourceStatusReportingInitiation", new_create_dissector_handle(dissect_ResourceStatusRequest_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.sout", "id-resourceStatusReportingInitiation", new_create_dissector_handle(dissect_ResourceStatusResponse_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.uout", "id-resourceStatusReportingInitiation", new_create_dissector_handle(dissect_ResourceStatusFailure_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-resourceStatusReporting", new_create_dissector_handle(dissect_ResourceStatusUpdate_PDU, proto_x2ap)); - dissector_add_string("x2ap.proc.imsg", "id-privateMessage", new_create_dissector_handle(dissect_PrivateMessage_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_handoverPreparation, new_create_dissector_handle(dissect_HandoverRequest_PDU, proto_x2ap)); + dissector_add("x2ap.proc.sout", id_handoverPreparation, new_create_dissector_handle(dissect_HandoverRequestAcknowledge_PDU, proto_x2ap)); + dissector_add("x2ap.proc.uout", id_handoverPreparation, new_create_dissector_handle(dissect_HandoverPreparationFailure_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_snStatusTransfer, new_create_dissector_handle(dissect_SNStatusTransfer_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_uEContextRelease, new_create_dissector_handle(dissect_UEContextRelease_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_handoverCancel, new_create_dissector_handle(dissect_HandoverCancel_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_errorIndication, new_create_dissector_handle(dissect_ErrorIndication_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_reset, new_create_dissector_handle(dissect_ResetRequest_PDU, proto_x2ap)); + dissector_add("x2ap.proc.sout", id_reset, new_create_dissector_handle(dissect_ResetResponse_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_x2Setup, new_create_dissector_handle(dissect_X2SetupRequest_PDU, proto_x2ap)); + dissector_add("x2ap.proc.sout", id_x2Setup, new_create_dissector_handle(dissect_X2SetupResponse_PDU, proto_x2ap)); + dissector_add("x2ap.proc.uout", id_x2Setup, new_create_dissector_handle(dissect_X2SetupFailure_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_loadIndication, new_create_dissector_handle(dissect_LoadInformation_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_eNBConfigurationUpdate, new_create_dissector_handle(dissect_ENBConfigurationUpdate_PDU, proto_x2ap)); + dissector_add("x2ap.proc.sout", id_eNBConfigurationUpdate, new_create_dissector_handle(dissect_ENBConfigurationUpdateAcknowledge_PDU, proto_x2ap)); + dissector_add("x2ap.proc.uout", id_eNBConfigurationUpdate, new_create_dissector_handle(dissect_ENBConfigurationUpdateFailure_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_resourceStatusReportingInitiation, new_create_dissector_handle(dissect_ResourceStatusRequest_PDU, proto_x2ap)); + dissector_add("x2ap.proc.sout", id_resourceStatusReportingInitiation, new_create_dissector_handle(dissect_ResourceStatusResponse_PDU, proto_x2ap)); + dissector_add("x2ap.proc.uout", id_resourceStatusReportingInitiation, new_create_dissector_handle(dissect_ResourceStatusFailure_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_resourceStatusReporting, new_create_dissector_handle(dissect_ResourceStatusUpdate_PDU, proto_x2ap)); + dissector_add("x2ap.proc.imsg", id_privateMessage, new_create_dissector_handle(dissect_PrivateMessage_PDU, proto_x2ap)); /*--- End of included file: packet-x2ap-dis-tab.c ---*/ -#line 179 "packet-x2ap-template.c" +#line 177 "packet-x2ap-template.c" } |