summaryrefslogtreecommitdiff
path: root/asn1/hnbap
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2010-03-04 06:09:03 +0000
committerAnders Broman <anders.broman@ericsson.com>2010-03-04 06:09:03 +0000
commitb507e40fa78d7411c01807f47bf17abc7c553ade (patch)
tree926303cbec4dcc384d13c5a19659290b97d7ac4d /asn1/hnbap
parentffbdfc3285c73d4d79bb62c074925684683a5f71 (diff)
downloadwireshark-b507e40fa78d7411c01807f47bf17abc7c553ade.tar.gz
From Mark Wallis:
Improvements to newHNBAP Iuh dissector https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4553 Removed check_col() from the patch as it's no longer needed. svn path=/trunk/; revision=32109
Diffstat (limited to 'asn1/hnbap')
-rw-r--r--asn1/hnbap/hnbap.cnf175
-rw-r--r--asn1/hnbap/packet-hnbap-template.c29
2 files changed, 162 insertions, 42 deletions
diff --git a/asn1/hnbap/hnbap.cnf b/asn1/hnbap/hnbap.cnf
index 8ca3604994..91a0d51f63 100644
--- a/asn1/hnbap/hnbap.cnf
+++ b/asn1/hnbap/hnbap.cnf
@@ -56,10 +56,9 @@ CN-DomainIndicator
#.FN_PARS ProcedureCode VAL_PTR = &ProcedureCode
#.FN_FTR ProcedureCode
- col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(ProcedureCode, hnbap_ProcedureCode_vals,
- "unknown message"));
-#.END
+ col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s ",
+ val_to_str(ProcedureCode, hnbap_ProcedureCode_vals,
+ "Unknown Message"));
#.FN_PARS InitiatingMessage/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_InitiatingMessageValue
@@ -67,43 +66,147 @@ CN-DomainIndicator
#.FN_PARS UnsuccessfulOutcome/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_UnsuccessfulOutcomeValue
+# There is no protocol inside HNBAP so fill col info with HNBAP elementary procedure name
+#.FN_BODY HNBRegisterRequest
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "HNB_REGISTER_REQUEST" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY HNBRegisterAccept
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "HNB_REGISTER_ACCEPT" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY HNBRegisterReject
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "HNB_REGISTER_REJECT" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY UERegisterRequest
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "UE_REGISTER_REQUEST" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY UERegisterAccept
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "UE_REGISTER_ACCEPT" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY UERegisterReject
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "UE_REGISTER_REJECT" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+%(DEFAULT_BODY)s
+
+#.FN_BODY UEDe-Register
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "UE_DE-REGISTER" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY HNBDe-Register
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "HNB_DE-REGISTER" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY ErrorIndication
+
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "ERROR_INDICATION" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+
+#.FN_BODY PrivateMessage
+ col_append_str(actx->pinfo->cinfo, COL_INFO, "PRIVATE_MESSAGE" );
+ col_append_fstr(actx->pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(actx->pinfo->cinfo, COL_INFO);
+
+%(DEFAULT_BODY)s
+#.END
+
+
+#.ASSIGN_VALUE_TO_TYPE # HNBAP ASN.1 does not have constants assigned to types
+# ProcedureCode
+id-HNBRegister ProcedureCode
+id-HNBDe-Register ProcedureCode
+id-UERegister ProcedureCode
+id-UEDe-Register ProcedureCode
+id-ErrorIndication ProcedureCode
+id-privateMessage ProcedureCode
+
+# ProtocolIE-ID
+id-Cause ProtocolIE-ID
+id-CriticalityDiagnostics ProtocolIE-ID
+id-HNB-Identity ProtocolIE-ID
+id-Context-ID ProtocolIE-ID
+id-UE-Identity ProtocolIE-ID
+id-LAC ProtocolIE-ID
+id-RAC ProtocolIE-ID
+id-HNB-Location-Information ProtocolIE-ID
+id-PLMNidentity ProtocolIE-ID
+id-SAC ProtocolIE-ID
+id-CellIdentity ProtocolIE-ID
+id-Registration-Cause ProtocolIE-ID
+id-UE-Capabilities ProtocolIE-ID
+id-RNC-ID ProtocolIE-ID
+id-CSG-ID ProtocolIE-ID
+id-BackoffTimer ProtocolIE-ID
+id-HNB-Internet-Information ProtocolIE-ID
+#.END
+
+
#.REGISTER_NEW
#HNBAP-PROTOCOL-IES
-Cause N hnbap.ies id-Cause
-CriticalityDiagnostics N hnbap.ies id-CriticalityDiagnostics
-HNB-Identity N hnbap.ies id-HNB-Identity
-Context-ID N hnbap.ies id-Context-ID
-UE-Identity N hnbap.ies id-UE-Identity
-LAC N hnbap.ies id-LAC
-RAC N hnbap.ies id-RAC
-HNB-Location-Information N hnbap.ies id-HNB-Location-Information
-PLMNidentity N hnbap.ies id-PLMNidentity
-SAC N hnbap.ies id-SAC
-CellIdentity N hnbap.ies id-CellIdentity
-Registration-Cause N hnbap.ies id-Registration-Cause
-UE-Capabilities N hnbap.ies id-UE-Capabilities
-RNC-ID N hnbap.ies id-RNC-ID
-CSG-ID N hnbap.ies id-CSG-ID
-BackoffTimer N hnbap.ies id-BackoffTimer
+Cause N hnbap.ies id-Cause
+CriticalityDiagnostics N hnbap.ies id-CriticalityDiagnostics
+HNB-Identity N hnbap.ies id-HNB-Identity
+Context-ID N hnbap.ies id-Context-ID
+UE-Identity N hnbap.ies id-UE-Identity
+LAC N hnbap.ies id-LAC
+RAC N hnbap.ies id-RAC
+HNB-Location-Information N hnbap.ies id-HNB-Location-Information
+PLMNidentity N hnbap.ies id-PLMNidentity
+SAC N hnbap.ies id-SAC
+CellIdentity N hnbap.ies id-CellIdentity
+Registration-Cause N hnbap.ies id-Registration-Cause
+UE-Capabilities N hnbap.ies id-UE-Capabilities
+RNC-ID N hnbap.ies id-RNC-ID
+CSG-ID N hnbap.ies id-CSG-ID
+BackoffTimer N hnbap.ies id-BackoffTimer
#HNBAP-PROTOCOL-EXTENSION
-IP-Address N hnbap.extension id-HNB-Internet-Information
-HNB-Cell-Access-Mode N hnbap.extension id-HNB-Cell-Access-Mode
-MuxPortNumber N hnbap.extension id-MuxPortNumber
-SAC N hnbap.extension id-Service-Area-For-Broadcast
-CSGMembershipStatus N hnbap.extension id-CSGMembershipStatus
+IP-Address N hnbap.extension id-HNB-Internet-Information
+HNB-Cell-Access-Mode N hnbap.extension id-HNB-Cell-Access-Mode
+MuxPortNumber N hnbap.extension id-MuxPortNumber
+CSGMembershipStatus N hnbap.extension id-CSGMembershipStatus
#HNBAP-ELEMENTARY-PROCEDURE
-HNBRegisterRequest N hnbap.proc.imsg id-HNBRegister
-HNBRegisterAccept N hnbap.proc.sout id-HNBRegister
-HNBRegisterReject N hnbap.proc.uout id-HNBRegister
-UERegisterRequest N hnbap.proc.imsg id-UERegister
-UERegisterAccept N hnbap.proc.sout id-UERegister
-UERegisterReject N hnbap.proc.uout id-UERegister
-UEDe-Register N hnbap.proc.imsg id-UEDe-Register
-HNBDe-Register N hnbap.proc.imsg id-HNBDe-Register
-ErrorIndication N hnbap.proc.imsg id-ErrorIndication
-PrivateMessage N hnbap.proc.imsg id-privateMessage
-
+#CLASS 1
+HNBRegisterRequest N hnbap.proc.imsg id-HNBRegister
+HNBRegisterAccept N hnbap.proc.sout id-HNBRegister
+HNBRegisterReject N hnbap.proc.uout id-HNBRegister
+UERegisterRequest N hnbap.proc.imsg id-UERegister
+UERegisterAccept N hnbap.proc.sout id-UERegister
+UERegisterReject N hnbap.proc.uout id-UERegister
+
+#CLASS 2
+UEDe-Register N hnbap.proc.imsg id-UEDe-Register
+HNBDe-Register N hnbap.proc.imsg id-HNBDe-Register
+ErrorIndication N hnbap.proc.imsg id-ErrorIndication
+PrivateMessage N hnbap.proc.imsg id-privateMessage
#.END
diff --git a/asn1/hnbap/packet-hnbap-template.c b/asn1/hnbap/packet-hnbap-template.c
index fd6fdc4136..231e37ecb6 100644
--- a/asn1/hnbap/packet-hnbap-template.c
+++ b/asn1/hnbap/packet-hnbap-template.c
@@ -36,6 +36,7 @@
#include <epan/packet.h>
#include <epan/sctpppids.h>
#include <epan/asn1.h>
+#include <epan/prefs.h>
#include "packet-per.h"
@@ -47,6 +48,8 @@
#define PNAME "UTRAN Iuh interface HNBAP signalling"
#define PSNAME "HNBAP"
#define PFNAME "hnbap"
+/* Dissector will use SCTP PPID 20 or SCTP port. IANA assigned port = 29169*/
+#define SCTP_PORT_HNBAP 29169;
#include "packet-hnbap-val.h"
@@ -63,6 +66,7 @@ static int ett_hnbap = -1;
/* Global variables */
static guint32 ProcedureCode;
static guint32 ProtocolIE_ID;
+static guint global_sctp_port = SCTP_PORT_HNBAP;
/* Dissector tables */
static dissector_table_t hnbap_ies_dissector_table;
@@ -76,6 +80,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_hnbap(void);
#include "packet-hnbap-fn.c"
@@ -141,6 +146,7 @@ dissect_hnbap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*--- proto_register_hnbap -------------------------------------------*/
void proto_register_hnbap(void) {
+module_t *hnbap_module;
/* List of fields */
@@ -172,6 +178,8 @@ void proto_register_hnbap(void) {
hnbap_proc_sout_dissector_table = register_dissector_table("hnbap.proc.sout", "HNBAP-ELEMENTARY-PROCEDURE SuccessfulOutcome", FT_UINT32, BASE_DEC);
hnbap_proc_uout_dissector_table = register_dissector_table("hnbap.proc.uout", "HNBAP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", FT_UINT32, BASE_DEC);
+ hnbap_module = prefs_register_protocol(proto_hnbap, proto_reg_handoff_hnbap);
+ prefs_register_uint_preference(hnbap_module, "port", "HNBAP SCTP Port", "Set the port for HNBAP messages (Default of 29169)", 10, &global_sctp_port);
}
@@ -179,11 +187,20 @@ void proto_register_hnbap(void) {
void
proto_reg_handoff_hnbap(void)
{
- dissector_handle_t hnbap_handle;
-
- hnbap_handle = find_dissector("hnbap");
- dissector_add("sctp.ppi", HNBAP_PAYLOAD_PROTOCOL_ID, hnbap_handle);
- dissector_add_handle("sctp.port", hnbap_handle); /* for "decode-as" */
-
+ static gboolean initialized = FALSE;
+ static dissector_handle_t hnbap_handle;
+ static guint sctp_port;
+
+ if (!initialized) {
+ hnbap_handle = find_dissector("hnbap");
+ dissector_add("sctp.ppi", HNBAP_PAYLOAD_PROTOCOL_ID, hnbap_handle);
+ initialized = TRUE;
#include "packet-hnbap-dis-tab.c"
+
+ } else {
+ dissector_delete("sctp.port", sctp_port, hnbap_handle);
+ }
+ /* Set our port number for future use */
+ sctp_port = global_sctp_port;
+ dissector_add("sctp.port", sctp_port, hnbap_handle);
}