aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2014-10-21 11:00:40 +0200
committerAnders Broman <a.broman58@gmail.com>2014-10-21 10:38:32 +0000
commit39b631da4dcd2b8a27054865040e5a1ebc28df34 (patch)
tree0fbe52642897651a8704222068bba5919c5d3d93 /asn1
parent750d377b30d9a117a007248de9af7275111b00ae (diff)
Add OID callback for private IEs making it possible to call a dissector
for the private OID. Change-Id: Ibb86d8523f1aee14ba1a843ec3ad4becc7729013 Reviewed-on: https://code.wireshark.org/review/4893 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/s1ap/packet-s1ap-template.c3
-rw-r--r--asn1/s1ap/s1ap.cnf24
2 files changed, 22 insertions, 5 deletions
diff --git a/asn1/s1ap/packet-s1ap-template.c b/asn1/s1ap/packet-s1ap-template.c
index 423b8215ec..23739213fa 100644
--- a/asn1/s1ap/packet-s1ap-template.c
+++ b/asn1/s1ap/packet-s1ap-template.c
@@ -30,6 +30,7 @@
#include <glib.h>
#include <epan/packet.h>
+#include <ctype.h>
#include <epan/strutil.h>
#include <epan/asn1.h>
#include <epan/prefs.h>
@@ -90,6 +91,7 @@ enum{
UNSUCCESSFUL_OUTCOME
};
+
/* Global variables */
static guint32 ProcedureCode;
static guint32 ProtocolIE_ID;
@@ -98,6 +100,7 @@ static guint gbl_s1apSctpPort=SCTP_PORT_S1AP;
static guint32 handover_type_value;
static guint32 message_type;
static gboolean g_s1ap_dissect_container = TRUE;
+static const char *obj_id = NULL;
static dissector_handle_t gcsna_handle = NULL;
diff --git a/asn1/s1ap/s1ap.cnf b/asn1/s1ap/s1ap.cnf
index 085647e81e..d8d247a791 100644
--- a/asn1/s1ap/s1ap.cnf
+++ b/asn1/s1ap/s1ap.cnf
@@ -185,6 +185,20 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
# Handle 64 bit constraint
#.FN_PARS BitRate FN_VARIANT = _64b
+#.FN_HDR PrivateIE-ID
+obj_id = NULL;
+
+#.FN_PARS PrivateIE-ID/global FN_VARIANT = _str VAL_PTR = &obj_id
+
+#.FN_BODY PrivateIE-Field/value
+
+ if (obj_id){
+ offset=call_per_oid_callback(obj_id, tvb, actx->pinfo, tree, offset, actx, hf_index);
+ }else{
+%(DEFAULT_BODY)s
+ }
+
+
# following construction is not supported by asn2wrs
# PLMNidentity ::= TBCD-STRING (SIZE (3))
# TBCD-STRING ::= OCTET STRING
@@ -206,7 +220,7 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
tvbuff_t *parameter_tvb=NULL;
int length;
int p_offset;
- gboolean is_printable_ascii;
+ gboolean is_ascii;
%(DEFAULT_BODY)s
@@ -215,14 +229,14 @@ MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
length = tvb_reported_length(parameter_tvb);
- is_printable_ascii = TRUE;
+ is_ascii = TRUE;
for (p_offset=0; p_offset < length; p_offset++){
- if(!g_ascii_isprint(tvb_get_guint8(parameter_tvb, p_offset ))){
- is_printable_ascii = FALSE;
+ if(!isalpha(tvb_get_guint8(parameter_tvb, p_offset ))){
+ is_ascii = FALSE;
break;
}
}
- if (is_printable_ascii)
+ if (is_ascii)
proto_item_append_text(actx->created_item,"(%%s)",tvb_format_text(parameter_tvb, 0, length));
#.END