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>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * References: 3GPP TS 48.071 version 7.2.0 Release 7
32 #include <epan/packet.h>
34 #include "packet-gsm_a_common.h"
36 static dissector_handle_t bsslap_rrlp_handle
= NULL
;
38 /* Initialize the protocol and registered fields */
39 static int proto_gsm_bsslap
= -1;
40 static int hf_gsm_bsslap_msg_type
= -1;
41 int hf_gsm_a_bsslap_elem_id
= -1;
42 static int hf_gsm_bsslap_ta
= -1;
43 static int hf_gsm_bsslap_timer_value
= -1;
44 static int hf_gsm_bsslap_ms_pow
= -1;
45 static int hf_gsm_bsslap_cause
= -1;
46 static int hf_gsm_bsslap_rrlp_flg
= -1;
47 static int hf_gsm_bsslap_tfi
= -1;
48 static int hf_gsm_bsslap_poll_rep
= -1;
49 static int hf_gsm_bsslap_lac
= -1;
50 static int hf_gsm_bsslap_cell_id_disc
= -1;
52 /* Initialize the subtree pointers */
53 static int ett_gsm_bsslap
= -1;
54 static int ett_bsslap_cell_list
= -1;
56 /* Table 5.1: Element Indentifier codes */
57 #define BSSLAP_PARAM_TIMING_ADVANCE 0x01
58 #define BSSLAP_PARAM_RESERVED_01 0x08
59 #define BSSLAP_PARAM_CELL_IDENTITY 0x09
60 #define BSSLAP_PARAM_RESERVED_02 0x0A
61 #define BSSLAP_PARAM_RESERVED_03 0x0B
62 #define BSSLAP_PARAM_RESERVED_04 0x0C
63 #define BSSLAP_PARAM_CHANNEL_DESCRIPTION 0x10
64 #define BSSLAP_PARAM_RESERVED_05 0x11
65 #define BSSLAP_PARAM_RESERVED_06 0x12
66 #define BSSLAP_PARAM_RESERVED_07 0x13
67 #define BSSLAP_PARAM_MEASUREMENT_REPORT 0x14
68 #define BSSLAP_PARAM_RESERVED_08 0x15
69 #define BSSLAP_PARAM_CAUSE 0x18
70 #define BSSLAP_PARAM_RRLP_FLAG 0x19
71 #define BSSLAP_PARAM_RRLP_IE 0x1B
72 #define BSSLAP_PARAM_CELL_IDENTITY_LIST 0x1C
73 #define BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT 0x1D
74 #define BSSLAP_PARAM_LOCATION_AREA_CODE 0x1E
75 #define BSSLAP_PARAM_FREQUENCY_LIST 0x21
76 #define BSSLAP_PARAM_MS_POWER 0x22
77 #define BSSLAP_PARAM_DELTA_TIMER 0x23
78 #define BSSLAP_PARAM_SERVING_CELL_IDENTIFIER 0x24
79 #define BSSLAP_PARAM_ENCRYPTION_KEY 0x25
80 #define BSSLAP_PARAM_CIPHER_MODE_SETTING 0x26
81 #define BSSLAP_PARAM_CHANNEL_MODE 0x27
82 #define BSSLAP_PARAM_MULTIRATE_CONFIGURATION 0x28
83 #define BSSLAP_PARAM_POLLING_REPETITION 0x29
84 #define BSSLAP_PARAM_PACKET_CHANNEL_DESCRIPTION 0x2A
85 #define BSSLAP_PARAM_TLLI 0x2B
86 #define BSSLAP_PARAM_TFI 0x2C
87 #define BSSLAP_PARAM_STARTING_TIME 0x2D
89 static const value_string gsm_bsslap_elem_strings
[] = {
90 { DE_BLAP_RES1
, "Reserved" },
91 { DE_BLAP_TA
, "Timing Advance" },
92 { DE_BLAP_RES3
, "Reserved" }, /* (note) */
93 { DE_BLAP_RES4
, "Cell Identity" },
94 { DE_BLAP_RES5
, "Reserved" }, /* (note) */
95 { DE_BLAP_RES6
, "Reserved" }, /* (note) */
96 { DE_BLAP_RES7
, "Reserved" }, /* (note) */
97 { DE_BLAP_CH_DESC
, "Channel Description" },
98 { DE_BLAP_RES9
, "Reserved" }, /* (note) */
99 { DE_BLAP_RES10
, "Reserved" }, /* (note) */
100 { DE_BLAP_RES11
, "Reserved" }, /* (note) */
101 { DE_BLAP_MEAS_REP
, "Measurement Report" },
102 { DE_BLAP_RES13
, "Reserved" }, /* (note) */
103 { DE_BLAP_CAUSE
, "Cause" },
104 { DE_BLAP_RRLP_FLG
, "RRLP Flag" },
105 { DE_BLAP_RRLP_IE
, "RRLP IE" },
106 { DE_BLAP_CELL_ID_LIST
, "Cell Identity List" },
107 { DE_BLAP_ENH_MEAS_REP
, "Enhanced Measurement Report" },
108 { DE_BLAP_LAC
, "Location Area Code" },
109 { DE_BLAP_FREQ_LIST
, "Frequency List" },
110 { DE_BLAP_MS_POW
, "MS Power" },
111 { DE_BLAP_DELTA_TIME
, "Delta Timer" },
112 { DE_BLAP_SERV_CELL_ID
, "Serving Cell Identifier" },
113 { DE_BLAP_ENC_KEY
, "Encryption Key (Kc)" },
114 { DE_BLAP_CIP_M_SET
, "Cipher Mode Setting" },
115 { DE_BLAP_CH_MODE
, "Channel Mode" },
116 { DE_BLAP_POLL_REP
, "Polling Repetition" },
117 { DE_BLAP_PKT_CH_DESC
, "Packet Channel Description" },
118 { DE_BLAP_TLLI
, "TLLI" },
119 { DE_BLAP_TFI
, "TFI" },
120 { DE_BLAP_START_TIME
, "Starting Time" },
123 value_string_ext gsm_bsslap_elem_strings_ext
= VALUE_STRING_EXT_INIT(gsm_bsslap_elem_strings
);
126 * NOTE: These values of the codepoints shall not be used as they were used in an earlier version of the
128 * All unassigned codes are spare.
132 #define BSSLAP_TA_REQUEST 1
133 #define BSSLAP_TA_RESPONSE 2
134 #define BSSLAP_REJECT 10
135 #define BSSLAP_RESET 11
136 #define BSSLAP_ABORT 12
137 #define BSSLAP_TA_LAYER3 13
138 #define BSSLAP_MS_POS_CMD 15
139 #define BSSLAP_MS_POS_RES 16
140 #define BSSLAP_U_TDOA_REQ 17
141 #define BSSLAP_U_TDOA_RES 18
143 /* Table 5.1.1: Message Type codes */
144 static const value_string gsm_a_bsslap_msg_strings
[] = {
145 { 0x00, "Reserved" },
146 { BSSLAP_TA_REQUEST
, "TA REQUEST" },
147 { BSSLAP_TA_RESPONSE
, "TA RESPONSE" },
148 { 0x04, "Reserved" },
149 { 0x05, "Reserved" },
150 { BSSLAP_REJECT
, "REJECT" },
151 { BSSLAP_RESET
, "RESET" },
152 { BSSLAP_ABORT
, "ABORT" },
153 { BSSLAP_TA_LAYER3
, "TA LAYER3" },
154 { BSSLAP_MS_POS_CMD
, "MS Position Command" },
155 { BSSLAP_MS_POS_RES
, "MS Position Response" },
156 { BSSLAP_U_TDOA_REQ
, "U-TDOA Request" },
157 { BSSLAP_U_TDOA_RES
, "U-TDOA Response" },
161 #define NUM_GSM_BSSLAP_ELEM (sizeof(gsm_bsslap_elem_strings)/sizeof(value_string))
162 gint ett_gsm_bsslap_elem
[NUM_GSM_BSSLAP_ELEM
];
165 * 5.2 Timing Advance IE
168 de_ta(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
172 curr_offset
= offset
;
173 proto_tree_add_item(tree
, hf_gsm_bsslap_ta
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
176 return(curr_offset
- offset
);
179 * 5.12 Measurement Report IE
183 de_meas_rep(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len
, gchar
*add_string _U_
, int string_len _U_
)
187 curr_offset
= offset
;
188 proto_tree_add_text(tree
,tvb
, curr_offset
, len
,"Not decoded yet");
197 static const value_string gsm_bsslap_cause_vals
[] = {
198 { 0x00, "Congestion" },
199 { 0x01, "Channel Mode not supported" },
200 { 0x02, "Positioning procedure not supported" },
201 { 0x03, "Failure for other radio related events" },
202 { 0x04, "Intra-BSS handover" },
203 { 0x05, "Supervision Timer Expired" },
204 { 0x06, "Inter-BSS handover" },
205 { 0x07, "Loss of signalling connection to MS" },
206 { 0x08, "Incorrect serving cell identity" },
207 { 0x09, "BSSAP-LE Segmentation error" },
212 de_bsslap_cause(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
216 curr_offset
= offset
;
217 proto_tree_add_item(tree
, hf_gsm_bsslap_cause
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
220 return(curr_offset
- offset
);
225 static const true_false_string gsm_bsslap_rrlp_flg_vals
= {
226 "Not a Positioning Command or final response." ,
227 "Position Command (SMLC to BSC) or final response (BSC to SMLC)"
230 de_rrlp_flg(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
234 curr_offset
= offset
;
235 proto_tree_add_item(tree
, hf_gsm_bsslap_rrlp_flg
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
238 return(curr_offset
- offset
);
241 de_rrlp_ie(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
247 length
= tvb_get_ntohs(tvb
, offset
);
249 curr_offset
= offset
+ 2;
252 rrlp_tvb
= tvb_new_subset(tvb
, curr_offset
, length
, length
);
253 if (bsslap_rrlp_handle
)
254 call_dissector(bsslap_rrlp_handle
, rrlp_tvb
, pinfo
, tree
);
257 curr_offset
+= length
;
258 return(curr_offset
- offset
);
261 * 5.17 Cell Identity List IE
264 * The Cell identification discriminator i is coded as follows:
266 static const value_string gsm_a_bsslap_cell_id_disc_vals
[] = {
267 { 0x0, "The whole Cell Global Identification, CGI, is used to identify the 2G cells" },
268 { 0x1, "Location Area Code, LAC, and Cell Identify, CI, are used to identify the 2G cells" },
269 { 0x2, "3G Cell identification container 1" },
270 { 0x3, "3G Cell identification container 2" },
277 de_cell_id_list(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, guint32 offset
, guint len
, gchar
*add_string _U_
, int string_len _U_
)
283 proto_item
*item
= NULL
;
284 proto_tree
*subtree
= NULL
;
286 curr_offset
= offset
;
287 cell_id_disc
= tvb_get_guint8(tvb
,curr_offset
);
293 item
= proto_tree_add_text(tree
, tvb
, curr_offset
, -1, "Cell %u", num_cells
);
294 subtree
= proto_item_add_subtree(item
, ett_bsslap_cell_list
);
297 add_string
[0] = '\0';
298 proto_tree_add_item(subtree
, hf_gsm_bsslap_cell_id_disc
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
301 switch(cell_id_disc
){
303 /* The whole Cell Global Identification, CGI, is used to identify the 2G cells. */
304 consumed
+= be_cell_id_aux(tvb
, subtree
, pinfo
, curr_offset
, len
, NULL
, 0, 0);
307 /* Location Area Code, LAC, and Cell Identify, CI, are used to identify the 2G cells. */
308 consumed
+= be_cell_id_aux(tvb
, subtree
, pinfo
, curr_offset
, len
, NULL
, 0, 1);
311 /* 3G Cell identification container 1 */
314 /* 3G Cell identification container 2 */
317 proto_tree_add_text(subtree
,tvb
, curr_offset
, len
,"Not decoded yet");
321 curr_offset
+= consumed
;
323 /* lengt is "cell id" + discriminator */
324 proto_item_set_len(item
, consumed
+1);
328 return(curr_offset
- offset
);
331 * 5.18 Enhanced Measurement Report IE
332 * The Enhanced Measurement Results field is encoded as the contents of the
333 * ENHANCED MEASUREMENT REPORT message in 3GPP TS 44.018 (excluding the fields:
334 * "RR short PD", "Message type" and "Short layer 2 header")...
337 de_enh_meas_rep(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len
, gchar
*add_string _U_
, int string_len _U_
)
341 curr_offset
= offset
;
342 proto_tree_add_text(tree
,tvb
, curr_offset
, len
,"Not decoded yet");
348 * 5.19 Location Area Code IE
351 de_lac(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
355 curr_offset
= offset
;
356 proto_tree_add_item(tree
, hf_gsm_bsslap_lac
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
359 return(curr_offset
- offset
);
365 de_ms_pow(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
369 curr_offset
= offset
;
370 proto_tree_add_item(tree
, hf_gsm_bsslap_ms_pow
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
373 return(curr_offset
- offset
);
377 * 5.22 Delta Timer IE
380 de_delta_time(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
384 curr_offset
= offset
;
385 proto_tree_add_item(tree
, hf_gsm_bsslap_timer_value
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
388 return(curr_offset
- offset
);
391 * 5.23 Serving Cell Identifier IE
392 * The Serving Cell Identifier IE is encoded as in 3GPP TS 48.008 (excluding IEI and length field).
395 * 5.24 Encryption Key
398 de_blap_enc_key(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
402 curr_offset
= offset
;
403 proto_tree_add_text(tree
,tvb
, curr_offset
, 8,"Encryption Key (Kc)");
404 curr_offset
= curr_offset
+ 8;
406 return(curr_offset
- offset
);
409 * 5.25 Cipher Mode Setting IE
410 * The Cipher Mode Setting information element is coded as defined in TS 44.018 (excluding IEI).
413 * 5.26 Channel Mode IE
414 * The Channel Mode information element is coded as defined in TS 44.018 (excluding IEI).
417 * 5.27 MultiRate Configuration IE
418 * The MultiRate Configuration information element is coded as defined in TS 44.018 (excluding IEI).
421 * 5.28 Polling Repetition IE
424 de_poll_rep(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
428 curr_offset
= offset
;
429 proto_tree_add_item(tree
, hf_gsm_bsslap_poll_rep
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
432 return(curr_offset
- offset
);
435 * 5.29 Packet Channel Description IE
436 * CSN.1 binary representation of the channel parameters as
437 * described in TS 44.018 (CCCH) or TS 44.060 (PCCCH) plus
438 * padding bits (binary 0) as required to achieve 4 complete octets
441 de_pkt_ch_desc(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len
, gchar
*add_string _U_
, int string_len _U_
)
445 curr_offset
= offset
;
446 proto_tree_add_text(tree
,tvb
, curr_offset
, len
,"Not decoded yet");
453 * The TFI information element is coded as defined in TS 44.060 (excluding IEI).
455 * UPLINK_TFI (5 bit field)
456 * The Temporary Flow Identity field identifies an uplink Temporary Block Flow (TBF).
457 * This field is encoded as a binary number. Range 0 to 31
460 de_tfi(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo _U_
, guint32 offset
, guint len _U_
, gchar
*add_string _U_
, int string_len _U_
)
464 curr_offset
= offset
;
465 proto_tree_add_item(tree
, hf_gsm_bsslap_tfi
, tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
468 return(curr_offset
- offset
);
472 This enum has been moved to packet-gsm_a_common to
473 make it possible to use element dissecton from this dissector
475 It is left here as a comment for easier reference.
477 Note this enum must be of the same size as the element decoding list
481 /. BSS LAP Elements 5 ./
482 DE_BLAP_RES1, /. Reserved ./
483 DE_BLAP_TA, /. Timing Advance ./
484 DE_BLAP_RES3, /. Reserved ./ /. (note) ./
485 DE_BLAP_RES4, /. Cell Identity ./
486 DE_BLAP_RES5, /. Reserved ./ /. (note) ./
487 DE_BLAP_RES6, /. Reserved ./ /. (note) ./
488 DE_BLAP_RES7, /. Reserved ./ /. (note) ./
489 DE_BLAP_CH_DESC, /. Channel Description ./
490 DE_BLAP_RES9, /. Reserved ./ /. (note) ./
491 DE_BLAP_RES10, /. Reserved ./ /. (note) ./
492 DE_BLAP_RES11, /. Reserved ./ /. (note) ./
493 DE_BLAP_MEAS_REP, /. Measurement Report ./
494 DE_BLAP_RES13, /. Reserved ./ /. (note) ./
495 DE_BLAP_CAUSE, /. Cause ./
496 DE_BLAP_RRLP_FLG, /. RRLP Flag ./
497 DE_BLAP_RRLP_IE, /. RRLP IE ./
498 DE_BLAP_CELL_ID_LIST, /. Cell Identity List ./
499 DE_BLAP_ENH_MEAS_REP, /. Enhanced Measurement Report ./
500 DE_BLAP_LAC, /. Location Area Code ./
501 DE_BLAP_FREQ_LIST, /. Frequency List ./
502 DE_BLAP_MS_POW, /. MS Power ./
503 DE_BLAP_DELTA_TIME, /. Delta Timer ./
504 DE_BLAP_SERV_CELL_ID, /. Serving Cell Identifier ./
505 DE_BLAP_ENC_KEY, /. Encryption Key (Kc) ./
506 DE_BLAP_CIP_M_SET, /. Cipher Mode Setting ./
507 DE_BLAP_CH_MODE, /. Channel Mode ./
508 DE_BLAP_POLL_REP, /. Polling Repetition ./
509 DE_BLAP_PKT_CH_DESC, /. Packet Channel Description ./
510 DE_BLAP_TLLI, /. TLLI ./
511 DE_BLAP_TFI, /. TFI ./
512 DE_BLAP_START_TIME, /. Starting Time ./
513 BSSLAP_NONE /. NONE ./
517 elem_fcn bsslap_elem_fcn
[] = {
518 /* BSS LAP Elements 5 */
520 de_ta
, /* Timing Advance */
521 NULL
, /* Reserved */ /* (note) */
522 NULL
, /* "Cell Identity */
523 NULL
, /* "Reserved */ /* (note) */
524 NULL
, /* "Reserved */ /* (note) */
525 NULL
, /* "Reserved */ /* (note) */
526 NULL
, /* "Channel Description */
527 NULL
, /* "Reserved */ /* (note) */
528 NULL
, /* Reserved */ /* (note) */
529 NULL
, /* Reserved */ /* (note) */
530 de_rr_meas_res
, /* "Measurement Report */
531 NULL
, /* "Reserved */ /* (note) */
532 de_bsslap_cause
, /* "Cause */
533 de_rrlp_flg
, /* "RRLP Flag */
534 de_rrlp_ie
, /* "RRLP IE */
535 de_cell_id_list
, /* "Cell Identity List */
536 de_enh_meas_rep
, /* Enhanced Measurement Report */
537 de_lac
, /* "Location Area Code */
538 NULL
, /* "Frequency List */
539 de_ms_pow
, /* MS Power */
540 de_delta_time
, /* Delta Timer */
541 NULL
, /* Serving Cell Identifier */
542 de_blap_enc_key
, /* Encryption Key (Kc) */
543 NULL
, /* Cipher Mode Setting */
544 NULL
, /* Channel Mode */
545 de_poll_rep
, /* Polling Repetition */
546 de_pkt_ch_desc
, /* Packet Channel Description */
549 NULL
, /* Starting Time */
553 #define NUM_GSM_BSSLAP_MSG (sizeof(gsm_a_bsslap_msg_strings)/sizeof(value_string))
554 static gint ett_gsm_bsslap_msg
[NUM_GSM_BSSLAP_MSG
];
556 /* 4.2.2 TA Response ETSI TS 148 071 V7.2.0 (2007-06) */
558 dissect_gsm_bsslap_ta_res(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
564 curr_offset
= offset
;
565 curr_len
= tvb_length_remaining(tvb
,offset
);
567 /* Cell Identity IE / 5.4 M TV 3 */
568 ELEM_MAND_TV(BSSLAP_PARAM_CELL_IDENTITY
, GSM_A_PDU_TYPE_COMMON
, DE_CELL_ID
, "Serving Cell Identity");
569 /* Timing Advance IE / 5.2 M TV 2 */
570 ELEM_MAND_TV(BSSLAP_PARAM_TIMING_ADVANCE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_TA
, NULL
);
571 /* Measurement Report IE / 5.12 O TLV 18 */
572 ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_MEAS_REP
, " BSSLAP");
573 /* Enhanced Measurement Report IE / 5.18 O TLV 4-n */
574 ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_ENH_MEAS_REP
, NULL
);
575 /* Cell Identity List IE / 5.17 O TLV 6-n */
576 ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CELL_ID_LIST
, "-Measured Cell");
583 /* 4.2.3 (void) ETSI TS 148 071 V7.2.0 (2007-06) */
584 /* 4.2.4 (void) ETSI TS 148 071 V7.2.0 (2007-06) */
585 /* 4.2.5 Reject ETSI TS 148 071 V7.2.0 (2007-06) */
587 dissect_gsm_bsslap_reject(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
593 curr_offset
= offset
;
594 curr_len
= tvb_length_remaining(tvb
,offset
);
596 /* Cause IE / 5.14 M TV 2 */
597 ELEM_MAND_TV(BSSLAP_PARAM_CAUSE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CAUSE
,NULL
);
602 /* 4.2.6 Reset ETSI TS 148 071 V7.2.0 (2007-06) */
604 dissect_gsm_bsslap_reset(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
610 curr_offset
= offset
;
611 curr_len
= tvb_length_remaining(tvb
,offset
);
613 /* Cell Identity IE / 5.4 M TV 3 */
614 ELEM_MAND_TV(BSSLAP_PARAM_CELL_IDENTITY
, GSM_A_PDU_TYPE_COMMON
, DE_CELL_ID
, NULL
);
615 /* Timing Advance IE / 5.2 M TV 2 */
616 ELEM_MAND_TV(BSSLAP_PARAM_TIMING_ADVANCE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_TA
, NULL
);
617 /* Channel Description IE / 5.8 M TV 4 */
618 ELEM_MAND_TV(BSSLAP_PARAM_CHANNEL_DESCRIPTION
,GSM_A_PDU_TYPE_RR
, DE_RR_CH_DSC
,NULL
);
619 /* Cause IE / 5.1 M TV 2 */
620 ELEM_MAND_TV(BSSLAP_PARAM_CAUSE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CAUSE
,NULL
);
621 /* Measurement Report Measurement Report IE / 5.12 O TLV 18 */
622 ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_MEAS_REP
, " BSSLAP");
623 /* Enhanced Measurement Report Enhanced Measurement Report IE / 5.18 O TLV 4-n */
624 ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_ENH_MEAS_REP
, NULL
);
625 /* Cell Identity List IE / 5.17 O TLV 6-n */
626 ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CELL_ID_LIST
, "-Measured Cell");
627 /* LAC Location Area Code IE / 5.19 O TV 3 */
628 ELEM_OPT_TLV(BSSLAP_PARAM_LOCATION_AREA_CODE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_LAC
, NULL
);
629 /* Frequency List Frequency List IE 5.20 C (note 1) TLV 3-n */
630 ELEM_OPT_TLV(BSSLAP_PARAM_FREQUENCY_LIST
, GSM_A_PDU_TYPE_RR
, DE_RR_FREQ_LIST
, NULL
);
631 /* Channel Mode IE 5.26 C (notes 2 & 4) TV 2 */
632 ELEM_OPT_TV(BSSLAP_PARAM_CHANNEL_MODE
, GSM_A_PDU_TYPE_RR
, DE_RR_CH_MODE
, NULL
);
633 /* MultiRate Configuration 5.27 C (notes 3 & 4) TLV 4-n */
634 ELEM_OPT_TLV(BSSLAP_PARAM_MULTIRATE_CONFIGURATION
, GSM_A_PDU_TYPE_RR
, DE_RR_MULTIRATE_CONF
, NULL
);
635 /* Packet Channel Description Packet Channel Description IE 5.29 C (note 5) TV 4 */
636 ELEM_OPT_TLV(BSSLAP_PARAM_PACKET_CHANNEL_DESCRIPTION
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_PKT_CH_DESC
, NULL
);
637 /* TLLI IE 5.30 C (note 5) TV 5 */
638 ELEM_OPT_TV(BSSLAP_PARAM_TLLI
, GSM_A_PDU_TYPE_RR
, DE_RR_TLLI
,NULL
);
639 /* TFI 5.31 C (note 5) TV 2 */
640 ELEM_OPT_TV(BSSLAP_PARAM_TFI
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_TFI
,NULL
);
641 /* Starting Time IE 5.32 C (note 5) TV 3 */
642 ELEM_OPT_TV(BSSLAP_PARAM_STARTING_TIME
, GSM_A_PDU_TYPE_RR
, DE_RR_STARTING_TIME
, "TBF Starting Time");
643 /* Encryption Key IE 5.24 C (note 4) TV 9 */
644 ELEM_OPT_TV(BSSLAP_PARAM_ENCRYPTION_KEY
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_ENC_KEY
,NULL
);
645 /* Cipher Mode Setting IE 5.25 C (note 4) TV 2 */
646 ELEM_OPT_TV(BSSLAP_PARAM_CIPHER_MODE_SETTING
, GSM_A_PDU_TYPE_RR
, DE_RR_CIP_MODE_SET
, NULL
);
650 /* 4.2.7 Abort ETSI TS 148 071 V7.2.0 (2007-06) */
652 dissect_gsm_bsslap_abort(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
658 curr_offset
= offset
;
659 curr_len
= tvb_length_remaining(tvb
,offset
);
661 /* Cause IE / 5.14 M TV 2 */
662 ELEM_MAND_TV(BSSLAP_PARAM_CAUSE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CAUSE
,NULL
);
666 /* 4.2.8 TA Layer3 ETSI TS 148 071 V7.2.0 (2007-06) */
668 dissect_gsm_bsslap_ta_layer3(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
674 curr_offset
= offset
;
675 curr_len
= tvb_length_remaining(tvb
,offset
);
677 /* Timing Advance IE / 5.2 M TV 2 */
678 ELEM_MAND_TV(BSSLAP_PARAM_TIMING_ADVANCE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_TA
, NULL
);
679 /* Measurement Report IE / 5.12 O TLV 18 */
680 ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_MEAS_REP
, " BSSLAP");
681 /* Enhanced Measurement Report IE / 5.18 O TLV 4-n */
682 ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_ENH_MEAS_REP
, NULL
);
683 /*Cell Identity List IE / 5.17 O TLV 6-n */
684 ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CELL_ID_LIST
, "-Measured Cell");
687 /* 4.2.9 MS Position Command ETSI TS 148 071 V7.2.0 (2007-06) */
689 dissect_gsm_bsslap_ms_pos_cmd(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
695 curr_offset
= offset
;
696 curr_len
= tvb_length_remaining(tvb
,offset
);
698 /* RRLP flag IE / 5.15 M TV 2 */
699 ELEM_MAND_TV(BSSLAP_PARAM_RRLP_FLAG
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_RRLP_FLG
,"flag");
700 /* RRLP IE / 5.16 M TLV 3-n */
701 ELEM_MAND_TV(BSSLAP_PARAM_RRLP_IE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_RRLP_IE
,"RRLP Info");
704 /* 4.2.10 MS Position Response ETSI TS 148 071 V7.2.0 (2007-06) */
706 dissect_gsm_bsslap_ms_pos_res(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
712 curr_offset
= offset
;
713 curr_len
= tvb_length_remaining(tvb
,offset
);
715 /* flag RRLP flag IE / 5.15 M TV 2 */
716 ELEM_MAND_TV(BSSLAP_PARAM_RRLP_FLAG
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_RRLP_FLG
,"flag");
717 /* RRLP Info RRLP IE / 5.16 M TLV 3-n */
718 ELEM_MAND_TV(BSSLAP_PARAM_RRLP_IE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_RRLP_IE
,"RRLP Info");
719 /* Timing Advance IE / 5.2 O TV 2 */
720 ELEM_OPT_TV(BSSLAP_PARAM_TIMING_ADVANCE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_TA
, NULL
);
721 /* Measurement Report IE / 5.12 O TLV 18 */
722 ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_MEAS_REP
, " BSSLAP");
723 /* Enhanced Measurement Report IE / 5.18 O TLV 4-n */
724 ELEM_OPT_TLV(BSSLAP_PARAM_ENHANCED_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_ENH_MEAS_REP
, NULL
);
725 /* Cell Identity List IE / 5.17 O TLV 6-n */
726 ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CELL_ID_LIST
, "-Measured Cell");
729 /* 4.2.11 U-TDOA Request ETSI TS 148 071 V7.2.0 (2007-06) */
731 dissect_gsm_bsslap_u_tdoa_req(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
737 curr_offset
= offset
;
738 curr_len
= tvb_length_remaining(tvb
,offset
);
740 /* Delta Timer IE 5.22 O (note 1) TV 2 */
741 ELEM_OPT_TV(BSSLAP_PARAM_DELTA_TIMER
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_DELTA_TIME
, NULL
);
742 /* Polling Repitition IE 5.28 (note) C (note 2) TV 2 */
743 ELEM_OPT_TV(BSSLAP_PARAM_POLLING_REPETITION
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_POLL_REP
, NULL
);
747 /* 4.2.12 U-TDOA Response ETSI TS 148 071 V7.2.0 (2007-06) */
749 dissect_gsm_bsslap_u_tdoa_res(tvbuff_t
*tvb
, proto_tree
*tree
, packet_info
*pinfo
, int offset
)
755 curr_offset
= offset
;
756 curr_len
= tvb_length_remaining(tvb
,offset
);
758 /* Channel Description IE 5.8 M TV 4 */
759 ELEM_MAND_TV(BSSLAP_PARAM_CHANNEL_DESCRIPTION
,GSM_A_PDU_TYPE_RR
, DE_RR_CH_DSC
, NULL
);
760 /* Serving Cell Identifier Cell Identifier IE 5.23 M TLV 4-n */
761 ELEM_MAND_TLV(BSSLAP_PARAM_SERVING_CELL_IDENTIFIER
,GSM_A_PDU_TYPE_BSSMAP
, BE_CELL_ID
, NULL
);
762 /* Frequency List IE 5.20 C (note 3) TLV 3-n */
763 ELEM_OPT_TLV(BSSLAP_PARAM_FREQUENCY_LIST
, GSM_A_PDU_TYPE_RR
, DE_RR_FREQ_LIST
, NULL
);
764 /* Timing Advance IE 5.2 O TV 2 */
765 ELEM_OPT_TV(BSSLAP_PARAM_TIMING_ADVANCE
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_TA
, NULL
);
766 /* MS Power IE 5.21 O TV 2 */
767 ELEM_OPT_TV(BSSLAP_PARAM_MS_POWER
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_MS_POW
, NULL
);
768 /* Measurement Report IE 5.12 O TLV 18 */
769 ELEM_OPT_TLV(BSSLAP_PARAM_MEASUREMENT_REPORT
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_MEAS_REP
, " BSSLAP");
770 /* Encryption Key IE 5.24 C (note 4) TV 9 */
771 ELEM_OPT_TV(BSSLAP_PARAM_ENCRYPTION_KEY
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_ENC_KEY
, NULL
);
772 /* Cipher Mode Setting IE 5.25 C (note 4) TV 2 */
773 ELEM_OPT_TV(BSSLAP_PARAM_CIPHER_MODE_SETTING
, GSM_A_PDU_TYPE_RR
, DE_RR_CIP_MODE_SET
, NULL
);
774 /* Channel Mode IE 5.26 C (notes 1 & 4)TV 2 */
775 ELEM_OPT_TV(BSSLAP_PARAM_CHANNEL_MODE
, GSM_A_PDU_TYPE_RR
, DE_RR_CH_MODE
, NULL
);
776 /* MultiRate Configuration IE 5.27 C (notes 1 & 4)TLV 4-n */
777 ELEM_OPT_TLV(BSSLAP_PARAM_MULTIRATE_CONFIGURATION
, GSM_A_PDU_TYPE_RR
, DE_RR_MULTIRATE_CONF
, NULL
);
778 /* Cell Identity List IE / 5.17 O TLV 6-n */
779 ELEM_OPT_TLV(BSSLAP_PARAM_CELL_IDENTITY_LIST
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_CELL_ID_LIST
, "-Measured Cell");
780 /* Packet Channel Description IE 5.29 C (note 5) TV 4 */
781 ELEM_OPT_TLV(BSSLAP_PARAM_PACKET_CHANNEL_DESCRIPTION
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_PKT_CH_DESC
, NULL
);
782 /* TLLI IE 5.30 C (note 5) TV 5 */
783 ELEM_OPT_TV(BSSLAP_PARAM_TLLI
, GSM_A_PDU_TYPE_RR
, DE_RR_TLLI
, NULL
);
784 /* TFI IE 5.31 C (note 5) TV 2 BSSLAP_PARAM_TFI*/
785 ELEM_OPT_TV(BSSLAP_PARAM_TFI
, GSM_A_PDU_TYPE_BSSLAP
, DE_BLAP_TFI
, NULL
);
786 /* Starting Time IE 5.32 C (note 5) TV 3*/
787 ELEM_OPT_TV(BSSLAP_PARAM_STARTING_TIME
, GSM_A_PDU_TYPE_RR
, DE_RR_STARTING_TIME
, "TBF Starting Time");
793 dissect_gsm_bsslap(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
796 proto_tree
*sub_tree
;
800 /* Make entries in Protocol column and Info column on summary display */
801 col_append_str(pinfo
->cinfo
, COL_PROTOCOL
, "/BSSLAP");
803 octet
= tvb_get_guint8(tvb
, offset
);
804 item
= proto_tree_add_item(tree
, proto_gsm_bsslap
, tvb
, 0, -1, ENC_NA
);
805 sub_tree
= proto_item_add_subtree(item
, ett_gsm_bsslap
);
807 /* Message Type IE / 5.1 M V 1 */
808 proto_tree_add_item(sub_tree
, hf_gsm_bsslap_msg_type
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
812 case BSSLAP_TA_REQUEST
:
813 /* Only message type IE */
815 case BSSLAP_TA_RESPONSE
:
816 dissect_gsm_bsslap_ta_res(tvb
, sub_tree
, pinfo
, offset
);
819 dissect_gsm_bsslap_reject(tvb
, sub_tree
, pinfo
, offset
);
822 dissect_gsm_bsslap_reset(tvb
, sub_tree
, pinfo
, offset
);
825 dissect_gsm_bsslap_abort(tvb
, sub_tree
, pinfo
, offset
);
827 case BSSLAP_TA_LAYER3
:
828 dissect_gsm_bsslap_ta_layer3(tvb
, sub_tree
, pinfo
, offset
);
830 case BSSLAP_MS_POS_CMD
:
831 dissect_gsm_bsslap_ms_pos_cmd(tvb
, sub_tree
, pinfo
, offset
);
833 case BSSLAP_MS_POS_RES
:
834 dissect_gsm_bsslap_ms_pos_res(tvb
, sub_tree
, pinfo
, offset
);
836 case BSSLAP_U_TDOA_REQ
:
837 dissect_gsm_bsslap_u_tdoa_req(tvb
, sub_tree
, pinfo
, offset
);
839 case BSSLAP_U_TDOA_RES
:
840 dissect_gsm_bsslap_u_tdoa_res(tvb
, sub_tree
, pinfo
, offset
);
851 proto_reg_handoff_gsm_bsslap(void)
853 bsslap_rrlp_handle
= find_dissector("rrlp");
857 proto_register_gsm_bsslap(void)
863 /* Setup list of header fields */
864 static hf_register_info hf
[] = {
865 { &hf_gsm_bsslap_msg_type
,
866 { "Message Type IE", "gsm_bsslap.msg_type",
867 FT_UINT8
, BASE_DEC
, VALS(gsm_a_bsslap_msg_strings
), 0x0,
870 { &hf_gsm_a_bsslap_elem_id
,
871 { "Element ID", "gsm_bsslap.elem_id",
872 FT_UINT8
, BASE_HEX
, NULL
, 0,
876 { "Timing Advance", "gsm_bsslap.ta",
877 FT_UINT8
, BASE_HEX
, NULL
, 0x0,
880 { &hf_gsm_bsslap_timer_value
,
881 {"Timer Value", "gsm_bsslap.timerValue",
882 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
886 { &hf_gsm_bsslap_ms_pow
,
887 {"MS Power", "gsm_bsslap.MS_pow",
888 FT_UINT8
, BASE_DEC
, NULL
, 0x0,
891 { &hf_gsm_bsslap_cause
,
892 {"Cause", "gsm_bsslap.cause",
893 FT_UINT8
, BASE_DEC
, VALS(gsm_bsslap_cause_vals
), 0x0,
896 { &hf_gsm_bsslap_rrlp_flg
,
897 {"RRLP Flag", "gsm_bsslap.rrlp_flg",
898 FT_BOOLEAN
, 8, TFS(&gsm_bsslap_rrlp_flg_vals
), 0x01,
901 { &hf_gsm_bsslap_tfi
,
902 {"TFI", "gsm_bsslap.tfi",
903 FT_UINT8
, BASE_DEC
, NULL
, 0x1f,
906 { &hf_gsm_bsslap_poll_rep
,
907 {"Number of polling repetitions", "gsm_bsslap.poll_rep",
908 FT_UINT8
, BASE_DEC
, NULL
, 0x3F,
911 { &hf_gsm_bsslap_lac
,
912 {"Location Area Code", "gsm_bsslap.lac",
913 FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
916 { &hf_gsm_bsslap_cell_id_disc
,
917 {"Cell identification Discriminator", "gsm_bsslap.cell_id_disc",
918 FT_UINT8
, BASE_DEC
, VALS(gsm_a_bsslap_cell_id_disc_vals
), 0xf,
923 /* Setup protocol subtree array */
924 #define NUM_INDIVIDUAL_ELEMS 2
925 gint
*ett
[NUM_INDIVIDUAL_ELEMS
+ NUM_GSM_BSSLAP_MSG
+
926 NUM_GSM_BSSLAP_ELEM
];
928 ett
[0] = &ett_gsm_bsslap
;
929 ett
[1] = &ett_bsslap_cell_list
;
931 last_offset
= NUM_INDIVIDUAL_ELEMS
;
933 for (i
=0; i
< NUM_GSM_BSSLAP_MSG
; i
++, last_offset
++)
935 ett_gsm_bsslap_msg
[i
] = -1;
936 ett
[last_offset
] = &ett_gsm_bsslap_msg
[i
];
939 for (i
=0; i
< NUM_GSM_BSSLAP_ELEM
; i
++, last_offset
++)
941 ett_gsm_bsslap_elem
[i
] = -1;
942 ett
[last_offset
] = &ett_gsm_bsslap_elem
[i
];
946 /* Register the protocol name and description */
948 proto_register_protocol("BSS LCS Assistance Protocol",
951 /* Required function calls to register the header fields and subtrees used */
952 proto_register_field_array(proto_gsm_bsslap
, hf
, array_length(hf
));
953 proto_register_subtree_array(ett
, array_length(ett
));
955 register_dissector("gsm_bsslap", dissect_gsm_bsslap
, proto_gsm_bsslap
);