1 /* packet-gsm_bssmap_le.c
2 * Routines for GSM Lb Interface BSSMAP dissection
4 * Copyright 2008, Johnny Mitrevski <mitrevj@hotmail.com>
6 * 3GPP TS 49.031 version v7.4.0 (2009-09)
10 * Wireshark - Network traffic analyzer
11 * By Gerald Combs <gerald@wireshark.org>
12 * Copyright 1998 Gerald Combs
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/packet.h>
40 #include <epan/emem.h>
42 #include "packet-bssap.h"
43 #include "packet-sccp.h"
44 #include "packet-gsm_a_common.h"
45 #include "packet-e212.h"
47 /* PROTOTYPES/FORWARDS */
49 /* Message Type definitions */
50 #define BSSMAP_LE_PERFORM_LOCATION_REQUEST 43
51 #define BSSMAP_LE_PERFORM_LOCATION_RESPONSE 45
52 #define BSSMAP_LE_PERFORM_LOCATION_ABORT 46
53 #define BSSMAP_LE_PERFORM_LOCATION_INFORMATION 47
54 #define BSSMAP_LE_CONNECTION_ORIENTED_INFORMATION 42
55 #define BSSMAP_LE_CONNECTIONLESS_INFORMATION 58
56 #define BSSMAP_LE_RESET 48
57 #define BSSMAP_LE_RESET_ACKNOWLEDGE 49
59 const value_string gsm_bssmap_le_msg_strings[] = {
65 { BSSMAP_LE_PERFORM_LOCATION_REQUEST, "Perform Location Request" },
66 { BSSMAP_LE_PERFORM_LOCATION_RESPONSE, "Perform Location Response" },
67 { BSSMAP_LE_PERFORM_LOCATION_ABORT, "Perform Location Abort" },
68 { BSSMAP_LE_PERFORM_LOCATION_INFORMATION, "Perform Location Information" },
69 { BSSMAP_LE_CONNECTION_ORIENTED_INFORMATION, "Connection Oriented Information" },
70 { BSSMAP_LE_CONNECTIONLESS_INFORMATION, "Connectionless Information" },
71 { BSSMAP_LE_RESET, "Reset" },
72 { BSSMAP_LE_RESET_ACKNOWLEDGE, "Reset Acknowledge" },
73 { 0, NULL } /*Null terminated list. Make sure we add this to our value/string structures. */
76 /* Information Element definitions */
77 #define BSSMAP_LE_LCS_QOS 62
78 #define BSSMAP_LE_LCS_PRIORITY 67
79 #define BSSMAP_LE_LOCATION_TYPE 68
80 #define BSSMAP_LE_GANSS_LOCATION_TYPE 130
81 #define BSSMAP_LE_GEOGRAPHIC_LOCATION 69
82 #define BSSMAP_LE_POSITIONING_DATA 70
83 #define BSSMAP_LE_GANSS_POSITIONING_DATA 131
84 #define BSSMAP_LE_VELOCITY_DATA 85
85 #define BSSMAP_LE_LCS_CAUSE 71
86 #define BSSMAP_LE_LCS_CLIENT_TYPE 72
87 #define BSSMAP_LE_APDU 73
88 #define BSSMAP_LE_NETWORK_ELEMENT_IDENTITY 74
89 #define BSSMAP_LE_REQUESTED_GPS_ASSISTANCE_DATA 75
90 #define BSSMAP_LE_REQUESTED_GANSS_ASSISTANCE_DATA 65
91 #define BSSMAP_LE_DECIPHERING_KEYS 76
92 #define BSSMAP_LE_RETURN_ERROR_REQUEST 77
93 #define BSSMAP_LE_RETURN_ERROR_CAUSE 78
94 #define BSSMAP_LE_SEGMENTATION 79
95 #define BSSMAP_LE_CLASSMARK_INFORMATION_TYPE_3 19
96 #define BSSMAP_LE_CAUSE 4
97 #define BSSMAP_LE_CELL_IDENTIFIER 5
98 #define BSSMAP_LE_CHOSEN_CHANNEL 33
99 #define BSSMAP_LE_IMSI 0
100 #define BSSMAP_LE_RESERVED_NOTE1 1
101 #define BSSMAP_LE_RESERVED_NOTE2 2
102 #define BSSMAP_LE_RESERVED_NOTE3 3
103 #define BSSMAP_LE_LCS_CAPABILITY 80
104 #define BSSMAP_LE_PACKET_MEASUREMENT_REPORT 81
105 #define BSSMAP_LE_CELL_IDENTITY_LIST 82
106 #define BSSMAP_LE_IMEI 128
108 const value_string gsm_bssmap_le_elem_strings[] = {
109 { BSSMAP_LE_LCS_QOS, "LCS QoS" },
110 { BSSMAP_LE_LCS_PRIORITY, "LCS Priority" },
111 { BSSMAP_LE_LOCATION_TYPE, "Location Type" },
112 { BSSMAP_LE_GANSS_LOCATION_TYPE, "GANSS Location Type" },
113 { BSSMAP_LE_GEOGRAPHIC_LOCATION, "Geographic Location" },
114 { BSSMAP_LE_POSITIONING_DATA, "Positioning Data" },
115 { BSSMAP_LE_GANSS_POSITIONING_DATA, "GANSS Positioning Data" },
116 { BSSMAP_LE_VELOCITY_DATA, "Velocity Data" },
117 { BSSMAP_LE_LCS_CAUSE, "LCS Cause" },
118 { BSSMAP_LE_LCS_CLIENT_TYPE, "LCS Client Type" },
119 { BSSMAP_LE_APDU, "APDU" },
120 { BSSMAP_LE_NETWORK_ELEMENT_IDENTITY, "Network Element Identity" },
121 { BSSMAP_LE_REQUESTED_GPS_ASSISTANCE_DATA, "Requested GPS Assistance Data" },
122 { BSSMAP_LE_REQUESTED_GANSS_ASSISTANCE_DATA, "Requested GANSS Assistance Data" },
123 { BSSMAP_LE_DECIPHERING_KEYS, "Deciphering Keys" },
124 { BSSMAP_LE_RETURN_ERROR_REQUEST, "Return Error Request" },
125 { BSSMAP_LE_RETURN_ERROR_CAUSE, "Return Error Cause" },
126 { BSSMAP_LE_SEGMENTATION, "Segmentation" },
127 { BSSMAP_LE_CLASSMARK_INFORMATION_TYPE_3, "Classmark Information Type 3" },
128 { BSSMAP_LE_CAUSE, "Cause" },
129 { BSSMAP_LE_CELL_IDENTIFIER, "Cell Identifier" },
130 { BSSMAP_LE_CHOSEN_CHANNEL, "Chosen Channel" },
131 { BSSMAP_LE_IMSI, "IMSI" },
132 { BSSMAP_LE_RESERVED_NOTE1, "Reserved" },
133 { BSSMAP_LE_RESERVED_NOTE2, "Reserved" },
134 { BSSMAP_LE_RESERVED_NOTE3, "Reserved" },
135 { BSSMAP_LE_LCS_CAPABILITY, "LCS Capability" },
136 { BSSMAP_LE_PACKET_MEASUREMENT_REPORT, "Packet Measurement Report" },
137 { BSSMAP_LE_CELL_IDENTITY_LIST, "Cell Identity List" },
138 { BSSMAP_LE_IMEI, "IMEI" },
142 static const value_string gsm_apdu_protocol_id_strings[] = {
150 /* Velocity Requested definitions */
151 static const value_string bssmap_le_velocity_requested_vals[] = {
152 { 0, "do not report velocity" },
153 { 1, "report velocity if available" },
157 /* Vertical Coordinate definitions */
158 static const value_string bssmap_le_vertical_coordinate_indicator_vals[] = {
159 { 0, "vertical coordinate not requested" },
160 { 1, "vertical coordinate is requested" },
164 /* Horizontal Accuracy definitions */
165 static const value_string bssmap_le_horizontal_accuracy_indicator_vals[] = {
166 { 0, "horizontal accuracy is not specified" },
167 { 1, "horizontal accuracy is specified" },
171 /* Vertical Accuracy definitions */
172 static const value_string bssmap_le_vertical_accuracy_indicator_vals[] = {
173 { 0, "vertical accuracy is not specified" },
174 { 1, "vertical accuracy is specified" },
178 /* Response Time definitions */
179 static const value_string bssmap_le_response_time_definitions_vals[] = {
180 { 0, "Response Time is not specified" },
182 { 2, "Delay Tolerant" },
187 /* Initialize the protocol and registered fields */
188 static int proto_bssmap_le = -1;
189 int hf_gsm_bssmap_le_elem_id = -1;
191 /* The following hf_* variables are used to hold the Wireshark IDs of
192 * our header fields; they are filled out when we call
193 * proto_register_field_array() in proto_register_bssmap_le()
195 static int hf_gsm_bssmap_le_msg_type = -1;
196 static int hf_gsm_bssmap_le_apdu_protocol_id = -1;
197 static int hf_gsm_bssmap_le_spare = -1;
198 static int hf_gsm_bssmap_le_ciphering_key_flag = -1;
199 static int hf_gsm_bssmap_le_current_deciphering_key_value = -1;
200 static int hf_gsm_bssmap_le_next_deciphering_key_value = -1;
201 static int hf_gsm_bssmap_le_lcs_cause_value =-1;
202 static int hf_gsm_bssmap_le_diagnostic_value = -1;
203 static int hf_gsm_bssmap_le_client_category = -1;
204 static int hf_gsm_bssmap_le_client_subtype = -1;
205 static int hf_gsm_bssmap_le_velocity_requested = -1;
206 static int hf_gsm_bssmap_le_vertical_coordinate_indicator = -1;
207 static int hf_gsm_bssmap_le_horizontal_accuracy_indicator = -1;
208 static int hf_gsm_bssmap_le_horizontal_accuracy = -1;
209 static int hf_gsm_bssmap_le_vertical_accuracy_indicator = -1;
210 static int hf_gsm_bssmap_le_vertical_accuracy = -1;
211 static int hf_gsm_bssmap_le_response_time_category = -1;
213 /* Initialize the subtree pointers */
214 static gint ett_bssmap_le_msg = -1;
216 static dissector_handle_t gsm_bsslap_handle = NULL;
218 static packet_info *g_pinfo;
219 static proto_tree *g_tree;
221 #define NUM_GSM_BSSMAP_LE_ELEM (sizeof(gsm_bssmap_le_elem_strings)/sizeof(value_string))
222 gint ett_gsm_bssmap_le_elem[NUM_GSM_BSSMAP_LE_ELEM];
229 de_bmaple_apdu(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
232 guint8 apdu_protocol_id;
235 curr_offset = offset;
237 /* curr_offset + 1 is a hack, the length part here is 2 octets and we are off by one */
238 proto_tree_add_text(tree, tvb, curr_offset+1, len, "APDU");
241 * dissect the embedded APDU message
242 * if someone writes a TS 09.31 dissector
244 * The APDU octets 4 to n are coded in the same way as the
245 * equivalent octet in the APDU element of 3GPP TS 49.031 BSSAP-LE.
248 apdu_protocol_id = tvb_get_guint8(tvb,curr_offset+1);
249 proto_tree_add_item(tree, hf_gsm_bssmap_le_apdu_protocol_id, tvb, curr_offset+1, 1, FALSE);
251 switch(apdu_protocol_id){
254 * the embedded message is as defined in 3GPP TS 08.71(3GPP TS 48.071 version 7.2.0 Release 7)
256 APDU_tvb = tvb_new_subset(tvb, curr_offset+2, len-1, len-1);
257 if(gsm_bsslap_handle)
258 call_dissector(gsm_bsslap_handle, APDU_tvb, g_pinfo, g_tree);
262 * The embedded message contains a Facility Information Element as defined in 3GPP TS 04.71
263 * excluding the Facility IEI and length of Facility IEI octets defined in 3GPP TS 04.71.(3GPP TS 44.071).
268 * The embedded message is as defined in 3GPP TS 08.31(TS 48.031).
277 EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
279 return(curr_offset - offset);
283 * coded as the value part of the Cause IE defined in 3GPP TS 48.008
286 * 10.5 Cell Identifier
287 * coded as the value part of the Cell Identifier IE defined in 3GPP TS 48.008
290 * 10.6 Chosen Channel
291 * coded as the value part of the Chosen Channel IE defined in 3GPP TS 48.008
294 * 10.7 Classmark Information Type 3
295 * coded as the value part of the Classmark Information Type 3 IE defined in 3GPP TS 48.008
298 * 10.8 Deciphering Keys
301 de_bmaple_decihp_keys(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
306 bit_offset = (offset<<3);
307 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bit_offset, 7, FALSE);
310 /* Extract the Ciphering Key Flag and add to protocol tree */
311 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_ciphering_key_flag, tvb, bit_offset, 1, FALSE);
315 /* Extract the Current Deciphering Key Value and add to protocol tree */
316 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_current_deciphering_key_value, tvb, bit_offset, 56, FALSE);
320 /* Extract the Next Deciphering Key Value and add to protocol tree */
321 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_next_deciphering_key_value, tvb, bit_offset, 56, FALSE);
327 * 10.9 Geographic Location
328 * contains an octet sequence identical to that for Geographical Information
329 * defined in 3GPP TS 23.032..
332 * 10.10 Requested GPS Assistance Data
336 * coded as the value part of the Mobile Identity IE defined in 3GPP TS 24.008 (NOTE 1)
337 * NOTE 1: The Type of identity field in the Mobile Identity IE shall
338 * be ignored by the receiver
346 static const value_string bssmap_le_lcs_cause_values[] = {
347 { 0, "Unspecified" },
348 { 1, "System Failure" },
349 { 2, "Protocol Error" },
350 { 3, "Data missing in position request" },
351 { 4, "Unexpected data value in position request" },
352 { 5, "Position method failure" },
353 { 6, "Target MS Unreachable" },
354 { 7, "Location request aborted" },
355 { 8, "Facility not supported" },
356 { 9, "Inter-BSC Handover Ongoing" },
357 { 10, "Intra-BSC Handover Complete" },
358 { 11, "Congestion" },
359 { 12, "Inter NSE cell change" },
360 { 13, "Routing Area Update" },
361 { 14, "PTMSI reallocation" },
362 { 15, "Suspension of GPRS services" },
366 static const value_string bssmap_le_position_method_failure_diagnostic_vals[] = {
368 { 1, "insufficientResources" },
369 { 2, "insufficientMeasurementData" },
370 { 3, "inconsistentMeasurementData" },
371 { 4, "locationProcedureNotCompleted" },
372 { 5, "locationProcedureNotSupportedByTargetMS" },
373 { 6, "qoSNotAttainable" },
374 { 7, "positionMethodNotAvailableInNetwork" },
375 { 8, "positionMethodNotAvailableInLocaitonArea" },
379 de_bmaple_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
383 curr_offset = offset;
386 proto_tree_add_item(tree, hf_gsm_bssmap_le_lcs_cause_value, tvb, curr_offset, 1, FALSE);
391 /* Diagnostic value (note) */
392 proto_tree_add_item(tree, hf_gsm_bssmap_le_diagnostic_value, tvb, curr_offset, 1, FALSE);
396 return(curr_offset - offset);
399 * 10.14 LCS Client Type
401 /* Client Category definitions */
402 static const value_string bssmap_le_client_category[] = {
403 { 0, "Value Added Client" },
404 { 2, "PLMN Operator" },
405 { 3, "Emergency Services"},
406 { 4, "Lawful Intercept Services"},
410 /* Client Subtype definitions */
411 static const value_string bssmap_le_client_subtype[] = {
412 { 0, "unspecified" },
413 { 1, "broadcast service" },
415 { 3, "anonymous statistics" },
416 { 4, "Target MS service support" },
421 de_bmaple_client(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
426 bitCount = offset<<3;
427 curr_offset = offset;
429 /* Extract the client category and add to protocol tree */
430 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_client_category, tvb, bitCount, 4, FALSE);
431 bitCount = bitCount + 4;
433 /* Extract the client subtype and add to protocol tree */
434 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_client_subtype, tvb, bitCount, 4, FALSE);
435 bitCount = bitCount + 4;
438 return(curr_offset - offset);
442 * coded as the LCS-Priority octet in 3GPP TS 29.002
448 de_bmaple_lcs_qos(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
450 guint64 verticalCoordIndicator, velocityRequested, horizontalAccuracyIndicator, verticalAccuracyIndicator;
453 bitCount = offset << 3;
455 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 6, FALSE);
456 bitCount = bitCount + 6;
458 /* Extract Velocity requested element */
459 proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_velocity_requested, tvb, bitCount, 1, &velocityRequested, FALSE);
462 /* Extract vertical coordinator element */
463 proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_vertical_coordinate_indicator, tvb, bitCount, 1, &verticalCoordIndicator, FALSE);
466 /* Extract horizontal accuracy element */
467 proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_horizontal_accuracy_indicator, tvb, bitCount, 1, &horizontalAccuracyIndicator, FALSE);
470 if(horizontalAccuracyIndicator == 1)
472 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_horizontal_accuracy, tvb, bitCount, 7, FALSE);
473 bitCount = bitCount + 7;
477 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 7, FALSE);
478 bitCount = bitCount + 7;
481 /* Extract vertical accuracy element */
482 proto_tree_add_bits_ret_val(tree, hf_gsm_bssmap_le_vertical_accuracy_indicator, tvb, bitCount, 1, &verticalAccuracyIndicator, FALSE);
485 if(verticalAccuracyIndicator == 1)
487 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_vertical_accuracy, tvb, bitCount, 7, FALSE);
488 bitCount = bitCount + 7;
492 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_spare, tvb, bitCount, 7, FALSE);
493 bitCount = bitCount + 7;
496 proto_tree_add_bits_item(tree, hf_gsm_bssmap_le_response_time_category, tvb, bitCount, 2, FALSE);
497 bitCount = bitCount + 2;
505 * 10.18 Location Type
508 * 10.19 Network Element Identity
511 * 10.20 Positioning Data
514 de_bmaple_pos_dta(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
519 curr_offset = offset;
521 data_tvb = tvb_new_subset(tvb, curr_offset, len, len);
522 dissect_geographical_description(data_tvb, g_pinfo, tree);
527 * 10.21 Return Error Request
530 * 10.22 Return Error Cause
542 * 10.26 LCS Capability
543 * coded as the value part of the LCS Capability
544 * information element in 3GPP TS 48.018, not including
545 * 3GPP TS 48.018 IEI and length indicator
547 /* Dissector for the LCS Capability element */
549 be_lcs_capability(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
551 /* Extract the LCS Capability element and add to protocol tree */
552 proto_tree_add_text(tree, tvb, offset, len, "Not decoded yet");
557 * 10.27 Packet Measurement Report
558 * coded as the Packet Measurement Report
559 * message or the Packet Enhanced Measurement Report message
560 * starting with the 6-bit MESSAGE_TYPE (see clause 11 in
561 * 3GPP TS 44.060) and ending with the Non-distribution contents
562 * (i.e. the RLC/MAC padding bits are not included). The end of the
563 * message is padded with 0-bits to the nearest octet boundary.
565 /* Dissector for the Packet Measurement Report element */
567 be_packet_meas_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
569 /* Extract the Packet Measurement Report element and add to protocol tree */
570 proto_tree_add_text(tree, tvb, offset, len, "Not decoded yet");
576 * 10.28 Cell Identity List
577 * coded as the value part of the Cell Identity List IE
578 * defined in 3GPP TS 48.071.
580 /* Dissector for the Measured Cell Identity List element */
582 be_measured_cell_identity(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
584 /* Extract the Measured Cell Identity List element and add to protocol tree */
585 proto_tree_add_text(tree, tvb, offset, len, "Not decoded yet");
592 * IMEI coded as the value part of the Mobile Identity IE defined in
593 * 3GPP TS 24.008 (NOTE 1)
594 * NOTE 1: The Type of identity field in the Mobile Identity IE shall
595 * be ignored by the receiver.
598 * 10.30 Velocity Data
599 * contains an octet sequence identical to that for Description of
600 * Velocity defined in 3GPP TS 23.032.
603 * 10.31 Requested GANSS Assistance Data
606 * 10.32 GANSS Positioning Data
609 * 10.33 GANSS Location Type
613 #define NUM_GSM_BSSMAP_LE_MSG (sizeof(gsm_bssmap_le_msg_strings)/sizeof(value_string))
614 static gint ett_gsm_bssmap_le_msg[NUM_GSM_BSSMAP_LE_MSG];
617 This enum is defined in packet-gsm_a_common.h to
618 make it possible to use element dissecton from this dissector
621 It is shown here as a comment for easier reference.
623 Note this enum must be of the same size as the element decoding list below
627 DE_BMAPLE_LCSQOS, / 10.16 LCS QoS /
628 DE_BMAPLE_LCS_PRIO, / LCS Priority /
629 DE_BMAPLE_LOC_TYPE, / 10.18 Location Type /
630 DE_BMAPLE_GANSS_LOC_TYPE, / GANSS Location Type /
631 DE_BMAPLE_GEO_LOC, / 10.9 Geographic Location /
632 DE_BMAPLE_POS_DATA, / 10.20 Positioning Data /
633 DE_BMAPLE_GANSS_POS_DATA, / GANSS Positioning Data /
634 DE_BMAPLE_VELOC_DATA, / Velocity Data /
635 DE_BMAPLE_LCS_CAUSE, / 10.13 LCS Cause /
636 DE_BMAPLE_LCS_CLIENT_TYPE, / LCS Client Type /
637 DE_BMAPLE_APDU, / 10.3 APDU /
638 DE_BMAPLE_NETWORK_ELEM_ID, / Network Element Identity /
639 DE_BMAPLE_REQ_GPS_ASSIST_D, / 10.10 Requested GPS Assistance Data /
640 DE_BMAPLE_REQ_GNSS_ASSIST_D,/ Requested GANSS Assistance Data /
641 DE_BMAPLE_DECIPH_KEYS, / 10.8 Deciphering Keys /
642 DE_BMAPLE_RETURN_ERROR_REQ, / Return Error Request /
643 DE_BMAPLE_RETURN_ERROR_CAUSE, / Return Error Cause /
644 DE_BMAPLE_SEGMENTATION, / Segmentation /
645 DE_BMAPLE_CLASSMARK_TYPE_3, / 10.7 Classmark Information Type 3 /
646 DE_BMAPLE_CAUSE, / 10.4 Cause /
647 DE_BMAPLE_CELL_IDENTIFIER, / 10.5 Cell Identifier /
648 DE_BMAPLE_CHOSEN_CHANNEL, / 10.6 Chosen Channel /
649 DE_BMAPLE_IMSI, / 10.11 IMSI /
650 DE_BMAPLE_RES1, / Reserved /
651 DE_BMAPLE_RES2, / Reserved /
652 DE_BMAPLE_RES3, / Reserved /
653 DE_BMAPLE_LCS_CAPABILITY, / LCS Capability /
654 DE_BMAPLE_PACKET_MEAS_REP, / Packet Measurement Report /
655 DE_BMAPLE_MEAS_CELL_ID, / Measured Cell Identity /
656 DE_BMAPLE_IMEI, / IMEI /
659 bssmap_le_elem_idx_t;
663 guint16 (*bssmap_le_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) = {
664 /* NOTE: The null types below are defined elsewhere. i.e in packet-gsm_a_bssmap.c */
665 de_bmaple_lcs_qos, /* 10.16 LCS QoS */
666 NULL, /* LCS Priority */
667 NULL, /* 10.18 Location Type */
668 be_ganss_loc_type, /* GANSS Location Type */
669 NULL, /* 10.9 Geographic Location */
670 de_bmaple_pos_dta, /* 10.20 Positioning Data */
671 be_ganss_pos_dta, /* GANSS Positioning Data */
672 NULL, /* Velocity Data */
673 de_bmaple_cause, /* 10.13 LCS Cause */
674 de_bmaple_client, /* LCS Client Type */
675 de_bmaple_apdu, /* APDU */
676 NULL, /* Network Element Identity */
677 NULL, /* Requested GPS Assitance Data */
678 be_ganss_ass_dta, /* Requested GANSS Assistance Data */
679 de_bmaple_decihp_keys, /* 10.8 Deciphering Keys */
680 NULL, /* Return Error Request */
681 NULL, /* Return Error Cause */
682 NULL, /* Segmentation */
683 NULL, /* 10.7 Classmark Information Type 3 */
685 NULL, /* Cell Identifier */
686 NULL, /* 10.6 Chosen Channel */
687 de_mid, /* 10.11 IMSI */
691 be_lcs_capability, /* LCS Capability */
692 be_packet_meas_rep, /* Packet Measurement Report */
693 be_measured_cell_identity, /* Measured Cell Identity List */
694 de_mid, /* IMEI (use same dissector as IMSI) */
701 * 9.1 PERFORM LOCATION REQUEST
704 bssmap_le_perf_loc_request(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
710 curr_offset = offset;
713 /* Location Type 9.1.1 M 3-n */
714 ELEM_MAND_TLV(gsm_bssmap_elem_strings[BE_LOC_TYPE].value, GSM_A_PDU_TYPE_BSSMAP, BE_LOC_TYPE, NULL)
715 /* Cell Identifier 9.1.2 O 5-10 */
716 ELEM_MAND_TLV(gsm_bssmap_elem_strings[BE_CELL_ID].value, GSM_A_PDU_TYPE_BSSMAP, BE_CELL_ID, NULL);
717 /* Classmark Information Type 3 9.1.3 O 3-14 */
718 ELEM_OPT_TLV(gsm_bssmap_elem_strings[BE_CM_INFO_3].value, GSM_A_PDU_TYPE_BSSMAP, BE_CM_INFO_3, NULL);
719 /* LCS Client Type 9.1.4 C (note 3) 3-n */
720 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_LCS_CLIENT_TYPE].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_LCS_CLIENT_TYPE, NULL);
721 /* Chosen Channel 9.1.5 O 2 */
722 ELEM_OPT_TV(gsm_bssmap_elem_strings[BE_CHOSEN_CHAN].value, GSM_A_PDU_TYPE_BSSMAP, BE_CHOSEN_CHAN, NULL);
723 /* LCS Priority 9.1.6 O 3-n */
724 ELEM_OPT_TLV(gsm_bssmap_elem_strings[BE_LCS_PRIO].value, GSM_A_PDU_TYPE_BSSMAP, BE_LCS_PRIO, NULL);
725 /* LCS QoS 9.1.6a C (note 1) 3-n */
726 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_LCSQOS].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_LCSQOS, NULL);
727 /* GPS Assistance Data 9.1.7 C (note 2) 3-n */
728 ELEM_OPT_TLV(gsm_bssmap_elem_strings[BE_GPS_ASSIST_DATA].value, GSM_A_PDU_TYPE_BSSMAP, BE_GPS_ASSIST_DATA, NULL);
729 /* APDU 9.1.8 O 3-n */
730 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_APDU].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_APDU, NULL);
731 /* LCS Capability 9.1.9 O */
732 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_LCS_CAPABILITY].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_LCS_CAPABILITY, NULL);
733 /* Packet Measurement Report 9.1.10 O*/
734 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_PACKET_MEAS_REP].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_PACKET_MEAS_REP, NULL);
735 /* Measured Cell Identity List 9.1.11 O*/
736 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_MEAS_CELL_ID].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_MEAS_CELL_ID, NULL);
737 /* IMSI 9.1.12 O (note 4) 5-10 */
738 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_IMSI].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_IMSI, NULL);
739 /* IMEI 9.1.13 O (note 4) 10 (use same decode as IMSI) */
740 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_IMEI].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_IMEI, NULL);
741 /* GANSS Location Type 9.1.14 C 3 */
742 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_GANSS_LOC_TYPE].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_GANSS_LOC_TYPE, NULL);
743 /* GANSS Assistance Data 9.1.15 C (note 5) 3-n */
744 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_REQ_GNSS_ASSIST_D].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_REQ_GNSS_ASSIST_D, NULL);
746 EXTRANEOUS_DATA_CHECK(curr_len, 0);
751 * 9.2 PERFORM LOCATION RESPONSE
754 bssmap_le_perf_loc_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
760 curr_offset = offset;
763 /* Location Estimate 9.2.1 C (note 1) 3-n */
764 ELEM_OPT_TLV(gsm_bssmap_elem_strings[BE_LOC_EST].value, BSSAP_PDU_TYPE_BSSMAP, BE_LOC_EST, NULL);
765 /* Positioning Data 9.2.2 O 3-n */
766 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_POS_DATA].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_POS_DATA, NULL);
767 /* Deciphering Keys 9.2.3 C (note 2) 3-n */
768 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_DECIPH_KEYS].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_DECIPH_KEYS, NULL);
769 /* LCS Cause 9.2.4 C (note 3) 3-n */
770 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_LCS_CAUSE].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_LCS_CAUSE, NULL);
771 /* Velocity Estimate 9.2.5 O 3-n */
772 ELEM_OPT_TLV(gsm_bssmap_elem_strings[BE_VEL_EST].value, BSSAP_PDU_TYPE_BSSMAP, BE_VEL_EST, NULL);
773 /* GANSS Positioning Data 9.2.6 O 3-n */
774 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_GANSS_POS_DATA].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_GANSS_POS_DATA, NULL);
776 EXTRANEOUS_DATA_CHECK(curr_len, 0);
780 * 9.8 CONNECTION ORIENTED INFORMATION
783 bssmap_le_connection_oriented(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
789 curr_offset = offset;
792 /* APDU 9.8.1 M 3-n */
793 ELEM_MAND_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_APDU].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_APDU, NULL);
794 /* Segmentation 9.8.2 */
795 ELEM_OPT_TLV(gsm_bssmap_elem_strings[BE_SEG].value, BSSAP_PDU_TYPE_BSSMAP, BE_SEG, NULL);
797 EXTRANEOUS_DATA_CHECK(curr_len, 0);
801 * 9.9 CONNECTIONLESS INFORMATION
803 Network Element Identity (source) 3.2.2.69 Both M 3-n
804 Network Element Identity (target) 3.2.2.69 Both M 3-n
805 APDU 3.2.2.68 Both M 3-n
806 Segmentation 3.2,2,74 Both C (note 1) 5
807 Return Error Request 3.2.2.72 Both C (note 2) 3-n
808 Return Error Cause 3.2.2.73 Both C (note 3) 3-n
812 * 9.11 RESET ACKNOWLEDGE
817 * 9.12 PERFORM LOCATION INFORMATION
820 bssmap_le_perf_loc_info(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
826 curr_offset = offset;
829 /* Cell Identifier 9.12.1 M */
830 ELEM_MAND_TLV(gsm_bssmap_elem_strings[BE_CELL_ID].value, GSM_A_PDU_TYPE_BSSMAP, BE_CELL_ID, NULL);
831 /* APDU 9.1.8 O 3-n */
832 ELEM_OPT_TLV(gsm_bssmap_le_elem_strings[DE_BMAPLE_APDU].value, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_APDU, NULL);
834 EXTRANEOUS_DATA_CHECK(curr_len, 0);
837 static void (*bssmap_le_msg_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len) = {
843 bssmap_le_perf_loc_request, /* Perform Location Request */
844 bssmap_le_perf_loc_resp, /* Perform Location Response */
845 bssmap_perf_loc_abort, /* Abort */
846 bssmap_le_perf_loc_info, /* Perform Location Information */
847 bssmap_le_connection_oriented, /* Connection Oriented Information */
848 NULL, /* Connectionless Information */
849 bssmap_reset, /* Reset */
850 NULL, /* Reset Acknowledge */
856 dissect_bssmap_le(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
858 static gsm_a_tap_rec_t tap_rec[4];
859 static gsm_a_tap_rec_t *tap_p;
860 static guint tap_current=0;
862 guint32 offset, saved_offset;
865 proto_item *bssmap_le_item = NULL;
866 proto_tree *bssmap_le_tree = NULL;
868 sccp_msg_info_t* sccp_msg;
870 sccp_msg = pinfo->sccp_info;
872 if (!(sccp_msg && sccp_msg->data.co.assoc)) {
876 col_append_str(pinfo->cinfo, COL_INFO, "(BSSMAP LE) ");
879 * set tap record pointer
882 if (tap_current >= 4)
886 tap_p = &tap_rec[tap_current];
890 saved_offset = offset;
895 len = tvb_length(tvb);
898 * add BSSMAP message name
900 oct = tvb_get_guint8(tvb, offset++);
902 str = match_strval_idx((guint32) oct, gsm_bssmap_le_msg_strings, &idx);
904 if (sccp_msg && !sccp_msg->data.co.label) {
905 sccp_msg->data.co.label = se_strdup(val_to_str((guint32) oct, gsm_bssmap_le_msg_strings, "BSSMAP LE(0x%02x)"));
909 * create the protocol tree
914 proto_tree_add_protocol_format(tree, proto_bssmap_le, tvb, 0, len,
915 "Lb - I/F BSSMAP LE - Unknown BSSMAP Message Type (0x%02x)",
918 bssmap_le_tree = proto_item_add_subtree(bssmap_le_item, ett_bssmap_le_msg);
923 proto_tree_add_protocol_format(tree, proto_bssmap_le, tvb, 0, -1,
924 "Lb - I/F BSSMAP LE - %s",
927 bssmap_le_tree = proto_item_add_subtree(bssmap_le_item, ett_gsm_bssmap_le_msg[idx]);
929 if (check_col(pinfo->cinfo, COL_INFO))
931 col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", str);
935 * add BSSMAP message name
937 proto_tree_add_uint_format(bssmap_le_tree, hf_gsm_bssmap_le_msg_type,
938 tvb, saved_offset, 1, oct, "Message Type %s",str);
941 tap_p->pdu_type = BSSAP_PDU_TYPE_BSSMAP;
942 tap_p->message_type = oct;
944 tap_queue_packet(gsm_a_tap, pinfo, tap_p);
946 if (str == NULL) return;
948 if (offset >= len) return;
953 if (bssmap_le_msg_fcn[idx] == NULL)
955 proto_tree_add_text(bssmap_le_tree,
956 tvb, offset, len - offset,
961 (*bssmap_le_msg_fcn[idx])(tvb, bssmap_le_tree, offset, len - offset);
965 /* Register the protocol with Wireshark */
967 proto_register_gsm_bssmap_le(void)
972 /* Setup list of header fields */
973 static hf_register_info hf[] = {
974 { &hf_gsm_bssmap_le_msg_type,
975 { "BSSMAP LE Message Type", "bssmap_le.msgtype",
976 FT_UINT8, BASE_HEX, VALS(gsm_bssmap_le_msg_strings), 0x0,
979 { &hf_gsm_bssmap_le_elem_id,
980 { "Element ID", "bssmap_le.elem_id",
981 FT_UINT8, BASE_DEC, NULL, 0,
984 { &hf_gsm_bssmap_le_apdu_protocol_id,
985 { "Protocol ID", "bssmap_le.apdu_protocol_id",
986 FT_UINT8, BASE_DEC, VALS(gsm_apdu_protocol_id_strings), 0x0,
987 "APDU embedded protocol id", HFILL }
989 { &hf_gsm_bssmap_le_spare,
990 { "Spare", "gsm_bssmap_le.spare",
991 FT_UINT8, BASE_HEX, NULL, 0x0,
994 { &hf_gsm_bssmap_le_ciphering_key_flag,
995 { "Ciphering Key Flag", "gsm_bssmap_le.decipheringKeys.flag",
996 FT_UINT8, BASE_DEC, NULL, 0x0,
999 { &hf_gsm_bssmap_le_current_deciphering_key_value,
1000 { "Current Deciphering Key Value", "gsm_bssmap_le.decipheringKeys.current",
1001 FT_UINT8, BASE_DEC, NULL, 0x0, NULL,
1004 { &hf_gsm_bssmap_le_next_deciphering_key_value,
1005 { "Next Deciphering Key Value", "gsm_bssmap_le.decipheringKeys.next",
1006 FT_UINT8, BASE_DEC, NULL, 0x0,
1009 { &hf_gsm_bssmap_le_lcs_cause_value,
1010 { "Cause Value", "gsm_bssmap_le.lcsCauseValue",
1011 FT_UINT8, BASE_HEX, VALS(bssmap_le_lcs_cause_values), 0x0,
1014 { &hf_gsm_bssmap_le_diagnostic_value,
1015 { "Diagnostic Value", "gsm_bssmap_le.diagnosticValue",
1016 FT_UINT8, BASE_HEX, VALS(bssmap_le_position_method_failure_diagnostic_vals), 0x0,
1019 { &hf_gsm_bssmap_le_client_category,
1020 { "Client Category", "gsm_bssmap_le.lcsClientType.clientCategory",
1021 FT_UINT8, BASE_HEX, VALS(bssmap_le_client_category), 0x0,
1024 { &hf_gsm_bssmap_le_client_subtype,
1025 { "Client Subtype", "gsm_bssmap_le.lcsClientType.clientSubtype",
1026 FT_UINT8, BASE_HEX, VALS(bssmap_le_client_subtype), 0x0,
1029 { &hf_gsm_bssmap_le_velocity_requested,
1030 { "Velocity Requested", "gsm_bssmap_le.lcsQos.velocityRequested",
1031 FT_UINT8, BASE_HEX, VALS(bssmap_le_velocity_requested_vals), 0x0,
1034 { &hf_gsm_bssmap_le_vertical_coordinate_indicator,
1035 { "Vertical Coordinate Indicator", "gsm_bssmap_le.lcsQos.verticalCoordinateIndicator",
1036 FT_UINT8, BASE_HEX, VALS(bssmap_le_vertical_coordinate_indicator_vals), 0x0,
1039 { &hf_gsm_bssmap_le_horizontal_accuracy_indicator,
1040 { "Horizontal Accuracy Indicator", "gsm_bssmap_le.lcsQos.horizontalAccuracyIndicator",
1041 FT_UINT8, BASE_HEX, VALS(bssmap_le_horizontal_accuracy_indicator_vals), 0x0,
1044 { &hf_gsm_bssmap_le_horizontal_accuracy,
1045 { "Horizontal Accuracy", "gsm_bssmap_le.lcsQos.horizontalAccuracy",
1046 FT_UINT8, BASE_HEX, NULL, 0x0,
1049 { &hf_gsm_bssmap_le_vertical_accuracy,
1050 { "Vertical Accuracy", "gsm_bssmap_le.lcsQos.verticalAccuracy",
1051 FT_UINT8, BASE_HEX, NULL, 0x0,
1054 { &hf_gsm_bssmap_le_vertical_accuracy_indicator,
1055 { "Vertical Accuracy Indicator", "gsm_bssmap_le.lcsQos.verticalAccuracyIndicator",
1056 FT_UINT8, BASE_HEX, VALS(bssmap_le_vertical_accuracy_indicator_vals), 0x0,
1059 { &hf_gsm_bssmap_le_response_time_category,
1060 { "Response Time Category", "gsm_bssmap_le.lcsQos.responseTimeCategory",
1061 FT_UINT8, BASE_HEX, VALS(bssmap_le_response_time_definitions_vals), 0x0,
1066 /* Setup protocol subtree array */
1067 #define NUM_INDIVIDUAL_ELEMS 1
1068 gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_BSSMAP_LE_MSG +
1069 NUM_GSM_BSSMAP_LE_ELEM];
1071 ett[0] = &ett_bssmap_le_msg;
1073 last_offset = NUM_INDIVIDUAL_ELEMS;
1075 for (i=0; i < NUM_GSM_BSSMAP_LE_MSG; i++, last_offset++)
1077 ett_gsm_bssmap_le_msg[i] = -1;
1078 ett[last_offset] = &ett_gsm_bssmap_le_msg[i];
1081 for (i=0; i < NUM_GSM_BSSMAP_LE_ELEM; i++, last_offset++)
1083 ett_gsm_bssmap_le_elem[i] = -1;
1084 ett[last_offset] = &ett_gsm_bssmap_le_elem[i];
1087 /* Register the protocol name and description */
1090 proto_register_protocol("Lb-I/F BSSMAP LE", "GSM BSSMAP LE", "gsm_bssmap_le");
1092 proto_register_field_array(proto_bssmap_le, hf, array_length(hf));
1094 proto_register_subtree_array(ett, array_length(ett));
1096 register_dissector("gsm_bssmap_le", dissect_bssmap_le, proto_bssmap_le);
1100 proto_reg_handoff_gsm_bssmap_le(void)
1102 dissector_handle_t bssmap_le_handle;
1104 bssmap_le_handle = find_dissector("gsm_bssmap_le");
1106 dissector_add("bssap.pdu_type", BSSAP_PDU_TYPE_BSSMAP, bssmap_le_handle);
1108 gsm_bsslap_handle = find_dissector("gsm_bsslap");