Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / plugins / epan / wimax / wimax_cdma_code_decoder.c
blob45bae8d90b2aaebf0d464be9af5b9518d32f72f5
1 /* wimax_cdma_code_decoder.c
2 * WiMax CDMA CODE Attribute 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
15 /* Include files */
17 #include "config.h"
19 #include <epan/packet.h>
20 #include "wimax-int.h"
22 static int proto_wimax_cdma_code_decoder;
23 static int ett_wimax_cdma_code_decoder;
25 static int hf_wimax_ranging_code;
26 static int hf_wimax_ranging_symbol_offset;
27 static int hf_wimax_ranging_subchannel_offset;
29 static int dissect_wimax_cdma_code_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
31 int offset = 0;
32 proto_item *cdma_item;
33 proto_tree *cdma_tree;
35 /* update the info column */
36 col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "CDMA Code Attribute");
37 if (tree)
38 { /* we are being asked for details */
39 /* display CDMA dissector info */
40 cdma_item = proto_tree_add_item(tree, proto_wimax_cdma_code_decoder, tvb, offset, -1, ENC_NA);
41 /* add CDMA Code subtree */
42 cdma_tree = proto_item_add_subtree(cdma_item, ett_wimax_cdma_code_decoder);
43 /* display the first CDMA Code */
44 proto_tree_add_item(cdma_tree, hf_wimax_ranging_code, tvb, offset, 1, ENC_BIG_ENDIAN);
45 /* display the 2nd CDMA Code */
46 proto_tree_add_item(cdma_tree, hf_wimax_ranging_symbol_offset, tvb, offset+1, 1, ENC_BIG_ENDIAN);
47 /* display the 3rd CDMA Code */
48 proto_tree_add_item(cdma_tree, hf_wimax_ranging_subchannel_offset, tvb, offset+2, 1, ENC_BIG_ENDIAN);
50 return tvb_captured_length(tvb);
53 /* Register Wimax CDMA Protocol */
54 void wimax_proto_register_wimax_cdma(void)
56 /* TLV display */
57 static hf_register_info hf[] =
60 &hf_wimax_ranging_code,
62 "Ranging Code", "wmx.cdma.ranging_code",
63 FT_UINT8, BASE_HEX, NULL, 0x0,
64 NULL, HFILL
68 &hf_wimax_ranging_symbol_offset,
70 "Ranging Symbol Offset", "wmx.cdma.ranging_symbol_offset",
71 FT_UINT8, BASE_HEX, NULL, 0x0,
72 NULL, HFILL
76 &hf_wimax_ranging_subchannel_offset,
78 "Ranging Sub-Channel Offset", "wmx.cdma.ranging_subchannel_offset",
79 FT_UINT8, BASE_HEX, NULL, 0x0,
80 NULL, HFILL
85 /* Setup protocol subtree array */
86 static int *ett[] =
88 &ett_wimax_cdma_code_decoder,
91 proto_wimax_cdma_code_decoder = proto_register_protocol (
92 "WiMax CDMA Code Attribute", /* name */
93 "CDMA Code Attribute", /* short name */
94 "wmx.cdma" /* abbrev */
97 /* register the field display messages */
98 proto_register_field_array(proto_wimax_cdma_code_decoder, hf, array_length(hf));
99 proto_register_subtree_array(ett, array_length(ett));
101 register_dissector("wimax_cdma_code_burst_handler", dissect_wimax_cdma_code_decoder, proto_wimax_cdma_code_decoder);
106 * Editor modelines - https://www.wireshark.org/tools/modelines.html
108 * Local variables:
109 * c-basic-offset: 8
110 * tab-width: 8
111 * indent-tabs-mode: t
112 * End:
114 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
115 * :indentSize=8:tabSize=8:noTabs=false: