2 * Routines for BSSGP (BSS GPRS Protocol ETSI GSM 08.18 version 6.7.1 TS 101 343 ) dissection
3 * Copyright 2000, Josef Korelus <jkor@quick.cz>
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 #ifdef HAVE_SYS_TYPES_H
35 # include <sys/types.h>
38 #ifdef HAVE_NETINET_IN_H
39 # include <netinet/in.h>
44 #ifdef NEED_SNPRINTF_H
45 # include "snprintf.h"
48 #include <epan/packet.h>
49 /*#include "packet-bssgp.h"*/
52 /*PDU Type GSM 08.18 version 6.7.1 table 11.27 page 53*/
53 #define DL_UNITDATA 0x0
54 #define UL_UNITDATA 0x1
55 #define RA_CAPABILITY 0X2
56 #define PTM_UNITDAT 0X3
59 #define RA_CAPABILITY_UPDATE 0X8
60 #define RA_CAPABILITY_UPDATE_ACK 0X9
61 #define RADIO_STATUS 0xa
63 #define SUSPEND_ACK 0xc
64 #define SUSPEND_NACK 0xd
66 #define RESUME_ACK 0xf
67 #define RESUME_NACK 0x10
68 #define BVC_BLOCK 0x20
69 #define BVC_BLOCK_ACK 0x21
70 #define BVC_RESET 0X22
71 #define BVC_RESET_ACK 0X23
72 #define BVC_UNBLOCK 0x24
73 #define BVC_UNBLOCK_ACK 0x25
74 #define FLOW_CONTROL_BVC 0x26
75 #define FLOW_CONTROL_BVC_ACK 0x27
76 #define FLOW_CONTROL_MS 0x28
77 #define FLOW_CONTROL_MS_ACK 0x29
79 #define FLUSH_LL_ACK 0x2b
80 #define LLC_DISCARDED 0x2c
81 #define SGSN_INVOKE_TRACE 0x40
93 #define ODD_EVEN_INDIC 0x08
94 /*GSM 08.18 version 6.7.1 table 11.27*/
96 static const value_string tab_bssgp_pdu_type[] = {
97 { DL_UNITDATA, "DL-UNITDATA" },
98 { UL_UNITDATA, "UL-UNITDATA" },
99 { RA_CAPABILITY, "RA_CAPABILITY" },
100 { PTM_UNITDAT, "PTM-UNITDATA" },
101 { PAGING_PS, "PAGING PS" },
102 { PAGING_CS, "PAGING CS" },
103 { RA_CAPABILITY_UPDATE, "RA-CAPABILITY-UPDATE" },
104 { RA_CAPABILITY_UPDATE_ACK, "RA-CAPABILITY-UPDATE-ACK" },
105 { RADIO_STATUS, "RADIO-STATUS" },
106 { SUSPEND, "SUSPEND" },
107 { SUSPEND_ACK, "SUSPEND-ACK" },
108 { SUSPEND_NACK, "SUSPEND-NACK" },
109 { RESUME, "RESUME" },
110 { RESUME_ACK, "RESUME-ACK" },
111 { RESUME_NACK, "RESUME-NACK" },
112 { BVC_BLOCK, "BVC-BLOCK" },
113 { BVC_BLOCK_ACK, "BVC-BLOCK-ACK" },
114 { BVC_RESET, "BVC-RESET" },
115 { BVC_RESET_ACK, "BVC-RESET-ACK" },
116 { BVC_UNBLOCK, "BVC-UNBLOCK" },
117 { BVC_UNBLOCK_ACK, "BVC_UNBLOCK_ACK" },
118 { FLOW_CONTROL_BVC, "FLOW-CONTROL-BVC" },
119 { FLOW_CONTROL_BVC_ACK, "FLOW-CONTROL-BVC-ACK" },
120 { FLOW_CONTROL_MS, "FLOW-CONTROL-MS" },
121 { FLOW_CONTROL_MS_ACK, "FLOW-CONTROL-MS-ACK" },
122 { FLUSH_LL, "FLUSH-LL" },
123 { FLUSH_LL_ACK, "FLUSH-LL-ACK" },
124 { LLC_DISCARDED, "LLC-DISCARDED" },
125 { SGSN_INVOKE_TRACE, "SGSN_INVOKE_TRACE" },
126 { STATUS, "STATUS" },
130 static const value_string bssgp_iei[] = {
131 { 0x0, "Alignment Octets" },
132 { 0x1, "Bmax default MS" },
133 { 0x2, "BSS Area Indication" },
134 { 0x3, "Bucket Leak Rate" },
136 { 0x5, "BVC Bucket Size" },
137 { 0x6, "BVC Measurment" },
139 { 0x8, "Cell Identifier" },
140 { 0x9, "Channel needed" },
141 { 0xa, "DRX Parameters" },
142 { 0xb, "eMLPP-Priority" },
143 { 0xc, "Flush Action" },
146 { 0xf, "LLC Frames Discarded" },
147 { 0x10, "Location Area" },
148 { 0x11, "Mobile Id" },
149 { 0x12, "MS Bucket Size" },
150 { 0x13, "MS Radio Access Capability" },
152 { 0x15, "PDU In Error" },
153 { 0x16, "PDU Lifetime" },
154 { 0x17, "Priority" },
155 { 0x18, "QoS Profile" },
156 { 0x19, "Radio Cause" },
157 { 0x1a, "RA-Cap-UPD-Cause" },
158 { 0x1b, "Routeing Area" },
159 { 0x1c, "R_default_MS" },
160 { 0x1d, "Suspend Reference Number" },
164 { 0x21, "Trace Reference" },
165 { 0x22, "Trace Type" },
166 { 0x23, "Transaction Id" },
167 { 0x24, "Trigger Id" },
168 { 0x25, "Number of octets affected" },
172 static const value_string bssgp_cause[] = {
173 { 0x0, "Processor overload" },
174 { 0x1, "Equipment failure" },
175 { 0x2, "Transit network service failure" },
176 { 0x3, "Network service transmission capacity modified from zero kbps to greater than zero" },
177 { 0x4, "Unknown MS" },
178 { 0x5, "BVCI unknown" },
179 { 0x6, "Cell traffic congestion" },
180 { 0x7, "SGSN congestion" },
181 { 0x8, "O&M intervention" },
182 { 0x9, "BVCI-blocked" },
183 { 0x20, "Semantically incorect PDU" },
184 { 0x21, "Invalid mandatory information" },
185 { 0x22, "Missing mandatory information" },
186 { 0x23, "Missing conditional IE" },
187 { 0x24, "Unexpected conditional IE" },
188 { 0x25, "Conditional IE error" },
189 { 0x26, "PDU not compatible with protocol state" },
190 { 0x27, "Protocol error-unspecified" },
194 #define TOI_IMSI 0x01
195 #define TOI_IMEI 0x02
196 #define TOI_IMEISV 0x03
197 #define TOI_TMSI_P_TMSI 0x04
198 #define TOI_NO_IDENTITY 0x00
200 static const value_string type_of_identity[] = {
201 { TOI_IMSI, "IMSI" },
202 { TOI_IMEI, "IMEI" },
203 { TOI_IMEISV, "IMEISV" },
204 { TOI_TMSI_P_TMSI, "TMSI/P-TMSI" },
205 { TOI_NO_IDENTITY, "No identity" },
208 static const value_string radio_cause[] = {
209 { 0x0, "Radio contact lost with the MS" },
210 { 0x1, "Radio link quality insufficient to continue communication" },
211 { 0x2, "cell-reselction ordered" },
214 static const true_false_string cr_string = {
215 "The SDU does not contain a LLC ACK or SACK command/response frame type",
216 "The SDU contains a LLC ACK or SACK command/response frame type",
218 static const true_false_string t_string = {
219 "The SDU contains data",
220 "The SDU contains signalling "
222 static const true_false_string a_string = {
223 "Radio interface uses RLC/MAC-UNITDATA functionality",
224 "Radio interface uses RLC/MAC ARQ functionality"
226 static const true_false_string imsi_odd_even = {
227 "even number of identity digits and also when the TMSI/P-TMSI is used",
228 "odd number of identity digits"
230 static const value_string prec_dl[] = {
231 { 0, "High priority"},
232 { 1, "Normal priority"},
233 { 2, "Low priority"},
234 { 3, "Reserved:Taken like Low priority"},
235 { 4, "Reserved:Taken like Low priority"},
238 static const value_string prec[] = {
239 { 0, "Radio priority 1" },
240 { 1, "Radio priority 2" },
241 { 2, "Radio priority 3" },
242 { 3, "Radio priority 4" },
243 { 4, "Radio priority Unknown" },
246 static const value_string prec_both[] = {
247 { 0, "High priority/Radio priority 1"},
248 { 1, "Normal priority/Radio priority 2"},
249 { 2, "Low priority/Radio priority 3"},
250 { 3, "Reserved/Radio priority 4"},
251 { 4, "Reserved/Radio priority Unknown"},
255 /* Initialize the protocol and registered fields */
256 static int proto_bssgp = -1;
257 static int hf_bssgp_pdu_type= -1;
258 static int hf_bssgp_cause = -1;
259 static int hf_bssgp_cid = -1;
260 static int hf_bssgp_imsi = -1;
261 static int hf_bssgp_imsi_toi = -1;
262 static int hf_bssgp_imsi_even_odd_indic = -1;
263 static int hf_bssgp_imsi_lsix = -1;
264 static int hf_bssgp_tlli = -1;
265 /*static int hf_bssgp_tag = -1;
266 static int hf_bssgp_tlli_old = -1;
267 static int hf_bssgp_aligment = -1;
268 static int hf_bssgp_drx_param = -1;
269 static int hf_bssgp_ms_radio_cap = -1;
271 static int hf_bssgp_qos = -1;
272 static int hf_bssgp_pbr = -1;
273 static int hf_bssgp_pdu_lifetime = -1;
274 /*static int hf_bssgp_priority = -1;
275 static int hf_bssgp_llc_pdu = -1;
276 static int hf_bssgp_ptmsi = -1;
278 static int hf_bssgp_bvci = -1;
279 /*static int hf_bssgp_la = -1;
281 static int hf_bssgp_ra_mccmnc = -1;
282 static int hf_bssgp_ra_lac = -1;
283 static int hf_bssgp_ra_rac = -1;
284 /*static int hf_bssgp_bss_area = -1;
285 static int hf_bssgp_channel_needed = -1;
286 static int hf_bssgp_emlpp_priority = -1;
287 static int hf_bssgp_ra_cap_upd_cause = -1;
289 static int hf_bssgp_radio_cause = -1;
290 /*static int hf_bssgp_sus_ref_num = -1;
292 static int hf_bssgp_bvci_new = -1;
293 /*static int hf_bssgp_flush_action = -1;
294 static int hf_bssgp_num_oct_affect = -1;
295 static int hf_bssgp_llc_disc = -1;
297 static int hf_bssgp_bvc_buck_size = -1;
298 static int hf_bssgp_buck_leak_rate = -1;
299 static int hf_bssgp_bmax_def_ms = -1;
300 static int hf_bssgp_r_defau_ms = -1;
301 /*static int hf_bssgp_bvc_measur = -1;
302 static int hf_bssgp_ms_buck_size = -1;
303 static int hf_bssgp_trace_type = -1;
304 static int hf_bssgp_trace_ref = -1;
305 static int hf_bssgp_trigg_id = -1;
306 static int hf_bssgp_mobile_id = -1;
307 static int hf_bssgp_omc_id = -1;
308 static int hf_bssgp_transactionid = -1;
310 static int hf_bssgp_ietype = -1;
311 static int hf_bssgp_qos_cr = -1;
312 static int hf_bssgp_qos_t = -1;
313 static int hf_bssgp_qos_a = -1;
314 static int hf_bssgp_qos_prec = -1;
315 static int hf_bssgp_frdsc = -1;
316 static int hf_bssgp_noaff = -1;
317 /*static int hf_bssgp_FIELDABBREV = -1;*/
319 /*static dissector_handle_t data_handle;
321 static dissector_handle_t llcgprs_handle;
323 /* Initialize the subtree pointers */
324 static gint ett_bssgp = -1;
325 static gint ett_bssgp_tlli = -1;
326 static gint ett_bssgp_qos = -1;
327 static gint ett_bssgp_o5 = -1;
328 static gint ett_bssgp_lft = -1;
329 static gint ett_bssgp_racc = -1;
330 static gint ett_prio_tree = -1;
331 static gint ett_drx_tree = -1;
332 static gint ett_bssgp_imsi = -1;
333 static gint ett_bssgp_imsi_stru_tree = -1;
334 static gint ett_algn_tree = -1;
335 static gint ett_b_llc_tree = -1;
336 static gint ett_celid_tree = -1;
337 static gint ett_tag_tree = -1;
338 static gint ett_bsize_tree = -1;
339 static gint ett_bucklr_tree = -1;
340 static gint ett_bmaxms_tree = -1;
341 static gint ett_rdefms_tree = -1;
342 static gint ett_bvci_tree = -1;
343 static gint ett_bvcin_tree = -1;
344 static gint ett_cause_tree = -1;
345 static gint ett_frdsc_tree = -1;
346 static gint ett_noaff_tree = -1;
347 static gint ett_racaus_tree = -1;
348 static gint ett_ra_tree = -1;
349 /*Functions for decoding IEs of BSSGP V6.7.1 */
355 } dec_fu_param_stru_t;
356 static int dcd_bssgp_algn ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
357 static int dcd_bssgp_bmaxms ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
358 /*static int dcd_bssgp_bss_aind ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
360 static int dcd_bssgp_bucklr ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
361 static int dcd_bssgp_bvci ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
362 static int dcd_bssgp_bvci_n ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
363 static int dcd_bssgp_bvc_bsize ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
364 /*static int dcd_bssgp_bvc_meas ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
366 static int dcd_bssgp_cause ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
367 static int dcd_bssgp_cellid ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
368 /*static int dcd_bssgp_chan_need ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
370 static int dcd_bssgp_drx ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
371 /*static int dcd_bssgp_emlpp_prio ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
372 static int dcd_bssgp_flush_act ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
374 static int dcd_bssgp_imsi ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
375 static int dcd_bssgp_llc_pdu ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
376 static int dcd_bssgp_llc_frdsc ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
377 /*static int dcd_bssgp_la ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
378 static int dcd_bssgp_mid ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
379 static int dcd_bssgp_ms_buck ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
381 static int dcd_bssgp_radio_acc ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
382 /*static int dcd_bssgp_omc_id ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
384 /*static int dcd_bssgp_pdu_err ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
386 static int dcd_bssgp_pdu_life ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
387 static int dcd_bssgp_prio ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
388 static int dcd_bssgp_qos ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
389 static int dcd_bssgp_radio_caus ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
390 /*static int dcd_bssgp_racap_upd ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
392 static int dcd_bssgp_ra ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
393 static int dcd_bssgp_r_def_ms ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
394 /*static int dcd_bssgp_sus_ref_num( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
396 static int dcd_bssgp_tag ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
397 static int dcd_bssgp_tlli ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
398 /*static int dcd_bssgp_tlli_o ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
400 /*static int dcd_bssgp_tmsi ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
402 /*static int dcd_bssgp_trace_ref ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
404 /*static int dcd_bssgp_trace_type ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
406 /*static int dcd_bssgp_trans_id ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
408 /*static int dcd_bssgp_trig_id ( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
410 static int dcd_bssgp_num_oct_aff( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
411 static int dcd_bssgp_not_yet_dcd( tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm );
412 static void mccmnc(guint32 mcmn, char buf[]);
413 /*---------------------------------------------------------*/
414 typedef struct _bssgp_ie {
418 /* int (*decode)(tvbuff_t *, int, int, packet_info *, proto_tree *);
420 int (*decode)(tvbuff_t *, int, dec_fu_param_stru_t *);
422 typedef struct _bssgp_pdu {
426 /*------------------------------------------------------------*/
427 static _bssgp_pdu_t bssgp_pdu[] = {
430 { 0x1f, BSSGP_M, 3, dcd_bssgp_tlli },
431 { 0x18, BSSGP_M, 3, dcd_bssgp_qos },
432 { 0x16, BSSGP_M, 4, dcd_bssgp_pdu_life },
433 { 0x13, BSSGP_O, 4, dcd_bssgp_radio_acc },
434 { 0x17, BSSGP_O, 4, dcd_bssgp_prio },
435 { 0x0a, BSSGP_O, 4, dcd_bssgp_drx },
436 { 0x0d, BSSGP_O, 4, dcd_bssgp_imsi },
437 /* { 0x1f, BSSGP_O, 4, dcd_bssgp_tlli_o },
439 { 0x1f, BSSGP_O, 4, dcd_bssgp_not_yet_dcd},
440 { 0x00, BSSGP_O, 4, dcd_bssgp_algn },
441 { 0x0e, BSSGP_M, 4, dcd_bssgp_llc_pdu },
448 { 0x1f, BSSGP_M, 3, dcd_bssgp_tlli },
449 { 0x18, BSSGP_M, 3, dcd_bssgp_qos },
450 { 0x08, BSSGP_M, 4, dcd_bssgp_cellid },
451 { 0x00, BSSGP_O, 4, dcd_bssgp_algn },
452 { 0x0e, BSSGP_M, 4, dcd_bssgp_llc_pdu },
458 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
459 { 0x13, BSSGP_M, 4, dcd_bssgp_radio_acc },
465 { 0x0d, BSSGP_M, 4, dcd_bssgp_imsi },
466 { 0x0a, BSSGP_O, 4, dcd_bssgp_drx },
467 { 0x04, BSSGP_C, 4, dcd_bssgp_bvci },
468 /* { 0x10, BSSGP_C, 4, dcd_bssgp_la },
470 { 0x10, BSSGP_C, 4, dcd_bssgp_not_yet_dcd},
471 { 0x1b, BSSGP_C, 4, dcd_bssgp_ra },
472 /* { 0x02, BSSGP_C, 4, dcd_bssgp_bss_aind },
474 { 0x02, BSSGP_C, 4, dcd_bssgp_not_yet_dcd},
475 { 0x18, BSSGP_M, 4, dcd_bssgp_qos },
476 /* { 0x20, BSSGP_O, 4, dcd_bssgp_tmsi },
478 { 0x20, BSSGP_O, 4, dcd_bssgp_not_yet_dcd},
484 { 0x0d, BSSGP_M, 4, dcd_bssgp_imsi },
485 { 0x0a, BSSGP_M, 4, dcd_bssgp_drx },
486 { 0x04, BSSGP_C, 4, dcd_bssgp_bvci },
487 /* { 0x10, BSSGP_C, 4, dcd_bssgp_la },
489 { 0x10, BSSGP_C, 4, dcd_bssgp_not_yet_dcd},
490 { 0x1b, BSSGP_C, 4, dcd_bssgp_ra },
491 /* { 0x02, BSSGP_C, 4, dcd_bssgp_bss_aind },
493 { 0x02, BSSGP_C, 4, dcd_bssgp_not_yet_dcd},
494 { 0x1f, BSSGP_O, 4, dcd_bssgp_tlli },
495 /* { 0x09, BSSGP_O, 4, dcd_bssgp_chan_need },
497 { 0x09, BSSGP_O, 4, dcd_bssgp_not_yet_dcd},
498 /* { 0x0b, BSSGP_O, 4, dcd_bssgp_emlpp_prio },
500 { 0x0b, BSSGP_O, 4, dcd_bssgp_not_yet_dcd},
501 /* { 0x20, BSSGP_O, 4, dcd_bssgp_tmsi },
503 { 0x20, BSSGP_O, 4, dcd_bssgp_not_yet_dcd},
508 RA_CAPABILITY_UPDATE, {
509 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
510 { 0x1e, BSSGP_M, 4, dcd_bssgp_tag },
516 RA_CAPABILITY_UPDATE_ACK, {
517 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
518 { 0x1e, BSSGP_M, 4, dcd_bssgp_tag },
519 { 0x0d, BSSGP_O, 4, dcd_bssgp_imsi },
520 /* { 0x1a, BSSGP_M, 4, dcd_bssgp_racap_upd },
522 { 0x1a, BSSGP_M, 4, dcd_bssgp_not_yet_dcd},
523 { 0x13, BSSGP_C, 4, dcd_bssgp_radio_acc },
529 { 0x1f, BSSGP_C, 4, dcd_bssgp_tlli },
530 /* { 0x20, BSSGP_C, 4, dcd_bssgp_tmsi },
532 { 0x20, BSSGP_C, 4, dcd_bssgp_not_yet_dcd},
533 { 0x0d, BSSGP_C, 4, dcd_bssgp_imsi },
534 { 0x19, BSSGP_M, 4, dcd_bssgp_radio_caus },
540 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
541 { 0x1b, BSSGP_M, 4, dcd_bssgp_ra },
547 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
548 { 0x1b, BSSGP_M, 4, dcd_bssgp_ra },
549 /* { 0x1d, BSSGP_M, 4, dcd_bssgp_sus_ref_num },
551 { 0x1d, BSSGP_M, 4, dcd_bssgp_not_yet_dcd},
557 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
558 { 0x1b, BSSGP_M, 4, dcd_bssgp_ra },
559 { 0x07, BSSGP_O, 4, dcd_bssgp_cause },
565 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
566 { 0x1b, BSSGP_M, 4, dcd_bssgp_ra },
567 /* { 0x1d, BSSGP_M, 4, dcd_bssgp_sus_ref_num },
569 { 0x1d, BSSGP_M, 4, dcd_bssgp_not_yet_dcd},
575 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
576 { 0x1b, BSSGP_M, 4, dcd_bssgp_ra },
582 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
583 { 0x1b, BSSGP_M, 4, dcd_bssgp_ra },
584 { 0x07, BSSGP_O, 4, dcd_bssgp_cause },
590 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
591 { 0x07, BSSGP_M, 4, dcd_bssgp_cause },
597 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
603 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
604 { 0x07, BSSGP_M, 4, dcd_bssgp_cause },
605 { 0x08, BSSGP_C, 4, dcd_bssgp_cellid },
611 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
612 { 0x08, BSSGP_C, 4, dcd_bssgp_cellid },
618 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
624 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
630 { 0x1e, BSSGP_M, 4, dcd_bssgp_tag },
631 { 0x05, BSSGP_M, 4, dcd_bssgp_bvc_bsize },
632 { 0x03, BSSGP_M, 4, dcd_bssgp_bucklr },
633 { 0x01, BSSGP_M, 4, dcd_bssgp_bmaxms },
634 { 0x1c, BSSGP_M, 4, dcd_bssgp_r_def_ms },
635 /* { 0x06, BSSGP_O, 4, dcd_bssgp_bvc_meas }, */
636 { 0x06, BSSGP_O, 4, dcd_bssgp_not_yet_dcd },
641 FLOW_CONTROL_BVC_ACK, {
642 { 0x1e, BSSGP_M, 4, dcd_bssgp_tag },
648 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
649 { 0x1e, BSSGP_M, 4, dcd_bssgp_tag },
650 /* { 0x12, BSSGP_M, 4, dcd_bssgp_ms_buck},
652 { 0x12, BSSGP_M, 4, dcd_bssgp_not_yet_dcd},
653 { 0x03, BSSGP_M, 4, dcd_bssgp_bucklr },
658 FLOW_CONTROL_MS_ACK, {
659 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
660 { 0x1e, BSSGP_M, 4, dcd_bssgp_tag },
666 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
667 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
668 { 0x04, BSSGP_O, 4, dcd_bssgp_bvci_n },
674 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
675 /* { 0x0c, BSSGP_M, 4, dcd_bssgp_flush_act },
677 { 0x0c, BSSGP_M, 4, dcd_bssgp_not_yet_dcd },
678 { 0x04, BSSGP_C, 4, dcd_bssgp_bvci_n },
679 { 0x25, BSSGP_M, 4, dcd_bssgp_num_oct_aff },
685 { 0x1f, BSSGP_M, 4, dcd_bssgp_tlli },
686 { 0x0f, BSSGP_M, 4, dcd_bssgp_llc_frdsc },
687 { 0x04, BSSGP_M, 4, dcd_bssgp_bvci },
688 { 0x25, BSSGP_M, 4, dcd_bssgp_num_oct_aff },
694 /* { 0x22, BSSGP_M, 4, dcd_bssgp_trace_type },
695 { 0x21, BSSGP_M, 4, dcd_bssgp_trace_ref },
696 { 0x24, BSSGP_O, 4, dcd_bssgp_trig_id },
697 { 0x11, BSSGP_O, 4, dcd_bssgp_mid },
698 { 0x14, BSSGP_O, 4, dcd_bssgp_omc_id },
699 { 0x23, BSSGP_O, 4, dcd_bssgp_trans_id },
701 { 0x22, BSSGP_M, 4, dcd_bssgp_not_yet_dcd },
702 { 0x21, BSSGP_M, 4, dcd_bssgp_not_yet_dcd },
703 { 0x24, BSSGP_O, 4, dcd_bssgp_not_yet_dcd },
704 { 0x11, BSSGP_O, 4, dcd_bssgp_not_yet_dcd },
705 { 0x14, BSSGP_O, 4, dcd_bssgp_not_yet_dcd },
706 { 0x23, BSSGP_O, 4, dcd_bssgp_not_yet_dcd },
712 { 0x07, BSSGP_M, 4, dcd_bssgp_cause },
713 { 0x04, BSSGP_C, 4, dcd_bssgp_bvci },
714 /* { 0x15, BSSGP_O, 4, dcd_bssgp_pdu_err },
716 { 0x15, BSSGP_O, 4, dcd_bssgp_not_yet_dcd },
726 /*-----------------------------------------------------------------------------------------------------------------*/
727 static void mccmnc(guint32 mcmn, char buf[]){
742 r_mncmcc = (u_mncmcc *)&mcmn;
746 pom = r_mncmcc->s.mcc1;
749 pom = r_mncmcc->s.mcc2;
752 pom = r_mncmcc->s.mcc3;
755 pom = 0x61;/* 0x61 because i need space " " (0x61-1)^0x40*/
758 pom = r_mncmcc->s.mnc1;
761 pom = r_mncmcc->s.mnc2;
764 pom = r_mncmcc->s.mnc3;
765 pom = (pom == 0xf)?0x41: pom;/* 0x41 because i need null on the end of string (0x41-1)^0x40*/
772 pom = (pom > 9)?(pom-1) ^ 0x40: pom ^ 0x30;
776 static int dcd_bssgp_not_yet_dcd(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
777 guint8 code=0, pom=0,k=2;
780 pom = tvb_get_guint8(tvb,offset+1);
786 llen = tvb_get_ntohs( tvb, offset+1);
790 code = tvb_get_guint8(tvb,offset);
791 proto_tree_add_uint_format(dprm_p->tree,hf_bssgp_ietype,tvb,offset,llen+k,code,"IE type: %s (%#.2x) ....Not yet decoded",match_strval(code,bssgp_iei),code);
795 static int dcd_bssgp_algn(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
796 guint8 code=0, len=0;
798 proto_tree *algn_tree=NULL;
800 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
802 code = tvb_get_guint8(tvb,offset);
803 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%u Aligment octets", len+2 );
804 algn_tree = proto_item_add_subtree(ti, ett_algn_tree);
805 proto_tree_add_uint_format(algn_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
806 proto_tree_add_text(algn_tree,tvb,offset+1,1,"Length:%u",len);
810 static int dcd_bssgp_bmaxms(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
811 guint8 code=0, len=0;
814 proto_tree *bmaxms_tree=NULL;
817 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
818 code = tvb_get_guint8(tvb,offset);
819 bucket = tvb_get_ntohs(tvb,offset+2);
820 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%s: %u bytes", match_strval(code,bssgp_iei),100*bucket);
821 bmaxms_tree = proto_item_add_subtree(ti, ett_bmaxms_tree);
822 proto_tree_add_uint_format(bmaxms_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
823 proto_tree_add_uint_format(bmaxms_tree, hf_bssgp_bmax_def_ms,tvb,offset+2,len,bucket,"%s in 100 octet increments: %u (%#.2x)",match_strval(code,bssgp_iei),bucket,bucket);
824 proto_tree_add_text(bmaxms_tree,tvb,offset+1,1,"Length:%u",len);
828 /*static int dcd_bssgp_bss_aind(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
831 static int dcd_bssgp_bucklr(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
832 guint8 code=0, len=0;
835 proto_tree *bucklr_tree=NULL;
837 bucket = tvb_get_ntohs(tvb,offset+2);
838 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
839 code = tvb_get_guint8(tvb,offset);
841 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
842 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, ", %s: %u bits/sec",match_strval(code,bssgp_iei),bucket*100 );
845 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "Bucket Leak Rate(R): %u bits/sec", 100*bucket);
846 bucklr_tree = proto_item_add_subtree(ti, ett_bucklr_tree);
847 proto_tree_add_uint_format(bucklr_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
848 proto_tree_add_uint_format(bucklr_tree, hf_bssgp_buck_leak_rate,tvb,offset+2,len,bucket,"%s in 100 bits/sec increments: %u (%#.2x)",match_strval(code,bssgp_iei),bucket,bucket);
849 proto_tree_add_text(bucklr_tree,tvb,offset+1,1,"Length:%u",len);
853 static int dcd_bssgp_bvci(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
854 guint8 code=0, len=0;
857 proto_tree *bvci_tree=NULL;
859 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
860 code = tvb_get_guint8(tvb,offset);
861 bucket = tvb_get_ntohs(tvb,offset+2);
862 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
863 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, ", %s: %u",match_strval(code,bssgp_iei),bucket );
866 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%s: %u", match_strval(code,bssgp_iei), bucket);
867 bvci_tree = proto_item_add_subtree(ti, ett_bvci_tree);
868 proto_tree_add_uint_format(bvci_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
869 proto_tree_add_uint_format(bvci_tree, hf_bssgp_bvci,tvb,offset+2,len,bucket,"%s: %u (%#.2x)",match_strval(code,bssgp_iei),bucket,bucket);
870 proto_tree_add_text(bvci_tree,tvb,offset+1,1,"Length:%u",len);
874 static int dcd_bssgp_bvci_n(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
875 guint8 code=0, len=0;
878 proto_tree *bvcin_tree=NULL;
880 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
881 code = tvb_get_guint8(tvb,offset);
882 bucket = tvb_get_ntohs(tvb,offset+2);
883 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
884 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, " New %s: %u",match_strval(code,bssgp_iei),bucket );
887 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "New %s: %u", match_strval(code,bssgp_iei), bucket);
888 bvcin_tree = proto_item_add_subtree(ti, ett_bvcin_tree);
889 proto_tree_add_uint_format(bvcin_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s(New) %#.2x",match_strval(code,bssgp_iei),code);
890 proto_tree_add_uint_format(bvcin_tree, hf_bssgp_bvci_new,tvb,offset+2,len,bucket,"New %s: %u (%#.2x)",match_strval(code,bssgp_iei),bucket,bucket);
891 proto_tree_add_text(bvcin_tree,tvb,offset+1,1,"Length:%u",len);
895 static int dcd_bssgp_bvc_bsize(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
896 guint8 code=0, len=0;
899 proto_tree *bsize_tree=NULL;
901 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
902 code = tvb_get_guint8(tvb,offset);
903 bucket = tvb_get_ntohs(tvb,offset+2);
904 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
905 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, ", %s: %u bytes",match_strval(code,bssgp_iei),bucket*100 );
908 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "BVC Bucket Size: %u bytes", 100*bucket);
909 bsize_tree = proto_item_add_subtree(ti, ett_bsize_tree);
910 proto_tree_add_uint_format(bsize_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
911 proto_tree_add_uint_format(bsize_tree, hf_bssgp_bvc_buck_size,tvb,offset+2,len,bucket,"%s in 100 octet increments: %u (%#.2x)",match_strval(code,bssgp_iei),bucket,bucket);
912 proto_tree_add_text(bsize_tree,tvb,offset+1,1,"Length:%u",len);
916 /*static int dcd_bssgp_bvc_meas(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
920 static int dcd_bssgp_cause(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
921 guint8 code=0, len=0,cause=0;
923 proto_tree *cause_tree=NULL;
925 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
926 code = tvb_get_guint8(tvb,offset);
927 cause = tvb_get_guint8(tvb,offset+2);
928 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
929 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, ", %s: %s",match_strval(code,bssgp_iei),match_strval(cause,bssgp_cause));
932 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%s: %s", match_strval(code,bssgp_iei),match_strval(cause,bssgp_cause));
933 cause_tree = proto_item_add_subtree(ti, ett_cause_tree);
934 proto_tree_add_uint_format(cause_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
935 proto_tree_add_uint_format(cause_tree, hf_bssgp_cause,tvb,offset+2,len,cause,"%s: %s (%#.2x)",match_strval(code,bssgp_iei),match_strval(cause,bssgp_cause),cause);
936 proto_tree_add_text(cause_tree,tvb,offset+1,1,"Length:%u",len);
941 static int dcd_bssgp_cellid(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
945 guint8 len=8, code=0,rac;
946 proto_item *ti = NULL;
947 proto_tree *celid_tree = NULL;
950 code = tvb_get_guint8(tvb,offset);
951 mnccc = tvb_get_ntoh24(tvb,offset+2);
952 lac = tvb_get_ntohs(tvb,offset+5);
953 rac = tvb_get_guint8(tvb,offset+7);
954 cid = tvb_get_ntohs(tvb,offset+8);
955 mccmnc(mnccc, mccmnc_str);
957 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "Cell Identifier: %s %u %u %u",mccmnc_str,lac,rac,cid);
958 celid_tree = proto_item_add_subtree(ti, ett_celid_tree);
959 proto_tree_add_uint_format(celid_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
960 proto_tree_add_string_format(celid_tree,hf_bssgp_ra_mccmnc,tvb,offset+2,3,mccmnc_str,"MCC MNC: %s",mccmnc_str);
961 proto_tree_add_uint_format(celid_tree,hf_bssgp_ra_lac,tvb,offset+5,2,lac,"LAC: %u",lac);
962 proto_tree_add_uint_format(celid_tree,hf_bssgp_ra_rac,tvb,offset+7,1,rac,"RAC: %u",rac);
963 proto_tree_add_uint_format(celid_tree,hf_bssgp_cid,tvb,offset+8,2,cid,"Cell Id: %u",cid);
964 proto_tree_add_text(celid_tree,tvb,offset+1,1,"Length:%u",len);
971 /*static int dcd_bssgp_chan_need(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
974 static int dcd_bssgp_drx(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
975 guint8 code=0, len=0;
977 proto_tree *drx_tree=NULL;
979 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
981 code = tvb_get_guint8(tvb,offset);
982 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, 4,"DRX Parameters");
983 drx_tree = proto_item_add_subtree(ti, ett_drx_tree);
984 proto_tree_add_uint_format(drx_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
985 proto_tree_add_text(drx_tree,tvb,offset+1,1,"Length:%u",len);
991 /*static int dcd_bssgp_emlpp_prio(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
995 /*static int dcd_bssgp_flush_act(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
999 static int dcd_bssgp_imsi(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1000 guint8 nextb=0, first_b=0, toi=0, i, k;
1001 guint8 num=0,code=0,len=0;
1002 char buf[17],imsi_mccn[6],imsi_val[11], toibuf[9];
1003 proto_item *ti=NULL, *ti2=NULL;
1004 proto_tree *imsi_tree = NULL, *imsi_stru_tree = NULL;
1006 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1007 first_b = tvb_get_guint8(tvb,offset+2);
1009 code = tvb_get_guint8(tvb,offset);
1010 decode_bitfield_value(toibuf,toi,LOW3B,8);
1011 ti = proto_tree_add_text(dprm_p->tree,tvb,offset,len+2 ,"IMSI");
1012 imsi_tree = proto_item_add_subtree(ti, ett_bssgp_imsi);
1013 proto_tree_add_uint_format(imsi_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1014 proto_tree_add_text(imsi_tree,tvb,offset+1,1,"Length:%u",len);
1016 toi = first_b & LOW3B;
1024 for (i=1,k=1;i<len;i++){
1025 nextb = tvb_get_guint8(tvb, offset+2+i);
1029 if (i < len - 1 || (first_b & ODD_EVEN_INDIC)) {
1031 * Either this isn't the last octet
1032 * of the number, or it is, but there's
1033 * an odd number of digits, so the last
1034 * nibble is part of the number.
1043 memcpy(&imsi_mccn,&buf,6);
1046 memcpy(&imsi_val, &buf[5],11);
1051 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
1052 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO,
1054 val_to_str(toi,type_of_identity,"Unknown TOI (0x%x)"),
1055 imsi_mccn, imsi_val );
1059 proto_item_append_text(ti, ": %s", buf);
1060 ti2 = proto_tree_add_text(imsi_tree,tvb,offset+2,len,"Mobile identity: %s",buf);
1061 imsi_stru_tree = proto_item_add_subtree( ti2, ett_bssgp_imsi_stru_tree);
1062 proto_tree_add_uint(imsi_stru_tree,hf_bssgp_imsi_toi,tvb,offset+2,1,first_b);
1063 proto_tree_add_boolean(imsi_stru_tree,hf_bssgp_imsi_even_odd_indic,tvb,offset+2,1,first_b);
1064 proto_tree_add_string(imsi_stru_tree,hf_bssgp_imsi,tvb,offset+2,len,buf);
1065 proto_tree_add_string_hidden(imsi_stru_tree,hf_bssgp_imsi_lsix,tvb,offset+2,len,imsi_val);
1072 static int dcd_bssgp_llc_pdu(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1073 guint8 code=0, pom=0,k=0;
1075 proto_item *ti=NULL;
1076 proto_tree *b_llc_tree=NULL;
1078 pom = tvb_get_guint8(tvb,offset+1);
1084 llen = tvb_get_ntohs( tvb, offset+1);
1088 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
1089 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, ", LLC PDU length %u bytes", llen );
1093 code = tvb_get_guint8(tvb,offset);
1094 ti = proto_tree_add_text(dprm_p->tree,tvb,offset,llen+2 ,"LLC PDU %u bytes", llen);
1095 b_llc_tree = proto_item_add_subtree(ti, ett_b_llc_tree);
1096 proto_tree_add_uint_format(b_llc_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1097 proto_tree_add_text(b_llc_tree,tvb,offset+1,k-1,"Length:%u",llen);
1104 static int dcd_bssgp_llc_frdsc(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1105 guint8 code=0, len=0,frdsc=0;
1106 proto_item *ti=NULL;
1107 proto_tree *frdsc_tree=NULL;
1109 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1110 frdsc = tvb_get_guint8(tvb,offset+2);
1111 code = tvb_get_guint8(tvb,offset);
1112 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
1113 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, ", %s: %u",match_strval(code,bssgp_iei), frdsc);
1116 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%s: %u", match_strval(code,bssgp_iei), frdsc);
1117 frdsc_tree = proto_item_add_subtree(ti, ett_frdsc_tree);
1118 proto_tree_add_uint_format(frdsc_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1119 proto_tree_add_uint_format(frdsc_tree, hf_bssgp_frdsc,tvb,offset+2,len,frdsc,"%s: %u",match_strval(code,bssgp_iei),frdsc);
1120 proto_tree_add_text(frdsc_tree,tvb,offset+1,1,"Length:%u",len);
1125 /*static int dcd_bssgp_la(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1129 /*static int dcd_bssgp_mid(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1133 /*static int dcd_bssgp_ms_buck(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1137 static int dcd_bssgp_radio_acc(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1138 guint8 code=0,len=0;
1139 proto_item *ti=NULL;
1140 proto_tree *racc_tree = NULL;
1142 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1144 code = tvb_get_guint8(tvb,offset);
1145 ti = proto_tree_add_text(dprm_p->tree,tvb,offset,len+2 ,"MS Radio Access Capability: ");
1146 racc_tree = proto_item_add_subtree(ti, ett_bssgp_racc);
1147 proto_tree_add_uint_format(racc_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1148 proto_tree_add_text(racc_tree,tvb,offset+1,1,"Length:%u",len);
1153 /*static int dcd_bssgp_omc_id(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1157 /*static int dcd_bssgp_pdu_err(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1161 static int dcd_bssgp_pdu_life(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1164 guint8 code=0, len=0;
1165 proto_item *ti=NULL;
1166 proto_tree *lft_tree=NULL;
1168 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1170 code = tvb_get_guint8(tvb,offset);
1171 lifetime = tvb_get_ntohs(tvb,offset+2);
1172 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, 4,"PDU Lifetime (s): ");
1173 lft_tree = proto_item_add_subtree(ti, ett_bssgp_lft);
1174 proto_tree_add_uint_format(lft_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1175 proto_tree_add_text(lft_tree,tvb,offset+1,1,"Length:%u",len);
1176 if (lifetime == 0xFFFF){
1177 proto_item_append_text(ti,"infinite delay");
1178 proto_tree_add_uint_format(lft_tree,hf_bssgp_pdu_lifetime,tvb,offset+2,2,lifetime,"PDU Life time: infinite delay (%#.4x centi seconds)", lifetime);
1181 ms_lifetime = (gfloat) (lifetime/100);
1182 proto_item_append_text(ti,"%f",ms_lifetime);
1183 proto_tree_add_uint_format(lft_tree,hf_bssgp_pdu_lifetime,tvb,offset+2,2,lifetime,"PDU Life time: %fs (%#.4x centi seconds)", ms_lifetime, lifetime);
1189 static int dcd_bssgp_prio(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1190 guint8 code=0, len=0;
1191 proto_item *ti=NULL;
1192 proto_tree *prio_tree=NULL;
1194 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1196 code = tvb_get_guint8(tvb,offset);
1197 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, 4,"Priority");
1198 prio_tree = proto_item_add_subtree(ti, ett_prio_tree);
1199 proto_tree_add_uint_format(prio_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1200 proto_tree_add_text(prio_tree,tvb,offset+1,1,"Length:%u",len);
1205 static int dcd_bssgp_qos(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1209 gint8 disp=0, opet=0, code=0,len=0,start=0,pre=0;
1210 proto_item *ti=NULL, *ti2=NULL;
1211 proto_tree *qos_tree=NULL,*o5_tree;
1212 switch (dprm_p->type){
1216 code = tvb_get_guint8(tvb,offset);
1218 len = tvb_get_guint8(tvb,offset+disp);
1224 blr = tvb_get_ntohs(tvb, offset+disp);
1226 opet = tvb_get_guint8(tvb,offset+disp);
1230 decode_bitfield_value(buf,opet,LOW3B,8);
1232 ti = proto_tree_add_text(dprm_p->tree,tvb,offset,len+disp,"QoS Profile IE");
1233 qos_tree = proto_item_add_subtree(ti,ett_bssgp_qos);
1234 switch (dprm_p->type){
1236 proto_tree_add_uint_format(qos_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1237 proto_tree_add_text(qos_tree,tvb,offset+1,1,"Length:%u",len);
1240 proto_tree_add_uint_format(qos_tree,hf_bssgp_pbr,tvb,offset+start,2,blr,"Peak bit rate: %u bytes/s, (%#.4x)in 100bits/sec increments",bps,blr);
1243 proto_tree_add_uint_format(qos_tree,hf_bssgp_pbr,tvb,offset+start,2,blr,"Peak bit rate: best effort (%#.4x)in 100bits/sec increments",blr);
1245 ti2 = proto_tree_add_item(qos_tree,hf_bssgp_qos,tvb,offset+(disp-1),1,FALSE);
1246 o5_tree = proto_item_add_subtree(ti2, ett_bssgp_o5);
1247 proto_tree_add_boolean(o5_tree,hf_bssgp_qos_cr,tvb,offset+(disp-1),1,opet);
1248 proto_tree_add_boolean(o5_tree,hf_bssgp_qos_t,tvb,offset+(disp-1),1,opet);
1249 proto_tree_add_boolean(o5_tree,hf_bssgp_qos_a,tvb,offset+(disp-1),1,opet);
1250 if(tvb_get_guint8(tvb,0)){
1251 proto_tree_add_uint_format(o5_tree,hf_bssgp_qos_prec,tvb,offset+(disp-1),1,pre,"%s %s", buf,match_strval(pre,prec));
1255 proto_tree_add_uint_format(o5_tree,hf_bssgp_qos_prec,tvb,offset+(disp-1),1,pre,"%s %s", buf,match_strval(pre,prec_dl));
1263 static int dcd_bssgp_radio_caus(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1264 guint8 code=0, len=0,racaus=0;
1265 proto_item *ti=NULL;
1266 proto_tree *racaus_tree=NULL;
1268 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1269 racaus = tvb_get_guint8(tvb,offset+2);
1270 code = tvb_get_guint8(tvb,offset);
1271 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
1272 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO, ", %s: %s",match_strval(code,bssgp_iei), val_to_str(racaus,radio_cause,"%u reserved value"));
1275 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%s: %s", match_strval(code,bssgp_iei), val_to_str(racaus,radio_cause,"%u reserved value, if received , it shall be handled as ""radio contact lost with MS"""));
1276 racaus_tree = proto_item_add_subtree(ti, ett_racaus_tree);
1277 proto_tree_add_uint_format(racaus_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1278 proto_tree_add_uint_format(racaus_tree, hf_bssgp_radio_cause,tvb,offset+2,len,racaus,"%s: %#.2x",match_strval(code,bssgp_iei),racaus);
1279 proto_tree_add_text(racaus_tree,tvb,offset+1,1,"Length:%u",len);
1284 /*static int dcd_bssgp_racap_upd(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1288 static int dcd_bssgp_ra(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1291 guint8 rac, len = 0,code=0 ;
1293 proto_item *ti=NULL;
1294 proto_tree *ra_tree = NULL;
1295 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1297 code = tvb_get_guint8(tvb,offset);
1298 mnccc = tvb_get_ntoh24(tvb,offset+2);
1299 lac = tvb_get_ntohs(tvb,offset+5);
1300 rac = tvb_get_guint8(tvb,offset+7);
1301 mccmnc(mnccc, st_mccn);
1302 ti = proto_tree_add_text(dprm_p->tree,tvb,offset,len+2, "Routing area: %s %u %u",st_mccn,lac,rac);
1303 ra_tree = proto_item_add_subtree(ti, ett_ra_tree);
1304 proto_tree_add_uint_format(ra_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1305 proto_tree_add_string_format(ra_tree,hf_bssgp_ra_mccmnc,tvb,offset+2,3,st_mccn,"MCC MNC: %s",st_mccn);
1306 proto_tree_add_uint_format(ra_tree,hf_bssgp_ra_lac,tvb,offset+5,2,lac,"LAC: %u",lac);
1307 proto_tree_add_uint_format(ra_tree,hf_bssgp_ra_rac,tvb,offset+7,1,rac,"RAC: %u",rac);
1308 proto_tree_add_text(ra_tree,tvb,offset+1,1,"Length:%u",len);
1313 static int dcd_bssgp_r_def_ms(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1314 guint8 code=0, len=0;
1316 proto_item *ti=NULL;
1317 proto_tree *rdefms_tree=NULL;
1320 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1321 code = tvb_get_guint8(tvb,offset);
1322 bucket = tvb_get_ntohs(tvb,offset+2);
1323 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%s: %u bits/sec", match_strval(code,bssgp_iei),100*bucket);
1324 rdefms_tree = proto_item_add_subtree(ti, ett_rdefms_tree);
1325 proto_tree_add_uint_format(rdefms_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1326 proto_tree_add_uint_format(rdefms_tree, hf_bssgp_r_defau_ms,tvb,offset+2,len,bucket,"%s in 100 bits/sec increments: %u (%#.2x)",match_strval(code,bssgp_iei),bucket,bucket);
1327 proto_tree_add_text(rdefms_tree,tvb,offset+1,1,"Length:%u",len);
1332 /*static int dcd_bssgp_sus_ref_num(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1336 static int dcd_bssgp_tag(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1337 guint8 code=0, len=0,tag=0;
1338 proto_item *ti=NULL;
1339 proto_tree *tag_tree=NULL;
1341 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1343 code = tvb_get_guint8(tvb,offset);
1344 tag = tvb_get_guint8(tvb,offset+2);
1345 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2,"Tag: %u", tag);
1346 tag_tree = proto_item_add_subtree(ti, ett_tag_tree);
1347 proto_tree_add_uint_format(tag_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1348 proto_tree_add_text(tag_tree,tvb,offset+1,1,"Length:%u",len);
1353 static int dcd_bssgp_tlli(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1355 guint8 len=0, code=0, disp=0;
1356 proto_item *ti=NULL;
1357 proto_tree *tlli_tree=NULL;
1358 switch (dprm_p->type){
1363 code = tvb_get_guint8(tvb, offset);
1365 len = tvb_get_guint8(tvb,offset+disp);
1370 tlli = tvb_get_ntohl(tvb, offset+disp);
1371 if (check_col((dprm_p->pinfo)->cinfo, COL_INFO)){
1372 col_append_fstr( (dprm_p->pinfo)->cinfo, COL_INFO,", TLLI: %X", tlli);
1375 switch (dprm_p->type){
1377 proto_tree_add_uint_format(dprm_p->tree,hf_bssgp_tlli,tvb,offset,4,tlli,"TLLI: %#.4x", tlli );
1380 ti = proto_tree_add_text(dprm_p->tree,tvb,offset,len+disp,"TLLI: %#.4x",tlli);
1381 tlli_tree =proto_item_add_subtree(ti,ett_bssgp_tlli);
1382 proto_tree_add_uint_format(tlli_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1384 proto_tree_add_text(tlli_tree,tvb,offset+1,1,"Length:%u",len);
1385 proto_tree_add_uint_format(tlli_tree,hf_bssgp_tlli,tvb,offset+disp,len,tlli,"TLLI: %#.4x", tlli );
1391 /*static int dcd_bssgp_tlli_o(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1396 /*static int dcd_bssgp_tmsi(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1399 /*static int dcd_bssgp_trace_ref(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1402 /*static int dcd_bssgp_trace_type(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1405 /*static int dcd_bssgp_trans_id(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1408 /*static int dcd_bssgp_trig_id(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1411 static int dcd_bssgp_num_oct_aff(tvbuff_t *tvb, int offset, dec_fu_param_stru_t *dprm_p){
1412 guint8 code=0, len=0;
1414 proto_item *ti=NULL;
1415 proto_tree *noaff_tree=NULL;
1417 len = tvb_get_guint8(tvb,offset+1) & 0x7f;
1419 code = tvb_get_guint8(tvb,offset);
1420 bucket = tvb_get_ntoh24(tvb,offset+2);
1421 ti = proto_tree_add_text(dprm_p->tree,tvb,offset, len+2, "%s: %u", match_strval(code,bssgp_iei), bucket);
1422 noaff_tree = proto_item_add_subtree(ti, ett_noaff_tree);
1423 proto_tree_add_uint_format(noaff_tree,hf_bssgp_ietype,tvb,offset,1,code,"IE type: %s %#.2x",match_strval(code,bssgp_iei),code);
1424 proto_tree_add_uint_format(noaff_tree, hf_bssgp_noaff,tvb,offset+2,len,bucket,"%s: %u (%#.2x)",match_strval(code,bssgp_iei),bucket,bucket);
1425 proto_tree_add_text(noaff_tree,tvb,offset+1,1,"Length:%u",len);
1431 /* Code to actually dissect the packets */
1433 dissect_bssgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
1435 static dec_fu_param_stru_t decp , *decodeparam=&decp;
1436 guint8 pdutype, i, j , iele , stay;
1440 /* Set up structures needed to add the protocol subtree and manage it */
1441 proto_item *ti=NULL;
1442 proto_tree *bssgp_tree=NULL;
1444 pdutype=tvb_get_guint8(tvb,0);
1445 /* Make entries in Protocol column and Info column on summary display */
1446 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1447 col_set_str(pinfo->cinfo, COL_PROTOCOL, "BSSGP");
1449 /* This field shows up as the "Info" column in the display; you should make
1450 it, if possible, summarize what's in the packet, so that a user looking
1451 at the list of packets can tell what type of packet it is. See section 1.5
1452 for more information.
1454 If you are setting it to a constant string, use "col_set_str()", as
1455 it's more efficient than the other "col_set_XXX()" calls.
1457 If you're setting it to a string you've constructed, or will be
1458 appending to the column later, use "col_add_str()".
1460 "col_add_fstr()" can be used instead of "col_add_str()"; it takes
1461 "printf()"-like arguments. Don't use "col_add_fstr()" with a format
1462 string of "%s" - just use "col_add_str()" or "col_set_str()", as it's
1463 more efficient than "col_add_fstr()".
1465 If you will be fetching any data from the packet before filling in
1466 the Info column, clear that column first, in case the calls to fetch
1467 data from the packet throw an exception because they're fetching data
1468 past the end of the packet, so that the Info column doesn't have data
1469 left over from the previous dissector; do
1471 if (check_col(pinfo->cinfo, COL_INFO)) {
1472 col_clear(pinfo->cinfo, COL_INFO);
1473 col_add_str(pinfo->cinfo, COL_INFO,match_strval(pdutype,tab_bssgp_pdu_type));
1475 /* In the interest of speed, if "tree" is NULL, don't do any work not
1476 necessary to generate protocol tree items. */
1479 /* NOTE: The offset and length values in the call to
1480 "proto_tree_add_item()" define what data bytes to highlight in the hex
1481 display window when the line in the protocol tree display
1482 corresponding to that item is selected.
1484 tvb_length(tvb) is a handy way to highlight all data from the offset to
1485 the end of the packet. */
1487 /* create display subtree for the protocol */
1488 /* ti = proto_tree_add_item(tree, proto_bssgp, tvb, 0, tvb_length(tvb), FALSE );
1490 bssgp_tree = proto_item_add_subtree(ti, ett_bssgp);
1492 decodeparam->pinfo=pinfo;
1493 decodeparam->tree=tree;
1496 while (bssgp_pdu[i].infe[0].presence && stay){
1497 if (bssgp_pdu[i].pdu == pdutype) {
1501 ti = proto_tree_add_protocol_format(tree, proto_bssgp, tvb, 0, tvb_length(tvb),"BSS GPRS protocol PDU type: %s (%#.2x)", match_strval(pdutype,tab_bssgp_pdu_type), pdutype);
1502 bssgp_tree = proto_item_add_subtree(ti, ett_bssgp);
1503 proto_tree_add_uint_format(bssgp_tree, hf_bssgp_pdu_type, tvb, 0, offset, pdutype, "PDU type: %s (%#.2x)",match_strval(pdutype,tab_bssgp_pdu_type), pdutype );
1504 decodeparam->tree=bssgp_tree;
1506 while (bssgp_pdu[i].infe[j].presence){
1507 switch(bssgp_pdu[i].infe[j].type){
1509 decodeparam->type=3;
1510 offset=offset+( *bssgp_pdu[i].infe[j].decode)(tvb, offset, decodeparam );
1514 decodeparam->type=4;
1515 if (offset >= tvb_length(tvb)) {
1519 iele = tvb_get_guint8( tvb, offset);
1520 while ((bssgp_pdu[i].infe[j].code != iele) && bssgp_pdu[i].infe[j].presence ) {
1521 if (bssgp_pdu[i].infe[j].presence > 1) j++;
1524 if (bssgp_pdu[i].infe[j].presence){
1525 offset=offset+( *bssgp_pdu[i].infe[j].decode)(tvb, offset, decodeparam );
1527 next_tvb = tvb_new_subset(tvb, decodeparam->k, -1, -1);
1528 call_dissector(llcgprs_handle, next_tvb, pinfo, tree);
1529 /* call_dissector(data_handle, next_tvb, pinfo, tree);
1541 /* add an item to the subtree, see section 1.6 for more information */
1543 proto_tree_add_uint(tree, hf_bssgp_FIELDABBREV, tvb, offset, len, value);
1545 /* proto_tree_add_uint_format(bssgp_tree, hf_bssgp_pdu_type, tvb, 0, 1, pdutype, "PDU type: %s (%#.2x)",match_strval(pdutype,tab_bssgp_pdu_type), pdutype );
1548 /* Continue adding tree items to process the packet here */
1553 /* If this protocol has a sub-dissector call it here, see section 1.8 */
1557 /* Register the protocol with Ethereal */
1559 /* this format is require because a script is used to build the C function
1560 that calls all the protocol registration.
1564 proto_register_bssgp(void)
1566 static hf_register_info hf[] = {
1567 { &hf_bssgp_pdu_type,
1568 { "PDU", "bssgp.pdu",
1569 FT_UINT8, BASE_HEX, VALS(tab_bssgp_pdu_type), 0x0,
1570 "BSSGP PDU", HFILL }},
1572 { "TLLI","bssgp.tlli",FT_UINT32, BASE_HEX, NULL,0x0,"Current TLLI",HFILL}},
1574 {"IE Type", "bssgp.ietype", FT_UINT8, BASE_HEX, VALS(bssgp_iei),0x0,"Information element", HFILL }},
1576 {"QoS_Profile","bssgp.pbr",FT_UINT16, BASE_HEX, NULL, 0x0, "Peak bit rate",HFILL }},
1578 {"Last byte QoS Profile","bssgp.qos",FT_UINT8, BASE_HEX, NULL, 0x0,"5th byte of QoS profile(contains Precedence..)",HFILL}},
1580 {"C/R bit","bssgp.qos.cr",FT_BOOLEAN,8, TFS(&cr_string),QOSO5CR,"The SDU contains LLC ACK/SACK command/responce frame type",HFILL }},
1582 {"T bit", "bssgp.qos.t", FT_BOOLEAN, 8, TFS( &t_string) , QOSO5T, "The SDU contains signaling/data" , HFILL}},
1584 {"A bit" , "bssgp.qos.a" , FT_BOOLEAN,8, TFS( &a_string), QOSO5A, "Radio interface uses ARQ/UNITDATA functionality",HFILL}},
1585 {&hf_bssgp_qos_prec,
1586 {"Precedence", "bssgp.qos.prec", FT_UINT8,BASE_HEX ,VALS(prec_both), 0x0,"Precedence coding", HFILL }},
1587 {&hf_bssgp_pdu_lifetime,
1588 {"PDU Lifetime","bssgp.lft", FT_UINT16, BASE_HEX, NULL, 0x0, "PDU Lifetime for PDU inside the BSS",HFILL}},
1590 {"IMSI","bssgp.imsi", FT_STRING, BASE_DEC, NULL, 0x0, "International Mobile Subscriber Identity",HFILL}},
1591 {&hf_bssgp_imsi_toi,
1592 { "Type of Mobile identity", "bssgp.mobid", FT_UINT8, BASE_HEX, VALS(type_of_identity), LOW3B, "Type of mobile identity",HFILL }},
1593 {&hf_bssgp_imsi_even_odd_indic,
1594 { "Odd/even indication", "bssgp.oei", FT_BOOLEAN, 8, TFS(&imsi_odd_even), ODD_EVEN_INDIC, "Odd/even indication",HFILL }},
1595 {&hf_bssgp_imsi_lsix,
1596 {"IMSI last ten numbers","bssgp.imsi.last10num",FT_STRING, BASE_NONE, NULL, 0x0, "Last ten numbers of IMSI",HFILL}},
1597 {&hf_bssgp_bvc_buck_size,
1598 {"Bmax(in 100 oct incr)","bssgp.bmax", FT_UINT16, BASE_HEX, NULL, 0x0, "BVC Bucket Size in 100 octet increments",HFILL}},
1599 {&hf_bssgp_buck_leak_rate,
1600 {"Bucket Leak Rate","bssgp.R", FT_UINT16, BASE_HEX, NULL, 0x0, "Bucket Leak Rate in 100 bits/sec increments",HFILL}},
1601 {&hf_bssgp_bmax_def_ms,
1602 {"Bmax default MS","bssgp.bmaxms", FT_UINT16, BASE_HEX, NULL, 0x0, "Default bucket size in 100 octetsincrement for an MS",HFILL}},
1603 {&hf_bssgp_r_defau_ms,
1604 {"R default MS","bssgp.Rms", FT_UINT16, BASE_HEX,NULL, 0x0, "Dfeault bucket leak rate to be applied to a flow control bucket for an MS", HFILL}},
1606 {"BVCI","bssgp.bvci",FT_UINT16, BASE_HEX, NULL, 0x0, "BSSGP Virtual Connection Identifier", HFILL}},
1608 {"Cause","bssgp.cause", FT_UINT8, BASE_HEX, NULL,0x0, " Cause information element indicates the reason for an exception condition",HFILL }},
1609 {&hf_bssgp_bvci_new,{"BVCI(New)","bssgp.bvci.new",FT_UINT16, BASE_HEX, NULL, 0x0, "BSSGP Virtual Connection Identifier", HFILL}},
1611 {"LLC frames discarded","bssgp.llcdisc.frames", FT_UINT8, BASE_HEX, NULL, 0x0,"LLC frames that have been discarded inside BSS", HFILL}},
1613 {"Number of octets affected","bssgp.noaff", FT_UINT24, BASE_HEX,NULL,0x0,"It indicates,for MS,the number of octets transferred or deleted by BSS",HFILL}},
1614 {&hf_bssgp_radio_cause,
1615 {"Radio Cause","bssgp.racase", FT_UINT8, BASE_HEX, NULL, 0x0, "Reason for an exception condition on the radio interface",HFILL}},
1616 {&hf_bssgp_ra_mccmnc,
1617 {"MCC and MNC","bssgp.ra.mccmnc", FT_STRING, BASE_DEC, NULL, 0x0, "Mobile country code and Mobile network code", HFILL}},
1619 {"LAC","bssgp.ra.lac",FT_UINT16, BASE_HEX, NULL, 0x0, "Location area code",HFILL }},
1621 {"RAC","bssgp.ra.rac",FT_UINT8, BASE_HEX, NULL, 0x0, "Routing area code", HFILL }},
1623 {"Cell id","bssgp.cid",FT_UINT16, BASE_HEX, NULL, 0x0, "Cell identity", HFILL }},
1626 /* Setup protocol subtree array */
1627 static gint *ett[] = {
1637 &ett_bssgp_imsi_stru_tree,
1655 /* Register the protocol name and description */
1656 proto_bssgp = proto_register_protocol("BSS GPRS Protocol",
1659 /* Required function calls to register the header fields and subtrees used */
1660 proto_register_field_array(proto_bssgp, hf, array_length(hf));
1661 proto_register_subtree_array(ett, array_length(ett));
1662 register_dissector("bssgp", dissect_bssgp, proto_bssgp);
1666 /* If this dissector uses sub-dissector registration add a registration routine.
1667 This format is required because a script is used to find these routines and
1668 create the code that calls these routines.
1671 proto_reg_handoff_bssgp(void)
1673 /* dissector_handle_t bssgp_handle;
1675 bssgp_handle = create_dissector_handle(dissect_bssgp,
1678 /* dissector_add("fr.nspduname", NS_UNITDATA, bssgp_handle);*/
1679 /* dissector_add("fr.nspduname", 0x0, bssgp_handle);
1681 /* dissector_add("fr.ietf", 0x0, bssgp_handle);
1683 /* data_handle = find_dissector("data");
1685 llcgprs_handle = find_dissector ("llcgprs");