Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-fp_hint.c
blob4a6f6ebd68b8b71e39911efb442bc94608dc510a
1 /* Routines for UMTS FP Hint protocol disassembly
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #include "config.h"
13 #include <epan/packet.h>
14 #include <wiretap/wtap.h>
15 #include <epan/tfs.h>
16 #include <epan/expert.h>
17 #include <epan/proto_data.h>
18 #include "packet-umts_fp.h"
19 #include "packet-umts_mac.h"
20 #include "packet-umts_rlc.h"
22 void proto_register_fp_hint(void);
23 void proto_reg_handoff_fp_hint(void);
25 static int proto_fp_hint;
26 extern int proto_fp;
27 extern int proto_umts_mac;
28 extern int proto_umts_rlc;
30 static int ett_fph;
31 static int ett_fph_rb;
32 static int ett_fph_ddi_entry;
33 static int ett_fph_tf;
35 static int hf_fph_frametype;
36 static int hf_fph_channeltype;
37 static int hf_fph_chcnt;
38 static int hf_fph_dchid;
39 static int hf_fph_urnti;
40 static int hf_fph_rlcmode;
41 static int hf_fph_content;
42 static int hf_fph_rbid;
43 static int hf_fph_ctmux;
44 static int hf_fph_ciphered;
45 static int hf_fph_deciphered;
46 static int hf_fph_macdflowid;
47 static int hf_fph_macehs;
48 static int hf_fph_rb;
49 static int hf_fph_ddi_entry;
50 static int hf_fph_ddi_size;
51 static int hf_fph_ddi_logical;
52 static int hf_fph_ddi_value;
53 static int hf_fph_tf;
54 static int hf_fph_tf_n;
55 static int hf_fph_tf_size;
57 static expert_field ei_fph_radio_bearers;
58 static expert_field ei_fph_mac_frames;
59 static expert_field ei_fph_fp_channels;
61 static dissector_handle_t data_handle;
62 static dissector_handle_t ethwithfcs_handle;
63 static dissector_handle_t atm_untrunc_handle;
65 enum fph_ctype {
66 FPH_CHANNEL_PCH,
67 FPH_CHANNEL_RACH,
68 FPH_CHANNEL_FACH,
69 FPH_CHANNEL_DCH,
70 FPH_CHANNEL_HSDSCH,
71 FPH_CHANNEL_EDCH
74 enum fph_frame {
75 FPH_FRAME_ATM_AAL2,
76 FPH_FRAME_ETHERNET
79 enum fph_pich {
80 FPH_PICH18,
81 FPH_PICH36,
82 FPH_PICH72,
83 FPH_PICH144
86 enum fph_content {
87 FPH_CONTENT_UNKNOWN,
88 FPH_CONTENT_DCCH,
89 FPH_CONTENT_PS_DTCH,
90 FPH_CONTENT_CS_DTCH
93 static const value_string fph_frametype_vals[] = {
94 { FPH_FRAME_ATM_AAL2, "ATM AAL2" },
95 { FPH_FRAME_ETHERNET, "Ethernet" },
96 { 0, NULL }
99 static const value_string fph_channeltype_vals[] = {
100 { FPH_CHANNEL_PCH, "PCH" },
101 { FPH_CHANNEL_RACH, "RACH" },
102 { FPH_CHANNEL_FACH, "FACH" },
103 { FPH_CHANNEL_DCH, "DCH" },
104 { FPH_CHANNEL_HSDSCH, "HSDSCH" },
105 { FPH_CHANNEL_EDCH, "E-DCH" },
106 { 0, NULL }
109 static const value_string fph_rlcmode_vals[] = {
110 { RLC_TM, "Transparent Mode" },
111 { RLC_UM, "Unacknowledged Mode" },
112 { RLC_AM, "Acknowledged Mode" },
113 { 0, NULL }
116 static const value_string fph_content_vals[] = {
117 { FPH_CONTENT_UNKNOWN, "Unknown" },
118 { FPH_CONTENT_DCCH, "DCCH" },
119 { FPH_CONTENT_PS_DTCH, "PS DTCH" },
120 { FPH_CONTENT_CS_DTCH, "PS DTCH" },
121 { 0, NULL }
124 static const true_false_string fph_ctmux_vals = {
125 "C/T Mux field present", "C/T Mux field not present"
128 static const true_false_string fph_ciphered_vals = {
129 "Ciphered", "Not ciphered"
132 static const true_false_string fph_deciphered_vals = {
133 "Deciphered", "Not deciphered"
136 static uint16_t assign_rb_info(tvbuff_t *tvb, packet_info *pinfo, uint16_t offset, uint8_t rbcnt, proto_tree *tree)
138 uint8_t i = 0, next_byte;
139 uint8_t rlc_mode, content, rb_id, ctmux, ciphered, deciphered;
140 uint32_t urnti;
141 struct umts_mac_info *macinf;
142 struct rlc_info *rlcinf;
144 macinf = (umts_mac_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0);
145 rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0);
146 if (!macinf) {
147 macinf = wmem_new0(wmem_file_scope(), struct umts_mac_info);
148 p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf);
150 if (!rlcinf) {
151 rlcinf = wmem_new0(wmem_file_scope(), struct rlc_info);
152 p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf);
155 while (i < rbcnt) {
156 urnti = tvb_get_letohl(tvb, offset);
157 next_byte = tvb_get_uint8(tvb, offset + 4);
158 rlc_mode = next_byte & 0x3;
159 content = (next_byte >> 2) & 0x3;
160 rb_id = next_byte >> 4;
161 next_byte = tvb_get_uint8(tvb, offset + 5);
162 rb_id |= (next_byte & 0x01) << 4;
163 ctmux = (next_byte >> 1) & 0x1;
164 ciphered = (next_byte >> 2) & 0x1;
165 deciphered = (next_byte >> 3) & 0x1;
167 if (i >= MAX_RLC_CHANS) {
168 proto_tree_add_expert_format(tree, pinfo, &ei_fph_radio_bearers, tvb, offset, -1,
169 "Frame contains more Radio Bearers than currently supported (%u present, %u supported)",
170 rbcnt, MAX_RLC_CHANS);
171 return -1;
173 if (i >= MAX_MAC_FRAMES) {
174 proto_tree_add_expert_format(tree, pinfo, &ei_fph_mac_frames, tvb, offset, -1,
175 "Frame contains more MAC Frames than currently supported (%u present, %u supported)",
176 rbcnt, MAX_MAC_FRAMES);
177 return -1;
180 rlcinf->mode[i] = rlc_mode;
181 rlcinf->rbid[i] = rb_id;
182 rlcinf->ueid[i] = urnti;
183 rlcinf->ciphered[i] = ciphered;
184 rlcinf->deciphered[i] = deciphered;
185 rlcinf->li_size[i] = RLC_LI_VARIABLE;
187 macinf->ctmux[i] = ctmux ? true : false;
188 switch (content) {
189 case FPH_CONTENT_DCCH:
190 macinf->content[i] = MAC_CONTENT_DCCH;
191 break;
192 case FPH_CONTENT_PS_DTCH:
193 macinf->content[i] = MAC_CONTENT_PS_DTCH;
194 break;
195 case FPH_CONTENT_CS_DTCH:
196 macinf->content[i] = MAC_CONTENT_CS_DTCH;
197 break;
198 default:
199 macinf->content[i] = MAC_CONTENT_UNKNOWN;
202 if (tree) {
203 proto_tree *subtree;
204 proto_item *pi;
206 pi = proto_tree_add_item(tree, hf_fph_rb, tvb, offset, 8, ENC_NA);
207 subtree = proto_item_add_subtree(pi, ett_fph_rb);
209 if (urnti)
210 proto_tree_add_uint(subtree, hf_fph_urnti, tvb, offset, 4, urnti);
211 proto_tree_add_bits_item(subtree, hf_fph_content, tvb, (offset+4)*8+4, 2, ENC_LITTLE_ENDIAN);
212 proto_tree_add_bits_item(subtree, hf_fph_rlcmode, tvb, (offset+4)*8+6, 2, ENC_LITTLE_ENDIAN);
213 proto_tree_add_item(subtree, hf_fph_rbid, tvb, (offset+4), 2, ENC_LITTLE_ENDIAN);
214 proto_tree_add_boolean(subtree, hf_fph_ctmux, tvb, offset+5, 1, ctmux);
215 proto_tree_add_boolean(subtree, hf_fph_ciphered, tvb, offset+5, 1, ciphered);
216 proto_tree_add_boolean(subtree, hf_fph_deciphered, tvb, offset+5, 1, deciphered);
218 offset += 8;
219 i++;
221 return offset;
224 static void assign_fph_pch(tvbuff_t *tvb, packet_info *pinfo _U_, uint16_t offset, fp_info *fpi, proto_tree *tree _U_)
226 uint8_t pich;
227 uint16_t blkcnt, blksz;
228 const uint8_t *hdr;
230 fpi->channel = CHANNEL_PCH;
232 hdr = tvb_get_ptr(tvb, offset, 4);
233 blkcnt = hdr[0] | ((hdr[1] & 0x01) << 8);
234 blksz = (hdr[1] >> 1) | ((hdr[2] & 0x3f) << 7);
235 pich = (hdr[2] >> 6) | ((hdr[3] & 0x01) << 2);
237 switch (pich) {
238 case FPH_PICH18:
239 fpi->paging_indications = 18;
240 break;
241 case FPH_PICH36:
242 fpi->paging_indications = 36;
243 break;
244 case FPH_PICH72:
245 fpi->paging_indications = 72;
246 break;
247 case FPH_PICH144:
248 fpi->paging_indications = 144;
249 break;
250 default:
251 fpi->paging_indications = 0;
253 fpi->num_chans = 1;
254 fpi->chan_tf_size[0] = blksz;
255 fpi->chan_num_tbs[0] = blkcnt;
258 static void assign_fph_rach(tvbuff_t *tvb, packet_info *pinfo, uint16_t offset, fp_info *fpi, proto_tree *tree)
260 const uint8_t *hdr;
261 uint8_t rbcnt;
262 uint16_t blkcnt, blksz;
264 fpi->channel = CHANNEL_RACH_FDD;
266 hdr = tvb_get_ptr(tvb, offset, 4);
267 blkcnt = hdr[0] | ((hdr[1] & 0x01) << 8);
268 blksz = (hdr[1] >> 1) | ((hdr[2] & 0x3f) << 7);
270 fpi->num_chans = 1;
271 fpi->chan_tf_size[0] = blksz;
272 fpi->chan_num_tbs[0] = blkcnt;
274 offset += 4;
275 rbcnt = tvb_get_uint8(tvb, offset); offset++;
276 if (rbcnt > 0)
277 /*offset =*/ assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
280 static void assign_fph_dch(tvbuff_t *tvb, packet_info *pinfo, uint16_t offset, fp_info *fpi, proto_tree *tree)
282 uint8_t dch_id, rbcnt;
283 uint16_t N, size;
284 uint32_t cnt, i = 0;
285 const uint8_t *hdr;
286 proto_tree *subtree;
287 proto_item *pi;
289 fpi->channel = CHANNEL_DCH;
290 cnt = tvb_get_uint8(tvb, offset); offset++;
292 if (tree)
293 proto_tree_add_uint(tree, hf_fph_chcnt, tvb, offset-1, 1, cnt);
295 fpi->num_chans = cnt;
296 fpi->dch_crc_present = 1;
297 while (i < cnt) {
298 pi = proto_tree_add_item(tree, hf_fph_tf, tvb, offset, 4, ENC_NA);
299 subtree = proto_item_add_subtree(pi, ett_fph_rb);
300 hdr = tvb_get_ptr(tvb, offset, 4);
301 dch_id = (hdr[0] & 0x1f) + 1;
303 N = ((hdr[1] & 0x3f)<<3) | (hdr[0] >> 5);
304 size = ((hdr[3] & 0x07)<<10) | (hdr[2] << 2) | ((hdr[1] & 0xc0)>>6);
305 size = size == 0x1fff ? 0 : size;
307 fpi->chan_tf_size[i] = size;
308 fpi->chan_num_tbs[i] = N;
310 if (subtree) {
311 proto_tree_add_uint(subtree, hf_fph_dchid, tvb, offset, 1, dch_id);
312 proto_tree_add_uint(subtree, hf_fph_tf_n, tvb, offset, 2, N);
313 if (size)
314 proto_tree_add_uint(subtree, hf_fph_tf_size, tvb, offset + 1, 3, size);
316 offset += 4;
317 if (i > MAX_FP_CHANS) {
318 proto_tree_add_expert_format(tree, pinfo, &ei_fph_fp_channels, tvb, offset, -1,
319 "Frame contains more FP channels than currently supported (%u supported)",
320 MAX_FP_CHANS);
321 return;
323 i++;
325 rbcnt = tvb_get_uint8(tvb, offset); offset++;
326 if (rbcnt > 0)
327 /*offset =*/ assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
330 static void assign_fph_fach(tvbuff_t *tvb, packet_info *pinfo, uint16_t offset, fp_info *fpi, proto_tree *tree)
332 const uint8_t *hdr;
333 uint8_t rbcnt;
334 uint16_t blkcnt, blksz;
336 fpi->channel = CHANNEL_FACH_FDD;
338 hdr = tvb_get_ptr(tvb, offset, 4);
339 blkcnt = hdr[0] | ((hdr[1] & 0x01) << 8);
340 blksz = (hdr[1] >> 1) | ((hdr[2] & 0x3f) << 7);
342 fpi->num_chans = 1;
343 fpi->chan_tf_size[0] = blksz;
344 fpi->chan_num_tbs[0] = blkcnt;
346 offset += 4;
347 rbcnt = tvb_get_uint8(tvb, offset); offset++;
348 if (rbcnt > 0)
349 /*offset =*/ assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
352 static void assign_fph_hsdsch(tvbuff_t *tvb, packet_info *pinfo, uint16_t offset, fp_info *fpi, proto_tree *tree)
354 uint8_t rbcnt, hsdsch_info;
356 hsdsch_info = tvb_get_uint8(tvb, offset);
357 fpi->hsdsch_entity = hsdsch_info & 0x08 ? ehs : hs;
358 fpi->channel = CHANNEL_HSDSCH;
360 if (tree) {
361 proto_tree_add_bits_item(tree, hf_fph_macehs, tvb,
362 offset*8+4, 1, ENC_LITTLE_ENDIAN);
363 proto_tree_add_bits_item(tree, hf_fph_macdflowid, tvb,
364 offset*8+5, 3, ENC_LITTLE_ENDIAN);
367 offset++;
368 rbcnt = tvb_get_uint8(tvb, offset); offset++;
369 if (rbcnt > 0)
370 /*offset =*/ assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
373 static void assign_fph_edch(tvbuff_t *tvb, packet_info *pinfo, uint16_t offset, fp_info *fpi, proto_tree *tree)
375 uint8_t rbcnt, macdflow_id, maces_cnt, i = 0;
376 uint8_t logical, ddi;
377 uint16_t maces_size;
378 proto_item *pi;
379 proto_tree *subtree = NULL;
381 fpi->channel = CHANNEL_EDCH;
382 macdflow_id = tvb_get_uint8(tvb, offset);
384 if (tree) {
385 proto_tree_add_uint(tree, hf_fph_macdflowid, tvb, offset, 1, macdflow_id);
388 offset++;
389 maces_cnt = tvb_get_uint8(tvb, offset); offset++;
391 fpi->no_ddi_entries = maces_cnt;
392 while (i < maces_cnt) {
393 ddi = tvb_get_uint8(tvb, offset++);
394 logical = tvb_get_uint8(tvb, offset++);
395 maces_size = tvb_get_letohs(tvb, offset);
396 offset += 2;
397 fpi->edch_ddi[i] = ddi;
398 fpi->edch_macd_pdu_size[i] = maces_size;
399 if (tree) {
400 pi = proto_tree_add_item(tree, hf_fph_ddi_entry, tvb, offset - 4, 4, ENC_NA);
401 subtree = proto_item_add_subtree(pi, ett_fph_ddi_entry);
402 proto_tree_add_uint(subtree, hf_fph_ddi_value, tvb, offset - 4, 1, ddi);
403 proto_tree_add_uint(subtree, hf_fph_ddi_logical, tvb, offset - 3, 1, logical);
404 proto_tree_add_uint(subtree, hf_fph_ddi_size, tvb, offset - 2, 2, maces_size);
406 i++;
407 if (i >= MAX_EDCH_DDIS) {
408 proto_tree_add_expert_format(tree, pinfo, &ei_fph_fp_channels, tvb, offset, -1,
409 "Frame contains more FP channels than currently supported (%u supported)",
410 MAX_FP_CHANS);
411 return;
416 rbcnt = tvb_get_uint8(tvb, offset); offset++;
417 if (rbcnt > 0)
418 /*offset =*/ assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
421 static void attach_info(tvbuff_t *tvb, packet_info *pinfo, uint16_t offset, uint8_t channel_type, uint8_t frame_type, proto_tree *tree)
423 fp_info *fpi;
425 fpi = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
426 if (!fpi) {
427 fpi = wmem_new0(wmem_file_scope(), fp_info);
428 p_add_proto_data(wmem_file_scope(), pinfo, proto_fp, 0, fpi);
431 fpi->is_uplink = pinfo->p2p_dir == P2P_DIR_RECV;
432 /* TODO make this configurable */
433 fpi->release = 7;
434 fpi->release_year = 2008;
435 fpi->release_month = 9;
436 fpi->dch_crc_present = 1;
438 switch (frame_type) {
439 case FPH_FRAME_ATM_AAL2:
440 fpi->link_type = FP_Link_ATM;
441 break;
442 case FPH_FRAME_ETHERNET:
443 fpi->link_type = FP_Link_Ethernet;
444 break;
445 default:
446 fpi->link_type = FP_Link_Unknown;
449 /* at the moment, only IuB is supported */
450 fpi->iface_type = IuB_Interface;
451 /* at the moment, only FDD is supported */
452 fpi->division = Division_FDD;
454 switch (channel_type) {
455 case FPH_CHANNEL_PCH:
456 assign_fph_pch(tvb, pinfo, offset, fpi, tree);
457 break;
458 case FPH_CHANNEL_RACH:
459 assign_fph_rach(tvb, pinfo, offset, fpi, tree);
460 break;
461 case FPH_CHANNEL_FACH:
462 assign_fph_fach(tvb, pinfo, offset, fpi, tree);
463 break;
464 case FPH_CHANNEL_DCH:
465 assign_fph_dch(tvb, pinfo, offset, fpi, tree);
466 break;
467 case FPH_CHANNEL_HSDSCH:
468 assign_fph_hsdsch(tvb, pinfo, offset, fpi, tree);
469 break;
470 case FPH_CHANNEL_EDCH:
471 assign_fph_edch(tvb, pinfo, offset, fpi, tree);
472 break;
473 default:
474 fpi->channel = 0;
478 static int dissect_fp_hint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
480 uint8_t frame_type, channel_type;
481 uint16_t hdrlen;
482 uint32_t atm_hdr, aal2_ext;
483 tvbuff_t *next_tvb;
484 dissector_handle_t next_dissector;
485 void *next_dissector_data;
486 proto_item *ti;
487 proto_tree *fph_tree = NULL;
488 struct atm_phdr atm_info;
490 col_set_str(pinfo->cinfo, COL_PROTOCOL, "FP Hint");
492 hdrlen = tvb_get_letohs(tvb, 0);
493 frame_type = tvb_get_uint8(tvb, 2);
494 channel_type = tvb_get_uint8(tvb, 3);
496 if (tree) {
497 ti = proto_tree_add_item(tree, proto_fp_hint, tvb, 0, hdrlen, ENC_NA);
498 fph_tree = proto_item_add_subtree(ti, ett_fph);
499 proto_tree_add_uint(fph_tree, hf_fph_frametype, tvb, 2, 1, frame_type);
500 proto_tree_add_uint(fph_tree, hf_fph_channeltype, tvb, 3, 1, channel_type);
503 /* attach FP, MAC, RLC information */
504 attach_info(tvb, pinfo, 4, channel_type, frame_type, fph_tree);
505 switch (frame_type) {
506 case FPH_FRAME_ATM_AAL2:
507 aal2_ext = tvb_get_ntohl(tvb, hdrlen); hdrlen += 4;
508 atm_hdr = tvb_get_ntohl(tvb, hdrlen); hdrlen += 4;
509 memset(&atm_info, 0, sizeof(atm_info));
510 atm_info.aal = AAL_2;
511 /* atm_info.flags = pinfo->p2p_dir; */
512 atm_info.flags = ATM_AAL2_NOPHDR;
513 atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
514 atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
515 atm_info.aal2_cid = aal2_ext & 0x000000ff;
516 atm_info.type = TRAF_UMTS_FP;
517 next_dissector = atm_untrunc_handle;
518 next_dissector_data = &atm_info;
519 break;
520 case FPH_FRAME_ETHERNET:
521 next_dissector = ethwithfcs_handle;
522 next_dissector_data = NULL;
523 break;
524 default:
525 next_dissector = data_handle;
526 next_dissector_data = NULL;
527 break;
530 next_tvb = tvb_new_subset_remaining(tvb, hdrlen);
531 call_dissector_with_data(next_dissector, next_tvb, pinfo, tree,
532 next_dissector_data);
533 return tvb_captured_length(tvb);
536 void
537 proto_register_fp_hint(void)
539 static hf_register_info hf[] = {
540 { &hf_fph_frametype, { "Frame Type", "fp_hint.frame_type", FT_UINT8, BASE_HEX, VALS(fph_frametype_vals), 0x0, NULL, HFILL } },
541 { &hf_fph_channeltype, { "Channel Type", "fp_hint.channel_type", FT_UINT8, BASE_HEX, VALS(fph_channeltype_vals), 0x0, NULL, HFILL } },
542 { &hf_fph_chcnt, { "Number of Channels", "fp_hint.num_chan", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
543 { &hf_fph_dchid, { "DCH ID", "fp_hint.dchid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
544 { &hf_fph_macdflowid, { "MACd Flow ID", "fp_hint.macdflowid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
545 { &hf_fph_macehs, { "MAC-ehs indicator", "fp_hint.mac_ehs", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL } },
546 /* traffic format details */
547 { &hf_fph_tf, { "Traffic Format", "fp_hint.tf", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
548 { &hf_fph_tf_n, { "N", "fp_hint.tf.n", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } },
549 { &hf_fph_tf_size, { "Size", "fp_hint.tf.size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } },
550 /* DDI information for E-DCH */
551 { &hf_fph_ddi_entry, { "DDI Entry", "fp_hint.ddi", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
552 { &hf_fph_ddi_value, { "DDI", "fp_hint.ddi.value", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
553 { &hf_fph_ddi_logical, { "Logical Channel ID", "fp_hint.ddi.logical", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
554 { &hf_fph_ddi_size, { "Size", "fp_hint.ddi.size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } },
555 /* radio bearer details */
556 { &hf_fph_rb, { "Radio Bearer", "fp_hint.rb", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } },
557 { &hf_fph_urnti, { "U-RNTI", "fp_hint.rb.urnti", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
558 { &hf_fph_content, { "Content", "fp_hint.rb.content", FT_UINT8, BASE_DEC, VALS(fph_content_vals), 0, NULL, HFILL } },
559 { &hf_fph_rlcmode, { "RLC Mode", "fp_hint.rb.rlc_mode", FT_UINT8, BASE_DEC, VALS(fph_rlcmode_vals), 0, NULL, HFILL } },
560 { &hf_fph_rbid, { "Radio Bearer ID", "fp_hint.rb.rbid", FT_UINT16, BASE_DEC, NULL, 0x01f0, NULL, HFILL } },
561 { &hf_fph_ctmux, { "C/T Mux", "fp_hint.rb.ctmux", FT_BOOLEAN, BASE_NONE, TFS(&fph_ctmux_vals), 0, "C/T Mux field", HFILL } },
562 { &hf_fph_ciphered, { "Ciphered", "fp_hint.rb.ciphered", FT_BOOLEAN, BASE_NONE, TFS(&fph_ciphered_vals), 0, "Ciphered flag", HFILL } },
563 { &hf_fph_deciphered, { "Deciphered", "fp_hint.rb.deciphered", FT_BOOLEAN, BASE_NONE, TFS(&fph_deciphered_vals), 0, "Deciphered flag", HFILL } }
566 static int *ett[] = {
567 &ett_fph,
568 &ett_fph_rb,
569 &ett_fph_ddi_entry,
570 &ett_fph_tf
573 static ei_register_info ei[] = {
574 { &ei_fph_radio_bearers, { "fp_hint.rb.invalid", PI_PROTOCOL, PI_WARN, "Frame contains more Radio Bearers than currently supported", EXPFILL }},
575 { &ei_fph_mac_frames, { "fp_hint.mac_frames.invalid", PI_PROTOCOL, PI_WARN, "Frame contains more MAC Frames than currently supported", EXPFILL }},
576 { &ei_fph_fp_channels, { "fp_hint.fp_channels.invalid", PI_PROTOCOL, PI_WARN, "Frame contains more FP channels than currently supported", EXPFILL }},
579 expert_module_t* expert_fp_hint;
581 proto_fp_hint = proto_register_protocol("FP Hint", "FP Hint", "fp_hint");
582 register_dissector("fp_hint", dissect_fp_hint, proto_fp_hint);
584 proto_register_field_array(proto_fp_hint, hf, array_length(hf));
585 proto_register_subtree_array(ett, array_length(ett));
586 expert_fp_hint = expert_register_protocol(proto_fp_hint);
587 expert_register_field_array(expert_fp_hint, ei, array_length(ei));
590 void
591 proto_reg_handoff_fp_hint(void)
593 atm_untrunc_handle = find_dissector_add_dependency("atm_untruncated", proto_fp_hint);
594 data_handle = find_dissector("data");
595 ethwithfcs_handle = find_dissector_add_dependency("eth_withfcs", proto_fp_hint);
600 * Editor modelines - https://www.wireshark.org/tools/modelines.html
602 * Local variables:
603 * c-basic-offset: 4
604 * tab-width: 8
605 * indent-tabs-mode: nil
606 * End:
608 * vi: set shiftwidth=4 tabstop=8 expandtab:
609 * :indentSize=4:tabSize=8:noTabs=true: