Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-gsm_bsslap.c
Line
Count
Source
1
/* packet-gsm_bsslap.c
2
 * Routines for Location Services (LCS) Serving Mobile Location Centre - Base Station System (SMLC-BSS) dissection
3
 * Copyright 2008, Anders Broman <anders.broman[at]ericsson.com>
4
 *
5
 * Wireshark - Network traffic analyzer
6
 * By Gerald Combs <gerald@wireshark.org>
7
 * Copyright 1998 Gerald Combs
8
 *
9
 * SPDX-License-Identifier: GPL-2.0-or-later
10
 *
11
 * References: 3GPP TS 48.071 version 7.2.0 Release 7
12
 */
13
14
#include "config.h"
15
16
#include <epan/packet.h>
17
#include <epan/expert.h>
18
#include <epan/tfs.h>
19
#include <wsutil/array.h>
20
21
#include "packet-gsm_a_common.h"
22
23
void proto_reg_handoff_gsm_bsslap(void);
24
void proto_register_gsm_bsslap(void);
25
26
static dissector_handle_t bsslap_rrlp_handle;
27
28
/* Initialize the protocol and registered fields */
29
static int proto_gsm_bsslap;
30
static int hf_gsm_bsslap_msg_type;
31
int hf_gsm_a_bsslap_elem_id;
32
static int hf_gsm_bsslap_ta;
33
static int hf_gsm_bsslap_timer_value;
34
static int hf_gsm_bsslap_ms_pow;
35
static int hf_gsm_bsslap_cause;
36
static int hf_gsm_bsslap_rrlp_flg;
37
static int hf_gsm_bsslap_tfi;
38
static int hf_gsm_bsslap_poll_rep;
39
static int hf_gsm_bsslap_lac;
40
static int hf_gsm_bsslap_cell_id_disc;
41
static int hf_gsm_bsslap_encryption_key;
42
43
/* Initialize the subtree pointers */
44
static int ett_gsm_bsslap;
45
static int ett_bsslap_cell_list;
46
static int ett_bsslap_cell_list_disc2;
47
static int ett_bsslap_cell_list_disc3;
48
49
static expert_field ei_gsm_bsslap_missing_mandatory_element;
50
static expert_field ei_gsm_bsslap_not_decoded_yet;
51
52
/* Table 5.1: Element Identifier codes */
53
#define BSSLAP_PARAM_TIMING_ADVANCE                  0x01
54
#define BSSLAP_PARAM_RESERVED_01                     0x08
55
#define BSSLAP_PARAM_CELL_IDENTITY                   0x09
56
#define BSSLAP_PARAM_RESERVED_02                     0x0A
57
#define BSSLAP_PARAM_RESERVED_03                     0x0B
58
#define BSSLAP_PARAM_RESERVED_04                     0x0C
59
#define BSSLAP_PARAM_CHANNEL_DESCRIPTION             0x10
60
#define BSSLAP_PARAM_RESERVED_05                     0x11
61
#define BSSLAP_PARAM_RESERVED_06                     0x12
62
#define BSSLAP_PARAM_RESERVED_07                     0x13
63
#define BSSLAP_PARAM_MEASUREMENT_REPORT              0x14
64
#define BSSLAP_PARAM_RESERVED_08                     0x15
65
#define BSSLAP_PARAM_CAUSE                           0x18
66
#define BSSLAP_PARAM_RRLP_FLAG                       0x19
67
#define BSSLAP_PARAM_RRLP_IE                         0x1B
68
#define BSSLAP_PARAM_CELL_IDENTITY_LIST              0x1C
69
#define BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT     0x1D
70
#define BSSLAP_PARAM_LOCATION_AREA_CODE              0x1E
71
#define BSSLAP_PARAM_FREQUENCY_LIST                  0x21
72
#define BSSLAP_PARAM_MS_POWER                        0x22
73
#define BSSLAP_PARAM_DELTA_TIMER                     0x23
74
#define BSSLAP_PARAM_SERVING_CELL_IDENTIFIER         0x24
75
#define BSSLAP_PARAM_ENCRYPTION_KEY                  0x25
76
#define BSSLAP_PARAM_CIPHER_MODE_SETTING             0x26
77
#define BSSLAP_PARAM_CHANNEL_MODE                    0x27
78
#define BSSLAP_PARAM_MULTIRATE_CONFIGURATION         0x28
79
#define BSSLAP_PARAM_POLLING_REPETITION              0x29
80
#define BSSLAP_PARAM_PACKET_CHANNEL_DESCRIPTION      0x2A
81
#define BSSLAP_PARAM_TLLI                            0x2B
82
#define BSSLAP_PARAM_TFI                             0x2C
83
#define BSSLAP_PARAM_STARTING_TIME                   0x2D
84
85
static const value_string gsm_bsslap_elem_strings[] = {
86
    {  DE_BLAP_RES1,         "Reserved" },
87
    {  DE_BLAP_TA,           "Timing Advance" },
88
    {  DE_BLAP_RES3,         "Reserved" },          /* (note) */
89
    {  DE_BLAP_RES4,         "Cell Identity" },
90
    {  DE_BLAP_RES5,         "Reserved" },          /* (note) */
91
    {  DE_BLAP_RES6,         "Reserved" },          /* (note) */
92
    {  DE_BLAP_RES7,         "Reserved" },          /* (note) */
93
    {  DE_BLAP_CH_DESC,      "Channel Description" },
94
    {  DE_BLAP_RES9,         "Reserved" },          /* (note) */
95
    {  DE_BLAP_RES10,        "Reserved" },          /* (note) */
96
    {  DE_BLAP_RES11,        "Reserved" },          /* (note) */
97
    {  DE_BLAP_MEAS_REP,     "Measurement Report" },
98
    {  DE_BLAP_RES13,        "Reserved" },          /* (note) */
99
    {  DE_BLAP_CAUSE,        "Cause" },
100
    {  DE_BLAP_RRLP_FLG,     "RRLP Flag" },
101
    {  DE_BLAP_RRLP_IE,      "RRLP IE" },
102
    {  DE_BLAP_CELL_ID_LIST, "Cell Identity List" },
103
    {  DE_BLAP_ENH_MEAS_REP, "Enhanced Measurement Report" },
104
    {  DE_BLAP_LAC,          "Location Area Code" },
105
    {  DE_BLAP_FREQ_LIST,    "Frequency List" },
106
    {  DE_BLAP_MS_POW,       "MS Power" },
107
    {  DE_BLAP_DELTA_TIME,   "Delta Timer" },
108
    {  DE_BLAP_SERV_CELL_ID, "Serving Cell Identifier" },
109
    {  DE_BLAP_ENC_KEY,      "Encryption Key (Kc)" },
110
    {  DE_BLAP_CIP_M_SET,    "Cipher Mode Setting" },
111
    {  DE_BLAP_CH_MODE,      "Channel Mode" },
112
    {  DE_BLAP_POLL_REP,     "Polling Repetition" },
113
    {  DE_BLAP_PKT_CH_DESC,  "Packet Channel Description" },
114
    {  DE_BLAP_TLLI,         "TLLI" },
115
    {  DE_BLAP_TFI,          "TFI" },
116
    {  DE_BLAP_START_TIME,   "Starting Time" },
117
    { 0,        NULL },
118
};
119
value_string_ext gsm_bsslap_elem_strings_ext = VALUE_STRING_EXT_INIT(gsm_bsslap_elem_strings);
120
121
/*
122
 *  NOTE: These values of the codepoints shall not be used as they were used in an earlier version of the
123
 *  protocol.
124
 *  All unassigned codes are spare.
125
 */
