DOKK / manpages / debian 12 / can-utils / cangw.1.en
CANGW(1) User Commands CANGW(1)

cangw - manual page for cangw 2020.11.0-1

cangw [options]

cangw - manage PF_CAN netlink gateway.

(add a new rule)
(delete a rule)
(flush / delete all rules)
(list all rules)

(source netdevice)
(destination netdevice)

(this is a CAN FD rule)
(preserve src_dev rx timestamp)
(echo sent frames - recommended on vcanx)
(allow to route to incoming interface)
(user defined modification identifier)
(limit the number of frame hops / routings)
(set CAN filter)
(set Classic CAN frame modifications)
(set CAN FD frame modifications)
(XOR checksum)
(CRC8 cs)
(CRC8 checksum profile & parameters)

Values are given and expected in hexadecimal values. Leading 0s can be omitted.

<can_id>:<can_mask>
(matches when <received_can_id> & mask == can_id & mask)
<can_id>~<can_mask>
(matches when <received_can_id> & mask != can_id & mask)

<mod> is a CAN frame modification instruction consisting of <instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>

<instruction>
is one of 'AND' 'OR' 'XOR' 'SET'
<can_frame-elements>
is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata
<can_id>
is an u32 value containing the CAN Identifier
<can_dlc>
is an u8 value containing the data length code (0 .. 8)
<can_data>
is always eight(!) u8 values containing the CAN frames data

<MOD> is a CAN FD frame modification instruction consisting of <instruction>:<canfd_frame-elements>:<can_id>.<flags>.<len>.<can_data>

<instruction>
is one of 'AND' 'OR' 'XOR' 'SET'
<canfd_frame-elements>
is _one_ or _more_ of 'I'd 'F'lags 'L'ength 'D'ata
<can_id>
is an u32 value containing the CAN FD Identifier
<flags>
is an u8 value containing CAN FD flags (CANFD_BRS, CANFD_ESI)
<len>
is an u8 value containing the data length (0 .. 64)
<can_data>
is always 64(!) u8 values containing the CAN FD frames data

The max. four modifications are performed in the order AND -> OR -> XOR -> SET

add one additional u8 value
add u8 value from table[16] indexed by (data[1] & 0xF)
add u8 value (can_id & 0xFF) ^ (can_id >> 8 & 0xFF)

cangw -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788

December 2020 cangw 2020.11.0-1