You can't return from inside a TRY/CATCH/ENDTRY block (see
[metze/wireshark/wip.git] / asn1 / gprscdr / gprscdr.cnf
1 # gprscdr.cnf
2 # Anders Broman 2011
3 # $Id$
4
5 #.IMPORT ../gsm_map/gsm_map-exp.cnf
6
7 #.MODULE
8
9 #.OMIT_ASSIGNMENT
10 CalledNumber
11 CallReference
12 ChargeIndicator
13 MscNo
14 SystemType
15 SGSNMTLCSRecord
16 SGSNMOLCSRecord
17 SGSNNILCSRecord
18 LCSCause
19 LCSClientIdentity
20 LCSQoSInfo
21 LocationAreaAndCell
22 PositioningData
23 # 6.4 If these are needed MBMS asn1 should be added.
24 SGSNMBMSRecord
25 GGSNMBMSRecord
26 ChangeOfMBMSCondition
27
28 #.EXPORTS
29 GPRSCallEventRecord
30 GPRSCallEventRecord_PDU
31 GPRSRecord
32 GPRSRecord_PDU
33
34 #.CLASS ATTRIBUTE
35 &id                    ObjectIdentifierType
36 &Value
37
38 #.CLASS CONTEXT
39 &id                    ObjectIdentifierType
40 &Value
41
42 #.PDU_NEW
43 GPRSCallEventRecord
44 GPRSRecord
45
46
47 #.FN_BODY ManagementExtension/information
48
49    proto_tree_add_text(tree, tvb, offset, -1, "Not dissected");
50    
51 #.FN_BODY TimeStamp VAL_PTR = &parameter_tvb
52 /*
53  *
54  * The contents of this field are a compact form of the UTCTime format
55  * containing local time plus an offset to universal time. Binary coded
56  * decimal encoding is employed for the digits to reduce the storage and
57  * transmission overhead
58  * e.g. YYMMDDhhmmssShhmm
59  * where
60  * YY   =       Year 00 to 99           BCD encoded
61  * MM   =       Month 01 to 12          BCD encoded
62  * DD   =       Day 01 to 31            BCD encoded
63  * hh   =       hour 00 to 23           BCD encoded
64  * mm   =       minute 00 to 59         BCD encoded
65  * ss   =       second 00 to 59         BCD encoded
66  * S    =       Sign 0 = "+", "-"       ASCII encoded
67  * hh   =       hour 00 to 23           BCD encoded
68  * mm   =       minute 00 to 59         BCD encoded
69  */
70
71  tvbuff_t       *parameter_tvb;
72  
73 %(DEFAULT_BODY)s
74
75  if (!parameter_tvb)
76         return offset;
77
78  proto_item_append_text(actx->created_item, " (UTC %%x-%%x-%%x %%x:%%x:%%x %%s%%x:%%x)",
79                         tvb_get_guint8(parameter_tvb,0),             /* Year */
80                         tvb_get_guint8(parameter_tvb,1),             /* Month */
81                         tvb_get_guint8(parameter_tvb,2),             /* Day */
82                         tvb_get_guint8(parameter_tvb,3),             /* Hour */
83                         tvb_get_guint8(parameter_tvb,4),             /* Minute */
84                         tvb_get_guint8(parameter_tvb,5),             /* Second */
85                         tvb_get_ephemeral_string(parameter_tvb,6,1), /* Sign */
86                         tvb_get_guint8(parameter_tvb,7),             /* Hour */
87                         tvb_get_guint8(parameter_tvb,8)             /* Minute */
88                         );
89  
90 #.FN_BODY MSTimeZone VAL_PTR = &parameter_tvb
91 /*
92  *
93  * 1.Octet: Time Zone and 2. Octet: Daylight saving time, see TS 29.060 [75]
94  */
95  tvbuff_t       *parameter_tvb;
96  guint8 data, data2;
97  char sign;
98
99 %(DEFAULT_BODY)s
100
101  if (!parameter_tvb)
102         return offset;
103
104         data = tvb_get_guint8(parameter_tvb, 0);
105         sign = (data & 0x08) ? '-' : '+';
106         data = (data >> 4) + (data & 0x07) * 10;
107
108         data2 = tvb_get_guint8(tvb, 1) & 0x3;
109         
110         proto_item_append_text(actx->created_item, " (GMT %%c %%d hours %%d minutes %%s)", 
111                         sign, 
112                         data / 4, 
113                         data %% 4 * 15,
114                         val_to_str_const(data2, gprscdr_daylight_saving_time_vals, "Unknown")
115                         );
116                         
117 #.FN_BODY PLMN-Id VAL_PTR = &parameter_tvb
118  tvbuff_t       *parameter_tvb;
119  proto_tree *subtree;
120
121 %(DEFAULT_BODY)s
122
123  if (!parameter_tvb)
124         return offset;
125            
126  subtree = proto_item_add_subtree(actx->created_item, ett_gprscdr_plmn_id);        
127  dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, TRUE);
128  
129 #.TYPE_ATTR
130 IPBinaryAddress/iPBinV4Address TYPE = FT_IPv4  DISPLAY = BASE_NONE   
131 IPBinaryAddress/iPBinV6Address TYPE = FT_IPv6  DISPLAY = BASE_NONE   
132 #.END