From 30c72444c34d47ab5b12c304c3b004e85cc288ad Mon Sep 17 00:00:00 2001 From: sahlberg Date: Fri, 26 Nov 2004 23:14:30 +0000 Subject: prettify the printing of the octet_format field which is really just a BCD git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12607 f5534014-38df-0310-8fa8-9805f1628bb7 --- asn1/smrse/Makefile | 5 +++++ asn1/smrse/packet-smrse-template.c | 5 +++++ asn1/smrse/smrse.cnf | 29 +++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100755 asn1/smrse/Makefile (limited to 'asn1') 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>4)&0x0f]; + offset++; + } + *strp=0; + + proto_tree_add_string(tree, hf_smrse_Octet_Format, tvb, start_offset, offset-start_offset, tmpstr); + + return offset; + #.END -- cgit v1.2.3