epan/dissectors/pidl/ C99 drsuapi
[wireshark-sm.git] / plugins / epan / wimax / msg_dsx_rvd.c
blob8fbbfb55b177f2a117ac67b902e47a59bf8d394f
1 /* msg_dsx_rvd.c
2 * WiMax MAC Management DSX-RVD Message 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_mac.h"
22 void proto_register_mac_mgmt_msg_dsx_rvd(void);
23 void proto_reg_handoff_mac_mgmt_msg_dsx_rvd(void);
25 static dissector_handle_t dsx_rvd_handle;
27 static int proto_mac_mgmt_msg_dsx_rvd_decoder;
28 static int ett_mac_mgmt_msg_dsx_rvd_decoder;
30 /* fix fields */
31 static int hf_dsx_rvd_transaction_id;
32 static int hf_dsx_rvd_confirmation_code;
35 /* Decode DSX-RVD messages. */
36 static int dissect_mac_mgmt_msg_dsx_rvd_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
38 unsigned offset = 0;
39 proto_item *dsx_rvd_item;
40 proto_tree *dsx_rvd_tree;
42 { /* we are being asked for details */
43 /* display MAC message type */
44 dsx_rvd_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_dsx_rvd_decoder, tvb, offset, -1, "DSx Received (DSX-RVD)");
45 /* add MAC DSx subtree */
46 dsx_rvd_tree = proto_item_add_subtree(dsx_rvd_item, ett_mac_mgmt_msg_dsx_rvd_decoder);
47 /* display the Transaction ID */
48 proto_tree_add_item(dsx_rvd_tree, hf_dsx_rvd_transaction_id, tvb, offset, 2, ENC_BIG_ENDIAN);
49 /* move to next field */
50 offset += 2;
51 /* display the Confirmation Code */
52 proto_tree_add_item(dsx_rvd_tree, hf_dsx_rvd_confirmation_code, tvb, offset, 1, ENC_BIG_ENDIAN);
54 return tvb_captured_length(tvb);
57 /* Register Wimax Mac Payload Protocol and Dissector */
58 void proto_register_mac_mgmt_msg_dsx_rvd(void)
60 /* DSX_RVD display */
61 static hf_register_info hf_dsx_rvd[] =
64 &hf_dsx_rvd_confirmation_code,
65 { "Confirmation code", "wmx.dsx_rvd.confirmation_code", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
68 &hf_dsx_rvd_transaction_id,
69 { "Transaction ID", "wmx.dsx_rvd.transaction_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
73 /* Setup protocol subtree array */
74 static int *ett[] =
76 &ett_mac_mgmt_msg_dsx_rvd_decoder,
79 proto_mac_mgmt_msg_dsx_rvd_decoder = proto_register_protocol (
80 "WiMax DSX-RVD Message", /* name */
81 "WiMax DSX-RVD (dsx_rvd)", /* short name */
82 "wmx.dsx_rvd" /* abbrev */
85 proto_register_field_array(proto_mac_mgmt_msg_dsx_rvd_decoder, hf_dsx_rvd, array_length(hf_dsx_rvd));
86 proto_register_subtree_array(ett, array_length(ett));
87 dsx_rvd_handle = register_dissector("mac_mgmt_msg_dsx_rvd_handler", dissect_mac_mgmt_msg_dsx_rvd_decoder, proto_mac_mgmt_msg_dsx_rvd_decoder);
90 void
91 proto_reg_handoff_mac_mgmt_msg_dsx_rvd(void)
93 dissector_add_uint("wmx.mgmtmsg", MAC_MGMT_MSG_DSX_RVD, dsx_rvd_handle);
97 * Editor modelines - https://www.wireshark.org/tools/modelines.html
99 * Local variables:
100 * c-basic-offset: 8
101 * tab-width: 8
102 * indent-tabs-mode: t
103 * End:
105 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
106 * :indentSize=8:tabSize=8:noTabs=false: