diff options
author | Guy Harris <gharris@sonic.net> | 2024-02-11 23:49:18 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2024-02-11 23:49:18 -0800 |
commit | 849c1251dfb3f09800dac9d1f5dc5e75c81bcc44 (patch) | |
tree | ec99ec9f2833e81698dfde07e925cfc9bf891587 | |
parent | fdf4ecdb4aea61f6e557d75172d27ca0ffea79d7 (diff) |
busmaster: use WTAP_ENCAP_SOCKETCAN, not WTAP_ENCAP_WIRESHARK_UPPER_PDU.
WTAP_ENCAP_SOCKETCAN suffices, and doesn't add a bunch of upper PDU tags
that provide no additional information.
-rw-r--r-- | wiretap/busmaster.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/wiretap/busmaster.c b/wiretap/busmaster.c index ec2b3bc8ac..335b2fda17 100644 --- a/wiretap/busmaster.c +++ b/wiretap/busmaster.c @@ -69,26 +69,16 @@ busmaster_gen_packet(wtap_rec *rec, Buffer *buf, return FALSE; } - /* Generate Exported PDU tags for the packet info */ ws_buffer_clean(buf); - if (is_fd) - { - wtap_buffer_append_epdu_string(buf, EXP_PDU_TAG_DISSECTOR_NAME, "canfd"); - } - else - { - wtap_buffer_append_epdu_string(buf, EXP_PDU_TAG_DISSECTOR_NAME, "can-hostendian"); - } - wtap_buffer_append_epdu_end(buf); if (is_fd) { canfd_frame_t canfd_frame = {0}; - canfd_frame.can_id = (msg->id & (is_eff ? CAN_EFF_MASK : CAN_SFF_MASK)) | + canfd_frame.can_id = g_ntohl((msg->id & (is_eff ? CAN_EFF_MASK : CAN_SFF_MASK)) | (is_eff ? CAN_EFF_FLAG : 0) | - (is_err ? CAN_ERR_FLAG : 0); - canfd_frame.flags = 0; + (is_err ? CAN_ERR_FLAG : 0)); + canfd_frame.flags = CANFD_FDF; canfd_frame.len = msg->data.length; memcpy(canfd_frame.data, @@ -103,10 +93,10 @@ busmaster_gen_packet(wtap_rec *rec, Buffer *buf, { can_frame_t can_frame = {0}; - can_frame.can_id = (msg->id & (is_eff ? CAN_EFF_MASK : CAN_SFF_MASK)) | + can_frame.can_id = g_ntohl((msg->id & (is_eff ? CAN_EFF_MASK : CAN_SFF_MASK)) | (is_rtr ? CAN_RTR_FLAG : 0) | (is_eff ? CAN_EFF_FLAG : 0) | - (is_err ? CAN_ERR_FLAG : 0); + (is_err ? CAN_ERR_FLAG : 0)); can_frame.can_dlc = msg->data.length; memcpy(can_frame.data, @@ -251,7 +241,7 @@ busmaster_open(wtap *wth, int *err, char **err_info) wth->subtype_read = busmaster_read; wth->subtype_seek_read = busmaster_seek_read; wth->file_type_subtype = busmaster_file_type_subtype; - wth->file_encap = WTAP_ENCAP_WIRESHARK_UPPER_PDU; + wth->file_encap = WTAP_ENCAP_SOCKETCAN; wth->file_tsprec = WTAP_TSPREC_USEC; return WTAP_OPEN_MINE; |