Skip to main content

Crate zerodds_transport_uds

Crate zerodds_transport_uds 

Source
Expand description

Crate zerodds-transport-uds. Safety classification: STANDARD.

ZeroDDS-Unix-Domain-Socket-Transport — Container-IPC für ZeroDDS.

§Spec

  • DDSI-RTPS 2.5 §9.4 — Locator-Kind LOCATOR_KIND_UDS (vendor-reservierter Wert 0x81000001, in crates/rtps/src/wire_types.rs).
  • ZeroDDS-UDS-Transport 1.0 — vendor-spezifischer Transport- Spec (Filesystem-Pfad-Resolution, Abstract-Namespace, SOCK_DGRAM Wire-Format), docs/spec-coverage/zerodds-uds-transport-1.0.md.

§Hinweis zur OMG-Normativität

OMG normiert keinen UDS-Transport für DDS. Cyclone DDS und FastDDS haben keinen offiziellen UDS-Transport (nutzen iceoryx oder shared memory). ZeroDDS definiert seine eigene Variante explizit als ZeroDDS-UDS-Transport-1.0-Spec.

§Use Case

Container-IPC, wenn Multicast geblockt ist und POSIX-SHM cross-Container unpraktisch (UID-Mapping, /dev/shm-Sichtbarkeit, SELinux). Ein gemountetes Volume mit UDS-Sockets ist das realistische Docker/Kubernetes-Pattern.

§Implementiert (RC1)

  • SOCK_DGRAM über Filesystem-Sockets (Default-Modus).
  • Linux Abstract-Namespace-Support via abstract_dgram-Modul (Datagrams ohne Filesystem-Inode).
  • Lazy Base-Directory-Erstellung mit Mode 0700.
  • TOCTOU-sichere Socket-Erstellung (path.exists + fail-fast).
  • Differenzierte io::Error-Klassifikation für Diagnose.

§Cross-Vendor-Interop

Nicht vorgesehen — UDS ist intra-Container/intra-Host-IPC. Cross-Vendor-Interop mit Cyclone/FastDDS bleibt UDP/TCP/SHM-Domain.

§Wire-Format

Jedes Datagram ist eine SOCK_DGRAM-Message; Kernel erhält die Message-Grenzen. Default-Path-Resolution: 16-Byte Locator-Adresse → <base_dir>/<lowercase-hex>.sock. Default base_dir = /tmp/zerodds/uds.

§Safety / Unsafe-Scope

Default-DGRAM-Modul (lib.rs) ist safe-only (std::os::unix::net::UnixDatagram). Linux-only abstract_dgram-Modul nutzt libc::sendto/libc::recvfrom plus raw sockaddr_un-Konstruktion für Abstract-Namespace — enthält begrenzte, mit SAFETY-Kommentaren dokumentierte unsafe-Blöcke.

Modules§

abstract_dgram
SOCK_DGRAM mit Abstract-Namespace (Linux-only, T5). UDS SOCK_DGRAM mit Abstract-Namespace — Linux-only, containerized-IPC-optimized (WP 2.0b T5).

Structs§

UdsConfig
Configuration for opening a UdsTransport.
UdsTransport
UDS-based transport bound to a specific 16-byte locator ID.

Constants§

DEFAULT_BASE_DIR
Default base directory for UDS sockets.
DEFAULT_MAX_DATAGRAM
Maximum UDS datagram size we accept on receive. Linux default wmem_max is 212992 bytes; we cap a bit below to stay under the typical kernel limit and match the UDP-transport recv-buffer size.

Functions§

socket_path
Renders a locator ID (16 bytes) to a filesystem path under base_dir.