126
127
128
0
#define BSSLAP_TA_REQUEST    1
129
0
#define BSSLAP_TA_RESPONSE   2
130
0
#define BSSLAP_REJECT       10
131
0
#define BSSLAP_RESET        11
132
0
#define BSSLAP_ABORT        12
133
0
#define BSSLAP_TA_LAYER3    13
134
0
#define BSSLAP_MS_POS_CMD   15
135
0
#define BSSLAP_MS_POS_RES   16
136
0
#define BSSLAP_U_TDOA_REQ   17
137
0
#define BSSLAP_U_TDOA_RES   18
138
139
/* Table 5.1.1: Message Type codes */
140
static const value_string gsm_a_bsslap_msg_strings[] = {
141
    {  0x00,               "Reserved" },
142
    {  BSSLAP_TA_REQUEST,  "TA REQUEST" },
143
    {  BSSLAP_TA_RESPONSE, "TA RESPONSE" },
144
    {  0x04,               "Reserved" },
145
    {  0x05,               "Reserved" },
146
    {  BSSLAP_REJECT,      "REJECT" },
147
    {  BSSLAP_RESET,       "RESET" },
148
    {  BSSLAP_ABORT,       "ABORT" },
149
    {  BSSLAP_TA_LAYER3,   "TA LAYER3" },
150
    {  BSSLAP_MS_POS_CMD,  "MS Position Command" },
151
    {  BSSLAP_MS_POS_RES,  "MS Position Response" },
152
    {  BSSLAP_U_TDOA_REQ,  "U-TDOA Request" },
153
    {  BSSLAP_U_TDOA_RES,  "U-TDOA Response" },
154
    { 0,            NULL }
155
};
156
157
528
#define NUM_GSM_BSSLAP_ELEM array_length(gsm_bsslap_elem_strings)
158
int ett_gsm_bsslap_elem[NUM_GSM_BSSLAP_ELEM];
159
160
/*
161
 * 5.2 Timing Advance IE
162
 */
