aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2008-03-19 19:13:47 +0000
committerAnders Broman <anders.broman@ericsson.com>2008-03-19 19:13:47 +0000
commitfcead8afd0cc9a72e4768556d516df80980c89dc (patch)
tree6e15e78d7c6ea935c0592c4dcfa8b4fb7820c359 /asn1
parent8180eee087b42c4723e111089506c37156d842d6 (diff)
Fix bug http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1809
"UTRAN Iub interface SABP signalling" The text for this protocol is little misleading. It should preferable be changed to. "UTRAN IuBC interface SABP signaling" Add TCP reassembly and dissect Data-Coding-Scheme. svn path=/trunk/; revision=24701
Diffstat (limited to 'asn1')
-rw-r--r--asn1/sabp/SABP-IEs.asn5
-rw-r--r--asn1/sabp/packet-sabp-template.c49
-rw-r--r--asn1/sabp/sabp.cnf29
3 files changed, 78 insertions, 5 deletions
diff --git a/asn1/sabp/SABP-IEs.asn b/asn1/sabp/SABP-IEs.asn
index 2d55b76776..d62c1f94ff 100644
--- a/asn1/sabp/SABP-IEs.asn
+++ b/asn1/sabp/SABP-IEs.asn
@@ -239,7 +239,7 @@ Serial-Number ::= BIT STRING (SIZE (16))
Service-Area-Identifier ::= SEQUENCE {
- pLMNidentity OCTET STRING (SIZE (3))
+ pLMNidentity PLMNidentity
-- Digits 0 to 9, two digits per octet. --
-- Each octet encoded 0000 to 1001. --
-- 1111 used as filler --
@@ -254,6 +254,9 @@ Service-Area-Identifier ::= SEQUENCE {
sac OCTET STRING (SIZE (2))
}
+PLMNidentity ::= TBCD-STRING (SIZE (3))
+
+TBCD-STRING ::= OCTET STRING
-- **TODO** The IE type for these parameters is not known as yet
Service-Areas-List ::= SEQUENCE (SIZE (1..maxnoofSAI)) OF Service-Area-Identifier
diff --git a/asn1/sabp/packet-sabp-template.c b/asn1/sabp/packet-sabp-template.c
index dd369d0f54..0833ed969f 100644
--- a/asn1/sabp/packet-sabp-template.c
+++ b/asn1/sabp/packet-sabp-template.c
@@ -37,21 +37,26 @@
#include <string.h>
#include <epan/asn1.h>
+#include <epan/emem.h>
+#include "packet-tcp.h"
#include "packet-per.h"
+#include "packet-e212.h"
+#include "packet-gsm_map.h"
#ifdef _MSC_VER
/* disable: "warning C4146: unary minus operator applied to unsigned type, result still unsigned" */
#pragma warning(disable:4146)
#endif
-#define PNAME "UTRAN Iub interface SABP signalling"
+#define PNAME "UTRAN IuBC interface SABP signaling"
#define PSNAME "SABP"
#define PFNAME "sabp"
#include "packet-sabp-val.h"
static dissector_handle_t sabp_handle = NULL;
+static dissector_handle_t sabp_tcp_handle = NULL;
/* Initialize the protocol and registered fields */
static int proto_sabp = -1;
@@ -60,6 +65,8 @@ static int proto_sabp = -1;
/* Initialize the subtree pointers */
static int ett_sabp = -1;
+static int ett_sabp_e212 = -1;
+static int ett_sabp_cbs_data_coding = -1;;
#include "packet-sabp-ett.c"
@@ -67,6 +74,10 @@ static int ett_sabp = -1;
static guint32 ProcedureCode;
static guint32 ProtocolIE_ID;
static guint32 ProtocolExtensionID;
+static guint8 sms_encoding;
+
+/* desegmentation of sabp over TCP */
+static gboolean gbl_sabp_desegment = TRUE;
/* Dissector tables */
static dissector_table_t sabp_ies_dissector_table;
@@ -108,6 +119,26 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p
return (dissector_try_port(sabp_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
}
+static guint
+get_sabp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
+{
+ guint32 type_length;
+ int bit_offset;
+ asn1_ctx_t asn1_ctx;
+ asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
+
+ /* Length should be in the 3:d octet */
+ offset = offset + 3;
+
+ bit_offset = offset<<3;
+ /* Get the length of the sabp packet. offset in bits */
+ offset = dissect_per_length_determinant(tvb, bit_offset, &asn1_ctx, NULL, -1, &type_length);
+
+ /* return the remaining length of the PDU */
+ return type_length+5;
+}
+
+
static void
dissect_sabp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
@@ -125,6 +156,14 @@ dissect_sabp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_SABP_PDU_PDU(tvb, pinfo, sabp_tree);
}
+/* Note a little bit of a hack assumes length max takes two bytes and that lenghth start at byte 4 */
+static void
+dissect_sabp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ tcp_dissect_pdus(tvb, pinfo, tree, gbl_sabp_desegment, 5,
+ get_sabp_pdu_len, dissect_sabp);
+}
+
/*--- proto_register_sbap -------------------------------------------*/
void proto_register_sabp(void) {
@@ -137,6 +176,8 @@ void proto_register_sabp(void) {
/* List of subtrees */
static gint *ett[] = {
&ett_sabp,
+ &ett_sabp_e212,
+ &ett_sabp_cbs_data_coding,
#include "packet-sabp-ettarr.c"
};
@@ -149,7 +190,9 @@ void proto_register_sabp(void) {
/* Register dissector */
register_dissector("sabp", dissect_sabp, proto_sabp);
+ register_dissector("sabp.tcp", dissect_sabp_tcp, proto_sabp);
sabp_handle = find_dissector("sabp");
+ sabp_tcp_handle = find_dissector("sabp.tcp");
/* Register dissector tables */
sabp_ies_dissector_table = register_dissector_table("sabp.ies", "SABP-PROTOCOL-IES", FT_UINT32, BASE_DEC);
@@ -170,9 +213,9 @@ proto_reg_handoff_sabp(void)
#include "packet-sabp-dis-tab.c"
sabp_handle = find_dissector("sabp");
- dissector_add("tcp.port", 3452, sabp_handle);
+ dissector_add("tcp.port", 3452, sabp_tcp_handle);
dissector_add("udp.port", 3452, sabp_handle);
- dissector_add_handle("tcp.port", sabp_handle);
+ dissector_add_handle("tcp.port", sabp_tcp_handle);
}
diff --git a/asn1/sabp/sabp.cnf b/asn1/sabp/sabp.cnf
index 72d9dbd1fd..d3963f9686 100644
--- a/asn1/sabp/sabp.cnf
+++ b/asn1/sabp/sabp.cnf
@@ -138,4 +138,31 @@ Restart N sabp.proc.imsg id-Restart-Indication
Failure N sabp.proc.imsg id-Failure-Indication
Error-Indication N sabp.proc.imsg id-Error-Indication
-#.END
+# following construction is not supported by asn2wrs
+# PLMNidentity ::= TBCD-STRING (SIZE (3))
+# TBCD-STRING ::= OCTET STRING
+
+#.FN_BODY PLMNidentity VAL_PTR =
+ tvbuff_t *parameter_tvb=NULL;
+ proto_tree *subtree;
+
+ offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
+ 3, 3, FALSE, &parameter_tvb);
+
+ if (!parameter_tvb)
+ return offset;
+ subtree = proto_item_add_subtree(actx->created_item, ett_sabp_e212);
+ dissect_e212_mcc_mnc(parameter_tvb, subtree, 0);
+
+#.FN_BODY Data-Coding-Scheme VAL_PTR = &parameter_tvb
+ tvbuff_t *parameter_tvb=NULL;
+ proto_tree *subtree;
+
+%(DEFAULT_BODY)s
+
+ if (!parameter_tvb)
+ return offset;
+ subtree = proto_item_add_subtree(actx->created_item, ett_sabp_cbs_data_coding);
+ sms_encoding = dissect_cbs_data_coding_scheme(parameter_tvb, actx->pinfo, subtree);
+
+