diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:26 +0000 |
commit | c4e8a3222648fcf22ca207f1815ebbf7cd144eeb (patch) | |
tree | 93d5c6aa93d9987680dd1adad5685e2ad698f223 /plugins/epan/wimax/packet-m2m.c | |
parent | Adding upstream version 4.2.6. (diff) | |
download | wireshark-upstream.tar.xz wireshark-upstream.zip |
Adding upstream version 4.4.0.upstream/4.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | plugins/epan/wimax/packet-m2m.c | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/plugins/epan/wimax/packet-m2m.c b/plugins/epan/wimax/packet-m2m.c index bd08ebb1..d14f3e19 100644 --- a/plugins/epan/wimax/packet-m2m.c +++ b/plugins/epan/wimax/packet-m2m.c @@ -25,14 +25,14 @@ /* forward reference */ void proto_reg_handoff_m2m(void); void proto_register_m2m(void); -static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo); -static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo); -static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo, gint burst_number, gint frag_type, gint frag_number); -static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo); -static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo); -static void physical_attributes_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo); +static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo); +static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo); +static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo, int burst_number, int frag_type, int frag_number); +static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo); +static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo); +static void physical_attributes_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo); static void extended_tlv_decoder(packet_info *pinfo); -void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree, gint hf, guint encoding); +void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, int hf, unsigned encoding); /* Global variables */ static dissector_handle_t m2m_handle; @@ -45,13 +45,13 @@ static dissector_handle_t wimax_phy_attributes_burst_handle; static reassembly_table pdu_reassembly_table; -static gint proto_m2m = -1; +static int proto_m2m; -static gint ett_m2m = -1; -static gint ett_m2m_tlv = -1; -static gint ett_m2m_fch = -1; -static gint ett_m2m_cdma = -1; -static gint ett_m2m_ffb = -1; +static int ett_m2m; +static int ett_m2m_tlv; +static int ett_m2m_fch; +static int ett_m2m_cdma; +static int ett_m2m_ffb; /* TLV types (rev:0.2) */ #define TLV_PROTO_VER 1 @@ -118,31 +118,31 @@ static const value_string tlv_crc16_status[] = { 0, NULL } }; -static gint hf_m2m_sequence_number = -1; -static gint hf_m2m_frame_number = -1; -static gint hf_m2m_tlv_count = -1; - -static gint hf_m2m_type = -1; -static gint hf_m2m_len = -1; -static gint hf_m2m_len_size = -1; -/* static gint hf_m2m_value_bytes = -1; */ -static gint hf_wimax_invalid_tlv = -1; -static gint hf_m2m_value_protocol_vers_uint8 = -1; -static gint hf_m2m_value_burst_num_uint8 = -1; -static gint hf_m2m_value_frag_type_uint8 = -1; -static gint hf_m2m_value_frag_num_uint8 = -1; -static gint hf_m2m_value_pdu_burst = -1; -static gint hf_m2m_value_fast_fb = -1; -static gint hf_m2m_value_fch_burst_uint24 = -1; -static gint hf_m2m_value_cdma_code_uint24 = -1; -static gint hf_m2m_value_crc16_status_uint8 = -1; -static gint hf_m2m_value_burst_power_uint16 = -1; -static gint hf_m2m_value_burst_cinr_uint16 = -1; -static gint hf_m2m_value_preamble_uint16 = -1; -static gint hf_m2m_value_harq_ack_burst_bytes = -1; -static gint hf_m2m_phy_attributes = -1; - -static expert_field ei_m2m_unexpected_length = EI_INIT; +static int hf_m2m_sequence_number; +static int hf_m2m_frame_number; +static int hf_m2m_tlv_count; + +static int hf_m2m_type; +static int hf_m2m_len; +static int hf_m2m_len_size; +/* static int hf_m2m_value_bytes; */ +static int hf_wimax_invalid_tlv; +static int hf_m2m_value_protocol_vers_uint8; +static int hf_m2m_value_burst_num_uint8; +static int hf_m2m_value_frag_type_uint8; +static int hf_m2m_value_frag_num_uint8; +static int hf_m2m_value_pdu_burst; +static int hf_m2m_value_fast_fb; +static int hf_m2m_value_fch_burst_uint24; +static int hf_m2m_value_cdma_code_uint24; +static int hf_m2m_value_crc16_status_uint8; +static int hf_m2m_value_burst_power_uint16; +static int hf_m2m_value_burst_cinr_uint16; +static int hf_m2m_value_preamble_uint16; +static int hf_m2m_value_harq_ack_burst_bytes; +static int hf_m2m_phy_attributes; + +static expert_field ei_m2m_unexpected_length; /* WiMax MAC to MAC protocol dissector */ @@ -152,16 +152,16 @@ static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void proto_item *m2m_item = NULL; proto_tree *m2m_tree = NULL; proto_tree *tlv_tree = NULL; - gint burst_number = 0; - gint length, offset = 0; - gint tlv_count; - gint tlv_type, tlv_len, tlv_offset, tlv_value; - gint tlv_frag_type = 0; - gint tlv_frag_number = 0; + int burst_number = 0; + int length, offset = 0; + int tlv_count; + int tlv_type, tlv_len, tlv_offset, tlv_value; + int tlv_frag_type = 0; + int tlv_frag_number = 0; tlv_info_t m2m_tlv_info; - gint hf; - guint encoding; - guint frame_number; + int hf; + unsigned encoding; + unsigned frame_number; int expected_len; /* display the M2M protocol name */ @@ -221,7 +221,7 @@ static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void { case TLV_PROTO_VER: /* get the protocol version */ - tlv_value = tvb_get_guint8( tvb, offset ); + tlv_value = tvb_get_uint8( tvb, offset ); /* add the description */ proto_item_append_text(ti, ": %d", tlv_value); hf = hf_m2m_value_protocol_vers_uint8; @@ -231,7 +231,7 @@ static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void case TLV_BURST_NUM: /* get the burst number */ - burst_number = tvb_get_guint8( tvb, offset ); + burst_number = tvb_get_uint8( tvb, offset ); /* add the description */ proto_item_append_text(ti, ": %d", burst_number); hf = hf_m2m_value_burst_num_uint8; @@ -241,7 +241,7 @@ static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void case TLV_FRAG_TYPE: /* add the description */ - tlv_frag_type = tvb_get_guint8( tvb, offset ); + tlv_frag_type = tvb_get_uint8( tvb, offset ); proto_item_append_text(ti, ": %s", val_to_str_const(tlv_frag_type, tlv_frag_type_name, "Unknown")); hf = hf_m2m_value_frag_type_uint8; encoding = ENC_BIG_ENDIAN; @@ -250,7 +250,7 @@ static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void case TLV_FRAG_NUM: /* get the fragment number */ - tlv_frag_number = tvb_get_guint8( tvb, offset ); + tlv_frag_number = tvb_get_uint8( tvb, offset ); /* add the description */ proto_item_append_text(ti, ": %d", tlv_frag_number); hf = hf_m2m_value_frag_num_uint8; @@ -308,7 +308,7 @@ static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void case TLV_CRC16_STATUS: /* add the description */ - tlv_value = tvb_get_guint8( tvb, offset ); + tlv_value = tvb_get_uint8( tvb, offset ); proto_item_append_text(ti, ": %s", val_to_str_const(tlv_value, tlv_crc16_status, "Unknown")); hf = hf_m2m_value_crc16_status_uint8; encoding = ENC_BIG_ENDIAN; @@ -389,7 +389,7 @@ static int dissect_m2m(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void } /* Decode and display the FCH burst */ -static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo) +static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo) { if(wimax_fch_burst_handle) { /* call FCH dissector */ @@ -402,7 +402,7 @@ static void fch_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint } /* Decode and display the CDMA Code Attribute */ -static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo) +static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo) { if(wimax_cdma_code_burst_handle) { /* call CDMA dissector */ @@ -415,7 +415,7 @@ static void cdma_code_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint } /* Decode and display the PDU Burst */ -static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo, gint burst_number, gint frag_type, gint frag_number) +static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo, int burst_number, int frag_type, int frag_number) { fragment_head *pdu_frag; tvbuff_t *pdu_tvb = NULL; @@ -471,7 +471,7 @@ static void pdu_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint } /* Decode and display the Fast Feedback Burst */ -static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo) +static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo) { if(wimax_ffb_burst_handle) { /* display the TLV Fast Feedback Burst dissector info */ @@ -483,7 +483,7 @@ static void fast_feedback_burst_decoder(proto_tree *tree, tvbuff_t *tvb, gint of } } -static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo) +static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo) { if(wimax_hack_burst_handle) { /* call the TLV HARQ ACK Bursts dissector */ @@ -495,7 +495,7 @@ static void harq_ack_bursts_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset } } -static void physical_attributes_decoder(proto_tree *tree, tvbuff_t *tvb, gint offset, gint length, packet_info *pinfo) +static void physical_attributes_decoder(proto_tree *tree, tvbuff_t *tvb, int offset, int length, packet_info *pinfo) { if(wimax_phy_attributes_burst_handle) { /* call the TLV PDU Burst Physical Attributes dissector */ @@ -515,10 +515,10 @@ static void extended_tlv_decoder(packet_info *pinfo) } /* Display the raw WiMax TLV */ -void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, guint offset, packet_info *pinfo, proto_tree *tree, gint hf, guint encoding) +void proto_tree_add_tlv(tlv_info_t *self, tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, int hf, unsigned encoding) { - guint tlv_offset; - gint tlv_type, tlv_len; + unsigned tlv_offset; + int tlv_type, tlv_len; /* make sure the TLV information is valid */ if(!self->valid) @@ -748,7 +748,7 @@ void proto_register_m2m(void) } }; - static gint *ett[] = + static int *ett[] = { &ett_m2m, &ett_m2m_tlv, |