Documentation/networking/iso15765-2.rst

Source file repositories/reference/linux-study-clean/Documentation/networking/iso15765-2.rst

File Facts

System
Linux kernel
Corpus path
Documentation/networking/iso15765-2.rst
Extension
.rst
Size
13612 bytes
Lines
387
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct sockaddr_can {
        sa_family_t can_family;
        int         can_ifindex;
        union {
            struct { canid_t rx_id, tx_id; } tp;
        ...
        } can_addr;
    }

* ``can_family`` and ``can_ifindex`` serve the same purpose as for other
  SocketCAN sockets.

* ``can_addr.tp.rx_id`` specifies the receive (RX) CAN ID and will be used as
  a RX filter.

* ``can_addr.tp.tx_id`` specifies the transmit (TX) CAN ID

ISO-TP socket options
---------------------

When creating an ISO-TP socket, reasonable defaults are set. Some options can
be modified with ``setsockopt(2)`` and/or read back with ``getsockopt(2)``.

General options
~~~~~~~~~~~~~~~

General socket options can be passed using the ``CAN_ISOTP_OPTS`` optname:

.. code-block:: C

    struct can_isotp_options opts;
    ret = setsockopt(s, SOL_CAN_ISOTP, CAN_ISOTP_OPTS, &opts, sizeof(opts))

where the ``can_isotp_options`` structure has the following contents:

.. code-block:: C

    struct can_isotp_options {
        u32 flags;
        u32 frame_txtime;
        u8  ext_address;
        u8  txpad_content;
        u8  rxpad_content;
        u8  rx_ext_address;
    };

* ``flags``: modifiers to be applied to the default behaviour of the ISO-TP
  stack. Following flags are available:

  * ``CAN_ISOTP_LISTEN_MODE``: listen only (do not send FC frames); normally
    used as a testing feature.

  * ``CAN_ISOTP_EXTEND_ADDR``: use the byte specified in ``ext_address`` as an
    additional address component. This enables the "mixed" addressing format if
    used alone, or the "extended" addressing format if used in conjunction with
    ``CAN_ISOTP_RX_EXT_ADDR``.

  * ``CAN_ISOTP_TX_PADDING``: enable padding for transmitted frames, using
    ``txpad_content`` as value for the padding bytes.

  * ``CAN_ISOTP_RX_PADDING``: enable padding for the received frames, using
    ``rxpad_content`` as value for the padding bytes.

  * ``CAN_ISOTP_CHK_PAD_LEN``: check for correct padding length on the received
    frames.

  * ``CAN_ISOTP_CHK_PAD_DATA``: check padding bytes on the received frames
    against ``rxpad_content``; if ``CAN_ISOTP_RX_PADDING`` is not specified,
    this flag is ignored.

Annotation

Implementation Notes