d065e654c022cd935bc0fa605adf1dc7db6ddff3
[metze/wireshark/wip.git] / asn1 / goose / goose.cnf
1 # goose.cnf
2 # goose conformation file
3
4 #.MODULE_IMPORT
5
6 #.EXPORTS
7
8 #.PDU_NEW
9
10 #.NO_EMIT ONLY_VALS
11 GOOSEpdu
12
13 #.TYPE_RENAME
14
15
16 #.FN_BODY UtcTime
17
18         guint32 len;
19         guint32 seconds;
20         guint32 fraction;
21         guint32 nanoseconds;
22         nstime_t ts;
23         gchar * ptime;
24
25         len = tvb_length_remaining(tvb, offset);
26
27         if(len != 8)
28         {
29                 proto_tree_add_expert(tree, actx->pinfo, &ei_goose_mal_utctime, tvb, offset, len);
30                 if(hf_index >= 0)
31                 {
32                         proto_tree_add_string(tree, hf_index, tvb, offset, len, "????");
33                 }
34                 return offset;
35         }
36
37         seconds = tvb_get_ntohl(tvb, offset);
38         fraction = tvb_get_ntoh24(tvb, offset+4) * 0x100; /* Only 3 bytes are recommended */
39         nanoseconds = (guint32)( ((guint64)fraction * G_GUINT64_CONSTANT(1000000000)) / G_GUINT64_CONSTANT(0x100000000) ) ;
40
41         ts.secs = seconds;
42         ts.nsecs = nanoseconds;
43
44         ptime = abs_time_to_str(wmem_packet_scope(), &ts, ABSOLUTE_TIME_UTC, TRUE);
45
46         if(hf_index >= 0)
47         {
48                 proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);
49         }
50
51         return offset;
52
53
54
55 #.TYPE_ATTR
56 UtcTime TYPE = FT_STRING DISPLAY = BASE_NONE
57
58
59 #.FIELD_RENAME
60 GetReferenceRequestPdu/offset getReferenceRequestPDU_offset
61 GSEMngtResponses/getGsReference gseMngtResponses_GetGSReference
62 GSEMngtResponses/getGoReference gseMngtResponses_GetGOReference
63 GSEMngtResponses/getGSSEDataOffset gseMngtResponses_GetGSSEDataOffset
64 GSEMngtResponses/getGOOSEElementNumber gseMngtResponses_GetGOOSEElementNumber
65
66 #.FIELD_ATTR
67 IECGoosePdu/stNum  TYPE = FT_UINT32  DISPLAY = BASE_DEC
68 IECGoosePdu/sqNum  TYPE = FT_UINT32  DISPLAY = BASE_DEC
69
70 #.END