aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iso15765.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-09socketcan: work around libpcap bug, add CAN XL support.Guy Harris1-2/+9
Change the "fd" gboolean in can_info_t to a guint, and give it a value of 2 for CAN XL. That preserves source and binary compatiility, at least in the case where a plugin would never be handed a CAN XL frame. Update code to treat it as such, to make it clearer what that code is doing. Add CAN XL support to the SocketCAN dissector - and to the LINKTYPE_LINUX_SLL detector. Note that the fields in the LINKTYPE_CAN_SOCKETCAN header for CAN XL frames are *little-endian*, as most if not all existing captures were probably done on little-endian machines - libpcap does that so that LINKTYPE_CAN_SOCKETCAN doesn't become one of those annoying link-layer types with *host-endian* (as in "the byte order of the host that last processed this file") fields (which require special processing in pcap/pcapng file readers *and* in rpcap clients). If the CANFD_FDF flag isn't set, treat the frame as CAN FD if it's exactly 72 bytes long; this works around a libpcap 1.10.{2,3,4} bug (which should be fixed in the next libpcap release) that inadvertantly cleared that flag for CAN FD frames.
2024-01-27Set BASE_NONE for FT_BOOLEAN items with zero maskMartin Mathieson1-4/+4
2024-01-11ISO15765: Cleanup and fix incomplete dissector warningsDr. Lars Völker1-94/+130
Dissector is improved as follows: - Code cleanup - Added comments - Offset calculations more obvious - Segment data is put into segment hf instead of data dissector - Padding is calculated and shown to fix incomplete dissector warnings
2024-01-09ISO15765/UDS: Clean up of Address HandlingDr. Lars Völker1-10/+33
This patch does: - clean up the address handling and limit to guint16 (see UDS) - add address length to the data exchanged to UDS - make UDS show the correct length in the protocol line instead of 2 - show address in UDS as generated as they are passed to UDS
2023-12-30ISO15765: clean up code and fix typoDr. Lars Völker1-270/+102
2023-12-23ISO15765: added a bit of documentationDr. Lars Völker1-32/+46
- Added some information how the CAN ID Mappings work. - Made formatting a bit more consistent.
2023-11-20Remove init of proto variablesStig Bjørlykke1-28/+28
Remove init of proto, header field, expert info and subtree variables. This will reduces the binary size by approximate 1266320 bytes due to using .bss to zero-initialize the fields. The conversion is done using the tools/convert-proto-init.py script.
2023-11-09ISO15765: Fix error in dissection of STminHaiyun Liu1-6/+26
The units of STmin in the range 0xF1 – 0xF9 are even multiples of 100µs, where parameter value 0xF1 represents 100µs and parameter value 0xF9 represents 900µs.
2023-11-06ISO15765: Remove the duplicated text in the "Information" columnHaiyun Liu1-2/+0
Similar text appended by the branch code below.
2023-09-24epan: Convert the UAT API to C99 typesGerald Combs1-2/+2
Ping #19116
2023-09-02Remove some uses of tvb_new_subset_length_caplen()John Thacker1-3/+3
These are all very obvious what was intended, and should be tvb_new_subset_length() or tvb_new_subset_remaining() instead. A few of them could throw exceptions (and sometimes the wrong exception) on packets where the captured length was not the full reported length, but for most of these this change has no effect (especially after commit 0c4dcc164be292790faa4707ccf06dfb6dc9dcb9) This makes it easier to find the calls that need fixing.
2023-06-27ISO15765: fix hf names for target and source address.Dr. Lars Völker1-2/+2
2023-04-12README.dissector - some trivial editsMartin Mathieson1-1/+1
2023-02-04ISO15765/ISO10681 memory corruption bugfixDr. Lars Völker1-2/+6
Fixes a situation in which the code wrote behind the frag_id_high array and corrupted memory. Closes #18839
2022-09-06ISO15765: Adding support to run over PDU TransportDr. Lars Völker1-5/+225
This patch allows to bind ISO15765 to PDU Transport PDUs.
2022-01-18ISO15765: change addresses to 32bitDr. Lars Völker1-4/+10
Currently the dissector maps 29bit addresses to 16bit. This limitation is being resolved by allowing 32bit addresses to be passed on.
2021-12-19Replace g_strdup_printf() with ws_strdup_printf()João Valverde1-9/+9
Use macros from inttypes.h.
2021-10-22AUTOSAR I-PduM dissectorDr. Lars Völker1-5/+53
This patch adds the AUTOSAR I-PduM dissector.
2021-10-10ISO15765: Bugfix, LIN config influenced CANDr. Lars Völker1-13/+10
This patch fixes the update_config routine, which turned off the CAN config, when LIN diagnostic frame parsing is deactivated. Closes #17639
2021-09-06iso15765: Fix Dead Store Found by Clang AnalyzerAlexis La Goutte1-1/+0
packet-iso15765.c:534:13: warning: Value stored to 'pci' is never read [deadcode.DeadStores]
2021-08-31ISO10681: Adding support for ISO10681 (FlexRay ISO TP)Dr. Lars Völker1-1/+1
This patch adds support for the ISO 10681-2 protocol, which is similar to the ISO 15765-2 protocol (see packet-iso15765.c). This patch also add support for registering combined FlexRay IDs to register the new dissector.
2021-08-30DoIP/ISO15765/UDS: Passing addresses to UDS to refine lookupDr. Lars Völker1-6/+192
This patch adds support to DoIP and ISO15765 to pass the diagnostic address or addresses to UDS. UDS takes the relevant address into account for the data identifier and routine identifier name resolution.
2021-08-22ISO15765: Adding support for AUTOSAR TP frame formatsDr. Lars Völker1-10/+86
This patch adds support for the FlexRay AUTOSAR TP frame formats as defined by AUTOSAR_SWS_FlexRayARTransportLayer.pdf
2021-08-06ISO15765: Cleanup and BugfixDr. Lars Völker1-43/+33
This patch fixes the wrong value for frame_length being shown in the header field. In addition, code is cleaned up and simplified.
2021-08-05ISO15765: Adding first support for FlexRay TPDr. Lars Völker1-4/+94
This patch adds first support for FlexRay TP based on the AUTOSAR specification including FlexRay addressing. The special message types (0x4 - 0x7) are only prepared but not added byt this patch.
2021-07-21First pass pinfo->pool conversion, part 2Evan Huus1-1/+1
Automated find/replace of wmem_packet_scope() with pinfo->pool in all files where it didn't cause a build failure.
2021-07-16ISO15765: Add support for the new CAN APIDr. Lars Völker1-5/+29
This patch allows to register single IDs for CAN.
2021-07-14ISO15765: Make a function static.Martin Mathieson1-1/+1
2021-07-14LIN: Adding support for LIN dissectionDr. Lars Völker1-21/+87
This patch adds support for LIN (Local Interconnect Network) as well as support for: - Signal PDUs on LIN - ISO 15765 (ISO TP) on LIN - TECMP transported LIN is handle like LIN LIN is a simple automotive fieldbus to connect for example simple sensors and actuators to an electronic control unit.
2021-01-15OBD2 on CAN rides on ISO15765, made it a subdissector.Adam Parker1-1/+1
- While I recognize that the spec says a request must be 8-bytes long, that's between you and your Tier-1. I removed this requirement for decode. - Adjusted byte positions. Note: Still needs a 15765 reassembler and when that happens response parsing will need touching up.
2020-04-15iso15765: Fix Dead StoreAlexis La Goutte1-1/+0
Fix dead store (Dead assignement/Dead increment) Warning found by Clang Change-Id: Iefd5cdfb5f24e95bc71768907c7474d3a61a24af Reviewed-on: https://code.wireshark.org/review/36841 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-28Add support for ISO 15765-2:2015 jumbo framesStefan Tatschner1-13/+26
In the case CAN-FD is used as a transport, the header of ISO15765 changes for first frames (ISO 15765-2:2015). In my previous commit "Add support for first frames with CAN-FD" (54010d4093f) I added support for *single frames*. This patch really adds support for ISO 15765-2:2015 first frames, also known as jumbo frames. Documentation is available in this presentation, on slide 24: * http://s3.eu-central-1.amazonaws.com/cancia-de/documents/proceedings/slides/hartkopp_slides_15icc.pdf Change-Id: Ic97a3c71ee1df4d133dbfb04a1c781fa66739cf0 Reviewed-on: https://code.wireshark.org/review/36189 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-29Add support for first frames with CAN-FDStefan Tatschner1-17/+29
In the case CAN-FD is used as a transport, the header of ISO15765 changes for first frames (ISO 15765-2:2015). This patch uses the introduced `struct can_info` to access the relevant metadata of the underlying CAN frame. Dissection is chosen accordingly. Ressources: * https://www.can-cia.org/fileadmin/resources/documents/proceedings/2015_hartkopp.pdf * http://s3.eu-central-1.amazonaws.com/cancia-de/documents/proceedings/slides/hartkopp_slides_15icc.pdf * https://github.com/linux-can/can-utils/commit/8150e21a1129c4b822d73186cd63e0e9fbf4c32d Change-Id: I248acacab62b51659efaed400b828ac0bb9e3c55 Reviewed-on: https://code.wireshark.org/review/35247 Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-11-28Change struct can_identifier to can_infoStefan Tatschner1-4/+4
The can specific data structure `struct can_identifier` is used as supplementary data for higher level dissectors. This patch adds more data to this struct and renames it accordingly to `struct can_info`. More supplementary data is needed in order to dissect iso15765 correctly, since the header format depends on details on the underlying CAN protocol (CAN 2.0B vs CAN-FD). Change-Id: Id068cf38453f98b67a5ec470a22e7013548c5a14 Reviewed-on: https://code.wireshark.org/review/35246 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-06-13register_decode_as_next_proto: remove the "title" parameterMartin Kaiser1-1/+1
Remove the "title" parameter from the register_decode_as_next_proto() function. This parameter is no longer required since decode_as_t does not have a title any more. Change-Id: I300c755bd465453aa91703b53ce9adc954e38c00 Reviewed-on: https://code.wireshark.org/review/33579 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-13dissectors: can: Handle CAN id flagsMaksim Salau1-5/+11
The change adds support of CAN flags stored in ids. The flags allow dissectors to distinguish error frames, remote transmission request frames and identify id type used (either standard 11-bit or extended 29-bit). Addition of bit flags allowed to add more checks whether a CAN frame may be decoded by a particular dissector. I.e. some dissectors work only with 11-bit ids (CANopen, DeviceNet) some only with 29-bit (J1939, ISObus), others should be fine with bot types (OBD-II, ISO 15765). The change also fixes 2 bugs in the DeviceNet dissector: * removed byte swapping of CAN id (the pcap file seems to be broken; verified dissector operation with random traffic generated by cangen) * fixed "Warn Dissector bug, protocol DeviceNet, in packet N": added a default value for fragmented message type string value lookup. Bug: 15418 Change-Id: I70e91130789bb3367fe19e51489cd34e97d678a6 Reviewed-on: https://code.wireshark.org/review/31471 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-4/+4
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-05Fix some spelling errors found by Lintian.Gerald Combs1-1/+1
Change-Id: If6fc3aab7ad4fc634567121f7b9541bc6f6c5766 Reviewed-on: https://code.wireshark.org/review/30926 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-15Epan+Qt: Invalidate cached column strings.Gerald Combs1-1/+1
Add col_data_changed, which checks to see if we have updated column info. Add col_append_frame_number, which adds a frame number and sets col_data_changed. Call col_append_frame_number instead of col_append_fstr from some dissectors. Add PacketListRecord::invalidateAllRecords, which invalidates any cached record data. Add PacketListModel::invalidateAllColumnStrings which calls invalidateAllRecords and signals that our data has changed. Call invalidateAllColumnStrings when we have new name resolution or column information. Bug: 11414 Bug: 11468 Change-Id: I2671594a722f4f9436fe1df84d43489a148e0cee Reviewed-on: https://code.wireshark.org/review/26373 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-16Have register_decode_as_next_proto create dissector table.Michael Mann1-8/+2
For protocols that have don't have a unique identifier for their payload, have register_decode_as_next_proto be a one stop shop to create Decode As functionality and a dissector table of type FT_NONE. Change-Id: Ic1f2e9ed0aee0554a4eb8f232630b99c0604dfc0 Reviewed-on: https://code.wireshark.org/review/22575 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-11Expand register_decode_as_next_proto to include prompt string.Michael Mann1-21/+2
Many dissectors don't have an identifier to pass to a dissector table. When using Decode As they all have a "value" function that returns 0 just so something is returned. A first step to a cleaner refactor of the functionality is to allow dissectors to provide a "prompt" function when registering Decode As with register_decode_as_next_proto() so that the text exposed in the GUI can vary, but the function that returns 0 (nothing) can be consolidated under decode as registration functionality. This casts a wider net for register_decode_as_next_proto() use. Change-Id: I2995b3c251dae70f5f529b672473d25c6288ed5c Reviewed-on: https://code.wireshark.org/review/22562 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-06can: remove duplicated can_identifier struct.Jakub Zawadzki1-7/+2
Change-Id: Ib6f0bcd1bec9a1fc5cbcd797a1f418270ae74a0e Reviewed-on: https://code.wireshark.org/review/21537 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-02iso15765: convert GHashTable to wmem_map.Dario Lombardo1-18/+5
Change-Id: I25fd598f3c2bd75548213140e93198b611f30d4b Reviewed-on: https://code.wireshark.org/review/19900 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-01-29Register reassembly tablesMichael Mann1-3/+2
Register all reassembly tables with a central unit, allowing the central unit to have the callback that initializes and destroys the reassembly tables, rather than have dissectors do it individually. Change-Id: Ic92619c06fb5ba6f1c3012f613cae14982e101d4 Reviewed-on: https://code.wireshark.org/review/19834 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-2/+2
This emphasizes that there is no such thing as *the* routine to construct a subset tvbuff; you need to choose one of tvb_new_subset_remaining() (if you want a new tvbuff that contains everything past a certain point in an existing tvbuff), tvb_new_subset_length() (if you want a subset that contains everything past a certain point, for some number of bytes, in an existing tvbuff), and tvb_new_subset_length_caplen() (for all other cases). Many of the calls to tvb_new_subset_length_caplen() should really be calling one of the other routines; that's the next step. (This also makes it easier to find the calls that need fixing.) Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b Reviewed-on: https://code.wireshark.org/review/19597 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-18iso15765: fix no previous prototype for ↵Alexis La Goutte1-0/+3
'proto_register_iso15765/proto_reg_handoff_iso15765' [-Wmissing-prototypes] Change-Id: Id563eb5c44a988a7ea5149e312f4033cd4ca31e9 Reviewed-on: https://code.wireshark.org/review/17141 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-08-06ios15765: tree is used, remove the _U_Martin Kaiser1-1/+1
Change-Id: Id7fb231fe820308641c09add22dde131757b9e92 Reviewed-on: https://code.wireshark.org/review/16929 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>