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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
|
# lcsap.cnf
# lcsap conformation file
#.OPT
PER
ALIGNED
#.END
#.EXPORTS
Correlation-ID_PDU
Positioning-Data_PDU
#.PDU
LCS-AP-PDU
#.MAKE_ENUM
ProcedureCode
ProtocolIE-ID
#.NO_EMIT
TBCD-STRING
#.OMIT_ASSIGNMENT
# Get rid of unused code warnings
Presence
TriggeringMessage
ProtocolIE-ContainerList
Message-Identifier
Bearing
#.END
#.TYPE_RENAME
InitiatingMessage/value InitiatingMessage_value
SuccessfulOutcome/value SuccessfulOutcome_value
UnsuccessfulOutcome/value UnsuccessfulOutcome_value
#.FIELD_RENAME
InitiatingMessage/value initiatingMessagevalue
UnsuccessfulOutcome/value unsuccessfulOutcome_value
SuccessfulOutcome/value successfulOutcome_value
ProtocolExtensionField/id ext_id
#PrivateIE-Field/value private_value
ProtocolIE-Field/value ie_field_value
#.FN_PARS ProtocolIE-ID VAL_PTR=&ProtocolIE_ID
#.FN_FTR ProtocolIE-ID
if (tree) {
proto_item_append_text(proto_item_get_parent_nth(actx->created_item, 2), ": %s", val_to_str(ProtocolIE_ID, VALS(lcsap_ProtocolIE_ID_vals), "unknown (%d)"));
}
#.END
#.FN_PARS ProtocolIE-Field/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_ProtocolIEFieldValue
#.FN_PARS ProtocolExtensionID VAL_PTR=&ProtocolExtensionID
#.FN_PARS ProtocolExtensionField/extensionValue FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_ProtocolExtensionFieldExtensionValue
#.FN_PARS Payload-Type VAL_PTR=&PayloadType
# LCSAP connectionless-transfer
# procedures, which according to 3GPP TS 29.171 LCS-AP, can only contain an LPPa
# payload within the APDU IE of the procedure.
#.FN_HDR Connectionless-Information
PayloadType = 1; /* LPPa */
#.FN_BODY APDU VAL_PTR = ¶meter_tvb
tvbuff_t *parameter_tvb=NULL;
%(DEFAULT_BODY)s
if (parameter_tvb) {
switch (PayloadType) {
case 0:
/* LPP */
if (lpp_handle) {
call_dissector(lpp_handle, parameter_tvb, %(ACTX)s->pinfo, tree);
}
break;
case 1:
/* LPPa */
if (lppa_handle) {
call_dissector(lppa_handle, parameter_tvb, %(ACTX)s->pinfo, tree);
}
break;
default:
break;
}
}
PayloadType = -1;
#.FN_PARS ProcedureCode VAL_PTR = &ProcedureCode
#.FN_FTR ProcedureCode
{
guint8 tmp = tvb_get_guint8(tvb, 0);
if (tmp == 0)
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sReq",
val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
else if (tmp == 32)
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sResp",
val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
else
col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s",
val_to_str(ProcedureCode, lcsap_ProcedureCode_vals, "unknown message"));
}
#.END
#.FN_PARS InitiatingMessage/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_InitiatingMessageValue
#.FN_PARS SuccessfulOutcome/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_SuccessfulOutcomeValue
#.FN_PARS UnsuccessfulOutcome/value FN_VARIANT=_pdu_new TYPE_REF_FN=dissect_UnsuccessfulOutcomeValue
#--- Parameterization is not supported in asn2wrs ---
#ProtocolIE-ContainerList {INTEGER : lowerBound, INTEGER : upperBound, LCS-AP-PROTOCOL-IES : IEsSetParam} ::=
# SEQUENCE (SIZE (lowerBound..upperBound)) OF
# ProtocolIE-Container {{IEsSetParam}}
#.END
# Currently not used
# FN_PARS ProtocolIE-ContainerPairList
#MIN_VAL = asn1_param_get_integer(%(ACTX)s,"lowerBound")
#MAX_VAL = asn1_param_get_integer(%(ACTX)s,"upperBound")
# FN_HDR ProtocolIE-ContainerPairList
# static const asn1_par_def_t ProtocolIE_ContainerPairList_pars[] = {
# { "lowerBound", ASN1_PAR_INTEGER },
# { "upperBound", ASN1_PAR_INTEGER },
# { NULL, 0 }
# };
# asn1_stack_frame_check(actx, "ProtocolIE-ContainerPairList", ProtocolIE_ContainerPairList_pars);
# END
# following construction is not supported by asn2wrs
# PLMN-ID ::= TBCD-STRING (SIZE (3))
# TBCD-STRING ::= OCTET STRING
# 3GPP TS 29.171 version 10.3.0 Release 10
# 7.4.27 PLMN Identity
#.FN_BODY PLMN-ID VAL_PTR = parameter_tvb
tvbuff_t *parameter_tvb=NULL;
proto_tree *subtree;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
3, 3, FALSE, ¶meter_tvb);
if(tvb_reported_length(tvb)==0)
return offset;
if (!parameter_tvb)
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_plmnd_id);
dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, subtree, 0, E212_NONE, FALSE);
#.END
#.FN_BODY Positioning-Method-And-Usage VAL_PTR = ¶meter_tvb
tvbuff_t *parameter_tvb=NULL;
%(DEFAULT_BODY)s
if (!parameter_tvb)
return offset;
proto_tree_add_item(tree, hf_lcsap_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_lcsap_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
#.FN_BODY GNSS-Positioning-Method-And-Usage VAL_PTR = ¶meter_tvb
tvbuff_t *parameter_tvb=NULL;
%(DEFAULT_BODY)s
if (!parameter_tvb)
return offset;
proto_tree_add_item(tree, hf_lcsap_gnss_pos_method, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_lcsap_gnss_id, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_lcsap_gnss_pos_usage, parameter_tvb, 0, 1, ENC_BIG_ENDIAN);
#
# Code copied from packet-gsm_a_common.c
#.FN_BODY Uncertainty-Code VAL_PTR = &uncertainty_code
guint32 uncertainty_code;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 127U, &uncertainty_code, FALSE);
proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1));
#.FN_BODY DegreesLatitude VAL_PTR = °rees
gint32 degrees;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
0U, 8388607U, °rees, FALSE);
proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/8388607) * 90));
#.FN_BODY DegreesLongitude VAL_PTR = °rees
gint32 degrees;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
-8388608, 8388607U, °rees, FALSE);
proto_item_append_text(actx->created_item, " (%.5f degrees)", (((double)degrees/16777215) * 360));
#.FN_BODY IMSI VAL_PTR=&imsi_tvb
tvbuff_t *imsi_tvb;
%(DEFAULT_BODY)s
if (imsi_tvb) {
proto_tree *subtree;
subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_imsi);
dissect_e212_imsi(imsi_tvb, actx->pinfo, subtree, 0, tvb_reported_length(imsi_tvb), FALSE);
}
#.FN_BODY Horizontal-Accuracy VAL_PTR=&uncertainty_code
guint32 uncertainty_code;
%(DEFAULT_BODY)s
#.FN_FTR Horizontal-Accuracy
proto_item_append_text(actx->created_item, " (%.1f m)", 10 * (pow(1.1, (double)uncertainty_code) - 1));
#.FN_BODY Vertical-Accuracy VAL_PTR=&vertical_uncertainty
guint32 vertical_uncertainty;
%(DEFAULT_BODY)s
#.FN_FTR Vertical-Accuracy
proto_item_append_text(actx->created_item, " (%.1f m)", 45 * (pow(1.025, (double)vertical_uncertainty) - 1));
#.FN_BODY Civic-Address VAL_PTR=¶meter_tvb
tvbuff_t *parameter_tvb=NULL;
%(DEFAULT_BODY)s
if (parameter_tvb && xml_handle) {
proto_tree *subtree;
subtree = proto_item_add_subtree(actx->created_item, ett_lcsap_civic_address);
if (tvb_strncaseeql(parameter_tvb, 0, "<?xml", 5) == 0) {
call_dissector(xml_handle, parameter_tvb, actx->pinfo, subtree);
} else {
proto_tree_add_expert(tree, actx->pinfo, &ei_lcsap_civic_data_not_xml, parameter_tvb, 0, -1);
}
}
#.TYPE_ATTR
ProtocolExtensionID TYPE = FT_UINT8 DISPLAY = BASE_DEC STRINGS = VALS(lcsap_ProtocolIE_ID_vals)
#.ASSIGN_VALUE_TO_TYPE # LCSAP does not have constants assigned to types, they are pure INTEGER
# ProcedureCode
id-Location-Service-Request ProcedureCode
id-Connection-Oriented-Information-Transfer ProcedureCode
id-Connectionless-Information-Transfer ProcedureCode
id-Location-Abort ProcedureCode
id-Reset ProcedureCode
id-Ciphering-Key-Data-Delivery ProcedureCode
# ProtocolIE-ID
id-Correlation-ID ProtocolIE-ID
id-Location-Type ProtocolIE-ID
id-E-UTRAN-Cell-Identifier ProtocolIE-ID
id-LCS-Client-Type ProtocolIE-ID
id-LCS-Priority ProtocolIE-ID
id-LCS-QOS ProtocolIE-ID
id-UE-Positioning-Capability ProtocolIE-ID
id-Include-Velocity ProtocolIE-ID
id-IMSI ProtocolIE-ID
id-IMEI ProtocolIE-ID
id-MultipleAPDUs ProtocolIE-ID
id-Positioning-Data ProtocolIE-ID
id-Velocity-Estimate ProtocolIE-ID
id-Accuracy-Fulfillment-Indicator ProtocolIE-ID
id-LCS-Cause ProtocolIE-ID
id-Payload-Type ProtocolIE-ID
id-Return-Error-Cause ProtocolIE-ID
id-APDU ProtocolIE-ID
id-Return-Error-Request ProtocolIE-ID
id-Location-Estimate ProtocolIE-ID
id-Source-Identity ProtocolIE-ID
id-Destination-ID ProtocolIE-ID
id-LCS-Service-Type-ID ProtocolIE-ID
id-Cell-Portion-ID ProtocolIE-ID
id-Civic-Address ProtocolIE-ID
id-Barometric-Pressure ProtocolIE-ID
id-Additional-PositioningDataSet ProtocolIE-ID
id-RAT-Type ProtocolIE-ID
id-Ciphering-Data ProtocolIE-ID
id-Ciphering-Data-Ack ProtocolIE-ID
id-Ciphering-Data-Error-Report ProtocolIE-ID
id-Coverage-Level ProtocolIE-ID
id-UE-Country-Determination-Indication ProtocolIE-ID
id-UE-Area-Indication ProtocolIE-ID
#.REGISTER
#LCS-AP-PROTOCOL-IES
Accuracy-Fulfillment-Indicator N lcsap.ies id-Accuracy-Fulfillment-Indicator
APDU N lcsap.ies id-APDU
Correlation-ID N lcsap.ies id-Correlation-ID
Network-Element N lcsap.ies id-Destination-ID
E-CGI N lcsap.ies id-E-UTRAN-Cell-Identifier
Include-Velocity N lcsap.ies id-Include-Velocity
IMEI N lcsap.ies id-IMEI
IMSI N lcsap.ies id-IMSI
LCS-Client-Type N lcsap.ies id-LCS-Client-Type
LCS-Priority N lcsap.ies id-LCS-Priority
LCS-QoS N lcsap.ies id-LCS-QOS
LCS-Cause N lcsap.ies id-LCS-Cause
Geographical-Area N lcsap.ies id-Location-Estimate
Location-Type N lcsap.ies id-Location-Type
MultipleAPDUs N lcsap.ies id-MultipleAPDUs
Payload-Type N lcsap.ies id-Payload-Type
Positioning-Data N lcsap.ies id-Positioning-Data
Return-Error-Type N lcsap.ies id-Return-Error-Request
Return-Error-Cause N lcsap.ies id-Return-Error-Cause
Network-Element N lcsap.ies id-Source-Identity
UE-Positioning-Capability N lcsap.ies id-UE-Positioning-Capability
Velocity-Estimate N lcsap.ies id-Velocity-Estimate
Barometric-Pressure N lcsap.extension id-Barometric-Pressure
Additional-PositioningDataSet N lcsap.extension id-Additional-PositioningDataSet
RAT-Type N lcsap.ies id-RAT-Type
Ciphering-Data N lcsap.ies id-Ciphering-Data
Ciphering-Data-Ack N lcsap.ies id-Ciphering-Data-Ack
Ciphering-Data-Error-Report N lcsap.ies id-Ciphering-Data-Error-Report
Coverage-Level N lcsap.ies id-Coverage-Level
UE-Country-Determination-Indication N lcsap.ies id-UE-Country-Determination-Indication
UE-Area-Indication N lcsap.ies id-UE-Area-Indication
#LCS-AP-PROTOCOL-EXTENSION
LCS-Service-Type-ID N lcsap.extension id-LCS-Service-Type-ID
Cell-Portion-ID N lcsap.extension id-Cell-Portion-ID
Civic-Address N lcsap.extension id-Civic-Address
E-CGI N lcsap.extension id-E-UTRAN-Cell-Identifier
Location-Request N lcsap.proc.imsg id-Location-Service-Request
Location-Response N lcsap.proc.sout id-Location-Service-Request
Location-Response N lcsap.proc.uout id-Location-Service-Request
Connection-Oriented-Information N lcsap.proc.imsg id-Connection-Oriented-Information-Transfer
Connectionless-Information N lcsap.proc.imsg id-Connectionless-Information-Transfer
Connectionless-Information N lcsap.proc.uout id-Connectionless-Information-Transfer
Location-Abort-Request N lcsap.proc.imsg id-Location-Abort
Location-Response N lcsap.proc.sout id-Location-Abort
Reset-Request N lcsap.proc.imsg id-Reset
Reset-Acknowledge N lcsap.proc.sout id-Reset
Ciphering-Key-Data N lcsap.proc.imsg id-Ciphering-Key-Data-Delivery
Ciphering-Key-Data-Result N lcsap.proc.sout id-Ciphering-Key-Data-Delivery
Ciphering-Key-Data-Result N lcsap.proc.uout id-Ciphering-Key-Data-Delivery
#.TYPE_ATTR
BitRate TYPE = FT_UINT64 DISPLAY = BASE_DEC STRINGS = NULL
#.END
#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 2
# tab-width: 8
# indent-tabs-mode: nil
# End:
#
# vi: set shiftwidth=2 tabstop=8 expandtab:
# :indentSize=2:tabSize=8:noTabs=true:
#
|