summaryrefslogtreecommitdiffstats
path: root/plugins/epan/wimax/msg_dcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/epan/wimax/msg_dcd.c')
-rw-r--r--plugins/epan/wimax/msg_dcd.c197
1 files changed, 99 insertions, 98 deletions
diff --git a/plugins/epan/wimax/msg_dcd.c b/plugins/epan/wimax/msg_dcd.c
index 167e0742..787cd0af 100644
--- a/plugins/epan/wimax/msg_dcd.c
+++ b/plugins/epan/wimax/msg_dcd.c
@@ -21,102 +21,103 @@
*/
#include <epan/packet.h>
+#include <epan/unit_strings.h>
+
+#include <wsutil/array.h>
#include "wimax_tlv.h"
#include "wimax_mac.h"
#include "wimax_utils.h"
-
-/* Delete the following variable as soon as possible */
-extern gboolean include_cor2_changes;
+#include "wimax_prefs.h"
void proto_register_mac_mgmt_msg_dcd(void);
void proto_reg_handoff_mac_mgmt_msg_dcd(void);
static dissector_handle_t dcd_handle;
-static gint proto_mac_mgmt_msg_dcd_decoder = -1;
-static gint ett_mac_mgmt_msg_dcd_decoder = -1;
+static int proto_mac_mgmt_msg_dcd_decoder;
+static int ett_mac_mgmt_msg_dcd_decoder;
/* fix fields */
-static gint hf_dcd_downlink_channel_id = -1;
-static gint hf_dcd_config_change_count = -1;
-static gint hf_dcd_dl_burst_profile_rsv = -1;
-static gint hf_dcd_dl_burst_profile_diuc = -1;
+static int hf_dcd_downlink_channel_id;
+static int hf_dcd_config_change_count;
+static int hf_dcd_dl_burst_profile_rsv;
+static int hf_dcd_dl_burst_profile_diuc;
-static gint hf_dcd_bs_eirp = -1;
-static gint hf_dcd_frame_duration = -1;
-static gint hf_dcd_phy_type = -1;
-static gint hf_dcd_power_adjustment = -1;
-static gint hf_dcd_channel_nr = -1;
-static gint hf_dcd_ttg = -1;
-static gint hf_dcd_rtg = -1;
+static int hf_dcd_bs_eirp;
+static int hf_dcd_frame_duration;
+static int hf_dcd_phy_type;
+static int hf_dcd_power_adjustment;
+static int hf_dcd_channel_nr;
+static int hf_dcd_ttg;
+static int hf_dcd_rtg;
#ifdef WIMAX_16D_2004
-static gint hf_dcd_rss = -1;
+static int hf_dcd_rss;
#endif
-static gint hf_dcd_channel_switch_frame_nr = -1;
-static gint hf_dcd_frequency = -1;
-static gint hf_dcd_bs_id = -1;
-static gint hf_dcd_frame_duration_code = -1;
-static gint hf_dcd_frame_nr = -1;
+static int hf_dcd_channel_switch_frame_nr;
+static int hf_dcd_frequency;
+static int hf_dcd_bs_id;
+static int hf_dcd_frame_duration_code;
+static int hf_dcd_frame_nr;
#ifdef WIMAX_16D_2004
-static gint hf_dcd_size_cqich_id = -1;
-static gint hf_dcd_h_arq_ack_delay_dl = -1;
+static int hf_dcd_size_cqich_id;
+static int hf_dcd_h_arq_ack_delay_dl;
#else
-static gint hf_dcd_h_arq_ack_delay_ul = -1;
+static int hf_dcd_h_arq_ack_delay_ul;
#endif
-static gint hf_dcd_mac_version = -1;
-static gint hf_dcd_restart_count = -1;
+static int hf_dcd_mac_version;
+static int hf_dcd_restart_count;
-/* static gint hf_dl_burst_reserved = -1; */
-/* static gint hf_dl_burst_diuc = -1; */
-static gint hf_dcd_burst_freq = -1;
-static gint hf_dcd_burst_fec = -1;
-static gint hf_dcd_burst_diuc_exit_threshold = -1;
-static gint hf_dcd_burst_diuc_entry_threshold = -1;
-static gint hf_dcd_burst_tcs = -1;
-static gint hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone = -1;
-static gint hf_dcd_tlv_t_20_maximum_retransmission = -1;
-static gint hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter = -1;
-static gint hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements = -1;
-static gint hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements = -1;
-static gint hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap = -1;
+/* static int hf_dl_burst_reserved; */
+/* static int hf_dl_burst_diuc; */
+static int hf_dcd_burst_freq;
+static int hf_dcd_burst_fec;
+static int hf_dcd_burst_diuc_exit_threshold;
+static int hf_dcd_burst_diuc_entry_threshold;
+static int hf_dcd_burst_tcs;
+static int hf_dcd_tlv_t_19_permutation_type_for_broadcast_regions_in_harq_zone;
+static int hf_dcd_tlv_t_20_maximum_retransmission;
+static int hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter;
+static int hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_physical_cinr_measurements;
+static int hf_dcd_tlv_t_21_default_rssi_and_cinr_averaging_parameter_rssi_measurements;
+static int hf_dcd_tlv_t_22_dl_amc_allocated_physical_bands_bitmap;
-static gint hf_dcd_tlv_t_34_dl_region_definition = -1;
-static gint hf_dcd_tlv_t_34_dl_region_definition_num_region = -1;
-static gint hf_dcd_tlv_t_34_dl_region_definition_reserved = -1;
-static gint hf_dcd_tlv_t_34_dl_region_definition_symbol_offset = -1;
-static gint hf_dcd_eirxp = -1;
-static gint hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset = -1;
-static gint hf_dcd_tlv_t_34_dl_region_definition_num_symbols = -1;
-static gint hf_dcd_tlv_t_34_dl_region_definition_num_subchannels = -1;
-static gint hf_dcd_tlv_t_50_ho_type_support = -1;
-static gint hf_dcd_tlv_t_50_ho_type_support_ho = -1;
-static gint hf_dcd_tlv_t_50_ho_type_support_mdho = -1;
-static gint hf_dcd_tlv_t_50_ho_type_support_fbss_ho = -1;
-static gint hf_dcd_tlv_t_50_ho_type_support_reserved = -1;
-static gint hf_dcd_tlv_t_31_h_add_threshold = -1;
-static gint hf_dcd_tlv_t_45_paging_interval_length = -1;
-static gint hf_dcd_tlv_t_45_paging_interval_reserved = -1;
-static gint hf_dcd_tlv_t_32_h_delete_threshold = -1;
-static gint hf_dcd_tlv_t_33_asr = -1;
-static gint hf_dcd_tlv_t_33_asr_m = -1;
-static gint hf_dcd_tlv_t_33_asr_l = -1;
-static gint hf_dcd_tlv_t_35_paging_group_id = -1;
-static gint hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap = -1;
-static gint hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap = -1;
-static gint hf_dcd_tlv_t_51_hysteresis_margin = -1;
-static gint hf_dcd_tlv_t_52_time_to_trigger_duration = -1;
-static gint hf_dcd_tlv_t_60_noise_interference = -1;
-static gint hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types = -1;
+static int hf_dcd_tlv_t_34_dl_region_definition;
+static int hf_dcd_tlv_t_34_dl_region_definition_num_region;
+static int hf_dcd_tlv_t_34_dl_region_definition_reserved;
+static int hf_dcd_tlv_t_34_dl_region_definition_symbol_offset;
+static int hf_dcd_eirxp;
+static int hf_dcd_tlv_t_34_dl_region_definition_subchannel_offset;
+static int hf_dcd_tlv_t_34_dl_region_definition_num_symbols;
+static int hf_dcd_tlv_t_34_dl_region_definition_num_subchannels;
+static int hf_dcd_tlv_t_50_ho_type_support;
+static int hf_dcd_tlv_t_50_ho_type_support_ho;
+static int hf_dcd_tlv_t_50_ho_type_support_mdho;
+static int hf_dcd_tlv_t_50_ho_type_support_fbss_ho;
+static int hf_dcd_tlv_t_50_ho_type_support_reserved;
+static int hf_dcd_tlv_t_31_h_add_threshold;
+static int hf_dcd_tlv_t_45_paging_interval_length;
+static int hf_dcd_tlv_t_45_paging_interval_reserved;
+static int hf_dcd_tlv_t_32_h_delete_threshold;
+static int hf_dcd_tlv_t_33_asr;
+static int hf_dcd_tlv_t_33_asr_m;
+static int hf_dcd_tlv_t_33_asr_l;
+static int hf_dcd_tlv_t_35_paging_group_id;
+static int hf_dcd_tlv_t_36_tusc1_permutation_active_subchannels_bitmap;
+static int hf_dcd_tlv_t_37_tusc2_permutation_active_subchannels_bitmap;
+static int hf_dcd_tlv_t_51_hysteresis_margin;
+static int hf_dcd_tlv_t_52_time_to_trigger_duration;
+static int hf_dcd_tlv_t_60_noise_interference;
+static int hf_dcd_tlv_t_153_downlink_burst_profile_for_mutiple_fec_types;
-static gint hf_dcd_tlv_t_541_type_function_action = -1;
-static gint hf_dcd_tlv_t_541_type = -1;
-static gint hf_dcd_tlv_t_541_function = -1;
-static gint hf_dcd_tlv_t_541_action = -1;
-static gint hf_dcd_tlv_t_542_trigger_value = -1;
-static gint hf_dcd_tlv_t_543_trigger_averaging_duration = -1;
+static int hf_dcd_tlv_t_541_type_function_action;
+static int hf_dcd_tlv_t_541_type;
+static int hf_dcd_tlv_t_541_function;
+static int hf_dcd_tlv_t_541_action;
+static int hf_dcd_tlv_t_542_trigger_value;
+static int hf_dcd_tlv_t_543_trigger_averaging_duration;
-static gint hf_dcd_unknown_type = -1;
-static gint hf_dcd_invalid_tlv = -1;
+static int hf_dcd_unknown_type;
+static int hf_dcd_invalid_tlv;
/* DCD DIUC messages (table 143) */
static const value_string diuc_msgs[] =
@@ -332,14 +333,14 @@ static const value_string tfs_support[] =
/* WiMax MAC Management DCD message (table 15) dissector */
static int dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
- guint offset = 0;
- guint tvb_len, length;
- gint tlv_type, tlv_len, tlv_offset, tlv_value_offset;
- guint dl_burst_diuc, dl_num_regions;
+ unsigned offset = 0;
+ unsigned tvb_len, length;
+ int tlv_type, tlv_len, tlv_offset, tlv_value_offset;
+ unsigned dl_burst_diuc, dl_num_regions;
proto_item *dcd_item, *tlv_item, *sub_item;
proto_tree *dcd_tree, *tlv_tree, *sub_tree;
tlv_info_t tlv_info;
- gchar* proto_str;
+ char* proto_str;
{ /* we are being asked for details */
/* Get the tvb reported length */
@@ -385,7 +386,7 @@ static int dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, p
case DCD_DOWNLINK_BURST_PROFILE:
{ /* Downlink Burst Profile TLV (table 363)*/
/* get the DIUC */
- dl_burst_diuc = (tvb_get_guint8(tvb, offset) & 0x0F);
+ dl_burst_diuc = (tvb_get_uint8(tvb, offset) & 0x0F);
/* display TLV info */
/* add TLV subtree */
proto_str = wmem_strdup_printf(pinfo->pool, "Downlink_Burst_Profile (DIUC=%u)", dl_burst_diuc);
@@ -564,7 +565,7 @@ static int dissect_mac_mgmt_msg_dcd_decoder(tvbuff_t *tvb, packet_info *pinfo, p
{
tlv_item = add_tlv_subtree(&tlv_info, dcd_tree, hf_dcd_tlv_t_34_dl_region_definition, tvb, offset-tlv_value_offset, ENC_NA);
tlv_tree = proto_item_add_subtree(tlv_item, ett_mac_mgmt_msg_dcd_decoder);
- dl_num_regions = tvb_get_guint8(tvb, offset);
+ dl_num_regions = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_num_region, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_dcd_tlv_t_34_dl_region_definition_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
tlv_offset = offset;
@@ -727,21 +728,21 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_tlv_t_33_asr_l,
{
"ASR Switching Period (L)", "wmx.dcd.asr.l",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_frames, 0x0f, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_frame_frames), 0x0f, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_33_asr_m,
{
"ASR Slot Length (M)", "wmx.dcd.asr.m",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_frames, 0xf0, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_frame_frames), 0xf0, NULL, HFILL
}
},
{
&hf_dcd_bs_eirp,
{
"BS EIRP", "wmx.dcd.bs_eirp",
- FT_INT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_dbm, 0x00, NULL, HFILL
+ FT_INT16, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_dbm), 0x00, NULL, HFILL
}
},
{
@@ -792,7 +793,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_burst_freq,
{
"Frequency", "wmx.dcd.burst.freq",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_khz, 0x00, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_khz), 0x00, NULL, HFILL
}
},
#if 0
@@ -935,7 +936,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_eirxp,
{
"EIRXP (IR, max)", "wmx.dcd.eirxp",
- FT_INT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_dbm, 0x00, NULL, HFILL
+ FT_INT16, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_dbm), 0x00, NULL, HFILL
}
},
#endif
@@ -964,14 +965,14 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_frequency,
{
"Downlink Center Frequency", "wmx.dcd.frequency",
- FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &wimax_units_khz, 0x00, NULL, HFILL
+ FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_khz), 0x00, NULL, HFILL
}
},
{
&hf_dcd_tlv_t_31_h_add_threshold,
{
"H_add Threshold", "wmx.dcd.h_add_threshold",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_db, 0x0, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_db), 0x0, NULL, HFILL
}
},
#ifdef WIMAX_16D_2004
@@ -979,7 +980,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_h_arq_ack_delay_dl,
{
"H-ARQ ACK Delay for DL Burst", "wmx.dcd.h_arq_ack_delay_dl_burst",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_offset, 0x00, "", HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_frame_offset), 0x00, "", HFILL
}
},
#else
@@ -987,7 +988,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_h_arq_ack_delay_ul,
{
"H-ARQ ACK Delay for UL Burst", "wmx.dcd.h_arq_ack_delay_ul_burst",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_frame_offset, 0x00, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_frame_offset), 0x00, NULL, HFILL
}
},
#endif
@@ -995,7 +996,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_tlv_t_32_h_delete_threshold,
{
"H_delete Threshold", "wmx.dcd.h_delete_threshold",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_db, 0x0, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_db), 0x0, NULL, HFILL
}
},
{
@@ -1037,7 +1038,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_tlv_t_51_hysteresis_margin,
{
"Hysteresis Margin", "wmx.dcd.hysteresis_margin",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_db, 0x0, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_db), 0x0, NULL, HFILL
}
},
{
@@ -1129,7 +1130,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_rss,
{
"RSS (IR, max)", "wmx.dcd.rss",
- FT_INT16, BASE_DEC|BASE_UNIT_STRING, &wimax_units_dbm, 0x00, "", HFILL
+ FT_INT16, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_dbm), 0x00, "", HFILL
}
},
#endif
@@ -1137,7 +1138,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_rtg,
{
"RTG", "wmx.dcd.rtg",
- FT_UINT8, BASE_HEX|BASE_UNIT_STRING, &wimax_units_ps, 0x00, NULL, HFILL
+ FT_UINT8, BASE_HEX|BASE_UNIT_STRING, UNS(&wimax_units_ps), 0x00, NULL, HFILL
}
},
#ifdef WIMAX_16D_2004
@@ -1160,7 +1161,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_tlv_t_52_time_to_trigger_duration,
{
"Time to Trigger Duration", "wmx.dcd.time_trigger_duration",
- FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &wimax_units_ms, 0x0, NULL, HFILL
+ FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&wimax_units_ms), 0x0, NULL, HFILL
}
},
{
@@ -1181,7 +1182,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
&hf_dcd_ttg,
{
"TTG", "wmx.dcd.ttg",
- FT_UINT16, BASE_HEX|BASE_UNIT_STRING, &wimax_units_ps, 0x00, NULL, HFILL
+ FT_UINT16, BASE_HEX|BASE_UNIT_STRING, UNS(&wimax_units_ps), 0x00, NULL, HFILL
}
},
{
@@ -1222,7 +1223,7 @@ void proto_register_mac_mgmt_msg_dcd(void)
};
/* Setup protocol subtree array */
- static gint *ett[] =
+ static int *ett[] =
{
&ett_mac_mgmt_msg_dcd_decoder,
};