aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/goose/goose.cnf
blob: a855a7fec718022e11014d285ce6c73118fa8be1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# goose.cnf
# goose conformation file

# $Id$

#.MODULE_IMPORT

#.EXPORTS

#.PDU

#.NO_EMIT

#.TYPE_RENAME


#.FN_BODY UtcTime

	guint32 len;
	guint32 seconds;
	guint32	fraction;
	guint32 nanoseconds;
	nstime_t ts;
	gchar *	ptime;

	len = tvb_length_remaining(tvb, offset);

	if(len != 8)
	{
		proto_tree_add_expert(tree, actx->pinfo, &ei_goose_mal_utctime, tvb, offset, len);
		if(hf_index >= 0)
		{
			proto_tree_add_string(tree, hf_index, tvb, offset, len, "????");
		}
		return offset;
	}

	seconds = tvb_get_ntohl(tvb, offset);
	fraction = tvb_get_ntoh24(tvb, offset+4) * 0x100; /* Only 3 bytes are recommended */
	nanoseconds = (guint32)( ((guint64)fraction * G_GINT64_CONSTANT(1000000000U)) / G_GINT64_CONSTANT(0x100000000U) ) ;

	ts.secs = seconds;
	ts.nsecs = nanoseconds;

	ptime = abs_time_to_str(&ts, ABSOLUTE_TIME_UTC, TRUE);

	if(hf_index >= 0)
	{
		proto_tree_add_string(tree, hf_index, tvb, offset, len, ptime);
	}

	return offset;



#.TYPE_ATTR
UtcTime	TYPE = FT_STRING DISPLAY = BASE_NONE


#.FIELD_RENAME
GetReferenceRequestPdu/offset getReferenceRequestPDU_offset
GSEMngtResponses/getGsReference gseMngtResponses_GetGSReference
GSEMngtResponses/getGoReference gseMngtResponses_GetGOReference
GSEMngtResponses/getGSSEDataOffset gseMngtResponses_GetGSSEDataOffset
GSEMngtResponses/getGOOSEElementNumber gseMngtResponses_GetGOOSEElementNumber

#.FIELD_ATTR
IECGoosePdu/stNum  TYPE = FT_UINT32  DISPLAY = BASE_DEC
IECGoosePdu/sqNum  TYPE = FT_UINT32  DISPLAY = BASE_DEC

#.END