163
static uint16_t
164
de_ta(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
165
0
{
166
0
    uint32_t curr_offset;
167
168
0
    curr_offset = offset;
169
0
    proto_tree_add_item(tree, hf_gsm_bsslap_ta, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
170
0
    curr_offset++;
171
172
0
    return curr_offset - offset;
173
0
}
174
/*
175
 * 5.12 Measurement Report IE
176
 */
177
#if 0
178
static uint16_t
179
de_meas_rep(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
180
{
181
    uint32_t curr_offset;
182
183
    curr_offset = offset;
184
    proto_tree_add_expert(tree, pinfo, &ei_gsm_bsslap_not_decoded_yet, tvb, curr_offset, len);
185
186
187
    return len;
188
}
189
#endif
190
/*
191
 * 5.14 Cause IE
192
 */
193
static const value_string gsm_bsslap_cause_vals[] = {
194
    { 0x00, "Congestion" },
195
    { 0x01, "Channel Mode not supported" },
196
    { 0x02, "Positioning procedure not supported" },
197
    { 0x03, "Failure for other radio related events" },
198
    { 0x04, "Intra-BSS handover" },
199
    { 0x05, "Supervision Timer Expired" },
200
    { 0x06, "Inter-BSS handover" },
201
    { 0x07, "Loss of signalling connection to MS" },
202
    { 0x08, "Incorrect serving cell identity" },
203
    { 0x09, "BSSAP-LE Segmentation error" },
204
    { 0,    NULL }
205
};
206
207
static uint16_t
208
de_bsslap_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
209
0
{
210
0
    uint32_t curr_offset;
211
212
0
    curr_offset = offset;
213
0
    proto_tree_add_item(tree, hf_gsm_bsslap_cause, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
214
0
    curr_offset++;
215
216
0
    return curr_offset - offset;
217
0
}
218
/*
219
 * 5.15 RRLP Flag IE
220
 */
221
static const true_false_string gsm_bsslap_rrlp_flg_vals = {
222
    "Not a Positioning Command or final response." ,
223
    "Position Command (SMLC to BSC) or final response (BSC to SMLC)"
224
};
225
static uint16_t
226
de_rrlp_flg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
227
0
{
228
0
    uint32_t curr_offset;
229
230
0
    curr_offset = offset;
231
0
    proto_tree_add_item(tree, hf_gsm_bsslap_rrlp_flg, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
232
0
    curr_offset++;
233
234
0
    return curr_offset - offset;
235
0
}
236
static uint16_t
237
de_rrlp_ie(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
238
0
{
239
0
    uint32_t curr_offset;
240
0
    tvbuff_t *rrlp_tvb;
241
0
    uint16_t length;
242
243
0
    length = tvb_get_ntohs(tvb, offset);
244
245
0
    curr_offset = offset + 2;
246
0
    if (length > 0)
247
0
    {
248
0
        rrlp_tvb = tvb_new_subset_length(tvb, curr_offset, length);
249
0
        if (bsslap_rrlp_handle)
250
0
            call_dissector(bsslap_rrlp_handle, rrlp_tvb, pinfo, tree);
251
0
    }
252
253
0
    curr_offset += length;
254
0
    return curr_offset - offset;
255
0
}
256
/*
257
 * 5.17 Cell Identity List IE
258
 */
259
/*
260
 * The Cell identification discriminator i is coded as follows:
261
 */
262
static const value_string gsm_a_bsslap_cell_id_disc_vals[] = {
263
    {  0x0, "The whole Cell Global Identification, CGI, is used to identify the 2G cells" },
264
    {  0x1, "Location Area Code, LAC, and Cell Identify, CI, are used to identify the 2G cells" },
265
    {  0x2, "3G Cell identification container 1" },
266
    {  0x3, "3G Cell identification container 2" },
267
    { 0,            NULL }
268
};
269
270
271
272
static uint16_t
273
de_cell_id_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
274
0
{
275
0
    uint32_t curr_offset;
276
0
    uint8_t consumed;
277
0
    uint32_t cell_id_disc;
278
0
    uint8_t num_cells;
279
0
    proto_item  *item = NULL, *subitem = NULL;
280
0
    proto_tree  *subtree = NULL;
281
282
0
    curr_offset = offset;
283
0
    num_cells = 0;
284
285
0
    while(len>0){
286
0
        num_cells++;
287
0
        consumed = 0;
288
0
        subtree = proto_tree_add_subtree_format(tree, tvb, curr_offset, -1, ett_bsslap_cell_list, &item, "Cell %u", num_cells);
289
290
0
        if (add_string)
291
0
            add_string[0] = '\0';
292
0
        proto_tree_add_item_ret_uint(subtree, hf_gsm_bsslap_cell_id_disc, tvb, curr_offset, 1, ENC_BIG_ENDIAN, &cell_id_disc);
293
0
        proto_item_append_text(item, " (%s)", val_to_str_const(cell_id_disc, gsm_a_bsslap_cell_id_disc_vals, "Unknown"));
294
0
        curr_offset++;
295
0
        len--;
296
0
        switch(cell_id_disc){
297
0
            case 0:
298
                /* The whole Cell Global Identification, CGI, is used to identify the 2G cells. */
299
0
                consumed+= be_cell_id_aux(tvb, subtree, pinfo, curr_offset, len, NULL, 0, 0);
300
0
                break;
301
0
            case 1:
302
                /* Location Area Code, LAC, and Cell Identify, CI, are used to identify the 2G cells. */
303
0
                consumed+= be_cell_id_aux(tvb, subtree, pinfo, curr_offset, len, NULL, 0, 1);
304
0
                break;
305
0
            case 2:
306
                /* 3G Cell identification container 1
307
                 * Coding of the Target ID for Cell identification discriminator = 0010.
308
                 * Octets (x+1) to (x+9) shall be ignored by the receiver.
309
                 */
310
0
                proto_tree_add_subtree(subtree, tvb, curr_offset, 9, ett_bsslap_cell_list_disc2, &subitem, "Octets (x+1) to (x+9) shall be ignored by the receiver");
311
0
                consumed += 9;
312
0
                break;
313
0
            case 3:
314
                /* 3G Cell identification container 2
315
                 * Coding of the Target ID for Cell identification discriminator = 0011.
316
                 * Octets (x+1) to (x+6) shall be ignored by the receiver.
317
                 */
318
0
                proto_tree_add_subtree(subtree, tvb, curr_offset, 6, ett_bsslap_cell_list_disc3, &subitem, "Octets (x+1) to (x+6) shall be ignored by the receiver");
319
0
                consumed += 6;
320
0
                break;
321
0
            default:
322
0
                proto_tree_add_expert(subtree, pinfo, &ei_gsm_bsslap_not_decoded_yet, tvb, curr_offset, len);
323
0
                consumed = len;
324
0
                break;
325
0
        }
326
0
        curr_offset += consumed;
327
0
        len-=consumed;
328
        /* length is "cell id" + discriminator */
329
0
        proto_item_set_len(item, consumed+1);
330
0
    }
331
332
333
0
    return curr_offset - offset;
334
0
}
335
/*
336
 * 5.18 Enhanced Measurement Report IE
337
 * The Enhanced Measurement Results field is encoded as the contents of the
338
 * ENHANCED MEASUREMENT REPORT message in 3GPP TS 44.018 (excluding the fields:
339
 * "RR short PD", "Message type" and "Short layer 2 header")...
340
 */
341
static uint16_t
342
de_enh_meas_rep(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
343
0
{
344
0
    uint32_t curr_offset;
345
346
0
    curr_offset = offset;
347
    //tvbuff_t* msg_tvb = tvb_new_subset_length(tvb, curr_offset, len);
348
    //sacch_rr_enh_meas_report(msg_tvb, tree, pinfo, 0, len);
349
0
    proto_tree_add_expert(tree, pinfo, &ei_gsm_bsslap_not_decoded_yet, tvb, curr_offset, len);
350
351
352
0
    return len;
353
0
}
354
/*
355
 * 5.19 Location Area Code IE
356
 */
357
static uint16_t
358
de_lac(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
359
0
{
360
0
    uint32_t curr_offset;
361
362
0
    curr_offset = offset;
363
0
    proto_tree_add_item(tree, hf_gsm_bsslap_lac, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
364
0
    curr_offset++;
365
366
0
    return curr_offset - offset;
367
0
}
368
/*
369
 * 5.21 MS Power IE
370
 */
371
static uint16_t
372
de_ms_pow(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
373
0
{
374
0
    uint32_t curr_offset;
375
376
0
    curr_offset = offset;
377
0
    proto_tree_add_item(tree, hf_gsm_bsslap_ms_pow, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
378
0
    curr_offset++;
379
380
0
    return curr_offset - offset;
381
0
}
382
383
/*
384
 * 5.22 Delta Timer IE
385
 */
386
static uint16_t
387
de_delta_time(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
388
0
{
389
0
    uint32_t curr_offset;
390
391
0
    curr_offset = offset;
392
0
    proto_tree_add_item(tree, hf_gsm_bsslap_timer_value, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
393
0
    curr_offset++;
394
395
0
    return curr_offset - offset;
396
0
}
397
/*
398
 * 5.23 Serving Cell Identifier IE
399
 * The Serving Cell Identifier IE is encoded as in 3GPP TS 48.008 (excluding IEI and length field).
400
 */
401
/*
402
 * 5.24 Encryption Key
403
 */
404
static uint16_t
405
de_blap_enc_key(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
406
0
{
407
0
    uint32_t curr_offset;
408
409
0
    curr_offset = offset;
410
0
    proto_tree_add_item(tree, hf_gsm_bsslap_encryption_key, tvb, curr_offset, 8, ENC_NA);
411
0
    curr_offset = curr_offset + 8;
412
413
0
    return curr_offset - offset;
414
0
}
415
/*
416
 * 5.25 Cipher Mode Setting IE
417
 * The Cipher Mode Setting information element is coded as defined in TS 44.018 (excluding IEI).
418
 */
419
/*
420
 * 5.26 Channel Mode IE
421
 * The Channel Mode information element is coded as defined in TS 44.018 (excluding IEI).
422
 */
423
/*
424
 * 5.27 MultiRate Configuration IE
425
 * The MultiRate Configuration information element is coded as defined in TS 44.018 (excluding IEI).
426
 */
427
/*
428
 * 5.28 Polling Repetition IE
429
 */
430
static uint16_t
431
de_poll_rep(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
432
0
{
433
0
    uint32_t curr_offset;
434
435
0
    curr_offset = offset;
436
0
    proto_tree_add_item(tree, hf_gsm_bsslap_poll_rep, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
437
0
    curr_offset++;
438
439
0
    return curr_offset - offset;
440
0
}
441
/*
442
 * 5.29 Packet Channel Description IE
443
 * CSN.1 binary representation of the channel parameters as
444
 * described in TS 44.018 (CCCH) or TS 44.060 (PCCCH) plus
445
 * padding bits (binary 0) as required to achieve 4 complete octets
446
 */
447
static uint16_t
448
de_pkt_ch_desc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, uint32_t offset, unsigned len, char *add_string _U_, int string_len _U_)
449
0
{
450
0
    uint32_t curr_offset;
451
452
0
    curr_offset = offset;
453
0
    proto_tree_add_expert(tree, pinfo, &ei_gsm_bsslap_not_decoded_yet, tvb, curr_offset, len);
454
455
456
0
    return len;
457
0
}
458
/*
459
 * 5.31 TFI IE
460
 * The TFI information element is coded as defined in TS 44.060 (excluding IEI).
461
 * 44.060:
462
 * UPLINK_TFI (5 bit field)
463
 * The Temporary Flow Identity field identifies an uplink Temporary Block Flow (TBF).
464
 * This field is encoded as a binary number. Range 0 to 31
465
 */
466
static uint16_t
467
de_tfi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, uint32_t offset, unsigned len _U_, char *add_string _U_, int string_len _U_)
468
0
{
469
0
    uint32_t curr_offset;
470
471
0
    curr_offset = offset;
472
0
    proto_tree_add_item(tree, hf_gsm_bsslap_tfi, tvb, curr_offset, 1, ENC_BIG_ENDIAN);
473
0
    curr_offset++;
474
475
0
    return curr_offset - offset;
476
0
}
477
478
/*
479
This enum has been moved to packet-gsm_a_common to
480
make it possible to use element dissection from this dissector
481
in other dissectors.
482
It is left here as a comment for easier reference.
483
484
Note this enum must be of the same size as the element decoding list
485
486
typedef enum
487
{
488
    /. BSS LAP Elements 5 ./
489
    DE_BLAP_RES1,           /. Reserved ./
490
    DE_BLAP_TA,             /. Timing Advance ./
491
    DE_BLAP_RES3,           /. Reserved ./          /. (note) ./
492
    DE_BLAP_RES4,           /. Cell Identity ./
493
    DE_BLAP_RES5,           /. Reserved ./          /. (note) ./
494
    DE_BLAP_RES6,           /. Reserved ./          /. (note) ./
495
    DE_BLAP_RES7,           /. Reserved ./          /. (note) ./
496
    DE_BLAP_CH_DESC,        /. Channel Description ./
497
    DE_BLAP_RES9,           /. Reserved ./          /. (note) ./
498
    DE_BLAP_RES10,          /. Reserved ./          /. (note) ./
499
    DE_BLAP_RES11,          /. Reserved ./          /. (note) ./
500
    DE_BLAP_MEAS_REP,       /. Measurement Report ./
501
    DE_BLAP_RES13,          /. Reserved ./          /. (note) ./
502
    DE_BLAP_CAUSE,          /. Cause ./
503
    DE_BLAP_RRLP_FLG,       /. RRLP Flag ./
504
    DE_BLAP_RRLP_IE,        /. RRLP IE ./
505
    DE_BLAP_CELL_ID_LIST,   /. Cell Identity List ./
506
    DE_BLAP_ENH_MEAS_REP,   /. Enhanced Measurement Report ./
507
    DE_BLAP_LAC,            /. Location Area Code ./
508
    DE_BLAP_FREQ_LIST,      /. Frequency List ./
509
    DE_BLAP_MS_POW,         /. MS Power ./
510
    DE_BLAP_DELTA_TIME,     /. Delta Timer ./
511
    DE_BLAP_SERV_CELL_ID,   /. Serving Cell Identifier ./
512
    DE_BLAP_ENC_KEY,        /. Encryption Key (Kc) ./
513
    DE_BLAP_CIP_M_SET,      /. Cipher Mode Setting ./
514
    DE_BLAP_CH_MODE,        /. Channel Mode ./
515
    DE_BLAP_POLL_REP,       /. Polling Repetition ./
516
    DE_BLAP_PKT_CH_DESC,    /. Packet Channel Description ./
517
    DE_BLAP_TLLI,           /. TLLI ./
518
    DE_BLAP_TFI,            /. TFI ./
519
    DE_BLAP_START_TIME,     /. Starting Time ./
520
    BSSLAP_NONE             /. NONE ./
521
}
522
bsslap_elem_idx_t;
523
*/
524
const elem_fcn bsslap_elem_fcn[] = {
525
    /* BSS LAP Elements 5 */
526
    NULL,            /* Reserved */
527
    de_ta,           /* Timing Advance */
528
    NULL,            /* Reserved */          /* (note) */
529
    NULL,            /* "Cell Identity */
530
    NULL,            /* "Reserved */         /* (note) */
531
    NULL,            /* "Reserved */         /* (note) */
532
    NULL,            /* "Reserved */         /* (note) */
533
    NULL,            /* "Channel Description */
534
    NULL,            /* "Reserved */         /* (note) */
535
    NULL,            /* Reserved */          /* (note) */
536
    NULL,            /* Reserved */          /* (note) */
537
    de_rr_meas_res,  /* "Measurement Report */
538
    NULL,            /* "Reserved */         /* (note) */
539
    de_bsslap_cause, /* "Cause */
540
    de_rrlp_flg,     /* "RRLP Flag */
541
    de_rrlp_ie,      /* "RRLP IE */
542
    de_cell_id_list, /* "Cell Identity List */
543
    de_enh_meas_rep, /* Enhanced Measurement Report */
544
    de_lac,          /* "Location Area Code */
545
    NULL,            /* "Frequency List */
546
    de_ms_pow,       /* MS Power */
547
    de_delta_time,   /* Delta Timer */
548
    NULL,            /* Serving Cell Identifier */
549
    de_blap_enc_key, /* Encryption Key (Kc) */
550
    NULL,            /* Cipher Mode Setting */
551
    NULL,            /* Channel Mode */
552
    de_poll_rep,     /* Polling Repetition */
553
    de_pkt_ch_desc,  /* Packet Channel Description */
554
    NULL,            /* TLLI */
555
    de_tfi,          /* TFI */
556
    NULL,            /* Starting Time */
557
    NULL,            /* NONE */
558
};
559
560
240
#define NUM_GSM_BSSLAP_MSG array_length(gsm_a_bsslap_msg_strings)
561
static int ett_gsm_bsslap_msg[NUM_GSM_BSSLAP_MSG];
562
563
/* 4.2.2 TA Response ETSI TS 148 071 V7.2.0 (2007-06) */
564
static void
565
dissect_gsm_bsslap_ta_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
566
0
{
567
0
    uint32_t curr_offset;
568
0
    uint32_t consumed;
569
0
    unsigned   curr_len;
570
571
0
    curr_offset = offset;
572
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
573
574
    /* Cell Identity IE / 5.4 M TV 3 */
575
0
    ELEM_MAND_TV(BSSLAP_PARAM_CELL_IDENTITY, GSM_A_PDU_TYPE_COMMON, DE_CELL_ID, "Serving Cell Identity", ei_gsm_bsslap_missing_mandatory_element);
576
    /* Timing Advance IE / 5.2 M TV 2 */
577
0
    ELEM_MAND_TV(BSSLAP_PARAM_TIMING_ADVANCE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TA, NULL, ei_gsm_bsslap_missing_mandatory_element);
578
    /* Measurement Report IE / 5.12 O TLV 18 */
579
0
    ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_MEAS_REP, " BSSLAP");
580
    /* Enhanced Measurement Report IE / 5.18 O TLV 4-n */
581
0
    ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_ENH_MEAS_REP, NULL);
582
    /* Cell Identity List IE / 5.17 O TLV 6-n */
583
0
    ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CELL_ID_LIST, "-Measured Cell");
584
585
0
    return;
586
587
0
}
588
589
590
/* 4.2.3 (void)   ETSI TS 148 071 V7.2.0 (2007-06) */
591
/* 4.2.4 (void)   ETSI TS 148 071 V7.2.0 (2007-06) */
592
/* 4.2.5 Reject   ETSI TS 148 071 V7.2.0 (2007-06) */
593
static void
594
dissect_gsm_bsslap_reject(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
595
0
{
596
0
    uint32_t curr_offset;
597
0
    uint32_t consumed;
598
0
    unsigned   curr_len;
599
600
0
    curr_offset = offset;
601
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
602
603
    /* Cause IE / 5.14 M TV 2 */
604
0
    ELEM_MAND_TV(BSSLAP_PARAM_CAUSE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CAUSE, NULL, ei_gsm_bsslap_missing_mandatory_element);
605
606
0
    return;
607
0
}
608
609
/* 4.2.6 Reset   ETSI TS 148 071 V7.2.0 (2007-06) */
610
static void
611
dissect_gsm_bsslap_reset(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
612
0
{
613
0
    uint32_t curr_offset;
614
0
    uint32_t consumed;
615
0
    unsigned   curr_len;
616
617
0
    curr_offset = offset;
618
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
619
620
    /* Cell Identity IE / 5.4 M TV 3 */
621
0
    ELEM_MAND_TV(BSSLAP_PARAM_CELL_IDENTITY, GSM_A_PDU_TYPE_COMMON, DE_CELL_ID, NULL, ei_gsm_bsslap_missing_mandatory_element);
622
    /* Timing Advance IE / 5.2 M TV 2 */
623
0
    ELEM_MAND_TV(BSSLAP_PARAM_TIMING_ADVANCE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TA, NULL, ei_gsm_bsslap_missing_mandatory_element);
624
    /* Channel Description IE / 5.8 M TV 4 */
625
0
    ELEM_MAND_TV(BSSLAP_PARAM_CHANNEL_DESCRIPTION,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL, ei_gsm_bsslap_missing_mandatory_element);
626
    /* Cause IE / 5.1 M TV 2 */
627
0
    ELEM_MAND_TV(BSSLAP_PARAM_CAUSE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CAUSE, NULL, ei_gsm_bsslap_missing_mandatory_element);
628
    /* Measurement Report Measurement Report IE / 5.12 O TLV 18 */
629
0
    ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_MEAS_REP, " BSSLAP");
630
    /* Enhanced Measurement Report Enhanced Measurement Report IE / 5.18 O TLV 4-n */
631
0
    ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_ENH_MEAS_REP, NULL);
632
    /* Cell Identity List IE / 5.17 O TLV 6-n */
633
0
    ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CELL_ID_LIST, "-Measured Cell");
634
    /* LAC Location Area Code IE / 5.19 O TV 3 */
635
0
    ELEM_OPT_TLV(BSSLAP_PARAM_LOCATION_AREA_CODE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_LAC, NULL);
636
    /* Frequency List Frequency List IE 5.20 C (note 1) TLV 3-n  */
637
0
    ELEM_OPT_TLV(BSSLAP_PARAM_FREQUENCY_LIST, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, NULL);
638
    /* Channel Mode IE 5.26 C (notes 2 & 4) TV 2 */
639
0
    ELEM_OPT_TV(BSSLAP_PARAM_CHANNEL_MODE, GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, NULL);
640
    /* MultiRate Configuration 5.27 C (notes 3 & 4) TLV 4-n */
641
0
    ELEM_OPT_TLV(BSSLAP_PARAM_MULTIRATE_CONFIGURATION, GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
642
    /* Packet Channel Description Packet Channel Description IE 5.29 C (note 5) TV 4 */
643
0
    ELEM_OPT_TLV(BSSLAP_PARAM_PACKET_CHANNEL_DESCRIPTION, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_PKT_CH_DESC, NULL);
644
    /* TLLI IE 5.30 C (note 5) TV 5 */
645
0
    ELEM_OPT_TV(BSSLAP_PARAM_TLLI, GSM_A_PDU_TYPE_RR, DE_RR_TLLI,NULL);
646
    /* TFI 5.31 C (note 5) TV 2 */
647
0
    ELEM_OPT_TV(BSSLAP_PARAM_TFI, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TFI,NULL);
648
    /* Starting Time IE 5.32 C (note 5) TV 3 */
649
0
    ELEM_OPT_TV(BSSLAP_PARAM_STARTING_TIME, GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, "TBF Starting Time");
650
    /* Encryption Key IE 5.24 C (note 4) TV 9 */
651
0
    ELEM_OPT_TV(BSSLAP_PARAM_ENCRYPTION_KEY, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_ENC_KEY,NULL);
652
    /* Cipher Mode Setting IE 5.25 C (note 4) TV 2 */
653
0
    ELEM_OPT_TV(BSSLAP_PARAM_CIPHER_MODE_SETTING, GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET, NULL);
654
0
    return;
655
0
}
656
657
/* 4.2.7 Abort  ETSI TS 148 071 V7.2.0 (2007-06) */
658
static void
659
dissect_gsm_bsslap_abort(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
660
0
{
661
0
    uint32_t curr_offset;
662
0
    uint32_t consumed;
663
0
    unsigned   curr_len;
664
665
0
    curr_offset = offset;
666
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
667
668
    /* Cause IE / 5.14 M TV 2 */
669
0
    ELEM_MAND_TV(BSSLAP_PARAM_CAUSE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CAUSE, NULL, ei_gsm_bsslap_missing_mandatory_element);
670
671
0
    return;
672
0
}
673
/* 4.2.8 TA Layer3  ETSI TS 148 071 V7.2.0 (2007-06) */
674
static void
675
dissect_gsm_bsslap_ta_layer3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
676
0
{
677
0
    uint32_t curr_offset;
678
0
    uint32_t consumed;
679
0
    unsigned   curr_len;
680
681
0
    curr_offset = offset;
682
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
683
684
    /* Timing Advance IE / 5.2 M TV 2 */
685
0
    ELEM_MAND_TV(BSSLAP_PARAM_TIMING_ADVANCE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TA, NULL, ei_gsm_bsslap_missing_mandatory_element);
686
    /* Measurement Report IE / 5.12 O TLV 18 */
687
0
    ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_MEAS_REP, " BSSLAP");
688
    /* Enhanced Measurement Report IE / 5.18 O TLV 4-n */
689
0
    ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_ENH_MEAS_REP, NULL);
690
    /*Cell Identity List IE / 5.17 O TLV 6-n */
691
0
    ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CELL_ID_LIST, "-Measured Cell");
692
0
    return;
693
0
}
694
/* 4.2.9 MS Position Command  ETSI TS 148 071 V7.2.0 (2007-06) */
695
static void
696
dissect_gsm_bsslap_ms_pos_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
697
0
{
698
0
    uint32_t curr_offset;
699
0
    uint32_t consumed;
700
0
    unsigned   curr_len;
701
702
0
    curr_offset = offset;
703
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
704
705
    /* RRLP flag IE / 5.15 M TV 2 */
706
0
    ELEM_MAND_TV(BSSLAP_PARAM_RRLP_FLAG, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_RRLP_FLG, "flag", ei_gsm_bsslap_missing_mandatory_element);
707
    /* RRLP IE / 5.16 M TLV 3-n */
708
0
    ELEM_MAND_TV(BSSLAP_PARAM_RRLP_IE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_RRLP_IE, "RRLP Info", ei_gsm_bsslap_missing_mandatory_element);
709
0
    return;
710
0
}
711
/* 4.2.10 MS Position Response   ETSI TS 148 071 V7.2.0 (2007-06) */
712
static void
713
dissect_gsm_bsslap_ms_pos_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
714
0
{
715
0
    uint32_t curr_offset;
716
0
    uint32_t consumed;
717
0
    unsigned   curr_len;
718
719
0
    curr_offset = offset;
720
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
721
722
    /* flag RRLP flag IE / 5.15 M TV 2  */
723
0
    ELEM_MAND_TV(BSSLAP_PARAM_RRLP_FLAG, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_RRLP_FLG, "flag", ei_gsm_bsslap_missing_mandatory_element);
724
    /* RRLP Info RRLP IE / 5.16 M TLV 3-n */
725
0
    ELEM_MAND_TV(BSSLAP_PARAM_RRLP_IE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_RRLP_IE, "RRLP Info", ei_gsm_bsslap_missing_mandatory_element);
726
    /* Timing Advance IE / 5.2 O TV 2 */
727
0
    ELEM_OPT_TV(BSSLAP_PARAM_TIMING_ADVANCE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TA, NULL);
728
    /* Measurement Report IE / 5.12 O TLV 18 */
729
0
    ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_MEAS_REP, " BSSLAP");
730
    /* Enhanced Measurement Report IE / 5.18 O TLV 4-n */
731
0
    ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_ENH_MEAS_REP, NULL);
732
    /* Cell Identity List IE / 5.17 O TLV 6-n */
733
0
    ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CELL_ID_LIST, "-Measured Cell");
734
0
    return;
735
0
}
736
/* 4.2.11 U-TDOA Request   ETSI TS 148 071 V7.2.0 (2007-06) */
737
static void
738
dissect_gsm_bsslap_u_tdoa_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
739
0
{
740
0
    uint32_t curr_offset;
741
0
    uint32_t consumed;
742
0
    unsigned   curr_len;
743
744
0
    curr_offset = offset;
745
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
746
747
    /* Delta Timer IE 5.22 O (note 1) TV 2 */
748
0
    ELEM_OPT_TV(BSSLAP_PARAM_DELTA_TIMER, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_DELTA_TIME, NULL);
749
    /*  Polling Repetition IE 5.28 (note) C (note 2) TV 2 */
750
0
    ELEM_OPT_TV(BSSLAP_PARAM_POLLING_REPETITION, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_POLL_REP, NULL);
751
752
0
    return;
753
0
}
754
/* 4.2.12 U-TDOA Response  ETSI TS 148 071 V7.2.0 (2007-06) */
755
static void
756
dissect_gsm_bsslap_u_tdoa_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
757
0
{
758
0
    uint32_t curr_offset;
759
0
    uint32_t consumed;
760
0
    unsigned   curr_len;
761
762
0
    curr_offset = offset;
763
0
    curr_len = tvb_reported_length_remaining(tvb,offset);
764
765
    /* Channel Description IE 5.8 M TV 4 */
766
0
    ELEM_MAND_TV(BSSLAP_PARAM_CHANNEL_DESCRIPTION,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL, ei_gsm_bsslap_missing_mandatory_element);
767
    /* Serving Cell Identifier Cell Identifier IE 5.23 M TLV 4-n */
768
0
    ELEM_MAND_TLV(BSSLAP_PARAM_SERVING_CELL_IDENTIFIER,GSM_A_PDU_TYPE_BSSMAP, BE_CELL_ID, NULL, ei_gsm_bsslap_missing_mandatory_element);
769
    /* Frequency List IE 5.20 C (note 3) TLV 3-n */
770
0
    ELEM_OPT_TLV(BSSLAP_PARAM_FREQUENCY_LIST, GSM_A_PDU_TYPE_RR, DE_RR_FREQ_LIST, NULL);
771
    /* Timing Advance IE 5.2 O TV 2 */
772
0
    ELEM_OPT_TV(BSSLAP_PARAM_TIMING_ADVANCE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TA, NULL);
773
    /* MS Power IE 5.21 O TV 2 */
774
0
    ELEM_OPT_TV(BSSLAP_PARAM_MS_POWER, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_MS_POW, NULL);
775
    /* Measurement Report IE 5.12 O TLV 18 */
776
0
    ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_MEAS_REP, " BSSLAP");
777
    /* Encryption Key IE 5.24 C (note 4) TV 9 */
778
0
    ELEM_OPT_TV(BSSLAP_PARAM_ENCRYPTION_KEY, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_ENC_KEY, NULL);
779
    /* Cipher Mode Setting IE 5.25 C (note 4) TV 2 */
780
0
    ELEM_OPT_TV(BSSLAP_PARAM_CIPHER_MODE_SETTING, GSM_A_PDU_TYPE_RR, DE_RR_CIP_MODE_SET, NULL);
781
    /* Channel Mode IE 5.26 C (notes 1 & 4)TV 2 */
782
0
    ELEM_OPT_TV(BSSLAP_PARAM_CHANNEL_MODE, GSM_A_PDU_TYPE_RR, DE_RR_CH_MODE, NULL);
783
    /* MultiRate Configuration IE 5.27 C (notes 1 & 4)TLV 4-n */
784
0
    ELEM_OPT_TLV(BSSLAP_PARAM_MULTIRATE_CONFIGURATION, GSM_A_PDU_TYPE_RR, DE_RR_MULTIRATE_CONF, NULL);
785
    /* Cell Identity List IE / 5.17 O TLV 6-n */
786
0
    ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CELL_ID_LIST, "-Measured Cell");
787
    /* Packet Channel Description IE 5.29 C (note 5) TV 4 */
788
0
    ELEM_OPT_TLV(BSSLAP_PARAM_PACKET_CHANNEL_DESCRIPTION, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_PKT_CH_DESC, NULL);
789
    /* TLLI IE 5.30 C (note 5) TV 5 */
790
0
    ELEM_OPT_TV(BSSLAP_PARAM_TLLI, GSM_A_PDU_TYPE_RR, DE_RR_TLLI, NULL);
791
    /* TFI IE 5.31 C (note 5) TV 2 BSSLAP_PARAM_TFI*/
792
0
    ELEM_OPT_TV(BSSLAP_PARAM_TFI, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TFI, NULL);
793
    /* Starting Time IE 5.32 C (note 5) TV 3*/
794
0
    ELEM_OPT_TV(BSSLAP_PARAM_STARTING_TIME, GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, "TBF Starting Time");
795
0
    return;
796
0
}
797
798
799
static int
800
dissect_gsm_bsslap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
801
0
{
802
0
    proto_item *item;
803
0
    proto_tree *sub_tree;
804
0
    int offset=0;
805
0
    uint8_t octet;
806
807
/* Make entries in Protocol column and Info column on summary display */
808
0
    col_append_str(pinfo->cinfo, COL_PROTOCOL, "/BSSLAP");
809
0
    if (tree) {
810
0
        octet = tvb_get_uint8(tvb, offset);
811
0
        item = proto_tree_add_item(tree, proto_gsm_bsslap, tvb, 0, -1, ENC_NA);
812
0
        sub_tree = proto_item_add_subtree(item, ett_gsm_bsslap);
813
814
        /* Message Type IE / 5.1 M V 1 */
815
0
        proto_tree_add_item(sub_tree, hf_gsm_bsslap_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
816
0
        offset++;
817
818
0
        switch (octet){
819
0
        case BSSLAP_TA_REQUEST:
820
            /* Only message type IE */
821
0
            break;
822
0
        case BSSLAP_TA_RESPONSE:
823
0
            dissect_gsm_bsslap_ta_res(tvb, sub_tree, pinfo, offset);
824
0
            break;
825
0
        case BSSLAP_REJECT:
826
0
            dissect_gsm_bsslap_reject(tvb, sub_tree, pinfo, offset);
827
0
            break;
828
0
        case BSSLAP_RESET:
829
0
            dissect_gsm_bsslap_reset(tvb, sub_tree, pinfo, offset);
830
0
            break;
831
0
        case BSSLAP_ABORT:
832
0
            dissect_gsm_bsslap_abort(tvb, sub_tree, pinfo, offset);
833
0
            break;
834
0
        case BSSLAP_TA_LAYER3:
835
0
            dissect_gsm_bsslap_ta_layer3(tvb, sub_tree, pinfo, offset);
836
0
            break;
837
0
        case BSSLAP_MS_POS_CMD:
838
0
            dissect_gsm_bsslap_ms_pos_cmd(tvb, sub_tree, pinfo, offset);
839
0
            break;
840
0
        case BSSLAP_MS_POS_RES:
841
0
            dissect_gsm_bsslap_ms_pos_res(tvb, sub_tree, pinfo, offset);
842
0
            break;
843
0
        case BSSLAP_U_TDOA_REQ:
844
0
            dissect_gsm_bsslap_u_tdoa_req(tvb, sub_tree, pinfo, offset);
845
0
            break;
846
0
        case BSSLAP_U_TDOA_RES:
847
0
            dissect_gsm_bsslap_u_tdoa_res(tvb, sub_tree, pinfo, offset);
848
0
            break;
849
0
        default:
850
0
            break;
851
0
        }
852
0
    }
853
854
0
    return tvb_captured_length(tvb);
855
0
}
856
857
void
858
proto_reg_handoff_gsm_bsslap(void)
859
16
{
860
16
    bsslap_rrlp_handle = find_dissector_add_dependency("rrlp", proto_gsm_bsslap);
861
16
}
862
863
void
864
proto_register_gsm_bsslap(void)
865
16
{
866
16
    unsigned    i;
867
16
    unsigned    last_offset;
868
869
870
    /* Setup list of header fields */
871
16
    static hf_register_info hf[] = {
872
16
        { &hf_gsm_bsslap_msg_type,
873
16
            { "Message Type IE",           "gsm_bsslap.msg_type",
874
16
            FT_UINT8, BASE_DEC, VALS(gsm_a_bsslap_msg_strings), 0x0,
875
16
            NULL, HFILL }
876
16
        },
877
16
        { &hf_gsm_a_bsslap_elem_id,
878
16
            { "Element ID", "gsm_bsslap.elem_id",
879
16
            FT_UINT8, BASE_HEX, NULL, 0,
880
16
            NULL, HFILL }
881
16
        },
882
16
        { &hf_gsm_bsslap_ta,
883
16
            { "Timing Advance",           "gsm_bsslap.ta",
884
16
            FT_UINT8, BASE_HEX, NULL, 0x0,
885
16
            NULL, HFILL }
886
16
        },
887
16
        { &hf_gsm_bsslap_timer_value,
888
16
            {"Timer Value", "gsm_bsslap.timerValue",
889
16
            FT_UINT8, BASE_DEC, NULL, 0x0,
890
16
            NULL, HFILL }
891
16
        },
892
893
16
        { &hf_gsm_bsslap_ms_pow,
894
16
            {"MS Power", "gsm_bsslap.MS_pow",
895
16
            FT_UINT8, BASE_DEC, NULL, 0x0,
896
16
            NULL, HFILL }
897
16
        },
898
16
        { &hf_gsm_bsslap_cause,
899
16
            {"Cause", "gsm_bsslap.cause",
900
16
            FT_UINT8, BASE_DEC, VALS(gsm_bsslap_cause_vals), 0x0,
901
16
            NULL, HFILL }
902
16
        },
903
16
        { &hf_gsm_bsslap_rrlp_flg,
904
16
            {"RRLP Flag", "gsm_bsslap.rrlp_flg",
905
16
            FT_BOOLEAN, 8, TFS(&gsm_bsslap_rrlp_flg_vals), 0x01,
906
16
            "Cause", HFILL }
907
16
        },
908
16
        { &hf_gsm_bsslap_tfi,
909
16
            {"TFI", "gsm_bsslap.tfi",
910
16
            FT_UINT8, BASE_DEC, NULL, 0x1f,
911
16
            NULL, HFILL }
912
16
        },
913
16
        { &hf_gsm_bsslap_poll_rep,
914
16
            {"Number of polling repetitions", "gsm_bsslap.poll_rep",
915
16
            FT_UINT8, BASE_DEC, NULL, 0x3F,
916
16
            NULL, HFILL }
917
16
        },
918
16
        { &hf_gsm_bsslap_lac,
919
16
            {"Location Area Code", "gsm_bsslap.lac",
920
16
            FT_UINT8, BASE_DEC, NULL, 0x3f,
921
16
            NULL, HFILL }
922
16
        },
923
16
        { &hf_gsm_bsslap_cell_id_disc,
924
16
            {"Cell identification Discriminator", "gsm_bsslap.cell_id_disc",
925
16
            FT_UINT8, BASE_DEC, VALS(gsm_a_bsslap_cell_id_disc_vals), 0xf,
926
16
            NULL, HFILL }
927
16
        },
928
16
        { &hf_gsm_bsslap_encryption_key,
929
16
            {"Encryption Key (Kc)", "gsm_bsslap.encryption_key",
930
16
            FT_BYTES, BASE_NONE, NULL, 0x0,
931
16
            NULL, HFILL }
932
16
        },
933
16
    };
934
935
16
    static ei_register_info ei[] = {
936
16
        { &ei_gsm_bsslap_missing_mandatory_element, { "gsm_bsslap.missing_mandatory_element", PI_PROTOCOL, PI_WARN, "Missing Mandatory element, rest of dissection is suspect", EXPFILL }},
937
16
        { &ei_gsm_bsslap_not_decoded_yet, { "gsm_bsslap.not_decoded_yet", PI_UNDECODED, PI_WARN, "Not decoded yet", EXPFILL }},
938
16
    };
939
940
16
    expert_module_t* expert_gsm_bsslap;
941
942
    /* Setup protocol subtree array */
943
16
#define NUM_INDIVIDUAL_ELEMS    4
944
16
    int *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_BSSLAP_MSG +
945
16
          NUM_GSM_BSSLAP_ELEM];
946
947
16
    ett[0] = &ett_gsm_bsslap;
948
16
    ett[1] = &ett_bsslap_cell_list;
949
16
    ett[2] = &ett_bsslap_cell_list_disc2;
950
16
    ett[3] = &ett_bsslap_cell_list_disc3;
951
952
16
    last_offset = NUM_INDIVIDUAL_ELEMS;
953
954
240
    for (i=0; i < NUM_GSM_BSSLAP_MSG; i++, last_offset++)
955
224
    {
956
224
        ett[last_offset] = &ett_gsm_bsslap_msg[i];
957
224
    }
958
959
528
    for (i=0; i < NUM_GSM_BSSLAP_ELEM; i++, last_offset++)
960
512
    {
961
512
        ett[last_offset] = &ett_gsm_bsslap_elem[i];
962
512
    }
963
964
965
/* Register the protocol name and description */
966
16
    proto_gsm_bsslap =
967
16
        proto_register_protocol("BSS LCS Assistance Protocol",
968
16
        "BSSLAP", "bsslap");
969
970
/* Required function calls to register the header fields and subtrees used */
971
16
    proto_register_field_array(proto_gsm_bsslap, hf, array_length(hf));
972
16
    proto_register_subtree_array(ett, array_length(ett));
973
16
    expert_gsm_bsslap = expert_register_protocol(proto_gsm_bsslap);
974
16
    expert_register_field_array(expert_gsm_bsslap, ei, array_length(ei));
975
976
16
    register_dissector("gsm_bsslap", dissect_gsm_bsslap, proto_gsm_bsslap);
977
16
}
978
979
/*
980
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
981
 *
982
 * Local variables:
983
 * c-basic-offset: 4
984
 * tab-width: 8
985
 * indent-tabs-mode: nil
986
 * End:
987
 *
988
 * vi: set shiftwidth=4 tabstop=8 expandtab:
989
 * :indentSize=4:tabSize=8:noTabs=true:
990
 */