MSWSP: add parse_CNatLanguageRestriction()
[wireshark-wip.git] / asn1 / sv / sv.cnf
blobe448da20b0d10d071724bd5418aa91ae94fd9756
1 # sv.cnf
2 # SampledValue conformation file
4 # $Id$
6 #.MODULE_IMPORT
8 #.EXPORTS
10 #.PDU
12 #.NO_EMIT
14 #.TYPE_RENAME
16 #.FIELD_RENAME
18 #.FN_BODY ASDU/smpCnt VAL_PTR = &value
19         guint32 value;
20 %(DEFAULT_BODY)s
21         sv_data.smpCnt = value;
22 #.END
24 #.FN_BODY UtcTime
25         guint32 len;
26         guint32 seconds;
27         guint32 fraction;
28         guint32 nanoseconds;
29         nstime_t ts;
30         gchar * ptime;
32         len = tvb_length_remaining(tvb, offset);
34         if(len != 8)
35         {
36                 proto_tree_add_expert_format(tree, actx->pinfo, &ei_sv_mal_utctime, tvb, offset, len,
37                                 "BER Error: malformed UTCTime encoding, length must be 8 bytes");
38                 if(hf_index >= 0)
39                 {
40                         proto_tree_add_string(tree, hf_index, tvb, offset, len, "????");
41                 }
42                 return offset;
43         }
45         seconds = tvb_get_ntohl(tvb, offset);
46         fraction = tvb_get_ntoh24(tvb, offset+4) * 0x100; /* Only 3 bytes are recommended */
47         nanoseconds = (guint32)( ((guint64)fraction * G_GINT64_CONSTANT(1000000000U)) / G_GINT64_CONSTANT(0x100000000U) ) ;
49         ts.secs = seconds;
50         ts.nsecs = nanoseconds;
52         ptime = abs_time_to_str(&ts, ABSOLUTE_TIME_UTC, TRUE);
54         if(hf_index >= 0)
55         {
56                 proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);
57         }
58         offset += 8;
59         return offset;
60 #.END
62 #.TYPE_ATTR
63 UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE
65 #.FN_BODY ASDU/smpSynch VAL_PTR = &value
66         guint32 value;
67 %(DEFAULT_BODY)s
68         sv_data.smpSynch = value;
69 #.END
71 #.FN_BODY ASDU/smpMod  VAL_PTR = &value
72         guint32 value;
73 %(DEFAULT_BODY)s
74         sv_data.smpMod = value;
75 #.END
77 #.END_OF_CNF