HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-gsmtap.c
blobb67d5d3a6567376370a69ed4e898e826539848ab
1 /* packet-gsmtap.c
2 * Routines for GSMTAP captures
4 * (C) 2008-2013 by Harald Welte <laforge@gnumonks.org>
5 * (C) 2011 by Holger Hans Peter Freyther
7 * $Id$
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 /* GSMTAP is a generic header format for GSM protocol captures,
29 * it uses the IANA-assigned UDP port number 4729 and carries
30 * payload in various formats of GSM interfaces such as Um MAC
31 * blocks or Um bursts.
33 * Example programs generating GSMTAP data are airprobe
34 * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/)
36 * It has also been used for Tetra by the OsmocomTETRA project.
37 * (http://tetra.osmocom.org/)
39 * GSMTAP also carries payload in various formats of WiMAX interfaces.
40 * It uses the wimax plugin to decode the WiMAX bursts.
43 #include "config.h"
45 #include <glib.h>
46 #include <epan/packet.h>
47 #include <epan/prefs.h>
49 #include "packet-tetra.h"
50 #include "packet-rrc.h"
52 /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
53 /* The following types and definitions are imported from libosmocore,
54 * the original source of the GSMTAP format.
56 * prior to getting them accepted/included into the official Osmocom
57 * GSMTAP definition, available from
58 * http://cgit.osmocom.org/cgit/libosmocore/tree/include/osmocom/core/gsmtap.h
60 * The GSMTAP maintainer can be contacted via the
61 * openbsc@lists.osmocom.org mailing list, or by private e-mail
62 * to laforge@gnumonks.org
64 /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
65 #define GSMTAP_TYPE_UM 0x01
66 #define GSMTAP_TYPE_ABIS 0x02
67 #define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */
68 #define GSMTAP_TYPE_SIM 0x04
69 #define GSMTAP_TYPE_TETRA_I1 0x05 /* tetra air interface */
70 #define GSMTAP_TTPE_TETRA_I1_BURST 0x06 /* tetra air interface */
71 #define GSMTAP_TYPE_WMX_BURST 0x07 /* WiMAX burst */
72 #define GSMTAP_TYPE_GB_LLC 0x08 /* GPRS Gb interface: LLC */
73 #define GSMTAP_TYPE_GB_SNDCP 0x09 /* GPRS Gb interface: SNDCP */
74 #define GSMTAP_TYPE_GMR1_UM 0x0a /* GMR-1 L2 packets */
75 #define GSMTAP_TYPE_UMTS_RLC_MAC 0x0b
76 #define GSMTAP_TYPE_UMTS_RRC 0x0c
78 /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
79 #define GSMTAP_BURST_UNKNOWN 0x00
80 #define GSMTAP_BURST_FCCH 0x01
81 #define GSMTAP_BURST_PARTIAL_SCH 0x02
82 #define GSMTAP_BURST_SCH 0x03
83 #define GSMTAP_BURST_CTS_SCH 0x04
84 #define GSMTAP_BURST_COMPACT_SCH 0x05
85 #define GSMTAP_BURST_NORMAL 0x06
86 #define GSMTAP_BURST_DUMMY 0x07
87 #define GSMTAP_BURST_ACCESS 0x08
88 #define GSMTAP_BURST_NONE 0x09
89 /* WiMAX bursts */
90 #define GSMTAP_BURST_CDMA_CODE 0x10 /* WiMAX CDMA Code Attribute burst */
91 #define GSMTAP_BURST_FCH 0x11 /* WiMAX FCH burst */
92 #define GSMTAP_BURST_FFB 0x12 /* WiMAX Fast Feedback burst */
93 #define GSMTAP_BURST_PDU 0x13 /* WiMAX PDU burst */
94 #define GSMTAP_BURST_HACK 0x14 /* WiMAX HARQ ACK burst */
95 #define GSMTAP_BURST_PHY_ATTRIBUTES 0x15 /* WiMAX PHY Attributes burst */
97 /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
98 /* sub-types for TYPE_UM */
99 #define GSMTAP_CHANNEL_UNKNOWN 0x00
100 #define GSMTAP_CHANNEL_BCCH 0x01
101 #define GSMTAP_CHANNEL_CCCH 0x02
102 #define GSMTAP_CHANNEL_RACH 0x03
103 #define GSMTAP_CHANNEL_AGCH 0x04
104 #define GSMTAP_CHANNEL_PCH 0x05
105 #define GSMTAP_CHANNEL_SDCCH 0x06
106 #define GSMTAP_CHANNEL_SDCCH4 0x07
107 #define GSMTAP_CHANNEL_SDCCH8 0x08
108 #define GSMTAP_CHANNEL_TCH_F 0x09
109 #define GSMTAP_CHANNEL_TCH_H 0x0a
110 #define GSMTAP_CHANNEL_PACCH 0x0b
111 #define GSMTAP_CHANNEL_CBCH52 0x0c
112 #define GSMTAP_CHANNEL_PDCH 0x0d
113 #define GSMTAP_CHANNEL_PTCCH 0x0e
114 #define GSMTAP_CHANNEL_CBCH51 0x0f
116 /* GPRS Coding Scheme CS1..4 */
117 #define GSMTAP_GPRS_CS_BASE 0x20
118 #define GSMTAP_GPRS_CS(N) (GSMTAP_GPRS_CS_BASE + N)
119 /* (E) GPRS Coding Scheme MCS0..9 */
120 #define GSMTAP_GPRS_MCS_BASE 0x30
121 #define GSMTAP_GPRS_MCS(N) (GSMTAP_GPRS_MCS_BASE + N)
123 #define GSMTAP_CHANNEL_ACCH 0x80
125 /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
126 /* sub-types for TYPE_TETRA_AIR */
127 #define GSMTAP_TETRA_BSCH 0x01
128 #define GSMTAP_TETRA_AACH 0x02
129 #define GSMTAP_TETRA_SCH_HU 0x03
130 #define GSMTAP_TETRA_SCH_HD 0x04
131 #define GSMTAP_TETRA_SCH_F 0x05
132 #define GSMTAP_TETRA_BNCH 0x06
133 #define GSMTAP_TETRA_STCH 0x07
134 #define GSMTAP_TETRA_TCH_F 0x08
136 /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */
137 /* sub-types for TYPE_GMR1 */
138 #define GSMTAP_GMR1_UNKNOWN 0x00
139 #define GSMTAP_GMR1_BCCH 0x01
140 #define GSMTAP_GMR1_CCCH 0x02 /* either AGCH or PCH */
141 #define GSMTAP_GMR1_PCH 0x03
142 #define GSMTAP_GMR1_AGCH 0x04
143 #define GSMTAP_GMR1_BACH 0x05
144 #define GSMTAP_GMR1_RACH 0x06
145 #define GSMTAP_GMR1_CBCH 0x07
146 #define GSMTAP_GMR1_SDCCH 0x08
147 #define GSMTAP_GMR1_TACCH 0x09
148 #define GSMTAP_GMR1_GBCH 0x0a
150 #define GSMTAP_GMR1_SACCH 0x01 /* to be combined with _TCH{6,9} */
151 #define GSMTAP_GMR1_FACCH 0x02 /* to be combines with _TCH{3,6,9} */
152 #define GSMTAP_GMR1_DKAB 0x03 /* to be combined with _TCH3 */
153 #define GSMTAP_GMR1_TCH3 0x10
154 #define GSMTAP_GMR1_TCH6 0x14
155 #define GSMTAP_GMR1_TCH9 0x18
157 #define GSMTAP_ARFCN_F_PCS 0x8000
158 #define GSMTAP_ARFCN_F_UPLINK 0x4000
159 #define GSMTAP_ARFCN_MASK 0x3fff
161 #define GSMTAP_UDP_PORT 4729
163 /* This is the header as it is used by gsmtap-generating software.
164 * It is not used by the wireshark dissector and provided for reference only.
165 struct gsmtap_hdr {
166 guint8 version; // version, set to 0x01 currently
167 guint8 hdr_len; // length in number of 32bit words
168 guint8 type; // see GSMTAP_TYPE_*
169 guint8 timeslot; // timeslot (0..7 on Um)
171 guint16 arfcn; // ARFCN (frequency)
172 gint8 signal_dbm; // signal level in dBm
173 gint8 snr_db; // signal/noise ratio in dB
175 guint32 frame_number; // GSM Frame Number (FN)
177 guint8 sub_type; // Type of burst/channel, see above
178 guint8 antenna_nr; // Antenna Number
179 guint8 sub_slot; // sub-slot within timeslot
180 guint8 res; // reserved for future use (RFU)
184 static int proto_gsmtap = -1;
186 static int hf_gsmtap_version = -1;
187 static int hf_gsmtap_hdrlen = -1;
188 static int hf_gsmtap_type = -1;
189 static int hf_gsmtap_timeslot = -1;
190 static int hf_gsmtap_subslot = -1;
191 static int hf_gsmtap_arfcn = -1;
192 static int hf_gsmtap_uplink = -1;
193 static int hf_gsmtap_noise_dbm = -1;
194 static int hf_gsmtap_signal_dbm = -1;
195 static int hf_gsmtap_frame_nr = -1;
196 static int hf_gsmtap_burst_type = -1;
197 static int hf_gsmtap_channel_type = -1;
198 static int hf_gsmtap_tetra_channel_type = -1;
199 static int hf_gsmtap_gmr1_channel_type = -1;
200 static int hf_gsmtap_antenna = -1;
202 static int hf_sacch_l1h_power_lev = -1;
203 static int hf_sacch_l1h_fpc = -1;
204 static int hf_sacch_l1h_ta = -1;
206 static gint ett_gsmtap = -1;
208 enum {
209 GSMTAP_SUB_DATA = 0,
210 GSMTAP_SUB_UM,
211 GSMTAP_SUB_UM_LAPDM,
212 GSMTAP_SUB_UM_RLC_MAC_UL,
213 GSMTAP_SUB_UM_RLC_MAC_DL,
214 GSMTAP_SUB_LLC,
215 GSMTAP_SUB_SNDCP,
216 GSMTAP_SUB_ABIS,
217 /* WiMAX sub handles */
218 GSMTAP_SUB_CDMA_CODE,
219 GSMTAP_SUB_FCH,
220 GSMTAP_SUB_FFB,
221 GSMTAP_SUB_PDU,
222 GSMTAP_SUB_HACK,
223 GSMTAP_SUB_PHY_ATTRIBUTES,
224 GSMTAP_SUB_CBCH,
225 GSMTAP_SUB_SIM,
226 /* GMR-1 sub handles */
227 GSMTAP_SUB_GMR1_BCCH,
228 GSMTAP_SUB_GMR1_CCCH,
229 GSMTAP_SUB_GMR1_LAPSAT,
230 GSMTAP_SUB_GMR1_RACH,
231 /* UMTS */
232 GSMTAP_SUB_UMTS_RLC_MAC,
233 GSMTAP_SUB_UMTS_RRC,
235 GSMTAP_SUB_MAX
238 enum {
239 GSMTAP_RRC_SUB_DL_DCCH_Message = 0,
240 GSMTAP_RRC_SUB_UL_DCCH_Message,
241 GSMTAP_RRC_SUB_DL_CCCH_Message,
242 GSMTAP_RRC_SUB_UL_CCCH_Message,
243 GSMTAP_RRC_SUB_PCCH_Message,
244 GSMTAP_RRC_SUB_DL_SHCCH_Message,
245 GSMTAP_RRC_SUB_UL_SHCCH_Message,
246 GSMTAP_RRC_SUB_BCCH_FACH_Message,
247 GSMTAP_RRC_SUB_BCCH_BCH_Message,
248 GSMTAP_RRC_SUB_MCCH_Message,
249 GSMTAP_RRC_SUB_MSCH_Message,
250 GSMTAP_RRC_SUB_HandoverToUTRANCommand,
251 GSMTAP_RRC_SUB_InterRATHandoverInfo,
252 GSMTAP_RRC_SUB_SystemInformation_BCH,
253 GSMTAP_RRC_SUB_System_Information_Container,
254 GSMTAP_RRC_SUB_UE_RadioAccessCapabilityInfo,
255 GSMTAP_RRC_SUB_MasterInformationBlock,
256 GSMTAP_RRC_SUB_SysInfoType1,
257 GSMTAP_RRC_SUB_SysInfoType2,
258 GSMTAP_RRC_SUB_SysInfoType3,
259 GSMTAP_RRC_SUB_SysInfoType4,
260 GSMTAP_RRC_SUB_SysInfoType5,
261 GSMTAP_RRC_SUB_SysInfoType5bis,
262 GSMTAP_RRC_SUB_SysInfoType6,
263 GSMTAP_RRC_SUB_SysInfoType7,
264 GSMTAP_RRC_SUB_SysInfoType8,
265 GSMTAP_RRC_SUB_SysInfoType9,
266 GSMTAP_RRC_SUB_SysInfoType10,
267 GSMTAP_RRC_SUB_SysInfoType11,
268 GSMTAP_RRC_SUB_SysInfoType11bis,
269 GSMTAP_RRC_SUB_SysInfoType12,
270 GSMTAP_RRC_SUB_SysInfoType13,
271 GSMTAP_RRC_SUB_SysInfoType13_1,
272 GSMTAP_RRC_SUB_SysInfoType13_2,
273 GSMTAP_RRC_SUB_SysInfoType13_3,
274 GSMTAP_RRC_SUB_SysInfoType13_4,
275 GSMTAP_RRC_SUB_SysInfoType14,
276 GSMTAP_RRC_SUB_SysInfoType15,
277 GSMTAP_RRC_SUB_SysInfoType15bis,
278 GSMTAP_RRC_SUB_SysInfoType15_1,
279 GSMTAP_RRC_SUB_SysInfoType15_1bis,
280 GSMTAP_RRC_SUB_SysInfoType15_2,
281 GSMTAP_RRC_SUB_SysInfoType15_2bis,
282 GSMTAP_RRC_SUB_SysInfoType15_2ter,
283 GSMTAP_RRC_SUB_SysInfoType15_3,
284 GSMTAP_RRC_SUB_SysInfoType15_3bis,
285 GSMTAP_RRC_SUB_SysInfoType15_4,
286 GSMTAP_RRC_SUB_SysInfoType15_5,
287 GSMTAP_RRC_SUB_SysInfoType15_6,
288 GSMTAP_RRC_SUB_SysInfoType15_7,
289 GSMTAP_RRC_SUB_SysInfoType15_8,
290 GSMTAP_RRC_SUB_SysInfoType16,
291 GSMTAP_RRC_SUB_SysInfoType17,
292 GSMTAP_RRC_SUB_SysInfoType18,
293 GSMTAP_RRC_SUB_SysInfoType19,
294 GSMTAP_RRC_SUB_SysInfoType20,
295 GSMTAP_RRC_SUB_SysInfoType21,
296 GSMTAP_RRC_SUB_SysInfoType22,
297 GSMTAP_RRC_SUB_SysInfoTypeSB1,
298 GSMTAP_RRC_SUB_SysInfoTypeSB2,
299 GSMTAP_RRC_SUB_ToTargetRNC_Container,
300 GSMTAP_RRC_SUB_TargetRNC_ToSourceRNC_Container,
302 GSMTAP_RRC_SUB_MAX
305 static dissector_handle_t sub_handles[GSMTAP_SUB_MAX];
306 static dissector_handle_t rrc_sub_handles[GSMTAP_RRC_SUB_MAX];
308 static dissector_table_t gsmtap_dissector_table;
310 static const value_string gsmtap_bursts[] = {
311 { GSMTAP_BURST_UNKNOWN, "UNKNOWN" },
312 { GSMTAP_BURST_FCCH, "FCCH" },
313 { GSMTAP_BURST_PARTIAL_SCH, "PARTIAL SCH" },
314 { GSMTAP_BURST_SCH, "SCH" },
315 { GSMTAP_BURST_CTS_SCH, "CTS SCH" },
316 { GSMTAP_BURST_COMPACT_SCH, "COMPACT SCH" },
317 { GSMTAP_BURST_NORMAL, "NORMAL" },
318 { GSMTAP_BURST_DUMMY, "DUMMY" },
319 { GSMTAP_BURST_ACCESS, "RACH" },
320 /* WiMAX bursts */
321 { GSMTAP_BURST_CDMA_CODE, "CDMA Code" },
322 { GSMTAP_BURST_FCH, "FCH" },
323 { GSMTAP_BURST_FFB, "Fast Feedback" },
324 { GSMTAP_BURST_PDU, "PDU" },
325 { GSMTAP_BURST_HACK, "HACK" },
326 { GSMTAP_BURST_PHY_ATTRIBUTES, "PHY Attributes" },
327 { 0, NULL },
330 static const value_string gsmtap_channels[] = {
331 { GSMTAP_CHANNEL_UNKNOWN, "UNKNOWN" },
332 { GSMTAP_CHANNEL_BCCH, "BCCH" },
333 { GSMTAP_CHANNEL_CCCH, "CCCH" },
334 { GSMTAP_CHANNEL_RACH, "RACH" },
335 { GSMTAP_CHANNEL_AGCH, "AGCH" },
336 { GSMTAP_CHANNEL_PCH, "PCH" },
337 { GSMTAP_CHANNEL_SDCCH, "SDCCH" },
338 { GSMTAP_CHANNEL_SDCCH4, "SDCCH/4" },
339 { GSMTAP_CHANNEL_SDCCH8, "SDCCH/8" },
340 { GSMTAP_CHANNEL_TCH_F, "FACCH/F" },
341 { GSMTAP_CHANNEL_TCH_H, "FACCH/H" },
342 { GSMTAP_CHANNEL_PACCH, "PACCH" },
343 { GSMTAP_CHANNEL_CBCH52, "CBCH" },
344 { GSMTAP_CHANNEL_PDCH, "PDCH" },
345 { GSMTAP_CHANNEL_PTCCH, "PTTCH" },
346 { GSMTAP_CHANNEL_CBCH51, "CBCH" },
348 { GSMTAP_CHANNEL_ACCH|
349 GSMTAP_CHANNEL_SDCCH, "LSACCH" },
350 { GSMTAP_CHANNEL_ACCH|
351 GSMTAP_CHANNEL_SDCCH4, "SACCH/4" },
352 { GSMTAP_CHANNEL_ACCH|
353 GSMTAP_CHANNEL_SDCCH8, "SACCH/8" },
354 { GSMTAP_CHANNEL_ACCH|
355 GSMTAP_CHANNEL_TCH_F, "SACCH/F" },
356 { GSMTAP_CHANNEL_ACCH|
357 GSMTAP_CHANNEL_TCH_H, "SACCH/H" },
358 { 0, NULL },
361 static const value_string gsmtap_tetra_channels[] = {
362 { GSMTAP_TETRA_BSCH, "BSCH" },
363 { GSMTAP_TETRA_AACH, "AACH" },
364 { GSMTAP_TETRA_SCH_HU, "SCH/HU" },
365 { GSMTAP_TETRA_SCH_HD, "SCH/HD" },
366 { GSMTAP_TETRA_SCH_F, "SCH/F" },
367 { GSMTAP_TETRA_BNCH, "BNCH" },
368 { GSMTAP_TETRA_STCH, "STCH" },
369 { GSMTAP_TETRA_TCH_F, "AACH" },
370 { 0, NULL },
373 static const value_string gsmtap_gmr1_channels[] = {
374 { GSMTAP_GMR1_BCCH, "BCCH" },
375 { GSMTAP_GMR1_CCCH, "CCCH" },
376 { GSMTAP_GMR1_PCH, "PCH" },
377 { GSMTAP_GMR1_AGCH, "AGCH" },
378 { GSMTAP_GMR1_BACH, "BACH" },
379 { GSMTAP_GMR1_RACH, "RACH" },
380 { GSMTAP_GMR1_CBCH, "CBCH" },
381 { GSMTAP_GMR1_SDCCH, "SDCCH" },
382 { GSMTAP_GMR1_TACCH, "TACCH" },
383 { GSMTAP_GMR1_GBCH, "GBCH" },
384 { GSMTAP_GMR1_TCH3, "TCH3" },
385 { GSMTAP_GMR1_TCH3|
386 GSMTAP_GMR1_FACCH, "FACCH3" },
387 { GSMTAP_GMR1_TCH3|
388 GSMTAP_GMR1_DKAB, "DKAB" },
389 { GSMTAP_GMR1_TCH6, "TCH6" },
390 { GSMTAP_GMR1_TCH6|
391 GSMTAP_GMR1_FACCH, "FACCH6" },
392 { GSMTAP_GMR1_TCH6|
393 GSMTAP_GMR1_SACCH, "SACCH6" },
394 { GSMTAP_GMR1_TCH9, "TCH9" },
395 { GSMTAP_GMR1_TCH9|
396 GSMTAP_GMR1_FACCH, "FACCH9" },
397 { GSMTAP_GMR1_TCH9|
398 GSMTAP_GMR1_SACCH, "SACCH9" },
399 { 0, NULL },
402 /* the mapping is not complete */
403 static const int gsmtap_to_tetra[9] = {
405 TETRA_CHAN_BSCH,
406 TETRA_CHAN_AACH,
407 TETRA_CHAN_SCH_HU,
409 TETRA_CHAN_SCH_F,
410 TETRA_CHAN_BNCH,
411 TETRA_CHAN_STCH,
415 static const value_string gsmtap_types[] = {
416 { GSMTAP_TYPE_UM, "GSM Um (MS<->BTS)" },
417 { GSMTAP_TYPE_ABIS, "GSM Abis (BTS<->BSC)" },
418 { GSMTAP_TYPE_UM_BURST, "GSM Um burst (MS<->BTS)" },
419 { GSMTAP_TYPE_SIM, "SIM" },
420 { GSMTAP_TYPE_TETRA_I1, "TETRA V+D"},
421 { GSMTAP_TTPE_TETRA_I1_BURST, "TETRA V+D burst"},
422 { GSMTAP_TYPE_WMX_BURST,"WiMAX burst" },
423 { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)" },
424 { GSMTAP_TYPE_UMTS_RLC_MAC, "UMTS RLC/MAC" },
425 { GSMTAP_TYPE_UMTS_RRC, "UMTS RRC" },
426 { 0, NULL },
429 /* dissect a SACCH L1 header which is included in the first 2 bytes
430 * of every SACCH frame (according to TS 04.04) */
431 static void
432 dissect_sacch_l1h(tvbuff_t *tvb, proto_tree *tree)
434 proto_item *ti;
435 proto_tree *l1h_tree = NULL;
437 if (!tree)
438 return;
440 ti = proto_tree_add_protocol_format(tree, proto_gsmtap, tvb, 0, 2,
441 "SACCH L1 Header, Power Level: %u, Timing Advance: %u",
442 tvb_get_guint8(tvb, 0) & 0x1f,
443 tvb_get_guint8(tvb, 1));
444 l1h_tree = proto_item_add_subtree(ti, ett_gsmtap);
445 /* Power Level */
446 proto_tree_add_item(l1h_tree, hf_sacch_l1h_power_lev, tvb, 0, 1, ENC_BIG_ENDIAN);
447 /* Fast Power Control */
448 proto_tree_add_item(l1h_tree, hf_sacch_l1h_fpc, tvb, 0, 1, ENC_BIG_ENDIAN);
449 /* Acutal Timing Advance */
450 proto_tree_add_item(l1h_tree, hf_sacch_l1h_ta, tvb, 1, 1, ENC_BIG_ENDIAN);
454 static void
455 handle_tetra(int channel _U_, tvbuff_t *payload_tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_)
457 int tetra_chan;
458 if (channel < 0 || channel > GSMTAP_TETRA_TCH_F)
459 return;
461 tetra_chan = gsmtap_to_tetra[channel];
462 if (tetra_chan <= 0)
463 return;
465 tetra_dissect_pdu(tetra_chan, TETRA_DOWNLINK, payload_tvb, tree, pinfo);
468 /* dissect a GSMTAP header and hand payload off to respective dissector */
469 static void
470 dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
472 int sub_handle, rrc_sub_handle = 0, len, offset = 0;
473 proto_item *ti;
474 proto_tree *gsmtap_tree = NULL;
475 tvbuff_t *payload_tvb, *l1h_tvb = NULL;
476 guint8 hdr_len, type, sub_type, timeslot, subslot;
477 guint16 arfcn;
479 len = tvb_length(tvb);
481 hdr_len = tvb_get_guint8(tvb, offset + 1) <<2;
482 type = tvb_get_guint8(tvb, offset + 2);
483 timeslot = tvb_get_guint8(tvb, offset + 3);
484 arfcn = tvb_get_ntohs(tvb, offset + 4);
485 sub_type = tvb_get_guint8(tvb, offset + 12);
486 subslot = tvb_get_guint8(tvb, offset + 14);
488 /* In case of a SACCH, there is a two-byte L1 header in front
489 * of the packet (see TS 04.04) */
490 if (type == GSMTAP_TYPE_UM &&
491 sub_type & GSMTAP_CHANNEL_ACCH) {
492 l1h_tvb = tvb_new_subset(tvb, hdr_len, 2, 2);
493 payload_tvb = tvb_new_subset(tvb, hdr_len+2, len-(hdr_len+2),
494 len-(hdr_len+2));
495 } else {
496 payload_tvb = tvb_new_subset(tvb, hdr_len, len-hdr_len,
497 len-hdr_len);
500 /* We don't want any UDP related info left in the INFO field, as the
501 * gsm_a_dtap dissector will not clear but only append */
502 col_clear(pinfo->cinfo, COL_INFO);
504 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSMTAP");
506 /* Some GSMTAP types are completely unrelated to the Um air interface */
507 if (dissector_try_uint(gsmtap_dissector_table, type, payload_tvb,
508 pinfo, tree))
509 return;
511 if (arfcn & GSMTAP_ARFCN_F_UPLINK) {
512 col_append_str(pinfo->cinfo, COL_RES_NET_SRC, "MS");
513 col_append_str(pinfo->cinfo, COL_RES_NET_DST, "BTS");
514 /* p2p_dir is used by the LAPDm dissector */
515 pinfo->p2p_dir = P2P_DIR_SENT;
516 } else {
517 col_set_str(pinfo->cinfo, COL_RES_NET_SRC, "BTS");
518 switch (sub_type & ~GSMTAP_CHANNEL_ACCH) {
519 case GSMTAP_CHANNEL_BCCH:
520 case GSMTAP_CHANNEL_CCCH:
521 case GSMTAP_CHANNEL_PCH:
522 case GSMTAP_CHANNEL_AGCH:
523 case GSMTAP_CHANNEL_CBCH51:
524 case GSMTAP_CHANNEL_CBCH52:
525 col_set_str(pinfo->cinfo, COL_RES_NET_DST, "Broadcast");
526 break;
527 default:
528 col_set_str(pinfo->cinfo, COL_RES_NET_DST, "MS");
529 break;
531 /* p2p_dir is used by the LAPDm dissector */
532 pinfo->p2p_dir = P2P_DIR_RECV;
535 /* Try to build an identifier of different 'streams' */
536 /* (AFCN _cant_ be used because of hopping */
537 pinfo->circuit_id = (timeslot << 3) | subslot;
539 if (tree) {
540 guint8 channel;
541 const char *channel_str;
542 channel = tvb_get_guint8(tvb, offset+12);
543 if (type == GSMTAP_TYPE_TETRA_I1)
544 channel_str = val_to_str(channel, gsmtap_tetra_channels, "Unknown: %d");
545 else if (type == GSMTAP_TYPE_GMR1_UM)
546 channel_str = val_to_str(channel, gsmtap_gmr1_channels, "Unknown: %d");
547 else
548 channel_str = val_to_str(channel, gsmtap_channels, "Unknown: %d");
550 ti = proto_tree_add_protocol_format(tree, proto_gsmtap, tvb, 0, hdr_len,
551 "GSM TAP Header, ARFCN: %u (%s), TS: %u, Channel: %s (%u)",
552 arfcn & GSMTAP_ARFCN_MASK,
553 arfcn & GSMTAP_ARFCN_F_UPLINK ? "Uplink" : "Downlink",
554 tvb_get_guint8(tvb, offset+3),
555 channel_str,
556 tvb_get_guint8(tvb, offset+14));
557 gsmtap_tree = proto_item_add_subtree(ti, ett_gsmtap);
558 proto_tree_add_item(gsmtap_tree, hf_gsmtap_version,
559 tvb, offset, 1, ENC_BIG_ENDIAN);
560 proto_tree_add_uint_format_value(gsmtap_tree, hf_gsmtap_hdrlen,
561 tvb, offset+1, 1, hdr_len,
562 "%u bytes", hdr_len);
563 proto_tree_add_item(gsmtap_tree, hf_gsmtap_type,
564 tvb, offset+2, 1, ENC_BIG_ENDIAN);
565 proto_tree_add_item(gsmtap_tree, hf_gsmtap_timeslot,
566 tvb, offset+3, 1, ENC_BIG_ENDIAN);
567 proto_tree_add_item(gsmtap_tree, hf_gsmtap_arfcn,
568 tvb, offset+4, 2, ENC_BIG_ENDIAN);
569 proto_tree_add_item(gsmtap_tree, hf_gsmtap_uplink,
570 tvb, offset+4, 2, ENC_BIG_ENDIAN);
571 proto_tree_add_item(gsmtap_tree, hf_gsmtap_noise_dbm,
572 tvb, offset+6, 1, ENC_BIG_ENDIAN);
573 proto_tree_add_item(gsmtap_tree, hf_gsmtap_signal_dbm,
574 tvb, offset+7, 1, ENC_BIG_ENDIAN);
575 proto_tree_add_item(gsmtap_tree, hf_gsmtap_frame_nr,
576 tvb, offset+8, 4, ENC_BIG_ENDIAN);
577 if (type == GSMTAP_TYPE_UM_BURST)
578 proto_tree_add_item(gsmtap_tree, hf_gsmtap_burst_type,
579 tvb, offset+12, 1, ENC_BIG_ENDIAN);
580 else if (type == GSMTAP_TYPE_UM)
581 proto_tree_add_item(gsmtap_tree, hf_gsmtap_channel_type,
582 tvb, offset+12, 1, ENC_BIG_ENDIAN);
583 else if (type == GSMTAP_TYPE_TETRA_I1)
584 proto_tree_add_item(gsmtap_tree, hf_gsmtap_tetra_channel_type,
585 tvb, offset+12, 1, ENC_BIG_ENDIAN);
586 else if (type == GSMTAP_TYPE_WMX_BURST)
587 proto_tree_add_item(gsmtap_tree, hf_gsmtap_burst_type,
588 tvb, offset+12, 1, ENC_BIG_ENDIAN);
589 else if (type == GSMTAP_TYPE_GMR1_UM)
590 proto_tree_add_item(gsmtap_tree, hf_gsmtap_gmr1_channel_type,
591 tvb, offset+12, 1, ENC_BIG_ENDIAN);
592 proto_tree_add_item(gsmtap_tree, hf_gsmtap_antenna,
593 tvb, offset+13, 1, ENC_BIG_ENDIAN);
594 proto_tree_add_item(gsmtap_tree, hf_gsmtap_subslot,
595 tvb, offset+14, 1, ENC_BIG_ENDIAN);
598 switch (type) {
599 case GSMTAP_TYPE_UMTS_RRC:
600 sub_handle = GSMTAP_SUB_UMTS_RRC;
601 rrc_sub_handle = sub_type;
602 if (rrc_sub_handle >= GSMTAP_RRC_SUB_MAX) {
603 sub_handle = GSMTAP_SUB_DATA;
605 /* make entry in the Protocol column on summary display.
606 * Normally, the RRC dissector would be doing this, but
607 * we are bypassing dissect_rrc() and directly call a
608 * sub-dissector */
609 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRC");
610 break;
611 case GSMTAP_TYPE_UM:
612 if (l1h_tvb)
613 dissect_sacch_l1h(l1h_tvb, tree);
614 switch (sub_type & ~GSMTAP_CHANNEL_ACCH) {
615 case GSMTAP_CHANNEL_BCCH:
616 case GSMTAP_CHANNEL_CCCH:
617 case GSMTAP_CHANNEL_PCH:
618 case GSMTAP_CHANNEL_AGCH:
619 /* FIXME: we might want to skip idle frames */
620 sub_handle = GSMTAP_SUB_UM;
621 break;
622 case GSMTAP_CHANNEL_SDCCH:
623 case GSMTAP_CHANNEL_SDCCH4:
624 case GSMTAP_CHANNEL_SDCCH8:
625 case GSMTAP_CHANNEL_TCH_F:
626 case GSMTAP_CHANNEL_TCH_H:
627 sub_handle = GSMTAP_SUB_UM_LAPDM;
628 break;
629 case GSMTAP_CHANNEL_PACCH:
630 if (pinfo->p2p_dir == P2P_DIR_SENT) {
631 sub_handle = GSMTAP_SUB_UM_RLC_MAC_UL;
633 else
635 sub_handle = GSMTAP_SUB_UM_RLC_MAC_DL;
637 break;
639 case GSMTAP_CHANNEL_CBCH51:
640 case GSMTAP_CHANNEL_CBCH52:
641 sub_handle = GSMTAP_SUB_CBCH;
642 break;
644 case GSMTAP_CHANNEL_RACH:
645 default:
646 sub_handle = GSMTAP_SUB_DATA;
647 break;
649 break;
650 case GSMTAP_TYPE_ABIS:
651 sub_handle = GSMTAP_SUB_ABIS;
652 break;
653 case GSMTAP_TYPE_GB_LLC:
654 sub_handle = GSMTAP_SUB_LLC;
655 break;
656 case GSMTAP_TYPE_GB_SNDCP:
657 sub_handle = GSMTAP_SUB_SNDCP;
658 break;
659 case GSMTAP_TYPE_TETRA_I1:
660 handle_tetra(tvb_get_guint8(tvb, offset+12), payload_tvb, pinfo, tree);
661 return;
662 case GSMTAP_TYPE_WMX_BURST:
663 switch (sub_type) {
664 case GSMTAP_BURST_CDMA_CODE:
665 sub_handle = GSMTAP_SUB_CDMA_CODE;
666 break;
667 case GSMTAP_BURST_FCH:
668 sub_handle = GSMTAP_SUB_FCH;
669 break;
670 case GSMTAP_BURST_FFB:
671 sub_handle = GSMTAP_SUB_FFB;
672 break;
673 case GSMTAP_BURST_PDU:
674 sub_handle = GSMTAP_SUB_PDU;
675 break;
676 case GSMTAP_BURST_HACK:
677 sub_handle = GSMTAP_SUB_HACK;
678 break;
679 case GSMTAP_BURST_PHY_ATTRIBUTES:
680 sub_handle = GSMTAP_SUB_PHY_ATTRIBUTES;
681 break;
682 default:
683 sub_handle = GSMTAP_SUB_DATA;
684 break;
686 break;
687 case GSMTAP_TYPE_GMR1_UM:
688 switch (sub_type) {
689 case GSMTAP_GMR1_BCCH:
690 sub_handle = GSMTAP_SUB_GMR1_BCCH;
691 break;
692 case GSMTAP_GMR1_CCCH:
693 case GSMTAP_GMR1_AGCH:
694 case GSMTAP_GMR1_PCH:
695 sub_handle = GSMTAP_SUB_GMR1_CCCH;
696 break;
697 case GSMTAP_GMR1_SDCCH:
698 case GSMTAP_GMR1_TCH3 | GSMTAP_GMR1_FACCH:
699 case GSMTAP_GMR1_TCH6 | GSMTAP_GMR1_FACCH:
700 case GSMTAP_GMR1_TCH9 | GSMTAP_GMR1_FACCH:
701 sub_handle = GSMTAP_SUB_GMR1_LAPSAT;
702 break;
703 case GSMTAP_GMR1_RACH:
704 sub_handle = GSMTAP_SUB_GMR1_RACH;
705 break;
706 default:
707 sub_handle = GSMTAP_SUB_DATA;
708 break;
710 break;
711 case GSMTAP_TYPE_UM_BURST:
712 default:
713 sub_handle = GSMTAP_SUB_DATA;
714 break;
716 if (sub_handle == GSMTAP_SUB_UMTS_RRC)
717 call_dissector(rrc_sub_handles[rrc_sub_handle], payload_tvb,
718 pinfo, tree);
719 else
720 call_dissector(sub_handles[sub_handle], payload_tvb, pinfo, tree);
723 static const true_false_string sacch_l1h_fpc_mode_vals = {
724 "In use",
725 "Not in use"
728 void
729 proto_register_gsmtap(void)
731 static hf_register_info hf[] = {
732 { &hf_gsmtap_version, { "Version", "gsmtap.version",
733 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
734 { &hf_gsmtap_hdrlen, { "Header Length", "gsmtap.hdr_len",
735 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
736 { &hf_gsmtap_type, { "Payload Type", "gsmtap.type",
737 FT_UINT8, BASE_DEC, VALS(gsmtap_types), 0, NULL, HFILL } },
738 { &hf_gsmtap_timeslot, { "Time Slot", "gsmtap.ts",
739 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
740 { &hf_gsmtap_arfcn, { "ARFCN", "gsmtap.arfcn",
741 FT_UINT16, BASE_DEC, NULL, GSMTAP_ARFCN_MASK, NULL, HFILL } },
742 { &hf_gsmtap_uplink, { "Uplink", "gsmtap.uplink",
743 FT_UINT16, BASE_DEC, NULL, GSMTAP_ARFCN_F_UPLINK, NULL, HFILL } },
744 { &hf_gsmtap_noise_dbm, { "Signal/Noise Ratio (dB)", "gsmtap.snr_db",
745 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
746 { &hf_gsmtap_signal_dbm, { "Signal Level (dBm)", "gsmtap.signal_dbm",
747 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
748 { &hf_gsmtap_frame_nr, { "GSM Frame Number", "gsmtap.frame_nr",
749 FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
750 { &hf_gsmtap_burst_type, { "Burst Type", "gsmtap.burst_type",
751 FT_UINT8, BASE_DEC, VALS(gsmtap_bursts), 0, NULL, HFILL }},
752 { &hf_gsmtap_channel_type, { "Channel Type", "gsmtap.chan_type",
753 FT_UINT8, BASE_DEC, VALS(gsmtap_channels), 0, NULL, HFILL }},
754 { &hf_gsmtap_tetra_channel_type, { "Channel Type", "gsmtap.tetra_chan_type",
755 FT_UINT8, BASE_DEC, VALS(gsmtap_tetra_channels), 0, NULL, HFILL }},
756 { &hf_gsmtap_gmr1_channel_type, { "Channel Type", "gsmtap.gmr1_chan_type",
757 FT_UINT8, BASE_DEC, VALS(gsmtap_gmr1_channels), 0, NULL, HFILL }},
758 { &hf_gsmtap_antenna, { "Antenna Number", "gsmtap.antenna",
759 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
760 { &hf_gsmtap_subslot, { "Sub-Slot", "gsmtap.sub_slot",
761 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
763 { &hf_sacch_l1h_power_lev, { "MS power level", "gsmtap.sacch_l1.power_lev",
764 FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } },
765 { &hf_sacch_l1h_fpc, { "FPC", "gsmtap.sacch_l1.fpc",
766 FT_BOOLEAN, 8, TFS(&sacch_l1h_fpc_mode_vals), 0x04,
767 NULL, HFILL } },
768 { &hf_sacch_l1h_ta, { "Actual Timing Advance", "gsmtap.sacch_l1.ta",
769 FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
771 static gint *ett[] = {
772 &ett_gsmtap
775 proto_gsmtap = proto_register_protocol("GSM Radiotap", "GSMTAP", "gsmtap");
776 proto_register_field_array(proto_gsmtap, hf, array_length(hf));
777 proto_register_subtree_array(ett, array_length(ett));
779 gsmtap_dissector_table = register_dissector_table("gsmtap.type",
780 "GSMTAP type", FT_UINT8, BASE_HEX);
783 void
784 proto_reg_handoff_gsmtap(void)
786 dissector_handle_t gsmtap_handle;
788 sub_handles[GSMTAP_SUB_DATA] = find_dissector("data");
789 sub_handles[GSMTAP_SUB_UM] = find_dissector("gsm_a_ccch");
790 sub_handles[GSMTAP_SUB_UM_LAPDM] = find_dissector("lapdm");
791 sub_handles[GSMTAP_SUB_UM_RLC_MAC_UL] = find_dissector("gsm_rlcmac_ul");
792 sub_handles[GSMTAP_SUB_UM_RLC_MAC_DL] = find_dissector("gsm_rlcmac_dl");
793 sub_handles[GSMTAP_SUB_LLC] = find_dissector("llcgprs");
794 sub_handles[GSMTAP_SUB_SNDCP] = find_dissector("sndcp");
795 sub_handles[GSMTAP_SUB_ABIS] = find_dissector("gsm_a_dtap");
796 sub_handles[GSMTAP_SUB_CDMA_CODE] = find_dissector("wimax_cdma_code_burst_handler");
797 sub_handles[GSMTAP_SUB_FCH] = find_dissector("wimax_fch_burst_handler");
798 sub_handles[GSMTAP_SUB_FFB] = find_dissector("wimax_ffb_burst_handler");
799 sub_handles[GSMTAP_SUB_PDU] = find_dissector("wimax_pdu_burst_handler");
800 sub_handles[GSMTAP_SUB_HACK] = find_dissector("wimax_hack_burst_handler");
801 sub_handles[GSMTAP_SUB_PHY_ATTRIBUTES] = find_dissector("wimax_phy_attributes_burst_handler");
802 sub_handles[GSMTAP_SUB_CBCH] = find_dissector("gsm_cbch");
803 sub_handles[GSMTAP_SUB_GMR1_BCCH] = find_dissector("gmr1_bcch");
804 sub_handles[GSMTAP_SUB_GMR1_CCCH] = find_dissector("gmr1_ccch");
805 sub_handles[GSMTAP_SUB_GMR1_LAPSAT] = find_dissector("lapsat");
806 sub_handles[GSMTAP_SUB_GMR1_RACH] = find_dissector("gmr1_rach");
807 sub_handles[GSMTAP_SUB_UMTS_RRC] = find_dissector("rrc");
809 rrc_sub_handles[GSMTAP_RRC_SUB_DL_DCCH_Message] = find_dissector("rrc.dl.dcch");
810 rrc_sub_handles[GSMTAP_RRC_SUB_UL_DCCH_Message] = find_dissector("rrc.ul.dcch");
811 rrc_sub_handles[GSMTAP_RRC_SUB_DL_CCCH_Message] = find_dissector("rrc.dl.ccch");
812 rrc_sub_handles[GSMTAP_RRC_SUB_UL_CCCH_Message] = find_dissector("rrc.ul.ccch");
813 rrc_sub_handles[GSMTAP_RRC_SUB_PCCH_Message] = find_dissector("rrc.pcch");
814 rrc_sub_handles[GSMTAP_RRC_SUB_DL_SHCCH_Message] = find_dissector("rrc.dl.shcch");
815 rrc_sub_handles[GSMTAP_RRC_SUB_UL_SHCCH_Message] = find_dissector("rrc.ul.shcch");
816 rrc_sub_handles[GSMTAP_RRC_SUB_BCCH_FACH_Message] = find_dissector("rrc.bcch.fach");
817 rrc_sub_handles[GSMTAP_RRC_SUB_BCCH_BCH_Message] = find_dissector("rrc.bcch.bch");
818 rrc_sub_handles[GSMTAP_RRC_SUB_MCCH_Message] = find_dissector("rrc.mcch");
819 rrc_sub_handles[GSMTAP_RRC_SUB_MSCH_Message] = find_dissector("rrc.msch");
820 rrc_sub_handles[GSMTAP_RRC_SUB_HandoverToUTRANCommand] = find_dissector("rrc.irat.ho_to_utran_cmd");
821 rrc_sub_handles[GSMTAP_RRC_SUB_InterRATHandoverInfo] = find_dissector("rrc.irat.irat_ho_info");
822 rrc_sub_handles[GSMTAP_RRC_SUB_SystemInformation_BCH] = find_dissector("rrc.sysinfo");
823 rrc_sub_handles[GSMTAP_RRC_SUB_System_Information_Container] = find_dissector("rrc.sysinfo.cont");
824 rrc_sub_handles[GSMTAP_RRC_SUB_UE_RadioAccessCapabilityInfo] = find_dissector("rrc.ue_radio_access_cap_info");
825 rrc_sub_handles[GSMTAP_RRC_SUB_MasterInformationBlock] = find_dissector("rrc.si.mib");
826 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType1] = find_dissector("rrc.si.sib1");
827 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType2] = find_dissector("rrc.si.sib2");
828 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType3] = find_dissector("rrc.si.sib3");
829 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType4] = find_dissector("rrc.si.sib4");
830 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType5] = find_dissector("rrc.si.sib5");
831 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType5bis] = find_dissector("rrc.si.sib5bis");
832 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType6] = find_dissector("rrc.si.sib6");
833 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType7] = find_dissector("rrc.si.sib7");
834 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType8] = find_dissector("rrc.si.sib8");
835 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType9] = find_dissector("rrc.si.sib9");
836 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType10] = find_dissector("rrc.si.sib10");
837 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType11] = find_dissector("rrc.si.sib11");
838 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType11bis] = find_dissector("rrc.si.sib11bis");
839 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType12] = find_dissector("rrc.si.sib12");
840 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType13] = find_dissector("rrc.si.sib13");
841 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType13_1] = find_dissector("rrc.si.sib13-1");
842 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType13_2] = find_dissector("rrc.si.sib13-2");
843 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType13_3] = find_dissector("rrc.si.sib13-3");
844 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType13_4] = find_dissector("rrc.si.sib13-4");
845 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType14] = find_dissector("rrc.si.sib14");
846 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15] = find_dissector("rrc.si.sib15");
847 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15bis] = find_dissector("rrc.si.sib15bis");
848 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_1] = find_dissector("rrc.si.sib15-1");
849 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_1bis] = find_dissector("rrc.si.sib15-1bis");
850 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_2] = find_dissector("rrc.si.sib15-2");
851 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_2bis] = find_dissector("rrc.si.sib15-2bis");
852 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_2ter] = find_dissector("rrc.si.sib15-2ter");
853 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_3] = find_dissector("rrc.si.sib15-3");
854 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_3bis] = find_dissector("rrc.si.sib15-3bis");
855 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_4] = find_dissector("rrc.si.sib15-4");
856 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_5] = find_dissector("rrc.si.sib15-5");
857 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_6] = find_dissector("rrc.si.sib15-6");
858 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_7] = find_dissector("rrc.si.sib15-7");
859 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType15_8] = find_dissector("rrc.si.sib15-8");
860 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType16] = find_dissector("rrc.si.sib16");
861 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType17] = find_dissector("rrc.si.sib17");
862 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType18] = find_dissector("rrc.si.sib18");
863 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType19] = find_dissector("rrc.si.sib19");
864 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType20] = find_dissector("rrc.si.sib20");
865 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType21] = find_dissector("rrc.si.sib21");
866 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoType22] = find_dissector("rrc.si.sib22");
867 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoTypeSB1] = find_dissector("rrc.si.sb1");
868 rrc_sub_handles[GSMTAP_RRC_SUB_SysInfoTypeSB2] = find_dissector("rrc.si.sb2");
869 rrc_sub_handles[GSMTAP_RRC_SUB_ToTargetRNC_Container] = find_dissector("rrc.s_to_trnc_cont");
870 rrc_sub_handles[GSMTAP_RRC_SUB_TargetRNC_ToSourceRNC_Container] = find_dissector("rrc.t_to_srnc_cont");
872 gsmtap_handle = create_dissector_handle(dissect_gsmtap, proto_gsmtap);
873 dissector_add_uint("udp.port", GSMTAP_UDP_PORT, gsmtap_handle);