diff options
Diffstat (limited to 'epan/dissectors/packet-iso10681.c')
-rw-r--r-- | epan/dissectors/packet-iso10681.c | 358 |
1 files changed, 165 insertions, 193 deletions
diff --git a/epan/dissectors/packet-iso10681.c b/epan/dissectors/packet-iso10681.c index 37edd587..1eb91a00 100644 --- a/epan/dissectors/packet-iso10681.c +++ b/epan/dissectors/packet-iso10681.c @@ -1,7 +1,7 @@ /* packet-iso10681.c * ISO 10681-2 ISO FlexRay TP * By Dr. Lars Voelker <lars.voelker@technica-engineering.de> - * Copyright 2021-2021 Dr. Lars Voelker + * Copyright 2021-2023 Dr. Lars Voelker * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> @@ -45,144 +45,144 @@ void proto_reg_handoff_iso10681(void); #define ISO10681_FLOW_STATUS_OVERFLOW 7 typedef struct iso10681_identifier { - guint32 id; - guint32 seq; - guint16 frag_id; - gboolean last; + uint32_t id; + uint32_t seq; + uint16_t frag_id; + bool last; } iso10681_identifier_t; typedef struct iso10681_frame { - guint32 seq; - guint32 offset; - guint32 len; - gboolean error; - gboolean complete; - guint16 last_frag_id; - guint8 frag_id_high[16]; + uint32_t seq; + uint32_t offset; + uint32_t len; + bool error; + bool complete; + uint16_t last_frag_id; + uint8_t frag_id_high[16]; } iso10681_frame_t; static const value_string iso10681_message_types[] = { - {ISO10681_TYPE_START_FRAME, "Start Frame"}, - {ISO10681_TYPE_CONSECUTIVE_FRAME_1, "Consecutive Frame 1"}, - {ISO10681_TYPE_CONSECUTIVE_FRAME_2, "Consecutive Frame 2"}, - {ISO10681_TYPE_CONSECUTIVE_FRAME_EOB, "Consecutive Frame EOB"}, - {ISO10681_TYPE_FLOW_CONTROL, "Flow Control"}, - {ISO10681_TYPE_LAST_FRAME, "Last Frame"}, - {0, NULL} + {ISO10681_TYPE_START_FRAME, "Start Frame"}, + {ISO10681_TYPE_CONSECUTIVE_FRAME_1, "Consecutive Frame 1"}, + {ISO10681_TYPE_CONSECUTIVE_FRAME_2, "Consecutive Frame 2"}, + {ISO10681_TYPE_CONSECUTIVE_FRAME_EOB, "Consecutive Frame EOB"}, + {ISO10681_TYPE_FLOW_CONTROL, "Flow Control"}, + {ISO10681_TYPE_LAST_FRAME, "Last Frame"}, + {0, NULL} }; static const value_string iso10681_flow_status_values[] = { - {ISO10681_FLOW_STATUS_CTS, "Continue to Send"}, - {ISO10681_FLOW_STATUS_ACK_RETRY, "Ack/Retry"}, - {ISO10681_FLOW_STATUS_WAIT, "Wait"}, - {ISO10681_FLOW_STATUS_ABORT, "Abort"}, - {ISO10681_FLOW_STATUS_OVERFLOW, "Overflow"}, - {0, NULL} + {ISO10681_FLOW_STATUS_CTS, "Continue to Send"}, + {ISO10681_FLOW_STATUS_ACK_RETRY, "Ack/Retry"}, + {ISO10681_FLOW_STATUS_WAIT, "Wait"}, + {ISO10681_FLOW_STATUS_ABORT, "Abort"}, + {ISO10681_FLOW_STATUS_OVERFLOW, "Overflow"}, + {0, NULL} }; static const value_string iso10681_start_type2_values[] = { - {0, "Unacknowledged"}, - {1, "Acknowledged"}, - {0, NULL} + {0, "Unacknowledged"}, + {1, "Acknowledged"}, + {0, NULL} }; static const value_string iso10681_fc_bc_scexp_values[] = { - {0, "0 cycles"}, - {1, "1 cycle"}, - {2, "3 cycles"}, - {3, "7 cycles"}, - {4, "15 cycles"}, - {5, "31 cycles"}, - {6, "63 cycles"}, - {7, "127 cycles"}, - {0, NULL} + {0, "0 cycles"}, + {1, "1 cycle"}, + {2, "3 cycles"}, + {3, "7 cycles"}, + {4, "15 cycles"}, + {5, "31 cycles"}, + {6, "63 cycles"}, + {7, "127 cycles"}, + {0, NULL} }; static const value_string iso10681_fc_ack_values[] = { - {0, "Acknowledge"}, - {1, "Retry Request"}, - {0, NULL} + {0, "Acknowledge"}, + {1, "Retry Request"}, + {0, NULL} }; -static int hf_iso10681_target_address = -1; -static int hf_iso10681_source_address = -1; -static int hf_iso10681_type = -1; -static int hf_iso10681_type2 = -1; -static int hf_iso10681_frame_payload_length = -1; -static int hf_iso10681_message_length = -1; -static int hf_iso10681_sequence_number = -1; -static int hf_iso10681_fc_flow_status = -1; -static int hf_iso10681_fc_bandwidth_control = -1; -static int hf_iso10681_fc_bc_separation_cycle_exp = -1; -static int hf_iso10681_fc_bc_max_num_pdu_per_cycle = -1; -static int hf_iso10681_fc_buffer_size = -1; -static int hf_iso10681_fc_ack = -1; -static int hf_iso10681_fc_byte_position = -1; +static int hf_iso10681_target_address; +static int hf_iso10681_source_address; +static int hf_iso10681_type; +static int hf_iso10681_type2; +static int hf_iso10681_frame_payload_length; +static int hf_iso10681_message_length; +static int hf_iso10681_sequence_number; +static int hf_iso10681_fc_flow_status; +static int hf_iso10681_fc_bandwidth_control; +static int hf_iso10681_fc_bc_separation_cycle_exp; +static int hf_iso10681_fc_bc_max_num_pdu_per_cycle; +static int hf_iso10681_fc_buffer_size; +static int hf_iso10681_fc_ack; +static int hf_iso10681_fc_byte_position; -static gint ett_iso10681 = -1; -static gint ett_iso10681_bandwidth_control = -1; +static int ett_iso10681; +static int ett_iso10681_bandwidth_control; -static expert_field ei_iso10681_message_type_bad = EI_INIT; +static expert_field ei_iso10681_message_type_bad; -static int proto_iso10681 = -1; -static dissector_handle_t iso10681_handle_flexray = NULL; +static int proto_iso10681; +static dissector_handle_t iso10681_handle_flexray; static dissector_table_t subdissector_table; -static range_t *iso10681_flexray_ids = NULL; -static gboolean iso10681_spread_over_multiple_cycles = TRUE; +static range_t *iso10681_flexray_ids; +static bool iso10681_spread_over_multiple_cycles = true; static reassembly_table iso10681_reassembly_table; -static wmem_map_t *iso10681_frame_table = NULL; -static wmem_map_t *iso10681_seq_table = NULL; -static guint32 next_seqnum = 0; +static wmem_map_t *iso10681_frame_table; +static wmem_map_t *iso10681_seq_table; +static uint32_t next_seqnum; -static int hf_iso10681_fragments = -1; -static int hf_iso10681_fragment = -1; -static int hf_iso10681_fragment_overlap = -1; -static int hf_iso10681_fragment_overlap_conflicts = -1; -static int hf_iso10681_fragment_multiple_tails = -1; -static int hf_iso10681_fragment_too_long_fragment = -1; -static int hf_iso10681_fragment_error = -1; -static int hf_iso10681_fragment_count = -1; -static int hf_iso10681_reassembled_in = -1; -static int hf_iso10681_reassembled_length = -1; +static int hf_iso10681_fragments; +static int hf_iso10681_fragment; +static int hf_iso10681_fragment_overlap; +static int hf_iso10681_fragment_overlap_conflicts; +static int hf_iso10681_fragment_multiple_tails; +static int hf_iso10681_fragment_too_long_fragment; +static int hf_iso10681_fragment_error; +static int hf_iso10681_fragment_count; +static int hf_iso10681_reassembled_in; +static int hf_iso10681_reassembled_length; -static gint ett_iso10681_fragment = -1; -static gint ett_iso10681_fragments = -1; +static int ett_iso10681_fragment; +static int ett_iso10681_fragments; static const fragment_items iso10681_frag_items = { - /* Fragment subtrees */ - &ett_iso10681_fragment, - &ett_iso10681_fragments, - /* Fragment fields */ - &hf_iso10681_fragments, - &hf_iso10681_fragment, - &hf_iso10681_fragment_overlap, - &hf_iso10681_fragment_overlap_conflicts, - &hf_iso10681_fragment_multiple_tails, - &hf_iso10681_fragment_too_long_fragment, - &hf_iso10681_fragment_error, - &hf_iso10681_fragment_count, - /* Reassembled in field */ - &hf_iso10681_reassembled_in, - /* Reassembled length field */ - &hf_iso10681_reassembled_length, - /* Reassembled data field */ - NULL, - "ISO10681 fragments" + /* Fragment subtrees */ + &ett_iso10681_fragment, + &ett_iso10681_fragments, + /* Fragment fields */ + &hf_iso10681_fragments, + &hf_iso10681_fragment, + &hf_iso10681_fragment_overlap, + &hf_iso10681_fragment_overlap_conflicts, + &hf_iso10681_fragment_multiple_tails, + &hf_iso10681_fragment_too_long_fragment, + &hf_iso10681_fragment_error, + &hf_iso10681_fragment_count, + /* Reassembled in field */ + &hf_iso10681_reassembled_in, + /* Reassembled length field */ + &hf_iso10681_reassembled_length, + /* Reassembled data field */ + NULL, + "ISO10681 fragments" }; -static guint32 -iso10681_seqnum(guint32 frame_id, gboolean new_seqnum) { - guint32 *ret; +static uint32_t +iso10681_seqnum(uint32_t frame_id, bool new_seqnum) { + uint32_t *ret; - ret = (guint32 *)wmem_map_lookup(iso10681_seq_table, GUINT_TO_POINTER(frame_id)); + ret = (uint32_t *)wmem_map_lookup(iso10681_seq_table, GUINT_TO_POINTER(frame_id)); if (ret == NULL) { - ret = wmem_new0(wmem_file_scope(), guint32); + ret = wmem_new0(wmem_file_scope(), uint32_t); *ret = next_seqnum++; wmem_map_insert(iso10681_seq_table, GUINT_TO_POINTER(frame_id), ret); } else { @@ -195,24 +195,24 @@ iso10681_seqnum(guint32 frame_id, gboolean new_seqnum) { } static int -dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 frame_id, guint32 frame_length _U_) { +dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uint32_t frame_id, uint32_t frame_length _U_) { proto_tree *iso10681_tree; proto_item *ti; proto_item *ti_type; - guint32 type; - guint32 offset; + uint32_t type; + uint32_t offset; iso10681_identifier_t* iso10681_info; - gboolean fragmented = FALSE; - guint32 seqnum = 0; + bool fragmented = false; + uint32_t seqnum = 0; - guint32 data_length = 0; - guint32 full_len = 0; - guint32 target_addr = 0; - guint32 source_addr = 0; + uint32_t data_length = 0; + uint32_t full_len = 0; + uint32_t target_addr = 0; + uint32_t source_addr = 0; tvbuff_t* next_tvb = NULL; - gboolean complete = FALSE; + bool complete = false; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISO10681"); col_clear(pinfo->cinfo, COL_INFO); @@ -222,7 +222,7 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr if (!iso10681_info) { iso10681_info = wmem_new0(wmem_file_scope(), iso10681_identifier_t); iso10681_info->id = frame_id; - iso10681_info->last = FALSE; + iso10681_info->last = false; p_add_proto_data(wmem_file_scope(), pinfo, proto_iso10681, 0, iso10681_info); } @@ -238,7 +238,7 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr switch (type) { case ISO10681_TYPE_START_FRAME: { - guint32 type2_value; + uint32_t type2_value; proto_tree_add_item_ret_uint(iso10681_tree, hf_iso10681_type2, tvb, offset, 1, ENC_BIG_ENDIAN, &type2_value); col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(type2_value, iso10681_start_type2_values, "Unknown (0x%x)")); @@ -246,12 +246,12 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr proto_tree_add_item_ret_uint(iso10681_tree, hf_iso10681_message_length, tvb, offset + 2, 2, ENC_BIG_ENDIAN, &full_len); offset += 4; - fragmented = TRUE; + fragmented = true; seqnum = 0; if (!(pinfo->fd->visited)) { iso10681_frame_t *iso10681_frame = wmem_new0(wmem_file_scope(), iso10681_frame_t); - iso10681_frame->seq = iso10681_info->seq = iso10681_seqnum(frame_id, TRUE); + iso10681_frame->seq = iso10681_info->seq = iso10681_seqnum(frame_id, true); iso10681_frame->len = full_len; wmem_map_insert(iso10681_frame_table, GUINT_TO_POINTER(iso10681_info->seq), iso10681_frame); @@ -268,10 +268,10 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr proto_tree_add_item_ret_uint(iso10681_tree, hf_iso10681_frame_payload_length, tvb, offset + 1, 1, ENC_BIG_ENDIAN, &data_length); offset += 2; - fragmented = TRUE; + fragmented = true; if (!(pinfo->fd->visited)) { - iso10681_info->seq = iso10681_seqnum(frame_id, FALSE); + iso10681_info->seq = iso10681_seqnum(frame_id, false); } col_append_fstr(pinfo->cinfo, COL_INFO, " (Segment Length: %d, Sequence Number: %d)", data_length, seqnum); @@ -282,17 +282,17 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr proto_tree_add_item_ret_uint(iso10681_tree, hf_iso10681_message_length, tvb, offset + 2, 2, ENC_BIG_ENDIAN, &full_len); offset += 4; - fragmented = TRUE; + fragmented = true; if (!(pinfo->fd->visited)) { - iso10681_info->seq = iso10681_seqnum(frame_id, FALSE); + iso10681_info->seq = iso10681_seqnum(frame_id, false); } col_append_fstr(pinfo->cinfo, COL_INFO, " (Segment Length: %d, Total Len: %d)", data_length, full_len); break; } case ISO10681_TYPE_FLOW_CONTROL: { - guint flow_status = 0; + unsigned flow_status = 0; proto_tree_add_item_ret_uint(iso10681_tree, hf_iso10681_fc_flow_status, tvb, offset, 1, ENC_BIG_ENDIAN, &flow_status); switch (flow_status) { @@ -330,7 +330,7 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr if (fragmented) { tvbuff_t *new_tvb = NULL; iso10681_frame_t *iso10681_frame; - guint16 frag_id = seqnum; + uint16_t frag_id = seqnum; /* Get frame information */ iso10681_frame = (iso10681_frame_t *)wmem_map_lookup(iso10681_frame_table, GUINT_TO_POINTER(iso10681_info->seq)); @@ -341,7 +341,7 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr if (!(pinfo->fd->visited)) { DISSECTOR_ASSERT(frag_id < 16); - guint16 tmp = iso10681_frame->frag_id_high[frag_id]++; + uint16_t tmp = iso10681_frame->frag_id_high[frag_id]++; /* Make sure that we assert on using more than 4096 (16*255) segments.*/ DISSECTOR_ASSERT(iso10681_frame->frag_id_high[frag_id] != 0); frag_id += tmp * 16; @@ -351,8 +351,8 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr } if (!iso10681_frame->error) { - gboolean save_fragmented = pinfo->fragmented; - guint32 len = data_length; + bool save_fragmented = pinfo->fragmented; + uint32_t len = data_length; fragment_head *frag_msg; /* Check if it's the last packet */ @@ -364,12 +364,12 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr iso10681_frame->offset += len; if (iso10681_frame->offset >= iso10681_frame->len) { - iso10681_info->last = TRUE; - iso10681_frame->complete = TRUE; + iso10681_info->last = true; + iso10681_frame->complete = true; len -= (iso10681_frame->offset - iso10681_frame->len); } } - pinfo->fragmented = TRUE; + pinfo->fragmented = true; /* Add fragment to fragment table */ frag_msg = fragment_add_seq_check(&iso10681_reassembly_table, tvb, offset, pinfo, iso10681_info->seq, NULL, @@ -388,7 +388,7 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr if (new_tvb) { /* This is a complete TVB to dissect */ next_tvb = new_tvb; - complete = TRUE; + complete = true; } else { next_tvb = tvb_new_subset_length(tvb, offset, data_length); } @@ -402,7 +402,7 @@ dissect_iso10681(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 fr iso10681data.target_address = target_addr; iso10681data.source_address = source_addr; - if (!complete || !dissector_try_payload_new(subdissector_table, next_tvb, pinfo, tree, TRUE, &iso10681data)) { + if (!complete || !dissector_try_payload_new(subdissector_table, next_tvb, pinfo, tree, true, &iso10681data)) { call_data_dissector(next_tvb, pinfo, tree); } } @@ -414,7 +414,7 @@ static int dissect_iso10681_flexray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { DISSECTOR_ASSERT(data); flexray_info_t *flexray_info = (flexray_info_t *)data; - guint32 id = flexray_flexrayinfo_to_flexrayid(flexray_info); + uint32_t id = flexray_flexrayinfo_to_flexrayid(flexray_info); if (iso10681_spread_over_multiple_cycles) { /* masking out the cycle */ @@ -430,101 +430,73 @@ proto_register_iso10681(void) { static hf_register_info hf[] = { { &hf_iso10681_source_address, { - "Source Address", "iso10681.source_address", - FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, + "Source Address", "iso10681.source_address", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_iso10681_target_address, { - "Target Address", "iso10681.target_address", - FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, + "Target Address", "iso10681.target_address", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_iso10681_type, { - "Type", "iso10681.type", - FT_UINT8, BASE_HEX, VALS(iso10681_message_types), ISO10681_TYPE_MASK, NULL, HFILL } }, + "Type", "iso10681.type", FT_UINT8, BASE_HEX, VALS(iso10681_message_types), ISO10681_TYPE_MASK, NULL, HFILL } }, { &hf_iso10681_type2, { - "Type Ack", "iso10681.type_ack", - FT_UINT8, BASE_HEX, VALS(iso10681_start_type2_values), ISO10681_TYPE_PART2_MASK, NULL, HFILL } }, + "Type Ack", "iso10681.type_ack", FT_UINT8, BASE_HEX, VALS(iso10681_start_type2_values), ISO10681_TYPE_PART2_MASK, NULL, HFILL } }, { &hf_iso10681_frame_payload_length, { - "Frame Payload Length", "iso10681.frame_payload_length", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + "Frame Payload Length", "iso10681.frame_payload_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_iso10681_message_length, { - "Message Length", "iso10681.message_length", - FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + "Message Length", "iso10681.message_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_iso10681_sequence_number, { - "Sequence Number", "iso10681.sequence_number", - FT_UINT8, BASE_DEC, NULL, ISO10681_TYPE_PART2_MASK, NULL, HFILL } }, + "Sequence Number", "iso10681.sequence_number", FT_UINT8, BASE_DEC, NULL, ISO10681_TYPE_PART2_MASK, NULL, HFILL } }, { &hf_iso10681_fc_flow_status, { - "Flow Status", "iso10681.flow_status", - FT_UINT8, BASE_DEC, VALS(iso10681_flow_status_values), ISO10681_TYPE_PART2_MASK, NULL, HFILL } }, + "Flow Status", "iso10681.flow_status", FT_UINT8, BASE_DEC, VALS(iso10681_flow_status_values), ISO10681_TYPE_PART2_MASK, NULL, HFILL } }, { &hf_iso10681_fc_bandwidth_control, { - "Bandwidth Control", "iso10681.bandwidth_control", - FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, + "Bandwidth Control", "iso10681.bandwidth_control", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_iso10681_fc_bc_separation_cycle_exp, { - "Separation Cycle Exp", "iso10681.bandwidth_control.separation_cycle_exp", - FT_UINT8, BASE_DEC, VALS(iso10681_fc_bc_scexp_values), 0x07, NULL, HFILL } }, + "Separation Cycle Exp", "iso10681.bandwidth_control.separation_cycle_exp", FT_UINT8, BASE_DEC, VALS(iso10681_fc_bc_scexp_values), 0x07, NULL, HFILL } }, { &hf_iso10681_fc_bc_max_num_pdu_per_cycle, { - "Max Number of PDUs per Cycle", "iso10681.bandwidth_control.max_number_pdus_per_cycle", - FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL } }, + "Max Number of PDUs per Cycle", "iso10681.bandwidth_control.max_number_pdus_per_cycle", FT_UINT8, BASE_DEC, NULL, 0xF8, NULL, HFILL } }, { &hf_iso10681_fc_buffer_size, { - "Buffer Size", "iso10681.buffer_size", - FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, + "Buffer Size", "iso10681.buffer_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_iso10681_fc_ack, { - "Ack", "iso10681.ack", - FT_UINT8, BASE_HEX, VALS(iso10681_fc_ack_values), 0, NULL, HFILL } }, + "Ack", "iso10681.ack", FT_UINT8, BASE_HEX, VALS(iso10681_fc_ack_values), 0, NULL, HFILL } }, { &hf_iso10681_fc_byte_position, { - "Byte Position", "iso10681.byte_position", - FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, + "Byte Position", "iso10681.byte_position", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } }, { &hf_iso10681_fragments, { - "Message fragments", "iso10681.fragments", - FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + "Message fragments", "iso10681.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_fragment, { - "Message fragment", "iso10681.fragment", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + "Message fragment", "iso10681.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_fragment_overlap, { - "Message fragment overlap", "iso10681.fragment.overlap", - FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, + "Message fragment overlap", "iso10681.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_fragment_overlap_conflicts, { - "Message fragment overlapping with conflicting data", "iso10681.fragment.overlap.conflicts", - FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, + "Message fragment overlapping with conflicting data", "iso10681.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_fragment_multiple_tails, { - "Message has multiple tail fragments", "iso10681.fragment.multiple_tails", - FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, + "Message has multiple tail fragments", "iso10681.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_fragment_too_long_fragment, { - "Message fragment too long", "iso10681.fragment.too_long_fragment", - FT_BOOLEAN, 0, NULL, 0x00, NULL, HFILL } }, + "Message fragment too long", "iso10681.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_fragment_error, { - "Message defragmentation error", "iso10681.fragment.error", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + "Message defragmentation error", "iso10681.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_fragment_count, { - "Message fragment count", "iso10681.fragment.count", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, + "Message fragment count", "iso10681.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_reassembled_in, { - "Reassembled in", "iso10681.reassembled.in", - FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, + "Reassembled in", "iso10681.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } }, { &hf_iso10681_reassembled_length, { - "Reassembled length", "iso10681.reassembled.length", - FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, + "Reassembled length", "iso10681.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, }; /* Setup protocol subtree array */ - static gint *ett[] = { - &ett_iso10681, - &ett_iso10681_bandwidth_control, - &ett_iso10681_fragment, - &ett_iso10681_fragments, - }; + static int *ett[] = { + &ett_iso10681, + &ett_iso10681_bandwidth_control, + &ett_iso10681_fragment, + &ett_iso10681_fragments, + }; static ei_register_info ei[] = { - { - &ei_iso10681_message_type_bad, { "iso10681.message_type.bad", PI_MALFORMED, PI_ERROR, "Bad Message Type value", EXPFILL } - }, + { + &ei_iso10681_message_type_bad, { "iso10681.message_type.bad", PI_MALFORMED, PI_ERROR, "Bad Message Type value", EXPFILL } + }, }; expert_module_t* expert_iso10681; - proto_iso10681 = proto_register_protocol ( - "ISO10681 Protocol", /* name */ - "ISO 10681", /* short name */ - "iso10681" /* abbrev */ - ); + proto_iso10681 = proto_register_protocol("ISO10681 Protocol", "ISO 10681", "iso10681"); iso10681_handle_flexray = register_dissector("iso10681", dissect_iso10681_flexray, proto_iso10681); /* Register configuration options */ @@ -553,12 +525,12 @@ proto_register_iso10681(void) { void proto_reg_handoff_iso10681(void) { - static gboolean initialized = FALSE; + static bool initialized = false; if (!initialized) { dissector_add_for_decode_as("flexray.subdissector", iso10681_handle_flexray); - initialized = TRUE; + initialized = true; } else { dissector_delete_all("flexray.combined_id", iso10681_handle_flexray); } |