diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
commit | c4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch) | |
tree | 93d5c6aa93d9987680dd1adad5685e2ad698f223 /plugins/epan/wimax/msg_pmc.c | |
parent | Adding upstream version 4.2.6. (diff) | |
download | wireshark-upstream.tar.xz wireshark-upstream.zip |
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/epan/wimax/msg_pmc.c')
-rw-r--r-- | plugins/epan/wimax/msg_pmc.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/plugins/epan/wimax/msg_pmc.c b/plugins/epan/wimax/msg_pmc.c index 7fe16e04..75e95b63 100644 --- a/plugins/epan/wimax/msg_pmc.c +++ b/plugins/epan/wimax/msg_pmc.c @@ -19,8 +19,7 @@ #include <epan/packet.h> #include "wimax_mac.h" - -extern gboolean include_cor2_changes; +#include "wimax_prefs.h" void proto_register_mac_mgmt_msg_pmc_req(void); void proto_register_mac_mgmt_msg_pmc_rsp(void); @@ -31,26 +30,26 @@ static int dissect_mac_mgmt_msg_pmc_rsp_decoder(tvbuff_t *tvb, packet_info *pinf static dissector_handle_t pmc_req_handle; static dissector_handle_t pmc_rsp_handle; -static gint proto_mac_mgmt_msg_pmc_req_decoder = -1; -static gint proto_mac_mgmt_msg_pmc_rsp_decoder = -1; +static int proto_mac_mgmt_msg_pmc_req_decoder; +static int proto_mac_mgmt_msg_pmc_rsp_decoder; -static gint ett_mac_mgmt_msg_pmc_decoder = -1; +static int ett_mac_mgmt_msg_pmc_decoder; /* Setup protocol subtree array */ -static gint *ett[] = +static int *ett[] = { &ett_mac_mgmt_msg_pmc_decoder, }; /* PMC fields */ -static gint hf_pmc_req_pwr_control_mode_change = -1; -static gint hf_pmc_req_pwr_control_mode_change_cor2 = -1; -static gint hf_pmc_req_tx_power_level = -1; -static gint hf_pmc_req_confirmation = -1; -static gint hf_pmc_req_reserved = -1; -static gint hf_pmc_rsp_start_frame = -1; -static gint hf_pmc_rsp_power_adjust = -1; -static gint hf_pmc_rsp_offset_BS_per_MS = -1; +static int hf_pmc_req_pwr_control_mode_change; +static int hf_pmc_req_pwr_control_mode_change_cor2; +static int hf_pmc_req_tx_power_level; +static int hf_pmc_req_confirmation; +static int hf_pmc_req_reserved; +static int hf_pmc_rsp_start_frame; +static int hf_pmc_rsp_power_adjust; +static int hf_pmc_rsp_offset_BS_per_MS; /* STRING RESOURCES */ static const value_string vals_pmc_req_pwr[] = { @@ -164,7 +163,7 @@ void proto_register_mac_mgmt_msg_pmc_rsp(void) /* Decode PMC-REQ messages. */ static int dissect_mac_mgmt_msg_pmc_req_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { - guint offset = 0; + unsigned offset = 0; proto_item *pmc_req_item; proto_tree *pmc_req_tree; @@ -189,12 +188,12 @@ static int dissect_mac_mgmt_msg_pmc_req_decoder(tvbuff_t *tvb, packet_info *pinf /* Decode PMC-RSP messages. */ static int dissect_mac_mgmt_msg_pmc_rsp_decoder(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_) { - guint offset = 0; + unsigned offset = 0; proto_item *pmc_rsp_item; proto_tree *pmc_rsp_tree; - guint8 pwr_control_mode; - gint8 value; - gfloat power_change; + uint8_t pwr_control_mode; + int8_t value; + float power_change; { /* we are being asked for details */ @@ -210,10 +209,10 @@ static int dissect_mac_mgmt_msg_pmc_rsp_decoder(tvbuff_t *tvb, packet_info *pinf proto_tree_add_item(pmc_rsp_tree, hf_pmc_req_pwr_control_mode_change, tvb, offset, 2, ENC_BIG_ENDIAN); /* display the Power Adjust start frame */ proto_tree_add_item(pmc_rsp_tree, hf_pmc_rsp_start_frame, tvb, offset, 2, ENC_BIG_ENDIAN); - pwr_control_mode = 0xC0 & tvb_get_guint8(tvb, offset); + pwr_control_mode = 0xC0 & tvb_get_uint8(tvb, offset); offset++; - value = tvb_get_gint8(tvb, offset); + value = tvb_get_int8(tvb, offset); power_change = (float)0.25 * value; /* 0.25dB incr */ /* Check if Power Control Mode is 0 */ if (pwr_control_mode == 0) { |