From Didier Gautheron:
[obnox/wireshark/wip.git] / epan / dissectors / packet-fp_hint.c
1 /* Routines for UMTS FP Hint protocol disassembly
2  *
3  * $Id$
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22  */
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31
32 #include <glib.h>
33 #include <epan/packet.h>
34 #include "packet-umts_fp.h"
35 #include "packet-umts_mac.h"
36 #include "packet-rlc.h"
37 #include "wiretap/erf.h"
38
39 static int proto_fp_hint = -1;
40 extern int proto_fp;
41 extern int proto_umts_mac;
42 extern int proto_rlc;
43
44 static int ett_fph = -1;
45 static int ett_fph_rb = -1;
46 static int ett_fph_ddi_entry = -1;
47 static int ett_fph_tf = -1;
48
49 static int hf_fph_frametype = -1;
50 static int hf_fph_channeltype = -1;
51 static int hf_fph_chcnt = -1;
52 static int hf_fph_dchid = -1;
53 static int hf_fph_urnti = -1;
54 static int hf_fph_rlcmode = -1;
55 static int hf_fph_content = -1;
56 static int hf_fph_rbid = -1;
57 static int hf_fph_ctmux = -1;
58 static int hf_fph_ciphered = -1;
59 static int hf_fph_deciphered = -1;
60 static int hf_fph_macdflowid = -1;
61 static int hf_fph_rb = -1;
62 static int hf_fph_ddi_entry = -1;
63 static int hf_fph_ddi_size = -1;
64 static int hf_fph_ddi_logical = -1;
65 static int hf_fph_ddi_value = -1;
66 static int hf_fph_tf = -1;
67 static int hf_fph_tf_n = -1;
68 static int hf_fph_tf_size = -1;
69
70 static dissector_handle_t data_handle;
71 static dissector_handle_t ethwithfcs_handle;
72 static dissector_handle_t atm_untrunc_handle;
73 static dissector_handle_t erf_handle;
74
75 enum fph_ctype {
76         FPH_CHANNEL_PCH,
77         FPH_CHANNEL_RACH,
78         FPH_CHANNEL_FACH,
79         FPH_CHANNEL_DCH,
80         FPH_CHANNEL_HSDSCH,
81         FPH_CHANNEL_EDCH
82 };
83
84 enum fph_frame {
85         FPH_FRAME_ERF_AAL2,
86         FPH_FRAME_ETHERNET
87 };
88
89 enum fph_pich {
90         FPH_PICH18,
91         FPH_PICH36,
92         FPH_PICH72,
93         FPH_PICH144
94 };
95
96 enum fph_content {
97         FPH_CONTENT_UNKNOWN,
98         FPH_CONTENT_DCCH,
99         FPH_CONTENT_PS_DTCH,
100         FPH_CONTENT_CS_DTCH
101 };
102
103 static const value_string fph_frametype_vals[] = {
104         { FPH_FRAME_ERF_AAL2,   "ERF AAL2" },
105         { FPH_FRAME_ETHERNET,   "Ethernet" },
106         { 0, NULL }
107 };
108
109 static const value_string fph_channeltype_vals[] = {
110         { FPH_CHANNEL_PCH,              "PCH" },
111         { FPH_CHANNEL_RACH,             "RACH" },
112         { FPH_CHANNEL_FACH,             "FACH" },
113         { FPH_CHANNEL_DCH,              "DCH" },
114         { FPH_CHANNEL_HSDSCH,   "HSDSCH" },
115         { FPH_CHANNEL_EDCH,             "E-DCH" },
116         { 0, NULL }
117 };
118
119 static const value_string fph_rlcmode_vals[] = {
120         { RLC_TM,                       "Transparent Mode" },
121         { RLC_UM,                       "Unacknowledged Mode" },
122         { RLC_AM,                       "Acknowledged Mode" },
123         { 0, NULL }
124 };
125
126 static const value_string fph_content_vals[] = {
127         { FPH_CONTENT_UNKNOWN,  "Unknown" },
128         { FPH_CONTENT_DCCH,             "DCCH" },
129         { FPH_CONTENT_PS_DTCH,  "PS DTCH" },
130         { FPH_CONTENT_CS_DTCH,  "PS DTCH" },
131         { 0, NULL }
132 };
133
134 static const true_false_string fph_ctmux_vals = {
135         "C/T Mux field present", "C/T Mux field not present"
136 };
137
138 static const true_false_string fph_ciphered_vals = {
139         "Ciphered", "Not ciphered"
140 };
141
142 static const true_false_string fph_deciphered_vals = {
143         "Deciphered", "Not deciphered"
144 };
145
146 static guint16 assign_rb_info(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, guint8 rbcnt, proto_tree *tree)
147 {
148         guint8 i = 0, next_byte;
149         guint8 rlc_mode, content, rb_id, ctmux, ciphered, deciphered;
150         guint32 urnti;
151         struct umts_mac_info *macinf;
152         struct rlc_info *rlcinf;
153
154         macinf = p_get_proto_data(pinfo->fd, proto_umts_mac);
155         rlcinf = p_get_proto_data(pinfo->fd, proto_rlc);
156         if (!macinf) {
157                 macinf = se_alloc0(sizeof(struct umts_mac_info));
158                 p_add_proto_data(pinfo->fd, proto_umts_mac, macinf);
159         }
160         if (!rlcinf) {
161                 rlcinf = se_alloc0(sizeof(struct rlc_info));
162                 p_add_proto_data(pinfo->fd, proto_rlc, rlcinf);
163         }
164
165         while (i < rbcnt) {
166                 urnti = tvb_get_letohl(tvb, offset);
167                 next_byte = tvb_get_guint8(tvb, offset + 4);
168                 rlc_mode = next_byte & 0x3;
169                 content = (next_byte >> 2) & 0x3;
170                 rb_id = next_byte >> 4;
171                 next_byte = tvb_get_guint8(tvb, offset + 5);
172                 rb_id |= (next_byte & 0x01) << 4;
173                 ctmux = (next_byte >> 1) & 0x1;
174                 ciphered = (next_byte >> 2) & 0x1;
175                 deciphered = (next_byte >> 3) & 0x1;
176
177                 if (i >= MAX_RLC_CHANS) {
178                         proto_item *pi;
179                         pi = proto_tree_add_text(tree, tvb, offset, -1,
180                                 "Frame contains more Radio Bearers than currently supported (%u present, %u supported)",
181                                 rbcnt, MAX_RLC_CHANS);
182                         return -1;
183                 }
184                 if (i >= MAX_MAC_FRAMES) {
185                         proto_item *pi;
186                         pi = proto_tree_add_text(tree, tvb, offset, -1,
187                                 "Frame contains more MAC Frames than currently supported (%u present, %u supported)",
188                                 rbcnt, MAX_MAC_FRAMES);
189                         return -1;
190                 }
191
192                 rlcinf->mode[i] = rlc_mode;
193                 rlcinf->rbid[i] = rb_id;
194                 rlcinf->urnti[i] = urnti;
195                 rlcinf->ciphered[i] = ciphered;
196                 rlcinf->deciphered[i] = deciphered;
197
198                 macinf->ctmux[i] = ctmux ? TRUE : FALSE;
199                 switch (content) {
200                         case FPH_CONTENT_DCCH:
201                                 macinf->content[i] = MAC_CONTENT_DCCH;
202                                 break;
203                         case FPH_CONTENT_PS_DTCH:
204                                 macinf->content[i] = MAC_CONTENT_PS_DTCH;
205                                 break;
206                         case FPH_CONTENT_CS_DTCH:
207                                 macinf->content[i] = MAC_CONTENT_CS_DTCH;
208                                 break;
209                         default:
210                                 macinf->content[i] = MAC_CONTENT_UNKNOWN;
211                 }
212
213                 if (tree) {
214                         proto_tree *subtree;
215                         proto_item *pi;
216
217                         pi = proto_tree_add_item(tree, hf_fph_rb, tvb, offset, 8, TRUE);
218                         subtree = proto_item_add_subtree(pi, ett_fph_rb);
219
220                         if (urnti)
221                                 proto_tree_add_uint(subtree, hf_fph_urnti, tvb, offset, 4, urnti);
222                         pi = proto_tree_add_bits_item(subtree, hf_fph_content, tvb, (offset+4)*8+4, 2, TRUE);
223                         pi = proto_tree_add_bits_item(subtree, hf_fph_rlcmode, tvb, (offset+4)*8+6, 2, TRUE);
224                         proto_tree_add_item(subtree, hf_fph_rbid, tvb, (offset+4), 2, TRUE);
225                         proto_tree_add_boolean(subtree, hf_fph_ctmux, tvb, offset+5, 1, ctmux);
226                         proto_tree_add_boolean(subtree, hf_fph_ciphered, tvb, offset+5, 1, ciphered);
227                         proto_tree_add_boolean(subtree, hf_fph_deciphered, tvb, offset+5, 1, deciphered);
228                 }
229                 offset += 8;
230                 i++;
231         }
232         return offset;
233 }
234
235 static void assign_fph_pch(tvbuff_t *tvb, packet_info *pinfo _U_, guint16 offset, fp_info *fpi, proto_tree *tree _U_)
236 {
237         guint8 pich;
238         guint16 blkcnt, blksz;
239         const guint8 *hdr;
240
241         fpi->channel = CHANNEL_PCH;
242
243         hdr = tvb_get_ptr(tvb, offset, 4);
244         blkcnt = hdr[0] | ((hdr[1] & 0x01) << 8);
245         blksz = (hdr[1] >> 1) | ((hdr[2] & 0x3f) << 7);
246         pich = (hdr[2] >> 6) | ((hdr[3] & 0x01) << 2);
247
248         switch (pich) {
249                 case FPH_PICH18:
250                         fpi->paging_indications = 18;
251                         break;
252                 case FPH_PICH36:
253                         fpi->paging_indications = 36;
254                         break;
255                 case FPH_PICH72:
256                         fpi->paging_indications = 72;
257                         break;
258                 case FPH_PICH144:
259                         fpi->paging_indications = 144;
260                         break;
261                 default:
262                         fpi->paging_indications = 0;
263         }
264         fpi->num_chans = 1;
265         fpi->chan_tf_size[0] = blksz;
266         fpi->chan_num_tbs[0] = blkcnt;
267 }
268
269 static void assign_fph_rach(tvbuff_t *tvb, packet_info *pinfo _U_, guint16 offset, fp_info *fpi, proto_tree *tree)
270 {
271         const guint8 *hdr;
272         guint8 rbcnt;
273         guint16 blkcnt, blksz;
274
275         fpi->channel = CHANNEL_RACH_FDD;
276
277         hdr = tvb_get_ptr(tvb, offset, 4);
278         blkcnt = hdr[0] | ((hdr[1] & 0x01) << 8);
279         blksz = (hdr[1] >> 1) | ((hdr[2] & 0x3f) << 7);
280
281         fpi->num_chans = 1;
282         fpi->chan_tf_size[0] = blksz;
283         fpi->chan_num_tbs[0] = blkcnt;
284
285         offset += 4;
286         rbcnt = tvb_get_guint8(tvb, offset); offset++;
287         if (rbcnt > 0)
288                 offset = assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
289 }
290
291 static void assign_fph_dch(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, fp_info *fpi, proto_tree *tree)
292 {
293         guint8 dch_id, rbcnt;
294         guint16 N, size;
295         guint32 cnt, i = 0;
296         const guint8 *hdr;
297         proto_tree *subtree;
298         proto_item *pi;
299
300         fpi->channel = CHANNEL_DCH;
301         cnt = tvb_get_guint8(tvb, offset); offset++;
302
303         if (tree)
304                 proto_tree_add_uint(tree, hf_fph_chcnt, tvb, offset-1, 1, cnt);
305
306         fpi->num_chans = cnt;
307         fpi->dch_crc_present = 1;
308         while (i < cnt) {
309                 pi = proto_tree_add_item(tree, hf_fph_tf, tvb, offset, 4, TRUE);
310                 subtree = proto_item_add_subtree(pi, ett_fph_rb);
311                 hdr = tvb_get_ptr(tvb, offset, 4);
312                 dch_id = hdr[0] & 0x1f;
313
314                 N = ((hdr[1] & 0x3f)<<3) | (hdr[0] >> 5);
315                 size = ((hdr[3] & 0x07)<<10) | (hdr[2] << 2) | ((hdr[1] & 0xc0)>>6);
316                 size = size == 0x1fff ? 0 : size;
317
318                 fpi->chan_tf_size[i] = size;
319                 fpi->chan_num_tbs[i] = N;
320
321                 if (subtree) {
322                         proto_tree_add_bits_item(subtree, hf_fph_dchid, tvb, offset*8+3, 5, TRUE);
323                         proto_tree_add_uint(subtree, hf_fph_tf_n, tvb, offset, 2, N);
324                         if (size)
325                                 proto_tree_add_uint(subtree, hf_fph_tf_size, tvb, offset + 1, 3, size);
326                 }
327                 offset += 4;
328                 if (i > MAX_FP_CHANS) {
329                         proto_item *pi;
330                         pi = proto_tree_add_text(tree, tvb, offset, -1,
331                                 "Frame contains more FP channels than currently supported (%u supported)",
332                                 MAX_FP_CHANS);
333                         return;
334                 }
335                 i++;
336         }
337         rbcnt = tvb_get_guint8(tvb, offset); offset++;
338         if (rbcnt > 0)
339                 offset = assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
340 }
341
342 static void assign_fph_fach(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, fp_info *fpi, proto_tree *tree)
343 {
344         const guint8 *hdr;
345         guint8 rbcnt;
346         guint16 blkcnt, blksz;
347
348         fpi->channel = CHANNEL_FACH_FDD;
349
350         hdr = tvb_get_ptr(tvb, offset, 4);
351         blkcnt = hdr[0] | ((hdr[1] & 0x01) << 8);
352         blksz = (hdr[1] >> 1) | ((hdr[2] & 0x3f) << 7);
353
354         fpi->num_chans = 1;
355         fpi->chan_tf_size[0] = blksz;
356         fpi->chan_num_tbs[0] = blkcnt;
357
358         offset += 4;
359         rbcnt = tvb_get_guint8(tvb, offset); offset++;
360         if (rbcnt > 0)
361                 offset = assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
362 }
363
364 static void assign_fph_hsdsch(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, fp_info *fpi, proto_tree *tree)
365 {
366         guint8 rbcnt, macdflow_id;
367
368         fpi->channel = CHANNEL_HSDSCH;
369         macdflow_id = tvb_get_guint8(tvb, offset);
370
371         if (tree)
372                 proto_tree_add_uint(tree, hf_fph_macdflowid, tvb, offset, 1, macdflow_id);
373
374         offset++;
375         rbcnt = tvb_get_guint8(tvb, offset); offset++;
376         if (rbcnt > 0)
377                 offset = assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
378 }
379
380 static void assign_fph_edch(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, fp_info *fpi, proto_tree *tree)
381 {
382         guint8 rbcnt, macdflow_id, maces_cnt, i = 0;
383         guint8 logical, ddi;
384         guint16 maces_size;
385         proto_item *pi;
386         proto_tree *subtree = NULL;
387
388         fpi->channel = CHANNEL_EDCH;
389         macdflow_id = tvb_get_guint8(tvb, offset);
390
391         if (tree) {
392                 proto_tree_add_uint(tree, hf_fph_macdflowid, tvb, offset, 1, macdflow_id);
393         }
394
395         offset++;
396         maces_cnt = tvb_get_guint8(tvb, offset); offset++;
397
398         fpi->no_ddi_entries = maces_cnt;
399         while (i < maces_cnt) {
400                 ddi = tvb_get_guint8(tvb, offset++);
401                 logical = tvb_get_guint8(tvb, offset++);
402                 maces_size = tvb_get_letohs(tvb, offset);
403                 offset += 2;
404                 fpi->edch_ddi[i] = ddi;
405                 fpi->edch_macd_pdu_size[i] = maces_size;
406                 if (tree) {
407                         pi = proto_tree_add_item(tree, hf_fph_ddi_entry, tvb, offset - 4, 4, TRUE);
408                         subtree = proto_item_add_subtree(pi, ett_fph_ddi_entry);
409                         proto_tree_add_uint(subtree, hf_fph_ddi_value, tvb, offset - 4, 1, ddi);
410                         proto_tree_add_uint(subtree, hf_fph_ddi_logical, tvb, offset - 3, 1, logical);
411                         proto_tree_add_uint(subtree, hf_fph_ddi_size, tvb, offset - 2, 2, maces_size);
412                 }
413                 i++;
414                 if (i >= MAX_EDCH_DDIS) {
415                         proto_item *pi;
416                         pi = proto_tree_add_text(tree, tvb, offset, -1,
417                                 "Frame contains more FP channels than currently supported (%u supported)",
418                                 MAX_FP_CHANS);
419                         return;
420                 }
421         }
422
423
424         rbcnt = tvb_get_guint8(tvb, offset); offset++;
425         if (rbcnt > 0)
426                 offset = assign_rb_info(tvb, pinfo, offset, rbcnt, tree);
427 }
428
429 static void attach_info(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, guint8 channel_type, guint8 frame_type, proto_tree *tree)
430 {
431         fp_info *fpi;
432
433         fpi = p_get_proto_data(pinfo->fd, proto_fp);
434         if (!fpi) {
435                 fpi = se_alloc0(sizeof(fp_info));
436                 p_add_proto_data(pinfo->fd, proto_fp, fpi);
437         }
438
439         fpi->is_uplink = pinfo->p2p_dir == P2P_DIR_RECV;
440         /* TODO make this configurable */
441         fpi->release = 6;
442         fpi->release_year = 2006;
443         fpi->release_month = 9;
444         fpi->dch_crc_present = 1;
445
446         switch (frame_type) {
447                 case FPH_FRAME_ERF_AAL2:
448                         fpi->link_type = FP_Link_ATM;
449                         break;
450                 case FPH_FRAME_ETHERNET:
451                         fpi->link_type = FP_Link_Ethernet;
452                         break;
453                 default:
454                         fpi->link_type = FP_Link_Unknown;
455         }
456
457         /* at the moment, only IuB is supported */
458         fpi->iface_type = IuB_Interface;
459         /* at the moment, only FDD is supported */
460         fpi->division = Division_FDD;
461
462         switch (channel_type) {
463                 case FPH_CHANNEL_PCH:
464                         assign_fph_pch(tvb, pinfo, offset, fpi, tree);
465                         break;
466                 case FPH_CHANNEL_RACH:
467                         assign_fph_rach(tvb, pinfo, offset, fpi, tree);
468                         break;
469                 case FPH_CHANNEL_FACH:
470                         assign_fph_fach(tvb, pinfo, offset, fpi, tree);
471                         break;
472                 case FPH_CHANNEL_DCH:
473                         assign_fph_dch(tvb, pinfo, offset, fpi, tree);
474                         break;
475                 case FPH_CHANNEL_HSDSCH:
476                         assign_fph_hsdsch(tvb, pinfo, offset, fpi, tree);
477                         break;
478                 case FPH_CHANNEL_EDCH:
479                         assign_fph_edch(tvb, pinfo, offset, fpi, tree);
480                         break;
481                 default:
482                         fpi->channel = 0;
483         }
484 }
485
486 static void dissect_fp_hint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
487 {
488         guint8 frame_type, channel_type;
489         guint16 hdrlen;
490 #if 0
491         guint32 atm_aal2_ext, atm_hdr;
492 #endif
493         tvbuff_t *next_tvb;
494         dissector_handle_t *next_dissector;
495         proto_item *ti;
496         proto_tree *fph_tree = NULL;
497
498         if (check_col(pinfo->cinfo, COL_PROTOCOL))
499                 col_set_str(pinfo->cinfo, COL_PROTOCOL, "FP Hint");
500
501         hdrlen = tvb_get_letohs(tvb, 0);
502         frame_type = tvb_get_guint8(tvb, 2);
503         channel_type = tvb_get_guint8(tvb, 3);
504
505         if (tree) {
506                 ti = proto_tree_add_item(tree, proto_fp_hint, tvb, 0, hdrlen, TRUE);
507                 fph_tree = proto_item_add_subtree(ti, ett_fph);
508                 proto_tree_add_uint(fph_tree, hf_fph_frametype, tvb, 2, 1, frame_type);
509                 proto_tree_add_uint(fph_tree, hf_fph_channeltype, tvb, 3, 1, channel_type);
510         }
511
512         /* attach FP, MAC, RLC information */
513         attach_info(tvb, pinfo, 4, channel_type, frame_type, fph_tree);
514         switch (frame_type) {
515                 case FPH_FRAME_ERF_AAL2:
516                         memset(&pinfo->pseudo_header->erf, 0, sizeof(pinfo->pseudo_header->erf));
517                         pinfo->pseudo_header->erf.phdr.type = ERF_TYPE_AAL2;
518                         /* store p2p direction in ERF flags */
519                         pinfo->pseudo_header->erf.phdr.flags |= pinfo->p2p_dir;
520                         /* set ATM properties */
521                         pinfo->pseudo_header->atm.type = TRAF_UMTS_FP;
522                         pinfo->pseudo_header->atm.subtype = TRAF_UNKNOWN;
523                         next_dissector = &erf_handle;
524                         break;
525                 case FPH_FRAME_ETHERNET:
526                         next_dissector = &ethwithfcs_handle;
527                         break;
528                 default:
529                         next_dissector = &data_handle;
530         }
531
532         next_tvb = tvb_new_subset(tvb, hdrlen, -1, -1);
533         call_dissector(*next_dissector, next_tvb, pinfo, tree);
534 }
535
536 void
537 proto_register_fp_hint(void)
538 {
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, "Frame Type", HFILL } },
541                 { &hf_fph_channeltype, { "Channel Type", "fp_hint.channel_type", FT_UINT8, BASE_HEX, VALS(fph_channeltype_vals), 0x0, "Channel Type", HFILL } },
542                 { &hf_fph_chcnt, { "Number of Channels", "fp_hint.num_chan", FT_UINT8, BASE_DEC, NULL, 0, "Number of Channels", HFILL } },
543                 { &hf_fph_dchid, { "DCH ID", "fp_hint.dchid", FT_UINT8, BASE_DEC, NULL, 0, "DCH ID", HFILL } },
544                 { &hf_fph_macdflowid, { "MACd Flow ID", "fp_hint.macdflowid", FT_UINT8, BASE_DEC, NULL, 0, "MACd Flow ID", HFILL } },
545                 /* traffic format details */
546                 { &hf_fph_tf, { "Traffic Format", "fp_hint.tf", FT_NONE, BASE_NONE, NULL, 0, "", HFILL } },
547                 { &hf_fph_tf_n, { "N", "fp_hint.tf.n", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL } },
548                 { &hf_fph_tf_size, { "Size", "fp_hintf.tf.size", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL } },
549                 /* DDI information for E-DCH */
550                 { &hf_fph_ddi_entry, { "DDI Entry", "fp_hint.ddi", FT_NONE, BASE_NONE, NULL, 0, "", HFILL } },
551                 { &hf_fph_ddi_value, { "DDI", "fp_hint.ddi.value", FT_UINT8, BASE_DEC, NULL, 0, "", HFILL } },
552                 { &hf_fph_ddi_logical, { "Logical Channel ID", "fp_hint.ddi.logical", FT_UINT8, BASE_DEC, NULL, 0, "", HFILL } },
553                 { &hf_fph_ddi_size, { "Size", "fp_hint.ddi.size", FT_UINT16, BASE_DEC, NULL, 0, "", HFILL } },
554                 /* radio bearer details */
555                 { &hf_fph_rb, { "Radio Bearer", "fp_hint.rb", FT_NONE, BASE_NONE, NULL, 0, "", HFILL } },
556                 { &hf_fph_urnti, { "U-RNTI", "fp_hint.rb.urnti", FT_UINT32, BASE_HEX, NULL, 0x0, "U-RNTI", HFILL } },
557                 { &hf_fph_content, { "Content", "fp_hint.rb.content", FT_UINT8, BASE_DEC, VALS(fph_content_vals), 0, "Content", HFILL } },
558                 { &hf_fph_rlcmode, { "RLC Mode", "fp_hint.rb.rlc_mode", FT_UINT8, BASE_DEC, VALS(fph_rlcmode_vals), 0, "RLC Mode", HFILL } },
559                 { &hf_fph_rbid, { "Radio Bearer ID", "fp_hint.rb.rbid", FT_UINT16, BASE_DEC, NULL, 0x01f0, "Radio Bearer ID", HFILL } },
560                 { &hf_fph_ctmux, { "C/T Mux", "fp_hint.rb.ctmux", FT_BOOLEAN, BASE_NONE, TFS(&fph_ctmux_vals), 0, "C/T Mux field", HFILL } },
561                 { &hf_fph_ciphered, { "Ciphered", "fp_hint.rb.ciphered", FT_BOOLEAN, BASE_NONE, TFS(&fph_ciphered_vals), 0, "Ciphered flag", HFILL } },
562                 { &hf_fph_deciphered, { "Deciphered", "fp_hint.rb.deciphered", FT_BOOLEAN, BASE_NONE, TFS(&fph_deciphered_vals), 0, "Deciphered flag", HFILL } }
563         };
564
565         static gint *ett[] = {
566                 &ett_fph,
567                 &ett_fph_rb,
568                 &ett_fph_ddi_entry,
569                 &ett_fph_tf
570         };
571
572         proto_fp_hint = proto_register_protocol("FP Hint", "FP Hint", "fp_hint");
573         register_dissector("fp_hint", dissect_fp_hint, proto_fp_hint);
574
575         proto_register_field_array(proto_fp_hint, hf, array_length(hf));
576         proto_register_subtree_array(ett, array_length(ett));
577 }
578
579 void
580 proto_reg_handoff_fp_hint(void)
581 {
582         atm_untrunc_handle = find_dissector("atm_untruncated");
583         data_handle = find_dissector("data");
584         ethwithfcs_handle = find_dissector("eth_withfcs");
585         erf_handle = find_dissector("erf");
586 }