aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iso15765.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-iso15765.c')
-rw-r--r--epan/dissectors/packet-iso15765.c1050
1 files changed, 629 insertions, 421 deletions
diff --git a/epan/dissectors/packet-iso15765.c b/epan/dissectors/packet-iso15765.c
index 3157397bf2..6faa4ca6be 100644
--- a/epan/dissectors/packet-iso15765.c
+++ b/epan/dissectors/packet-iso15765.c
@@ -9,6 +9,33 @@
*/
/*
+ * CAN ID Mapping
+ *
+ * When using ISO15765 to transport UDS and others, the diagnostic addresses might be
+ * determined by mapping the underlaying CAN ID (29bit or 11bit).
+ *
+ * Option 1: Two Addresses can be determined (Source and Target Address.
+ * Option 2: One Address can be determined (ECU Address).
+ * Option 3: No Address can be determined.
+ *
+ * For Option 1 and 2 the ISO15765_can_id_mappings table can be used to determine the addresses:
+ * - Ext Addr determines, if the CAN ID is 29bit (TRUE) or 11bit (FALSE)
+ * - CAN ID and CAN ID Mask determined how to know if a CAN ID should be mapped
+ * - Source Addr Mask and Target Addr Mask show the bits used to determine the addresses of Option 1
+ * - ECU Addr Mask defines the bits for the address of Option 2
+ *
+ * Example:
+ * - ISO15765 is applicable to all 29bit CAN IDs 0x9988TTSS, with TT the target address and SS the source address.
+ * - Ext Addr: TRUE
+ * - CAN ID: 0x99880000
+ * - CAN ID Mask: 0xffff0000
+ * - Target Addr Mask: 0x0000ff00
+ * - Source Addr Mask: 0x000000ff
+ *
+ * The addresses are passed via iso15765data_t to the next dissector (e.g., UDS).
+ */
+
+/*
* Support for FlexRay variant, see: https://www.autosar.org/fileadmin/user_upload/standards/classic/20-11/AUTOSAR_SWS_FlexRayARTransportLayer.pdf
*/
@@ -22,19 +49,18 @@
#include <epan/proto_data.h>
#include <epan/uat.h>
#include <wsutil/bits_ctz.h>
+#include <wsutil/bits_count_ones.h>
#include "packet-socketcan.h"
#include "packet-lin.h"
#include "packet-flexray.h"
#include "packet-iso15765.h"
+#include "packet-autosar-ipdu-multiplexer.h"
+#include "packet-pdu-transport.h"
void proto_register_iso15765(void);
void proto_reg_handoff_iso15765(void);
-#define ISO15765_PCI_LEN 1
-#define ISO15765_PCI_FD_SF_LEN 2
-#define ISO15765_PCI_FD_FF_LEN 6
-
#define ISO15765_MESSAGE_TYPE_MASK 0xF0
#define ISO15765_MESSAGE_TYPES_SINGLE_FRAME 0
#define ISO15765_MESSAGE_TYPES_FIRST_FRAME 1
@@ -46,34 +72,25 @@ void proto_reg_handoff_iso15765(void);
#define ISO15765_MESSAGE_TYPES_FR_ACK_FRAME 7
#define ISO15765_MESSAGE_DATA_LENGTH_MASK 0x0F
-#define ISO15765_FD_MESSAGE_DATA_LENGTH_MASK 0x00FF
-#define ISO15765_MESSAGE_EXTENDED_FRAME_LENGTH_MASK 0x0F
-#define ISO15765_MESSAGE_FRAME_LENGTH_OFFSET (ISO15765_PCI_LEN)
-#define ISO15765_MESSAGE_FRAME_LENGTH_LEN 1
#define ISO15765_MESSAGE_SEQUENCE_NUMBER_MASK 0x0F
#define ISO15765_MESSAGE_FLOW_STATUS_MASK 0x0F
-#define ISO15765_FC_BS_OFFSET (ISO15765_PCI_LEN)
-#define ISO15765_FC_BS_LEN 1
-#define ISO15765_FC_STMIN_OFFSET (ISO15765_FC_BS_OFFSET + ISO15765_FC_BS_LEN)
-#define ISO15765_FC_STMIN_LEN 1
+#define ISO15765_MESSAGE_FIRST_FRAME_DATA_LENGTH_MASK 0x0FFF
#define ISO15765_MESSAGE_AUTOSAR_ACK_MASK 0xF0
#define ISO15765_AUTOSAR_ACK_OFFSET 3
-struct iso15765_identifier
-{
+#define ISO15765_ADDR_INVALID 0xffffffff
+
+typedef struct iso15765_identifier {
guint32 id;
guint32 seq;
guint16 frag_id;
gboolean last;
-};
+ guint32 bytes_used;
+} iso15765_identifier_t;
-typedef struct iso15765_identifier iso15765_identifier_t;
-
-
-struct iso15765_frame
-{
+typedef struct iso15765_frame {
guint32 seq;
guint32 offset;
guint32 len;
@@ -81,120 +98,134 @@ struct iso15765_frame
gboolean complete;
guint16 last_frag_id;
guint8 frag_id_high[16];
-};
-
-typedef struct iso15765_frame iso15765_frame_t;
+} iso15765_frame_t;
static const value_string iso15765_message_types[] = {
- {ISO15765_MESSAGE_TYPES_SINGLE_FRAME, "Single Frame"},
- {ISO15765_MESSAGE_TYPES_FIRST_FRAME, "First Frame"},
- {ISO15765_MESSAGE_TYPES_CONSECUTIVE_FRAME, "Consecutive Frame"},
- {ISO15765_MESSAGE_TYPES_FLOW_CONTROL, "Flow control"},
- {ISO15765_MESSAGE_TYPES_FR_SINGLE_FRAME_EXT, "Single Frame Ext"},
- {ISO15765_MESSAGE_TYPES_FR_FIRST_FRAME_EXT, "First Frame Ext"},
- {ISO15765_MESSAGE_TYPES_FR_CONSECUTIVE_FRAME_2, "Consecutive Frame 2"},
- {ISO15765_MESSAGE_TYPES_FR_ACK_FRAME, "Ack Frame"},
- {0, NULL}
+ {ISO15765_MESSAGE_TYPES_SINGLE_FRAME, "Single Frame"},
+ {ISO15765_MESSAGE_TYPES_FIRST_FRAME, "First Frame"},
+ {ISO15765_MESSAGE_TYPES_CONSECUTIVE_FRAME, "Consecutive Frame"},
+ {ISO15765_MESSAGE_TYPES_FLOW_CONTROL, "Flow control"},
+ {ISO15765_MESSAGE_TYPES_FR_SINGLE_FRAME_EXT, "Single Frame Ext"},
+ {ISO15765_MESSAGE_TYPES_FR_FIRST_FRAME_EXT, "First Frame Ext"},
+ {ISO15765_MESSAGE_TYPES_FR_CONSECUTIVE_FRAME_2, "Consecutive Frame 2"},
+ {ISO15765_MESSAGE_TYPES_FR_ACK_FRAME, "Ack Frame"},
+ {0, NULL}
};
static const value_string iso15765_flow_status_types[] = {
- {0, "Continue to Send"},
- {1, "Wait"},
- {2, "Overflow"},
- {0, NULL}
+ {0, "Continue to Send"},
+ {1, "Wait"},
+ {2, "Overflow"},
+ {0, NULL}
};
#define NORMAL_ADDRESSING 1
#define EXTENDED_ADDRESSING 2
-#define FLEXRAY_ONE_BYTE_ADDRESSING 1
-#define FLEXRAY_TWO_BYTE_ADDRESSING 2
+#define ZERO_BYTE_ADDRESSING 0
+#define ONE_BYTE_ADDRESSING 1
+#define TWO_BYTE_ADDRESSING 2
static gint addressing = NORMAL_ADDRESSING;
-static gint flexray_addressing = FLEXRAY_ONE_BYTE_ADDRESSING;
+static gint flexray_addressing = ONE_BYTE_ADDRESSING;
static guint flexray_segment_size_limit = 0;
static guint window = 8;
static range_t *configured_can_ids= NULL;
static range_t *configured_ext_can_ids = NULL;
static gboolean register_lin_diag_frames = TRUE;
+static range_t *configured_ipdum_pdu_ids = NULL;
+static gint ipdum_addressing = ZERO_BYTE_ADDRESSING;
/* Encoding */
static const enum_val_t enum_addressing[] = {
- {"normal", "Normal addressing", NORMAL_ADDRESSING},
- {"extended", "Extended addressing", EXTENDED_ADDRESSING},
- {NULL, NULL, 0}
+ {"normal", "Normal addressing", NORMAL_ADDRESSING},
+ {"extended", "Extended addressing", EXTENDED_ADDRESSING},
+ {NULL, NULL, 0}
};
/* Encoding */
static const enum_val_t enum_flexray_addressing[] = {
- {"1 Byte", "1 byte addressing", FLEXRAY_ONE_BYTE_ADDRESSING},
- {"2 byte", "2 byte addressing", FLEXRAY_TWO_BYTE_ADDRESSING},
- {NULL, NULL, 0}
+ {"1 Byte", "1 byte addressing", ONE_BYTE_ADDRESSING},
+ {"2 Byte", "2 byte addressing", TWO_BYTE_ADDRESSING},
+ {NULL, NULL, 0}
};
+static const enum_val_t enum_ipdum_addressing[] = {
+ {"0 Byte", "0 byte addressing", ZERO_BYTE_ADDRESSING},
+ {"1 Byte", "1 byte addressing", ONE_BYTE_ADDRESSING},
+ {"2 Byte", "2 byte addressing", TWO_BYTE_ADDRESSING},
+ {NULL, NULL, 0}
+};
-static int hf_iso15765_address = -1;
-static int hf_iso15765_target_address = -1;
-static int hf_iso15765_source_address = -1;
-static int hf_iso15765_message_type = -1;
-static int hf_iso15765_data_length = -1;
-static int hf_iso15765_frame_length = -1;
-static int hf_iso15765_sequence_number = -1;
-static int hf_iso15765_flow_status = -1;
+static int hf_iso15765_address;
+static int hf_iso15765_target_address;
+static int hf_iso15765_source_address;
+static int hf_iso15765_message_type;
+static int hf_iso15765_data_length_8bit;
+static int hf_iso15765_data_length_4bit;
+static int hf_iso15765_frame_length_32bit;
+static int hf_iso15765_frame_length_12bit;
+static int hf_iso15765_sequence_number;
+static int hf_iso15765_flow_status;
+static int hf_iso15765_segment_data;
+static int hf_iso15765_padding;
-static int hf_iso15765_fc_bs = -1;
-static int hf_iso15765_fc_stmin = -1;
+static int hf_iso15765_fc_bs;
+static int hf_iso15765_fc_stmin;
+static int hf_iso15765_fc_stmin_in_us;
-static int hf_iso15765_autosar_ack = -1;
+static int hf_iso15765_autosar_ack;
-static gint ett_iso15765 = -1;
+static gint ett_iso15765;
-static expert_field ei_iso15765_message_type_bad = EI_INIT;
+static expert_field ei_iso15765_message_type_bad;
-static int proto_iso15765 = -1;
+static int proto_iso15765;
static dissector_handle_t iso15765_handle_can = NULL;
static dissector_handle_t iso15765_handle_lin = NULL;
static dissector_handle_t iso15765_handle_flexray = NULL;
+static dissector_handle_t iso15765_handle_ipdum = NULL;
+static dissector_handle_t iso15765_handle_pdu_transport = NULL;
static dissector_table_t subdissector_table;
static reassembly_table iso15765_reassembly_table;
static wmem_map_t *iso15765_frame_table = NULL;
-static int hf_iso15765_fragments = -1;
-static int hf_iso15765_fragment = -1;
-static int hf_iso15765_fragment_overlap = -1;
-static int hf_iso15765_fragment_overlap_conflicts = -1;
-static int hf_iso15765_fragment_multiple_tails = -1;
-static int hf_iso15765_fragment_too_long_fragment = -1;
-static int hf_iso15765_fragment_error = -1;
-static int hf_iso15765_fragment_count = -1;
-static int hf_iso15765_reassembled_in = -1;
-static int hf_iso15765_reassembled_length = -1;
+static int hf_iso15765_fragments;
+static int hf_iso15765_fragment;
+static int hf_iso15765_fragment_overlap;
+static int hf_iso15765_fragment_overlap_conflicts;
+static int hf_iso15765_fragment_multiple_tails;
+static int hf_iso15765_fragment_too_long_fragment;
+static int hf_iso15765_fragment_error;
+static int hf_iso15765_fragment_count;
+static int hf_iso15765_reassembled_in;
+static int hf_iso15765_reassembled_length;
-static gint ett_iso15765_fragment = -1;
-static gint ett_iso15765_fragments = -1;
+static gint ett_iso15765_fragment;
+static gint ett_iso15765_fragments;
static const fragment_items iso15765_frag_items = {
- /* Fragment subtrees */
- &ett_iso15765_fragment,
- &ett_iso15765_fragments,
- /* Fragment fields */
- &hf_iso15765_fragments,
- &hf_iso15765_fragment,
- &hf_iso15765_fragment_overlap,
- &hf_iso15765_fragment_overlap_conflicts,
- &hf_iso15765_fragment_multiple_tails,
- &hf_iso15765_fragment_too_long_fragment,
- &hf_iso15765_fragment_error,
- &hf_iso15765_fragment_count,
- /* Reassembled in field */
- &hf_iso15765_reassembled_in,
- /* Reassembled length field */
- &hf_iso15765_reassembled_length,
- /* Reassembled data field */
- NULL,
- "ISO15765 fragments"
+ /* Fragment subtrees */
+ &ett_iso15765_fragment,
+ &ett_iso15765_fragments,
+ /* Fragment fields */
+ &hf_iso15765_fragments,
+ &hf_iso15765_fragment,
+ &hf_iso15765_fragment_overlap,
+ &hf_iso15765_fragment_overlap_conflicts,
+ &hf_iso15765_fragment_multiple_tails,
+ &hf_iso15765_fragment_too_long_fragment,
+ &hf_iso15765_fragment_error,
+ &hf_iso15765_fragment_count,
+ /* Reassembled in field */
+ &hf_iso15765_reassembled_in,
+ /* Reassembled length field */
+ &hf_iso15765_reassembled_length,
+ /* Reassembled data field */
+ NULL,
+ "ISO15765 fragments"
};
/* UAT for address encoded into CAN IDs */
@@ -233,49 +264,49 @@ copy_config_can_addr_mapping_cb(void *n, const void *o, size_t size _U_) {
return new_rec;
}
-static gboolean
+static bool
update_config_can_addr_mappings(void *r, char **err) {
config_can_addr_mapping_t *rec = (config_can_addr_mapping_t *)r;
if (rec->source_addr_mask == 0 && rec->target_addr_mask == 0 && rec->ecu_addr_mask == 0) {
- *err = g_strdup_printf("You need to define the ECU Mask OR Source Mask/Target Mask!");
+ *err = ws_strdup_printf("You need to define the ECU Mask OR Source Mask/Target Mask!");
return FALSE;
}
if ((rec->source_addr_mask != 0 || rec->target_addr_mask != 0) && rec->ecu_addr_mask != 0) {
- *err = g_strdup_printf("You can only use Source Address Mask/Target Address Mask OR ECU Address Mask! Not both at the same time!");
+ *err = ws_strdup_printf("You can only use Source Address Mask/Target Address Mask OR ECU Address Mask! Not both at the same time!");
return FALSE;
}
if ((rec->source_addr_mask == 0 || rec->target_addr_mask == 0) && rec->ecu_addr_mask == 0) {
- *err = g_strdup_printf("You can only use Source Address Mask and Target Address Mask in combination!");
+ *err = ws_strdup_printf("You can only use Source Address Mask and Target Address Mask in combination!");
return FALSE;
}
if (rec->extended_address) {
if ((rec->source_addr_mask & ~CAN_EFF_MASK) != 0) {
- *err = g_strdup_printf("Source Address Mask covering bits not allowed for extended IDs (29bit)!");
+ *err = ws_strdup_printf("Source Address Mask covering bits not allowed for extended IDs (29bit)!");
return FALSE;
}
if ((rec->target_addr_mask & ~CAN_EFF_MASK) != 0) {
- *err = g_strdup_printf("Target Address Mask covering bits not allowed for extended IDs (29bit)!");
+ *err = ws_strdup_printf("Target Address Mask covering bits not allowed for extended IDs (29bit)!");
return FALSE;
}
if ((rec->ecu_addr_mask & ~CAN_EFF_MASK) != 0) {
- *err = g_strdup_printf("ECU Address Mask covering bits not allowed for extended IDs (29bit)!");
+ *err = ws_strdup_printf("ECU Address Mask covering bits not allowed for extended IDs (29bit)!");
return FALSE;
}
} else {
if ((rec->source_addr_mask & ~CAN_SFF_MASK) != 0) {
- *err = g_strdup_printf("Source Address Mask covering bits not allowed for standard IDs (11bit)!");
+ *err = ws_strdup_printf("Source Address Mask covering bits not allowed for standard IDs (11bit)!");
return FALSE;
}
if ((rec->target_addr_mask & ~CAN_SFF_MASK) != 0) {
- *err = g_strdup_printf("Target Address Mask covering bits not allowed for standard IDs (11bit)!");
+ *err = ws_strdup_printf("Target Address Mask covering bits not allowed for standard IDs (11bit)!");
return FALSE;
}
if ((rec->ecu_addr_mask & ~CAN_SFF_MASK) != 0) {
- *err = g_strdup_printf("ECU Address Mask covering bits not allowed for standard IDs (11bit)!");
+ *err = ws_strdup_printf("ECU Address Mask covering bits not allowed for standard IDs (11bit)!");
return FALSE;
}
}
@@ -294,17 +325,20 @@ post_update_config_can_addr_mappings_cb(void) {
}
static guint16
-masked_guint16_value(const guint16 value, const guint16 mask)
-{
+masked_guint16_value(const guint16 value, const guint16 mask) {
+ return (value & mask) >> ws_ctz(mask);
+}
+
+static guint32
+masked_guint32_value(const guint32 value, const guint32 mask) {
return (value & mask) >> ws_ctz(mask);
}
/*
- * setting addresses to 0xffffffff, if not found or configured
- * returning number of addresses (0: none, 1:ecu (both addr same), 2:source+target)
+ * returning number of addresses (0:none, 1:ecu (both addr same), 2:source+target)
*/
static guint8
-find_config_can_addr_mapping(gboolean ext_id, guint32 can_id, guint16 *source_addr, guint16 *target_addr) {
+find_config_can_addr_mapping(gboolean ext_id, guint32 can_id, guint16 *source_addr, guint16 *target_addr, guint8 *addr_len) {
config_can_addr_mapping_t *tmp = NULL;
guint32 i;
@@ -321,15 +355,23 @@ find_config_can_addr_mapping(gboolean ext_id, guint32 can_id, guint16 *source_ad
}
}
+ *addr_len = 0;
+
if (tmp != NULL) {
if (tmp->ecu_addr_mask != 0) {
- *source_addr = masked_guint16_value(can_id, tmp->ecu_addr_mask);
+ *source_addr = masked_guint32_value(can_id, tmp->ecu_addr_mask);
*target_addr = *source_addr;
+ *addr_len = (7 + ws_count_ones(tmp->ecu_addr_mask)) / 8;
return 1;
}
if (tmp->source_addr_mask != 0 && tmp->target_addr_mask != 0) {
- *source_addr = masked_guint16_value(can_id, tmp->source_addr_mask);
- *target_addr = masked_guint16_value(can_id, tmp->target_addr_mask);
+ *source_addr = masked_guint32_value(can_id, tmp->source_addr_mask);
+ *target_addr = masked_guint32_value(can_id, tmp->target_addr_mask);
+ guint8 tmp_len = ws_count_ones(tmp->source_addr_mask);
+ if (ws_count_ones(tmp->target_addr_mask) > tmp_len) {
+ tmp_len = ws_count_ones(tmp->target_addr_mask);
+ }
+ *addr_len = (7 + tmp_len) / 8;
return 2;
}
}
@@ -338,22 +380,200 @@ find_config_can_addr_mapping(gboolean ext_id, guint32 can_id, guint16 *source_ad
}
+/* UAT for PDU Transport config */
+typedef struct config_pdu_tranport_config {
+ guint32 pdu_id;
+ guint32 source_address_size;
+ guint32 source_address_fixed;
+ guint32 target_address_size;
+ guint32 target_address_fixed;
+ guint32 ecu_address_size;
+ guint32 ecu_address_fixed;
+} config_pdu_transport_config_t;
+
+static config_pdu_transport_config_t *config_pdu_transport_config_items = NULL;
+static guint config_pdu_transport_config_items_num = 0;
+#define DATAFILE_PDU_TRANSPORT_CONFIG "ISO15765_pdu_transport_config"
+
+UAT_HEX_CB_DEF(config_pdu_transport_config_items, pdu_id, config_pdu_transport_config_t)
+UAT_DEC_CB_DEF(config_pdu_transport_config_items, source_address_size, config_pdu_transport_config_t)
+UAT_HEX_CB_DEF(config_pdu_transport_config_items, source_address_fixed, config_pdu_transport_config_t)
+UAT_DEC_CB_DEF(config_pdu_transport_config_items, target_address_size, config_pdu_transport_config_t)
+UAT_HEX_CB_DEF(config_pdu_transport_config_items, target_address_fixed, config_pdu_transport_config_t)
+UAT_DEC_CB_DEF(config_pdu_transport_config_items, ecu_address_size, config_pdu_transport_config_t)
+UAT_HEX_CB_DEF(config_pdu_transport_config_items, ecu_address_fixed, config_pdu_transport_config_t)
+
+
+static void *
+copy_config_pdu_transport_config_cb(void *n, const void *o, size_t size _U_) {
+ config_pdu_transport_config_t *new_rec = (config_pdu_transport_config_t *)n;
+ const config_pdu_transport_config_t *old_rec = (const config_pdu_transport_config_t *)o;
+
+ new_rec->pdu_id = old_rec->pdu_id;
+ new_rec->source_address_size = old_rec->source_address_size;
+ new_rec->source_address_fixed = old_rec->source_address_fixed;
+ new_rec->target_address_size = old_rec->target_address_size;
+ new_rec->target_address_fixed = old_rec->target_address_fixed;
+ new_rec->ecu_address_size = old_rec->ecu_address_size;
+ new_rec->ecu_address_fixed = old_rec->ecu_address_fixed;
+
+ return new_rec;
+}
+
+static bool
+update_config_pdu_transport_config_item(void *r, char **err) {
+ config_pdu_transport_config_t *rec = (config_pdu_transport_config_t *)r;
+
+ gboolean source_address_configured = rec->source_address_size != 0 || rec->source_address_fixed != ISO15765_ADDR_INVALID;
+ gboolean target_address_configured = rec->target_address_size != 0 || rec->target_address_fixed != ISO15765_ADDR_INVALID;
+ gboolean ecu_address_configured = rec->ecu_address_size != 0 || rec->ecu_address_fixed != ISO15765_ADDR_INVALID;
+
+ if (rec->source_address_size != 0 && rec->source_address_fixed != ISO15765_ADDR_INVALID) {
+ *err = ws_strdup_printf("You can either set the size of the source address or configure a fixed value!");
+ return FALSE;
+ }
+
+ if (rec->target_address_size != 0 && rec->target_address_fixed != ISO15765_ADDR_INVALID) {
+ *err = ws_strdup_printf("You can either set the size of the target address or configure a fixed value!");
+ return FALSE;
+ }
+
+ if (rec->ecu_address_size != 0 && rec->ecu_address_fixed != ISO15765_ADDR_INVALID) {
+ *err = ws_strdup_printf("You can either set the size of the ecu address or configure a fixed value!");
+ return FALSE;
+ }
+
+ if (ecu_address_configured && (source_address_configured || target_address_configured)) {
+ *err = ws_strdup_printf("You cannot configure an ecu address and a source or target address at the same time!");
+ return FALSE;
+ }
+
+ if ((source_address_configured && !target_address_configured) || (!source_address_configured && target_address_configured)) {
+ *err = ws_strdup_printf("You can only configure source and target address at the same time but not only one of them!");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+free_config_pdu_transport_config(void *r _U_) {
+ /* do nothing for now */
+}
+
+static void
+reset_config_pdu_transport_config_cb(void) {
+ /* do nothing for now */
+}
+
+static void
+post_update_config_pdu_transport_config_cb(void) {
+ dissector_delete_all("pdu_transport.id", iso15765_handle_pdu_transport);
+
+ config_pdu_transport_config_t *tmp;
+ guint i;
+ for (i = 0; i < config_pdu_transport_config_items_num; i++) {
+ tmp = &(config_pdu_transport_config_items[i]);
+ dissector_add_uint("pdu_transport.id", tmp->pdu_id, iso15765_handle_pdu_transport);
+ }
+}
+
+static config_pdu_transport_config_t *
+find_pdu_transport_config(guint32 pdu_id) {
+ guint i;
+ for (i = 0; i < config_pdu_transport_config_items_num; i++) {
+ if (config_pdu_transport_config_items[i].pdu_id == pdu_id) {
+ return &(config_pdu_transport_config_items[i]);
+ }
+ }
+
+ return NULL;
+}
+
static int
-dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bus_type, guint32 frame_id, guint32 frame_length)
-{
+handle_pdu_transport_addresses(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint offset_orig, guint32 pdu_id, iso15765_info_t *iso15765data) {
+ gint offset = offset_orig;
+ config_pdu_transport_config_t *config = find_pdu_transport_config(pdu_id);
+
+ iso15765data->number_of_addresses_valid = 0;
+ iso15765data->source_address = 0xffff;
+ iso15765data->target_address = 0xffff;
+
+ if (config == NULL) {
+ return offset - offset_orig;
+ }
+
+ guint32 tmp;
+ /* single address, in payload */
+ if (config->ecu_address_size != 0) {
+ proto_tree_add_item_ret_uint(tree, hf_iso15765_address, tvb, offset, config->ecu_address_size, ENC_BIG_ENDIAN, &tmp);
+ offset += config->ecu_address_size;
+ iso15765data->number_of_addresses_valid = 1;
+ iso15765data->source_address = (guint16)tmp;
+ iso15765data->target_address = (guint16)tmp;
+ iso15765data->address_length = config->ecu_address_size;
+ return offset - offset_orig;
+ }
+
+ /* single address, fixed */
+ if (config->ecu_address_fixed != ISO15765_ADDR_INVALID) {
+ iso15765data->number_of_addresses_valid = 1;
+ iso15765data->source_address = config->ecu_address_fixed;
+ iso15765data->target_address = config->ecu_address_fixed;
+ iso15765data->address_length = 2; /* could be also 1 Byte but we cannot know for sure */
+ return offset - offset_orig;
+ }
+
+ /* no address possible */
+ if (config->source_address_size == 0 && config->source_address_fixed == ISO15765_ADDR_INVALID && config->target_address_size == 0 && config->target_address_fixed == ISO15765_ADDR_INVALID) {
+ iso15765data->address_length = 0;
+ return offset - offset_orig;
+ }
+
+ /* now we can only have two addresses! */
+ iso15765data->number_of_addresses_valid = 2;
+ iso15765data->address_length = config->source_address_size;
+ if (config->target_address_size > iso15765data->address_length) {
+ iso15765data->address_length = config->target_address_size;
+ }
+
+ if (config->source_address_size != 0) {
+ proto_tree_add_item_ret_uint(tree, hf_iso15765_source_address, tvb, offset, config->source_address_size, ENC_BIG_ENDIAN, &tmp);
+ offset += config->source_address_size;
+ iso15765data->source_address = tmp;
+ } else if (config->source_address_fixed != ISO15765_ADDR_INVALID) {
+ iso15765data->source_address = config->source_address_fixed;
+ iso15765data->address_length = 2; /* could be also 1 Byte but we cannot know for sure */
+ }
+
+ if (config->target_address_size != 0) {
+ proto_tree_add_item_ret_uint(tree, hf_iso15765_target_address, tvb, offset, config->target_address_size, ENC_BIG_ENDIAN, &tmp);
+ offset += config->target_address_size;
+ iso15765data->target_address = tmp;
+ } else if (config->target_address_fixed != ISO15765_ADDR_INVALID) {
+ iso15765data->target_address = config->target_address_fixed;
+ iso15765data->address_length = 2; /* could be also 1 Byte but we cannot know for sure */
+ }
+
+ return offset - offset_orig;
+}
+
+static int
+dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bus_type, guint32 frame_id, guint32 frame_length) {
static guint32 msg_seqid = 0;
proto_tree *iso15765_tree;
proto_item *ti;
proto_item *message_type_item;
tvbuff_t* next_tvb = NULL;
- guint16 pci, message_type;
+ guint16 pci;
+ guint32 message_type;
iso15765_identifier_t* iso15765_info;
/* LIN is always extended addressing */
guint8 ae = (addressing == NORMAL_ADDRESSING && bus_type != ISO15765_TYPE_LIN) ? 0 : 1;
guint16 frag_id_low = 0;
- guint32 offset;
- gint32 data_length;
+ guint32 offset, pci_offset;
+ guint32 data_length;
guint32 full_len;
gboolean fragmented = FALSE;
gboolean complete = FALSE;
@@ -369,6 +589,7 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
iso15765_info = wmem_new0(wmem_file_scope(), iso15765_identifier_t);
iso15765_info->id = frame_id;
iso15765_info->last = FALSE;
+ iso15765_info->bytes_used = 0;
p_add_proto_data(wmem_file_scope(), pinfo, proto_iso15765, 0, iso15765_info);
}
@@ -378,6 +599,7 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
iso15765data.bus_type = bus_type;
iso15765data.id = frame_id;
iso15765data.number_of_addresses_valid = 0;
+ iso15765data.address_length = 0;
if (bus_type == ISO15765_TYPE_FLEXRAY) {
guint32 tmp;
@@ -386,66 +608,91 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_target_address, tvb, flexray_addressing, flexray_addressing, ENC_BIG_ENDIAN, &tmp);
iso15765data.target_address = (guint16)tmp;
iso15765data.number_of_addresses_valid = 2;
- ae = 2 * flexray_addressing;
+ iso15765data.address_length = flexray_addressing;
+ pci_offset = 2 * flexray_addressing;
+ } else if (bus_type == ISO15765_TYPE_IPDUM && ipdum_addressing > 0) {
+ guint32 tmp;
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_source_address, tvb, 0, ipdum_addressing, ENC_BIG_ENDIAN, &tmp);
+ iso15765data.source_address = (guint16)tmp;
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_target_address, tvb, ipdum_addressing, ipdum_addressing, ENC_BIG_ENDIAN, &tmp);
+ iso15765data.target_address = (guint16)tmp;
+ iso15765data.number_of_addresses_valid = 2;
+ iso15765data.address_length = ipdum_addressing;
+ pci_offset = 2 * ipdum_addressing;
+ } else if (bus_type == ISO15765_TYPE_PDU_TRANSPORT) {
+ pci_offset = handle_pdu_transport_addresses(tvb, pinfo, iso15765_tree, 0, frame_id, &iso15765data);
} else {
if (ae != 0) {
guint32 tmp;
iso15765data.number_of_addresses_valid = 1;
+ iso15765data.address_length = ae;
proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_address, tvb, 0, ae, ENC_NA, &tmp);
iso15765data.source_address = (guint16)tmp;
iso15765data.target_address = (guint16)tmp;
+ pci_offset = ae;
} else {
- /* Address implicit encoded? */
+ /* Address implicitly encoded? */
if (bus_type == ISO15765_TYPE_CAN || bus_type == ISO15765_TYPE_CAN_FD) {
gboolean ext_id = (CAN_EFF_FLAG & frame_id) == CAN_EFF_FLAG;
guint32 can_id = ext_id ? frame_id & CAN_EFF_MASK : frame_id & CAN_SFF_MASK;
- iso15765data.number_of_addresses_valid = find_config_can_addr_mapping(ext_id, can_id, &(iso15765data.source_address), &(iso15765data.target_address));
+ iso15765data.number_of_addresses_valid = find_config_can_addr_mapping(ext_id, can_id, &(iso15765data.source_address), &(iso15765data.target_address), &(iso15765data.address_length));
}
+ pci_offset = 0;
}
}
- message_type_item = proto_tree_add_item(iso15765_tree, hf_iso15765_message_type, tvb,
- ae, ISO15765_PCI_LEN, ENC_BIG_ENDIAN);
-
- pci = tvb_get_guint8(tvb, ae);
- message_type = masked_guint16_value(pci, ISO15765_MESSAGE_TYPE_MASK);
-
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(message_type, iso15765_message_types, "Unknown (0x%02x)"));
+ offset = pci_offset;
+ pci = tvb_get_guint8(tvb, offset);
+ message_type_item = proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_message_type, tvb, offset, 1, ENC_NA, &message_type);
+ col_add_str(pinfo->cinfo, COL_INFO, val_to_str(message_type, iso15765_message_types, "Unknown (0x%02x)"));
switch(message_type) {
case ISO15765_MESSAGE_TYPES_SINGLE_FRAME: {
if (frame_length > 8 && (pci & ISO15765_MESSAGE_DATA_LENGTH_MASK) == 0) {
- offset = ae + ISO15765_PCI_FD_SF_LEN;
- data_length = tvb_get_guint8(tvb, ae + 1);
- proto_tree_add_item(iso15765_tree, hf_iso15765_data_length, tvb, ae + 1, 1, ENC_BIG_ENDIAN);
+ /* Single Frame with CAN_DL > 8 Bytes: TTTT0000 LLLLLLLL, Type, Length */
+
+ /* This is always zero but still we need to dissect... */
+ proto_tree_add_item(iso15765_tree, hf_iso15765_data_length_4bit, tvb, offset, 1, ENC_NA);
+ offset += 1;
+
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_data_length_8bit, tvb, offset, 1, ENC_NA, &data_length);
+ offset += 1;
} else {
- offset = ae + ISO15765_PCI_LEN;
- data_length = masked_guint16_value(pci, ISO15765_MESSAGE_DATA_LENGTH_MASK);
- proto_tree_add_uint(iso15765_tree, hf_iso15765_data_length, tvb, ae, 1, data_length);
+ /* Single Frame with CAN_DL <= 8 Bytes: TTTTLLLL, Type, Length */
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_data_length_4bit, tvb, offset, 1, ENC_NA, &data_length);
+ offset += 1;
}
- next_tvb = tvb_new_subset_length_caplen(tvb, offset, data_length, data_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, data_length);
complete = TRUE;
col_append_fstr(pinfo->cinfo, COL_INFO, "(Len: %d)", data_length);
break;
}
case ISO15765_MESSAGE_TYPES_FIRST_FRAME: {
- pci = tvb_get_guint16(tvb, ae, ENC_BIG_ENDIAN);
+ pci = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN);
if (pci == 0x1000) {
- full_len = tvb_get_guint32(tvb, ae + 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(iso15765_tree, hf_iso15765_frame_length, tvb, ae + 2, 4, ENC_BIG_ENDIAN);
- offset = ae + 2 + 4;
+ /* First Frame with CAN_DL > 4095 Bytes: TTTT0000 00000000 LLLLLLLL LLLLLLLL LLLLLLLL LLLLLLLL, Type, Length */
+
+ /* This is always zero but still we need to dissect... */
+ proto_tree_add_item(iso15765_tree, hf_iso15765_frame_length_12bit, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_frame_length_32bit, tvb, offset, 4, ENC_BIG_ENDIAN, &full_len);
+ offset += 4;
} else {
- full_len = tvb_get_guint16(tvb, ae, ENC_BIG_ENDIAN) & 0xFFF;
- proto_tree_add_uint(iso15765_tree, hf_iso15765_frame_length, tvb, ae, 2, full_len);
- offset = ae + 2;
+ /* First Frame with CAN_DL <= 4095 Bytes: TTTTLLLL LLLLLLLL, Type, Length */
+ full_len = pci & ISO15765_MESSAGE_FIRST_FRAME_DATA_LENGTH_MASK;
+ proto_tree_add_item(iso15765_tree, hf_iso15765_frame_length_12bit, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
}
+ /* we need to assume that all following bytes are of the first frame data */
data_length = tvb_reported_length(tvb) - offset;
- if (bus_type == ISO15765_TYPE_FLEXRAY && flexray_segment_size_limit != 0
- && (guint32)data_length > flexray_segment_size_limit - (offset - ae)) {
- data_length = flexray_segment_size_limit - (offset - ae);
+
+ /* FlexRay data_length cut off, if configured */
+ if (bus_type == ISO15765_TYPE_FLEXRAY && flexray_segment_size_limit != 0 && (guint32)data_length > flexray_segment_size_limit - (offset - pci_offset)) {
+ data_length = flexray_segment_size_limit - (offset - pci_offset);
}
fragmented = TRUE;
@@ -465,80 +712,92 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
}
case ISO15765_MESSAGE_TYPES_FR_CONSECUTIVE_FRAME_2:
case ISO15765_MESSAGE_TYPES_CONSECUTIVE_FRAME: {
- offset = ae + ISO15765_PCI_LEN;
+ /* Consecutive Frame (DF): TTTTSSSS, Type, SeqNo */
+ proto_tree_add_item(iso15765_tree, hf_iso15765_sequence_number, tvb, offset, 1, ENC_NA);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(Seq: %d)", (pci & ISO15765_MESSAGE_DATA_LENGTH_MASK));
+ offset += 1;
+
+ /* we need to assume that all following bytes are of the first frame data */
data_length = tvb_reported_length(tvb) - offset;
+
frag_id_low = masked_guint16_value(pci, ISO15765_MESSAGE_SEQUENCE_NUMBER_MASK);
fragmented = TRUE;
- if (bus_type == ISO15765_TYPE_FLEXRAY && flexray_segment_size_limit != 0
- && (guint32)data_length > flexray_segment_size_limit - (offset - ae)) {
- data_length = flexray_segment_size_limit - (offset - ae);
+ /* FlexRay data_length cut off, if configured */
+ if (bus_type == ISO15765_TYPE_FLEXRAY && flexray_segment_size_limit != 0 && (guint32)data_length > flexray_segment_size_limit - (offset - pci_offset)) {
+ data_length = flexray_segment_size_limit - (offset - pci_offset);
}
/* Save information */
if (!(pinfo->fd->visited)) {
iso15765_info->seq = msg_seqid;
}
-
- proto_tree_add_item(iso15765_tree, hf_iso15765_sequence_number,
- tvb, ae, ISO15765_PCI_LEN, ENC_BIG_ENDIAN);
- col_append_fstr(pinfo->cinfo, COL_INFO, "(Seq: %d)", (pci & ISO15765_MESSAGE_DATA_LENGTH_MASK));
break;
}
case ISO15765_MESSAGE_TYPES_FR_ACK_FRAME:
case ISO15765_MESSAGE_TYPES_FLOW_CONTROL: {
+ /* Flow Control Frame (FC): TTTTFFFF, BBBBBBBB, SSSSSSSS, Type, Flow status, Block size, Separation time */
guint32 status = 0;
guint32 bs = 0;
guint32 stmin = 0;
+ gboolean stmin_in_us = FALSE;
data_length = 0;
- proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_flow_status, tvb, ae,
- ISO15765_PCI_LEN, ENC_BIG_ENDIAN, &status);
- proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_fc_bs, tvb, ae + ISO15765_FC_BS_OFFSET,
- ISO15765_FC_BS_LEN, ENC_BIG_ENDIAN, &bs);
- proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_fc_stmin, tvb, ae + ISO15765_FC_STMIN_OFFSET,
- ISO15765_FC_STMIN_LEN, ENC_BIG_ENDIAN, &stmin);
- col_append_fstr(pinfo->cinfo, COL_INFO, "(Status: %d, Block size: 0x%x, Separation time minimum: %d ms)",
- status, bs, stmin);
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_flow_status, tvb, offset, 1, ENC_NA, &status);
+ offset += 1;
+
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_fc_bs, tvb, offset, 1, ENC_NA, &bs);
+ offset += 1;
+
+ stmin = tvb_get_guint8(tvb, offset);
+ if (stmin >= 0xF1 && stmin <= 0xF9) {
+ stmin_in_us = TRUE;
+ stmin = (stmin - 0xF0) * 100U;
+ proto_tree_add_uint(iso15765_tree, hf_iso15765_fc_stmin_in_us, tvb, offset, 1, stmin);
+ } else {
+ proto_tree_add_uint(iso15765_tree, hf_iso15765_fc_stmin, tvb, offset, 1, stmin);
+ }
+ offset += 1;
if (message_type == ISO15765_MESSAGE_TYPES_FR_ACK_FRAME) {
guint32 ack = 0;
guint32 sn = 0;
- offset = ae + ISO15765_FC_STMIN_OFFSET + ISO15765_FC_STMIN_LEN;
- proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_autosar_ack, tvb, offset, 1, ENC_BIG_ENDIAN, &ack);
- proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_sequence_number, tvb, offset, 1, ENC_BIG_ENDIAN, &sn);
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_autosar_ack, tvb, offset, 1, ENC_NA, &ack);
+ proto_tree_add_item_ret_uint(iso15765_tree, hf_iso15765_sequence_number, tvb, offset, 1, ENC_NA, &sn);
+ offset += 1;
- col_append_fstr(pinfo->cinfo, COL_INFO, "(Status: %d, Block size: 0x%x, Separation time minimum: %d ms, Ack: %d, Seq: %d)",
- status, bs, stmin, ack, sn);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(Status: %d, Block size: 0x%x, Separation time minimum: %d %s, Ack: %d, Seq: %d)",
+ status, bs, stmin, stmin_in_us ? "µs" : "ms", ack, sn);
} else {
- col_append_fstr(pinfo->cinfo, COL_INFO, "(Status: %d, Block size: 0x%x, Separation time minimum: %d ms)",
- status, bs, stmin);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(Status: %d, Block size: 0x%x, Separation time minimum: %d %s)",
+ status, bs, stmin, stmin_in_us ? "µs" : "ms");
}
break;
}
- /* And now the AUTOSAR FlexRay TP Types... */
case ISO15765_MESSAGE_TYPES_FR_SINGLE_FRAME_EXT: {
- offset = ae + ISO15765_PCI_FD_SF_LEN;
- data_length = tvb_get_guint8(tvb, ae + 1);
- proto_tree_add_item(iso15765_tree, hf_iso15765_data_length, tvb, ae + 1, 1, ENC_BIG_ENDIAN);
+ offset += 1;
+
+ data_length = tvb_get_guint8(tvb, offset);
+ proto_tree_add_item(iso15765_tree, hf_iso15765_data_length_8bit, tvb, offset, 1, ENC_NA);
+ offset += 1;
- next_tvb = tvb_new_subset_length_caplen(tvb, offset, data_length, data_length);
+ next_tvb = tvb_new_subset_length(tvb, offset, data_length);
complete = TRUE;
- /* Show some info */
col_append_fstr(pinfo->cinfo, COL_INFO, "(Len: %d)", data_length);
break;
}
case ISO15765_MESSAGE_TYPES_FR_FIRST_FRAME_EXT: {
- full_len = tvb_get_guint32(tvb, ae + 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(iso15765_tree, hf_iso15765_frame_length, tvb, ae + 1, 4, ENC_BIG_ENDIAN);
- offset = ae + 1 + 4;
+ offset += 1;
+
+ full_len = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN);
+ proto_tree_add_item(iso15765_tree, hf_iso15765_frame_length_32bit, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
data_length = tvb_reported_length(tvb) - offset;
- if (bus_type == ISO15765_TYPE_FLEXRAY && flexray_segment_size_limit != 0
- && (guint32)data_length > flexray_segment_size_limit - (offset - ae)) {
- data_length = flexray_segment_size_limit - (offset - ae);
+ if (bus_type == ISO15765_TYPE_FLEXRAY && flexray_segment_size_limit != 0 && (guint32)data_length > flexray_segment_size_limit - (offset - pci_offset)) {
+ data_length = flexray_segment_size_limit - (offset - pci_offset);
}
fragmented = TRUE;
@@ -553,34 +812,34 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
wmem_map_insert(iso15765_frame_table, GUINT_TO_POINTER(iso15765_info->seq), iso15765_frame);
}
- /* Show some info */
col_append_fstr(pinfo->cinfo, COL_INFO, "(Frame Len: %d)", full_len);
break;
}
default:
- expert_add_info_format(pinfo, message_type_item, &ei_iso15765_message_type_bad,
- "Bad Message Type value %u <= 7", message_type);
- return ae;
+ expert_add_info_format(pinfo, message_type_item, &ei_iso15765_message_type_bad, "Bad Message Type value %u!", message_type);
+ return offset;
}
/* Show data */
if (data_length > 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
- tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length, ' '));
+ col_append_fstr(pinfo->cinfo, COL_INFO, " %s", tvb_bytes_to_str_punct(pinfo->pool, tvb, offset, data_length, ' '));
}
if (fragmented) {
tvbuff_t *new_tvb = NULL;
iso15765_frame_t *iso15765_frame;
guint16 frag_id = frag_id_low;
-
/* Get frame information */
- iso15765_frame = (iso15765_frame_t *)wmem_map_lookup(iso15765_frame_table,
- GUINT_TO_POINTER(iso15765_info->seq));
+ iso15765_frame = (iso15765_frame_t *)wmem_map_lookup(iso15765_frame_table, GUINT_TO_POINTER(iso15765_info->seq));
if (iso15765_frame != NULL) {
if (!(pinfo->fd->visited)) {
- frag_id += ((iso15765_frame->frag_id_high[frag_id]++) * 16);
+ DISSECTOR_ASSERT(frag_id < 16);
+ guint16 tmp = iso15765_frame->frag_id_high[frag_id]++;
+ /* Make sure that we assert on using more than 4096 (16*255) segments.*/
+ DISSECTOR_ASSERT(iso15765_frame->frag_id_high[frag_id] != 0);
+ frag_id += tmp * 16;
+
/* Save the frag_id for subsequent dissection */
iso15765_info->frag_id = frag_id;
@@ -598,6 +857,8 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
/* Check if it's the last packet */
if (!(pinfo->fd->visited)) {
+ iso15765_info->bytes_used = data_length;
+
/* Update the last_frag_id */
if (frag_id > iso15765_frame->last_frag_id) {
iso15765_frame->last_frag_id = frag_id;
@@ -608,6 +869,9 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
iso15765_info->last = TRUE;
iso15765_frame->complete = TRUE;
len -= (iso15765_frame->offset - iso15765_frame->len);
+
+ /* Determine how many bytes were needed to calculate padding latter. */
+ iso15765_info->bytes_used = data_length - (iso15765_frame->offset - iso15765_frame->len);
}
}
pinfo->fragmented = TRUE;
@@ -620,8 +884,7 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
&iso15765_frag_items, NULL, iso15765_tree);
if (frag_msg && frag_msg->reassembled_in != pinfo->num) {
- col_append_frame_number(pinfo, COL_INFO, " [Reassembled in #%u]",
- frag_msg->reassembled_in);
+ col_append_frame_number(pinfo, COL_INFO, " [Reassembled in #%u]", frag_msg->reassembled_in);
}
pinfo->fragmented = save_fragmented;
@@ -631,12 +894,27 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
/* This is a complete TVB to dissect */
next_tvb = new_tvb;
complete = TRUE;
- } else {
- next_tvb = tvb_new_subset_length_caplen(tvb, offset, data_length, data_length);
}
}
}
+ /* Let us correct bytes used for last segment to identify padding. */
+ if (iso15765_info != NULL && iso15765_info->last) {
+ data_length = iso15765_info->bytes_used;
+ }
+
+ if (message_type == ISO15765_MESSAGE_TYPES_FIRST_FRAME || message_type == ISO15765_MESSAGE_TYPES_CONSECUTIVE_FRAME ||
+ message_type == ISO15765_MESSAGE_TYPES_FR_FIRST_FRAME_EXT || message_type == ISO15765_MESSAGE_TYPES_FR_CONSECUTIVE_FRAME_2) {
+ proto_tree_add_item(iso15765_tree, hf_iso15765_segment_data, tvb, offset, data_length, ENC_NA);
+ }
+
+ offset += data_length;
+
+ if (offset < tvb_captured_length(tvb)) {
+ /* Unused bytes should be filled with 0xCC padding. */
+ proto_tree_add_item(iso15765_tree, hf_iso15765_padding, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
+ }
+
if (next_tvb) {
iso15765data.len = frame_length;
@@ -649,28 +927,33 @@ dissect_iso15765(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 bu
}
static int
-dissect_iso15765_can(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
-{
- struct can_info can_info;
+dissect_iso15765_can(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
+ can_info_t can_info;
DISSECTOR_ASSERT(data);
- can_info = *((struct can_info*)data);
+ can_info = *((can_info_t*)data);
if (can_info.id & (CAN_ERR_FLAG | CAN_RTR_FLAG)) {
/* Error and RTR frames are not for us. */
return 0;
}
- if (can_info.fd) {
+ switch (can_info.fd) {
+
+ case CAN_TYPE_CAN_FD:
return dissect_iso15765(tvb, pinfo, tree, ISO15765_TYPE_CAN_FD, can_info.id, can_info.len);
- } else {
+
+ case CAN_TYPE_CAN_CLASSIC:
return dissect_iso15765(tvb, pinfo, tree, ISO15765_TYPE_CAN, can_info.id, can_info.len);
+
+ default:
+ DISSECTOR_ASSERT_NOT_REACHED();
+ return tvb_captured_length(tvb);
}
}
static int
-dissect_iso15765_lin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
-{
+dissect_iso15765_lin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
DISSECTOR_ASSERT(data);
lin_info_t *lininfo = (lin_info_t *)data;
@@ -679,8 +962,7 @@ dissect_iso15765_lin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
static int
-dissect_iso15765_flexray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
-{
+dissect_iso15765_flexray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
DISSECTOR_ASSERT(data);
flexray_info_t *flexray_id = (flexray_info_t *)data;
@@ -690,9 +972,26 @@ dissect_iso15765_flexray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
return dissect_iso15765(tvb, pinfo, tree, ISO15765_TYPE_FLEXRAY, id, tvb_captured_length(tvb));
}
+static int
+dissect_iso15765_ipdum(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
+ DISSECTOR_ASSERT(data);
+
+ autosar_ipdu_multiplexer_info_t *ipdum_data = (autosar_ipdu_multiplexer_info_t *)data;
+
+ return dissect_iso15765(tvb, pinfo, tree, ISO15765_TYPE_IPDUM, ipdum_data->pdu_id, tvb_captured_length(tvb));
+}
+
+static int
+dissect_iso15765_pdu_transport(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
+ DISSECTOR_ASSERT(data);
+
+ pdu_transport_info_t *pdu_transport_data = (pdu_transport_info_t *)data;
+
+ return dissect_iso15765(tvb, pinfo, tree, ISO15765_TYPE_PDU_TRANSPORT, pdu_transport_data->id, tvb_captured_length(tvb));
+}
+
static void
-update_config(void)
-{
+update_config(void) {
if (iso15765_handle_lin != NULL) {
dissector_delete_all("lin.frame_id", iso15765_handle_lin);
if (register_lin_diag_frames) {
@@ -708,232 +1007,91 @@ update_config(void)
dissector_add_uint_range("can.id", configured_can_ids, iso15765_handle_can);
dissector_add_uint_range("can.extended_id", configured_ext_can_ids, iso15765_handle_can);
}
+
+ if (iso15765_handle_ipdum != NULL) {
+ dissector_delete_all("ipdum.pdu.id", iso15765_handle_ipdum);
+ dissector_add_uint_range("ipdum.pdu.id", configured_ipdum_pdu_ids, iso15765_handle_ipdum);
+ }
}
void
-proto_register_iso15765(void)
-{
+proto_register_iso15765(void) {
uat_t *config_can_addr_mapping_uat;
+ uat_t *config_pdu_transport_config_uat;
static hf_register_info hf[] = {
- {
- &hf_iso15765_address,
- {
- "Address", "iso15765.address",
- FT_UINT8, BASE_HEX,
- NULL, 0,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_target_address,
- {
- "FlexRay Target Address", "iso15765.flexray_target_address",
- FT_UINT16, BASE_HEX,
- NULL, 0,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_source_address,
- {
- "FlexRay Source Address", "iso15765.flexray_source_address",
- FT_UINT16, BASE_HEX,
- NULL, 0,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_message_type,
- {
- "Message Type", "iso15765.message_type",
- FT_UINT8, BASE_HEX,
- VALS(iso15765_message_types), ISO15765_MESSAGE_TYPE_MASK,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_data_length,
- {
- "Data length", "iso15765.data_length",
- FT_UINT32, BASE_DEC,
- NULL, 0,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_frame_length,
- {
- "Frame length", "iso15765.frame_length",
- FT_UINT32, BASE_DEC,
- NULL, 0x0,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_sequence_number,
- {
- "Sequence number", "iso15765.sequence_number",
- FT_UINT8, BASE_HEX,
- NULL, ISO15765_MESSAGE_SEQUENCE_NUMBER_MASK,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_flow_status,
- {
- "Flow status", "iso15765.flow_status",
- FT_UINT8, BASE_HEX,
- VALS(iso15765_flow_status_types), ISO15765_MESSAGE_FLOW_STATUS_MASK,
- NULL, HFILL
- }
- },
-
- {
- &hf_iso15765_fc_bs,
- {
- "Block size", "iso15765.flow_control.bs",
- FT_UINT8, BASE_HEX,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_fc_stmin,
- {
- "Separation time minimum (ms)", "iso15765.flow_control.stmin",
- FT_UINT8, BASE_DEC,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_autosar_ack,
- {
- "Acknowledgement", "iso15765.autosar_ack.ack",
- FT_UINT8, BASE_HEX,
- NULL, ISO15765_MESSAGE_AUTOSAR_ACK_MASK,
- NULL, HFILL
- }
- },
-
- {
- &hf_iso15765_fragments,
- {
- "Message fragments", "iso15765.fragments",
- FT_NONE, BASE_NONE,
- NULL, 0x00,
- NULL, HFILL
- },
- },
- {
- &hf_iso15765_fragment,
- {
- "Message fragment", "iso15765.fragment",
- FT_FRAMENUM, BASE_NONE,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_fragment_overlap,
- {
- "Message fragment overlap", "iso15765.fragment.overlap",
- FT_BOOLEAN, 0,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_fragment_overlap_conflicts,
- {
- "Message fragment overlapping with conflicting data", "iso15765.fragment.overlap.conflicts",
- FT_BOOLEAN, 0,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_fragment_multiple_tails,
- {
- "Message has multiple tail fragments", "iso15765.fragment.multiple_tails",
- FT_BOOLEAN, 0,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_fragment_too_long_fragment,
- {
- "Message fragment too long", "iso15765.fragment.too_long_fragment",
- FT_BOOLEAN, 0, NULL,
- 0x00, NULL, HFILL
- }
- },
- {
- &hf_iso15765_fragment_error,
- {
- "Message defragmentation error", "iso15765.fragment.error",
- FT_FRAMENUM, BASE_NONE,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_fragment_count,
- {
- "Message fragment count", "iso15765.fragment.count",
- FT_UINT32, BASE_DEC,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_reassembled_in,
- {
- "Reassembled in", "iso15765.reassembled.in",
- FT_FRAMENUM, BASE_NONE,
- NULL, 0x00,
- NULL, HFILL
- }
- },
- {
- &hf_iso15765_reassembled_length,
- {
- "Reassembled length", "iso15765.reassembled.length",
- FT_UINT32, BASE_DEC,
- NULL, 0x00,
- NULL, HFILL
- }
- },
+ { &hf_iso15765_address, {
+ "Address", "iso15765.address", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL } },
+ { &hf_iso15765_target_address, {
+ "Target Address", "iso15765.target_address", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
+ { &hf_iso15765_source_address, {
+ "Source Address", "iso15765.source_address", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL } },
+ { &hf_iso15765_message_type, {
+ "Message Type", "iso15765.message_type", FT_UINT8, BASE_HEX, VALS(iso15765_message_types), ISO15765_MESSAGE_TYPE_MASK, NULL, HFILL } },
+ { &hf_iso15765_data_length_8bit, {
+ "Data length (8bit)", "iso15765.data_length_8bit", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } },
+ { &hf_iso15765_data_length_4bit, {
+ "Data length (4bit)", "iso15765.data_length_4bit", FT_UINT8, BASE_DEC, NULL, ISO15765_MESSAGE_DATA_LENGTH_MASK, NULL, HFILL } },
+ { &hf_iso15765_frame_length_32bit, {
+ "Frame length (32bit)", "iso15765.frame_length_32bit", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
+ { &hf_iso15765_frame_length_12bit, {
+ "Frame length (12bit)", "iso15765.frame_length_12bit", FT_UINT16, BASE_DEC, NULL, ISO15765_MESSAGE_FIRST_FRAME_DATA_LENGTH_MASK, NULL, HFILL } },
+ { &hf_iso15765_sequence_number, {
+ "Sequence number", "iso15765.sequence_number", FT_UINT8, BASE_HEX, NULL, ISO15765_MESSAGE_SEQUENCE_NUMBER_MASK, NULL, HFILL } },
+ { &hf_iso15765_flow_status, {
+ "Flow status", "iso15765.flow_status", FT_UINT8, BASE_HEX, VALS(iso15765_flow_status_types), ISO15765_MESSAGE_FLOW_STATUS_MASK, NULL, HFILL } },
+
+ { &hf_iso15765_fc_bs, {
+ "Block size", "iso15765.flow_control.bs", FT_UINT8, BASE_HEX, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fc_stmin, {
+ "Separation time minimum (ms)", "iso15765.flow_control.stmin", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fc_stmin_in_us, {
+ "Separation time minimum (µs)", "iso15765.flow_control.stmin", FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_autosar_ack, {
+ "Acknowledgment", "iso15765.autosar_ack.ack", FT_UINT8, BASE_HEX, NULL, ISO15765_MESSAGE_AUTOSAR_ACK_MASK, NULL, HFILL } },
+ { &hf_iso15765_segment_data, {
+ "Segment Data", "iso15765.segment_data", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_padding, {
+ "Padding", "iso15765.padding", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+
+ { &hf_iso15765_fragments, {
+ "Message fragments", "iso15765.fragments", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }, },
+ { &hf_iso15765_fragment, {
+ "Message fragment", "iso15765.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fragment_overlap, {
+ "Message fragment overlap", "iso15765.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fragment_overlap_conflicts, {
+ "Message fragment overlapping with conflicting data", "iso15765.fragment.overlap.conflicts", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fragment_multiple_tails, {
+ "Message has multiple tail fragments", "iso15765.fragment.multiple_tails", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fragment_too_long_fragment, {
+ "Message fragment too long", "iso15765.fragment.too_long_fragment", FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fragment_error, {
+ "Message defragmentation error", "iso15765.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_fragment_count, {
+ "Message fragment count", "iso15765.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_reassembled_in, {
+ "Reassembled in", "iso15765.reassembled.in", FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
+ { &hf_iso15765_reassembled_length, {
+ "Reassembled length", "iso15765.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
};
/* Setup protocol subtree array */
- static gint *ett[] =
- {
- &ett_iso15765,
- &ett_iso15765_fragment,
- &ett_iso15765_fragments,
- };
+ static gint *ett[] = {
+ &ett_iso15765,
+ &ett_iso15765_fragment,
+ &ett_iso15765_fragments,
+ };
static ei_register_info ei[] = {
- {
- &ei_iso15765_message_type_bad,
- {
- "iso15765.message_type.bad", PI_MALFORMED,
- PI_ERROR, "Bad Message Type value", EXPFILL
- }
- },
+ { &ei_iso15765_message_type_bad, {
+ "iso15765.message_type.bad", PI_MALFORMED, PI_ERROR, "Bad Message Type value", EXPFILL } },
};
module_t *iso15765_module;
expert_module_t* expert_iso15765;
- proto_iso15765 = proto_register_protocol (
- "ISO15765 Protocol", /* name */
- "ISO 15765", /* short name */
- "iso15765" /* abbrev */
- );
+ proto_iso15765 = proto_register_protocol ( "ISO15765 Protocol", "ISO 15765", "iso15765");
register_dissector("iso15765", dissect_iso15765_lin, proto_iso15765);
expert_iso15765 = expert_register_protocol(proto_iso15765);
@@ -955,8 +1113,7 @@ proto_register_iso15765(void)
"Window of ISO 15765 fragments",
10, &window);
- prefs_register_static_text_preference(iso15765_module, "empty1", "", NULL);
- prefs_register_static_text_preference(iso15765_module, "header1", "Protocol Handling:", NULL);
+ prefs_register_static_text_preference(iso15765_module, "empty_can", "", NULL);
range_convert_str(wmem_epan_scope(), &configured_can_ids, "", 0x7ff);
prefs_register_range_preference(iso15765_module, "can.ids",
@@ -972,12 +1129,12 @@ proto_register_iso15765(void)
/* UATs for config_can_addr_mapping_uat */
static uat_field_t config_can_addr_mapping_uat_fields[] = {
- UAT_FLD_BOOL(config_can_addr_mappings, extended_address, "Ext. Addr.", "Extended Addressing (TRUE), Standard Addressing (FALSE)"),
- UAT_FLD_HEX(config_can_addr_mappings, can_id, "CAN ID", "CAN ID (hex)"),
- UAT_FLD_HEX(config_can_addr_mappings, can_id_mask, "CAN ID Mask", "CAN ID Mask (hex)"),
- UAT_FLD_HEX(config_can_addr_mappings, source_addr_mask, "Source Addr Mask", "Bitmask to specify location of Source Address (hex)"),
- UAT_FLD_HEX(config_can_addr_mappings, target_addr_mask, "Target Addr Mask", "Bitmask to specify location of Target Address (hex)"),
- UAT_FLD_HEX(config_can_addr_mappings, ecu_addr_mask, "ECU Addr Mask", "Bitmask to specify location of ECU Address (hex)"),
+ UAT_FLD_BOOL(config_can_addr_mappings, extended_address, "Ext Addr (29bit)", "29bit Addressing (TRUE), 11bit Addressing (FALSE)"),
+ UAT_FLD_HEX(config_can_addr_mappings, can_id, "CAN ID", "CAN ID (hex)"),
+ UAT_FLD_HEX(config_can_addr_mappings, can_id_mask, "CAN ID Mask", "CAN ID Mask (hex)"),
+ UAT_FLD_HEX(config_can_addr_mappings, source_addr_mask, "Source Addr Mask", "Bitmask to specify location of Source Address (hex)"),
+ UAT_FLD_HEX(config_can_addr_mappings, target_addr_mask, "Target Addr Mask", "Bitmask to specify location of Target Address (hex)"),
+ UAT_FLD_HEX(config_can_addr_mappings, ecu_addr_mask, "ECU Addr Mask", "Bitmask to specify location of ECU Address (hex)"),
UAT_END_FIELDS
};
@@ -1000,11 +1157,13 @@ proto_register_iso15765(void)
prefs_register_uat_preference(iso15765_module, "_iso15765_can_id_mappings", "CAN ID Mappings",
"A table to define mappings rules for CAN IDs", config_can_addr_mapping_uat);
+ prefs_register_static_text_preference(iso15765_module, "empty_lin", "", NULL);
prefs_register_bool_preference(iso15765_module, "lin_diag",
"Handle LIN Diagnostic Frames",
"Handle LIN Diagnostic Frames",
&register_lin_diag_frames);
+ prefs_register_static_text_preference(iso15765_module, "empty_fr", "", NULL);
prefs_register_enum_preference(iso15765_module, "flexray_addressing",
"FlexRay Addressing",
"Addressing of FlexRay TP. 1 Byte or 2 Byte",
@@ -1016,6 +1175,54 @@ proto_register_iso15765(void)
"Segment Size Limit for first and consecutive frames of FlexRay (bytes after addresses)",
10, &flexray_segment_size_limit);
+
+ prefs_register_static_text_preference(iso15765_module, "empty_ipdum", "", NULL);
+ range_convert_str(wmem_epan_scope(), &configured_ipdum_pdu_ids, "", 0xffffffff);
+ prefs_register_range_preference(iso15765_module, "ipdum.pdu.id",
+ "I-PduM PDU-IDs",
+ "I-PduM PDU-IDs",
+ &configured_ipdum_pdu_ids, 0xffffffff);
+
+ prefs_register_enum_preference(iso15765_module, "ipdum_addressing",
+ "I-PduM Addressing",
+ "Addressing of I-PduM TP. 0, 1, or 2 Bytes",
+ &ipdum_addressing,
+ enum_ipdum_addressing, TRUE);
+
+ prefs_register_static_text_preference(iso15765_module, "empty_pdu_transport", "", NULL);
+
+ /* UATs for config_pdu_transport_uat */
+ static uat_field_t config_pdu_transport_uat_fields[] = {
+ UAT_FLD_HEX(config_pdu_transport_config_items, pdu_id, "PDU ID", "PDU ID (hex)"),
+ UAT_FLD_DEC(config_pdu_transport_config_items, source_address_size, "Source Addr. Size", "Size of encoded source address (0, 1, 2 bytes)"),
+ UAT_FLD_HEX(config_pdu_transport_config_items, source_address_fixed, "Source Addr. Fixed", "Fixed source address for this PDU ID (hex), 0xffffffff is invalid"),
+ UAT_FLD_DEC(config_pdu_transport_config_items, target_address_size, "Target Addr. Size", "Size of encoded target address (0, 1, 2 bytes)"),
+ UAT_FLD_HEX(config_pdu_transport_config_items, target_address_fixed, "Target Addr. Fixed", "Fixed target address for this PDU ID (hex), 0xffffffff is invalid"),
+ UAT_FLD_DEC(config_pdu_transport_config_items, ecu_address_size, "Single Addr. Size", "Size of encoded address (0, 1, 2 bytes)"),
+ UAT_FLD_HEX(config_pdu_transport_config_items, ecu_address_fixed, "Single Addr. Fixed", "Fixed address for this PDU ID (hex), 0xffffffff is invalid"),
+ UAT_END_FIELDS
+ };
+
+ config_pdu_transport_config_uat = uat_new("ISO15765 PDU Transport Config",
+ sizeof(config_pdu_transport_config_t), /* record size */
+ DATAFILE_PDU_TRANSPORT_CONFIG, /* filename */
+ TRUE, /* from profile */
+ (void**)&config_pdu_transport_config_items, /* data_ptr */
+ &config_pdu_transport_config_items_num, /* numitems_ptr */
+ UAT_AFFECTS_DISSECTION, /* but not fields */
+ NULL, /* help */
+ copy_config_pdu_transport_config_cb, /* copy callback */
+ update_config_pdu_transport_config_item, /* update callback */
+ free_config_pdu_transport_config, /* free callback */
+ post_update_config_pdu_transport_config_cb, /* post update callback */
+ reset_config_pdu_transport_config_cb, /* reset callback */
+ config_pdu_transport_uat_fields /* UAT field definitions */
+ );
+
+ prefs_register_uat_preference(iso15765_module, "_iso15765_pdu_transport_config", "PDU Transport Config",
+ "A table to define the PDU Transport Config", config_pdu_transport_config_uat);
+
+
iso15765_frame_table = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal);
reassembly_table_register(&iso15765_reassembly_table, &addresses_reassembly_table_functions);
@@ -1024,11 +1231,12 @@ proto_register_iso15765(void)
}
void
-proto_reg_handoff_iso15765(void)
-{
+proto_reg_handoff_iso15765(void) {
iso15765_handle_can = create_dissector_handle(dissect_iso15765_can, proto_iso15765);
iso15765_handle_lin = create_dissector_handle(dissect_iso15765_lin, proto_iso15765);
iso15765_handle_flexray = create_dissector_handle(dissect_iso15765_flexray, proto_iso15765);
+ iso15765_handle_ipdum = create_dissector_handle(dissect_iso15765_ipdum, proto_iso15765);
+ iso15765_handle_pdu_transport = create_dissector_handle(dissect_iso15765_pdu_transport, proto_iso15765);
dissector_add_for_decode_as("can.subdissector", iso15765_handle_can);
dissector_add_for_decode_as("flexray.subdissector", iso15765_handle_flexray);
update_config();