Skip to main content

Module wire_types

Module wire_types 

Source
Expand description

RTPS wire base types (DDSI-RTPS 2.5 §8.3.5, §8.3.5.1).

These types are the atoms of the RTPS wire format: GUID components, sequence numbers, locators. They are all pure byte structures with a fixed layout (no XCDR alignment, no endianness tagging on the type — the endianness of a submessage stream slice comes from the submessage-header E flag).

§Convention

  • read_from_le / read_from_be: decoder with explicit endianness.
  • write_to_le / write_to_be: encoder, symmetric.
  • WIRE_SIZE: constant with the fixed byte count on the wire.

Structs§

EntityId
EntityId: 4-byte endpoint identifier within a participant. Layout: 3 bytes entity_key + 1 byte entity_kind.
FragmentNumber
FragmentNumber: 32-bit unsigned, 1-based (fragment #1 is the first fragment of a sample). UNKNOWN = 0 is used as a sentinel, but is not a valid fragment.
Guid
Guid: GuidPrefix + EntityId = 16 bytes. Globally unique identifier of an endpoint.
GuidPrefix
GuidPrefix: 12-byte prefix of a GUID. Identifies a participant; stays the same for all endpoints of the participant.
Locator
Locator: 24-byte address (kind + port + 16-byte address).
ProtocolVersion
ProtocolVersion: major + minor of the RTPS protocol. Currently 2.5.
SequenceNumber
SequenceNumber: 64-bit signed, encoded as (high: i32, low: u32). Both fields are written with the active submessage endianness.
UExtension4
UExtension4_t — 4-byte vendor-specific extension slot. Spec §8.3.2: opaque 32-bit value, the vendor decides its meaning; the receiver propagates the value via the extensions field into the receiver state.
VendorId
VendorId: 2-byte vendor identifier. ZeroDDS uses 0x01F0 as an interim value from the OMG developer range, until an official VendorId is requested.
WExtension8
WExtension8_t — 8-byte vendor-specific extension slot. Spec §8.3.2: opaque 64-bit value (analogous to UExtension4_t for fields that need 8 bytes, e.g. for 64-bit counters).

Enums§

EntityKind
EntityKind: classification of an endpoint. Spec Table 9.1.
LocatorKind
LocatorKind: address family of a locator.

Constants§

SPDP_DEFAULT_MULTICAST_ADDRESS
SPDP default multicast address (Spec §9.6.1.4.1): 239.255.0.1.
SPDP_DISCOVERY_MULTICAST_OFFSET
Multicast discovery port offset (Spec §9.6.1.4.1, d0).
SPDP_DOMAIN_GAIN
Domain-specific port offset (Spec §9.6.1.4.1, DG).
SPDP_PORT_BASE
SPDP discovery port base (Spec §9.6.1.4.1, PB).

Functions§

spdp_multicast_port
Computes the SPDP multicast discovery port for a domain. Formula (Spec §9.6.1.4.1): port = PB + DG * domain_id + d0 = 7400 + 250 * domain + 0