diff options
author | Anders Broman <anders.broman@ericsson.com> | 2011-02-02 23:12:34 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2011-02-02 23:12:34 +0000 |
commit | 77333de27890a968c52a93d47547b70eff8a3540 (patch) | |
tree | ccab264e3bef4a62058a85664e304675997212de /asn1 | |
parent | ac057f844588bfaeecb456acc682f29a193edfca (diff) |
Start to prettify TimeStamp(to be continued).
svn path=/trunk/; revision=35773
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/gprscdr/gprscdr.cnf | 43 | ||||
-rw-r--r-- | asn1/gprscdr/packet-gprscdr-template.c | 2 |
2 files changed, 45 insertions, 0 deletions
diff --git a/asn1/gprscdr/gprscdr.cnf b/asn1/gprscdr/gprscdr.cnf index 89546a261d..9ec29803f6 100644 --- a/asn1/gprscdr/gprscdr.cnf +++ b/asn1/gprscdr/gprscdr.cnf @@ -26,6 +26,49 @@ GPRSCallEventRecord proto_tree_add_text(tree, tvb, offset, -1, "Not dissected"); +#.FN_BODY Timestamp VAL_PTR = ¶meter_tvb + +/* + TimeStamp ::= OCTET STRING (SIZE(9)) + -- The contents of this field are a compact form of the UTCTime format + -- containing local time plus an offset to universal time. Binary coded + -- decimal encoding is employed for the digits to reduce the storage and + -- transmission overhead + -- e.g. YYMMDDhhmmssShhmm + -- where + -- YY = Year 00 to 99 BCD encoded + -- MM = Month 01 to 12 BCD encoded + -- DD = Day 01 to 31 BCD encoded + -- hh = hour 00 to 23 BCD encoded + -- mm = minute 00 to 59 BCD encoded + -- ss = second 00 to 59 BCD encoded + -- S = Sign 0 = "+", "-" ASCII encoded + -- hh = hour 00 to 23 BCD encoded + -- mm = minute 00 to 59 BCD encoded + -- +*/ + tvbuff_t *parameter_tvb; + proto_tree *subtree; + guint8 YY,MM,DD,hh,mm,S,hh2,mm2; + +%(DEFAULT_BODY)s + + if (!parameter_tvb) + return offset; + + subtree = proto_item_add_subtree(actx->created_item, ett_gprscdr_timestamp); + yy = tvb_get_guint8(tvb,0); + MM = tvb_get_guint8(tvb,1); + DD = tvb_get_guint8(tvb,2); + hh = tvb_get_guint8(tvb,3); + mm = tvb_get_guint8(tvb,4); + ss = tvb_get_guint8(tvb,5); + S = tvb_get_guint8(tvb,6); + hh2 = tvb_get_guint8(tvb,7); + mm2 = tvb_get_guint8(tvb,9); + proto_tree_add_text(subtree, tvb, offset, -1, "UTCTime %u%u%u %u:%u.%u",YY,MM,DD,hh,mm,ss); + + #.TYPE_ATTR IPBinaryAddress/iPBinV4Address TYPE = FT_IPv4 DISPLAY = BASE_NONE IPBinaryAddress/iPBinV6Address TYPE = FT_IPv6 DISPLAY = BASE_NONE diff --git a/asn1/gprscdr/packet-gprscdr-template.c b/asn1/gprscdr/packet-gprscdr-template.c index 7ddecc5d4d..c2ee82db9b 100644 --- a/asn1/gprscdr/packet-gprscdr-template.c +++ b/asn1/gprscdr/packet-gprscdr-template.c @@ -45,6 +45,7 @@ static int proto_gprscdr = -1; #include "packet-gprscdr-hf.c" static int ett_gprscdr = -1; +static int ett_gprscdr_timestamp = -1; #include "packet-gprscdr-ett.c" static dissector_handle_t gprscdr_handle; @@ -65,6 +66,7 @@ proto_register_gprscdr(void) /* List of subtrees */ static gint *ett[] = { &ett_gprscdr, + &ett_gprscdr_timestamp, #include "packet-gprscdr-ettarr.c" }; |