/*
*
*
* Distributed under the Apache License.
* See: https://github.com/frehberg/rtps-gen/blob/master/LICENSE
*/
#ifndef RTPS_RTPSCORE_IDL
#define RTPS_RTPSCORE_IDL
#include "dds/DdsDcpsInfoUtils.idl"
#ifdef DDS_SECURITY
#include "dds/DdsSecurityParams.idl"
#endif
module DDS {
module RTPS {
typedef octet OctetArray2[2];
typedef octet OctetArray4[4];
/* A list of filters that were applied to the sample.
See section 9.6.3.1 for the signature-generation algorithm. */
typedef long FilterSignature_t[4];
/* For each filter signature, the results indicate whether the
sample passed the filter. */
typedef sequence<long> FilterResult_t;
typedef sequence<FilterSignature_t> FilterSignatureSeq;
struct ContentFilterInfo_t {
FilterResult_t filterResult;
FilterSignatureSeq filterSignatures;
};
// TODO: PENDING IDL V4 INHERITANCE
// Remove these typedefs and force dependencies to use the
// DDS::Property_t version directly. These were move moved
// into DdsDcpsCore.idl because:
// - PropertyQosPolicy depends on the security version of Property_t
// - Security's DomainParticipantQos depends on PropertyQosPolicy
// - Security's DomainParticipantQos inherits from the core DDS DomainParticipantQos
// - IDL v4 inheritance isn't supported yet (so we combined the two)
typedef DDS::Property_t Property_t;
typedef DDS::PropertySeq PropertySeq;
struct EntityName_t {
string name;
};
/* Type used to encapsulate a count that is incremented monotonically, used
to identify message duplicates. */
struct Count_t {
long value;
};
/* Type used to hold sequence numbers. */
struct SequenceNumber_t {
long high;
unsigned long low;
};
// see SEQUENCENUMBER_UNKNOWN constant in BaseMessageTypes.h
typedef sequence<long, 8> LongSeq8;
/* SequenceNumberSet SubmessageElements are used as parts of several
messages to provide binary information about individual sequence numbers
within a range. */
struct SequenceNumberSet {
SequenceNumber_t bitmapBase;
unsigned long numBits;
LongSeq8 bitmap;
};
/* LocatorList is used to specify a list of locators. */
typedef sequence<DDS::DCPS::Locator_t, 8> LocatorList;
// OMG Specification formal/2010-11-01 DDS-RTPS v2.1
// Section 9.3: "Mapping of the RTPS Types"
/* Type used to hold a timestamp. */
struct Time_t { // IETF RFC 1305: time = seconds + fraction / 2^32
long seconds;
unsigned long fraction;
};
// see TIME_* constants in BaseMessageTypes.h
typedef Time_t Timestamp_t;
/* Duration_t isn't defined in the PSM. It is used to hold time-differences.
Should have at least nano-second resolution. Table 9.13's row for
PID_PARTICIPANT_LEASE_DURATION indicates this a 2-item struct or array,
just like Time_t (which does have the needed resolution). So we'll use
Time_t for the Duration_t datatype. */
typedef Time_t Duration_t;
const long LOCATOR_KIND_INVALID = -1;
const long LOCATOR_KIND_RESERVED = 0;
const long LOCATOR_KIND_UDPv4 = 1;
const long LOCATOR_KIND_UDPv6 = 2;
const unsigned long LOCATOR_PORT_INVALID = 0;
// see LOCATOR_* constants in BaseMessageTypes.h
/* Specialization of Locator_t used to hold UDP IPv4 locators using a more
compact representation. */
struct LocatorUDPv4_t {
unsigned long address;
unsigned long _port;
};
// see LOCATORUDPv4_INVALID constant in BaseMessageTypes.h
/* Enumeration used to distinguish whether a Topic has defined some fields
within to be used as the 'key' that identifies data-instances within the
Topic. */
struct TopicKind_t {
long value;
};
// Constants for the TopicKind_t::value field
const short NO_KEY = 1;
const short WITH_KEY = 2;
/* Enumeration used to indicate the level of the reliability used for
communications. */
struct ReliabilityKind_t {
long value;
};
// Constants for the ReliabilityKind_t::value field
const short BEST_EFFORT = 1;
const short RELIABLE = 3;
struct KeyHash_t {
DCPS::OctetArray16 value;
};
struct StatusInfo_t {
OctetArray4 value;
};
/* Identifies the version of the RTPS protocol. */
struct ProtocolVersion_t {
octet major;
octet minor;
};
// see PROTOCOLVERSION* constants in BaseMessageTypes.h
/* Type used to represent the vendor of the service
implementing the RTPS protocol. */
struct VendorId_t {
OctetArray2 vendorId;
};
// see VENDORID_* constants in BaseMessageTypes.h
typedef unsigned long BuiltinEndpointSet_t;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER =
1 << 0;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR =
1 << 1;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER =
1 << 2;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR =
1 << 3;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER =
1 << 4;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR =
1 << 5;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_PROXY_ANNOUNCER =
1 << 6;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_PROXY_DETECTOR =
1 << 7;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_STATE_ANNOUNCER =
1 << 8;
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_STATE_DETECTOR =
1 << 9;
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER =
1 << 10;
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER =
1 << 11;
union Parameter;
/* contains a list of Parameters, terminated with a sentinel */
typedef sequence<Parameter> ParameterList;
struct OriginalWriterInfo_t {
DCPS::GUID_t originalWriterGUID;
SequenceNumber_t originalWriterSN;
ParameterList originalWriterQos;
};
typedef unsigned short ParameterId_t;
// see Table 9.12 "ParameterId Values" and 9.14 "Inline QoS Parameters"
// (the following constants are in the same order as Table 9.12)
const ParameterId_t PID_PAD = 0x0000;
const ParameterId_t PID_SENTINEL = 0x0001;
const ParameterId_t PID_USER_DATA = 0x002c;
const ParameterId_t PID_TOPIC_NAME = 0x0005;
const ParameterId_t PID_TYPE_NAME = 0x0007;
const ParameterId_t PID_GROUP_DATA = 0x002d;
const ParameterId_t PID_TOPIC_DATA = 0x002e;
const ParameterId_t PID_DURABILITY = 0x001d;
const ParameterId_t PID_DURABILITY_SERVICE = 0x001e;
const ParameterId_t PID_DEADLINE = 0x0023;
const ParameterId_t PID_LATENCY_BUDGET = 0x0027;
const ParameterId_t PID_LIVELINESS = 0x001b;
const ParameterId_t PID_RELIABILITY = 0x001a;
const ParameterId_t PID_LIFESPAN = 0x002b;
const ParameterId_t PID_DESTINATION_ORDER = 0x0025;
const ParameterId_t PID_HISTORY = 0x0040;
const ParameterId_t PID_RESOURCE_LIMITS = 0x0041;
const ParameterId_t PID_OWNERSHIP = 0x001f;
const ParameterId_t PID_OWNERSHIP_STRENGTH = 0x0006;
const ParameterId_t PID_PRESENTATION = 0x0021;
const ParameterId_t PID_PARTITION = 0x0029;
const ParameterId_t PID_TIME_BASED_FILTER = 0x0004;
const ParameterId_t PID_TRANSPORT_PRIORITY = 0x0049;
const ParameterId_t PID_PROTOCOL_VERSION = 0x0015;
const ParameterId_t PID_VENDORID = 0x0016;
const ParameterId_t PID_UNICAST_LOCATOR = 0x002f;
const ParameterId_t PID_MULTICAST_LOCATOR = 0x0030;
const ParameterId_t PID_MULTICAST_IPADDRESS = 0x0011;
const ParameterId_t PID_DEFAULT_UNICAST_LOCATOR = 0x0031;
const ParameterId_t PID_DEFAULT_MULTICAST_LOCATOR = 0x0048;
const ParameterId_t PID_METATRAFFIC_UNICAST_LOCATOR = 0x0032;
const ParameterId_t PID_METATRAFFIC_MULTICAST_LOCATOR = 0x0033;
const ParameterId_t PID_DEFAULT_UNICAST_IPADDRESS = 0x000c;
const ParameterId_t PID_DEFAULT_UNICAST_PORT = 0x000e;
const ParameterId_t PID_METATRAFFIC_UNICAST_IPADDRESS = 0x0045;
const ParameterId_t PID_METATRAFFIC_UNICAST_PORT = 0x000d;
const ParameterId_t PID_METATRAFFIC_MULTICAST_IPADDRESS = 0x000b;
const ParameterId_t PID_METATRAFFIC_MULTICAST_PORT = 0x0046;
const ParameterId_t PID_EXPECTS_INLINE_QOS = 0x0043;
const ParameterId_t PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT = 0x0034;
const ParameterId_t PID_PARTICIPANT_BUILTIN_ENDPOINTS = 0x0044;
const ParameterId_t PID_PARTICIPANT_LEASE_DURATION = 0x0002;
const ParameterId_t PID_CONTENT_FILTER_PROPERTY = 0x0035;
const ParameterId_t PID_PARTICIPANT_GUID = 0x0050;
const ParameterId_t PID_PARTICIPANT_ENTITYID = 0x0051;
const ParameterId_t PID_GROUP_GUID = 0x0052;
const ParameterId_t PID_GROUP_ENTITYID = 0x0053;
const ParameterId_t PID_BUILTIN_ENDPOINT_SET = 0x0058;
const ParameterId_t PID_PROPERTY_LIST = 0x0059;
const ParameterId_t PID_TYPE_MAX_SIZE_SERIALIZED = 0x0060;
const ParameterId_t PID_ENTITY_NAME = 0x0062;
const ParameterId_t PID_KEY_HASH = 0x0070;
const ParameterId_t PID_STATUS_INFO = 0x0071;
// (the following constant is not in the spec but is needed for SEDP)
const ParameterId_t PID_ENDPOINT_GUID = 0x005a;
// (the following constants are in the same order as Table 9.14)
const ParameterId_t PID_CONTENT_FILTER_INFO = 0x0055;
const ParameterId_t PID_COHERENT_SET = 0x0056;
// PID_DIRECTED_WRITE is not supported
// const ParameterId_t PID_DIRECTED_WRITE = 0x0057;
const ParameterId_t PID_ORIGINAL_WRITER_INFO = 0x0061;
// ParameterId Bitmask values (Table 9.11)
const ParameterId_t PIDMASK_VENDOR_SPECIFIC = 0x8000;
const ParameterId_t PIDMASK_INCOMPATIBLE = 0x4000;
// Vendor-specific parameters
// PID_DDS_BASE won't be used as an actual PID, it's just the starting
// point for ones we assign. This is deliberately a larger number so as
// not to overlap ones that other vendors are using and are in the Wireshark
// dissector (they could overlap, but it would confuse Wireshark).
const ParameterId_t PID_DDS_BASE = PIDMASK_VENDOR_SPECIFIC + 0x3000;
const ParameterId_t PID_DDS_LOCATOR = PID_DDS_BASE + 1;
const ParameterId_t PID_DDS_ASSOCIATED_WRITER = PID_DDS_BASE + 2;
/* Always used inside a ParameterList */
union Parameter switch (ParameterId_t) {
case PID_TOPIC_NAME:
case PID_TYPE_NAME:
DDS::DCPS::String256 string_data;
// DDS Quality-of-Service (QoS) structs
case PID_USER_DATA:
DDS::UserDataQosPolicy user_data;
case PID_GROUP_DATA:
DDS::GroupDataQosPolicy group_data;
case PID_TOPIC_DATA:
DDS::TopicDataQosPolicy topic_data;
case PID_DURABILITY:
DDS::DurabilityQosPolicy durability;
case PID_DURABILITY_SERVICE:
DDS::DurabilityServiceQosPolicy durability_service;
case PID_DEADLINE:
DDS::DeadlineQosPolicy deadline;
case PID_LATENCY_BUDGET:
DDS::LatencyBudgetQosPolicy latency_budget;
case PID_LIVELINESS:
DDS::LivelinessQosPolicy liveliness;
case PID_RELIABILITY:
DDS::ReliabilityQosPolicy reliability;
case PID_LIFESPAN:
DDS::LifespanQosPolicy lifespan;
case PID_DESTINATION_ORDER:
DDS::DestinationOrderQosPolicy destination_order;
case PID_HISTORY:
DDS::HistoryQosPolicy history;
case PID_RESOURCE_LIMITS:
DDS::ResourceLimitsQosPolicy resource_limits;
case PID_OWNERSHIP:
DDS::OwnershipQosPolicy ownership;
case PID_OWNERSHIP_STRENGTH:
DDS::OwnershipStrengthQosPolicy ownership_strength;
case PID_PRESENTATION:
DDS::PresentationQosPolicy presentation;
case PID_PARTITION:
DDS::PartitionQosPolicy partition;
case PID_TIME_BASED_FILTER:
DDS::TimeBasedFilterQosPolicy time_based_filter;
case PID_TRANSPORT_PRIORITY:
DDS::TransportPriorityQosPolicy transport_priority;
// RTPS-defined data types
case PID_PROTOCOL_VERSION:
ProtocolVersion_t version;
case PID_VENDORID:
VendorId_t vendor;
case PID_UNICAST_LOCATOR:
case PID_MULTICAST_LOCATOR:
case PID_DEFAULT_UNICAST_LOCATOR:
case PID_DEFAULT_MULTICAST_LOCATOR:
case PID_METATRAFFIC_UNICAST_LOCATOR:
case PID_METATRAFFIC_MULTICAST_LOCATOR:
DCPS::Locator_t locator;
case PID_MULTICAST_IPADDRESS:
case PID_DEFAULT_UNICAST_IPADDRESS:
case PID_METATRAFFIC_UNICAST_IPADDRESS:
case PID_METATRAFFIC_MULTICAST_IPADDRESS:
unsigned long ipv4_address;
//NOTE: the spec uses "IPv4Address_t" which is not defined anywhere.
// We have chosen unsigned long to match the type of
// the address field in the LocatorUDPv4_t struct.
case PID_DEFAULT_UNICAST_PORT:
case PID_METATRAFFIC_UNICAST_PORT:
case PID_METATRAFFIC_MULTICAST_PORT:
unsigned long udpv4_port;
//NOTE: the spec uses "Port_t" which is not defined anywhere.
// We have chosen unsigned long to match the type of
// the port field in the LocatorUDPv4_t struct.
case PID_EXPECTS_INLINE_QOS:
boolean expects_inline_qos;
case PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT:
Count_t count;
case PID_PARTICIPANT_BUILTIN_ENDPOINTS:
unsigned long participant_builtin_endpoints;
case PID_PARTICIPANT_LEASE_DURATION:
Duration_t duration;
case PID_CONTENT_FILTER_PROPERTY:
DCPS::ContentFilterProperty_t content_filter_property;
case PID_PARTICIPANT_GUID:
case PID_ENDPOINT_GUID:
case PID_GROUP_GUID:
case PID_DDS_ASSOCIATED_WRITER:
DCPS::GUID_t guid;
case PID_PARTICIPANT_ENTITYID:
case PID_GROUP_ENTITYID:
DCPS::EntityId_t entity_id;
case PID_BUILTIN_ENDPOINT_SET:
BuiltinEndpointSet_t builtin_endpoints;
case PID_PROPERTY_LIST:
// IDL compiler adds support for reading the RTPS version of this
// PID (which has one sequence in it), or the Security version which
// contains the optional second sequence for binary properties.
DDS::PropertyQosPolicy property;
case PID_TYPE_MAX_SIZE_SERIALIZED:
long type_max_size_serialized;
case PID_ENTITY_NAME:
EntityName_t entity_name;
case PID_KEY_HASH:
KeyHash_t key_hash;
case PID_STATUS_INFO:
StatusInfo_t status_info;
case PID_CONTENT_FILTER_INFO:
ContentFilterInfo_t content_filter_info;
case PID_COHERENT_SET:
SequenceNumber_t coherent_set;
case PID_ORIGINAL_WRITER_INFO:
OriginalWriterInfo_t original_writer_info;
case PID_DDS_LOCATOR:
DCPS::TransportLocator opendds_locator;
#ifdef DDS_SECURITY
case DDS::Security::PID_IDENTITY_TOKEN:
DDS::Security::IdentityToken identity_token;
case DDS::Security::PID_PERMISSIONS_TOKEN:
DDS::Security::PermissionsToken permissions_token;
case DDS::Security::PID_DATA_TAGS:
DDS::Security::DataTags data_tags;
case DDS::Security::PID_ENDPOINT_SECURITY_INFO:
DDS::Security::EndpointSecurityInfo endpoint_security_info;
case DDS::Security::PID_PARTICIPANT_SECURITY_INFO:
DDS::Security::ParticipantSecurityInfo participant_security_info;
case DDS::Security::PID_IDENTITY_STATUS_TOKEN:
DDS::Security::IdentityStatusToken identity_status_token;
#endif
default:
DDS::OctetSeq unknown_data;
};
const octet FLAG_E = 1; // All Submessages: little Endian
const octet FLAG_Q = 2; // Data, DataFrag: inline Qos present
const octet FLAG_F = 2; // AckNack, Heartbeat: Final
const octet FLAG_I = 2; // InfoTimestamp: Invalidate
const octet FLAG_M = 2; // InfoReplyIp4: Multicast present
const octet FLAG_D = 4; // Data: sample Data present
const octet FLAG_L = 4; // Heartbeat: Liveliness
const octet FLAG_K_IN_FRAG = 4; // DataFrag: Key present
const octet FLAG_K_IN_DATA = 8; // Data: Key present
/* all Submessages are composed of a leading SubmessageHeader */
struct SubmessageHeader {
octet submessageId;
octet flags; // E = flags & 1 (EndiannessFlag)
unsigned short submessageLength; /* octetsToNextHeader */
};
// Valid constants for the submessageId field are the enumerators
// of the SubmessageKind enum in MessageTypes.h.
// The least-significant bit of "flags" is E, the endianness flag:
// pseudoenum E { BIG_ENDIAN = 0, LITTLE_ENDIAN = 1};
/* Type used to hold fragment numbers. */
struct FragmentNumber_t {
unsigned long value;
};
/* FragmentNumberSet SubmessageElements are used to provide binary
information about individual fragment numbers within a range. */
struct FragmentNumberSet {
FragmentNumber_t bitmapBase;
unsigned long numBits;
LongSeq8 bitmap;
};
/* Provides information on the state of a Reader to a Writer. AckNack
messages are sent by a Reader to one or more Writers. */
struct AckNackSubmessage {
SubmessageHeader smHeader;
// F = smHeader.flags & 2 (FinalFlag)
DCPS::EntityId_t readerId;
DCPS::EntityId_t writerId;
SequenceNumberSet readerSNState;
Count_t count;
};
/* Sent from an RTPS Writer to an RTPS Reader. Indicates to the RTPS
Reader that a range of sequence numbers is no longer relevant. */
struct GapSubmessage {
SubmessageHeader smHeader;
DCPS::EntityId_t readerId;
DCPS::EntityId_t writerId;
SequenceNumber_t gapStart;
SequenceNumberSet gapList;
};
/* Sent from an RTPS Reader to an RTPS Writer. It contains explicit
information on where to send a reply to the Submessages that follow it
within the same message. */
struct InfoReplySubmessage {
SubmessageHeader smHeader;
// M = smHeader.flags & 2 (MulticastFlag)
LocatorList unicastLocatorList;
LocatorList multicastLocatorList; // if M
};
/* The NackFrag Submessage is used to communicate the state of a Reader to a
Writer. */
struct NackFragSubmessage {
SubmessageHeader smHeader;
DCPS::EntityId_t readerId;
DCPS::EntityId_t writerId;
SequenceNumber_t writerSN;
FragmentNumberSet fragmentNumberState;
Count_t count;
};
struct ParticipantProxy_t {
ProtocolVersion_t protocolVersion;
DCPS::GuidPrefix_t guidPrefix; // optional in SPDPdiscoveredParticipantData
VendorId_t vendorId;
boolean expectsInlineQos;
BuiltinEndpointSet_t availableBuiltinEndpoints;
DCPS::LocatorSeq metatrafficUnicastLocatorList;
DCPS::LocatorSeq metatrafficMulticastLocatorList;
DCPS::LocatorSeq defaultMulticastLocatorList;
DCPS::LocatorSeq defaultUnicastLocatorList;
Count_t manualLivelinessCount;
};
// top-level data type for SPDP
struct SPDPdiscoveredParticipantData {
DDS::ParticipantBuiltinTopicData ddsParticipantData;
ParticipantProxy_t participantProxy;
Duration_t leaseDuration;
};
/* Type used to hold data exchanged between Participants.
This is used for the BuiltinParticipantMessage{Writer,Reader}
to implement the Writer Liveliness Protocol (8.4.13). */
struct ParticipantMessageData {
DCPS::GUID_t participantGuid;
DDS::OctetSeq data;
};
// See PARTICIPANT_MESSAGE_DATA_KIND_* constants for the 'kind'
// field of ParticipantMessageData, in MessageTypes.h.
// OMG Specification formal/2010-11-01 DDS-RTPS v2.1
// Section 9.4: "Mapping of the RTPS Messages"
// ======== 9.4.2 SubmessageElements ========
// Many SubmessageElements are already defined in RtpsBaseMessageTypes.idl.
// The others follow directly here.
// Note that we are not doing "typedef Foo_t Foo;" -- no need for it.
// ======== 9.4.4 Header ========
/* All messages should include a leading RTPS Header. */
struct Header {
OctetArray4 prefix;
ProtocolVersion_t version;
VendorId_t vendorId;
DCPS::GuidPrefix_t guidPrefix;
};
// ======== 9.4.5 Submessages ========
/* Sent from an RTPS Writer to an RTPS Reader. Notifies the RTPS Reader of a
change to a data-object belonging to the RTPS Writer */
struct DataSubmessage {
SubmessageHeader smHeader;
// Q = smHeader.flags & 2 (InlineQosFlag)
// D = smHeader.flags & 4 (DataFlag)
// K = smHeader.flags & 8 (KeyFlag)
unsigned short extraFlags;
unsigned short octetsToInlineQos; // used by serializer
DCPS::EntityId_t readerId;
DCPS::EntityId_t writerId;
SequenceNumber_t writerSN;
ParameterList inlineQos; // if Q
// SerializedPayload payload; // if D|K
// These Submessages correspond to the DDS::DCPS::DataSampleHeader,
// so they do not contain any payload data.
};
/* Sent from an RTPS Writer to an RTPS Reader. Extends the Data Submessage
by enabling the serializedData to be fragmented and sent as multiple
DataFrag Submessages. */
struct DataFragSubmessage {
SubmessageHeader smHeader;
// Q = smHeader.flags & 2 (InlineQosFlag)
// K = smHeader.flags & 4 (KeyFlag)
unsigned short extraFlags;
unsigned short octetsToInlineQos; // used by serializer
DCPS::EntityId_t readerId;
DCPS::EntityId_t writerId;
SequenceNumber_t writerSN;
FragmentNumber_t fragmentStartingNum;
unsigned short fragmentsInSubmessage;
unsigned short fragmentSize;
unsigned long sampleSize;
ParameterList inlineQos; // if Q
// SerializedPayload payload; // unconditional
// These Submessages correspond to the DDS::DCPS::DataSampleHeader,
// so they do not contain any payload data.
};
/* Sent from an RTPS Writer to an RTPS Reader to communicate the sequence
numbers of changes that the Writer has available. */
struct HeartBeatSubmessage {
SubmessageHeader smHeader;
// F = smHeader.flags & 2 (FinalFlag)
// L = smHeader.flags & 4 (LivelinessFlag)
DCPS::EntityId_t readerId;
DCPS::EntityId_t writerId;
SequenceNumber_t firstSN;
SequenceNumber_t lastSN;
Count_t count;
};
/* Sent from an RTPS Writer to an RTPS Reader to communicate which fragments
the Writer has available. */
struct HeartBeatFragSubmessage {
SubmessageHeader smHeader;
DCPS::EntityId_t readerId;
DCPS::EntityId_t writerId;
SequenceNumber_t writerSN;
FragmentNumber_t lastFragmentNum;
Count_t count;
};
/* Sent from an RTPS Writer to an RTPS Reader to modify the GuidPrefix used
to interpret the Reader entityIds appearing in the Submessages that follow it. */
struct InfoDestinationSubmessage {
SubmessageHeader smHeader;
DCPS::GuidPrefix_t guidPrefix;
};
/* This message modifies the logical source of the Submessages that follow. */
struct InfoSourceSubmessage {
SubmessageHeader smHeader;
long unused;
ProtocolVersion_t version;
VendorId_t vendorId;
DCPS::GuidPrefix_t guidPrefix;
};
/* This Submessage is used to send a timestamp which applies to the Submessages
that follow within the same message. */
struct InfoTimestampSubmessage {
SubmessageHeader smHeader;
// I = smHeader.flags & 2 (InvalidateFlag)
Timestamp_t timestamp; // if !I (watch the negation)
};
/* The purpose of the Pad Submessage is to allow the introduction of any padding
necessary to meet any desired memory-alignment requirements. Its body is
empty */
struct PadSubmessage {
SubmessageHeader smHeader;
};
/* InfoReplyIp4 is provided for efficiency reasons and can be used instead
of the InfoReply Submessage to provide a more compact representation. */
struct InfoReplyIp4Submessage {
SubmessageHeader smHeader;
// M = smHeader.flags & 2 (MulticastFlag)
LocatorUDPv4_t unicastLocator;
LocatorUDPv4_t multicastLocator; // if M
};
// Security Submessages (0x30-0x3f) don't have a defined structure since
// each plugin can impose its own definitions of CryptoContent/Header/Footer
struct SecuritySubmessage {
SubmessageHeader smHeader;
DDS::OctetSeq content;
};
enum SubmessageKind {
SUBMESSAGE_NONE,
PAD, /* = 0x01, Pad */
RESERVED_2,
RESERVED_3,
RESERVED_4,
RESERVED_5,
ACKNACK, /* = 0x06, AckNack */
HEARTBEAT, /* = 0x07, Heartbeat */
GAP, /* = 0x08, Gap */
INFO_TS, /* = 0x09, InfoTimestamp */
RESERVED_10,
RESERVED_11,
INFO_SRC, /* = 0x0c, InfoSource */
INFO_REPLY_IP4, /* = 0x0d, InfoReplyIp4 */
INFO_DST, /* = 0x0e, InfoDestination */
INFO_REPLY, /* = 0x0f, InfoReply */
RESERVED_16,
RESERVED_17,
NACK_FRAG, /* = 0x12, NackFrag */
HEARTBEAT_FRAG, /* = 0x13, HeartbeatFrag */
RESERVED_20,
DATA, /* = 0x15, Data */
DATA_FRAG, /* = 0x16, DataFrag */
RESERVED_23,
RESERVED_24,
RESERVED_25,
RESERVED_26,
RESERVED_27,
RESERVED_28,
RESERVED_29,
RESERVED_30,
RESERVED_31,
RESERVED_32,
RESERVED_33,
RESERVED_34,
RESERVED_35,
RESERVED_36,
RESERVED_37,
RESERVED_38,
RESERVED_39,
RESERVED_40,
RESERVED_41,
RESERVED_42,
RESERVED_43,
RESERVED_44,
RESERVED_45,
RESERVED_46,
RESERVED_47,
SEC_BODY, // SubmessageKinds 0x30-3f reserved for security
SEC_PREFIX,
SEC_POSTFIX,
SRTPS_PREFIX,
SRTPS_POSTFIX,
RESERVED_53_SECURITY
};
union Submessage switch (SubmessageKind) {
case PAD:
PadSubmessage pad_sm;
case ACKNACK:
AckNackSubmessage acknack_sm;
case HEARTBEAT:
HeartBeatSubmessage heartbeat_sm;
case GAP:
GapSubmessage gap_sm;
case INFO_TS:
InfoTimestampSubmessage info_ts_sm;
case INFO_SRC:
InfoSourceSubmessage info_src_sm;
case INFO_REPLY_IP4:
InfoReplyIp4Submessage info_reply_ipv4_sm;
case INFO_DST:
InfoDestinationSubmessage info_dst_sm;
case INFO_REPLY:
InfoReplySubmessage info_reply_sm;
case NACK_FRAG:
NackFragSubmessage nack_frag_sm;
case HEARTBEAT_FRAG:
HeartBeatFragSubmessage hb_frag_sm;
case DATA:
DataSubmessage data_sm;
case DATA_FRAG:
DataFragSubmessage data_frag_sm;
case SEC_BODY:
case SEC_PREFIX:
case SEC_POSTFIX:
case SRTPS_PREFIX:
case SRTPS_POSTFIX:
SecuritySubmessage security_sm;
default:
SubmessageHeader unknown_sm;
};
typedef sequence<Submessage> SubmessageSeq;
// Section 9.6: "Mapping of the RTPS Protocol"
// ======== 9.6.2 Data for Built-in Endpoints ========
/* The following structs are used for the serializedData of
* the SPDP/SEDP discovery protocol writers & readers.
* They are serialized as a ParameterList, not CDR (see section 9.6.2.2).
* Each of the fields should have a PID_* in Tables 9.12 and 9.13.
*/
// top-level data type for SEDPbuiltinTopics
struct DiscoveredTopicData {
DDS::TopicBuiltinTopicData ddsTopicData;
};
};
};
#endif /* RTPS_RTPSCORE_IDL */