Commit Graph

19 Commits

Author SHA1 Message Date
David Perry 51315cf37c Fix AUTOSAR heuristic label 2022-07-05 19:19:56 +00:00
David Perry 7f820c4a02 More descriptive names for some heuristic dissectors 2022-02-07 18:07:22 +00:00
João Valverde 0ccd69e530 Replace g_strdup_printf() with ws_strdup_printf()
Use macros from inttypes.h.
2021-12-19 21:21:58 +00:00
João Valverde 22ee2764a7 Replace g_snprintf() with snprintf() (dissectors)
Use macros from inttypes.h with format strings.
2021-12-19 20:25:11 +00:00
Dr. Lars Völker 79b0e4999a AUTOSAR I-PduM dissector
This patch adds the AUTOSAR I-PduM dissector.
2021-10-22 05:49:34 +00:00
Guy Harris c2b6a27e97 autosar_nm: get rid of unused protocol IDs.
We fetch the protocol IDs for several protocols, but use none of them.
Get rid of them.
2021-10-11 20:44:41 +00:00
Dr. Lars Völker 0d276b47d1 AUTOSAR NM: Bugfix: wrong filters for user defined elements
When UDP-NM was renamed into AUTOSAR-NM (as well as filename changed)
the author of that patch missed the dynamic filters. This patch fixes
this oversight and makes sure all filters of AUTOSAR NM start with
"autosar-nm.".

Fixes #17643
2021-10-10 20:00:15 +00:00
Alexis La Goutte 90a060c339 autosar-nm: Fix Dead Store found by Clang Analyzer
packet-autosar-nm.c:572:7: warning: Value stored to 'offset' is never read [deadcode.DeadStores]
2021-09-06 04:21:15 +00:00
Dr. Lars Völker d95b118fc5 AUTOSAR NM: Adding support for 64bit elements in user data
This patch adds suppport for 64bit elements in the user data. With
CAN-FD and Ethernet replacing traditional CANs, NM is not limited
to 8 Byte messages anymore; therefore, the limitation of uint32
elements needed to change.
2021-05-14 07:06:24 +00:00
Dr. Lars Völker 8a96d2a903 CAN, AUTOSAR NM, Signal PDU: Fix the interpretation of CAN ID
This patches makes sure that the registered IDs are not influenced
by the three flags mapped into the same uint32.

This was a oversight in the AUTOSAR NM and Signal PDU dissectors.
2021-04-24 11:40:57 +00:00
Dr. Lars Völker 67ac25c862 AUTOSAR NM: Adding support for different CBV versions
This patch adds support for the different CBV layouts based on:
- AUTOSAR 3.0 / AUTOSAR 3.1
- AUTOSAR 3.2
- AUTOSAR 4.0
- AUTOSAR 4.1 - AUTOSAR 19-11
- AUTOSAR 20-11.

Before there was only a boolean config item to switch between 3.2 and
4.1. This was removed since it is now not required anymore.

The patch keeps AUTOSAR 4.1 as default layout.
2021-04-19 04:25:06 +00:00
Dr. Lars Völker d90c49e2cf AUTOSAR-NM: Adding support to configure CBV and SNI
The AUTOSAR NM standard defines that the position of CBV can be
byte 0, byte 1, or turned off. For SNI the same options are possible.

This patch replaces the old simplfied "swap configuration" that only
allowed CBV=0/SNI=1 or CBV=1/SNI=0 with the standard compliant
configuration option.
2021-04-16 07:25:18 +00:00
Dr. Lars Völker dabf0af6b7 AUTOSAR NM: In default configuration all CAN packets will be dissected
The default value for the CAN-ID Mask is currently 0. If no config is
present, all comparisons would be always true. This leads to all CAN
packets are being dissected by this dissector by default.
This is a huge performance problem and surely not intended.

This patch sets the default of the CAN-ID Mask to 0xffffffff, so that
in the unconfigured case, only the CAN-ID 0 would be dissected.
2021-03-13 08:00:30 +00:00
Dr. Lars Völker 4d515f70af AUTOSAR-NM: Adding support for PDU ranges and clean up
This patch:
- adds support for PDU ranges instead of one single PDUs
- simplifies the dissection code for CAN messages
- cleans up some some comments
2021-01-14 18:36:49 +00:00
Dr. Lars Völker 238446dc91 AUTOSAR-NM: True-False-String wrong way around for PNI (BUGFIX)
This patch fixes the PNI TFString, which was wrong. Correct is:
0 = "... contains no Partial Network ..."
1 = "... contains Partial Network ..."

Fixes #17154
2021-01-14 13:18:12 +00:00
Dr. Lars Völker e8ebebe860 Adding dissector for PDU-Transport
This patch adds a new dissector for PDU-Transport. This is a very
simple protocol to transport CAN, FlexRay, LIN, and other PDUs.
It is typically used to transport legacy messages/PDUs over Ethernet.
The format is compatible to FDN and AUTOSAR.

Enabled AUTOSAR NM on top of the PDU Transport and fixed a few bugs
in AUTOSAR NM as well (length parsing).

Solves #17095
2020-12-24 06:05:27 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00:00
Stefan Tatschner 40eece98f8 Change struct can_identifier to can_info
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-11-28 18:27:16 +00:00
Maksim Salau 7f49d0d1bb udp-nm: Extend and rename to autosar-nm
The UDP-NM dissector is actually AUTOSAR-NM and works over UDP and CAN.

The change also adds parsing of reserved bits of control bit vector and
the 'NM Coordinator Id' field which was present in revision 3.2 but now
is deprecated (bits are marked as reserved).

Since not every packet on a CAN bus is an Network Management one,
parameters were added to filter only packets with specific ids.
In order to define ids to be dissected one should define a reference id
and a mask in preferences.

Change-Id: Ica69032b7200c4c3a1f81130ebcea0dd4144cbf2
Reviewed-on: https://code.wireshark.org/review/31560
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-17 08:11:22 +00:00