summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-umts_fp.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-umts_fp.c')
-rw-r--r--epan/dissectors/packet-umts_fp.c1773
1 files changed, 883 insertions, 890 deletions
diff --git a/epan/dissectors/packet-umts_fp.c b/epan/dissectors/packet-umts_fp.c
index 42bdff3b..16601e2f 100644
--- a/epan/dissectors/packet-umts_fp.c
+++ b/epan/dissectors/packet-umts_fp.c
@@ -44,189 +44,189 @@ void proto_reg_handoff_fp(void);
/* Initialize the protocol and registered fields. */
-int proto_fp = -1;
+int proto_fp;
extern int proto_umts_mac;
extern int proto_umts_rlc;
-static int hf_fp_release = -1;
-static int hf_fp_release_version = -1;
-static int hf_fp_release_year = -1;
-static int hf_fp_release_month = -1;
-static int hf_fp_channel_type = -1;
-static int hf_fp_division = -1;
-static int hf_fp_direction = -1;
-static int hf_fp_ddi_config = -1;
-static int hf_fp_ddi_config_ddi = -1;
-static int hf_fp_ddi_config_macd_pdu_size = -1;
-
-static int hf_fp_header_crc = -1;
-static int hf_fp_ft = -1;
-static int hf_fp_cfn = -1;
-static int hf_fp_pch_cfn = -1;
-static int hf_fp_pch_toa = -1;
-static int hf_fp_cfn_control = -1;
-static int hf_fp_toa = -1;
-static int hf_fp_tfi = -1;
-static int hf_fp_usch_tfi = -1;
-static int hf_fp_cpch_tfi = -1;
-static int hf_fp_propagation_delay = -1;
-static int hf_fp_tb = -1;
-static int hf_fp_chan_zero_tbs = -1;
-static int hf_fp_received_sync_ul_timing_deviation = -1;
-static int hf_fp_pch_pi = -1;
-static int hf_fp_pch_tfi = -1;
-static int hf_fp_fach_tfi = -1;
-static int hf_fp_transmit_power_level = -1;
-static int hf_fp_paging_indication_bitmap = -1;
-static int hf_fp_relevant_paging_indication_bitmap = -1;
-static int hf_fp_pdsch_set_id = -1;
-static int hf_fp_rx_timing_deviation = -1;
-static int hf_fp_dch_e_rucch_flag = -1;
-static int hf_fp_dch_control_frame_type = -1;
-static int hf_fp_dch_rx_timing_deviation = -1;
-static int hf_fp_quality_estimate = -1;
-static int hf_fp_payload_crc = -1;
-static int hf_fp_payload_crc_status = -1;
-static int hf_fp_edch_header_crc = -1;
-static int hf_fp_edch_fsn = -1;
-static int hf_fp_edch_subframe = -1;
-static int hf_fp_edch_number_of_subframes = -1;
-static int hf_fp_edch_harq_retransmissions = -1;
-static int hf_fp_edch_subframe_number = -1;
-static int hf_fp_edch_number_of_mac_es_pdus = -1;
-static int hf_fp_edch_ddi = -1;
-static int hf_fp_edch_subframe_header = -1;
-static int hf_fp_edch_number_of_mac_d_pdus = -1;
-static int hf_fp_edch_pdu_padding = -1;
-static int hf_fp_edch_tsn = -1;
-static int hf_fp_edch_mac_es_pdu = -1;
-
-static int hf_fp_edch_user_buffer_size = -1;
-static int hf_fp_edch_no_macid_sdus = -1;
-static int hf_fp_edch_number_of_mac_is_pdus = -1;
-static int hf_fp_edch_mac_is_pdu = -1;
-
-static int hf_fp_edch_e_rnti = -1;
-static int hf_fp_edch_macis_descriptors = -1;
-static int hf_fp_edch_macis_lchid = -1;
-static int hf_fp_edch_macis_length = -1;
-static int hf_fp_edch_macis_flag = -1;
-static int hf_fp_edch_entity = -1;
-
-static int hf_fp_frame_seq_nr = -1;
-static int hf_fp_hsdsch_pdu_block_header = -1;
-/* static int hf_fp_hsdsch_pdu_block = -1; */
-static int hf_fp_flush = -1;
-static int hf_fp_fsn_drt_reset = -1;
-static int hf_fp_drt_indicator = -1;
-static int hf_fp_fach_indicator = -1;
-static int hf_fp_total_pdu_blocks = -1;
-static int hf_fp_drt = -1;
-static int hf_fp_hrnti = -1;
-static int hf_fp_rach_measurement_result = -1;
-static int hf_fp_lchid = -1;
-static int hf_fp_pdu_length_in_block = -1;
-static int hf_fp_pdus_in_block = -1;
-static int hf_fp_cmch_pi = -1;
-static int hf_fp_user_buffer_size = -1;
-static int hf_fp_hsdsch_credits = -1;
-static int hf_fp_hsdsch_max_macd_pdu_len = -1;
-static int hf_fp_hsdsch_max_macdc_pdu_len = -1;
-static int hf_fp_hsdsch_interval = -1;
-static int hf_fp_hsdsch_calculated_rate = -1;
-static int hf_fp_hsdsch_unlimited_rate = -1;
-static int hf_fp_hsdsch_repetition_period = -1;
-static int hf_fp_hsdsch_data_padding = -1;
-static int hf_fp_hsdsch_new_ie_flags = -1;
-static int hf_fp_hsdsch_new_ie_flag[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_fp_hsdsch_drt = -1;
-static int hf_fp_hsdsch_entity = -1;
-static int hf_fp_hsdsch_physical_layer_category = -1;
-static int hf_fp_timing_advance = -1;
-static int hf_fp_num_of_pdu = -1;
-static int hf_fp_mac_d_pdu_len = -1;
-static int hf_fp_mac_d_pdu = -1;
-static int hf_fp_data = -1;
-static int hf_fp_crcis = -1;
-static int hf_fp_crci[8] = {-1, -1, -1, -1, -1, -1, -1, -1};
-static int hf_fp_common_control_frame_type = -1;
-static int hf_fp_t1 = -1;
-static int hf_fp_t2 = -1;
-static int hf_fp_t3 = -1;
-static int hf_fp_ul_sir_target = -1;
-static int hf_fp_pusch_set_id = -1;
-static int hf_fp_activation_cfn = -1;
-static int hf_fp_duration = -1;
-static int hf_fp_power_offset = -1;
-static int hf_fp_code_number = -1;
-static int hf_fp_spreading_factor = -1;
-static int hf_fp_mc_info = -1;
-
-static int hf_fp_rach_new_ie_flags = -1;
-static int hf_fp_rach_new_ie_flag_unused[7] = {-1, -1, -1, -1, -1, -1, -1 };
-static int hf_fp_rach_ext_propagation_delay_present = -1;
-static int hf_fp_rach_cell_portion_id_present = -1;
-static int hf_fp_rach_angle_of_arrival_present = -1;
-static int hf_fp_rach_ext_rx_sync_ul_timing_deviation_present = -1;
-static int hf_fp_rach_ext_rx_timing_deviation_present = -1;
-
-static int hf_fp_cell_portion_id = -1;
-static int hf_fp_ext_propagation_delay = -1;
-static int hf_fp_angle_of_arrival = -1;
-static int hf_fp_ext_received_sync_ul_timing_deviation = -1;
-
-static int hf_fp_radio_interface_parameter_update_flag[5] = {-1, -1, -1, -1, -1};
-static int hf_fp_dpc_mode = -1;
-static int hf_fp_tpc_po = -1;
-static int hf_fp_multiple_rl_set_indicator = -1;
-static int hf_fp_max_ue_tx_pow = -1;
-static int hf_fp_congestion_status = -1;
-static int hf_fp_e_rucch_present = -1;
-static int hf_fp_extended_bits_present = -1;
-static int hf_fp_extended_bits = -1;
-static int hf_fp_spare_extension = -1;
-static int hf_fp_ul_setup_frame = -1;
-static int hf_fp_dl_setup_frame = -1;
-static int hf_fp_relevant_pi_frame = -1;
+static int hf_fp_release;
+static int hf_fp_release_version;
+static int hf_fp_release_year;
+static int hf_fp_release_month;
+static int hf_fp_channel_type;
+static int hf_fp_division;
+static int hf_fp_direction;
+static int hf_fp_ddi_config;
+static int hf_fp_ddi_config_ddi;
+static int hf_fp_ddi_config_macd_pdu_size;
+
+static int hf_fp_header_crc;
+static int hf_fp_ft;
+static int hf_fp_cfn;
+static int hf_fp_pch_cfn;
+static int hf_fp_pch_toa;
+static int hf_fp_cfn_control;
+static int hf_fp_toa;
+static int hf_fp_tfi;
+static int hf_fp_usch_tfi;
+static int hf_fp_cpch_tfi;
+static int hf_fp_propagation_delay;
+static int hf_fp_tb;
+static int hf_fp_chan_zero_tbs;
+static int hf_fp_received_sync_ul_timing_deviation;
+static int hf_fp_pch_pi;
+static int hf_fp_pch_tfi;
+static int hf_fp_fach_tfi;
+static int hf_fp_transmit_power_level;
+static int hf_fp_paging_indication_bitmap;
+static int hf_fp_relevant_paging_indication_bitmap;
+static int hf_fp_pdsch_set_id;
+static int hf_fp_rx_timing_deviation;
+static int hf_fp_dch_e_rucch_flag;
+static int hf_fp_dch_control_frame_type;
+static int hf_fp_dch_rx_timing_deviation;
+static int hf_fp_quality_estimate;
+static int hf_fp_payload_crc;
+static int hf_fp_payload_crc_status;
+static int hf_fp_edch_header_crc;
+static int hf_fp_edch_fsn;
+static int hf_fp_edch_subframe;
+static int hf_fp_edch_number_of_subframes;
+static int hf_fp_edch_harq_retransmissions;
+static int hf_fp_edch_subframe_number;
+static int hf_fp_edch_number_of_mac_es_pdus;
+static int hf_fp_edch_ddi;
+static int hf_fp_edch_subframe_header;
+static int hf_fp_edch_number_of_mac_d_pdus;
+static int hf_fp_edch_pdu_padding;
+static int hf_fp_edch_tsn;
+static int hf_fp_edch_mac_es_pdu;
+
+static int hf_fp_edch_user_buffer_size;
+static int hf_fp_edch_no_macid_sdus;
+static int hf_fp_edch_number_of_mac_is_pdus;
+static int hf_fp_edch_mac_is_pdu;
+
+static int hf_fp_edch_e_rnti;
+static int hf_fp_edch_macis_descriptors;
+static int hf_fp_edch_macis_lchid;
+static int hf_fp_edch_macis_length;
+static int hf_fp_edch_macis_flag;
+static int hf_fp_edch_entity;
+
+static int hf_fp_frame_seq_nr;
+static int hf_fp_hsdsch_pdu_block_header;
+/* static int hf_fp_hsdsch_pdu_block; */
+static int hf_fp_flush;
+static int hf_fp_fsn_drt_reset;
+static int hf_fp_drt_indicator;
+static int hf_fp_fach_indicator;
+static int hf_fp_total_pdu_blocks;
+static int hf_fp_drt;
+static int hf_fp_hrnti;
+static int hf_fp_rach_measurement_result;
+static int hf_fp_lchid;
+static int hf_fp_pdu_length_in_block;
+static int hf_fp_pdus_in_block;
+static int hf_fp_cmch_pi;
+static int hf_fp_user_buffer_size;
+static int hf_fp_hsdsch_credits;
+static int hf_fp_hsdsch_max_macd_pdu_len;
+static int hf_fp_hsdsch_max_macdc_pdu_len;
+static int hf_fp_hsdsch_interval;
+static int hf_fp_hsdsch_calculated_rate;
+static int hf_fp_hsdsch_unlimited_rate;
+static int hf_fp_hsdsch_repetition_period;
+static int hf_fp_hsdsch_data_padding;
+static int hf_fp_hsdsch_new_ie_flags;
+static int hf_fp_hsdsch_new_ie_flag[8];
+static int hf_fp_hsdsch_drt;
+static int hf_fp_hsdsch_entity;
+static int hf_fp_hsdsch_physical_layer_category;
+static int hf_fp_timing_advance;
+static int hf_fp_num_of_pdu;
+static int hf_fp_mac_d_pdu_len;
+static int hf_fp_mac_d_pdu;
+static int hf_fp_data;
+static int hf_fp_crcis;
+static int hf_fp_crci[8];
+static int hf_fp_common_control_frame_type;
+static int hf_fp_t1;
+static int hf_fp_t2;
+static int hf_fp_t3;
+static int hf_fp_ul_sir_target;
+static int hf_fp_pusch_set_id;
+static int hf_fp_activation_cfn;
+static int hf_fp_duration;
+static int hf_fp_power_offset;
+static int hf_fp_code_number;
+static int hf_fp_spreading_factor;
+static int hf_fp_mc_info;
+
+static int hf_fp_rach_new_ie_flags;
+static int hf_fp_rach_new_ie_flag_unused[7];
+static int hf_fp_rach_ext_propagation_delay_present;
+static int hf_fp_rach_cell_portion_id_present;
+static int hf_fp_rach_angle_of_arrival_present;
+static int hf_fp_rach_ext_rx_sync_ul_timing_deviation_present;
+static int hf_fp_rach_ext_rx_timing_deviation_present;
+
+static int hf_fp_cell_portion_id;
+static int hf_fp_ext_propagation_delay;
+static int hf_fp_angle_of_arrival;
+static int hf_fp_ext_received_sync_ul_timing_deviation;
+
+static int hf_fp_radio_interface_parameter_update_flag[5];
+static int hf_fp_dpc_mode;
+static int hf_fp_tpc_po;
+static int hf_fp_multiple_rl_set_indicator;
+static int hf_fp_max_ue_tx_pow;
+static int hf_fp_congestion_status;
+static int hf_fp_e_rucch_present;
+static int hf_fp_extended_bits_present;
+static int hf_fp_extended_bits;
+static int hf_fp_spare_extension;
+static int hf_fp_ul_setup_frame;
+static int hf_fp_dl_setup_frame;
+static int hf_fp_relevant_pi_frame;
/* Subtrees. */
-static int ett_fp = -1;
-static int ett_fp_release = -1;
-static int ett_fp_data = -1;
-static int ett_fp_crcis = -1;
-static int ett_fp_ddi_config = -1;
-static int ett_fp_edch_subframe_header = -1;
-static int ett_fp_edch_subframe = -1;
-static int ett_fp_edch_maces = -1;
-static int ett_fp_edch_macis_descriptors = -1;
-static int ett_fp_hsdsch_new_ie_flags = -1;
-static int ett_fp_rach_new_ie_flags = -1;
-static int ett_fp_hsdsch_pdu_block_header = -1;
-static int ett_fp_pch_relevant_pi = -1;
-
-static expert_field ei_fp_hsdsch_common_experimental_support = EI_INIT;
-static expert_field ei_fp_hsdsch_common_t3_not_implemented = EI_INIT;
-static expert_field ei_fp_channel_type_unknown = EI_INIT;
-static expert_field ei_fp_ddi_not_defined = EI_INIT;
-static expert_field ei_fp_stop_hsdpa_transmission = EI_INIT;
-static expert_field ei_fp_hsdsch_entity_not_specified = EI_INIT;
-static expert_field ei_fp_expecting_tdd = EI_INIT;
-static expert_field ei_fp_bad_payload_checksum = EI_INIT;
-static expert_field ei_fp_e_rnti_t2_edch_frames = EI_INIT;
-static expert_field ei_fp_crci_no_subdissector = EI_INIT;
-static expert_field ei_fp_timing_adjustmentment_reported = EI_INIT;
-static expert_field ei_fp_mac_is_sdus_miscount = EI_INIT;
-static expert_field ei_fp_maybe_srb = EI_INIT;
-static expert_field ei_fp_transport_channel_type_unknown = EI_INIT;
-static expert_field ei_fp_pch_lost_relevant_pi_frame = EI_INIT;
-static expert_field ei_fp_unable_to_locate_ddi_entry = EI_INIT;
-static expert_field ei_fp_e_rnti_first_entry = EI_INIT;
-static expert_field ei_fp_bad_header_checksum = EI_INIT;
-static expert_field ei_fp_crci_error_bit_set_for_tb = EI_INIT;
-static expert_field ei_fp_spare_extension = EI_INIT;
-static expert_field ei_fp_no_per_frame_info = EI_INIT;
-static expert_field ei_fp_no_per_conv_channel_info = EI_INIT;
-static expert_field ei_fp_invalid_frame_count = EI_INIT;
+static int ett_fp;
+static int ett_fp_release;
+static int ett_fp_data;
+static int ett_fp_crcis;
+static int ett_fp_ddi_config;
+static int ett_fp_edch_subframe_header;
+static int ett_fp_edch_subframe;
+static int ett_fp_edch_maces;
+static int ett_fp_edch_macis_descriptors;
+static int ett_fp_hsdsch_new_ie_flags;
+static int ett_fp_rach_new_ie_flags;
+static int ett_fp_hsdsch_pdu_block_header;
+static int ett_fp_pch_relevant_pi;
+
+static expert_field ei_fp_hsdsch_common_experimental_support;
+static expert_field ei_fp_hsdsch_common_t3_not_implemented;
+static expert_field ei_fp_channel_type_unknown;
+static expert_field ei_fp_ddi_not_defined;
+static expert_field ei_fp_stop_hsdpa_transmission;
+static expert_field ei_fp_hsdsch_entity_not_specified;
+static expert_field ei_fp_expecting_tdd;
+static expert_field ei_fp_bad_payload_checksum;
+static expert_field ei_fp_e_rnti_t2_edch_frames;
+static expert_field ei_fp_crci_no_subdissector;
+static expert_field ei_fp_timing_adjustment_reported;
+static expert_field ei_fp_mac_is_sdus_miscount;
+static expert_field ei_fp_maybe_srb;
+static expert_field ei_fp_transport_channel_type_unknown;
+static expert_field ei_fp_pch_lost_relevant_pi_frame;
+static expert_field ei_fp_unable_to_locate_ddi_entry;
+static expert_field ei_fp_e_rnti_first_entry;
+static expert_field ei_fp_bad_header_checksum;
+static expert_field ei_fp_crci_error_bit_set_for_tb;
+static expert_field ei_fp_spare_extension;
+static expert_field ei_fp_no_per_frame_info;
+static expert_field ei_fp_no_per_conv_channel_info;
+static expert_field ei_fp_invalid_frame_count;
static dissector_handle_t rlc_bcch_handle;
static dissector_handle_t mac_fdd_dch_handle;
@@ -240,32 +240,32 @@ static dissector_handle_t fp_handle;
static dissector_handle_t fp_aal2_handle;
-static proto_tree *top_level_tree = NULL;
+static proto_tree *top_level_tree;
/* Variables used for preferences */
-static gboolean preferences_call_mac_dissectors = TRUE;
-static gboolean preferences_show_release_info = TRUE;
-static gboolean preferences_payload_checksum = TRUE;
-static gboolean preferences_header_checksum = TRUE;
-static gboolean preferences_track_paging_indications = TRUE;
+static bool preferences_call_mac_dissectors = true;
+static bool preferences_show_release_info = true;
+static bool preferences_payload_checksum = true;
+static bool preferences_header_checksum = true;
+static bool preferences_track_paging_indications = true;
/* E-DCH (T1) channel header information */
struct edch_t1_subframe_info
{
- guint8 subframe_number;
- guint8 number_of_mac_es_pdus;
- guint8 ddi[64];
- guint16 number_of_mac_d_pdus[64];
+ uint8_t subframe_number;
+ uint8_t number_of_mac_es_pdus;
+ uint8_t ddi[64];
+ uint16_t number_of_mac_d_pdus[64];
};
/* E-DCH (T2) channel header information */
struct edch_t2_subframe_info
{
- guint8 subframe_number;
- guint8 number_of_mac_is_pdus;
- guint8 number_of_mac_is_sdus[16];
- guint8 mac_is_lchid[16][16];
- guint16 mac_is_length[16][16];
+ uint8_t subframe_number;
+ uint8_t number_of_mac_is_pdus;
+ uint8_t number_of_mac_is_sdus[16];
+ uint8_t mac_is_lchid[16][16];
+ uint16_t mac_is_length[16][16];
};
@@ -444,10 +444,10 @@ static const value_string common_control_frame_type_vals[] = {
};
/* 0 to 7*/
-static const guint8 hsdsch_macdflow_id_rlc_map[] = {
+static const uint8_t hsdsch_macdflow_id_rlc_map[] = {
RLC_UM, /*0 SRB */
RLC_AM, /*1 Interactive PS*/
- RLC_AM, /*2 Interatcive PS*/
+ RLC_AM, /*2 Interactive PS*/
RLC_UNKNOWN_MODE, /*3 ???*/
RLC_AM, /*4 Streaming PS*/
RLC_UNKNOWN_MODE,
@@ -457,10 +457,10 @@ static const guint8 hsdsch_macdflow_id_rlc_map[] = {
/* Mapping hsdsch MACd-FlowId to MAC_CONTENT, basically flowid = 1 (0) => SRB*/
/* 1 to 8*/
-static const guint8 hsdsch_macdflow_id_mac_content_map[] = {
+static const uint8_t hsdsch_macdflow_id_mac_content_map[] = {
MAC_CONTENT_DCCH, /*1 SRB */
MAC_CONTENT_PS_DTCH, /*2 Interactive PS*/
- MAC_CONTENT_PS_DTCH, /*3 Interatcive PS*/
+ MAC_CONTENT_PS_DTCH, /*3 Interactive PS*/
RLC_UNKNOWN_MODE, /*4 ???*/
MAC_CONTENT_PS_DTCH, /*5 Streaming PS*/
RLC_UNKNOWN_MODE,
@@ -472,7 +472,7 @@ static const guint8 hsdsch_macdflow_id_mac_content_map[] = {
* XXXX Bug 12121 expanded the number of entries to 8(+2),
* not at all sure what the proper value should be 0xfF?
*/
-static const guint8 fake_lchid_macd_flow[] = {1,9,14,11,0,12,0,0};
+static const uint8_t fake_lchid_macd_flow[] = {1,9,14,11,0,12,0,0};
/* Dissect message parts */
static int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
@@ -481,17 +481,17 @@ static int dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
void *data);
static int dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- int offset, guint16 length, guint16 number_of_pdus, struct fp_info *p_fp_info,
+ int offset, uint16_t length, uint16_t number_of_pdus, struct fp_info *p_fp_info,
void *data);
static int dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- int offset, guint16 length, guint16 number_of_pdus, struct fp_info * fpi,
+ int offset, uint16_t length, uint16_t number_of_pdus, struct fp_info * fpi,
void *data);
static int dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
fp_info *p_fp_info, int offset);
static void dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree, guint8 dch_crc_present,
- int offset, guint header_length);
+ proto_tree *tree, uint8_t dch_crc_present,
+ int offset, unsigned header_length);
/* Dissect common control messages */
static int dissect_common_outer_loop_power_control(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
int offset, struct fp_info *p_fp_info);
@@ -587,14 +587,14 @@ static void dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tr
/* Dissect dedicated channels */
static void dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info,
- gboolean is_common,
+ bool is_common,
void *data);
static void dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info,
int number_of_subframes,
- gboolean is_common,
- guint16 header_crc,
+ bool is_common,
+ uint16_t header_crc,
proto_item * header_crc_pi,
void *data);
@@ -626,12 +626,12 @@ get_tb_count(struct fp_info *p_fp_info)
return tb_count;
}
-static gboolean verify_control_frame_crc(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, guint16 frame_crc)
+static bool verify_control_frame_crc(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, uint16_t frame_crc)
{
- guint8 crc = 0;
- guint8 * data = NULL;
+ uint8_t crc = 0;
+ uint8_t * data = NULL;
/* Get data. */
- data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb));
+ data = (uint8_t *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb));
/* Include only FT flag bit in CRC calculation. */
data[0] = data[0] & 1;
/* Calculate crc7 sum. */
@@ -639,49 +639,49 @@ static gboolean verify_control_frame_crc(tvbuff_t * tvb, packet_info * pinfo, pr
crc = crc7finalize(crc); /* finalize crc */
if (frame_crc == crc) {
proto_item_append_text(pi, " [correct]");
- return TRUE;
+ return true;
} else {
proto_item_append_text(pi, " [incorrect, should be 0x%x]", crc);
expert_add_info(pinfo, pi, &ei_fp_bad_header_checksum);
- return FALSE;
+ return false;
}
}
-static gboolean verify_header_crc(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, guint16 header_crc, guint header_length)
+static bool verify_header_crc(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, uint16_t header_crc, unsigned header_length)
{
- guint8 crc = 0;
- guint8 * data = NULL;
+ uint8_t crc = 0;
+ uint8_t * data = NULL;
/* Get data of header with first byte removed. */
- data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 1, header_length-1);
+ data = (uint8_t *)tvb_memdup(wmem_packet_scope(), tvb, 1, header_length-1);
/* Calculate crc7 sum. */
crc = crc7update(0, data, header_length-1);
crc = crc7finalize(crc); /* finalize crc */
if (header_crc == crc) {
proto_item_append_text(pi, " [correct]");
- return TRUE;
+ return true;
} else {
proto_item_append_text(pi, " [incorrect, should be 0x%x]", crc);
expert_add_info(pinfo, pi, &ei_fp_bad_header_checksum);
- return FALSE;
+ return false;
}
}
-static gboolean verify_header_crc_edch(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, guint16 header_crc, guint header_length)
+static bool verify_header_crc_edch(tvbuff_t * tvb, packet_info * pinfo, proto_item * pi, uint16_t header_crc, unsigned header_length)
{
- guint16 crc = 0;
- guint8 * data = NULL;
+ uint16_t crc = 0;
+ uint8_t * data = NULL;
/* First create new subset of header with first byte removed. */
tvbuff_t * headtvb = tvb_new_subset_length(tvb, 1, header_length-1);
/* Get data of header with first byte removed. */
- data = (guint8 *)tvb_memdup(wmem_packet_scope(), headtvb, 0, header_length-1);
+ data = (uint8_t *)tvb_memdup(wmem_packet_scope(), headtvb, 0, header_length-1);
/* Remove first 4 bits of the remaining data which are Header CRC cont. */
data[0] = data[0] & 0x0f;
crc = crc11_307_noreflect_noxor(data, header_length-1);
if (header_crc == crc) {
proto_item_append_text(pi, " [correct]");
- return TRUE;
+ return true;
} else {
proto_item_append_text(pi, " [incorrect, should be 0x%x]", crc);
expert_add_info(pinfo, pi, &ei_fp_bad_header_checksum);
- return FALSE;
+ return false;
}
}
@@ -694,11 +694,11 @@ dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int chan, num_tbs = 0;
int bit_offset = 0;
int crci_bit_offset = (offset+1)<<3; /* Current offset + Quality estimate of 1 byte at the end*/
- guint data_bits = 0;
- guint8 crci_bit = 0;
+ unsigned data_bits = 0;
+ uint8_t crci_bit = 0;
proto_item *tree_ti = NULL;
proto_tree *data_tree = NULL;
- gboolean dissected = FALSE;
+ bool dissected = false;
/* Add data subtree */
tree_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA);
@@ -740,8 +740,6 @@ dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Show TBs from non-empty channels */
- pinfo->fd->subnum = chan; /* set subframe number to current TB */
-
for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++) {
proto_item *ti;
@@ -782,7 +780,7 @@ dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/****************/
/* TODO: maybe this decision can be based only on info available in fp_info */
call_dissector_with_data(*data_handle, next_tvb, pinfo, top_level_tree, data);
- dissected = TRUE;
+ dissected = true;
} else {
proto_tree_add_expert(tree, pinfo, &ei_fp_crci_no_subdissector, tvb, offset + bit_offset/8,
((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8);
@@ -802,7 +800,7 @@ dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- if (dissected == FALSE) {
+ if (dissected == false) {
col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bits in %u tbs)",
data_bits, num_tbs);
}
@@ -824,14 +822,14 @@ dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
Length is in bits, and payload is offset by 4 bits of padding */
static int
dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- int offset, guint16 length, guint16 number_of_pdus,
+ int offset, uint16_t length, uint16_t number_of_pdus,
struct fp_info *p_fp_info, void *data)
{
int pdu;
int bit_offset = 0;
proto_item *pdus_ti = NULL;
proto_tree *data_tree = NULL;
- gboolean dissected = FALSE;
+ bool dissected = false;
/* Add data subtree */
pdus_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA);
@@ -862,14 +860,13 @@ dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_item_set_text(pdu_ti, "MAC-d PDU (PDU %u)", pdu+1);
}
- pinfo->fd->subnum = pdu; /* set subframe number to current TB */
p_fp_info->cur_tb = pdu; /*Set TB (PDU) index correctly*/
if (preferences_call_mac_dissectors) {
tvbuff_t *next_tvb;
next_tvb = tvb_new_subset_length_caplen(tvb, offset + bit_offset/8,
((bit_offset % 8) + length + 7)/8, -1);
call_dissector_with_data(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree, data);
- dissected = TRUE;
+ dissected = true;
}
/* Advance bit offset */
@@ -888,7 +885,7 @@ dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += (bit_offset / 8);
/* Show summary in info column */
- if (dissected == FALSE) {
+ if (dissected == false) {
col_append_fstr(pinfo->cinfo, COL_INFO, " %u PDUs of %u bits",
number_of_pdus, length);
}
@@ -901,14 +898,14 @@ dissect_macd_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
Length is in bytes, and payload is byte-aligned (no padding) */
static int
dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- int offset, guint16 length, guint16 number_of_pdus,
+ int offset, uint16_t length, uint16_t number_of_pdus,
struct fp_info *fpi, void *data)
{
int pdu;
proto_item *pdus_ti = NULL;
proto_tree *data_tree = NULL;
int first_offset = offset;
- gboolean dissected = FALSE;
+ bool dissected = false;
/* Add data subtree */
pdus_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA);
@@ -937,9 +934,8 @@ dissect_macd_pdu_data_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, length);
fpi->cur_tb = pdu; /*Set proper pdu index for MAC and higher layers*/
- pinfo->fd->subnum = pdu;
call_dissector_with_data(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree, data);
- dissected = TRUE;
+ dissected = true;
}
/* Advance offset */
@@ -966,7 +962,7 @@ dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int n, num_tbs;
proto_item *ti = NULL;
proto_tree *crcis_tree = NULL;
- guint errors = 0;
+ unsigned errors = 0;
num_tbs = get_tb_count(p_fp_info);
@@ -980,7 +976,7 @@ dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* CRCIs */
for (n=0; n < num_tbs; n++) {
- int bit = (tvb_get_guint8(tvb, offset+(n/8)) >> (7-(n%8))) & 0x01;
+ int bit = (tvb_get_uint8(tvb, offset+(n/8)) >> (7-(n%8))) & 0x01;
proto_tree_add_item(crcis_tree, hf_fp_crci[n%8], tvb, offset+(n/8),
1, ENC_BIG_ENDIAN);
@@ -1005,8 +1001,8 @@ dissect_crci_bits(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static void
dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *tree, guint8 dch_crc_present,
- int offset, guint header_length)
+ proto_tree *tree, uint8_t dch_crc_present,
+ int offset, unsigned header_length)
{
int crc_size = 0;
int remain = tvb_reported_length_remaining(tvb, offset);
@@ -1026,16 +1022,16 @@ dissect_spare_extension_and_crc(tvbuff_t *tvb, packet_info *pinfo,
}
if (crc_size) {
- guint flags = PROTO_CHECKSUM_NO_FLAGS;
- guint16 calc_crc = 0;
+ unsigned flags = PROTO_CHECKSUM_NO_FLAGS;
+ uint16_t calc_crc = 0;
if (preferences_payload_checksum) {
flags = PROTO_CHECKSUM_VERIFY;
- if ((guint)offset > header_length) {
- guint8 * data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, header_length, offset-header_length);
+ if ((unsigned)offset > header_length) {
+ uint8_t * data = (uint8_t *)tvb_memdup(wmem_packet_scope(), tvb, header_length, offset-header_length);
calc_crc = crc16_8005_noreflect_noxor(data, offset-header_length);
}
}
- if ((guint)offset == header_length && remain == 0) {
+ if ((unsigned)offset == header_length && remain == 0) {
/* 3GPP TS 25.427 and TS 25.435: "The Payload CRC IE may
* only be present if the frame contains payload" (even
* if defined as present at the setup of the transport bearer.)
@@ -1066,11 +1062,11 @@ static int
dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
int offset, struct fp_info *p_fp_info)
{
- gint32 toa;
+ int32_t toa;
proto_item *toa_ti;
if (p_fp_info->channel != CHANNEL_PCH) {
- guint32 cfn;
+ uint32_t cfn;
/* CFN control */
proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn);
@@ -1084,7 +1080,7 @@ dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t
col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa);
}
else {
- guint32 cfn;
+ uint32_t cfn;
/* PCH CFN is 12 bits */
proto_tree_add_item_ret_uint(tree, hf_fp_pch_cfn, tvb, offset, 2, ENC_BIG_ENDIAN, &cfn);
@@ -1100,7 +1096,7 @@ dissect_common_timing_adjustment(packet_info *pinfo, proto_tree *tree, tvbuff_t
col_append_fstr(pinfo->cinfo, COL_INFO, " CFN=%u, ToA=%d", cfn, toa);
}
- expert_add_info_format(pinfo, toa_ti, &ei_fp_timing_adjustmentment_reported, "Timing adjustmentment reported (%.3f ms)", ((float)(toa) / 8));
+ expert_add_info_format(pinfo, toa_ti, &ei_fp_timing_adjustment_reported, "Timing adjustment reported (%.3f ms)", ((float)(toa) / 8));
return offset;
}
@@ -1110,7 +1106,7 @@ dissect_common_dl_node_synchronisation(packet_info *pinfo, proto_tree *tree,
tvbuff_t *tvb, int offset)
{
/* T1 (3 bytes) */
- guint32 encoded = tvb_get_ntoh24(tvb, offset);
+ uint32_t encoded = tvb_get_ntoh24(tvb, offset);
float t1 = encoded * (float)0.125;
proto_tree_add_float_format_value(tree, hf_fp_t1, tvb, offset, 3, t1, "%.3f ms (%u)", t1, encoded);
offset += 3;
@@ -1124,7 +1120,7 @@ static int
dissect_common_ul_node_synchronisation(packet_info *pinfo, proto_tree *tree,
tvbuff_t *tvb, int offset)
{
- guint32 encoded;
+ uint32_t encoded;
float t1, t2, t3;
/* T1 (3 bytes) */
@@ -1155,7 +1151,7 @@ static int
dissect_common_dl_synchronisation(packet_info *pinfo, proto_tree *tree,
tvbuff_t *tvb, int offset, struct fp_info *p_fp_info)
{
- guint32 cfn;
+ uint32_t cfn;
if (p_fp_info->channel != CHANNEL_PCH) {
/* CFN control */
@@ -1185,15 +1181,15 @@ dissect_common_ul_synchronisation(packet_info *pinfo, proto_tree *tree,
static int
dissect_common_timing_advance(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
{
- guint32 cfn;
- guint16 timing_advance;
+ uint32_t cfn;
+ uint16_t timing_advance;
/* CFN control */
proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn);
offset++;
/* Timing Advance */
- timing_advance = (tvb_get_guint8(tvb, offset) & 0x3f) * 4;
+ timing_advance = (tvb_get_uint8(tvb, offset) & 0x3f) * 4;
proto_tree_add_uint(tree, hf_fp_timing_advance, tvb, offset, 1, timing_advance);
offset++;
@@ -1207,11 +1203,11 @@ static int
dissect_hsdpa_capacity_request(packet_info *pinfo, proto_tree *tree,
tvbuff_t *tvb, int offset)
{
- guint8 priority;
- guint16 user_buffer_size;
+ uint8_t priority;
+ uint16_t user_buffer_size;
/* CmCH-PI */
- priority = (tvb_get_guint8(tvb, offset) & 0x0f);
+ priority = (tvb_get_uint8(tvb, offset) & 0x0f);
proto_tree_add_item(tree, hf_fp_cmch_pi, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -1233,10 +1229,10 @@ dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
{
proto_item *ti;
proto_item *rate_ti;
- guint16 max_pdu_length;
- guint8 repetition_period;
- guint8 interval;
- guint64 credits;
+ uint16_t max_pdu_length;
+ uint8_t repetition_period;
+ uint8_t interval;
+ uint64_t credits;
/* Congestion status (introduced sometime during R6...) */
if ((p_fp_info->release == 6) || (p_fp_info->release == 7)) {
@@ -1268,7 +1264,7 @@ dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
}
/* HS-DSCH Interval */
- interval = tvb_get_guint8(tvb, offset);
+ interval = tvb_get_uint8(tvb, offset);
ti = proto_tree_add_uint(tree, hf_fp_hsdsch_interval, tvb, offset, 1, interval*10);
offset++;
if (interval == 0) {
@@ -1276,7 +1272,7 @@ dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
}
/* HS-DSCH Repetition period */
- repetition_period = tvb_get_guint8(tvb, offset);
+ repetition_period = tvb_get_uint8(tvb, offset);
ti = proto_tree_add_item(tree, hf_fp_hsdsch_repetition_period, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
if (repetition_period == 0) {
@@ -1292,14 +1288,14 @@ dissect_hsdpa_capacity_allocation(packet_info *pinfo, proto_tree *tree,
if (interval != 0) {
/* Cast on credits is safe, since we know it won't exceed 10^11 */
rate_ti = proto_tree_add_uint(tree, hf_fp_hsdsch_calculated_rate, tvb, 0, 0,
- (guint16)credits * max_pdu_length * (1000 / (interval*10)));
+ (uint16_t)credits * max_pdu_length * (1000 / (interval*10)));
proto_item_set_generated(rate_ti);
}
}
col_append_fstr(pinfo->cinfo, COL_INFO,
" Max-PDU-len=%u Credits=%u Interval=%u Rep-Period=%u",
- max_pdu_length, (guint16)credits, interval, repetition_period);
+ max_pdu_length, (uint16_t)credits, interval, repetition_period);
return offset;
}
@@ -1310,10 +1306,10 @@ dissect_hsdpa_capacity_allocation_type_2(packet_info *pinfo, proto_tree *tree,
{
proto_item *ti;
proto_item *rate_ti;
- guint16 max_pdu_length;
- guint8 repetition_period;
- guint8 interval;
- guint16 credits;
+ uint16_t max_pdu_length;
+ uint8_t repetition_period;
+ uint8_t interval;
+ uint16_t credits;
/* Congestion status */
proto_tree_add_bits_item(tree, hf_fp_congestion_status, tvb,
@@ -1346,7 +1342,7 @@ dissect_hsdpa_capacity_allocation_type_2(packet_info *pinfo, proto_tree *tree,
}
/* HS-DSCH Interval */
- interval = tvb_get_guint8(tvb, offset);
+ interval = tvb_get_uint8(tvb, offset);
ti = proto_tree_add_uint(tree, hf_fp_hsdsch_interval, tvb, offset, 1, interval*10);
offset++;
if (interval == 0) {
@@ -1354,7 +1350,7 @@ dissect_hsdpa_capacity_allocation_type_2(packet_info *pinfo, proto_tree *tree,
}
/* HS-DSCH Repetition period */
- repetition_period = tvb_get_guint8(tvb, offset);
+ repetition_period = tvb_get_uint8(tvb, offset);
ti = proto_tree_add_item(tree, hf_fp_hsdsch_repetition_period, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
if (repetition_period == 0) {
@@ -1387,22 +1383,22 @@ static int
dissect_common_dynamic_pusch_assignment(packet_info *pinfo, proto_tree *tree,
tvbuff_t *tvb, int offset)
{
- guint8 pusch_set_id;
- guint8 activation_cfn;
- guint8 duration;
+ uint8_t pusch_set_id;
+ uint8_t activation_cfn;
+ uint8_t duration;
/* PUSCH Set Id */
- pusch_set_id = tvb_get_guint8(tvb, offset);
+ pusch_set_id = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tree, hf_fp_pusch_set_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Activation CFN */
- activation_cfn = tvb_get_guint8(tvb, offset);
+ activation_cfn = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tree, hf_fp_activation_cfn, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Duration */
- duration = tvb_get_guint8(tvb, offset) * 10;
+ duration = tvb_get_uint8(tvb, offset) * 10;
proto_tree_add_uint(tree, hf_fp_duration, tvb, offset, 1, duration);
offset++;
@@ -1423,7 +1419,7 @@ dissect_common_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info)
{
/* Common control frame type */
- guint8 control_frame_type = tvb_get_guint8(tvb, offset);
+ uint8_t control_frame_type = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tree, hf_fp_common_control_frame_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -1483,10 +1479,10 @@ static void
dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info, void *data)
{
- guint32 ft;
- guint32 header_crc = 0;
+ uint32_t ft;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
- guint header_length;
+ unsigned header_length;
/* Header CRC */
header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc);
@@ -1502,23 +1498,23 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* For control frame the header CRC is actually frame CRC covering all
* bytes except the first */
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
}
else {
- guint8 cfn;
- guint32 encoded;
- guint32 propagation_delay = 0;
+ uint8_t cfn;
+ uint32_t encoded;
+ uint32_t propagation_delay = 0;
proto_item *propagation_delay_ti = NULL;
- guint32 received_sync_ul_timing_deviation = 0;
+ uint32_t received_sync_ul_timing_deviation = 0;
proto_item *received_sync_ul_timing_deviation_ti = NULL;
proto_item *rx_timing_deviation_ti = NULL;
- guint16 rx_timing_deviation = 0;
+ uint16_t rx_timing_deviation = 0;
/* DATA */
/* CFN */
- cfn = tvb_get_guint8(tvb, offset);
+ cfn = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -1530,7 +1526,7 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (p_fp_info->channel == CHANNEL_RACH_FDD) {
/* Propagation delay */
- encoded = tvb_get_guint8(tvb, offset);
+ encoded = tvb_get_uint8(tvb, offset);
propagation_delay = encoded * 3;
propagation_delay_ti = proto_tree_add_uint_format(tree, hf_fp_propagation_delay, tvb, offset, 1,
propagation_delay, "Propagation Delay: %u chips (%u)",
@@ -1541,14 +1537,14 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Should be TDD 3.84 or 7.68 */
if (p_fp_info->channel == CHANNEL_RACH_TDD) {
/* Rx Timing Deviation */
- rx_timing_deviation = tvb_get_guint8(tvb, offset);
+ rx_timing_deviation = tvb_get_uint8(tvb, offset);
rx_timing_deviation_ti = proto_tree_add_item(tree, hf_fp_rx_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
}
if (p_fp_info->channel == CHANNEL_RACH_TDD_128) {
/* Received SYNC UL Timing Deviation */
- received_sync_ul_timing_deviation = tvb_get_guint8(tvb, offset);
+ received_sync_ul_timing_deviation = tvb_get_uint8(tvb, offset);
received_sync_ul_timing_deviation_ti =
proto_tree_add_item(tree, hf_fp_received_sync_ul_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -1568,20 +1564,20 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
(tvb_reported_length_remaining(tvb, offset) > 2))
{
int n;
- guint8 flags;
- /* guint8 flag_bytes = 0; */
+ uint8_t flags;
+ /* uint8_t flag_bytes = 0; */
- gboolean cell_portion_id_present = FALSE;
- gboolean ext_propagation_delay_present = FALSE;
- gboolean angle_of_arrival_present = FALSE;
- gboolean ext_rx_sync_ul_timing_deviation_present = FALSE;
- gboolean ext_rx_timing_deviation_present = FALSE;
+ bool cell_portion_id_present = false;
+ bool ext_propagation_delay_present = false;
+ bool angle_of_arrival_present = false;
+ bool ext_rx_sync_ul_timing_deviation_present = false;
+ bool ext_rx_timing_deviation_present = false;
/* New IE flags (assume mandatory for now) */
do {
proto_item *new_ie_flags_ti;
proto_tree *new_ie_flags_tree;
- guint ies_found = 0;
+ unsigned ies_found = 0;
/* Add new IE flags subtree */
new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_rach_new_ie_flags, tvb, offset, 1,
@@ -1589,7 +1585,7 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_rach_new_ie_flags);
/* Read next byte */
- flags = tvb_get_guint8(tvb, offset);
+ flags = tvb_get_uint8(tvb, offset);
/* flag_bytes++ */
/* Dissect individual bits */
@@ -1599,13 +1595,13 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
switch (p_fp_info->division) {
case Division_FDD:
/* Ext propagation delay */
- ext_propagation_delay_present = TRUE;
+ ext_propagation_delay_present = true;
proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_propagation_delay_present,
tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case Division_TDD_128:
/* Ext Rx Sync UL Timing */
- ext_rx_sync_ul_timing_deviation_present = TRUE;
+ ext_rx_sync_ul_timing_deviation_present = true;
proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_rx_sync_ul_timing_deviation_present,
tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1621,20 +1617,20 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
switch (p_fp_info->division) {
case Division_FDD:
/* Cell Portion ID */
- cell_portion_id_present = TRUE;
+ cell_portion_id_present = true;
proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_cell_portion_id_present,
tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case Division_TDD_128:
/* AOA */
- angle_of_arrival_present = TRUE;
+ angle_of_arrival_present = true;
proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_angle_of_arrival_present,
tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case Division_TDD_384:
case Division_TDD_768:
/* Extended Rx Timing Deviation */
- ext_rx_timing_deviation_present = TRUE;
+ ext_rx_timing_deviation_present = true;
proto_tree_add_item(new_ie_flags_tree, hf_fp_rach_ext_rx_timing_deviation_present,
tvb, offset, 1, ENC_BIG_ENDIAN);
break;
@@ -1667,8 +1663,8 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Ext Rx Timing Deviation */
if (ext_rx_timing_deviation_present) {
- guint8 extra_bits;
- guint bits_to_extend;
+ uint8_t extra_bits;
+ unsigned bits_to_extend;
switch (p_fp_info->division) {
case Division_TDD_384:
bits_to_extend = 1;
@@ -1682,7 +1678,7 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
bits_to_extend = 1;
break;
}
- extra_bits = tvb_get_guint8(tvb, offset) &
+ extra_bits = tvb_get_uint8(tvb, offset) &
((bits_to_extend == 1) ? 0x01 : 0x03);
rx_timing_deviation = (extra_bits << 8) | (rx_timing_deviation);
proto_item_append_text(rx_timing_deviation_ti,
@@ -1695,7 +1691,7 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Ext propagation delay. */
if (ext_propagation_delay_present) {
- guint16 extra_bits = tvb_get_ntohs(tvb, offset) & 0x03ff;
+ uint16_t extra_bits = tvb_get_ntohs(tvb, offset) & 0x03ff;
proto_tree_add_item(tree, hf_fp_ext_propagation_delay, tvb, offset, 2, ENC_BIG_ENDIAN);
/* Adding 10 bits to original 8 */
@@ -1712,7 +1708,7 @@ dissect_rach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Ext. Rx Sync UL Timing Deviation */
if (ext_rx_sync_ul_timing_deviation_present) {
- guint16 extra_bits;
+ uint16_t extra_bits;
/* Ext received Sync UL Timing Deviation */
extra_bits = tvb_get_ntohs(tvb, offset) & 0x1fff;
@@ -1739,10 +1735,10 @@ static void
dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info, void *data)
{
- guint32 ft;
- guint32 header_crc = 0;
+ uint32_t ft;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
- guint header_length;
+ unsigned header_length;
/* Header CRC */
header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc);
@@ -1758,15 +1754,15 @@ dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* For control frame the header CRC is actually frame CRC covering all
* bytes except the first */
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
}
else {
- guint8 cfn;
+ uint8_t cfn;
/* DATA */
/* CFN */
- cfn = tvb_get_guint8(tvb, offset);
+ cfn = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tree, hf_fp_cfn, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -1778,7 +1774,7 @@ dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Transmit power level */
proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1,
- (float)(int)(tvb_get_guint8(tvb, offset)) / 10);
+ (float)(int)(tvb_get_uint8(tvb, offset)) / 10);
offset++;
header_length = offset;
@@ -1789,8 +1785,8 @@ dissect_fach_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if ((p_fp_info->release == 7) &&
(tvb_reported_length_remaining(tvb, offset) > 2)) {
- guint8 flags = tvb_get_guint8(tvb, offset);
- guint8 aoa_present = flags & 0x01;
+ uint8_t flags = tvb_get_uint8(tvb, offset);
+ uint8_t aoa_present = flags & 0x01;
offset++;
if (aoa_present) {
@@ -1813,7 +1809,7 @@ static void
dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info)
{
- guint32 ft;
+ uint32_t ft;
/* Header CRC */
proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1828,8 +1824,8 @@ dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
}
else {
- guint32 cfn;
- guint header_length = 0;
+ uint32_t cfn;
+ unsigned header_length = 0;
/* DATA */
@@ -1851,7 +1847,7 @@ dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Power offset */
proto_tree_add_float(tree, hf_fp_power_offset, tvb, offset, 1,
(float)(-32.0) +
- ((float)(int)(tvb_get_guint8(tvb, offset)) * (float)(0.25)));
+ ((float)(int)(tvb_get_uint8(tvb, offset)) * (float)(0.25)));
offset++;
/* Code number */
@@ -1876,7 +1872,7 @@ dissect_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Transmit power level */
proto_tree_add_float(tree, hf_fp_transmit_power_level, tvb, offset, 1,
- (float)(int)(tvb_get_guint8(tvb, offset)) / 10);
+ (float)(int)(tvb_get_uint8(tvb, offset)) / 10);
offset++;
}
header_length = offset;
@@ -1895,7 +1891,7 @@ static void
dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info)
{
- guint32 ft;
+ uint32_t ft;
/* Header CRC */
proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1910,10 +1906,10 @@ dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
}
else {
- guint cfn;
- guint16 rx_timing_deviation;
+ unsigned cfn;
+ uint16_t rx_timing_deviation;
proto_item *rx_timing_deviation_ti;
- guint header_length = 0;
+ unsigned header_length = 0;
/* DATA */
@@ -1928,7 +1924,7 @@ dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset++;
/* Rx Timing Deviation */
- rx_timing_deviation = tvb_get_guint8(tvb, offset);
+ rx_timing_deviation = tvb_get_uint8(tvb, offset);
rx_timing_deviation_ti = proto_tree_add_item(tree, hf_fp_rx_timing_deviation,
tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -1947,12 +1943,12 @@ dissect_usch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if ((p_fp_info->release == 7) &&
(tvb_reported_length_remaining(tvb, offset) > 2)) {
- guint8 flags = tvb_get_guint8(tvb, offset);
- guint8 bits_extended = flags & 0x01;
+ uint8_t flags = tvb_get_uint8(tvb, offset);
+ uint8_t bits_extended = flags & 0x01;
offset++;
if (bits_extended) {
- guint8 extra_bits = tvb_get_guint8(tvb, offset) & 0x03;
+ uint8_t extra_bits = tvb_get_uint8(tvb, offset) & 0x03;
proto_item_append_text(rx_timing_deviation_ti,
" (extended to %u)",
(rx_timing_deviation << 2) | extra_bits);
@@ -1973,11 +1969,11 @@ static void
dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info, void *data)
{
- guint32 ft;
- guint16 pch_cfn;
- guint32 tfi;
- gboolean paging_indication;
- guint32 header_crc = 0;
+ uint32_t ft;
+ uint16_t pch_cfn;
+ uint32_t tfi;
+ bool paging_indication;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
/* Header CRC */
@@ -1994,11 +1990,11 @@ dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* For control frame the header CRC is actually frame CRC covering all
* bytes except the first */
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
}
else {
- guint header_length = 0;
+ unsigned header_length = 0;
/* DATA */
/* 12-bit CFN value */
@@ -2010,7 +2006,7 @@ dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Paging indication */
proto_tree_add_item(tree, hf_fp_pch_pi, tvb, offset, 1, ENC_BIG_ENDIAN);
- paging_indication = tvb_get_guint8(tvb, offset) & 0x01;
+ paging_indication = tvb_get_uint8(tvb, offset) & 0x01;
offset++;
/* 5-bit TFI */
@@ -2030,7 +2026,7 @@ dissect_pch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
paging_indications_info_t* current_pi_info;
current_pi_info = wmem_new0(wmem_file_scope(), paging_indications_info_t);
current_pi_info->frame_number = pinfo->num;
- current_pi_info->paging_indications_bitmap = (guint8*)tvb_memdup(wmem_file_scope(), tvb, offset, (p_fp_info->paging_indications+7) / 8);
+ current_pi_info->paging_indications_bitmap = (uint8_t*)tvb_memdup(wmem_file_scope(), tvb, offset, (p_fp_info->paging_indications+7) / 8);
p_fp_info->current_paging_indications = current_pi_info;
}
@@ -2087,7 +2083,7 @@ static void
dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info)
{
- guint32 ft;
+ uint32_t ft;
/* Header CRC */
proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2102,10 +2098,10 @@ dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_common_control(tvb, pinfo, tree, offset, p_fp_info);
}
else {
- guint cfn;
- guint32 encoded;
- guint header_length = 0;
- guint32 propagation_delay = 0;
+ unsigned cfn;
+ uint32_t encoded;
+ unsigned header_length = 0;
+ uint32_t propagation_delay = 0;
/* DATA */
@@ -2120,7 +2116,7 @@ dissect_cpch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset++;
/* Propagation delay */
- encoded = tvb_get_guint8(tvb, offset);
+ encoded = tvb_get_uint8(tvb, offset);
propagation_delay = encoded * 3;
proto_tree_add_uint_format_value(tree, hf_fp_propagation_delay, tvb, offset, 1,
propagation_delay, "Propagation Delay: %u chips (%u)",
@@ -2145,7 +2141,7 @@ static void
dissect_bch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info)
{
- guint32 ft;
+ uint32_t ft;
/* Header CRC */
proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2168,7 +2164,7 @@ static void
dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info)
{
- guint32 ft;
+ uint32_t ft;
/* Header CRC */
proto_tree_add_item(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -2196,8 +2192,8 @@ dissect_iur_dsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
static int
dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
{
- guint32 cfn;
- gint16 toa;
+ uint32_t cfn;
+ int16_t toa;
proto_item *toa_ti;
/* CFN control */
@@ -2209,7 +2205,7 @@ dissect_dch_timing_adjustment(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv
toa_ti = proto_tree_add_item(tree, hf_fp_toa, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- expert_add_info_format(pinfo, toa_ti, &ei_fp_timing_adjustmentment_reported, "Timing adjustmentment reported (%.3f ms)", ((float)(toa) / 8));
+ expert_add_info_format(pinfo, toa_ti, &ei_fp_timing_adjustment_reported, "Timing adjustment reported (%.3f ms)", ((float)(toa) / 8));
col_append_fstr(pinfo->cinfo, COL_INFO,
" CFN = %u, ToA = %d", cfn, toa);
@@ -2222,8 +2218,8 @@ dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
tvbuff_t *tvb, int offset,
struct fp_info *p_fp_info)
{
- guint16 timing_deviation;
- gint timing_deviation_chips;
+ uint16_t timing_deviation;
+ int timing_deviation_chips;
proto_item *timing_deviation_ti;
/* CFN control */
@@ -2231,7 +2227,7 @@ dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
offset++;
/* Rx Timing Deviation */
- timing_deviation = tvb_get_guint8(tvb, offset);
+ timing_deviation = tvb_get_uint8(tvb, offset);
timing_deviation_ti = proto_tree_add_item(tree, hf_fp_dch_rx_timing_deviation, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -2240,8 +2236,8 @@ dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
(tvb_reported_length_remaining(tvb, offset) >= 2)) {
/* New IE flags */
- guint64 extended_bits_present;
- guint64 e_rucch_present;
+ uint64_t extended_bits_present;
+ uint64_t e_rucch_present;
/* Read flags */
proto_tree_add_bits_ret_val(tree, hf_fp_e_rucch_present, tvb,
@@ -2280,8 +2276,8 @@ dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
- 2 bits (7.68 TDD)
*/
if (extended_bits_present) {
- guint8 extra_bits;
- guint bits_to_extend;
+ uint8_t extra_bits;
+ unsigned bits_to_extend;
switch (p_fp_info->division) {
case Division_TDD_384:
bits_to_extend = 1;
@@ -2295,7 +2291,7 @@ dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
bits_to_extend = 1;
break;
}
- extra_bits = tvb_get_guint8(tvb, offset) &
+ extra_bits = tvb_get_uint8(tvb, offset) &
((bits_to_extend == 1) ? 0x01 : 0x03);
timing_deviation = (extra_bits << 8) | (timing_deviation);
proto_item_append_text(timing_deviation_ti,
@@ -2320,7 +2316,7 @@ dissect_dch_rx_timing_deviation(packet_info *pinfo, proto_tree *tree,
static int
dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
{
- guint32 cfn;
+ uint32_t cfn;
/* CFN control */
proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn);
@@ -2334,8 +2330,8 @@ dissect_dch_dl_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *t
static int
dissect_dch_ul_synchronisation(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
{
- guint32 cfn;
- gint16 toa;
+ uint32_t cfn;
+ int16_t toa;
/* CFN control */
proto_tree_add_item_ret_uint(tree, hf_fp_cfn_control, tvb, offset, 1, ENC_BIG_ENDIAN, &cfn);
@@ -2356,7 +2352,7 @@ static int
dissect_dch_outer_loop_power_control(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
{
/* UL SIR target */
- guint8 encoded = tvb_get_guint8(tvb, offset);
+ uint8_t encoded = tvb_get_uint8(tvb, offset);
float target = (float)-8.2 + ((float)0.1 * (float)(int)(encoded));
proto_tree_add_float_format_value(tree, hf_fp_ul_sir_target, tvb, offset, 1, target, "%.1f dB (%u)", target, encoded);
offset++;
@@ -2382,9 +2378,9 @@ static int
dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
float tpc_po;
- gint8 max_tx_pwr;
+ int8_t max_tx_pwr;
int n;
- guint8 encoded;
+ uint8_t encoded;
/* Show defined flags in these 2 bytes */
for (n=4; n >= 0; n--) {
@@ -2400,7 +2396,7 @@ dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinf
proto_tree_add_item(tree, hf_fp_dpc_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
/* TPC PO */
- encoded = tvb_get_guint8(tvb, offset) & 0x1f;
+ encoded = tvb_get_uint8(tvb, offset) & 0x1f;
tpc_po = (float)encoded * 0.25f;
proto_tree_add_float_format_value(tree, hf_fp_tpc_po, tvb, offset, 1, tpc_po,
"%.2f dB (%u)", tpc_po, encoded);
@@ -2411,7 +2407,7 @@ dissect_dch_radio_interface_parameter_update(proto_tree *tree, packet_info *pinf
offset += 2;
/* Maximum UE TX Power */
- encoded = tvb_get_guint8(tvb, offset) & 0x7f;
+ encoded = tvb_get_uint8(tvb, offset) & 0x7f;
max_tx_pwr = -55 + encoded;
proto_tree_add_int_format(tree, hf_fp_max_ue_tx_pow, tvb, offset, 1, max_tx_pwr,
"%d dBm (%u)", max_tx_pwr, encoded);
@@ -2424,8 +2420,8 @@ static int
dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
tvbuff_t *tvb, int offset, struct fp_info *p_fp_info)
{
- guint32 cfn;
- guint16 timing_advance;
+ uint32_t cfn;
+ uint16_t timing_advance;
proto_item *timing_advance_ti;
/* CFN control */
@@ -2433,7 +2429,7 @@ dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
offset++;
/* Timing Advance */
- timing_advance = (tvb_get_guint8(tvb, offset) & 0x3f) * 4;
+ timing_advance = (tvb_get_uint8(tvb, offset) & 0x3f) * 4;
timing_advance_ti = proto_tree_add_uint(tree, hf_fp_timing_advance, tvb, offset, 1, timing_advance);
offset++;
@@ -2441,12 +2437,12 @@ dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
(tvb_reported_length_remaining(tvb, offset) > 0)) {
/* New IE flags */
- guint8 flags = tvb_get_guint8(tvb, offset);
- guint8 extended_bits = flags & 0x01;
+ uint8_t flags = tvb_get_uint8(tvb, offset);
+ uint8_t extended_bits = flags & 0x01;
offset++;
if (extended_bits) {
- guint8 extra_bit = tvb_get_guint8(tvb, offset) & 0x01;
+ uint8_t extra_bit = tvb_get_uint8(tvb, offset) & 0x01;
proto_item_append_text(timing_advance_ti, " (extended to %u)",
(timing_advance << 1) | extra_bit);
}
@@ -2462,7 +2458,7 @@ dissect_dch_timing_advance(proto_tree *tree, packet_info *pinfo,
static int
dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset)
{
- guint64 status;
+ uint64_t status;
/* Congestion status */
proto_tree_add_bits_ret_val(tree, hf_fp_congestion_status, tvb,
@@ -2470,7 +2466,7 @@ dissect_dch_tnl_congestion_indication(proto_tree *tree, packet_info *pinfo, tvbu
offset++;
col_append_fstr(pinfo->cinfo, COL_INFO, " status = %s",
- val_to_str_const((guint16)status, congestion_status_vals, "unknown"));
+ val_to_str_const((uint16_t)status, congestion_status_vals, "unknown"));
return offset;
}
@@ -2484,7 +2480,7 @@ dissect_dch_control_frame(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, struct fp_info *p_fp_info)
{
/* Control frame type */
- guint8 control_frame_type = tvb_get_guint8(tvb, offset);
+ uint8_t control_frame_type = tvb_get_uint8(tvb, offset);
proto_tree_add_item(tree, hf_fp_dch_control_frame_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -2536,10 +2532,10 @@ static void
dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info, void *data)
{
- guint32 ft;
- guint32 cfn;
- guint header_length;
- guint32 header_crc = 0;
+ uint32_t ft;
+ uint32_t cfn;
+ unsigned header_length;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
/* Header CRC */
@@ -2560,7 +2556,7 @@ dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* For control frame the header CRC is actually frame CRC covering all
* bytes except the first */
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
} else {
/************************/
@@ -2602,18 +2598,18 @@ dissect_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
static void
dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info,
- gboolean is_common,
+ bool is_common,
void *data)
{
- guint32 ft;
- guint8 number_of_subframes;
- guint32 cfn;
+ uint32_t ft;
+ uint8_t number_of_subframes;
+ uint32_t cfn;
int n;
struct edch_t1_subframe_info subframes[16];
- guint32 header_crc = 0;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
proto_item * item;
- guint header_length;
+ unsigned header_length;
rlc_info * rlcinf;
if (p_fp_info->edch_type == 1) {
@@ -2625,7 +2621,7 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
header_crc = (tvb_get_bits8(tvb, offset*8, 7) << 4) + tvb_get_bits8(tvb, offset*8+8, 4);
/* Frame Type */
- ft = tvb_get_guint8(tvb, offset) & 0x01;
+ ft = tvb_get_uint8(tvb, offset) & 0x01;
col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] ", val_to_str_const(ft, frame_type_vals, "Unknown"));
@@ -2638,17 +2634,17 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_fp_ft, tvb, 0, 1, ENC_BIG_ENDIAN);
offset++;
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
dissect_dch_control_frame(tree, pinfo, tvb, offset, p_fp_info);
}
else {
/********************************/
/* E-DCH data here */
- guint bit_offset;
- guint total_pdus = 0;
- guint total_bits = 0;
- gboolean dissected = FALSE;
+ unsigned bit_offset;
+ unsigned total_pdus = 0;
+ unsigned total_bits = 0;
+ bool dissected = false;
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0);
if (!rlcinf) {
@@ -2682,11 +2678,11 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
((p_fp_info->release_year == 2005) && (p_fp_info->release_month >= 9)))) {
/* Use 4 bits plus offset of 1 */
- number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x0f) + 1;
+ number_of_subframes = (tvb_get_uint8(tvb, offset) & 0x0f) + 1;
}
else {
/* Use 3 bits only */
- number_of_subframes = (tvb_get_guint8(tvb, offset) & 0x07);
+ number_of_subframes = (tvb_get_uint8(tvb, offset) & 0x07);
}
proto_tree_add_uint(tree, hf_fp_edch_number_of_subframes, tvb, offset, 1,
number_of_subframes);
@@ -2723,13 +2719,13 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset, 1, ENC_BIG_ENDIAN);
/* Subframe number */
- subframes[n].subframe_number = (tvb_get_guint8(tvb, offset) & 0x07);
+ subframes[n].subframe_number = (tvb_get_uint8(tvb, offset) & 0x07);
proto_tree_add_bits_item(subframe_header_tree, hf_fp_edch_subframe_number, tvb,
offset*8+5, 3, ENC_BIG_ENDIAN);
offset++;
/* Number of MAC-es PDUs */
- subframes[n].number_of_mac_es_pdus = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
+ subframes[n].number_of_mac_es_pdus = (tvb_get_uint8(tvb, offset) & 0xf0) >> 4;
proto_tree_add_item(subframe_header_tree, hf_fp_edch_number_of_mac_es_pdus,
tvb, offset, 1, ENC_BIG_ENDIAN);
bit_offset = 4;
@@ -2740,18 +2736,18 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Details of each MAC-es PDU */
for (i=0; i < subframes[n].number_of_mac_es_pdus; i++) {
- guint64 ddi;
- guint64 n_pdus; /*Size of the PDU*/
+ uint64_t ddi;
+ uint64_t n_pdus; /*Size of the PDU*/
proto_item *ddi_ti;
- gint ddi_size = -1;
+ int ddi_size = -1;
int p;
/* DDI (6 bits) */
ddi_ti = proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_ddi, tvb,
offset*8 + bit_offset, 6, &ddi, ENC_BIG_ENDIAN);
- rlcinf->rbid[i] = (guint8)ddi;
+ rlcinf->rbid[i] = (uint8_t)ddi;
/********************************/
/* Look up data in higher layers*/
/* Look up the size from this DDI value */
@@ -2764,14 +2760,14 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (ddi_size == -1) {
- expert_add_info_format(pinfo, ddi_ti, &ei_fp_ddi_not_defined, "DDI %u not defined for this UE!", (guint)ddi);
+ expert_add_info_format(pinfo, ddi_ti, &ei_fp_ddi_not_defined, "DDI %u not defined for this UE!", (unsigned)ddi);
return;
}
else {
proto_item_append_text(ddi_ti, " (%d bits)", ddi_size);
}
- subframes[n].ddi[i] = (guint8)ddi;
+ subframes[n].ddi[i] = (uint8_t)ddi;
bit_offset += 6;
/* Number of MAC-d PDUs (6 bits) */
@@ -2782,7 +2778,7 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return;
}
- subframes[n].number_of_mac_d_pdus[i] = (guint8)n_pdus;
+ subframes[n].number_of_mac_d_pdus[i] = (uint8_t)n_pdus;
bit_offset += 6;
}
@@ -2797,10 +2793,10 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int i;
proto_item *subframe_ti;
proto_tree *subframe_tree;
- guint bits_in_subframe = 0;
- guint mac_d_pdus_in_subframe = 0;
- guint lchid=0; /*Logcial channel id*/
- guint32 user_identity;
+ unsigned bits_in_subframe = 0;
+ unsigned mac_d_pdus_in_subframe = 0;
+ unsigned lchid=0; /*Logical channel id*/
+ uint32_t user_identity;
umts_mac_info *macinf;
bit_offset = 0;
@@ -2815,9 +2811,9 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
for (i=0; i < subframes[n].number_of_mac_es_pdus; i++) {
int m;
- guint16 size = 0;
- /* guint8 tsn; */
- guint send_size;
+ uint16_t size = 0;
+ /* uint8_t tsn; */
+ unsigned send_size;
proto_item *ti;
int macd_idx;
proto_tree *maces_tree = NULL;
@@ -2854,7 +2850,7 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
bit_offset += 2;
/* TSN */
- /* tsn = (tvb_get_guint8(tvb, offset + (bit_offset/8)) & 0x3f); */
+ /* tsn = (tvb_get_uint8(tvb, offset + (bit_offset/8)) & 0x3f); */
proto_tree_add_item(subframe_tree, hf_fp_edch_tsn, tvb,
offset + (bit_offset/8),
1, ENC_BIG_ENDIAN);
@@ -2886,7 +2882,6 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
tvbuff_t *next_tvb;
- pinfo->fd->subnum = macd_idx; /* set subframe number to current TB */
/* create new TVB and pass further on */
next_tvb = tvb_new_subset_length(tvb, offset + bit_offset/8,
((bit_offset % 8) + size + 7) / 8);
@@ -2896,17 +2891,17 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
macinf->lchid[macd_idx] = lchid;
rlcinf->mode[macd_idx] = lchId_rlc_map[lchid]; /* Set RLC mode by lchid to RLC_MODE map in nbap.h */
- /* Set UE ID to U-RNTI or NBAP Comuncation Context*/
+ /* Set UE ID to U-RNTI or NBAP Communication Context*/
rlcinf->ueid[macd_idx] = user_identity;
rlcinf->rbid[macd_idx] = lchid;
rlcinf->li_size[macd_idx] = RLC_LI_7BITS;
- rlcinf->ciphered[macd_idx] = FALSE;
- rlcinf->deciphered[macd_idx] = FALSE;
- p_fp_info->cur_tb = macd_idx; /*Set the transport block index (NOTE: This and not subnum is used in MAC dissector!)*/
+ rlcinf->ciphered[macd_idx] = false;
+ rlcinf->deciphered[macd_idx] = false;
+ p_fp_info->cur_tb = macd_idx; /*Set the transport block index */
call_dissector_with_data(mac_fdd_edch_handle, next_tvb, pinfo, top_level_tree, data);
- dissected = TRUE;
+ dissected = true;
}
else {
/* Just add as a MAC-d PDU */
@@ -2942,7 +2937,7 @@ dissect_e_dch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Report number of subframes in info column
* do this only if no other dissector was called */
- if (dissected == FALSE) {
+ if (dissected == false) {
col_append_fstr(pinfo->cinfo, COL_INFO,
" CFN = %03u (%u bits in %u pdus in %u subframes)",
cfn, total_bits, total_pdus, number_of_subframes);
@@ -2964,21 +2959,21 @@ static void
dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info,
int number_of_subframes,
- gboolean is_common,
- guint16 header_crc,
+ bool is_common,
+ uint16_t header_crc,
proto_item * header_crc_pi,
void *data)
{
int n;
int pdu_no;
- guint64 total_macis_sdus;
- guint16 macis_sdus_found = 0;
- /* guint16 macis_pdus = 0; */
- gboolean F = TRUE; /* We want to continue loop if get E-RNTI indication... */
- gint bit_offset;
+ uint64_t total_macis_sdus;
+ uint16_t macis_sdus_found = 0;
+ /* uint16_t macis_pdus = 0; */
+ bool F = true; /* We want to continue loop if get E-RNTI indication... */
+ int bit_offset;
proto_item *subframe_macis_descriptors_ti = NULL;
static struct edch_t2_subframe_info subframes[16];
- guint header_length = 0;
+ unsigned header_length = 0;
/* User Buffer size */
proto_tree_add_bits_item(tree, hf_fp_edch_user_buffer_size, tvb, offset*8,
18, ENC_BIG_ENDIAN);
@@ -3000,8 +2995,8 @@ dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
bit_offset = offset*8;
/* EDCH subframe header list */
for (n=0; n < number_of_subframes; n++) {
- guint64 subframe_number;
- guint64 no_of_macis_pdus;
+ uint64_t subframe_number;
+ uint64_t no_of_macis_pdus;
proto_item *subframe_header_ti;
proto_tree *subframe_header_tree;
@@ -3023,14 +3018,14 @@ dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
/* Subframe number */
proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_subframe_number, tvb,
bit_offset, 3, &subframe_number, ENC_BIG_ENDIAN);
- subframes[n].subframe_number = (guint8)subframe_number;
+ subframes[n].subframe_number = (uint8_t)subframe_number;
bit_offset += 3;
/* Number of MAC-is PDUs */
proto_tree_add_bits_ret_val(subframe_header_tree, hf_fp_edch_number_of_mac_is_pdus, tvb,
bit_offset, 4, &no_of_macis_pdus, ENC_BIG_ENDIAN);
bit_offset += 4;
- subframes[n].number_of_mac_is_pdus = (guint8)no_of_macis_pdus;
+ subframes[n].number_of_mac_is_pdus = (uint8_t)no_of_macis_pdus;
/* macis_pdus += subframes[n].number_of_mac_is_pdus; */
/* Next 4 bits are spare for T2*/
@@ -3066,11 +3061,11 @@ dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
do {
/* Check we haven't gone past the limit */
if (macis_sdus_found++ > total_macis_sdus) {
- expert_add_info_format(pinfo, f_ti, &ei_fp_mac_is_sdus_miscount, "Found too many (%u) MAC-is SDUs - header said there were %u", macis_sdus_found, (guint16)total_macis_sdus);
+ expert_add_info_format(pinfo, f_ti, &ei_fp_mac_is_sdus_miscount, "Found too many (%u) MAC-is SDUs - header said there were %u", macis_sdus_found, (uint16_t)total_macis_sdus);
}
/* LCH-ID */
- subframes[n].mac_is_lchid[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
+ subframes[n].mac_is_lchid[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] = (tvb_get_uint8(tvb, offset) & 0xf0) >> 4;
proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_lchid, tvb, offset, 1, ENC_BIG_ENDIAN);
if (subframes[n].mac_is_lchid[pdu_no][subframes[n].number_of_mac_is_sdus[pdu_no]] == 15) {
proto_item *ti;
@@ -3100,7 +3095,7 @@ dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
offset++;
/* Flag */
- F = tvb_get_guint8(tvb, offset) & 0x01;
+ F = tvb_get_uint8(tvb, offset) & 0x01;
f_ti = proto_tree_add_item(subframe_macis_descriptors_tree, hf_fp_edch_macis_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
subframes[n].number_of_mac_is_sdus[pdu_no]++;
@@ -3112,7 +3107,7 @@ dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
/* Check overall count of MAC-is SDUs */
if (macis_sdus_found != total_macis_sdus) {
- expert_add_info_format(pinfo, subframe_macis_descriptors_ti, &ei_fp_mac_is_sdus_miscount, "Frame contains %u MAC-is SDUs - header said there would be %u!", macis_sdus_found, (guint16)total_macis_sdus);
+ expert_add_info_format(pinfo, subframe_macis_descriptors_ti, &ei_fp_mac_is_sdus_miscount, "Frame contains %u MAC-is SDUs - header said there would be %u!", macis_sdus_found, (uint16_t)total_macis_sdus);
}
header_length = offset;
/* Now PDUs */
@@ -3121,7 +3116,7 @@ dissect_e_dch_t2_or_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
/* MAC-is PDU */
for (pdu_no=0; pdu_no < subframes[n].number_of_mac_is_pdus; pdu_no++) {
int i;
- guint length = 0;
+ unsigned length = 0;
umts_mac_is_info * mac_is_info = wmem_new(wmem_file_scope(), umts_mac_is_info);
mac_is_info->number_of_mac_is_sdus = subframes[n].number_of_mac_is_sdus[pdu_no];
@@ -3168,9 +3163,9 @@ static void
dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info, void *data)
{
- guint32 ft;
- guint header_length;
- guint32 header_crc = 0;
+ uint32_t ft;
+ unsigned header_length;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
/* Header CRC */
@@ -3187,17 +3182,17 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* For control frame the header CRC is actually frame CRC covering all
* bytes except the first */
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
}
else {
- guint8 number_of_pdus;
- guint16 pdu_length;
- guint16 user_buffer_size;
+ uint8_t number_of_pdus;
+ uint16_t pdu_length;
+ uint16_t user_buffer_size;
int i;
umts_mac_info *macinf;
rlc_info *rlcinf;
- guint32 user_identity;
+ uint32_t user_identity;
proto_item *item;
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0);
@@ -3216,7 +3211,7 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if ((p_fp_info->release == 6) ||
(p_fp_info->release == 7)) {
- guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
+ uint8_t frame_seq_no = (tvb_get_uint8(tvb, offset) & 0xf0) >> 4;
proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no);
@@ -3243,7 +3238,7 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Num of PDUs */
- number_of_pdus = tvb_get_guint8(tvb, offset);
+ number_of_pdus = tvb_get_uint8(tvb, offset);
item = proto_tree_add_item(tree, hf_fp_num_of_pdu, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
if (number_of_pdus > MAX_MAC_FRAMES) {
@@ -3269,16 +3264,16 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
for (i=0;i<number_of_pdus && i<MIN(MAX_MAC_FRAMES, MAX_RLC_CHANS); i++) {
macinf->content[i] = hsdsch_macdflow_id_mac_content_map[p_fp_info->hsdsch_macflowd_id]; /*MAC_CONTENT_PS_DTCH;*/
macinf->lchid[i] = fake_lchid_macd_flow[p_fp_info->hsdsch_macflowd_id];/*Faked logical channel id 255 used as a mark if it doesn't exist...*/
- macinf->fake_chid[i] = TRUE; /**/
+ macinf->fake_chid[i] = true; /**/
macinf->macdflow_id[i] = p_fp_info->hsdsch_macflowd_id; /*Save the flow ID (+1 to make it human readable (it's zero indexed!))*/
/*Check if this is multiplexed (signaled by RRC)*/
if (p_fp_info->hsdhsch_macfdlow_is_mux[p_fp_info->hsdsch_macflowd_id] ) {
- macinf->ctmux[i] = TRUE;
+ macinf->ctmux[i] = true;
} else if (p_fp_info->hsdsch_macflowd_id == 0) { /*MACd-flow = 0 is often SRB */
expert_add_info(pinfo, NULL, &ei_fp_maybe_srb);
} else {
- macinf->ctmux[i] = FALSE; /*Either it's multiplexed and not signled or it's not MUX*/
+ macinf->ctmux[i] = false; /*Either it's multiplexed and not signalled or it's not MUX*/
}
/* Figure out RLC mode */
@@ -3294,8 +3289,8 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
rlcinf->ueid[i] = user_identity;
rlcinf->li_size[i] = RLC_LI_7BITS;
- rlcinf->deciphered[i] = FALSE;
- rlcinf->ciphered[i] = FALSE;
+ rlcinf->deciphered[i] = false;
+ rlcinf->ciphered[i] = false;
rlcinf->rbid[i] = macinf->lchid[i];
#if 0
@@ -3306,7 +3301,7 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*Indicate we need to reset stream*/
if (p_fp_info->reset_frag) {
rlc_reset_channel(rlcinf->mode[i], macinf->lchid[i], p_fp_info->is_uplink, rlcinf->ueid[i] );
- p_fp_info->reset_frag = FALSE;
+ p_fp_info->reset_frag = false;
}
#endif
@@ -3325,14 +3320,14 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
(tvb_reported_length_remaining(tvb, offset) > 2)) {
int n;
- guint8 flags;
- /* guint8 flag_bytes = 0; */
+ uint8_t flags;
+ /* uint8_t flag_bytes = 0; */
/* New IE flags */
do {
proto_item *new_ie_flags_ti;
proto_tree *new_ie_flags_tree;
- guint ies_found = 0;
+ unsigned ies_found = 0;
/* Add new IE flags subtree */
new_ie_flags_ti = proto_tree_add_string_format(tree, hf_fp_hsdsch_new_ie_flags, tvb, offset, 1,
@@ -3340,7 +3335,7 @@ dissect_hsdsch_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
new_ie_flags_tree = proto_item_add_subtree(new_ie_flags_ti, ett_fp_hsdsch_new_ie_flags);
/* Read next byte */
- flags = tvb_get_guint8(tvb, offset);
+ flags = tvb_get_uint8(tvb, offset);
/* flag_bytes++; */
/* Dissect individual bits */
@@ -3385,10 +3380,10 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
int offset, struct fp_info *p_fp_info,
void *data)
{
- guint32 ft;
- guint32 header_crc = 0;
+ uint32_t ft;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
- guint16 header_length;
+ uint16_t header_length;
/* Header CRC */
header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc);
@@ -3404,26 +3399,26 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* For control frame the header CRC is actually frame CRC covering all
* bytes except the first */
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
}
else {
- guint8 number_of_pdu_blocks;
- gboolean drt_present = FALSE;
- gboolean fach_present = FALSE;
- guint16 user_buffer_size;
+ uint8_t number_of_pdu_blocks;
+ bool drt_present = false;
+ bool fach_present = false;
+ uint16_t user_buffer_size;
int n;
- guint j;
- guint64 lchid_val;
+ unsigned j;
+ uint64_t lchid_val;
#define MAX_PDU_BLOCKS 31
- guint64 lchid_field[MAX_PDU_BLOCKS];
- guint64 pdu_length[MAX_PDU_BLOCKS];
- guint64 no_of_pdus[MAX_PDU_BLOCKS];
+ uint64_t lchid_field[MAX_PDU_BLOCKS];
+ uint64_t pdu_length[MAX_PDU_BLOCKS];
+ uint64_t no_of_pdus[MAX_PDU_BLOCKS];
umts_mac_info *macinf;
rlc_info *rlcinf;
- guint32 user_identity;
+ uint32_t user_identity;
rlcinf = (rlc_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0);
if (!rlcinf) {
@@ -3443,7 +3438,7 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if ((p_fp_info->release == 6) ||
(p_fp_info->release == 7)) {
- guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
+ uint8_t frame_seq_no = (tvb_get_uint8(tvb, offset) & 0xf0) >> 4;
proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no);
@@ -3454,7 +3449,7 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset++;
/* Total number of PDU blocks (5 bits) */
- number_of_pdu_blocks = (tvb_get_guint8(tvb, offset) >> 3);
+ number_of_pdu_blocks = (tvb_get_uint8(tvb, offset) >> 3);
proto_tree_add_item(tree, hf_fp_total_pdu_blocks, tvb, offset, 1, ENC_BIG_ENDIAN);
if (p_fp_info->release == 7) {
@@ -3465,13 +3460,13 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
proto_tree_add_item(tree, hf_fp_fsn_drt_reset, tvb, offset, 1, ENC_BIG_ENDIAN);
/* DRT Indicator */
- drt_present = tvb_get_guint8(tvb, offset) & 0x01;
+ drt_present = tvb_get_uint8(tvb, offset) & 0x01;
proto_tree_add_item(tree, hf_fp_drt_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
}
offset++;
/* FACH Indicator flag */
- fach_present = (tvb_get_guint8(tvb, offset) & 0x80) >> 7;
+ fach_present = (tvb_get_uint8(tvb, offset) & 0x80) >> 7;
proto_tree_add_item(tree, hf_fp_fach_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -3534,9 +3529,9 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* Append summary to header tree root */
proto_item_append_text(pdu_block_header_ti,
" (lch:%u, %u pdus of %u bytes)",
- (guint16)lchid_field[n],
- (guint16)no_of_pdus[n],
- (guint16)pdu_length[n]);
+ (uint16_t)lchid_field[n],
+ (uint16_t)no_of_pdus[n],
+ (uint16_t)pdu_length[n]);
/* Set length of header tree item */
if (((n % 2) == 0) && (n < (number_of_pdu_blocks-1))) {
@@ -3584,17 +3579,17 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if (lchid_field[n] != 0x0f) {
lchid_val = lchid_field[n] + 1; /* Add 1 since 'LCHID' field is zero indexed. ie field value = 0 => Actual L-CHID = 1*/
macinf->content[j] = lchId_type_table[lchid_val];
- macinf->lchid[j] = (guint8)lchid_val;
+ macinf->lchid[j] = (uint8_t)lchid_val;
macinf->macdflow_id[j] = p_fp_info->hsdsch_macflowd_id;
/*Figure out RLC_MODE based on MACd-flow-ID, basically MACd-flow-ID = 0 then it's SRB0 == UM else AM*/
rlcinf->mode[j] = lchId_rlc_map[lchid_val];
- macinf->ctmux[n] = FALSE;
+ macinf->ctmux[n] = false;
rlcinf->li_size[j] = RLC_LI_7BITS;
- rlcinf->ciphered[j] = FALSE;
- rlcinf->deciphered[j] = FALSE;
- rlcinf->rbid[j] = (guint8)lchid_val;
+ rlcinf->ciphered[j] = false;
+ rlcinf->deciphered[j] = false;
+ rlcinf->rbid[j] = (uint8_t)lchid_val;
rlcinf->ueid[j] = user_identity;
}
@@ -3604,12 +3599,12 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
macinf->content[j] = MAC_CONTENT_UNKNOWN;
macinf->lchid[j] = 0; /* LCHID field doesn't reflect a real ID in this case*/
macinf->macdflow_id[j] = 0;
- macinf->ctmux[j] = FALSE;
+ macinf->ctmux[j] = false;
rlcinf->mode[j] = RLC_TM; /* PCCH and BCCH should be using RLC TM? */
rlcinf->li_size[j] = RLC_LI_7BITS;
- rlcinf->ciphered[j] = FALSE;
- rlcinf->deciphered[j] = FALSE;
+ rlcinf->ciphered[j] = false;
+ rlcinf->deciphered[j] = false;
rlcinf->rbid[j] = 0;
rlcinf->ueid[j] = 0;
}
@@ -3617,8 +3612,8 @@ dissect_hsdsch_type_2_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* Add PDU block header subtree */
offset = dissect_macd_pdu_data_type_2(tvb, pinfo, tree, offset,
- (guint16)pdu_length[n],
- (guint16)no_of_pdus[n],
+ (uint16_t)pdu_length[n],
+ (uint16_t)no_of_pdus[n],
p_fp_info, data);
}
if (preferences_header_checksum) {
@@ -3646,10 +3641,10 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
int offset, struct fp_info *p_fp_info,
void *data)
{
- guint32 ft;
- guint32 header_crc = 0;
+ uint32_t ft;
+ uint32_t header_crc = 0;
proto_item * header_crc_pi = NULL;
- guint header_length;
+ unsigned header_length;
/* Header CRC */
header_crc_pi = proto_tree_add_item_ret_uint(tree, hf_fp_header_crc, tvb, offset, 1, ENC_BIG_ENDIAN, &header_crc);
@@ -3665,22 +3660,22 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
/* For control frame the header CRC is actually frame CRC covering all
* bytes except the first */
if (preferences_header_checksum) {
- verify_control_frame_crc(tvb, pinfo, header_crc_pi, (guint16)header_crc);
+ verify_control_frame_crc(tvb, pinfo, header_crc_pi, (uint16_t)header_crc);
}
}
else {
- guint8 number_of_pdu_blocks;
- gboolean drt_present = FALSE;
- gboolean fach_present = FALSE;
- guint16 user_buffer_size;
+ uint8_t number_of_pdu_blocks;
+ bool drt_present = false;
+ bool fach_present = false;
+ uint16_t user_buffer_size;
int n;
- guint j;
+ unsigned j;
#define MAX_PDU_BLOCKS 31
- guint64 lchid[MAX_PDU_BLOCKS];
- guint64 pdu_length[MAX_PDU_BLOCKS];
- guint64 no_of_pdus[MAX_PDU_BLOCKS];
- guint8 newieflags = 0;
+ uint64_t lchid[MAX_PDU_BLOCKS];
+ uint64_t pdu_length[MAX_PDU_BLOCKS];
+ uint64_t no_of_pdus[MAX_PDU_BLOCKS];
+ uint8_t newieflags = 0;
umts_mac_info *macinf;
rlc_info *rlcinf;
@@ -3702,7 +3697,7 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
if ((p_fp_info->release == 6) ||
(p_fp_info->release == 7)) {
- guint8 frame_seq_no = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
+ uint8_t frame_seq_no = (tvb_get_uint8(tvb, offset) & 0xf0) >> 4;
proto_tree_add_item(tree, hf_fp_frame_seq_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, " seqno=%u", frame_seq_no);
@@ -3713,7 +3708,7 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
offset++;
/* Total number of PDU blocks (5 bits) */
- number_of_pdu_blocks = (tvb_get_guint8(tvb, offset) >> 3);
+ number_of_pdu_blocks = (tvb_get_uint8(tvb, offset) >> 3);
proto_tree_add_item(tree, hf_fp_total_pdu_blocks, tvb, offset, 1, ENC_BIG_ENDIAN);
if (p_fp_info->release == 7) {
@@ -3724,13 +3719,13 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
proto_tree_add_item(tree, hf_fp_fsn_drt_reset, tvb, offset, 1, ENC_BIG_ENDIAN);
/* DRT Indicator */
- drt_present = tvb_get_guint8(tvb, offset) & 0x01;
+ drt_present = tvb_get_uint8(tvb, offset) & 0x01;
proto_tree_add_item(tree, hf_fp_drt_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
}
offset++;
/* FACH Indicator flag */
- fach_present = (tvb_get_guint8(tvb, offset) & 0x80) >> 7;
+ fach_present = (tvb_get_uint8(tvb, offset) & 0x80) >> 7;
proto_tree_add_item(tree, hf_fp_fach_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
@@ -3797,9 +3792,9 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
/* Append summary to header tree root */
proto_item_append_text(pdu_block_header_ti,
" (lch:%u, %u pdus of %u bytes)",
- (guint16)lchid[n],
- (guint16)no_of_pdus[n],
- (guint16)pdu_length[n]);
+ (uint16_t)lchid[n],
+ (uint16_t)no_of_pdus[n],
+ (uint16_t)pdu_length[n]);
/* Set length of header tree item */
if (((n % 2) == 0) && (n < (number_of_pdu_blocks-1))) {
@@ -3842,40 +3837,38 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
/* In the very few test cases I've seen, this seems to be
* BCCH with transparent MAC layer. Therefore skip right to
* rlc_bcch and hope for the best. */
- next_tvb = tvb_new_subset_length(tvb, offset, (gint)pdu_length[n]);
+ next_tvb = tvb_new_subset_length(tvb, offset, (int)pdu_length[n]);
call_dissector_with_data(rlc_bcch_handle, next_tvb, pinfo, top_level_tree, data);
- offset += (gint)pdu_length[n];
+ offset += (int)pdu_length[n];
} else { /* Else go for CCCH UM, this seems to work. */
p_fp_info->hsdsch_entity = ehs; /* HSDSCH type 2 */
- /* TODO: use cur_tb or subnum everywhere. */
if (j >= MAX_MAC_FRAMES) {
/* Should not happen as we check no_of_pdus[n]*/
expert_add_info_format(pinfo, tree, &ei_fp_invalid_frame_count, "Invalid frame count (max is %u)", MAX_MAC_FRAMES);
return;
}
- p_fp_info->cur_tb = j; /* set cur_tb for MAC */
- pinfo->fd->subnum = j; /* set subframe number for RRC */
+ p_fp_info->cur_tb = j; /* set cur_tb for MAC and RRC */
macinf->content[j] = MAC_CONTENT_CCCH;
- macinf->lchid[j] = (guint8)lchid[n]+1; /*Add 1 since it is zero indexed? */
+ macinf->lchid[j] = (uint8_t)lchid[n]+1; /*Add 1 since it is zero indexed? */
macinf->macdflow_id[j] = p_fp_info->hsdsch_macflowd_id;
- macinf->ctmux[j] = FALSE;
+ macinf->ctmux[j] = false;
rlcinf->li_size[j] = RLC_LI_7BITS;
- rlcinf->ciphered[j] = FALSE;
- rlcinf->deciphered[j] = FALSE;
- rlcinf->rbid[j] = (guint8)lchid[n]+1;
+ rlcinf->ciphered[j] = false;
+ rlcinf->deciphered[j] = false;
+ rlcinf->rbid[j] = (uint8_t)lchid[n]+1;
rlcinf->ueid[j] = p_fp_info->channel; /*We need to fake "UE ID"*/
- next_tvb = tvb_new_subset_length(tvb, offset, (gint)pdu_length[n]);
+ next_tvb = tvb_new_subset_length(tvb, offset, (int)pdu_length[n]);
call_dissector_with_data(mac_fdd_hsdsch_handle, next_tvb, pinfo, top_level_tree, data);
- offset += (gint)pdu_length[n];
+ offset += (int)pdu_length[n];
}
}
}
/* New IE Flags */
- newieflags = tvb_get_guint8(tvb, offset);
+ newieflags = tvb_get_uint8(tvb, offset);
/* If newieflags == 0000 0010 then this indicates that there is a
* HS-DSCH physical layer category and no other New IE flags. */
if (newieflags == 2) {
@@ -3895,20 +3888,20 @@ void dissect_hsdsch_common_channel_info(tvbuff_t *tvb, packet_info *pinfo, proto
}
/* Validates the header CRC in a Control FP frame */
/* Should only be used in heuristic dissectors! */
-static gboolean
+static bool
check_control_frame_crc_for_heur(tvbuff_t * tvb)
{
- guint8 crc = 0;
- guint8 calc_crc = 0;
- guint8 * data = NULL;
- guint reported_length = tvb_reported_length(tvb);
+ uint8_t crc = 0;
+ uint8_t calc_crc = 0;
+ uint8_t * data = NULL;
+ unsigned reported_length = tvb_reported_length(tvb);
if (reported_length == 0 || reported_length > tvb_captured_length(tvb))
- return FALSE;
+ return false;
- crc = tvb_get_guint8(tvb, 0) >> 1;
+ crc = tvb_get_uint8(tvb, 0) >> 1;
/* Get data. */
- data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb));
+ data = (uint8_t *)tvb_memdup(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb));
/* Include only FT flag bit in CRC calculation. */
data[0] = data[0] & 1;
calc_crc = crc7update(0, data, tvb_reported_length(tvb));
@@ -3918,17 +3911,17 @@ check_control_frame_crc_for_heur(tvbuff_t * tvb)
}
/* Validates the header CRC in a Data FP frame */
/* Should only be used in heuristic dissectors! */
-static gboolean
-check_header_crc_for_heur(tvbuff_t *tvb, guint16 header_length)
+static bool
+check_header_crc_for_heur(tvbuff_t *tvb, uint16_t header_length)
{
- guint8 crc = 0;
- guint8 calc_crc = 0;
- const guint8 * data = NULL;
+ uint8_t crc = 0;
+ uint8_t calc_crc = 0;
+ const uint8_t * data = NULL;
if (header_length > tvb_captured_length(tvb))
- return FALSE;
+ return false;
- crc = tvb_get_guint8(tvb, 0) >> 1;
+ crc = tvb_get_uint8(tvb, 0) >> 1;
/* Get data of header excluding the first byte */
data = tvb_get_ptr(tvb, 1, header_length - 1);
@@ -3939,20 +3932,20 @@ check_header_crc_for_heur(tvbuff_t *tvb, guint16 header_length)
}
/* Validates the payload CRC in a Data FP frame */
/* Should only be used in heuristic dissectors! */
-static gboolean
-check_payload_crc_for_heur(tvbuff_t *tvb, guint16 header_length)
+static bool
+check_payload_crc_for_heur(tvbuff_t *tvb, uint16_t header_length)
{
- guint16 reported_length;
- guint16 crc_index;
- guint16 crc = 0;
- guint16 calc_crc = 0;
- guint16 payload_index;
- guint16 payload_length;
- const guint8 *data = NULL;
+ uint16_t reported_length;
+ uint16_t crc_index;
+ uint16_t crc = 0;
+ uint16_t calc_crc = 0;
+ uint16_t payload_index;
+ uint16_t payload_length;
+ const uint8_t *data = NULL;
reported_length = tvb_reported_length(tvb);
if (reported_length < 2 || reported_length > tvb_captured_length(tvb)) {
- return FALSE;
+ return false;
}
/* Payload CRC is in the last 2 bytes of the packet */
crc_index = reported_length - 2;
@@ -3967,19 +3960,19 @@ check_payload_crc_for_heur(tvbuff_t *tvb, guint16 header_length)
}
/* Validates the header CRC in a E-DCH Data FP frame */
/* Should only be used in heuristic dissectors! */
-static gboolean
-check_edch_header_crc_for_heur(tvbuff_t *tvb, guint16 header_length)
+static bool
+check_edch_header_crc_for_heur(tvbuff_t *tvb, uint16_t header_length)
{
- guint16 crc = 0;
- guint16 calc_crc = 0;
- guint8 * data = NULL;
+ uint16_t crc = 0;
+ uint16_t calc_crc = 0;
+ uint8_t * data = NULL;
if (header_length > tvb_captured_length(tvb))
- return FALSE;
+ return false;
crc = (tvb_get_bits8(tvb, 0, 7) << 4) + tvb_get_bits8(tvb, 8, 4);
/* Get data of header excluding the first byte */
- data = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, 1, header_length-1);
+ data = (uint8_t *)tvb_memdup(wmem_packet_scope(), tvb, 1, header_length-1);
/*Zero the part in the second byte which contains part of the CRC*/
data[0] = data[0] & 0x0f;
@@ -3990,7 +3983,7 @@ check_edch_header_crc_for_heur(tvbuff_t *tvb, guint16 header_length)
/* Generates a unique 32bit identifier based on the frame's metadata */
/* This ID is used in the RLC dissector for reassembly */
/* Should only be used in heuristic dissectors! */
-static guint32
+static uint32_t
generate_ue_id_for_heur(packet_info *pinfo)
{
if (pinfo->ptype == PT_UDP && pinfo->src.type == AT_IPv4 && pinfo->dst.type == AT_IPv4) {
@@ -4076,17 +4069,17 @@ set_both_sides_umts_fp_conv_data(packet_info *pinfo, umts_fp_conversation_info_t
conversation_add_proto_data(other_direction_conv, proto_fp, umts_fp_conversation_info);
}
-static gboolean
-heur_dissect_fp_dcch_over_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_dcch_over_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
struct fp_info *p_fp_info;
- guint32 captured_length;
- guint32 reported_length;
- guint8 frame_type;
- guint8 tfi;
- guint8 pch_collisions_byte;
+ uint32_t captured_length;
+ uint32_t reported_length;
+ uint8_t frame_type;
+ uint8_t tfi;
+ uint8_t pch_collisions_byte;
/* Trying to find existing conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -4100,11 +4093,11 @@ heur_dissect_fp_dcch_over_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (umts_fp_conversation_info->channel == CHANNEL_DCH) {
conversation_set_dissector(p_conv, fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
}
}
@@ -4112,34 +4105,34 @@ heur_dissect_fp_dcch_over_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Making sure FP info isn't already attached */
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
if (p_fp_info) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
- return FALSE;
+ return false;
}
/* Making sure we have at least enough bytes for header (3) + footer (2) */
captured_length = tvb_captured_length(tvb);
if (captured_length < 5) {
- return FALSE;
+ return false;
}
reported_length = tvb_reported_length(tvb);
- tfi = tvb_get_guint8(tvb, 2) & 0x1f;
+ tfi = tvb_get_uint8(tvb, 2) & 0x1f;
/* Checking if this is a DCH frame with 0 TBs*/
if (tfi == 0x00)
{
if (reported_length != 5 /* DL */ && reported_length != 7 /* UL */) {
- return FALSE;
+ return false;
}
if (!check_header_crc_for_heur(tvb, 3)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, 3)) {
- return FALSE;
+ return false;
}
/* All checks passed - This is an unknown DCH FP frame. */
/* To allow dissection of this frame after umts_fp_conversation_info will be added in a later frame */
@@ -4149,33 +4142,33 @@ heur_dissect_fp_dcch_over_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
conversation_pt_to_conversation_type(pinfo->ptype),
pinfo->destport, pinfo->srcport, NO_ADDR2);
}
- return FALSE;
+ return false;
}
/* Checking this is a DCH frame with 1 TB */
if (tfi != 0x01) {
- return FALSE;
+ return false;
}
/* Expecting specific lengths: 24 for downlink frames, 26 for uplink frames */
/* This is the common Transport Format of DCCH over DCH ( See 3GPP TR 25.944 / 4.1.1.3.1.1 ) */
if (reported_length != 24 /* DL */ && reported_length != 26 /* UL */) {
- return FALSE;
+ return false;
}
if (!check_header_crc_for_heur(tvb, 3)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, 3)) {
- return FALSE;
+ return false;
}
/* Checking if the 4th byte in the frame is zeroed. In this case the CRC checks aren't */
- /* deterministic enough to gurantee this is a DCH since this packet could also be a PCH frame */
+ /* deterministic enough to guarantee this is a DCH since this packet could also be a PCH frame */
/* with PI Bitmap of 18 bytes + 0 TBs (Both CRCs will match for both formats) */
- pch_collisions_byte = tvb_get_guint8(tvb, 3);
+ pch_collisions_byte = tvb_get_uint8(tvb, 3);
if (pch_collisions_byte == 0) {
- return FALSE;
+ return false;
}
if(!umts_fp_conversation_info) {
@@ -4208,20 +4201,20 @@ heur_dissect_fp_dcch_over_dch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
umts_fp_conversation_info->fp_dch_channel_info[0].ul_chan_tf_size[1] = 148;
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
-static gboolean
-heur_dissect_fp_fach1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_fach1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
fp_fach_channel_info_t* fp_fach_channel_info;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
struct fp_info *p_fp_info;
- guint32 captured_length;
- guint32 reported_length;
- guint8 frame_type;
- guint8 tfi;
- guint8 tctf;
+ uint32_t captured_length;
+ uint32_t reported_length;
+ uint8_t frame_type;
+ uint8_t tfi;
+ uint8_t tctf;
/* Finding or creating conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -4235,46 +4228,46 @@ heur_dissect_fp_fach1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
if (umts_fp_conversation_info->channel == CHANNEL_FACH_FDD) {
conversation_set_dissector(p_conv, fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
}
}
/* Making sure we have at least enough bytes for header (4) + footer (2) */
captured_length = tvb_captured_length(tvb);
if(captured_length < 6) {
- return FALSE;
+ return false;
}
/* Expecting specific lengths: 51 for frames with 1 TB */
/* This is a common Transport Format of FACH ( See 3GPP TR 25.944 / 4.1.1.2 'FACH1' ) */
reported_length = tvb_reported_length(tvb);
if (reported_length != 51) {
- return FALSE;
+ return false;
}
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
/* Making sure FP info isn't already attached */
if (p_fp_info) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
/* We can't tell the FP type and content of control frames */
- return FALSE;
+ return false;
}
- tfi = tvb_get_guint8(tvb, 2) & 0x1f;
+ tfi = tvb_get_uint8(tvb, 2) & 0x1f;
if (tfi != 0x01) {
- return FALSE;
+ return false;
}
- tctf = tvb_get_guint8(tvb, 4);
+ tctf = tvb_get_uint8(tvb, 4);
/* Asserting the TCTF field contains a valid (non reserved) value according to TS 25.321 Table 9.2.1-2 */
if (tctf != 0x40 && /* CCCH */
tctf != 0x50 && /* MCCH */
@@ -4283,14 +4276,14 @@ heur_dissect_fp_fach1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
(tctf >> 4) != 0x06 && /* MTCH */
(tctf >> 6) != 0x00 && /* BCCH */
(tctf >> 6) != 0x03) { /* DCCH or DTCH over FACH */
- return FALSE;
+ return false;
}
if (!check_header_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
if(!umts_fp_conversation_info) {
@@ -4318,20 +4311,20 @@ heur_dissect_fp_fach1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
-static gboolean
-heur_dissect_fp_fach2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_fach2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
fp_fach_channel_info_t* fp_fach_channel_info;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
struct fp_info *p_fp_info;
- guint32 captured_length;
- guint32 reported_length;
- guint8 frame_type;
- guint8 tfi;
- guint8 tctf;
+ uint32_t captured_length;
+ uint32_t reported_length;
+ uint8_t frame_type;
+ uint8_t tfi;
+ uint8_t tctf;
/* Finding or creating conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -4345,49 +4338,49 @@ heur_dissect_fp_fach2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
if (umts_fp_conversation_info->channel == CHANNEL_FACH_FDD) {
conversation_set_dissector(p_conv, fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
}
}
/* Making sure we have at least enough bytes for header (4) + footer (2) */
captured_length = tvb_captured_length(tvb);
if(captured_length < 6) {
- return FALSE;
+ return false;
}
/* Expecting specific lengths: 27 for frames with 1 TB, 48 for frames with 2 TBs */
/* This is a common Transport Format of FACH ( See 3GPP TR 25.944 / 4.1.1.2 'FACH2' ) */
reported_length = tvb_reported_length(tvb);
if (reported_length != 27 && reported_length != 48) {
- return FALSE;
+ return false;
}
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
/* Making sure FP info isn't already attached */
if (p_fp_info) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
/* We can't tell the FP type and content of control frames */
- return FALSE;
+ return false;
}
- tfi = tvb_get_guint8(tvb, 2) & 0x1f;
+ tfi = tvb_get_uint8(tvb, 2) & 0x1f;
if (reported_length == 27 && tfi != 0x01) {
- return FALSE;
+ return false;
}
if (reported_length == 48 && tfi != 0x02) {
- return FALSE;
+ return false;
}
- tctf = tvb_get_guint8(tvb, 4);
+ tctf = tvb_get_uint8(tvb, 4);
/* Asserting the TCTF field contains a valid (non reserved) value according to TS 25.321 Table 9.2.1-2 */
if (tctf != 0x40 && /* CCCH */
tctf != 0x50 && /* MCCH */
@@ -4396,14 +4389,14 @@ heur_dissect_fp_fach2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
(tctf >> 4) != 0x06 && /* MTCH */
(tctf >> 6) != 0x00 && /* BCCH */
(tctf >> 6) != 0x03) { /* DCCH or DTCH over FACH */
- return FALSE;
+ return false;
}
if (!check_header_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
if(!umts_fp_conversation_info) {
@@ -4433,20 +4426,20 @@ heur_dissect_fp_fach2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
-static gboolean
-heur_dissect_fp_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
fp_rach_channel_info_t* fp_rach_channel_info;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
struct fp_info *p_fp_info;
- guint32 captured_length;
- guint32 reported_length;
- guint8 frame_type;
- guint8 tfi;
- guint8 tctf;
+ uint32_t captured_length;
+ uint32_t reported_length;
+ uint8_t frame_type;
+ uint8_t tfi;
+ uint8_t tctf;
/* Finding or creating conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -4460,11 +4453,11 @@ heur_dissect_fp_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (umts_fp_conversation_info->channel == CHANNEL_RACH_FDD) {
conversation_set_dissector(p_conv, fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
}
}
@@ -4472,50 +4465,50 @@ heur_dissect_fp_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
/* Making sure we have at least enough bytes for header (4) + footer (2) */
captured_length = tvb_captured_length(tvb);
if(captured_length < 6) {
- return FALSE;
+ return false;
}
/* Expecting specific lengths: rach frames are either 28 or 52 bytes long */
/* This is the common Transport Formats of RACH ( See 3GPP TR 25.944 / 4.1.2.1 ) */
reported_length = tvb_reported_length(tvb);
if (reported_length != 28 && reported_length != 52) {
- return FALSE;
+ return false;
}
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
/* Making sure FP info isn't already attached */
if (p_fp_info) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
/* We can't tell the FP type and content of control frames */
- return FALSE;
+ return false;
}
- tfi = tvb_get_guint8(tvb, 2) & 0x1f;
+ tfi = tvb_get_uint8(tvb, 2) & 0x1f;
if (reported_length == 28 && tfi != 0x00) {
- return FALSE;
+ return false;
}
if (reported_length == 52 && tfi != 0x01) {
- return FALSE;
+ return false;
}
- tctf = tvb_get_guint8(tvb, 4) >> 6;
+ tctf = tvb_get_uint8(tvb, 4) >> 6;
/* Asserting the TCTF field contains a valid (non reserved) value according to TS 25.321 Table 9.2.1-4 */
if (tctf != 0x00 && /* CCCH */
tctf != 0x01) /* DCCH over RACH */
{
- return FALSE;
+ return false;
}
if (!check_header_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
if(!umts_fp_conversation_info) {
@@ -4546,28 +4539,28 @@ heur_dissect_fp_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
-static gboolean
-heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
fp_pch_channel_info_t* fp_pch_channel_info = NULL;
struct fp_info *p_fp_info;
- gboolean conversation_initialized = FALSE;
- guint32 captured_length;
- guint32 reported_length;
- guint8 frame_type;
- guint8 reserved_bits;
- guint8 tfi;
- guint8 pi_byte_length;
- guint16 tb_byte_length;
- gboolean pi_present;
- gboolean tb_size_found;
- gboolean pi_length_found;
- guint8 cfn_lowest_bits;
- guint8 dch_collisions_byte;
+ bool conversation_initialized = false;
+ uint32_t captured_length;
+ uint32_t reported_length;
+ uint8_t frame_type;
+ uint8_t reserved_bits;
+ uint8_t tfi;
+ uint8_t pi_byte_length;
+ uint16_t tb_byte_length;
+ bool pi_present;
+ bool tb_size_found;
+ bool pi_length_found;
+ uint8_t cfn_lowest_bits;
+ uint8_t dch_collisions_byte;
/* To correctly dissect a PCH stream 2 parameters are required: PI Bitmap length & TB length */
/* Both are optional in each packet and having them both in a packet without knowing any of them */
@@ -4586,79 +4579,79 @@ heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
fp_pch_channel_info = (fp_pch_channel_info_t*)umts_fp_conversation_info->channel_specific_info;
/* Making sure this conversation type is "PCH" and the PCH channel info is present */
if (umts_fp_conversation_info->channel == CHANNEL_PCH && fp_pch_channel_info != NULL) {
- conversation_initialized = TRUE;
+ conversation_initialized = true;
pi_length_found = fp_pch_channel_info->paging_indications != 0;
tb_size_found = umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] != 0;
if (pi_length_found && tb_size_found) {
/* Stream already framed - contains both PI length and TB size */
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
else {
/* FP conversation info attached and the channel type is UNKNOWN - might be PCH */
- tb_size_found = FALSE;
- pi_length_found = FALSE;
+ tb_size_found = false;
+ pi_length_found = false;
}
}
else {
/* FP conversation info not attached - no PCH info is known */
- tb_size_found = FALSE;
- pi_length_found = FALSE;
+ tb_size_found = false;
+ pi_length_found = false;
}
}
else {
/* A conversation does not exist yet - no PCH info is known */
- tb_size_found = FALSE;
- pi_length_found = FALSE;
+ tb_size_found = false;
+ pi_length_found = false;
}
/* Making sure we have at least enough bytes for header (4) + footer (2) */
captured_length = tvb_captured_length(tvb);
if(captured_length < 6) {
- return FALSE;
+ return false;
}
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
/* Making sure FP info isn't already attached */
if (p_fp_info) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
/* We can't tell the FP type and content of control frames */
- return FALSE;
+ return false;
}
/* Checking bits after CFN and before PI indicator are zeroed */
- reserved_bits = tvb_get_guint8(tvb, 2) & 0x0E;
+ reserved_bits = tvb_get_uint8(tvb, 2) & 0x0E;
if (reserved_bits != 0x00) {
- return FALSE;
+ return false;
}
- tfi = tvb_get_guint8(tvb, 3) & 0x1f;
+ tfi = tvb_get_uint8(tvb, 3) & 0x1f;
if (tfi != 0x00 && tfi != 0x01) {
- return FALSE;
+ return false;
}
if (!check_header_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, 4)) {
- return FALSE;
+ return false;
}
reported_length = tvb_reported_length(tvb);
- pi_present = tvb_get_guint8(tvb, 2) & 0x01; /* Rightmost bit in the 3rd byte */
+ pi_present = tvb_get_uint8(tvb, 2) & 0x01; /* Rightmost bit in the 3rd byte */
if (pi_present) {
if (tfi == 0x00 && !pi_length_found) {
/* PI Bitmap present and No TB. Can calculate PI bitmap length */
- guint8 pi_bit_length;
+ uint8_t pi_bit_length;
pi_byte_length = reported_length - 6; /* Removing header length (4) and footer length (2)*/
switch (pi_byte_length)
{
@@ -4675,7 +4668,7 @@ heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
pi_bit_length = 144;
break;
default:
- return FALSE;
+ return false;
}
if (pi_bit_length == 144 && !tb_size_found) {
@@ -4683,14 +4676,14 @@ heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
/* both 'tb_size_found' and 'pi_length_found' are false. */
/* Checking if the 4 LSB bits of the CFN (the 4 leftmost bits in the 3rd byte) aren't zeroed. */
/* if they aren't this is probably PCH because those are reserved in DCH */
- cfn_lowest_bits = tvb_get_guint8(tvb, 2) & 0xF0;
+ cfn_lowest_bits = tvb_get_uint8(tvb, 2) & 0xF0;
if(cfn_lowest_bits == 0) {
/* Checking if the 4th byte in the frame is zeroed. In this case the CRC checks aren't */
- /* deterministic enough to gurantee this is a PCH since this packet could also be a DCH frame */
+ /* deterministic enough to guarantee this is a PCH since this packet could also be a DCH frame */
/* with MAC's C/T is 0 and 4 leftmost bits of RLC are 0 */
- dch_collisions_byte = tvb_get_guint8(tvb, 3);
+ dch_collisions_byte = tvb_get_uint8(tvb, 3);
if (dch_collisions_byte == 0) {
- return FALSE;
+ return false;
}
}
}
@@ -4704,7 +4697,7 @@ heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
fp_pch_channel_info = (fp_pch_channel_info_t*)umts_fp_conversation_info->channel_specific_info;
}
fp_pch_channel_info->paging_indications = pi_bit_length;
- pi_length_found = TRUE;
+ pi_length_found = true;
}
else if (tfi == 0x01 && !tb_size_found && pi_length_found) {
/* TB present and PI bitmap length is known. Can calculate TB length.*/
@@ -4720,7 +4713,7 @@ heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
/* Possible TB lengths for PCH is 10 or 30 bytes ( See 3GPP TR 25.944 / 4.1.1.2 ) */
if (tb_byte_length == 10 || tb_byte_length == 30) {
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] = tb_byte_length * 8;
- tb_size_found = TRUE;
+ tb_size_found = true;
}
}
/* TODO: It should be possible to figure both PI & TB sizes if both are present in a frame and neither is known */
@@ -4745,7 +4738,7 @@ heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
if (tb_byte_length == 10 || tb_byte_length == 30) {
umts_fp_conversation_info->fp_dch_channel_info[0].dl_chan_tf_size[1] = tb_byte_length * 8;
set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info);
- tb_size_found = TRUE;
+ tb_size_found = true;
}
}
}
@@ -4754,29 +4747,29 @@ heur_dissect_fp_pch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
/* Stream completely framed! */
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else {
/* Some data still missing */
- return FALSE;
+ return false;
}
}
-static gboolean
-heur_dissect_fp_hsdsch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_hsdsch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
fp_hsdsch_channel_info_t* fp_hsdsch_channel_info;
struct fp_info *p_fp_info;
- guint32 captured_length;
- guint32 reported_length;
- guint8 frame_type;
- guint16 mac_d_pdu_length;
- guint16 num_of_pdus;
- guint32 expected_total_size;
- guint32 next_pdu_index;
- guint16 index_step;
- guint8 pre_pdu_padding;
+ uint32_t captured_length;
+ uint32_t reported_length;
+ uint8_t frame_type;
+ uint16_t mac_d_pdu_length;
+ uint16_t num_of_pdus;
+ uint32_t expected_total_size;
+ uint32_t next_pdu_index;
+ uint16_t index_step;
+ uint8_t pre_pdu_padding;
/* Trying to find existing conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -4791,11 +4784,11 @@ heur_dissect_fp_hsdsch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (umts_fp_conversation_info->channel == CHANNEL_HSDSCH && fp_hsdsch_channel_info->hsdsch_entity == hs) {
conversation_set_dissector(p_conv, fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
}
}
@@ -4803,46 +4796,46 @@ heur_dissect_fp_hsdsch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Making sure FP info isn't already attached */
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
if (p_fp_info) {
- return FALSE;
+ return false;
}
captured_length = tvb_reported_length(tvb);
/* Lengths limit: header size (7) + at least 1 PDU Block (2) + CRC Payload size (2)*/
if (captured_length < 11) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
- return FALSE;
+ return false;
}
/* Lengths limit: Smallest HS-DSCH type 1 data frame is 55 bytes (1 PDU of 336 bits) */
reported_length = tvb_reported_length(tvb);
if (reported_length < 55) {
- return FALSE;
+ return false;
}
- mac_d_pdu_length = tvb_get_guint16(tvb, 2, ENC_NA) >> 3;
+ mac_d_pdu_length = tvb_get_uint16(tvb, 2, ENC_NA) >> 3;
/* Only valid PDU lengths are 336 or 656 */
if (mac_d_pdu_length != 336 && mac_d_pdu_length != 656) {
- return FALSE;
+ return false;
}
- num_of_pdus = tvb_get_guint8(tvb, 4);
+ num_of_pdus = tvb_get_uint8(tvb, 4);
/* PDUs count shouldn't be 0*/
if (num_of_pdus == 0) {
- return FALSE;
+ return false;
}
/* Maximum PDUs count constraint: 32 PDUs * 336 bits or 17 PDUs * 656 bits */
if ((mac_d_pdu_length == 336 && num_of_pdus > 32) || (mac_d_pdu_length == 656 && num_of_pdus > 17)) {
- return FALSE;
+ return false;
}
/* Making sure the expected packet size is smaller/equals to the entire packet's size */
expected_total_size = (num_of_pdus * mac_d_pdu_length / 8) + 7 /*Header length*/ + 2 /*Footer length*/;
if (expected_total_size > captured_length || expected_total_size > reported_length) {
- return FALSE;
+ return false;
}
/* Iterating through the PDUs making sure the padding nibble is present in all of them */
@@ -4850,20 +4843,20 @@ heur_dissect_fp_hsdsch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
index_step = mac_d_pdu_length / 8;
for (int i = 0; i < num_of_pdus; i++)
{
- pre_pdu_padding = tvb_get_guint8(tvb, next_pdu_index) >> 4;
+ pre_pdu_padding = tvb_get_uint8(tvb, next_pdu_index) >> 4;
if (pre_pdu_padding != 0x00)
{
/* One of the padding nibbles is not zeroed */
- return FALSE;
+ return false;
}
next_pdu_index += index_step;
}
if (!check_header_crc_for_heur(tvb, 7)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, 7)) {
- return FALSE;
+ return false;
}
if(!umts_fp_conversation_info) {
@@ -4887,27 +4880,27 @@ heur_dissect_fp_hsdsch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
-static gboolean
-heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
fp_hsdsch_channel_info_t* fp_hsdsch_channel_info;
struct fp_info *p_fp_info;
- guint32 captured_length;
- guint32 reported_length;
- guint8 frame_type;
- guint8 reserved_fach_ind_bits;
- guint8 pdu_block_header_reserved_bit;
- guint8 pdu_block_headers_count;
- guint16 next_pdu_block_header_index;
- guint16 pdu_block_header_pdu_length;
- guint8 pdu_block_header_pdus_count;
- guint8 pdu_block_header_lchid;
- guint32 total_header_length;
- guint32 expected_payload_length;
+ uint32_t captured_length;
+ uint32_t reported_length;
+ uint8_t frame_type;
+ uint8_t reserved_fach_ind_bits;
+ uint8_t pdu_block_header_reserved_bit;
+ uint8_t pdu_block_headers_count;
+ uint16_t next_pdu_block_header_index;
+ uint16_t pdu_block_header_pdu_length;
+ uint8_t pdu_block_header_pdus_count;
+ uint8_t pdu_block_header_lchid;
+ uint32_t total_header_length;
+ uint32_t expected_payload_length;
/* Trying to find existing conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -4922,11 +4915,11 @@ heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
if (umts_fp_conversation_info->channel == CHANNEL_HSDSCH && fp_hsdsch_channel_info->hsdsch_entity == ehs) {
conversation_set_dissector(p_conv, fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
}
}
@@ -4934,36 +4927,36 @@ heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Making sure FP info isn't already attached */
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
if (p_fp_info) {
- return FALSE;
+ return false;
}
captured_length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
/* Lengths limit: header size + at least 1 PDU Block Header + CRC Payload size */
if (captured_length < 11) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
- return FALSE;
+ return false;
}
- pdu_block_header_reserved_bit = (tvb_get_guint8(tvb, 7) & 0x10) >> 4;
+ pdu_block_header_reserved_bit = (tvb_get_uint8(tvb, 7) & 0x10) >> 4;
if (pdu_block_header_reserved_bit == 0x1) {
- return FALSE;
+ return false;
}
/* Expecting at least 1 PDU Block Header */
- pdu_block_headers_count = tvb_get_guint8(tvb, 2) >> 3;
+ pdu_block_headers_count = tvb_get_uint8(tvb, 2) >> 3;
if (pdu_block_headers_count == 0) {
- return FALSE;
+ return false;
}
/* Getting 3 rightmost bits in the FACH Indicator's byte, which are reserved and should be 0 */
- reserved_fach_ind_bits = tvb_get_guint8(tvb, 3) & 0x03;
+ reserved_fach_ind_bits = tvb_get_uint8(tvb, 3) & 0x03;
if (reserved_fach_ind_bits != 0x00) {
- return FALSE;
+ return false;
}
/* Iterating through the block headers looking for invalid fields and */
@@ -4973,8 +4966,8 @@ heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
for (int i = 0; i < pdu_block_headers_count; i++)
{
/* Making sure the next index is not out of range */
- if (((guint32)(8 + (i * 3))) >= captured_length) {
- return FALSE;
+ if (((uint32_t)(8 + (i * 3))) >= captured_length) {
+ return false;
}
/* Getting blocks length and count from the i-th header */
@@ -4984,18 +4977,18 @@ heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
else {
next_pdu_block_header_index = (((i-1) * 25) / 10) + 2;
}
- pdu_block_header_pdu_length = tvb_get_guint16(tvb, 6 + next_pdu_block_header_index, ENC_NA) >> 5;
- pdu_block_header_pdus_count = tvb_get_guint8(tvb, 7 + next_pdu_block_header_index) & 0x0F;
- pdu_block_header_lchid = tvb_get_guint8(tvb, 8 + next_pdu_block_header_index) >> 4;
+ pdu_block_header_pdu_length = tvb_get_uint16(tvb, 6 + next_pdu_block_header_index, ENC_NA) >> 5;
+ pdu_block_header_pdus_count = tvb_get_uint8(tvb, 7 + next_pdu_block_header_index) & 0x0F;
+ pdu_block_header_lchid = tvb_get_uint8(tvb, 8 + next_pdu_block_header_index) >> 4;
/* Making sure PDUs' Length isn't zeroed*/
if (pdu_block_header_pdu_length == 0) {
- return FALSE;
+ return false;
}
/* Making sure PDUs Count isn't zeroed */
if (pdu_block_header_pdus_count == 0) {
- return FALSE;
+ return false;
}
/* Adding this header's length to expected length*/
@@ -5005,31 +4998,31 @@ heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
else {
total_header_length += 2;
}
- /* Adding this header's paylod's size to expected length*/
+ /* Adding this header's payload's size to expected length*/
expected_payload_length += (pdu_block_header_pdu_length * pdu_block_header_pdus_count);
/* Checking padding after lchid */
- if ((tvb_get_guint8(tvb, 8 + (i * 3)) & 0x0F) != 0x00) {
- return FALSE;
+ if ((tvb_get_uint8(tvb, 8 + (i * 3)) & 0x0F) != 0x00) {
+ return false;
}
/* Checking lchid for reserved value 0x0F*/
if (pdu_block_header_lchid == 0x0F) {
- return FALSE;
+ return false;
}
}
/* Adding Payload CRC'slength to payload length*/
expected_payload_length += 2;
/* Calculated expected packet size must not exceed captured length or reported length*/
if ((total_header_length + expected_payload_length) > captured_length || (total_header_length + expected_payload_length) > reported_length) {
- return FALSE;
+ return false;
}
if (!check_header_crc_for_heur(tvb, total_header_length)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, total_header_length)) {
- return FALSE;
+ return false;
}
if(!umts_fp_conversation_info) {
@@ -5053,31 +5046,31 @@ heur_dissect_fp_hsdsch_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
-static gboolean
-heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
fp_edch_channel_info_t* fp_edch_channel_info;
struct fp_info *p_fp_info;
- guint32 captured_length;
- guint8 frame_type;
- guint8 num_sub_frames_byte;
- guint8 number_of_subframes;
- guint8 number_of_mac_es_pdus;
- guint32 subframe_number;
- guint32 total_sub_headers_len;
- guint32 total_header_length;
- guint32 payload_length;
- guint32 total_mac_pdus_count;
- guint32 macd_pdu_bit_size;
- guint32 bit_offset;
- guint32 offset;
- guint32 i = 0;
- guint32 n = 0;
+ uint32_t captured_length;
+ uint8_t frame_type;
+ uint8_t num_sub_frames_byte;
+ uint8_t number_of_subframes;
+ uint8_t number_of_mac_es_pdus;
+ uint32_t subframe_number;
+ uint32_t total_sub_headers_len;
+ uint32_t total_header_length;
+ uint32_t payload_length;
+ uint32_t total_mac_pdus_count;
+ uint32_t macd_pdu_bit_size;
+ uint32_t bit_offset;
+ uint32_t offset;
+ uint32_t i = 0;
+ uint32_t n = 0;
/* Trying to find existing conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -5092,11 +5085,11 @@ heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (umts_fp_conversation_info->channel == CHANNEL_EDCH && fp_edch_channel_info->edch_type == 0) {
conversation_set_dissector(p_conv, fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else if (umts_fp_conversation_info->channel != CHANNEL_UNKNOWN){
- /* This conversation was successfuly framed as ANOTHER type */
- return FALSE;
+ /* This conversation was successfully framed as ANOTHER type */
+ return false;
}
}
}
@@ -5104,30 +5097,30 @@ heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Making sure FP info isn't already attached */
p_fp_info = (fp_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_fp, 0);
if (p_fp_info) {
- return FALSE;
+ return false;
}
captured_length = tvb_reported_length(tvb);
/* Lengths limit: header size + at least 1 Subframe Header + CRC Payload size */
if (captured_length < 9) {
- return FALSE;
+ return false;
}
- frame_type = tvb_get_guint8(tvb, 0) & 0x01;
+ frame_type = tvb_get_uint8(tvb, 0) & 0x01;
if (frame_type == 1) { /* is 'control' frame type*/
- return FALSE;
+ return false;
}
- num_sub_frames_byte = tvb_get_guint8(tvb, 2);
+ num_sub_frames_byte = tvb_get_uint8(tvb, 2);
/* Checking 4 leftmost bits in the 'Number of Subframes' byte, which are reserved and should be 0 */
if (num_sub_frames_byte & 0xf0) {
- return FALSE;
+ return false;
}
/* Values {11-16} are reserved */
number_of_subframes = (num_sub_frames_byte & 0x0f) + 1;
if (number_of_subframes >= 11) {
- return FALSE;
+ return false;
}
/* Iterating through the block headers looking for invalid fields */
@@ -5138,32 +5131,32 @@ heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
for (n=0; n < number_of_subframes; n++) {
/* Making sure the next index is not out of range */
- if (((guint32)(offset + 3)) >= captured_length) {
- return FALSE;
+ if (((uint32_t)(offset + 3)) >= captured_length) {
+ return false;
}
/* Subframe number */
- subframe_number = (tvb_get_guint8(tvb, offset) & 0x07);
+ subframe_number = (tvb_get_uint8(tvb, offset) & 0x07);
if (subframe_number > 4) {
- return FALSE;
+ return false;
}
offset++;
/* Number of MAC-es PDUs */
- number_of_mac_es_pdus = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4;
+ number_of_mac_es_pdus = (tvb_get_uint8(tvb, offset) & 0xf0) >> 4;
if (number_of_mac_es_pdus == 0) {
- return FALSE;
+ return false;
}
bit_offset = 4;
- /* Making sure enough bytes are presesnt for all sub-header */
+ /* Making sure enough bytes are present for all sub-header */
total_sub_headers_len = ((int)((((1.5 + (number_of_mac_es_pdus * 1.5))*8+7)/8)));
if ((offset + total_sub_headers_len) >= captured_length) {
- return FALSE;
+ return false;
}
/* Details of each MAC-es PDU */
for (i=0; i < number_of_mac_es_pdus; i++) {
- guint32 n_pdus; /*Size of the PDU*/
+ uint32_t n_pdus; /*Size of the PDU*/
/* DDI (6 bits) */
bit_offset += 6;
@@ -5188,14 +5181,14 @@ heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
else {
/* Unexpected payload length or DDIs combination */
- return FALSE;
+ return false;
}
if (!check_edch_header_crc_for_heur(tvb, total_header_length)) {
- return FALSE;
+ return false;
}
if (!check_payload_crc_for_heur(tvb, total_header_length)) {
- return FALSE;
+ return false;
}
if(!umts_fp_conversation_info) {
@@ -5224,20 +5217,20 @@ heur_dissect_fp_edch_type_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_set_dissector(find_or_create_conversation(pinfo), fp_handle);
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
/* This method can frame UDP streams containing FP packets but dissection of those packets will */
/* fail since the FP conversation info is never attached */
-/* Usefull for DCH streams containing CS data and don't have their own heuristic method */
-static gboolean
-heur_dissect_fp_unknown_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+/* Useful for DCH streams containing CS data and don't have their own heuristic method */
+static bool
+heur_dissect_fp_unknown_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t *p_conv;
umts_fp_conversation_info_t* umts_fp_conversation_info = NULL;
struct fp_info *p_fp_info;
- guint32 length;
- guint8 frame_type;
- guint32 ft;
+ uint32_t length;
+ uint8_t frame_type;
+ uint32_t ft;
/* Trying to find existing conversation */
p_conv = (conversation_t *)find_conversation(pinfo->num, &pinfo->net_dst, &pinfo->net_src,
@@ -5251,10 +5244,10 @@ heur_dissect_fp_unknown_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (umts_fp_conversation_info->channel == CHANNEL_UNKNOWN) {
/* This stream was framed using a previous control frame, we can call FP dissector without further tests*/
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
else {
- return FALSE;
+ return false;
}
}
}
@@ -5265,52 +5258,52 @@ heur_dissect_fp_unknown_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if(p_fp_info) {
/* if FP info is present, check that it really is an ethernet link */
if (p_fp_info->link_type != FP_Link_Ethernet) {
- return FALSE;
+ return false;
}
/* discriminate 'lower' UDP layer from 'user data' UDP layer
* (i.e. if an FP over UDP packet contains a user UDP packet */
if (p_fp_info->srcport != pinfo->srcport ||
p_fp_info->destport != pinfo->destport)
- return FALSE;
+ return false;
/* assume this is FP */
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
/* Both per-frame FP info and conversation FP info are missing */
/* Try to frame control frames using header CRC */
- ft = (tvb_get_guint8(tvb, 0) & 0x01);
+ ft = (tvb_get_uint8(tvb, 0) & 0x01);
if(ft != FT_CONTROL) {
/* This is a Data frame, can't tell if it's FP. */
- return FALSE;
+ return false;
}
length = tvb_captured_length(tvb);
/* Length limit: control frames header is 2 bytes */
if (length < 2) {
- return FALSE;
+ return false;
}
/* Check 'Frame Type' */
- frame_type = tvb_get_guint8(tvb, 1);
+ frame_type = tvb_get_uint8(tvb, 1);
/* 0x00 is unused for both dedicated & common FP */
if( frame_type == 0x00 ) {
- return FALSE;
+ return false;
}
/* Max frame types are: */
/* For common channels: 0x0E */
/* For dedicated channels: 0x0B */
/* The left nibble is zeroed in both cases */
if( (frame_type & 0xF0) != 0x00) {
- return FALSE;
+ return false;
}
/* Checking Header CRC*/
if (!check_control_frame_crc_for_heur(tvb)) {
/* The CRC is incorrect */
- return FALSE;
+ return false;
}
/* The CRC is correct! */
@@ -5321,50 +5314,50 @@ heur_dissect_fp_unknown_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
set_both_sides_umts_fp_conv_data(pinfo, umts_fp_conversation_info);
/* Call FP Dissector for the current frame */
dissect_fp(tvb, pinfo, tree, data);
- return TRUE;
+ return true;
}
/* This method wraps the heuristic dissectors of all supported channels */
-static gboolean
-heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
+static bool
+heur_dissect_fp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- gboolean match;
+ bool match;
match = heur_dissect_fp_dcch_over_dch(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
match = heur_dissect_fp_fach1(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
match = heur_dissect_fp_fach2(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
match = heur_dissect_fp_rach(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
match = heur_dissect_fp_pch(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
match = heur_dissect_fp_hsdsch_type_1(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
match = heur_dissect_fp_hsdsch_type_2(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
match = heur_dissect_fp_edch_type_1(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
/* NOTE: Add new heuristic dissectors BEFORE the 'unknown format' dissector */
/* since it might 'swallow' packets if the UDP stream is framed as 'CHANNEL_UNKNOWN' */
match = heur_dissect_fp_unknown_format(tvb, pinfo, tree, data);
if(match)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
-static guint8 fakes =5; /*[] ={1,5,8};*/
-static guint8 fake_map[256];
+static uint8_t fakes =5; /*[] ={1,5,8};*/
+static uint8_t fake_map[256];
/*
* TODO: This need to be fixed!
@@ -5373,8 +5366,8 @@ static guint8 fake_map[256];
* to set the proper logical channel/RAB ID, but for now we make syntethic ones.
* */
-static guint8
-make_fake_lchid(packet_info *pinfo _U_, gint trchld)
+static uint8_t
+make_fake_lchid(packet_info *pinfo _U_, int trchld)
{
if ( fake_map[trchld] == 0) {
fake_map[trchld] = fakes;
@@ -5389,7 +5382,7 @@ static void fp_conv_resolve_urnti(umts_fp_conversation_info_t *p_conv_data)
/* Trying to resolve the U-RNTI of the user if missing */
/* Resolving based on the 'C-RNC Communication Context' field found in NBAP */
if (!p_conv_data->urnti && p_conv_data->com_context_id != 0) {
- guint32 * mapped_urnti = (guint32 *)(wmem_tree_lookup32(nbap_crncc_urnti_map,p_conv_data->com_context_id));
+ uint32_t * mapped_urnti = (uint32_t *)(wmem_tree_lookup32(nbap_crncc_urnti_map,p_conv_data->com_context_id));
if (mapped_urnti != 0) {
p_conv_data->urnti = GPOINTER_TO_UINT(mapped_urnti);
}
@@ -5397,9 +5390,9 @@ static void fp_conv_resolve_urnti(umts_fp_conversation_info_t *p_conv_data)
}
/* Figures the best "UE ID" to use in RLC reassembly logic */
-static guint32 get_ue_id_from_conv(umts_fp_conversation_info_t *p_conv_data)
+static uint32_t get_ue_id_from_conv(umts_fp_conversation_info_t *p_conv_data)
{
- guint32 user_identity;
+ uint32_t user_identity;
/* Choosing RLC 'UE ID': */
/* 1. Preferring the U-RNTI if attached */
/* 2. Fallback - Using the 'C-RNC Communication Context' used in NBAP for this user */
@@ -5417,20 +5410,20 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
proto_tree *tree _U_)
{
fp_info *fpi;
- guint8 tfi, c_t, lchid;
+ uint8_t tfi, c_t, lchid;
int offset = 0, i=0, j=0, num_tbs, chan, tb_size, tb_bit_off;
- guint32 ft;
- gboolean is_known_dcch_tf,is_stndalone_ps_rab_tf,is_muxed_cs_ps_tf;
+ uint32_t ft;
+ bool is_known_dcch_tf,is_stndalone_ps_rab_tf,is_muxed_cs_ps_tf;
umts_mac_info *macinf;
rlc_info *rlcinf;
- guint8 fake_lchid=0;
- gint *cur_val=NULL;
+ uint8_t fake_lchid=0;
+ int *cur_val=NULL;
fp_hsdsch_channel_info_t* fp_hsdsch_channel_info = NULL;
fp_edch_channel_info_t* fp_edch_channel_info = NULL;
fp_pch_channel_info_t *fp_pch_channel_info = NULL;
fp_fach_channel_info_t* fp_fach_channel_info = NULL;
fp_rach_channel_info_t* fp_rach_channel_info = NULL;
- gboolean info_missing = FALSE;
+ bool info_missing = false;
fpi = wmem_new0(wmem_file_scope(), fp_info);
p_add_proto_data(wmem_file_scope(), pinfo, proto_fp, 0, fpi);
@@ -5448,7 +5441,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
/*Only do this the first run, signals that we need to reset the RLC fragtable*/
if (!PINFO_FD_VISITED(pinfo) && p_conv_data->reset_frag ) {
fpi->reset_frag = p_conv_data->reset_frag;
- p_conv_data->reset_frag = FALSE;
+ p_conv_data->reset_frag = false;
}
#endif
/* remember 'lower' UDP layer port information so we can later
@@ -5463,12 +5456,12 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
fpi->urnti = p_conv_data->urnti;
if (pinfo->link_dir == P2P_DIR_UL) {
- fpi->is_uplink = TRUE;
+ fpi->is_uplink = true;
} else {
- fpi->is_uplink = FALSE;
+ fpi->is_uplink = false;
}
- ft = tvb_get_guint8(tvb, offset) & 0x01;
+ ft = tvb_get_uint8(tvb, offset) & 0x01;
switch (fpi->channel) {
case CHANNEL_HSDSCH: /* HS-DSCH - High Speed Downlink Shared Channel */
@@ -5476,7 +5469,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
if(fp_hsdsch_channel_info == NULL) {
proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1,
"Can't dissect HS-DSCH FP stream because no per-conversation channel info was attached!");
- info_missing = TRUE;
+ info_missing = true;
break;
}
fpi->hsdsch_entity = fp_hsdsch_channel_info->hsdsch_entity;
@@ -5495,19 +5488,19 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
if (fpi->hsdsch_entity == hs) {
for (i=0; i<MAX_NUM_HSDHSCH_MACDFLOW; i++) {
/*Figure out if this channel is multiplexed (signaled from RRC)*/
- if ((cur_val=(gint *)g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((gint)fp_hsdsch_channel_info->hrnti))) != NULL) {
+ if ((cur_val=(int *)g_tree_lookup(hsdsch_muxed_flows, GINT_TO_POINTER((int)fp_hsdsch_channel_info->hrnti))) != NULL) {
j = 1 << i;
fpi->hsdhsch_macfdlow_is_mux[i] = j & *cur_val;
} else {
- fpi->hsdhsch_macfdlow_is_mux[i] = FALSE;
+ fpi->hsdhsch_macfdlow_is_mux[i] = false;
}
}
}
rlcinf->ueid[0] = get_ue_id_from_conv(p_conv_data);
rlcinf->li_size[0] = RLC_LI_7BITS;
- rlcinf->ciphered[0] = FALSE;
- rlcinf->deciphered[0] = FALSE;
+ rlcinf->ciphered[0] = false;
+ rlcinf->deciphered[0] = false;
p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf);
return fpi;
@@ -5517,7 +5510,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
if(fp_edch_channel_info == NULL) {
proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1,
"Can't dissect E-DCH FP stream because no per-conversation channel info was attached!");
- info_missing = TRUE;
+ info_missing = true;
break;
}
macinf = wmem_new0(wmem_file_scope(), umts_mac_info);
@@ -5532,8 +5525,8 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
rlcinf->ueid[0] = get_ue_id_from_conv(p_conv_data);
rlcinf->li_size[0] = RLC_LI_7BITS;
- rlcinf->ciphered[0] = FALSE;
- rlcinf->deciphered[0] = FALSE;
+ rlcinf->ciphered[0] = false;
+ rlcinf->deciphered[0] = false;
p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_mac, 0, macinf);
p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf);
@@ -5545,7 +5538,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
if(fp_pch_channel_info == NULL) {
proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1,
"Can't dissect PCH FP stream because no per-conversation channel info was attached!");
- info_missing = TRUE;
+ info_missing = true;
break;
}
fpi->paging_indications = fp_pch_channel_info->paging_indications;
@@ -5555,7 +5548,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
/* control frame, we're done */
return fpi;
}
- /* Inesrting Paging Indication Info extracted from the previous packet */
+ /* Inserting Paging Indication Info extracted from the previous packet */
fpi->relevant_paging_indications = fp_pch_channel_info->last_paging_indication_info;
fp_pch_channel_info->last_paging_indication_info = NULL;
@@ -5601,7 +5594,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
if (is_known_dcch_tf || is_muxed_cs_ps_tf) {
/* Channel is multiplexed (ie. C/T field present) */
- macinf->ctmux[j+chan] = TRUE;
+ macinf->ctmux[j+chan] = true;
/* Peek at C/T, different RLC params for different logical channels */
/* C/T is 4 bits according to 3GPP TS 25.321, paragraph 9.2.1, from MAC header (not FP) */
@@ -5613,11 +5606,11 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
}
else if (is_stndalone_ps_rab_tf) {
/* Channel isn't multiplexed (ie. C/T field not present) */
- macinf->ctmux[j+chan] = FALSE;
+ macinf->ctmux[j+chan] = false;
/* Using a fake 'interactive PS' DTCH logical channel id */
/* TODO: Once proper lchid is always set, this has to be changed */
- macinf->fake_chid[j+chan] = TRUE;
+ macinf->fake_chid[j+chan] = true;
macinf->lchid[j+chan] = 11;
macinf->content[j+chan] = MAC_CONTENT_PS_DTCH;
rlcinf->mode[j+chan] = RLC_AM;
@@ -5625,7 +5618,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
else {
/* Unfamiliar DCH format, faking LCHID */
/* Asuming the channel isn't multiplexed (ie. C/T field not present) */
- macinf->ctmux[j+chan] = FALSE;
+ macinf->ctmux[j+chan] = false;
/* TODO: This stuff has to be reworked! */
/* Generates a fake logical channel id for non multiplexed channel */
@@ -5635,7 +5628,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
/************************/
/* TODO: Once proper lchid is always set, this has to be removed */
- macinf->fake_chid[j+chan] = TRUE;
+ macinf->fake_chid[j+chan] = true;
macinf->lchid[j+chan] = fake_lchid;
/************************/
}
@@ -5643,8 +5636,8 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
/* Set RLC data */
rlcinf->ueid[j + chan] = get_ue_id_from_conv(p_conv_data);
rlcinf->li_size[j+chan] = RLC_LI_7BITS;
- rlcinf->ciphered[j+chan] = FALSE;
- rlcinf->deciphered[j+chan] = FALSE;
+ rlcinf->ciphered[j+chan] = false;
+ rlcinf->deciphered[j+chan] = false;
rlcinf->rbid[j+chan] = macinf->lchid[j+chan];
/*Step over this TB and it's C/T field.*/
@@ -5663,7 +5656,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
if(fp_fach_channel_info == NULL) {
proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1,
"Can't dissect FACH FP stream because no per-conversation channel info was attached!");
- info_missing = TRUE;
+ info_missing = true;
break;
}
fpi->num_chans = p_conv_data->num_dch_in_flow;
@@ -5685,8 +5678,8 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
rlcinf->ueid[0] = (p_conv->conv_index | 0xFFF00000);
rlcinf->mode[0] = RLC_AM;
rlcinf->li_size[0] = RLC_LI_7BITS;
- rlcinf->ciphered[0] = FALSE;
- rlcinf->deciphered[0] = FALSE;
+ rlcinf->ciphered[0] = false;
+ rlcinf->deciphered[0] = false;
p_add_proto_data(wmem_file_scope(), pinfo, proto_umts_rlc, 0, rlcinf);
break;
@@ -5695,7 +5688,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
if(fp_rach_channel_info == NULL) {
proto_tree_add_expert_format(tree, pinfo, &ei_fp_no_per_conv_channel_info, tvb, offset, -1,
"Can't dissect RACH FP stream because no per-conversation channel info was attached!");
- info_missing = TRUE;
+ info_missing = true;
break;
}
fpi->num_chans = p_conv_data->num_dch_in_flow;
@@ -5727,7 +5720,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
break;
default:
expert_add_info(pinfo, NULL, &ei_fp_transport_channel_type_unknown);
- info_missing = TRUE;
+ info_missing = true;
break;
}
@@ -5741,7 +5734,7 @@ fp_set_per_packet_inf_from_conv(conversation_t *p_conv,
/* Peek at the packet as the per packet info seems not to take the tfi into account */
for (i=0; i<fpi->num_chans; i++) {
/*TFI is 5 bits according to 3GPP TS 25.427, paragraph 6.2.4.4*/
- tfi = tvb_get_guint8(tvb, offset) & 0x1f;
+ tfi = tvb_get_uint8(tvb, offset) & 0x1f;
if (pinfo->link_dir == P2P_DIR_UL) {
fpi->chan_tf_size[i] = p_conv_data->fp_dch_channel_info[i].ul_chan_tf_size[tfi];
fpi->chan_num_tbs[i] = p_conv_data->fp_dch_channel_info[i].ul_chan_num_tbs[tfi];
@@ -5782,7 +5775,7 @@ dissect_fp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
{
proto_tree *fp_tree;
proto_item *ti;
- gint offset = 0;
+ int offset = 0;
struct fp_info *p_fp_info;
conversation_t *p_conv = NULL;
umts_fp_conversation_info_t *p_conv_data = NULL;
@@ -5889,7 +5882,7 @@ dissect_fp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
for (i=1; i < p_conv_data->num_dch_in_flow; i++) {
col_append_fstr(pinfo->cinfo, COL_INFO, ",%u", p_conv_data->dch_ids_in_flow_list[i]);
}
- col_append_fstr(pinfo->cinfo, COL_INFO, ") ");
+ col_append_str(pinfo->cinfo, COL_INFO, ") ");
}
proto_item_append_text(ti, " (%s)",
val_to_str_const(p_fp_info->channel,
@@ -6007,7 +6000,7 @@ dissect_fp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
break;
case CHANNEL_HSDSCH_COMMON:
expert_add_info(pinfo, NULL, &ei_fp_hsdsch_common_experimental_support);
- /*if (FALSE)*/
+ /*if (false)*/
dissect_hsdsch_common_channel_info(tvb, pinfo, fp_tree, offset, p_fp_info, data);
break;
@@ -6102,7 +6095,7 @@ void proto_register_fp(void)
},
{ &hf_fp_direction,
{ "Direction",
- "fp.direction", FT_BOOLEAN, 8, TFS(&tfs_uplink_downlink), 0x0,
+ "fp.direction", FT_BOOLEAN, BASE_NONE, TFS(&tfs_uplink_downlink), 0x0,
"Link direction", HFILL
}
},
@@ -7018,7 +7011,7 @@ void proto_register_fp(void)
};
- static gint *ett[] =
+ static int *ett[] =
{
&ett_fp,
&ett_fp_data,
@@ -7042,7 +7035,7 @@ void proto_register_fp(void)
{ &ei_fp_spare_extension, { "fp.spare-extension.expert", PI_UNDECODED, PI_WARN, "Spare Extension present (%u bytes)", EXPFILL }},
{ &ei_fp_bad_payload_checksum, { "fp.payload-crc.bad", PI_CHECKSUM, PI_WARN, "Bad payload checksum.", EXPFILL }},
{ &ei_fp_stop_hsdpa_transmission, { "fp.stop_hsdpa_transmission", PI_RESPONSE_CODE, PI_NOTE, "Stop HSDPA transmission", EXPFILL }},
- { &ei_fp_timing_adjustmentment_reported, { "fp.timing_adjustmentment_reported", PI_SEQUENCE, PI_WARN, "Timing adjustmentment reported (%.3f ms)", EXPFILL }},
+ { &ei_fp_timing_adjustment_reported, { "fp.timing_adjustment_reported", PI_SEQUENCE, PI_WARN, "Timing adjustment reported (%.3f ms)", EXPFILL }},
{ &ei_fp_expecting_tdd, { "fp.expecting_tdd", PI_MALFORMED, PI_NOTE, "Error: expecting TDD-384 or TDD-768", EXPFILL }},
{ &ei_fp_ddi_not_defined, { "fp.ddi_not_defined", PI_MALFORMED, PI_ERROR, "DDI %u not defined for this UE!", EXPFILL }},
{ &ei_fp_unable_to_locate_ddi_entry, { "fp.unable_to_locate_ddi_entry", PI_UNDECODED, PI_ERROR, "Unable to locate DDI entry.", EXPFILL }},