aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-06-20 10:29:46 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2011-06-20 10:29:46 +0000
commitf08afca4b5184965aa356a1cfe967f163f1f1b0d (patch)
tree68fb6263c8241dc0ef416f1e1b2d4fc3d3292107 /asn1
parent82e5adf7f1c8fea16722d6df307b2a1252c358e6 (diff)
Pretyfy APN display and make it filterable as a string.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37731 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1')
-rw-r--r--asn1/gsm_map/gsm_map.cnf36
-rw-r--r--asn1/gsm_map/packet-gsm_map-template.c7
2 files changed, 43 insertions, 0 deletions
diff --git a/asn1/gsm_map/gsm_map.cnf b/asn1/gsm_map/gsm_map.cnf
index 547915b2c8..35dac7fe00 100644
--- a/asn1/gsm_map/gsm_map.cnf
+++ b/asn1/gsm_map/gsm_map.cnf
@@ -818,6 +818,42 @@ if (!actx->value_ptr)
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_GeographicalInformation);
dissect_geographical_description(parameter_tvb, actx->pinfo, subtree);
+
+# APN ::= OCTET STRING (SIZE (2..63))
+# Octets are coded according to TS 3GPP TS 23.003
+# 9.1 Structure of APN
+# :
+# The APN consists of one or more labels. Each label is coded as a one octet length field followed by that number of
+# octets coded as 8 bit ASCII characters. Following RFC 1035 [19] the labels shall consist only of the alphabetic
+# characters (A-Z and a-z), digits (0-9) and the hyphen (-). Following RFC 1123 [20], the label shall begin and end with
+# either an alphabetic character or a digit. The case of alphabetic characters is not significant. The APN is not terminated
+# by a length byte of zero.
+#.FN_BODY APN VAL_PTR = &parameter_tvb
+ tvbuff_t *parameter_tvb;
+ proto_tree *subtree;
+ int length, name_len, tmp;
+ guint8 *apn_str = NULL;
+
+%(DEFAULT_BODY)s
+ if (!parameter_tvb)
+ return offset;
+
+ length = tvb_length(parameter_tvb);
+ name_len = tvb_get_guint8(parameter_tvb, 0);
+ apn_str = tvb_get_ephemeral_string(parameter_tvb, 1, length - 1);
+ if (name_len < length-1) {
+ for (;;) {
+ if (name_len >= length - 1)
+ break;
+ tmp = name_len;
+ name_len = name_len + apn_str[tmp] + 1;
+ apn_str[tmp] = '.';
+ }
+ }
+ proto_item_append_text(actx->created_item, " - %%s", apn_str);
+ subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_apn_str);
+ proto_tree_add_string(subtree, hf_gsm_apn_str, parameter_tvb, 0, -1, apn_str);
+
#----------------------------------------------------------------------------------------
#.TYPE_ATTR
SS-Code TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(ssCode_vals)
diff --git a/asn1/gsm_map/packet-gsm_map-template.c b/asn1/gsm_map/packet-gsm_map-template.c
index 0e5389c9d9..5eeb817ed2 100644
--- a/asn1/gsm_map/packet-gsm_map-template.c
+++ b/asn1/gsm_map/packet-gsm_map-template.c
@@ -139,6 +139,7 @@ static int hf_gsm_map_ie_tag = -1;
static int hf_gsm_map_len = -1;
static int hf_gsm_map_disc_par = -1;
static int hf_gsm_map_dlci = -1;
+static int hf_gsm_apn_str = -1;
#include "packet-gsm_map-hf.c"
@@ -165,6 +166,7 @@ static gint ett_gsm_map_externalsignalinfo = -1;
static gint ett_gsm_map_cbs_data_coding = -1;
static gint ett_gsm_map_GlobalCellId = -1;
static gint ett_gsm_map_GeographicalInformation = -1;
+static gint ett_gsm_map_apn_str = -1;
#include "packet-gsm_map-ett.c"
@@ -2460,6 +2462,10 @@ void proto_register_gsm_map(void) {
{ "DLCI", "gsm_map.disc_par",
FT_UINT8, BASE_DEC, NULL, 0,
"Data Link Connection Indicator", HFILL }},
+ { &hf_gsm_apn_str,
+ { "APN", "gsm_map.apn_str",
+ FT_STRING, BASE_NONE, NULL, 0,
+ NULL, HFILL }},
#include "packet-gsm_map-hfarr.c"
};
@@ -2488,6 +2494,7 @@ void proto_register_gsm_map(void) {
&ett_gsm_map_cbs_data_coding,
&ett_gsm_map_GlobalCellId,
&ett_gsm_map_GeographicalInformation,
+ &ett_gsm_map_apn_str,
#include "packet-gsm_map-ettarr.c"
};