2 * WiMax Fast Feedback packet decoder
4 * Copyright (c) 2007 by Intel Corporation.
6 * Author: Lu Pan <lu.pan@intel.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1999 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
19 #include <epan/packet.h>
20 #include "wimax-int.h"
22 extern int proto_wimax
;
24 static int proto_wimax_ffb_decoder
;
25 static int ett_wimax_ffb_decoder
;
27 /* static int hf_ffb_burst; */
28 static int hf_ffb_num_of_ffbs
;
29 static int hf_ffb_type
;
30 static int hf_ffb_subchannel
;
31 static int hf_ffb_symboloffset
;
32 static int hf_ffb_value
;
35 static int dissect_wimax_ffb_decoder(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
38 unsigned length
, num_of_ffbs
, i
;
39 proto_item
*ffb_item
= NULL
;
40 proto_tree
*ffb_tree
= NULL
;
42 /* update the info column */
43 col_append_sep_str(pinfo
->cinfo
, COL_INFO
, NULL
, "Fast Feedback Burst:");
45 { /* we are being asked for details */
46 /* get the tvb reported length */
47 length
= tvb_reported_length(tvb
);
48 /* display Fast Feedback Burst dissector info */
49 ffb_item
= proto_tree_add_protocol_format(tree
, proto_wimax_ffb_decoder
, tvb
, offset
, length
, "Fast Feedback Burst (%u bytes)", length
);
50 /* add Fast Feedback Burst subtree */
51 ffb_tree
= proto_item_add_subtree(ffb_item
, ett_wimax_ffb_decoder
);
52 /* get the number of FFBs */
53 num_of_ffbs
= tvb_get_uint8(tvb
, offset
);
54 /* display the number of FFBs */
55 proto_tree_add_item(ffb_tree
, hf_ffb_num_of_ffbs
, tvb
, offset
++, 1, ENC_BIG_ENDIAN
);
56 /* display the FFB type */
57 proto_tree_add_item(ffb_tree
, hf_ffb_type
, tvb
, offset
++, 1, ENC_BIG_ENDIAN
);
58 /* display the FFBs */
59 for(i
= 0; i
< num_of_ffbs
; i
++)
61 proto_tree_add_item(ffb_tree
, hf_ffb_subchannel
, tvb
, offset
++, 1, ENC_BIG_ENDIAN
);
62 proto_tree_add_item(ffb_tree
, hf_ffb_symboloffset
, tvb
, offset
++, 1, ENC_BIG_ENDIAN
);
63 proto_tree_add_item(ffb_tree
, hf_ffb_value
, tvb
, offset
++, 1, ENC_BIG_ENDIAN
);
66 return tvb_captured_length(tvb
);
69 /* Register Wimax FFB Protocol */
70 void wimax_proto_register_wimax_ffb(void)
73 static hf_register_info hf
[] =
78 {"Fast Feedback Burst", "wmx.ffb.burst", FT_BYTES
, BASE_NONE
, NULL
, 0x0, NULL
, HFILL
}
83 {"Number Of Fast Feedback", "wmx.ffb.num_of_ffbs", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
87 {"Fast Feedback Type", "wmx.ffb.ffb_type", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
91 {"Physical Subchannel", "wmx.ffb.subchannel", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
95 {"Symbol Offset", "wmx.ffb.symbol_offset", FT_UINT8
, BASE_DEC
, NULL
, 0x0, NULL
, HFILL
}
99 {"Fast Feedback Value", "wmx.ffb.ffb_value", FT_UINT8
, BASE_HEX
, NULL
, 0x0, NULL
, HFILL
}
103 /* Setup protocol subtree array */
106 &ett_wimax_ffb_decoder
,
109 proto_wimax_ffb_decoder
= proto_wimax
;
111 /* register the field display messages */
112 proto_register_field_array(proto_wimax_ffb_decoder
, hf
, array_length(hf
));
113 proto_register_subtree_array(ett
, array_length(ett
));
115 register_dissector("wimax_ffb_burst_handler", dissect_wimax_ffb_decoder
, proto_wimax_ffb_decoder
);
119 * Editor modelines - https://www.wireshark.org/tools/modelines.html
124 * indent-tabs-mode: t
127 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
128 * :indentSize=8:tabSize=8:noTabs=false: