diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-atm.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-atm.c')
-rw-r--r-- | epan/dissectors/packet-atm.c | 345 |
1 files changed, 171 insertions, 174 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index f47dcb28..40f39d24 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -14,115 +14,112 @@ #include <epan/capture_dissectors.h> #include <wsutil/pint.h> #include <epan/oui.h> -#include <epan/addr_resolv.h> #include <epan/ppptypes.h> #include <epan/expert.h> #include <epan/crc10-tvb.h> #include <epan/crc32-tvb.h> #include <epan/decode_as.h> +#include <epan/tfs.h> #include "packet-atm.h" #include "packet-snmp.h" -#include "packet-eth.h" -#include "packet-tr.h" -#include "packet-llc.h" #include <epan/prefs.h> #include "packet-pw-atm.h" void proto_register_atm(void); void proto_reg_handoff_atm(void); -static int proto_atm = -1; -static int hf_atm_aal = -1; -static int hf_atm_gfc = -1; -static int hf_atm_vpi = -1; -static int hf_atm_vci = -1; -static int hf_atm_cid = -1; -static int hf_atm_reserved = -1; -static int proto_atm_lane = -1; -static int proto_ilmi = -1; -static int proto_aal1 = -1; -static int proto_aal3_4 = -1; -static int proto_oamaal = -1; - -static int hf_atm_le_client_client = -1; -static int hf_atm_lan_destination_tag = -1; -static int hf_atm_lan_destination_mac = -1; -static int hf_atm_le_control_tlv_type = -1; -static int hf_atm_le_control_tlv_length = -1; -static int hf_atm_lan_destination_route_desc = -1; -static int hf_atm_lan_destination_lan_id = -1; -static int hf_atm_lan_destination_bridge_num = -1; -static int hf_atm_source_atm = -1; -static int hf_atm_target_atm = -1; -static int hf_atm_le_configure_join_frame_lan_type = -1; -static int hf_atm_le_configure_join_frame_max_frame_size = -1; -static int hf_atm_le_configure_join_frame_num_tlvs = -1; -static int hf_atm_le_configure_join_frame_elan_name_size = -1; -static int hf_atm_le_configure_join_frame_elan_name = -1; -static int hf_atm_le_registration_frame_num_tlvs = -1; -static int hf_atm_le_arp_frame_num_tlvs = -1; -static int hf_atm_le_verify_frame_num_tlvs = -1; -static int hf_atm_le_control_marker = -1; -static int hf_atm_le_control_protocol = -1; -static int hf_atm_le_control_version = -1; -static int hf_atm_le_control_opcode = -1; -static int hf_atm_le_control_status = -1; -static int hf_atm_le_control_transaction_id = -1; -static int hf_atm_le_control_requester_lecid = -1; -static int hf_atm_le_control_flags = -1; -static int hf_atm_le_control_flag_v2_capable = -1; -static int hf_atm_le_control_flag_selective_multicast = -1; -static int hf_atm_le_control_flag_v2_required = -1; -static int hf_atm_le_control_flag_proxy = -1; -static int hf_atm_le_control_flag_exclude_explorer_frames = -1; -static int hf_atm_le_control_flag_address = -1; -static int hf_atm_le_control_topology_change = -1; -static int hf_atm_traffic_type = -1; -static int hf_atm_traffic_vcmx = -1; -static int hf_atm_traffic_lane = -1; -static int hf_atm_traffic_ipsilon = -1; -static int hf_atm_cells = -1; -static int hf_atm_aal5_uu = -1; -static int hf_atm_aal5_cpi = -1; -static int hf_atm_aal5_len = -1; -static int hf_atm_aal5_crc = -1; -static int hf_atm_payload_type = -1; -static int hf_atm_cell_loss_priority = -1; -static int hf_atm_header_error_check = -1; -static int hf_atm_channel = -1; -static int hf_atm_aa1_csi = -1; -static int hf_atm_aa1_seq_count = -1; -static int hf_atm_aa1_crc = -1; -static int hf_atm_aa1_parity = -1; -static int hf_atm_aa1_payload = -1; -static int hf_atm_aal3_4_seg_type = -1; -static int hf_atm_aal3_4_seq_num = -1; -static int hf_atm_aal3_4_multiplex_id = -1; -static int hf_atm_aal3_4_information = -1; -static int hf_atm_aal3_4_length_indicator = -1; -static int hf_atm_aal3_4_crc = -1; -static int hf_atm_aal_oamcell_type = -1; -static int hf_atm_aal_oamcell_type_fm = -1; -static int hf_atm_aal_oamcell_type_pm = -1; -static int hf_atm_aal_oamcell_type_ad = -1; -static int hf_atm_aal_oamcell_type_ft = -1; -static int hf_atm_aal_oamcell_func_spec = -1; -static int hf_atm_aal_oamcell_crc = -1; -static int hf_atm_padding = -1; - -static gint ett_atm = -1; -static gint ett_atm_lane = -1; -static gint ett_atm_lane_lc_lan_dest = -1; -static gint ett_atm_lane_lc_lan_dest_rd = -1; -static gint ett_atm_lane_lc_flags = -1; -static gint ett_atm_lane_lc_tlv = -1; -static gint ett_ilmi = -1; -static gint ett_aal1 = -1; -static gint ett_aal3_4 = -1; -static gint ett_oamaal = -1; - -static expert_field ei_atm_reassembly_failed = EI_INIT; +static int proto_atm; +static int hf_atm_aal; +static int hf_atm_gfc; +static int hf_atm_vpi; +static int hf_atm_vci; +static int hf_atm_cid; +static int hf_atm_reserved; +static int proto_atm_lane; +static int proto_ilmi; +static int proto_aal1; +static int proto_aal3_4; +static int proto_oamaal; + +static int hf_atm_le_client_client; +static int hf_atm_lan_destination_tag; +static int hf_atm_lan_destination_mac; +static int hf_atm_le_control_tlv_type; +static int hf_atm_le_control_tlv_length; +static int hf_atm_lan_destination_route_desc; +static int hf_atm_lan_destination_lan_id; +static int hf_atm_lan_destination_bridge_num; +static int hf_atm_source_atm; +static int hf_atm_target_atm; +static int hf_atm_le_configure_join_frame_lan_type; +static int hf_atm_le_configure_join_frame_max_frame_size; +static int hf_atm_le_configure_join_frame_num_tlvs; +static int hf_atm_le_configure_join_frame_elan_name_size; +static int hf_atm_le_configure_join_frame_elan_name; +static int hf_atm_le_registration_frame_num_tlvs; +static int hf_atm_le_arp_frame_num_tlvs; +static int hf_atm_le_verify_frame_num_tlvs; +static int hf_atm_le_control_marker; +static int hf_atm_le_control_protocol; +static int hf_atm_le_control_version; +static int hf_atm_le_control_opcode; +static int hf_atm_le_control_status; +static int hf_atm_le_control_transaction_id; +static int hf_atm_le_control_requester_lecid; +static int hf_atm_le_control_flags; +static int hf_atm_le_control_flag_v2_capable; +static int hf_atm_le_control_flag_selective_multicast; +static int hf_atm_le_control_flag_v2_required; +static int hf_atm_le_control_flag_proxy; +static int hf_atm_le_control_flag_exclude_explorer_frames; +static int hf_atm_le_control_flag_address; +static int hf_atm_le_control_topology_change; +static int hf_atm_traffic_type; +static int hf_atm_traffic_vcmx; +static int hf_atm_traffic_lane; +static int hf_atm_traffic_ipsilon; +static int hf_atm_cells; +static int hf_atm_aal5_uu; +static int hf_atm_aal5_cpi; +static int hf_atm_aal5_len; +static int hf_atm_aal5_crc; +static int hf_atm_payload_type; +static int hf_atm_cell_loss_priority; +static int hf_atm_header_error_check; +static int hf_atm_channel; +static int hf_atm_aa1_csi; +static int hf_atm_aa1_seq_count; +static int hf_atm_aa1_crc; +static int hf_atm_aa1_parity; +static int hf_atm_aa1_payload; +static int hf_atm_aal3_4_seg_type; +static int hf_atm_aal3_4_seq_num; +static int hf_atm_aal3_4_multiplex_id; +static int hf_atm_aal3_4_information; +static int hf_atm_aal3_4_length_indicator; +static int hf_atm_aal3_4_crc; +static int hf_atm_aal_oamcell_type; +static int hf_atm_aal_oamcell_type_fm; +static int hf_atm_aal_oamcell_type_pm; +static int hf_atm_aal_oamcell_type_ad; +static int hf_atm_aal_oamcell_type_ft; +static int hf_atm_aal_oamcell_func_spec; +static int hf_atm_aal_oamcell_crc; +static int hf_atm_padding; + +static int ett_atm; +static int ett_atm_lane; +static int ett_atm_lane_lc_lan_dest; +static int ett_atm_lane_lc_lan_dest_rd; +static int ett_atm_lane_lc_flags; +static int ett_atm_lane_lc_tlv; +static int ett_ilmi; +static int ett_aal1; +static int ett_aal3_4; +static int ett_oamaal; + +static expert_field ei_atm_reassembly_failed; static dissector_handle_t atm_handle; static dissector_handle_t atm_untruncated_handle; @@ -136,7 +133,7 @@ static dissector_handle_t ppp_handle; static dissector_handle_t eth_maybefcs_handle; static dissector_handle_t ip_handle; -static gboolean dissect_lanesscop = FALSE; +static bool dissect_lanesscop; static dissector_table_t atm_type_aal2_table; static dissector_table_t atm_type_aal5_table; @@ -275,7 +272,7 @@ dissect_lan_destination(tvbuff_t *tvb, int offset, const char *type, proto_tree { proto_item *td; proto_tree *dest_tree; - guint16 tag; + uint16_t tag; proto_tree *rd_tree; dest_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, @@ -355,16 +352,16 @@ static const value_string le_tlv_type_vals[] = { }; static void -dissect_le_control_tlvs(tvbuff_t *tvb, int offset, guint num_tlvs, +dissect_le_control_tlvs(tvbuff_t *tvb, int offset, unsigned num_tlvs, proto_tree *tree) { - guint32 tlv_type; - guint8 tlv_length; + uint32_t tlv_type; + uint8_t tlv_length; proto_tree *tlv_tree; while (num_tlvs != 0) { tlv_type = tvb_get_ntohl(tvb, offset); - tlv_length = tvb_get_guint8(tvb, offset+4); + tlv_length = tvb_get_uint8(tvb, offset+4); tlv_tree = proto_tree_add_subtree_format(tree, tvb, offset, 5+tlv_length, ett_atm_lane_lc_tlv, NULL, "TLV type: %s", val_to_str(tlv_type, le_tlv_type_vals, "Unknown (0x%08x)")); proto_tree_add_item(tlv_tree, hf_atm_le_control_tlv_type, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -377,8 +374,8 @@ dissect_le_control_tlvs(tvbuff_t *tvb, int offset, guint num_tlvs, static void dissect_le_configure_join_frame(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint8 num_tlvs; - guint8 name_size; + uint8_t num_tlvs; + uint8_t name_size; dissect_lan_destination(tvb, offset, "Source", tree); offset += 8; @@ -395,11 +392,11 @@ dissect_le_configure_join_frame(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree_add_item(tree, hf_atm_le_configure_join_frame_max_frame_size, tvb, offset, 1, ENC_NA); offset += 1; - num_tlvs = tvb_get_guint8(tvb, offset); + num_tlvs = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_atm_le_configure_join_frame_num_tlvs, tvb, offset, 1, ENC_NA); offset += 1; - name_size = tvb_get_guint8(tvb, offset); + name_size = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_atm_le_configure_join_frame_elan_name_size, tvb, offset, 1, ENC_NA); offset += 1; @@ -419,7 +416,7 @@ dissect_le_configure_join_frame(tvbuff_t *tvb, int offset, proto_tree *tree) static void dissect_le_registration_frame(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint8 num_tlvs; + uint8_t num_tlvs; dissect_lan_destination(tvb, offset, "Source", tree); offset += 8; @@ -433,7 +430,7 @@ dissect_le_registration_frame(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree_add_item(tree, hf_atm_reserved, tvb, offset, 2, ENC_NA); offset += 2; - num_tlvs = tvb_get_guint8(tvb, offset); + num_tlvs = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_atm_le_registration_frame_num_tlvs, tvb, offset, 1, ENC_NA); offset += 1; @@ -446,7 +443,7 @@ dissect_le_registration_frame(tvbuff_t *tvb, int offset, proto_tree *tree) static void dissect_le_arp_frame(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint8 num_tlvs; + uint8_t num_tlvs; dissect_lan_destination(tvb, offset, "Source", tree); offset += 8; @@ -460,7 +457,7 @@ dissect_le_arp_frame(tvbuff_t *tvb, int offset, proto_tree *tree) proto_tree_add_item(tree, hf_atm_reserved, tvb, offset, 2, ENC_NA); offset += 2; - num_tlvs = tvb_get_guint8(tvb, offset); + num_tlvs = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_atm_le_arp_frame_num_tlvs, tvb, offset, 1, ENC_NA); offset += 1; @@ -479,12 +476,12 @@ dissect_le_arp_frame(tvbuff_t *tvb, int offset, proto_tree *tree) static void dissect_le_verify_frame(tvbuff_t *tvb, int offset, proto_tree *tree) { - guint8 num_tlvs; + uint8_t num_tlvs; proto_tree_add_item(tree, hf_atm_reserved, tvb, offset, 38, ENC_NA); offset += 38; - num_tlvs = tvb_get_guint8(tvb, offset); + num_tlvs = tvb_get_uint8(tvb, offset); proto_tree_add_item(tree, hf_atm_le_verify_frame_num_tlvs, tvb, offset, 1, ENC_NA); offset += 1; @@ -532,7 +529,7 @@ dissect_le_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) int offset = 0; proto_item *tf; proto_tree *flags_tree; - guint16 opcode; + uint16_t opcode; col_set_str(pinfo->cinfo, COL_INFO, "LE Control"); @@ -650,8 +647,8 @@ dissect_le_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } } -static gboolean -capture_lane(const guchar *pd, int offset _U_, +static bool +capture_lane(const unsigned char *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header) { /* Is it LE Control, 802.3, 802.5, or "none of the above"? */ @@ -707,7 +704,7 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) static int dissect_ilmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - return dissect_snmp_pdu(tvb, 0, pinfo, tree, proto_ilmi, ett_ilmi, FALSE); + return dissect_snmp_pdu(tvb, 0, pinfo, tree, proto_ilmi, ett_ilmi, false); } /* AAL types */ @@ -776,28 +773,28 @@ static const value_string ipsilon_type_vals[] = { { 0, NULL } }; -static gboolean -capture_atm(const guchar *pd, int offset, +static bool +capture_atm(const unsigned char *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header) { if (pseudo_header->atm.aal == AAL_5) { return try_capture_dissector("atm.aal5.type", pseudo_header->atm.type, pd, offset, len, cpinfo, pseudo_header); } - return FALSE; + return false; } static void dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - proto_item *atm_ti, proto_tree *atm_tree, gboolean truncated, - struct atm_phdr *atm_info, gboolean pseudowire_mode) + proto_item *atm_ti, proto_tree *atm_tree, bool truncated, + struct atm_phdr *atm_info, bool pseudowire_mode) { - guint length, reported_length; - guint16 aal5_length; + unsigned length, reported_length; + uint16_t aal5_length; int pad_length; tvbuff_t *next_tvb; - guint32 crc; - guint32 calc_crc; - gboolean decoded; + uint32_t crc; + uint32_t calc_crc; + bool decoded; /* * This is reassembled traffic, so the cell headers are missing; @@ -935,12 +932,12 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, */ if (dissector_try_uint_new(atm_reassembled_vpi_vci_table, ((atm_info->vpi) << 16) | atm_info->vci, - next_tvb, pinfo, tree, TRUE, atm_info)) + next_tvb, pinfo, tree, true, atm_info)) { return; } - decoded = FALSE; + decoded = false; /* * Don't try to dissect the payload of PDUs with a reassembly * error. @@ -950,21 +947,21 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case AAL_SIGNALLING: if (!(atm_info->flags & ATM_REASSEMBLY_ERROR)) { call_dissector(sscop_handle, next_tvb, pinfo, tree); - decoded = TRUE; + decoded = true; } break; case AAL_5: if (!(atm_info->flags & ATM_REASSEMBLY_ERROR)) { - if (dissector_try_uint_new(atm_type_aal5_table, atm_info->type, next_tvb, pinfo, tree, TRUE, atm_info)) + if (dissector_try_uint_new(atm_type_aal5_table, atm_info->type, next_tvb, pinfo, tree, true, atm_info)) { - decoded = TRUE; + decoded = true; } else { if (tvb_reported_length(next_tvb) > 7) /* sizeof(octet) */ { - guint8 octet[8]; + uint8_t octet[8]; tvb_memcpy(next_tvb, octet, 0, sizeof(octet)); if (octet[0] == 0xaa @@ -972,12 +969,12 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, && octet[2] == 0x03) /* LLC SNAP as per RFC2684 */ { call_dissector(llc_handle, next_tvb, pinfo, tree); - decoded = TRUE; + decoded = true; } else if ((pntoh16(octet) & 0xff) == PPP_IP) { call_dissector(ppp_handle, next_tvb, pinfo, tree); - decoded = TRUE; + decoded = true; } else if (pntoh16(octet) == 0x00) { @@ -994,7 +991,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item(tree, hf_atm_padding, tvb, 0, 2, ENC_NA); next_tvb = tvb_new_subset_remaining(tvb, 2); call_dissector(eth_maybefcs_handle, next_tvb, pinfo, tree); - decoded = TRUE; + decoded = true; } else if (octet[2] == 0x03 && /* NLPID */ ((octet[3] == 0xcc || /* IPv4 */ @@ -1004,7 +1001,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, { /* assume network interworking with FR 2 byte header */ call_dissector(fr_handle, next_tvb, pinfo, tree); - decoded = TRUE; + decoded = true; } else if (octet[4] == 0x03 && /* NLPID */ ((octet[5] == 0xcc || /* IPv4 */ @@ -1014,13 +1011,13 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, { /* assume network interworking with FR 4 byte header */ call_dissector(fr_handle, next_tvb, pinfo, tree); - decoded = TRUE; + decoded = true; } else if (((octet[0] & 0xf0)== 0x40) || ((octet[0] & 0xf0) == 0x60)) { call_dissector(ip_handle, next_tvb, pinfo, tree); - decoded = TRUE; + decoded = true; } } } @@ -1050,7 +1047,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (dissector_try_uint(atm_type_aal2_table, atm_info->type, next_tvb, pinfo, tree)) { - decoded = TRUE; + decoded = true; } } break; @@ -1079,7 +1076,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, */ #define COSET_LEADER 0x055 /* x^6 + x^4 + x^2 + 1 */ -static const guint8 syndrome_table[256] = { +static const uint8_t syndrome_table[256] = { 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, @@ -1253,9 +1250,9 @@ static const int err_posn_table[256] = { * and, if so, where the error was, if it was correctable. */ static int -get_header_err(const guint8 *cell_header) +get_header_err(const uint8_t *cell_header) { - register guint8 syndrome; + register uint8_t syndrome; register int i, err_posn; syndrome = 0; @@ -1327,14 +1324,14 @@ static const value_string ft_ad_vals[] = { static void dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *tree, guint aal, gboolean fill_columns, + proto_tree *tree, unsigned aal, bool fill_columns, struct atm_phdr *atm_info) { proto_tree *aal_tree; proto_item *ti; - guint8 octet; - gint length; - guint16 aal3_4_hdr, crc10; + uint8_t octet; + int length; + uint16_t aal3_4_hdr, crc10; tvbuff_t *next_tvb; next_tvb = tvb_new_subset_remaining(tvb, offset); @@ -1344,7 +1341,7 @@ dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, */ if (dissector_try_uint_new(atm_cell_payload_vpi_vci_table, ((atm_info->vpi) << 16) | atm_info->vci, - next_tvb, pinfo, tree, TRUE, atm_info)) + next_tvb, pinfo, tree, true, atm_info)) { return; } @@ -1356,7 +1353,7 @@ dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, col_clear(pinfo->cinfo, COL_INFO); ti = proto_tree_add_item(tree, proto_aal1, tvb, offset, -1, ENC_NA); aal_tree = proto_item_add_subtree(ti, ett_aal1); - octet = tvb_get_guint8(tvb, offset); + octet = tvb_get_uint8(tvb, offset); proto_tree_add_item(aal_tree, hf_atm_aa1_csi, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(aal_tree, hf_atm_aa1_seq_count, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1405,10 +1402,10 @@ dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, } ti = proto_tree_add_item(tree, proto_oamaal, tvb, offset, -1, ENC_NA); aal_tree = proto_item_add_subtree(ti, ett_oamaal); - octet = tvb_get_guint8(tvb, offset); + octet = tvb_get_uint8(tvb, offset); if (fill_columns) { - col_add_fstr(pinfo->cinfo, COL_INFO, "%s", + col_add_str(pinfo->cinfo, COL_INFO, val_to_str(octet >> 4, oam_type_vals, "Unknown (%u)")); } @@ -1454,8 +1451,8 @@ dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo, * OAM F4 is VCI 3 or 4 and PT 0X0. * OAM F5 is PT 10X. */ -gboolean -atm_is_oam_cell(const guint16 vci, const guint8 pt) +bool +atm_is_oam_cell(const uint16_t vci, const uint8_t pt) { return (((vci == 3 || vci == 4) && ((pt & 0x5) == 0)) || ((pt & 0x6) == 0x4)); @@ -1464,14 +1461,14 @@ atm_is_oam_cell(const guint16 vci, const guint8 pt) static void dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - proto_tree *atm_tree, guint aal, gboolean nni, - gboolean crc_stripped, const struct atm_phdr *atm_info) + proto_tree *atm_tree, unsigned aal, bool nni, + bool crc_stripped, const struct atm_phdr *atm_info) { int offset; proto_item *ti; - guint8 octet, pt; + uint8_t octet, pt; int err; - guint16 vpi, vci; + uint16_t vpi, vci; struct atm_phdr atm_info_local; if (!nni) { @@ -1492,10 +1489,10 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * | HEC (CRC) | * +-+-+-+-+-+-+-+-+ */ - octet = tvb_get_guint8(tvb, 0); + octet = tvb_get_uint8(tvb, 0); proto_tree_add_item(atm_tree, hf_atm_gfc, tvb, 0, 1, ENC_NA); vpi = (octet & 0xF) << 4; - octet = tvb_get_guint8(tvb, 1); + octet = tvb_get_uint8(tvb, 1); vpi |= octet >> 4; proto_tree_add_uint(atm_tree, hf_atm_vpi, tvb, 0, 2, vpi); } else { @@ -1516,17 +1513,17 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * | HEC (CRC) | * +-+-+-+-+-+-+-+-+ */ - octet = tvb_get_guint8(tvb, 0); + octet = tvb_get_uint8(tvb, 0); vpi = octet << 4; - octet = tvb_get_guint8(tvb, 1); + octet = tvb_get_uint8(tvb, 1); vpi |= (octet & 0xF0) >> 4; proto_tree_add_uint(atm_tree, hf_atm_vpi, tvb, 0, 2, vpi); } vci = (octet & 0x0F) << 12; - octet = tvb_get_guint8(tvb, 2); + octet = tvb_get_uint8(tvb, 2); vci |= octet << 4; - octet = tvb_get_guint8(tvb, 3); + octet = tvb_get_uint8(tvb, 3); vci |= octet >> 4; proto_tree_add_uint(atm_tree, hf_atm_vci, tvb, 1, 3, vci); pt = (octet >> 1) & 0x7; @@ -1538,7 +1535,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * FF: parse the Header Error Check (HEC). */ ti = proto_tree_add_item(atm_tree, hf_atm_header_error_check, tvb, 4, 1, ENC_BIG_ENDIAN); - err = get_header_err((const guint8*)tvb_memdup(pinfo->pool, tvb, 0, 5)); + err = get_header_err((const uint8_t*)tvb_memdup(pinfo->pool, tvb, 0, 5)); if (err == NO_ERROR_DETECTED) proto_item_append_text(ti, " (correct)"); else if (err == UNCORRECTIBLE_ERROR) @@ -1587,12 +1584,12 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, atm_info_local.vci = vci; } - dissect_atm_cell_payload(tvb, offset, pinfo, tree, aal, TRUE, &atm_info_local); + dissect_atm_cell_payload(tvb, offset, pinfo, tree, aal, true, &atm_info_local); } static int dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, - gboolean truncated, struct atm_phdr *atm_info, gboolean pseudowire_mode) + bool truncated, struct atm_phdr *atm_info, bool pseudowire_mode) { proto_tree *atm_tree = NULL; proto_item *atm_ti = NULL; @@ -1655,7 +1652,7 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item_set_len(atm_ti, 5); } dissect_atm_cell(tvb, pinfo, tree, atm_tree, - atm_info->aal, FALSE, + atm_info->aal, false, atm_info->flags & ATM_NO_HEC, atm_info); } else { /* This is a reassembled PDU. */ @@ -1680,7 +1677,7 @@ dissect_atm_truncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void DISSECTOR_ASSERT(atm_info != NULL); - return dissect_atm_common(tvb, pinfo, tree, TRUE, atm_info, FALSE); + return dissect_atm_common(tvb, pinfo, tree, true, atm_info, false); } static int @@ -1690,7 +1687,7 @@ dissect_atm_pw_truncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo DISSECTOR_ASSERT(atm_info != NULL); - return dissect_atm_common(tvb, pinfo, tree, TRUE, atm_info, TRUE); + return dissect_atm_common(tvb, pinfo, tree, true, atm_info, true); } static int @@ -1700,7 +1697,7 @@ dissect_atm_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi DISSECTOR_ASSERT(atm_info != NULL); - return dissect_atm_common(tvb, pinfo, tree, FALSE, atm_info, FALSE); + return dissect_atm_common(tvb, pinfo, tree, false, atm_info, false); } static int @@ -1710,7 +1707,7 @@ dissect_atm_pw_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, DISSECTOR_ASSERT(atm_info != NULL); - return dissect_atm_common(tvb, pinfo, tree, FALSE, atm_info, TRUE); + return dissect_atm_common(tvb, pinfo, tree, false, atm_info, true); } static int @@ -1724,7 +1721,7 @@ dissect_atm_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* atm_ti = proto_tree_add_item(tree, proto_atm, tvb, 0, 0, ENC_NA); atm_tree = proto_item_add_subtree(atm_ti, ett_atm); - dissect_atm_cell(tvb, pinfo, tree, atm_tree, AAL_OAMCELL, FALSE, FALSE, NULL); + dissect_atm_cell(tvb, pinfo, tree, atm_tree, AAL_OAMCELL, false, false, NULL); return tvb_reported_length(tvb); } @@ -1744,14 +1741,14 @@ dissect_atm_pw_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi return tvb_reported_length(tvb); } -static void atm_prompt(packet_info *pinfo _U_, gchar* result) +static void atm_prompt(packet_info *pinfo _U_, char* result) { snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode AAL2 traffic as"); } -static gpointer atm_value(packet_info *pinfo) +static void *atm_value(packet_info *pinfo) { - return GUINT_TO_POINTER((guint)pinfo->pseudo_header->atm.type); + return GUINT_TO_POINTER((unsigned)pinfo->pseudo_header->atm.type); } void @@ -1978,7 +1975,7 @@ proto_register_atm(void) }; - static gint *ett[] = { + static int *ett[] = { &ett_atm, &ett_ilmi, &ett_aal1, |