3 * Routines for GMR-1 Radio Resource dissection in wireshark.
4 * Copyright (c) 2011 Sylvain Munaut <tnt@246tNt.com>
7 * [1] ETSI TS 101 376-4-8 V1.3.1 - GMR-1 04.008
8 * [2] ETSI TS 101 376-4-8 V2.2.1 - GMPRS-1 04.008
9 * [3] ETSI TS 101 376-4-8 V3.1.1 - GMR-1 3G 44.008
10 * [4] ETSI TS 100 940 V7.21.0 - GSM 04.08
11 * [5] ETSI TS 101 376-4-12 V3.2.1 - GMR-1 3G 44.060
12 * [6] ETSI TS 101 376-5-6 V1.3.1 - GMR-1 05.008
14 * Wireshark - Network traffic analyzer
15 * By Gerald Combs <gerald@wireshark.org>
16 * Copyright 1998 Gerald Combs
18 * SPDX-License-Identifier: GPL-2.0-or-later
23 #include <epan/packet.h>
24 #include <epan/expert.h>
25 #include <wsutil/array.h>
27 #include "packet-gmr1_common.h"
29 #include "packet-gmr1_rr.h"
31 void proto_register_gmr1_rr(void);
33 /* GMR-1 RR and CCCH proto */
34 static int proto_gmr1_rr
;
35 static int proto_gmr1_ccch
;
37 /* Fallback CCCH sub tree */
38 static int ett_msg_ccch
;
42 static expert_field ei_gmr1_missing_mandatory_element
;
45 /* ------------------------------------------------------------------------ */
46 /* RR Information Elements */
47 /* ------------------------------------------------------------------------ */
50 GMR1_IE_RR_CHAN_DESC
= 0, /* [1] 11.5.2.5 */
51 GMR1_IE_RR_CHAN_MODE
, /* [1] 11.5.2.6 */
52 GMR1_IE_RR_CIPH_MODE_SETTING
, /* [4] 10.5.2.9 */
53 GMR1_IE_RR_CIPH_RESP
, /* [4] 10.5.2.10 */
54 GMR1_IE_RR_L2_PSEUDO_LEN
, /* [1] 11.5.2.19 */
55 GMR1_IE_RR_PAGE_MODE
, /* [1] 11.5.2.26 */
56 GMR1_IE_RR_REQ_REF
, /* [1] 11.5.2.30 */
57 GMR1_IE_RR_CAUSE
, /* [1] 11.5.2.31 */
58 GMR1_IE_RR_TIMING_OFS
, /* [1] 11.5.2.40 */
59 GMR1_IE_RR_TMSI_PTMSI
, /* [4] 10.5.2.42 */
60 GMR1_IE_RR_WAIT_IND
, /* [4] 10.5.2.43 */
61 GMR1_IE_RR_MES_INFO_FLG
, /* [1] 11.5.2.44 */
62 GMR1_IE_RR_FREQ_OFS
, /* [1] 11.5.2.49 */
63 GMR1_IE_RR_PAGE_INFO
, /* [1] 11.5.2.51 */
64 GMR1_IE_RR_POS_DISPLAY
, /* [1] 11.5.2.52 */
65 GMR1_IE_RR_POS_UPD_INFO
, /* [1] 11.5.2.54 */
66 GMR1_IE_RR_BCCH_CARRIER
, /* [1] 11.5.2.55 */
67 GMR1_IE_RR_REJECT_CAUSE
, /* [1] 11.5.2.56 */
68 GMR1_IE_RR_GPS_TIMESTAMP
, /* [1] 11.5.2.57 */
69 GMR1_IE_RR_PWR_CTRL_PRM
, /* [1] 11.5.2.60 */
70 GMR1_IE_RR_TMSI_AVAIL_MSK
, /* [1] 11.5.2.62 */
71 GMR1_IE_RR_GPS_ALMANAC
, /* [1] 11.5.2.63 */
72 GMR1_IE_RR_MSC_ID
, /* [1] 11.5.2.100 */
73 GMR1_IE_RR_GPS_DISCR
, /* [1] 11.5.2.101 */
74 GMR1_IE_RR_PKT_IMM_ASS_3_PRM
, /* [3] 11.5.2.105 */
75 GMR1_IE_RR_PKT_FREQ_PRM
, /* [3] 11.5.2.106 */
76 GMR1_IE_RR_PKT_IMM_ASS_2_PRM
, /* [3] 11.5.2.107 */
77 GMR1_IE_RR_USF
, /* [3] 11.5.2.110 */
78 GMR1_IE_RR_TIMING_ADV_IDX
, /* [3] 10.1.18.3.4 */
79 GMR1_IE_RR_TLLI
, /* [5] 12.16 */
80 GMR1_IE_RR_PKT_PWR_CTRL_PRM
, /* [3] 10.1.18.3.3 */
81 GMR1_IE_RR_PERSISTENCE_LVL
, /* [3] 10.1.18.4.2 */
82 NUM_GMR1_IE_RR
/* Terminator */
85 static const value_string gmr1_ie_rr_strings
[] = {
86 { GMR1_IE_RR_CHAN_DESC
,
87 "Channel Description" }, /* [1] 11.5.2.5 */
88 { GMR1_IE_RR_CHAN_MODE
,
89 "Channel Mode" }, /* [1] 11.5.2.6 */
90 { GMR1_IE_RR_CIPH_MODE_SETTING
,
91 "Cipher Mode Setting" }, /* [4] 10.5.2.9 */
92 { GMR1_IE_RR_CIPH_RESP
,
93 "Cipher Response" }, /* [4] 10.5.2.10 */
94 { GMR1_IE_RR_L2_PSEUDO_LEN
,
95 "L2 Pseudo Length" }, /* [1] 11.5.2.19 */
96 { GMR1_IE_RR_PAGE_MODE
,
97 "Page Mode" }, /* [1] 11.5.2.26 */
99 "Request Reference" }, /* [1] 11.5.2.30 */
101 "RR Cause" }, /* [1] 11.5.2.31 */
102 { GMR1_IE_RR_TIMING_OFS
,
103 "Timing Offset" }, /* [1] 11.5.2.40 */
104 { GMR1_IE_RR_TMSI_PTMSI
,
105 "TMSI/P-TMSI" }, /* [4] 10.5.2.42 */
106 { GMR1_IE_RR_WAIT_IND
,
107 "Wait Indication" }, /* [4] 10.5.2.43 */
108 { GMR1_IE_RR_MES_INFO_FLG
,
109 "MES Information Flag" }, /* [1] 11.5.2.44 */
110 { GMR1_IE_RR_FREQ_OFS
,
111 "Frequency Offset" }, /* [1] 11.5.2.49 */
112 { GMR1_IE_RR_PAGE_INFO
,
113 "Paging Information" }, /* [1] 11.5.2.51 */
114 { GMR1_IE_RR_POS_DISPLAY
,
115 "Position Display" }, /* [1] 11.5.2.52 */
116 { GMR1_IE_RR_POS_UPD_INFO
,
117 "Position Update Information" }, /* [1] 11.5.2.54 */
118 { GMR1_IE_RR_BCCH_CARRIER
,
119 "BCCH Carrier Specification"}, /* [1] 11.5.2.55 */
120 { GMR1_IE_RR_REJECT_CAUSE
,
121 "Reject Cause" }, /* [1] 11.5.2.56 */
122 { GMR1_IE_RR_GPS_TIMESTAMP
,
123 "GPS timestamp" }, /* [1] 11.5.2.57 */
124 { GMR1_IE_RR_PWR_CTRL_PRM
,
125 "Power Control Params" }, /* [1] 11.5.2.60 */
126 { GMR1_IE_RR_TMSI_AVAIL_MSK
,
127 "TMSI Availability Mask" }, /* [1] 11.5.2.62 */
128 { GMR1_IE_RR_GPS_ALMANAC
,
129 "GPS Almanac Data" }, /* [1] 11.5.2.63 */
131 "MSC ID" }, /* [1] 11.5.2.100 */
132 { GMR1_IE_RR_GPS_DISCR
,
133 "GPS Discriminator" }, /* [1] 11.5.2.101 */
134 { GMR1_IE_RR_PKT_IMM_ASS_3_PRM
,
135 "Packet Imm. Ass. Type 3 Params" }, /* [3] 11.5.2.105 */
136 { GMR1_IE_RR_PKT_FREQ_PRM
,
137 "Packet Frequency Parameters" }, /* [3] 11.5.2.106 */
138 { GMR1_IE_RR_PKT_IMM_ASS_2_PRM
,
139 "Packet Imm. Ass. Type 2 Params" }, /* [3] 11.5.2.107 */
141 "USF" }, /* [3] 11.5.2.110 */
142 { GMR1_IE_RR_TIMING_ADV_IDX
,
143 "Timing Advance Index" }, /* [3] 10.1.18.3.4 */
145 "TLLI" }, /* [5] 12.16 */
146 { GMR1_IE_RR_PKT_PWR_CTRL_PRM
,
147 "Packet Power Control Params" }, /* [3] 10.1.18.3.3 */
148 { GMR1_IE_RR_PERSISTENCE_LVL
,
149 "Persistence Level" }, /* [3] 10.1.18.4.2 */
152 value_string_ext gmr1_ie_rr_strings_ext
= VALUE_STRING_EXT_INIT(gmr1_ie_rr_strings
);
154 int ett_gmr1_ie_rr
[NUM_GMR1_IE_RR
];
158 static int hf_rr_msg_type
;
159 static int hf_rr_chan_desc_kab_loc
;
160 static int hf_rr_chan_desc_rx_tn
;
161 static int hf_rr_chan_desc_arfcn
;
162 static int hf_rr_chan_desc_tx_tn
;
163 static int hf_rr_chan_desc_chan_type
;
164 static int hf_rr_chan_mode
;
165 static int hf_rr_ciph_mode_setting_sc
;
166 static int hf_rr_ciph_mode_setting_algo
;
167 static int hf_rr_ciph_resp_cr
;
168 static int hf_rr_ciph_resp_spare
;
169 static int hf_rr_l2_pseudo_len
;
170 static int hf_rr_page_mode
;
171 static int hf_rr_page_mode_spare
;
172 static int hf_rr_req_ref_est_cause
;
173 static int hf_rr_req_ref_ra
;
174 static int hf_rr_req_ref_fn
;
175 static int hf_rr_cause
;
176 static int hf_rr_timing_ofs_ti
;
177 static int hf_rr_timing_ofs_value
;
178 static int hf_rr_tmsi_ptmsi
;
179 static int hf_rr_wait_ind_timeout
;
180 static int hf_rr_mif_mes1_ab
;
181 static int hf_rr_mif_mes1_i
;
182 static int hf_rr_mif_mes1_d
;
183 static int hf_rr_mif_mes2
;
184 static int hf_rr_mif_mes3
;
185 static int hf_rr_mif_mes4
;
186 static int hf_rr_mif_pv
;
187 static int hf_rr_freq_ofs_fi
;
188 static int hf_rr_freq_ofs_value
;
189 static int hf_rr_freq_ofs_spare
;
190 static int hf_rr_page_info_msc_id
;
191 static int hf_rr_page_info_chan_needed
;
192 static int hf_rr_pos_display_flag
;
193 static int hf_rr_pos_display_text
;
194 static int hf_rr_pos_upd_info_v
;
195 static int hf_rr_pos_upd_info_dist
;
196 static int hf_rr_pos_upd_info_time
;
197 static int hf_rr_bcch_carrier_arfcn
;
198 static int hf_rr_bcch_carrier_si
;
199 static int hf_rr_bcch_carrier_ri
;
200 static int hf_rr_bcch_carrier_spare
;
201 static int hf_rr_reject_cause
;
202 static int hf_rr_reject_cause_b
;
203 static int hf_rr_gps_timestamp
;
204 static int hf_rr_gps_power_control_params
;
205 static int hf_rr_tmsi_avail_msk_tmsi
[4];
206 static int hf_rr_gps_almanac_pn
;
207 static int hf_rr_gps_almanac_wn
;
208 static int hf_rr_gps_almanac_word
;
209 static int hf_rr_gps_almanac_sfn
;
210 static int hf_rr_gps_almanac_co
;
211 static int hf_rr_gps_almanac_spare
;
212 static int hf_rr_msc_id
;
213 static int hf_rr_msc_id_spare
;
214 static int hf_rr_gps_discr
;
215 static int hf_rr_pkt_imm_ass_3_prm_rlc_mode
;
216 static int hf_rr_pkt_imm_ass_3_prm_spare
;
217 static int hf_rr_pkt_imm_ass_3_prm_dl_tfi
;
218 static int hf_rr_pkt_imm_ass_3_prm_start_fn
;
219 static int hf_rr_pkt_imm_ass_3_prm_mac_slot_alloc
;
220 static int hf_rr_pkt_freq_prm_arfcn
;
221 static int hf_rr_pkt_freq_prm_dl_freq_plan_id
;
222 static int hf_rr_pkt_freq_prm_dl_bw
;
223 static int hf_rr_pkt_freq_prm_ul_freq_dist
;
224 static int hf_rr_pkt_freq_prm_ul_bw
;
225 static int hf_rr_pkt_freq_prm_spare
;
226 static int hf_rr_pkt_imm_ass_2_prm_ac_spare1
;
227 static int hf_rr_pkt_imm_ass_2_prm_ac_final_alloc
;
228 static int hf_rr_pkt_imm_ass_2_prm_ac_usf_granularity
;
229 static int hf_rr_pkt_imm_ass_2_prm_ac_dl_ctl_mac_slot
;
230 static int hf_rr_pkt_imm_ass_2_prm_ac_mac_mode
;
231 static int hf_rr_pkt_imm_ass_2_prm_ac_start_fn
;
232 static int hf_rr_pkt_imm_ass_2_prm_ac_rlc_dblk_gnt
;
233 static int hf_rr_pkt_imm_ass_2_prm_ac_mcs
;
234 static int hf_rr_pkt_imm_ass_2_prm_ac_tfi
;
235 static int hf_rr_pkt_imm_ass_2_prm_ac_spare2
;
236 static int hf_rr_pkt_imm_ass_2_prm_ac_mac_slot_alloc
;
237 static int hf_rr_pkt_imm_ass_2_prm_d_chan_mcs_cmd
;
238 static int hf_rr_pkt_imm_ass_2_prm_d_chan_mcs_cmd_pnb512
;
239 static int hf_rr_pkt_imm_ass_2_prm_d_spare1
;
240 static int hf_rr_pkt_imm_ass_2_prm_d_rlc_dblk_gnt
;
241 static int hf_rr_pkt_imm_ass_2_prm_d_spare2
;
242 static int hf_rr_pkt_imm_ass_2_prm_d_tfi
;
243 static int hf_rr_pkt_imm_ass_2_prm_d_usf_granularity
;
244 static int hf_rr_pkt_imm_ass_2_prm_d_mac_slot_alloc
;
245 static int hf_rr_usf_value
;
246 static int hf_rr_usf_spare
;
247 static int hf_rr_timing_adv_idx_value
;
248 static int hf_rr_timing_adv_idx_spare
;
249 static int hf_rr_tlli
;
250 static int hf_rr_pkt_pwr_ctrl_prm_par
;
251 static int hf_rr_pkt_pwr_ctrl_prm_spare
;
252 static int hf_rr_persistence_lvl
[4];
253 static int hf_rr_protocol_discriminator
;
254 static int hf_rr_message_elements
;
256 /* Generic display vals/func */
257 static const value_string rr_gen_ie_presence_vals
[] = {
258 { 0, "IE is absent" },
259 { 1, "IE is present" },
264 rr_gen_ie_seconds_fmt(char *s
, uint32_t v
)
266 snprintf(s
, ITEM_LABEL_LENGTH
, "%u seconds", v
);
271 /* [1] 11.5.2.5 - Channel Description */
272 static const value_string rr_chan_desc_chan_type_vals
[] = {
273 { 1, "TCH3 No offset" },
274 { 3, "TCH3 1/2 symbol offset" },
275 { 6, "TCH6 No offset" },
276 { 7, "TCH6 1/2 symbol offset" },
277 { 4, "TCH9 No offset" },
278 { 5, "TCH9 1/2 symbol offset" },
279 { 13, "Reserved for SDCCH frames xx00" },
280 { 14, "Reserved for SDCCH frames xx01" },
281 { 15, "Reserved for SDCCH frames xx10" },
282 { 16, "Reserved for SDCCH frames xx11" },
286 GMR1_IE_FUNC(gmr1_ie_rr_chan_desc
)
290 bit_offset
= offset
<< 3;
292 /* KAB Location (6 bits)*/
293 proto_tree_add_bits_item(tree
, hf_rr_chan_desc_kab_loc
, tvb
,
294 bit_offset
, 6, ENC_BIG_ENDIAN
);
297 /* RX Timeslot (5 bits) */
298 proto_tree_add_bits_item(tree
, hf_rr_chan_desc_rx_tn
, tvb
,
299 bit_offset
, 5, ENC_BIG_ENDIAN
);
302 /* ARFCN (11 bits) */
303 proto_tree_add_bits_item(tree
, hf_rr_chan_desc_arfcn
, tvb
,
304 bit_offset
, 11, ENC_BIG_ENDIAN
);
307 /* TX Timeslot (5 bits) */
308 proto_tree_add_bits_item(tree
, hf_rr_chan_desc_tx_tn
, tvb
,
309 bit_offset
, 5, ENC_BIG_ENDIAN
);
312 /* Channel Type (5 bits) */
313 proto_tree_add_bits_item(tree
, hf_rr_chan_desc_chan_type
, tvb
,
314 bit_offset
, 5, ENC_BIG_ENDIAN
);
320 /* [1] 11.5.2.6 - Channel Mode */
321 static const value_string rr_chan_mode_vals
[] = {
322 { 0x00, "Signalling only" },
324 { 0x03, "Data, 12,0 kbit/s radio I/F rate" },
325 { 0x0b, "Data, 6,0 kbit/s radio I/F rate" },
326 { 0x13, "Data, 3,6 kbit/s radio I/F rate" },
330 GMR1_IE_FUNC(gmr1_ie_rr_chan_mode
)
333 proto_tree_add_item(tree
, hf_rr_chan_mode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
338 /* [4] 10.5.2.9 - Cipher Mode Setting */
339 static const value_string rr_ciph_mode_setting_sc_vals
[] = {
340 { 0, "No ciphering"},
341 { 1, "Start ciphering"},
345 static const value_string rr_ciph_mode_setting_algo_vals
[] = {
357 GMR1_IE_FUNC(gmr1_ie_rr_ciph_mode_setting
)
360 proto_tree_add_item(tree
, hf_rr_ciph_mode_setting_sc
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
363 proto_tree_add_item(tree
, hf_rr_ciph_mode_setting_algo
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
368 /* [4] 10.5.2.10 - Cipher Response */
369 static const value_string rr_ciph_resp_cr_vals
[] = {
370 { 0, "IMEISV shall not be included"},
371 { 1, "IMEISV shall be included"},
375 GMR1_IE_FUNC(gmr1_ie_rr_ciph_resp
)
378 proto_tree_add_item(tree
, hf_rr_ciph_resp_cr
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
381 proto_tree_add_item(tree
, hf_rr_ciph_resp_spare
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
386 /* [1] 11.5.2.19 - L2 Pseudo Length */
387 GMR1_IE_FUNC(gmr1_ie_rr_l2_pseudo_len
)
389 /* L2 Pseudo Length value */
390 proto_tree_add_item(tree
, hf_rr_l2_pseudo_len
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
395 /* [1] 11.5.2.26 - Page Mode */
396 static const value_string rr_page_mode_vals
[] = {
397 { 0, "Normal Paging" },
398 { 1, "Reserved (Changed from Extended Paging in GSM)" },
399 { 2, "Paging Reorganization" },
400 { 3, "Same as before" },
404 GMR1_IE_FUNC(gmr1_ie_rr_page_mode
)
407 proto_tree_add_item(tree
, hf_rr_page_mode
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
410 proto_tree_add_item(tree
, hf_rr_page_mode_spare
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
415 /* [1] 11.5.2.30 - Request Reference */
416 static const value_string rr_req_ref_est_cause_vals
[] = {
418 { 1, "In response to paging/alerting" },
419 { 2, "Location update/IMSI detach" },
420 { 3, "Emergency call" },
421 { 4, "Supplementary/short message service" },
422 { 5, "Position verification" },
423 { 6, "Any other valid cause" },
428 GMR1_IE_FUNC(gmr1_ie_rr_req_ref
)
430 /* Establishment Cause + RA */
431 proto_tree_add_item(tree
, hf_rr_req_ref_est_cause
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
432 proto_tree_add_item(tree
, hf_rr_req_ref_ra
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
435 /* Frame number % 256 */
436 proto_tree_add_item(tree
, hf_rr_req_ref_fn
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
441 /* [1] 11.5.2.31 - RR Cause */
442 static const value_string rr_cause_vals
[] = {
443 { 0x00, "Normal event" },
444 { 0x01, "Abnormal release, unspecified" },
445 { 0x02, "Abnormal release, channel unacceptable" },
446 { 0x03, "Abnormal release, timer expired" },
447 { 0x04, "Abnormal release, no activity on the radio path" },
448 { 0x05, "Preemptive release" },
449 { 0x09, "Channel mode unacceptable" },
450 { 0x0a, "Frequency not implemented" },
451 { 0x0b, "Position unacceptable" },
452 { 0x41, "Call already cleared" },
453 { 0x5f, "Semantically incorrect message" },
454 { 0x60, "Invalid mandatory information" },
455 { 0x61, "Message type nonexistent or not implemented" },
456 { 0x62, "Message type not compatible with protocol state" },
457 { 0x6f, "Protocol error unspecified" },
461 GMR1_IE_FUNC(gmr1_ie_rr_cause
)
464 proto_tree_add_item(tree
, hf_rr_cause
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
469 /* [1] 11.5.2.40 - Timing Offset */
470 static const value_string rr_timing_ofs_ti_vals
[] = {
471 { 0, "The timing offset parameter in this IE to be ignored" },
472 { 1, "The timing offset parameter has a valid value" },
477 rr_timing_ofs_value_fmt(char *s
, uint32_t v
)
479 int32_t sv
= (signed)v
;
481 snprintf(s
, ITEM_LABEL_LENGTH
, "%.3f symbols ( ~ %.3f ms )",
482 sv
/ 40.0f
, (sv
/ 40.0f
) * (10.0f
/ 234.0f
));
485 GMR1_IE_FUNC(gmr1_ie_rr_timing_ofs
)
489 bit_offset
= offset
<< 3;
492 proto_tree_add_bits_item(tree
, hf_rr_timing_ofs_ti
, tvb
,
493 bit_offset
, 1, ENC_BIG_ENDIAN
);
497 proto_tree_add_bits_item(tree
, hf_rr_timing_ofs_value
, tvb
,
498 bit_offset
, 15, ENC_BIG_ENDIAN
);
499 /*bit_offset += 15;*/
504 /* [4] 10.5.2.42 - TMSI/P-TMSI */
505 GMR1_IE_FUNC(gmr1_ie_rr_tmsi_ptmsi
)
507 /* TMSI/P-TMSI value as hex */
508 proto_tree_add_item(tree
, hf_rr_tmsi_ptmsi
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
513 /* [4] 10.5.2.43 - Wait Indication */
514 GMR1_IE_FUNC(gmr1_ie_rr_wait_ind
)
517 proto_tree_add_item(tree
, hf_rr_wait_ind_timeout
, tvb
, offset
, 1, ENC_BIG_ENDIAN
);
522 /* [1] 11.5.2.44 - MES Information Flag */
523 static const value_string rr_mif_mes1_ab_vals
[] = {
524 { 0, "Chan. Assigned: MES1 registered at selected GS" },
525 { 1, "Chan. Assigned: MES1 requires registration at selected GS" },
526 { 2, "Chan. Assigned; MES 1 Extended Channel Req. Reqd" },
527 { 3, "Pause Timer Indication" },
531 static const value_string rr_mif_mes234_vals
[] = {
532 { 0, "MES doesn't exists" },
533 { 1, "Pause Timer Ind for this MES" },
537 static const value_string rr_mif_pv_vals
[] = {
538 { 0, "Position Verification not requested" },
539 { 1, "MES1 shall send a Channel Request for Position Verification following the completion of the upcoming call" },
543 GMR1_IE_FUNC(gmr1_ie_rr_mes_info_flg
)
545 proto_tree_add_item(tree
, hf_rr_mif_mes1_ab
,
546 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
548 proto_tree_add_item(tree
, hf_rr_mif_mes1_i
,
549 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
551 proto_tree_add_item(tree
, hf_rr_mif_mes1_d
,
552 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
554 proto_tree_add_item(tree
, hf_rr_mif_mes2
,
555 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
557 proto_tree_add_item(tree
, hf_rr_mif_mes3
,
558 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
560 proto_tree_add_item(tree
, hf_rr_mif_mes4
,
561 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
563 proto_tree_add_item(tree
, hf_rr_mif_pv
,
564 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
569 /* [1] 11.5.2.49 - Frequency Offset */
570 static const value_string rr_freq_ofs_fi_vals
[] = {
571 { 0, "The frequency offset parameter in this IE to be ignored" },
572 { 1, "The frequency offset parameter has a valid value" },
577 rr_freq_ofs_value_fmt(char *s
, uint32_t v
)
579 int32_t sv
= (signed)v
;
581 snprintf(s
, ITEM_LABEL_LENGTH
, "%d Hz", sv
);
584 GMR1_IE_FUNC(gmr1_ie_rr_freq_ofs
)
588 bit_offset
= offset
<< 3;
591 proto_tree_add_bits_item(tree
, hf_rr_freq_ofs_fi
, tvb
,
592 bit_offset
, 1, ENC_BIG_ENDIAN
);
596 proto_tree_add_bits_item(tree
, hf_rr_freq_ofs_value
, tvb
,
597 bit_offset
, 12, ENC_BIG_ENDIAN
);
601 proto_tree_add_bits_item(tree
, hf_rr_freq_ofs_spare
, tvb
,
602 bit_offset
, 3, ENC_BIG_ENDIAN
);
608 /* [1] 11.5.2.51 - Paging Information */
609 static const value_string rr_page_info_chan_needed_vals
[] = {
617 GMR1_IE_FUNC(gmr1_ie_rr_page_info
)
619 /* MSC ID & Channel needed */
620 proto_tree_add_item(tree
, hf_rr_page_info_msc_id
,
621 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
622 proto_tree_add_item(tree
, hf_rr_page_info_chan_needed
,
623 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
628 /* [1] 11.5.2.52 - Position Display */
629 static const value_string rr_pos_display_flag_vals
[] = {
630 { 0, "Position not available" },
631 { 1, "No position display service" },
632 { 2, "Use default 7-bit alphabet (GSM 03.38)" },
636 GMR1_IE_FUNC(gmr1_ie_rr_pos_display
)
638 const unsigned char *txt_raw
;
639 char *txt_packed
, *txt_unpacked
;
640 tvbuff_t
*txt_packed_tvb
;
644 proto_tree_add_item(tree
, hf_rr_pos_display_flag
,
645 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
647 /* Get text in an aligned tvbuff */
648 /* Do not use tvb_new_octet_aligned(), GSM 7bit packing bit parsing
649 goes from LSB to MSB so a trick is applied here for the last byte */
650 txt_raw
= tvb_get_ptr(tvb
, offset
, 11);
651 txt_packed
= (char*)wmem_alloc(pinfo
->pool
, 11);
653 txt_packed
[i
] = (txt_raw
[i
] << 4) | (txt_raw
[i
+1] >> 4);
654 txt_packed
[10] = txt_raw
[10];
655 txt_packed_tvb
= tvb_new_real_data(txt_packed
, 11, 11);
658 txt_unpacked
= tvb_get_ts_23_038_7bits_string_packed(pinfo
->pool
, txt_packed_tvb
, 0, 12);
659 tvb_free(txt_packed_tvb
);
662 proto_tree_add_string(tree
, hf_rr_pos_display_text
, tvb
, offset
, 11,
668 /* [1] 11.5.2.54 - Position Update Information */
669 static const value_string rr_pos_upd_info_v_vals
[] = {
670 { 0, "Information in this IE is Invalid and should be ignored" },
671 { 1, "Information in this IE is Valid" },
676 rr_pos_upd_info_dist_fmt(char *s
, uint32_t v
)
678 snprintf(s
, ITEM_LABEL_LENGTH
, "%d km", v
);
682 rr_pos_upd_info_time_fmt(char *s
, uint32_t v
)
684 snprintf(s
, ITEM_LABEL_LENGTH
, "%d minutes", v
);
687 GMR1_IE_FUNC(gmr1_ie_rr_pos_upd_info
)
689 int curr_offset
= offset
;
691 /* Valid & GPS Update Distance */
692 proto_tree_add_item(tree
, hf_rr_pos_upd_info_v
,
693 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
694 proto_tree_add_item(tree
, hf_rr_pos_upd_info_dist
,
695 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
698 /* GPS Update Timer */
699 proto_tree_add_item(tree
, hf_rr_pos_upd_info_time
,
700 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
706 /* [1] 11.5.2.55 - BCCH Carrier */
707 static const value_string rr_bcch_carrier_si_vals
[] = {
708 { 0, "BCCH carrier is on the same satellite" },
709 { 1, "BCCH carrier is on a different satellite" },
713 static const value_string rr_bcch_carrier_ri_vals
[] = {
714 { 0, "Spot beam reselection not needed; use the spot beam with given BCCH" },
715 { 1, "Spot beam reselection needed; use the BCCH for spot beam reselection" },
719 GMR1_IE_FUNC(gmr1_ie_rr_bcch_carrier
)
723 bit_offset
= offset
<< 3;
726 proto_tree_add_bits_item(tree
, hf_rr_bcch_carrier_arfcn
,
727 tvb
, bit_offset
, 11, ENC_BIG_ENDIAN
);
731 proto_tree_add_bits_item(tree
, hf_rr_bcch_carrier_si
,
732 tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
736 proto_tree_add_bits_item(tree
, hf_rr_bcch_carrier_ri
,
737 tvb
, bit_offset
, 1, ENC_BIG_ENDIAN
);
741 proto_tree_add_bits_item(tree
, hf_rr_bcch_carrier_spare
,
742 tvb
, bit_offset
, 3, ENC_BIG_ENDIAN
);
748 /* [1] 11.5.2.56 - Reject Cause */
749 static const value_string rr_reject_cause_vals
[] = {
750 { 0x00, "Lack of resources (default)" },
751 { 0x11, "Invalid position for selected LAI" },
752 { 0x12, "Invalid position for selected spot beam" },
753 { 0x13, "Invalid position" },
754 { 0x15, "Position too old" },
755 { 0x16, "Invalid position for service provider" },
756 { 0x17, "Redirect to new satellite" },
757 { 0x3f, "Reported position acceptable" },
761 GMR1_IE_FUNC(gmr1_ie_rr_reject_cause
)
764 proto_tree_add_item(tree
, hf_rr_reject_cause
,
765 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
768 proto_tree_add_item(tree
, hf_rr_reject_cause_b
,
769 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
774 /* [1] 11.5.2.57 - GPS timestamp */
776 rr_gps_timestamp_fmt(char *s
, uint32_t v
)
779 snprintf(s
, ITEM_LABEL_LENGTH
, "> 65535 minutes or N/A");
781 snprintf(s
, ITEM_LABEL_LENGTH
, "%d minutes", v
);
784 GMR1_IE_FUNC(gmr1_ie_rr_gps_timestamp
)
787 proto_tree_add_item(tree
, hf_rr_gps_timestamp
,
788 tvb
, offset
, 2, ENC_BIG_ENDIAN
);
793 /* [1] 11.5.2.60 - Power Control Params */
794 GMR1_IE_FUNC(gmr1_ie_rr_pwr_ctrl_prm
)
796 /* It's CSN1 encoded and we have no real world sample. Until we do,
797 * we don't pollute the code with a bunch of untested stuff ... */
799 proto_tree_add_item(tree
, hf_rr_gps_power_control_params
, tvb
, offset
, 5, ENC_NA
);
804 /* [1] 11.5.2.62 - Availability Mask */
805 GMR1_IE_FUNC(gmr1_ie_rr_tmsi_avail_msk
)
810 proto_tree_add_item(tree
, hf_rr_tmsi_avail_msk_tmsi
[i
],
811 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
816 /* [1] 11.5.2.63 - GPS Almanac Data */
818 rr_gps_almanac_pn_fmt(char *s
, uint32_t v
)
820 snprintf(s
, ITEM_LABEL_LENGTH
, "%d", v
+1);
823 static const value_string rr_gps_almanac_sfn_vals
[] = {
830 GMR1_IE_FUNC(gmr1_ie_rr_gps_almanac
)
832 int curr_offset
= offset
;
834 /* Page Number & Word Number */
835 proto_tree_add_item(tree
, hf_rr_gps_almanac_pn
,
836 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
837 proto_tree_add_item(tree
, hf_rr_gps_almanac_wn
,
838 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
842 proto_tree_add_item(tree
, hf_rr_gps_almanac_word
,
843 tvb
, curr_offset
, 3, ENC_BIG_ENDIAN
);
846 /* SubFrame Number & CO & Spare */
847 proto_tree_add_item(tree
, hf_rr_gps_almanac_sfn
,
848 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
849 proto_tree_add_item(tree
, hf_rr_gps_almanac_co
,
850 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
851 proto_tree_add_item(tree
, hf_rr_gps_almanac_spare
,
852 tvb
, curr_offset
, 1, ENC_BIG_ENDIAN
);
858 /* [1] 11.5.2.100 - MSC ID */
859 GMR1_IE_FUNC(gmr1_ie_rr_msc_id
)
862 proto_tree_add_item(tree
, hf_rr_msc_id
,
863 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
866 proto_tree_add_item(tree
, hf_rr_msc_id_spare
,
867 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
872 /* [1] 11.5.2.101 - GPS Discriminator */
873 GMR1_IE_FUNC(gmr1_ie_rr_gps_discr
)
875 /* GPS Position CRC value */
876 proto_tree_add_item(tree
, hf_rr_gps_discr
, tvb
, offset
, 2, ENC_BIG_ENDIAN
);
881 /* [3] 11.5.2.105 - Packet Imm. Ass. Type 3 Params */
882 static const value_string rr_pkt_imm_ass_3_prm_rlc_mode_vals
[] = {
883 { 0, "RLC acknowledged mode" },
884 { 1, "RLC unacknowledged mode" },
888 static const crumb_spec_t rr_pkt_imm_ass_3_prm_dl_tfi_crumbs
[] = {
894 GMR1_IE_FUNC(gmr1_ie_rr_pkt_imm_ass_3_prm
)
897 proto_tree_add_item(tree
, hf_rr_pkt_imm_ass_3_prm_rlc_mode
,
898 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
901 proto_tree_add_item(tree
, hf_rr_pkt_imm_ass_3_prm_spare
,
902 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
904 /* Downlink Temporary Flow Identifier (TFI) */
905 proto_tree_add_split_bits_item_ret_val(
906 tree
, hf_rr_pkt_imm_ass_3_prm_dl_tfi
,
908 rr_pkt_imm_ass_3_prm_dl_tfi_crumbs
,
911 /* Starting Frame Number */
912 proto_tree_add_item(tree
, hf_rr_pkt_imm_ass_3_prm_start_fn
,
913 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
915 /* MAC Slot allocation */
916 proto_tree_add_item(tree
, hf_rr_pkt_imm_ass_3_prm_mac_slot_alloc
,
917 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
922 /* [3] 11.5.2.106 - Packet Frequency Parameters */
923 static const value_string rr_pkt_freq_prm_dl_freq_plan_id_vals
[] = {
924 { 0, "S-Band" }, /* Pretty much a guess ... */
925 { 1, "L-Band" }, /* didn't find exact value in specs */
929 static const crumb_spec_t rr_pkt_freq_prm_arfcn_crumbs
[] = {
935 static const crumb_spec_t rr_pkt_freq_prm_ul_freq_dist_crumbs
[] = {
942 rr_pkt_freq_prm_xx_bw_fmt(char *s
, uint32_t v
)
944 snprintf(s
, ITEM_LABEL_LENGTH
, "%d * 31.25 kHz = %.2f kHz (%d)", v
, 31.25f
*v
, v
);
947 GMR1_IE_FUNC(gmr1_ie_rr_pkt_freq_prm
)
950 proto_tree_add_split_bits_item_ret_val(
951 tree
, hf_rr_pkt_freq_prm_arfcn
,
953 rr_pkt_freq_prm_arfcn_crumbs
,
956 /* DL Freq plan ID */
957 proto_tree_add_item(tree
, hf_rr_pkt_freq_prm_dl_freq_plan_id
,
958 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
961 proto_tree_add_item(tree
, hf_rr_pkt_freq_prm_dl_bw
,
962 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
964 /* UL Freq distance */
965 proto_tree_add_split_bits_item_ret_val(
966 tree
, hf_rr_pkt_freq_prm_ul_freq_dist
,
967 tvb
, (offset
+1) << 3,
968 rr_pkt_freq_prm_ul_freq_dist_crumbs
,
972 proto_tree_add_item(tree
, hf_rr_pkt_freq_prm_ul_bw
,
973 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
976 proto_tree_add_item(tree
, hf_rr_pkt_freq_prm_spare
,
977 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
982 /* [3] 11.5.2.107 - Packet Imm. Ass. Type 2 Params */
983 static const value_string rr_pkt_imm_ass_2_prm_ac_mac_mode_vals
[] = {
984 { 0, "Dynamic allocation" },
991 static const crumb_spec_t rr_pkt_imm_ass_2_prm_ac_rlc_dblk_gnt_crumbs
[] = {
997 GMR1_IE_FUNC(gmr1_ie_rr_pkt_imm_ass_2_prm
)
999 proto_tree
*subtree_ac
, *subtree_d
;
1005 subtree_ac
= proto_tree_add_subtree(tree
, tvb
, offset
, 5,
1006 ett_gmr1_ie_rr
[GMR1_IE_RR_PKT_IMM_ASS_2_PRM
], NULL
, "GMPRS Terminal type A or C");
1009 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_spare1
,
1010 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1012 /* Final Allocation */
1013 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_final_alloc
,
1014 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1016 /* USF Granularity */
1017 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_usf_granularity
,
1018 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1020 /* Downlink Control MAC slot */
1021 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_dl_ctl_mac_slot
,
1022 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1025 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_mac_mode
,
1026 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1028 /* Starting Frame Number */
1029 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_start_fn
,
1030 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1032 /* RLC Data Blocks Granted */
1033 proto_tree_add_split_bits_item_ret_val(
1034 tree
, hf_rr_pkt_imm_ass_2_prm_ac_rlc_dblk_gnt
,
1035 tvb
, (offset
+1) << 3,
1036 rr_pkt_imm_ass_2_prm_ac_rlc_dblk_gnt_crumbs
,
1040 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_mcs
,
1041 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1044 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_tfi
,
1045 tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
1048 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_spare2
,
1049 tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
1051 /* MAC Slot allocation */
1052 proto_tree_add_item(subtree_ac
, hf_rr_pkt_imm_ass_2_prm_ac_mac_slot_alloc
,
1053 tvb
, offset
+4, 1, ENC_BIG_ENDIAN
);
1058 subtree_d
= proto_tree_add_subtree(tree
, tvb
, offset
, 5,
1059 ett_gmr1_ie_rr
[GMR1_IE_RR_PKT_IMM_ASS_2_PRM
], NULL
, "GMPRS Terminal type D");
1061 /* Channel MCS command */
1062 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_chan_mcs_cmd
,
1063 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1065 /* Channel MCS command PNB(5,12) */
1066 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_chan_mcs_cmd_pnb512
,
1067 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1070 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_spare1
,
1071 tvb
, offset
+1, 1, ENC_BIG_ENDIAN
);
1073 /* RLC Data Blocks Granted */
1074 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_rlc_dblk_gnt
,
1075 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1078 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_spare2
,
1079 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1082 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_tfi
,
1083 tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
1085 /* USF Granularity */
1086 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_usf_granularity
,
1087 tvb
, offset
+3, 1, ENC_BIG_ENDIAN
);
1089 /* MAC Slot allocation */
1090 proto_tree_add_item(subtree_d
, hf_rr_pkt_imm_ass_2_prm_d_mac_slot_alloc
,
1091 tvb
, offset
+4, 1, ENC_BIG_ENDIAN
);
1097 /* [3] 11.5.2.110 - USF */
1098 GMR1_IE_FUNC(gmr1_ie_rr_usf
)
1101 proto_tree_add_item(tree
, hf_rr_usf_spare
,
1102 tvb
, offset
, 3, ENC_BIG_ENDIAN
);
1105 proto_tree_add_item(tree
, hf_rr_usf_value
,
1106 tvb
, offset
+2, 1, ENC_BIG_ENDIAN
);
1111 /* [3] 10.1.18.3.4 & [5] 12.29 - Timing Advance Index */
1112 GMR1_IE_FUNC(gmr1_ie_rr_timing_adv_idx
)
1115 proto_tree_add_item(tree
, hf_rr_timing_adv_idx_value
,
1116 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1119 proto_tree_add_item(tree
, hf_rr_timing_adv_idx_spare
,
1120 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1125 /* [5] 12.16 - TLLI */
1126 GMR1_IE_FUNC(gmr1_ie_rr_tlli
)
1128 /* TLLI value as hex */
1129 proto_tree_add_item(tree
, hf_rr_tlli
, tvb
, offset
, 4, ENC_BIG_ENDIAN
);
1134 /* [3] 10.1.18.3.3 & [5] 10.4.10a & [6] 5.3.3 - Packet Power Control Params */
1136 rr_pkt_pwr_ctrl_prm_par_fmt(char *s
, uint32_t v
)
1139 snprintf(s
, ITEM_LABEL_LENGTH
, "Escape %d (%d)", v
-60, v
);
1143 snprintf(s
, ITEM_LABEL_LENGTH
, "%.1f dB (%d)", v
*0.4f
, v
);
1146 GMR1_IE_FUNC(gmr1_ie_rr_pkt_pwr_ctrl_prm
)
1148 /* Power Attenuation Request (PAR) */
1149 proto_tree_add_item(tree
, hf_rr_pkt_pwr_ctrl_prm_par
,
1150 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1153 proto_tree_add_item(tree
, hf_rr_pkt_pwr_ctrl_prm_spare
,
1154 tvb
, offset
, 1, ENC_BIG_ENDIAN
);
1159 /* [3] 10.1.18.4.2 & [5] 12.14 - Persistence Level */
1160 GMR1_IE_FUNC(gmr1_ie_rr_persistence_lvl
)
1165 proto_tree_add_item(tree
, hf_rr_persistence_lvl
[i
],
1166 tvb
, offset
+ (i
>>1), 1, ENC_BIG_ENDIAN
);
1172 elem_fcn gmr1_ie_rr_func
[NUM_GMR1_IE_RR
] = {
1173 gmr1_ie_rr_chan_desc
, /* Channel Description */
1174 gmr1_ie_rr_chan_mode
, /* Channel Mode */
1175 gmr1_ie_rr_ciph_mode_setting
, /* Cipher Mode Setting */
1176 gmr1_ie_rr_ciph_resp
, /* Cipher Response */
1177 gmr1_ie_rr_l2_pseudo_len
, /* L2 Pseudo Length */
1178 gmr1_ie_rr_page_mode
, /* Page Mode */
1179 gmr1_ie_rr_req_ref
, /* Request Reference */
1180 gmr1_ie_rr_cause
, /* RR Cause */
1181 gmr1_ie_rr_timing_ofs
, /* Timing Offset */
1182 gmr1_ie_rr_tmsi_ptmsi
, /* TMSI/P-TMSI */
1183 gmr1_ie_rr_wait_ind
, /* Wait Indication */
1184 gmr1_ie_rr_mes_info_flg
, /* MES Information Flag */
1185 gmr1_ie_rr_freq_ofs
, /* Frequency Offset */
1186 gmr1_ie_rr_page_info
, /* Paging Information */
1187 gmr1_ie_rr_pos_display
, /* Position Display */
1188 gmr1_ie_rr_pos_upd_info
, /* Position Update Information */
1189 gmr1_ie_rr_bcch_carrier
, /* BCCH Carrier */
1190 gmr1_ie_rr_reject_cause
, /* Reject Cause */
1191 gmr1_ie_rr_gps_timestamp
, /* GPS timestamp */
1192 gmr1_ie_rr_pwr_ctrl_prm
, /* Power Control Params */
1193 gmr1_ie_rr_tmsi_avail_msk
, /* TMSI Availability Mask */
1194 gmr1_ie_rr_gps_almanac
, /* GPS Almanac Data */
1195 gmr1_ie_rr_msc_id
, /* MSC ID */
1196 gmr1_ie_rr_gps_discr
, /* GPS Discriminator */
1197 gmr1_ie_rr_pkt_imm_ass_3_prm
, /* Packet Imm. Ass. Type 3 Params */
1198 gmr1_ie_rr_pkt_freq_prm
, /* Packet Frequency Parameters */
1199 gmr1_ie_rr_pkt_imm_ass_2_prm
, /* Packet Imm. Ass. Type 2 Params */
1200 gmr1_ie_rr_usf
, /* USF */
1201 gmr1_ie_rr_timing_adv_idx
, /* Timing Advance Index */
1202 gmr1_ie_rr_tlli
, /* TLLI */
1203 gmr1_ie_rr_pkt_pwr_ctrl_prm
, /* Packet Power Control Params */
1204 gmr1_ie_rr_persistence_lvl
, /* Persistence Level */
1208 /* ------------------------------------------------------------------------ */
1210 /* ------------------------------------------------------------------------ */
1212 /* [1] 10.1.18 - Immediate Assignment */
1213 GMR1_MSG_FUNC(gmr1_rr_msg_imm_ass
)
1219 /* MES Information Flag [1] 11.5.2.44 - M V 1 */
1220 mif
= tvb_get_uint8(tvb
, curr_offset
);
1222 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_MES_INFO_FLG
, NULL
, ei_gmr1_missing_mandatory_element
);
1224 /* Request Reference 1 (MES1) [1] 11.5.2.30 - M V 2 */
1225 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES1", ei_gmr1_missing_mandatory_element
);
1227 /* GPS Discriminator [1] 11.5.2.101 - C V 2 */
1228 if ((mif
& 0x03) != 0x02) {
1229 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_GPS_DISCR
, " - MES1", ei_gmr1_missing_mandatory_element
);
1232 /* Channel Description [1] 11.5.2.5 - C V 4 */
1233 if ((mif
& 0x03) != 0x03) {
1234 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_CHAN_DESC
, " - MES1", ei_gmr1_missing_mandatory_element
);
1237 /* Timing Offset [1] 11.5.2.40 - C V 2 */
1238 if ((mif
& 0x03) != 0x03) {
1239 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TIMING_OFS
, " - MES1", ei_gmr1_missing_mandatory_element
);
1242 /* Frequency Offset [1] 11.5.2.49 - C V 2 */
1243 if ((mif
& 0x03) != 0x03) {
1244 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_FREQ_OFS
, " - MES1", ei_gmr1_missing_mandatory_element
);
1247 /* Idle Mode Pos. Upd. Info. [1] 11.5.2.54 - C V 2 */
1249 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_POS_UPD_INFO
, " - Idle Mode", ei_gmr1_missing_mandatory_element
);
1252 /* Ded. Mode Pos. Upd. Info. [1] 11.5.2.54 - C V 2 */
1254 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_POS_UPD_INFO
, " - Dedicated Mode", ei_gmr1_missing_mandatory_element
);
1257 /* Request Reference 2 (MES2) [1] 11.5.2.30 - C V 2 */
1259 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES2", ei_gmr1_missing_mandatory_element
);
1262 /* Request Reference 3 (MES3) [1] 11.5.2.30 - C V 2 */
1264 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES3", ei_gmr1_missing_mandatory_element
);
1267 /* Request Reference 4 (MES4) [1] 11.5.2.30 - C V 2 */
1269 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES4", ei_gmr1_missing_mandatory_element
);
1272 /* IA Rest Octets [1] 11.5.2.16 - M V 0..18 */
1278 /* [1] 10.1.20.1 - Immediate Assignment Reject Type 1 */
1279 GMR1_MSG_FUNC(gmr1_rr_msg_imm_ass_rej_1
)
1285 /* Request Reference 1 (MES1) [1] 11.5.2.30 - M V 2 */
1286 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES1", ei_gmr1_missing_mandatory_element
);
1288 /* GPS Discriminator [1] 11.5.2.101 - M V 2 */
1289 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_GPS_DISCR
, NULL
, ei_gmr1_missing_mandatory_element
);
1291 /* Reject Cause [1] 11.5.2.56 - M V 1 */
1292 rej_cause
= tvb_get_uint8(tvb
, curr_offset
);
1294 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REJECT_CAUSE
, NULL
, ei_gmr1_missing_mandatory_element
);
1296 /* Wait Indication 1 (MES1) [4] 10.5.2.43 - C V 1 */
1297 if ((rej_cause
& 0xfc) == 0x00) {
1298 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_WAIT_IND
, " - MES1", ei_gmr1_missing_mandatory_element
);
1301 /* Request Reference 2 (MES2) [1] 11.5.2.30 - M V 2 */
1302 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES2", ei_gmr1_missing_mandatory_element
);
1304 /* Wait Indication 2 (MES2) [4] 10.5.2.43 - M V 1 */
1305 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_WAIT_IND
, " - MES2", ei_gmr1_missing_mandatory_element
);
1307 /* Request Reference 3 (MES3) [1] 11.5.2.30 - M V 2 */
1308 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES3", ei_gmr1_missing_mandatory_element
);
1310 /* Wait Indication 3 (MES3) [4] 10.5.2.43 - M V 1 */
1311 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_WAIT_IND
, " - MES3", ei_gmr1_missing_mandatory_element
);
1313 /* Request Reference 4 (MES4) [1] 11.5.2.30 - M V 2 */
1314 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, " - MES4", ei_gmr1_missing_mandatory_element
);
1316 /* Wait Indication 4 (MES4) [4] 10.5.2.43 - M V 1 */
1317 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_WAIT_IND
, " - MES4", ei_gmr1_missing_mandatory_element
);
1319 /* Idle Mode Position Update Info. [1] 11.5.2.54 - M V 2 */
1320 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_POS_UPD_INFO
, " - Idle Mode", ei_gmr1_missing_mandatory_element
);
1322 /* BCCH Carrier Specification [1] 11.5.2.55 - C V 2 */
1323 if (rej_cause
& 1) {
1324 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_BCCH_CARRIER
, NULL
, ei_gmr1_missing_mandatory_element
);
1327 /* MSC ID [1] 11.5.2.100 - C V 1 */
1328 if ((rej_cause
& 0xfc) == 0x5c) {
1329 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_MSC_ID
, NULL
, ei_gmr1_missing_mandatory_element
);
1332 /* IAR Rest Octets [1] 11.5.2.17 - M V 1..4 */
1338 /* [1] 10.1.20.4 - Position Verification Notify */
1339 GMR1_MSG_FUNC(gmr1_rr_msg_pos_verif_notify
)
1343 /* Request Reference [1] 11.5.2.30 - M V 2 */
1344 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_REQ_REF
, NULL
, ei_gmr1_missing_mandatory_element
);
1346 /* GPS Discriminator [1] 11.5.2.101 - M V 2 */
1347 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_GPS_DISCR
, NULL
, ei_gmr1_missing_mandatory_element
);
1349 /* Position Display [1] 11.5.2.52 - M V 11 */
1350 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_POS_DISPLAY
, NULL
, ei_gmr1_missing_mandatory_element
);
1352 /* 78 Idle Mode Position Update Info. [1] 11.5.2.54 - O TV 3 */
1353 ELEM_OPT_TV(0x78, GMR1_IE_RR
, GMR1_IE_RR_POS_UPD_INFO
, NULL
);
1355 /* IAR Rest Octets [1] 11.5.2.17 - M V 3..6 */
1361 /* [3] 10.1.18.3 - Immediate Assignment Type 2 */
1362 GMR1_MSG_FUNC(gmr1_rr_msg_imm_ass_2
)
1366 /* USF [3] 11.5.2.110 - M V 3 */
1367 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_USF
, NULL
, ei_gmr1_missing_mandatory_element
);
1369 /* Timing Advance Index [3] 10.1.18.3.4 - M V 1 */
1370 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TIMING_ADV_IDX
, NULL
, ei_gmr1_missing_mandatory_element
);
1372 /* TLLI [5] 12.16 - M V 4 */
1373 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TLLI
, NULL
, ei_gmr1_missing_mandatory_element
);
1375 /* Timing Offset [1] 11.5.2.40 - M V 2 */
1376 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TIMING_OFS
, NULL
, ei_gmr1_missing_mandatory_element
);
1378 /* Frequency Offset [1] 11.5.2.49 - M V 2 */
1379 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_FREQ_OFS
, NULL
, ei_gmr1_missing_mandatory_element
);
1381 /* Packet Imm. Ass. Type 2 Params. [3] 11.5.2.107 - M V 5 */
1382 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PKT_IMM_ASS_2_PRM
, NULL
, ei_gmr1_missing_mandatory_element
);
1384 /* Packet Frequency Parameters [3] 11.5.2.106 - M V 3 */
1385 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PKT_FREQ_PRM
, NULL
, ei_gmr1_missing_mandatory_element
);
1387 /* Packet Power Control Parameters [3] 10.1.18.3.3 - M V 1 */
1388 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PKT_PWR_CTRL_PRM
, NULL
, ei_gmr1_missing_mandatory_element
);
1393 /* [3] 10.1.18.4 - Immediate Assignment Type 3 */
1394 GMR1_MSG_FUNC(gmr1_rr_msg_imm_ass_3
)
1398 /* Page Mode [1] 11.5.2.26 - M V 1/2 */
1399 /* Spare Half Octet [1] 11.5.1.8 - M V 1/2 */
1400 ELEM_MAND_VV_SHORT(GMR1_IE_RR
, GMR1_IE_RR_PAGE_MODE
,
1401 GMR1_IE_COMMON
, GMR1_IE_COM_SPARE_NIBBLE
, ei_gmr1_missing_mandatory_element
);
1403 /* Persistence Level [3] 10.1.18.4.2 - M V 2 */
1404 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PERSISTENCE_LVL
, NULL
, ei_gmr1_missing_mandatory_element
);
1406 /* Timing Advance Index [3] 10.1.18.3.4 - M V 1 */
1407 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TIMING_ADV_IDX
, NULL
, ei_gmr1_missing_mandatory_element
);
1409 /* TLLI [5] 12.16 - M V 4 */
1410 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TLLI
, NULL
, ei_gmr1_missing_mandatory_element
);
1412 /* Packet Imm. Ass. Type 3 Params [3] 11.5.2.105 - M V 3 */
1413 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PKT_IMM_ASS_3_PRM
, NULL
, ei_gmr1_missing_mandatory_element
);
1415 /* Packet Frequency Parameters [3] 11.5.2.106 - M V 3 */
1416 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PKT_FREQ_PRM
, NULL
, ei_gmr1_missing_mandatory_element
);
1418 /* Packet Power Control Parameters [3] 10.1.18.3.3 - M V 1 */
1419 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PKT_PWR_CTRL_PRM
, NULL
, ei_gmr1_missing_mandatory_element
);
1421 /* P1 Rest Octets [1] 11.5.2.23 - M V 6 */
1427 /* [3] 10.1.9 - Ciphering Mode Command */
1428 GMR1_MSG_FUNC(gmr1_rr_msg_ciph_mode_cmd
)
1432 /* Cipher Mode Setting [4] 10.5.2.9 - M V 1/2 */
1433 /* Cipher Response [4] 10.5.2.10 - M V 1/2 */
1434 ELEM_MAND_VV_SHORT(GMR1_IE_RR
, GMR1_IE_RR_CIPH_MODE_SETTING
,
1435 GMR1_IE_RR
, GMR1_IE_RR_CIPH_RESP
, ei_gmr1_missing_mandatory_element
);
1437 /* 75 Position Display [1] 11.5.2.52 - O TV 12 */
1438 ELEM_OPT_TV(0x75, GMR1_IE_RR
, GMR1_IE_RR_POS_DISPLAY
, NULL
);
1443 /* [1] 10.1.10 - Ciphering Mode Complete */
1444 GMR1_MSG_FUNC(gmr1_rr_msg_ciph_mode_complete
)
1448 /* 17 Mobile Identity [1] 11.5.1.4 - O TLV 3-11 */
1449 ELEM_OPT_TLV(0x17, GSM_A_PDU_TYPE_COMMON
, DE_MID
, NULL
);
1451 /* 76 GPS Timestamp [1] 11.5.2.57 - O TV 3 */
1452 ELEM_OPT_TV(0x76, GMR1_IE_RR
, GMR1_IE_RR_GPS_TIMESTAMP
, NULL
);
1457 /* [1] 10.1.2.1 - Assignment Command 1 */
1458 GMR1_MSG_FUNC(gmr1_rr_msg_ass_cmd_1
)
1462 /* Channel Description [1] 11.5.2.5 - M V 4 */
1463 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_CHAN_DESC
, NULL
, ei_gmr1_missing_mandatory_element
);
1465 /* 7D Timing Offset [1] 11.5.2.40 - O TV 3 */
1466 ELEM_OPT_TV(0x7D, GMR1_IE_RR
, GMR1_IE_RR_TIMING_OFS
, NULL
);
1468 /* 7F Frequency Offset [1] 11.5.2.49 - O TV 3 */
1469 ELEM_OPT_TV(0x7F, GMR1_IE_RR
, GMR1_IE_RR_FREQ_OFS
, NULL
);
1471 /* 63 Channel Mode [1] 11.5.2.6 - O TV 2 */
1472 ELEM_OPT_TV(0x63, GMR1_IE_RR
, GMR1_IE_RR_CHAN_MODE
, NULL
);
1474 /* 71 Power Control Parameters [1] 11.5.2.60 - O TV 6 */
1475 ELEM_OPT_TV(0x71, GMR1_IE_RR
, GMR1_IE_RR_PWR_CTRL_PRM
, NULL
);
1477 /* 9- Cipher Mode Setting [4] 10.5.2.9 - O TV 1 */
1478 ELEM_OPT_TV_SHORT(0x90, GMR1_IE_RR
, GMR1_IE_RR_CIPH_MODE_SETTING
, NULL
);
1483 /* [1] 10.1.7 - Channel Release */
1484 GMR1_MSG_FUNC(gmr1_rr_msg_chan_release
)
1488 /* RR Cause [1] 11.5.2.31 - M V 1 */
1489 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_CAUSE
, NULL
, ei_gmr1_missing_mandatory_element
);
1494 /* [1] 10.1.24 - Paging Request Type 3 */
1495 GMR1_MSG_FUNC(gmr1_rr_msg_pag_req_3
)
1501 /* Page Mode [1] 11.5.2.26 - M V 1/2 */
1502 /* TMSI Availability Mask [1] 11.5.2.62 - M V 1/2 */
1503 tam
= (tvb_get_uint8(tvb
, curr_offset
) & 0xf0) >> 4;
1505 ELEM_MAND_VV_SHORT(GMR1_IE_RR
, GMR1_IE_RR_PAGE_MODE
,
1506 GMR1_IE_RR
, GMR1_IE_RR_TMSI_AVAIL_MSK
, ei_gmr1_missing_mandatory_element
);
1508 /* Mobile Identity 1 (TMSI) [4] 10.5.2.42 - C V 4 */
1510 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TMSI_PTMSI
, " - 1", ei_gmr1_missing_mandatory_element
);
1513 /* GPS Almanac Data 1 [1] 11.5.2.63 - C V 5 */
1514 if (!(tam
& 0x01)) {
1515 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_GPS_ALMANAC
, " - 1", ei_gmr1_missing_mandatory_element
);
1518 /* Mobile Identity 2 (TMSI) [4] 10.5.2.42 - C V 4 */
1520 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TMSI_PTMSI
, " - 2", ei_gmr1_missing_mandatory_element
);
1523 /* GPS Almanac Data 2 [1] 11.5.2.63 - C V 5 */
1524 if (!(tam
& 0x02)) {
1525 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_GPS_ALMANAC
, " - 2", ei_gmr1_missing_mandatory_element
);
1528 /* Mobile Identity 3 (TMSI) [4] 10.5.2.42 - C V 4 */
1530 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TMSI_PTMSI
, " - 3", ei_gmr1_missing_mandatory_element
);
1533 /* GPS Almanac Data 3 [1] 11.5.2.63 - C V 5 */
1534 if (!(tam
& 0x04)) {
1535 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_GPS_ALMANAC
, " - 3", ei_gmr1_missing_mandatory_element
);
1538 /* Mobile Identity 4 (TMSI) [4] 10.5.2.42 - C V 4 */
1540 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_TMSI_PTMSI
, " - 4", ei_gmr1_missing_mandatory_element
);
1543 /* GPS Almanac Data 4 [1] 11.5.2.63 - C V 5 */
1544 if (!(tam
& 0x08)) {
1545 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_GPS_ALMANAC
, " - 4", ei_gmr1_missing_mandatory_element
);
1548 /* Paging Information 1 [1] 11.5.2.51 - C V 1 */
1550 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PAGE_INFO
, " - 1", ei_gmr1_missing_mandatory_element
);
1553 /* Paging Information 2 [1] 11.5.2.51 - C V 1 */
1555 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PAGE_INFO
, " - 2", ei_gmr1_missing_mandatory_element
);
1558 /* Paging Information 3 [1] 11.5.2.51 - C V 1 */
1560 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PAGE_INFO
, " - 3", ei_gmr1_missing_mandatory_element
);
1563 /* Paging Information 4 [1] 11.5.2.51 - C V 1 */
1565 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_PAGE_INFO
, " - 4", ei_gmr1_missing_mandatory_element
);
1571 /* [1] 10.1.25 - Paging Response */
1572 GMR1_MSG_FUNC(gmr1_rr_msg_pag_resp
)
1576 /* Ciphering Key Sequence Number [4] 10.5.1.2 - M V 1/2 */
1577 /* Spare Half Octet [1] 11.5.1.8 - M V 1/2 */
1578 ELEM_MAND_VV_SHORT(GSM_A_PDU_TYPE_COMMON
, DE_CIPH_KEY_SEQ_NUM
,
1579 GMR1_IE_COMMON
, GMR1_IE_COM_SPARE_NIBBLE
, ei_gmr1_missing_mandatory_element
);
1581 /* Mobile Earth Station Classmark 2 [1] 11.5.1.6 - M L V 4 */
1582 ELEM_MAND_LV(GMR1_IE_COMMON
, GMR1_IE_COM_CM2
, NULL
, ei_gmr1_missing_mandatory_element
);
1584 /* Mobile Identity [4] 10.5.1.4 - M L V 2-9 */
1585 ELEM_MAND_LV(GSM_A_PDU_TYPE_COMMON
, DE_MID
, NULL
, ei_gmr1_missing_mandatory_element
);
1590 /* [1] 10.1.5 - Channel Mode Modify */
1591 GMR1_MSG_FUNC(gmr1_rr_msg_chan_mode_modify
)
1595 /* Channel Description [1] 11.5.2.5 - M V 4 */
1596 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_CHAN_DESC
, NULL
, ei_gmr1_missing_mandatory_element
);
1598 /* Channel Mode [1] 11.5.2.6 - M V 1 */
1599 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_CHAN_MODE
, NULL
, ei_gmr1_missing_mandatory_element
);
1604 /* [1] 10.1.6 - Channel Mode Modify Acknowledge */
1605 GMR1_MSG_FUNC(gmr1_rr_msg_chan_mode_mod_ack
)
1609 /* Channel Description [1] 11.5.2.5 - M V 4 */
1610 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_CHAN_DESC
, NULL
, ei_gmr1_missing_mandatory_element
);
1612 /* Channel Mode [1] 11.5.2.6 - M V 1 */
1613 ELEM_MAND_V(GMR1_IE_RR
, GMR1_IE_RR_CHAN_MODE
, NULL
, ei_gmr1_missing_mandatory_element
);
1619 /* See [3] 11.4.1 - Table 11.1 */
1620 static const value_string gmr1_msg_rr_strings
[] = {
1621 /* Channel establishment messages */
1622 { 0x3f, "Immediate Assignment" },
1623 { 0x3a, "Immediate Assignment Reject Type 1" },
1624 { 0x3b, "Immediate Assignment Reject Type 2" },
1626 * XXX - [3] 11.4.1 - Table 11.1 ([3] is ETSI TS 101 376-4-8
1627 * V3.1.1, which is GMR-1 3G 44.008) has 0x3e meaning both
1628 * "Extended Immediate Assignment" and "Immediate Assignment Type 2"
1629 * and has 0x3b meaning both "Immediate Asignment Reject Type 2"
1630 * and "Extended Imm. Assignment Reject".
1632 * [3] makes some references to [1] ([1] is ETSI TS 101 376-4-8
1633 * V1.3.1, which is GMR-1 04.008, not to be confused with GMR-1
1634 * 3G 44.008), saying some messages are the same as in GMR-1
1637 * says, in 10.1.18.2, that "Extended immediate assignment"
1638 * "is sent on the main signalling link by the network to
1639 * the MES in response to an EXTENDED CHANNEL REQUEST message
1642 * says, in 10.1.20.2, that "Immediate assignment reject type 2"
1643 * "may be sent to the MES by the network on the CCCH to indicate
1644 * that no channel is available for assignment or that the MES
1645 * cannot be allowed access";
1647 * says, in 10.1.20.3, that "Extended immediate assignment
1648 * reject" "message is sent by the network on the DCCH to
1649 * indicate that no channel is available for assignment or
1650 * that the MES cannot be allowed access";
1652 * does not mention "Immediate assignment type 2" anywhere
1657 * says, in 10.1.18.2, that "Extended immediate assignment
1658 * (A/Gb mode only)" is "Same as clause 10.1.18.2 of
1661 * says, in 10.1.18.3, that "Intermediate assignment Type
1662 * 2 (A/Gb mode only)" "is sent on the CCCH by the network
1663 * to the MES to change the channel configuration to a
1664 * dedicated configuration while staying in the same cell";
1666 * says, in 10.1.20.2, that "Immediate assignment reject
1667 * type 2" is "Same as clause 10.1.20.2 of GMR-1 04.008";
1669 * says, in 10.1.20.3, that "Extended immediate assignment
1670 * reject" is "Same as clause 10.1.20.3 of GMR-1 04.008".
1672 * This is currently handled by ORing 0x100 into the values
1673 * for the DCCH, and, in gmr1_get_msg_rr_params(), if the dcch
1674 * parameter is set (which it is if called from gmr1_get_msg_params()
1675 * in packet-gmr1_common.c), 0x100 is ORed into the value
1676 * passed to try_val_to_str_idx(). If that returns NULL, or
1677 * isn't called in the first placee, it calls try_val_to_str_idx()
1678 * without ORing in 0x100.
1680 * So that's why a 1-byte field has, in a value_string used with
1681 * it, two values that don't fit into 1 byte.
1683 * It Would Be Nice if this could be done in a somewhat less
1684 * hackish and opaque fashion.
1686 { 0x13e, "Extended Immediate Assignment" },
1687 { 0x13b, "Extended Imm. Assignment Reject" },
1688 { 0x39, "Position Verification Notify" },
1689 { 0x3c, "Immediate Assignment Reject Type 3" },
1690 { 0x3e, "Immediate Assignment Type 2" },
1691 { 0x3d, "Immediate Assignment Type 3" },
1693 /* Ciphering messages */
1694 { 0x35, "Ciphering Mode Command" },
1695 { 0x32, "Ciphering Mode Complete" },
1697 /* Channel assignment/handover messages */
1698 { 0x2e, "Assignment Command 1" },
1699 { 0x2a, "Assignment Command 2" },
1700 { 0x29, "Assignment Complete" },
1701 { 0x2f, "Assignment Failure" },
1702 { 0x2b, "Handover Command" },
1703 { 0x2c, "Handover Complete" },
1705 /* Channel release messages */
1706 { 0x0d, "Channel Release" },
1707 { 0x0e, "TtT Signalling Link Failure" },
1709 /* Paging messages */
1710 { 0x21, "Paging Request Type 1" },
1711 { 0x22, "Paging Request Type 2" },
1712 { 0x24, "Paging Request Type 3" },
1713 { 0x27, "Paging Response" },
1715 /* Miscellaneous messages */
1716 { 0x10, "Channel Mode Modify" },
1717 { 0x12, "RR Status" },
1718 { 0x17, "Channel Mode Modify Acknowledge" },
1719 { 0x16, "Classmark Change" },
1720 { 0x13, "Classmark Enquiry" },
1721 { 0x14, "Position Update Request" },
1722 { 0x15, "Position Update Accept" },
1723 { 0x11, "Link Correction Message" },
1725 { 0x01, "Power Control Parameters Update" },
1726 { 0x02, "Guard Time Violation" },
1727 { 0x04, "Extended Channel Request" },
1729 /* Status and Diagnostic Messages */
1730 { 0x40, "Information Request" },
1731 { 0x41, "Information Response Position" },
1732 { 0x42, "Information Response Version" },
1733 { 0x43, "Information Response Spot Beam Selection" },
1734 { 0x44, "Information Response Power Control" },
1735 { 0x45, "Information Response Vendor Specific" },
1736 { 0x46, "Information Response Current Beam" },
1737 { 0x4f, "Information Response Error" },
1744 #define NUM_GMR1_MSG_RR array_length(gmr1_msg_rr_strings)
1745 static int ett_msg_rr
[NUM_GMR1_MSG_RR
];
1747 /* same order as gmr1_msg_rr_strings */
1748 static const gmr1_msg_func_t gmr1_msg_rr_func
[NUM_GMR1_MSG_RR
] = {
1749 /* Channel establishment messages */
1750 gmr1_rr_msg_imm_ass
, /* Imm. Ass.*/
1751 gmr1_rr_msg_imm_ass_rej_1
, /* Imm. Ass. Reject Type 1 */
1752 NULL
, /* Imm. Ass. Reject Type 2 */
1753 NULL
, /* Extended Imm. Ass. */
1754 NULL
, /* Extended Imm. Ass. Reject */
1755 gmr1_rr_msg_pos_verif_notify
, /* Position Verification Notify */
1756 NULL
, /* Imm. Ass. Reject Type 3 */
1757 gmr1_rr_msg_imm_ass_2
, /* Imm. Ass. Type 2 */
1758 gmr1_rr_msg_imm_ass_3
, /* Imm. Ass. Type 3 */
1760 /* Ciphering messages */
1761 gmr1_rr_msg_ciph_mode_cmd
, /* Ciphering Mode Command */
1762 gmr1_rr_msg_ciph_mode_complete
, /* Ciphering Mode Complete */
1764 /* Channel assignment/handover messages */
1765 gmr1_rr_msg_ass_cmd_1
, /* Assignment Command 1 */
1766 NULL
, /* Assignment Command 2 */
1767 NULL
, /* Assignment Complete */
1768 NULL
, /* Assignment Failure */
1769 NULL
, /* Handover Command */
1770 NULL
, /* Handover Complete */
1772 /* Channel release messages */
1773 gmr1_rr_msg_chan_release
, /* Channel Release */
1774 NULL
, /* TtT Signalling Link Failure */
1776 /* Paging messages */
1777 NULL
, /* Paging Request Type 1 */
1778 NULL
, /* Paging Request Type 2 */
1779 gmr1_rr_msg_pag_req_3
, /* Paging Request Type 3 */
1780 gmr1_rr_msg_pag_resp
, /* Paging Response */
1782 /* Miscellaneous messages */
1783 gmr1_rr_msg_chan_mode_modify
, /* Channel Mode Modify */
1784 NULL
, /* RR Status */
1785 gmr1_rr_msg_chan_mode_mod_ack
, /* Channel Mode Modify Acknowledge */
1786 NULL
, /* Classmark Change */
1787 NULL
, /* Classmark Enquiry */
1788 NULL
, /* Position Update Request */
1789 NULL
, /* Position Update Accept */
1790 NULL
, /* Link Correction Message */
1792 NULL
, /* Power Control Parameters Update */
1793 NULL
, /* Guard Time Violation */
1794 NULL
, /* Extended Channel Request */
1796 /* Status and Diagnostic Messages */
1797 NULL
, /* Info. Req. */
1798 NULL
, /* Info. Resp. Position */
1799 NULL
, /* Info. Resp. Version */
1800 NULL
, /* Info. Resp. Spot Beam Selection */
1801 NULL
, /* Info. Resp. Power Control */
1802 NULL
, /* Info. Resp. Vendor Specific */
1803 NULL
, /* Info. Resp. Current Beam */
1804 NULL
, /* Info. Resp. Error */
1811 gmr1_get_msg_rr_params(uint8_t oct
, int dcch
, const char **msg_str
,
1812 int *ett_tree
, int *hf_idx
, gmr1_msg_func_t
*msg_func_p
)
1814 const char *m
= NULL
;
1818 * See the large comment in gmr1_msg_rr_strings[] for an
1819 * explanation of why we're doing this.
1822 m
= try_val_to_str_idx((uint32_t)oct
| 0x100, gmr1_msg_rr_strings
, &idx
);
1825 m
= try_val_to_str_idx((uint32_t)oct
, gmr1_msg_rr_strings
, &idx
);
1828 *hf_idx
= hf_rr_msg_type
;
1830 *ett_tree
= ett_msg_rr
[idx
];
1831 *msg_func_p
= gmr1_msg_rr_func
[idx
];
1839 /* ------------------------------------------------------------------------ */
1840 /* Dissector code */
1841 /* ------------------------------------------------------------------------ */
1844 dissect_gmr1_ccch(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
1846 uint32_t len
, offset
;
1847 gmr1_msg_func_t msg_func
;
1848 const char *msg_str
;
1851 proto_item
*ccch_item
= NULL
, *pd_item
= NULL
;
1852 proto_tree
*ccch_tree
= NULL
, *pd_tree
= NULL
;
1858 len
= tvb_reported_length(tvb
);
1863 /* Can't be a CCCH */
1867 col_append_str(pinfo
->cinfo
, COL_INFO
, "(CCCH) ");
1869 /* First octet with pseudo len */
1870 oct
[0] = tvb_get_uint8(tvb
, offset
++);
1872 /* Check protocol descriptor */
1873 oct
[1] = tvb_get_uint8(tvb
, offset
++);
1875 if ((oct
[1] & GMR1_PD_EXT_MSK
) == GMR1_PD_EXT_VAL
)
1880 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "(%s) ",
1881 val_to_str(pd
, gmr1_pd_short_vals
, "Unknown (%u)"));
1883 if (pd
!= GMR1_PD_RR
)
1884 goto err
; /* CCCH is only RR */
1886 /* Get message parameters */
1887 oct
[2] = tvb_get_uint8(tvb
, offset
);
1889 gmr1_get_msg_rr_params(oct
[2], 0, &msg_str
, &ett_tree
, &hf_idx
, &msg_func
);
1891 /* Create protocol tree */
1892 if (msg_str
== NULL
)
1894 ccch_item
= proto_tree_add_protocol_format(
1895 tree
, proto_gmr1_ccch
, tvb
, 0, len
,
1896 "GMR-1 CCCH - Message Type (0x%02x)", oct
[2]);
1897 ccch_tree
= proto_item_add_subtree(ccch_item
, ett_msg_ccch
);
1899 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "Message Type (0x%02x) ", oct
[2]);
1903 ccch_item
= proto_tree_add_protocol_format(
1904 tree
, proto_gmr1_ccch
, tvb
, 0, -1,
1905 "GMR-1 CCCH - %s", msg_str
);
1906 ccch_tree
= proto_item_add_subtree(ccch_item
, ett_tree
);
1908 col_append_fstr(pinfo
->cinfo
, COL_INFO
, "%s ", msg_str
);
1914 /* L2 Pseudo Length - [1] 11.5.2.19 */
1915 offset
+= elem_v(tvb
, ccch_tree
, pinfo
, GMR1_IE_RR
, GMR1_IE_RR_L2_PSEUDO_LEN
, offset
, NULL
);
1917 /* Protocol discriminator item */
1918 pd_item
= proto_tree_add_uint(
1919 ccch_tree
, hf_rr_protocol_discriminator
, tvb
, 1, 1, pd
);
1921 pd_tree
= proto_item_add_subtree(pd_item
, ett_rr_pd
);
1923 /* Skip indicator / Transaction indicator */
1925 proto_tree_add_item(pd_tree
, hf_gmr1_skip_ind
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
1930 /* Protocol discriminator value */
1931 proto_tree_add_item(pd_tree
, hf_gmr1_l3_pd
, tvb
, 1, 1, ENC_BIG_ENDIAN
);
1937 /* Message type - [1] 11.4 */
1938 proto_tree_add_uint_format(
1939 ccch_tree
, hf_idx
, tvb
, offset
, 1, oct
[2],
1940 "Message Type: %s", msg_str
? msg_str
: "(Unknown)"
1945 /* Decode elements */
1947 (*msg_func
)(tvb
, ccch_tree
, pinfo
, offset
, len
- offset
);
1949 proto_tree_add_item(ccch_tree
, hf_rr_message_elements
, tvb
, offset
, len
- offset
, ENC_NA
);
1952 /* Error handling */
1954 call_data_dissector(tvb
, pinfo
, tree
);
1955 return tvb_captured_length(tvb
);
1959 proto_register_gmr1_rr(void)
1961 static hf_register_info hf
[] = {
1963 { "Radio Resources Management Message Type", "gmr1.rr.msg_type",
1964 FT_UINT8
, BASE_HEX
, VALS(gmr1_msg_rr_strings
), 0x00,
1965 NULL
, HFILL
} /* FIXME handle CCCH/DCCH conflicts */
1967 { &hf_rr_chan_desc_kab_loc
,
1968 { "KAB Location", "gmr1.rr.chan_desc.kab_loc",
1969 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
1972 { &hf_rr_chan_desc_rx_tn
,
1973 { "RX Timeslot", "gmr1.rr.chan_desc.rx_tn",
1974 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
1977 { &hf_rr_chan_desc_arfcn
,
1978 { "ARFCN", "gmr1.rr.chan_desc.arfcn",
1979 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
1982 { &hf_rr_chan_desc_tx_tn
,
1983 { "TX Timeslot", "gmr1.rr.chan_desc.tx_tn",
1984 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
1987 { &hf_rr_chan_desc_chan_type
,
1988 { "Channel Type", "gmr1.rr.chan_desc.chan_type",
1989 FT_UINT8
, BASE_DEC
, VALS(rr_chan_desc_chan_type_vals
), 0x00,
1993 { "Channel Mode", "gmr1.rr.chan_mode",
1994 FT_UINT8
, BASE_DEC
, VALS(rr_chan_mode_vals
), 0x00,
1997 { &hf_rr_ciph_mode_setting_sc
,
1998 { "SC", "gmr1.rr.ciph_mode_setting.sc",
1999 FT_UINT8
, BASE_DEC
, VALS(rr_ciph_mode_setting_sc_vals
), 0x01,
2002 { &hf_rr_ciph_mode_setting_algo
,
2003 { "Algorithm", "gmr1.rr.ciph_mode_setting.algo",
2004 FT_UINT8
, BASE_DEC
, VALS(rr_ciph_mode_setting_algo_vals
), 0x0e,
2007 { &hf_rr_ciph_resp_cr
,
2008 { "CR", "gmr1.rr.ciph_resp.cr",
2009 FT_UINT8
, BASE_DEC
, VALS(rr_ciph_resp_cr_vals
), 0x10,
2012 { &hf_rr_ciph_resp_spare
,
2013 { "Spare", "gmr1.rr.ciph_resp.spare",
2014 FT_UINT8
, BASE_DEC
, NULL
, 0xe0,
2017 { &hf_rr_l2_pseudo_len
,
2018 { "L2 Pseudo Length value", "gmr1.rr.l2_pseudo_len",
2019 FT_UINT8
, BASE_DEC
, NULL
, 0xfc,
2023 { "Page Mode", "gmr1.rr.page_mode.mode",
2024 FT_UINT8
, BASE_DEC
, VALS(rr_page_mode_vals
), 0x03,
2027 { &hf_rr_page_mode_spare
,
2028 { "Spare", "gmr1.rr.page_mode.spare",
2029 FT_UINT8
, BASE_DEC
, NULL
, 0x0c,
2032 { &hf_rr_req_ref_est_cause
,
2033 { "Establishment cause group ID", "gmr1.rr.req_ref.est_cause",
2034 FT_UINT8
, BASE_DEC
, VALS(rr_req_ref_est_cause_vals
), 0xe0,
2037 { &hf_rr_req_ref_ra
,
2038 { "Random Access Information", "gmr1.rr.req_ref.ra",
2039 FT_UINT8
, BASE_HEX
, NULL
, 0x1f,
2042 { &hf_rr_req_ref_fn
,
2043 { "Frame Number mod 256", "gmr1.rr.req_ref.fn",
2044 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2048 { "RR Cause", "gmr1.rr.cause",
2049 FT_UINT8
, BASE_DEC
, VALS(rr_cause_vals
), 0x00,
2052 { &hf_rr_timing_ofs_ti
,
2053 { "TI", "gmr1.rr.timing_offset.ti",
2054 FT_UINT8
, BASE_DEC
, VALS(rr_timing_ofs_ti_vals
), 0x00,
2057 { &hf_rr_timing_ofs_value
,
2058 { "Timing Offset value", "gmr1.rr.timing_offset.value",
2059 FT_INT16
, BASE_CUSTOM
, CF_FUNC(rr_timing_ofs_value_fmt
), 0x00,
2062 { &hf_rr_tmsi_ptmsi
,
2063 { "TMSI/P-TMSI Value","gmr1.rr.tmsi_ptmsi",
2064 FT_UINT32
,BASE_HEX
, NULL
, 0x00,
2067 { &hf_rr_wait_ind_timeout
,
2068 { "T3122/T3142 timeout", "gmr1.rr.wait_ind.timeout",
2069 FT_UINT8
, BASE_CUSTOM
, CF_FUNC(rr_gen_ie_seconds_fmt
), 0x00,
2072 { &hf_rr_mif_mes1_ab
,
2073 { "MES1 - Assignment Type", "gmr1.rr.mes_info_flag.1.ab",
2074 FT_UINT8
, BASE_DEC
, VALS(rr_mif_mes1_ab_vals
), 0x03,
2077 { &hf_rr_mif_mes1_i
,
2078 { "MES1 - Idle mode position update", "gmr1.rr.mes_info_flag.1.i",
2079 FT_UINT8
, BASE_DEC
, VALS(rr_gen_ie_presence_vals
), 0x04,
2082 { &hf_rr_mif_mes1_d
,
2083 { "MES1 - Dedicated mode position update", "gmr1.rr.mes_info_flag.1.d",
2084 FT_UINT8
, BASE_DEC
, VALS(rr_gen_ie_presence_vals
), 0x08,
2088 { "MES2", "gmr1.rr.mes_info_flag.2",
2089 FT_UINT8
, BASE_DEC
, VALS(rr_mif_mes234_vals
), 0x10,
2093 { "MES3", "gmr1.rr.mes_info_flag.3",
2094 FT_UINT8
, BASE_DEC
, VALS(rr_mif_mes234_vals
), 0x20,
2098 { "MES4", "gmr1.rr.mes_info_flag.4",
2099 FT_UINT8
, BASE_DEC
, VALS(rr_mif_mes234_vals
), 0x40,
2103 { "Position Verification indicator", "gmr1.rr.mes_info_flag.pv",
2104 FT_UINT8
, BASE_DEC
, VALS(rr_mif_pv_vals
), 0x80,
2107 { &hf_rr_freq_ofs_fi
,
2108 { "FI", "gmr1.rr.frequency_offset.fi",
2109 FT_UINT8
, BASE_DEC
, VALS(rr_freq_ofs_fi_vals
), 0x00,
2112 { &hf_rr_freq_ofs_value
,
2113 { "Frequency Offset value", "gmr1.rr.frequency_offset.value",
2114 FT_INT16
, BASE_CUSTOM
, CF_FUNC(rr_freq_ofs_value_fmt
), 0x00,
2117 { &hf_rr_freq_ofs_spare
,
2118 { "Spare", "gmr1.rr.frequency_offset.spare",
2119 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2122 { &hf_rr_page_info_msc_id
,
2123 { "MSC ID", "gmr1.rr.paging_info.msc_id",
2124 FT_UINT8
, BASE_DEC
, NULL
, 0xfc,
2127 { &hf_rr_page_info_chan_needed
,
2128 { "Channel Needed", "gmr1.rr.paging_info.chan_needed",
2129 FT_UINT8
, BASE_DEC
, VALS(rr_page_info_chan_needed_vals
), 0x03,
2132 { &hf_rr_pos_display_flag
,
2133 { "Display Information Flag", "gmr1.rr.pos_display.flag",
2134 FT_UINT8
, BASE_DEC
, VALS(rr_pos_display_flag_vals
), 0xf0,
2137 { &hf_rr_pos_display_text
,
2138 { "Country and Region name", "gmr1.rr.pos_display.text",
2139 FT_STRING
, BASE_NONE
, NULL
, 0x00,
2142 { &hf_rr_pos_upd_info_v
,
2143 { "Valid", "gmr1.rr.pos_upd_info.valid",
2144 FT_UINT8
, BASE_DEC
, VALS(rr_pos_upd_info_v_vals
), 0x01,
2147 { &hf_rr_pos_upd_info_dist
,
2148 { "GPS Update Distance", "gmr1.rr.pos_upd_info.distance",
2149 FT_UINT8
, BASE_CUSTOM
, CF_FUNC(rr_pos_upd_info_dist_fmt
), 0xfe,
2152 { &hf_rr_pos_upd_info_time
,
2153 { "GPS Update Timer", "gmr1.rr.pos_upd_info.time",
2154 FT_UINT8
, BASE_CUSTOM
, CF_FUNC(rr_pos_upd_info_time_fmt
), 0xff,
2157 { &hf_rr_bcch_carrier_arfcn
,
2158 { "ARFCN", "gmr1.rr.bcch_carrier.arfcn",
2159 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
2162 { &hf_rr_bcch_carrier_si
,
2163 { "Satellite Indication", "gmr1.rr.bcch_carrier.si",
2164 FT_UINT8
, BASE_DEC
, VALS(rr_bcch_carrier_si_vals
), 0x00,
2167 { &hf_rr_bcch_carrier_ri
,
2168 { "Reselection Indication", "gmr1.rr.bcch_carrier.ri",
2169 FT_UINT8
, BASE_DEC
, VALS(rr_bcch_carrier_ri_vals
), 0x00,
2172 { &hf_rr_bcch_carrier_spare
,
2173 { "Spare", "gmr1.rr.bcch_carrier.spare",
2174 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2177 { &hf_rr_reject_cause
,
2178 { "Cause", "gmr1.rr.reject_cause.cause",
2179 FT_UINT8
, BASE_DEC
, VALS(rr_reject_cause_vals
), 0xfc,
2182 { &hf_rr_reject_cause_b
,
2183 { "BCCH Carrier IE presence", "gmr1.rr.reject_cause.b",
2184 FT_UINT8
, BASE_DEC
, VALS(rr_gen_ie_presence_vals
), 0x01,
2187 { &hf_rr_gps_timestamp
,
2188 { "GPS timestamp", "gmr1.rr.gps_timestamp",
2189 FT_UINT16
, BASE_CUSTOM
, CF_FUNC(rr_gps_timestamp_fmt
), 0xffff,
2192 { &hf_rr_gps_power_control_params
,
2193 { "Power Control Parameters", "gmr1.rr.power_control_params",
2194 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2197 { &hf_rr_tmsi_avail_msk_tmsi
[0],
2198 { "TMSI 1 Presence", "gmr1.rr.tmsi_avail_msk.tmsi1",
2199 FT_UINT8
, BASE_DEC
, VALS(rr_gen_ie_presence_vals
), 0x10,
2202 { &hf_rr_tmsi_avail_msk_tmsi
[1],
2203 { "TMSI 2 Presence", "gmr1.rr.tmsi_avail_msk.tmsi2",
2204 FT_UINT8
, BASE_DEC
, VALS(rr_gen_ie_presence_vals
), 0x20,
2207 { &hf_rr_tmsi_avail_msk_tmsi
[2],
2208 { "TMSI 3 Presence", "gmr1.rr.tmsi_avail_msk.tmsi3",
2209 FT_UINT8
, BASE_DEC
, VALS(rr_gen_ie_presence_vals
), 0x40,
2212 { &hf_rr_tmsi_avail_msk_tmsi
[3],
2213 { "TMSI 4 Presence", "gmr1.rr.tmsi_avail_msk.tmsi4",
2214 FT_UINT8
, BASE_DEC
, VALS(rr_gen_ie_presence_vals
), 0x80,
2217 { &hf_rr_gps_almanac_pn
,
2218 { "Page Number", "gmr1.rr.gps_almanac.pn",
2219 FT_UINT8
, BASE_CUSTOM
, CF_FUNC(rr_gps_almanac_pn_fmt
), 0xf8,
2220 "See ICD-GPS-200", HFILL
}
2222 { &hf_rr_gps_almanac_wn
,
2223 { "Word Number", "gmr1.rr.gps_almanac.wn",
2224 FT_UINT8
, BASE_DEC
, NULL
, 0x07,
2225 "See ICD-GPS-200", HFILL
}
2227 { &hf_rr_gps_almanac_word
,
2228 { "GPS Almanac Word", "gmr1.rr.gps_almanac.word",
2229 FT_UINT24
, BASE_HEX
, NULL
, 0x00,
2230 "See ICD-GPS-200", HFILL
}
2232 { &hf_rr_gps_almanac_sfn
,
2233 { "Sub Frame Number", "gmr1.rr.gps_almanac.sfn",
2234 FT_UINT8
, BASE_DEC
, VALS(rr_gps_almanac_sfn_vals
), 0x80,
2235 "See ICD-GPS-200", HFILL
}
2237 { &hf_rr_gps_almanac_co
,
2238 { "CO", "gmr1.rr.gps_almanac.co",
2239 FT_UINT8
, BASE_DEC
, NULL
, 0x40,
2242 { &hf_rr_gps_almanac_spare
,
2243 { "Spare", "gmr1.rr.gps_almanac.spare",
2244 FT_UINT8
, BASE_DEC
, NULL
, 0x3f,
2248 { "MSC ID", "gmr1.rr.msc_id",
2249 FT_UINT8
, BASE_DEC
, NULL
, 0xfc,
2252 { &hf_rr_msc_id_spare
,
2253 { "Spare", "gmr1.rr.msc_id.spare",
2254 FT_UINT8
, BASE_DEC
, NULL
, 0x03,
2258 { "GPS Position field CRC-16", "gmr1.rr.gps_discriminator",
2259 FT_UINT16
, BASE_HEX
, NULL
, 0x00,
2262 { &hf_rr_pkt_imm_ass_3_prm_rlc_mode
,
2263 { "RLC Mode", "gmr1.rr.pkt_imm_ass_3_prm",
2264 FT_UINT8
, BASE_DEC
, VALS(rr_pkt_imm_ass_3_prm_rlc_mode_vals
), 0x01,
2267 { &hf_rr_pkt_imm_ass_3_prm_spare
,
2268 { "Spare", "gmr1.rr.pkt_imm_ass_3_prm.spare",
2269 FT_UINT8
, BASE_DEC
, NULL
, 0x1e,
2272 { &hf_rr_pkt_imm_ass_3_prm_dl_tfi
,
2273 { "Downlink TFI", "gmr1.rr.pkt_imm_ass_3_prm.tfi",
2274 FT_UINT8
, BASE_HEX
, NULL
, 0x00,
2275 "Temporary Flow Identifier", HFILL
}
2277 { &hf_rr_pkt_imm_ass_3_prm_start_fn
,
2278 { "Start Framenumber", "gmr1.rr.pkt_imm_ass_3_prm.start_fn",
2279 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
2282 { &hf_rr_pkt_imm_ass_3_prm_mac_slot_alloc
,
2283 { "MAC-slot Allocation", "gmr1.rr.pkt_imm_ass_3_prm.mac_slot_alloc",
2284 FT_UINT8
, BASE_HEX
, NULL
, 0xff,
2285 "LSB=slot 0, MSB=slot 7", HFILL
}
2287 { &hf_rr_pkt_freq_prm_arfcn
,
2288 { "ARFCN", "gmr1.rr.pkt_freq_prm.arfcn",
2289 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
2292 { &hf_rr_pkt_freq_prm_dl_freq_plan_id
,
2293 { "Downlink Freq. Plan ID", "gmr1.rr.pkt_freq_prm.dl_freq_plan_id",
2294 FT_UINT8
, BASE_DEC
, VALS(rr_pkt_freq_prm_dl_freq_plan_id_vals
), 0x08,
2297 { &hf_rr_pkt_freq_prm_dl_bw
,
2298 { "Downlink Bandwidth", "gmr1.rr.pkt_freq_prm.dl_bw",
2299 FT_UINT8
, BASE_CUSTOM
, CF_FUNC(rr_pkt_freq_prm_xx_bw_fmt
), 0x70,
2302 { &hf_rr_pkt_freq_prm_ul_freq_dist
,
2303 { "Uplink Freq. Distance", "gmr1.rr.pkt_freq_prm.ul_freq_dist",
2304 FT_INT8
, BASE_DEC
, NULL
, 0x00,
2307 { &hf_rr_pkt_freq_prm_ul_bw
,
2308 { "Uplink Bandwidth", "gmr1.rr.pkt_freq_prm.ul_bw",
2309 FT_UINT8
, BASE_CUSTOM
, CF_FUNC(rr_pkt_freq_prm_xx_bw_fmt
), 0x70,
2312 { &hf_rr_pkt_freq_prm_spare
,
2313 { "Spare", "gmr1.rr.pkt_freq_prm.spare",
2314 FT_UINT8
, BASE_DEC
, NULL
, 0x80,
2317 { &hf_rr_pkt_imm_ass_2_prm_ac_spare1
,
2318 { "Spare", "gmr1.rr.pkt_imm_ass_2_prm.ac.spare1",
2319 FT_UINT8
, BASE_DEC
, NULL
, 0x01,
2322 { &hf_rr_pkt_imm_ass_2_prm_ac_final_alloc
,
2323 { "Final Allocation", "gmr1.rr.pkt_imm_ass_2_prm.ac.final_alloc",
2324 FT_UINT8
, BASE_DEC
, NULL
, 0x02,
2327 { &hf_rr_pkt_imm_ass_2_prm_ac_usf_granularity
,
2328 { "USF Granularity", "gmr1.rr.pkt_imm_ass_2_prm.ac.usf_granularity",
2329 FT_UINT8
, BASE_DEC
, NULL
, 0x04,
2332 { &hf_rr_pkt_imm_ass_2_prm_ac_dl_ctl_mac_slot
,
2333 { "Downlink Control MAC-slot", "gmr1.rr.pkt_imm_ass_2_prm.ac.dl_ctl_mac_slot",
2334 FT_UINT8
, BASE_DEC
, NULL
, 0x38,
2337 { &hf_rr_pkt_imm_ass_2_prm_ac_mac_mode
,
2338 { "MAC mode", "gmr1.rr.pkt_imm_ass_2_prm.ac.mac_mode",
2339 FT_UINT8
, BASE_DEC
, VALS(rr_pkt_imm_ass_2_prm_ac_mac_mode_vals
), 0xc0,
2342 { &hf_rr_pkt_imm_ass_2_prm_ac_start_fn
,
2343 { "Starting Frame Number", "gmr1.rr.pkt_imm_ass_2_prm.ac.start_fn",
2344 FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
2347 { &hf_rr_pkt_imm_ass_2_prm_ac_rlc_dblk_gnt
,
2348 { "RLC Data Blocks Granted", "gmr1.rr.pkt_imm_ass_2_prm.ac.rlc_dblk_gnt",
2349 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2352 { &hf_rr_pkt_imm_ass_2_prm_ac_mcs
,
2353 { "MCS", "gmr1.rr.pkt_imm_ass_2_prm.ac.mcs",
2354 FT_UINT8
, BASE_DEC
, NULL
, 0xf8,
2357 { &hf_rr_pkt_imm_ass_2_prm_ac_tfi
,
2358 { "TFI", "gmr1.rr.pkt_imm_ass_2_prm.ac.tfi",
2359 FT_UINT8
, BASE_HEX
, NULL
, 0x7f,
2362 { &hf_rr_pkt_imm_ass_2_prm_ac_spare2
,
2363 { "Spare", "gmr1.rr.pkt_imm_ass_2_prm.ac.spare2",
2364 FT_UINT8
, BASE_HEX
, NULL
, 0x80,
2367 { &hf_rr_pkt_imm_ass_2_prm_ac_mac_slot_alloc
,
2368 { "MAC-slot Allocation", "gmr1.rr.pkt_imm_ass_2_prm.ac.mac_slot_alloc",
2369 FT_UINT8
, BASE_HEX
, NULL
, 0xff,
2370 "LSB=slot 0, MSB=slot 7", HFILL
}
2372 { &hf_rr_pkt_imm_ass_2_prm_d_chan_mcs_cmd
,
2373 { "Channel MCS Command", "gmr1.rr.pkt_imm_ass_2_prm.d.chan_mcs_cmd",
2374 FT_UINT8
, BASE_HEX
, NULL
, 0x0f,
2377 { &hf_rr_pkt_imm_ass_2_prm_d_chan_mcs_cmd_pnb512
,
2378 { "Channel MCS Command PNB 5,12", "gmr1.rr.pkt_imm_ass_2_prm.d.chan_mcs_cmd_pnb512",
2379 FT_UINT8
, BASE_HEX
, NULL
, 0xf0,
2382 { &hf_rr_pkt_imm_ass_2_prm_d_spare1
,
2383 { "Spare", "gmr1.rr.pkt_imm_ass_2_prm.d.spare1",
2384 FT_UINT8
, BASE_HEX
, NULL
, 0xff,
2387 { &hf_rr_pkt_imm_ass_2_prm_d_rlc_dblk_gnt
,
2388 { "RLC Data Blocks Granted", "gmr1.rr.pkt_imm_ass_2_prm.d.rlc_dblk_gnt",
2389 FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
2392 { &hf_rr_pkt_imm_ass_2_prm_d_spare2
,
2393 { "Spare", "gmr1.rr.pkt_imm_ass_2_prm.d.spare2",
2394 FT_UINT8
, BASE_HEX
, NULL
, 0x80,
2397 { &hf_rr_pkt_imm_ass_2_prm_d_tfi
,
2398 { "TFI", "gmr1.rr.pkt_imm_ass_2_prm.d.tfi",
2399 FT_UINT8
, BASE_HEX
, NULL
, 0x7f,
2402 { &hf_rr_pkt_imm_ass_2_prm_d_usf_granularity
,
2403 { "USF Granularity", "gmr1.rr.pkt_imm_ass_2_prm.ac.usf_granularity",
2404 FT_UINT8
, BASE_DEC
, NULL
, 0x80,
2407 { &hf_rr_pkt_imm_ass_2_prm_d_mac_slot_alloc
,
2408 { "MAC-slot Allocation", "gmr1.rr.pkt_imm_ass_2_prm.d.mac_slot_alloc",
2409 FT_UINT8
, BASE_HEX
, NULL
, 0xff,
2410 "LSB=slot 0, MSB=slot 7", HFILL
}
2413 { "Uplink state flag (USF)", "gmr1.rr.usf.value",
2414 FT_UINT8
, BASE_HEX
, NULL
, 0x3f,
2418 { "Spare", "gmr1.rr.usf.spare",
2419 FT_UINT24
, BASE_DEC
, NULL
, 0xffffc0,
2422 { &hf_rr_timing_adv_idx_value
,
2423 { "TAI Value", "gmr1.rr.timing_adv_idx.tai",
2424 FT_UINT8
, BASE_DEC
, NULL
, 0x7f,
2427 { &hf_rr_timing_adv_idx_spare
,
2428 { "Spare", "gmr1.rr.timing_adv_idx.spare",
2429 FT_UINT8
, BASE_DEC
, NULL
, 0x80,
2433 { "TLLI", "gmr1.rr.tlli",
2434 FT_UINT32
, BASE_HEX
, NULL
, 0x00,
2437 { &hf_rr_pkt_pwr_ctrl_prm_par
,
2438 { "Power Attenuation Request (PAR)", "gmr1.rr.pkt_pwr_ctrl_prm.par",
2439 FT_UINT8
, BASE_CUSTOM
, CF_FUNC(rr_pkt_pwr_ctrl_prm_par_fmt
), 0x3f,
2442 { &hf_rr_pkt_pwr_ctrl_prm_spare
,
2443 { "Spare", "gmr1.rr.pkt_pwr_ctrl_prm.spare",
2444 FT_UINT8
, BASE_DEC
, NULL
, 0xc0,
2447 { &hf_rr_persistence_lvl
[0],
2448 { "for Radio priority 1", "gmr1.rr.persistence_lvl.p1",
2449 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
2452 { &hf_rr_persistence_lvl
[1],
2453 { "for Radio priority 2", "gmr1.rr.persistence_lvl.p2",
2454 FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
2457 { &hf_rr_persistence_lvl
[2],
2458 { "for Radio priority 3", "gmr1.rr.persistence_lvl.p3",
2459 FT_UINT8
, BASE_DEC
, NULL
, 0xf0,
2462 { &hf_rr_persistence_lvl
[3],
2463 { "for Radio priority 4", "gmr1.rr.persistence_lvl.p4",
2464 FT_UINT8
, BASE_DEC
, NULL
, 0x0f,
2467 { &hf_rr_protocol_discriminator
,
2468 { "Protocol Discriminator", "gmr1.rr.protocol_discriminator",
2469 FT_UINT8
, BASE_DEC
, VALS(gmr1_pd_vals
), 0x0,
2472 { &hf_rr_message_elements
,
2473 { "Message elements", "gmr1.rr.message_elements",
2474 FT_BYTES
, BASE_NONE
, NULL
, 0x0,
2479 static ei_register_info ei
[] = {
2480 { &ei_gmr1_missing_mandatory_element
, { "gmr1.rr.missing_mandatory_element", PI_PROTOCOL
, PI_ERROR
, "Missing Mandatory element, rest of dissection is suspect", EXPFILL
}},
2483 expert_module_t
* expert_gmr1_rr
;
2485 #define NUM_INDIVIDUAL_ELEMS 2
2486 static int *ett
[NUM_INDIVIDUAL_ELEMS
+
2490 unsigned int last_offset
, i
;
2492 /* Setup protocol subtree array */
2493 ett
[0] = &ett_msg_ccch
;
2494 ett
[1] = &ett_rr_pd
;
2496 last_offset
= NUM_INDIVIDUAL_ELEMS
;
2498 for (i
=0; i
<NUM_GMR1_IE_RR
; i
++,last_offset
++) {
2499 ett
[last_offset
] = &ett_gmr1_ie_rr
[i
];
2502 for (i
=0; i
<NUM_GMR1_MSG_RR
; i
++,last_offset
++) {
2503 ett
[last_offset
] = &ett_msg_rr
[i
];
2506 proto_register_subtree_array(ett
, array_length(ett
));
2508 /* Register the protocol name and field description */
2509 proto_gmr1_rr
= proto_register_protocol("GEO-Mobile Radio (1) RR", "GMR-1 RR", "gmr1.rr");
2511 proto_register_field_array(proto_gmr1_rr
, hf
, array_length(hf
));
2513 expert_gmr1_rr
= expert_register_protocol(proto_gmr1_rr
);
2514 expert_register_field_array(expert_gmr1_rr
, ei
, array_length(ei
));
2516 /* Register the protocol name and field description */
2517 proto_gmr1_ccch
= proto_register_protocol("GEO-Mobile Radio (1) CCCH", "GMR-1 CCCH", "gmr1.ccch");
2519 /* Register dissector */
2520 register_dissector("gmr1_ccch", dissect_gmr1_ccch
, proto_gmr1_ccch
);
2524 * Editor modelines - https://www.wireshark.org/tools/modelines.html
2529 * indent-tabs-mode: t
2532 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
2533 * :indentSize=8:tabSize=8:noTabs=false: