aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2004-11-26 23:14:30 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2004-11-26 23:14:30 +0000
commitc0e68bf50c9ac69d8f961380cd9055e53d96c2b3 (patch)
treeb6bf01f4b4057e444297823739c95666db036b88 /asn1
parentc4b39a818f32150482d6c51320779bea106cf459 (diff)
prettify the printing of the octet_format field which is really just a BCD
svn path=/trunk/; revision=12607
Diffstat (limited to 'asn1')
-rwxr-xr-xasn1/smrse/Makefile5
-rw-r--r--asn1/smrse/packet-smrse-template.c5
-rw-r--r--asn1/smrse/smrse.cnf29
3 files changed, 39 insertions, 0 deletions
diff --git a/asn1/smrse/Makefile b/asn1/smrse/Makefile
new file mode 100755
index 0000000000..07a684e36c
--- /dev/null
+++ b/asn1/smrse/Makefile
@@ -0,0 +1,5 @@
+
+../../epan/dissectors/packet-smrse.c : ../../tools/asn2eth.py SMRSE.asn packet-smrse-template.c packet-smrse-template.h smrse.cnf
+ python ../../tools/asn2eth.py -X -b -k -e -p smrse -c smrse.cnf -s packet-smrse-template SMRSE.asn
+ cp packet-smrse.* ../../epan/dissectors
+
diff --git a/asn1/smrse/packet-smrse-template.c b/asn1/smrse/packet-smrse-template.c
index 34f70a0359..f43ed566f3 100644
--- a/asn1/smrse/packet-smrse-template.c
+++ b/asn1/smrse/packet-smrse-template.c
@@ -48,6 +48,7 @@ int proto_smrse = -1;
static int hf_smrse_reserved = -1;
static int hf_smrse_tag = -1;
static int hf_smrse_length = -1;
+static int hf_smrse_Octet_Format = -1;
#include "packet-smrse-hf.c"
/* Initialize the subtree pointers */
@@ -155,6 +156,10 @@ void proto_register_smrse(void) {
{ &hf_smrse_length, {
"Length", "smrse.length", FT_UINT16, BASE_DEC,
NULL, 0, "Length of SMRSE PDU", HFILL }},
+ { &hf_smrse_Octet_Format,
+ { "octet-Format", "smrse.octet_Format",
+ FT_STRING, BASE_HEX, NULL, 0,
+ "SMS-Address/address-value/octet-format", HFILL }},
#include "packet-smrse-hfarr.c"
};
diff --git a/asn1/smrse/smrse.cnf b/asn1/smrse/smrse.cnf
index 81480b6efc..ff44a4a958 100644
--- a/asn1/smrse/smrse.cnf
+++ b/asn1/smrse/smrse.cnf
@@ -15,6 +15,35 @@
#.FIELD_RENAME
+#.FN_BODY SMS-Address/address-value/octet-format
+ char *strp,tmpstr[21];
+ guint32 i, start_offset;
+ guint8 class;
+ gboolean pc, ind;
+ guint32 tag;
+ guint32 len;
+ static char n2a[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+
+ start_offset=offset;
+
+ /* skip the tag and length */
+ offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag);
+ offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind);
+ if(len>10){
+ len=10;
+ }
+ strp=tmpstr;
+ for(i=0;i<len;i++){
+ *strp++=n2a[tvb_get_guint8(tvb, offset)&0x0f];
+ *strp++=n2a[(tvb_get_guint8(tvb, offset)>>4)&0x0f];
+ offset++;
+ }
+ *strp=0;
+
+ proto_tree_add_string(tree, hf_smrse_Octet_Format, tvb, start_offset, offset-start_offset, tmpstr);
+
+ return offset;
+
#.END