From 49d87190561c3be6be82c5498388bab61ddfeeef Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Thu, 1 Apr 2010 20:20:25 +0000 Subject: From KATAOKA Toshihiro: Protocol preference for x2ap port. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4634 svn path=/trunk/; revision=32355 --- asn1/x2ap/packet-x2ap-template.c | 12 ++++++++++++ epan/dissectors/packet-x2ap.c | 26 +++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/asn1/x2ap/packet-x2ap-template.c b/asn1/x2ap/packet-x2ap-template.c index 0f1d0b7236..5040368d8e 100644 --- a/asn1/x2ap/packet-x2ap-template.c +++ b/asn1/x2ap/packet-x2ap-template.c @@ -39,6 +39,7 @@ #include #include +#include #include #include "packet-per.h" @@ -88,6 +89,7 @@ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_in static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +void proto_reg_handoff_x2ap(void); #include "packet-x2ap-fn.c" @@ -157,6 +159,7 @@ void proto_register_x2ap(void) { #include "packet-x2ap-ettarr.c" }; + module_t *x2ap_module; /* Register protocol */ proto_x2ap = proto_register_protocol(PNAME, PSNAME, PFNAME); @@ -174,6 +177,15 @@ void proto_register_x2ap(void) { 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); + /* Register configuration options for ports */ + x2ap_module = prefs_register_protocol(proto_x2ap, proto_reg_handoff_x2ap); + + prefs_register_uint_preference(x2ap_module, "sctp.port", + "X2AP SCTP Port", + "Set the SCTP port for X2AP messages", + 10, + &gbl_x2apSctpPort); + } diff --git a/epan/dissectors/packet-x2ap.c b/epan/dissectors/packet-x2ap.c index 2b8f88aa0f..aa4756013d 100644 --- a/epan/dissectors/packet-x2ap.c +++ b/epan/dissectors/packet-x2ap.c @@ -47,6 +47,7 @@ #include #include +#include #include #include "packet-per.h" @@ -165,7 +166,7 @@ typedef enum _ProtocolIE_ID_enum { } ProtocolIE_ID_enum; /*--- End of included file: packet-x2ap-val.h ---*/ -#line 62 "packet-x2ap-template.c" +#line 63 "packet-x2ap-template.c" /* Initialize the protocol and registered fields */ static int proto_x2ap = -1; @@ -425,7 +426,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 68 "packet-x2ap-template.c" +#line 69 "packet-x2ap-template.c" /* Initialize the subtree pointers */ static int ett_x2ap = -1; @@ -545,7 +546,7 @@ static gint ett_x2ap_SuccessfulOutcome = -1; static gint ett_x2ap_UnsuccessfulOutcome = -1; /*--- End of included file: packet-x2ap-ett.c ---*/ -#line 73 "packet-x2ap-template.c" +#line 74 "packet-x2ap-template.c" /* Global variables */ static guint32 ProcedureCode; @@ -564,6 +565,7 @@ static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_in static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +void proto_reg_handoff_x2ap(void); /*--- Included file: packet-x2ap-fn.c ---*/ @@ -4244,7 +4246,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 93 "packet-x2ap-template.c" +#line 95 "packet-x2ap-template.c" static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -5303,7 +5305,7 @@ void proto_register_x2ap(void) { "x2ap.UnsuccessfulOutcome_value", HFILL }}, /*--- End of included file: packet-x2ap-hfarr.c ---*/ -#line 151 "packet-x2ap-template.c" +#line 153 "packet-x2ap-template.c" }; /* List of subtrees */ @@ -5425,9 +5427,10 @@ void proto_register_x2ap(void) { &ett_x2ap_UnsuccessfulOutcome, /*--- End of included file: packet-x2ap-ettarr.c ---*/ -#line 158 "packet-x2ap-template.c" +#line 160 "packet-x2ap-template.c" }; + module_t *x2ap_module; /* Register protocol */ proto_x2ap = proto_register_protocol(PNAME, PSNAME, PFNAME); @@ -5445,6 +5448,15 @@ void proto_register_x2ap(void) { 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); + /* Register configuration options for ports */ + x2ap_module = prefs_register_protocol(proto_x2ap, proto_reg_handoff_x2ap); + + prefs_register_uint_preference(x2ap_module, "sctp.port", + "X2AP SCTP Port", + "Set the SCTP port for X2AP messages", + 10, + &gbl_x2apSctpPort); + } @@ -5547,7 +5559,7 @@ proto_reg_handoff_x2ap(void) /*--- End of included file: packet-x2ap-dis-tab.c ---*/ -#line 194 "packet-x2ap-template.c" +#line 206 "packet-x2ap-template.c" } else { if (SctpPort != 0) { dissector_delete("sctp.port", SctpPort, x2ap_handle); -- cgit v1.2.3