44 #ifndef reda_sequenceNumber_h
45 #include "reda/reda_sequenceNumber.h"
50 #ifndef osapi_system_h
57 #include "cdr/cdr_stream.h"
59 #ifndef netio_common_h
62 #ifndef netio_common_h
65 #ifndef netio_address_h
66 #include "netio/netio_address.h"
69 #include "netio/netio_route.h"
71 #ifndef netio_interface_h
81 #define RTPS_CPP_SUPPORT_METHODS_BASIC(T) \
87 T& operator=(const T& from);\
88 bool operator==(const T& other);\
89 bool operator!=(const T& other);
91 #define RTPS_CPP_SUPPORT_METHODS_BASIC(T)
95 #define RTPS_PATHNAME_LEN_MAX (255)
101 typedef RTI_UINT16 RTPS_ParameterId;
108 #define RTPS_PID_INCOMPATIBLE_MASK (0x4000)
113 #define RTPS_PID_PAD (0x0000)
118 #define RTPS_PID_SENTINEL (0x0001)
126 #define RTPS_PID_TOPIC_NAME (0x0005)
135 #define RTPS_PID_TYPE_NAME (0x0007)
144 #define RTPS_PID_DURABILITY (0x001d)
153 #define RTPS_PID_DESTINATION_ORDER (0x0025)
161 #define RTPS_PID_DEADLINE (0x0023)
170 #define RTPS_PID_LIVELINESS (0x001b)
179 #define RTPS_PID_RELIABILITY (0x001a)
187 #define RTPS_PID_OWNERSHIP (0x001f)
195 #define RTPS_PID_OWNERSHIP_STRENGTH (0x0006)
203 #define RTPS_PID_PROTOCOL_VERSION (0x0015)
211 #define RTPS_PID_VENDOR_ID (0x0016)
215 #define RTPS_PID_USERDATA_IPADDRESS_COUNT_MAX (4)
222 #define RTPS_PID_UNICAST_LOCATOR6 (0x002f)
229 #define RTPS_PID_MULTICAST_LOCATOR6 (0x0030)
236 #define RTPS_PID_DEFAULT_UNICAST_LOCATOR6 (0x0031)
243 #define RTPS_PID_METATRAFFIC_UNICAST_LOCATOR6 (0x0032)
250 #define RTPS_PID_METATRAFFIC_MULTICAST_LOCATOR6 (0x0033)
255 #define RTPS_PID_LEASE_DURATION (0x0002)
262 #define RTPS_PID_PROPERTY_LIST (0x0059)
267 #define RTPS_PID_PARTICIPANT_GUID (0x0050)
272 #define RTPS_PID_PRESENTATION (0x0021)
280 #define RTPS_PID_BUILTIN_ENDPOINT_MASK (0x0058)
285 #define RTPS_PID_ENDPOINT_GUID (0x005A)
290 #define RTPS_PID_ENTITY_NAME (0x0062)
296 #define RTPS_PID_KEY_HASH (0x0070)
299 #define RTPS_KEY_HASH_PARAM_LENGTH (16)
304 #define RTPS_PID_STATUS_INFO (0x0071)
307 #define RTPS_STATUS_INFO_PARAM_LENGTH (4)
310 #define RTPS_PID_SEND_QUEUE_SIZE_DEPRECATED (0x0013)
316 typedef RTI_UINT32 RTPS_HostId;
321 #define RTPS_HOST_ID_UNKNOWN (0x00000000)
326 typedef RTI_UINT32 RTPS_AppId;
331 #define RTPS_APP_ID_UNKNOWN (0x00000000)
336 typedef RTI_UINT32 RTPS_InstanceId;
341 #define RTPS_INSTANCE_ID_UNKNOWN (0x00000000)
346 typedef RTI_UINT32 RTPS_ObjectId;
351 #define RTPS_OBJECT_ID_UNKNOWN (0x00000000)
356 #define RTPS_OBJECT_ID_MAX (0xFFFFFFFF)
365 struct RTPS_GuidPrefix
380 RTPS_InstanceId instance_id ;
386 #define RTPS_GUID_PREFIX_UNKNOWN { \
387 RTPS_HOST_ID_UNKNOWN, \
388 RTPS_APP_ID_UNKNOWN, \
389 RTPS_INSTANCE_ID_UNKNOWN}
394 #define RTPS_GUID_PREFIX_SIZE (12)
402 struct RTPS_GuidPrefix prefix;
405 RTPS_ObjectId object_id;
411 #define RTPS_GUID_UNKNOWN { \
412 RTPS_GUID_PREFIX_UNKNOWN, \
413 RTPS_OBJECT_ID_UNKNOWN}
417 #define RTPS_OBJECT_ID_PARTICIPANT (0x000001C1)
420 #define RTPS_OBJECT_ID_WRITER_SDP_PARTICIPANT (0x000100C2)
423 #define RTPS_OBJECT_ID_WRITER_SDP_PUBLICATION (0x000003C2)
426 #define RTPS_OBJECT_ID_WRITER_SDP_SUBSCRIPTION (0x000004C2)
429 #define RTPS_OBJECT_ID_READER_SDP_PARTICIPANT (0x000100C7)
432 #define RTPS_OBJECT_ID_READER_SDP_PUBLICATION (0x000003C7)
435 #define RTPS_OBJECT_ID_READER_SDP_SUBSCRIPTION (0x000004C7)
439 #define RTPS_KEY_HASH_MAX_LENGTH 16
445 RTI_UINT8 value[RTPS_KEY_HASH_MAX_LENGTH];
452 #define RTPS_KEY_HASH_NIL {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
455 #define RTPS_KEY_HASH_DEFAULT { \
457 RTPS_KEY_HASH_MAX_LENGTH\
469 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
470 RTPS_Guid_equals(
struct RTPS_Guid *a,
struct RTPS_Guid *b);
480 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
481 RTPS_Guid_prefix_equals(
483 struct RTPS_Guid *b);
493 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
494 RTPS_Guid_suffix_equals(
496 struct RTPS_Guid *b);
500 typedef RTI_UINT16 RTPS_ProtocolVersion_T;
503 #define RTPS_PROTOCOL_VERSION_MAJOR (0x02)
506 #define RTPS_PROTOCOL_VERSION_MINOR (0x01)
509 typedef RTI_UINT16 RTPS_VendorId;
512 #define RTPS_VENDOR_ID_MAJOR (0x01)
515 #define RTPS_VENDOR_ID_MINOR (0x0A)
518 #define RTPS_VENDOR_ID_RTI_DDS (0x0101)
521 #define RTPS_VENDOR_ID_RTI_MICRO (0x010A)
531 RTPS_VendorId_get_major(RTPS_VendorId *me);
541 RTPS_VendorId_get_minor(RTPS_VendorId *me);
545 typedef RTI_UINT32 RTPS_StatusInfo;
548 #define RTPS_NO_STATUS_INFO (0x00000000)
551 #define RTPS_DISPOSE_STATUS_INFO (0x00000001)
554 #define RTPS_UNREGISTER_STATUS_INFO (0X00000002)
557 #define RTPS_ENDIAN_FLAG (0x01)
572 RTPS_OBJECT_NORMAL_USER_UNKNOWN = 0x00,
573 RTPS_OBJECT_NORMAL_USER_APPLICATION = 0x01,
575 RTPS_OBJECT_NORMAL_USER_CST_WRITER = 0x02,
577 RTPS_OBJECT_NORMAL_USER_PUBLICATION = 0x03,
579 RTPS_OBJECT_NORMAL_USER_SUBSCRIPTION = 0x04,
581 RTPS_OBJECT_NORMAL_USER_CST_READER = 0x07,
582 RTPS_OBJECT_NORMAL_USER_VIRTUAL_SUBSCRIPTION = 0x3C,
583 RTPS_OBJECT_NORMAL_USER_VIRTUAL_CST_READER = 0x3D,
584 RTPS_OBJECT_RESERVED_USER_UNKNOWN = 0x40,
585 RTPS_OBJECT_RESERVED_USER_APPLICATION = 0x41,
586 RTPS_OBJECT_RESERVED_USER_CST_WRITER = 0x42,
587 RTPS_OBJECT_RESERVED_USER_PUBLICATION = 0x43,
588 RTPS_OBJECT_RESERVED_USER_SUBSCRIPTION = 0x44,
589 RTPS_OBJECT_RESERVED_USER_CST_READER = 0x47,
590 RTPS_OBJECT_NORMAL_META_UNKNOWN = 0x80,
591 RTPS_OBJECT_NORMAL_META_APPLICATION = 0x81,
592 RTPS_OBJECT_NORMAL_META_CST_WRITER = 0x82,
593 RTPS_OBJECT_NORMAL_META_PUBLICATION = 0x83,
594 RTPS_OBJECT_NORMAL_META_SUBSCRIPTION = 0x84,
595 RTPS_OBJECT_NORMAL_META_CST_READER = 0x87,
596 RTPS_OBJECT_RESERVED_META_UNKNOWN = 0xc0,
597 RTPS_OBJECT_RESERVED_META_APPLICATION = 0xc1,
598 RTPS_OBJECT_RESERVED_META_CST_WRITER = 0xc2,
599 RTPS_OBJECT_RESERVED_META_PUBLICATION = 0xc3,
600 RTPS_OBJECT_RESERVED_META_SUBSCRIPTION = 0xc4,
601 RTPS_OBJECT_RESERVED_META_CST_READER = 0xc7
609 #define RTPS_LOCATOR_ADDRESS_LENGTH_MAX 16
614 #define RTPS_LOCATOR_ADDRESS_UDPV4_OFFSET 12
617 struct RTPS_Locator_t
626 RTI_UINT8 address[RTPS_LOCATOR_ADDRESS_LENGTH_MAX];
630 #define RTPS_LOCATOR_DEFAULT_KIND (-1)
633 #define RTPS_LOCATOR_DEFAULT {\
634 RTPS_LOCATOR_DEFAULT_KIND, \
636 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} \
640 #define RTPS_Locator RTPS_Locator_t
643 struct RTPS_LocatorUdpv4_t
656 #define RTPS_LOCATOR_UDPV4_DEFAULT {\
657 RTPS_LOCATOR_DEFAULT_KIND, \
663 extern RTPSDllVariable
const struct RTPS_Locator_t RTPS_LOCATOR_INVALID;
666 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_INVALID;
669 extern RTPSDllVariable
const RTI_UINT32 RTPS_LOCATOR_PORT_INVALID;
672 extern RTPSDllVariable
const RTI_UINT8
673 RTPS_LOCATOR_ADDRESS_INVALID[RTPS_LOCATOR_ADDRESS_LENGTH_MAX];
676 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_UDPv4;
679 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_UDPv6;
682 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_RESERVED;
685 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_SHMEM;
706 RTPS_SequenceNumber_deserialize(
char **src_buffer,
707 struct REDA_SequenceNumber *instance,
720 MUST_CHECK_RETURN RTPSDllExport RTI_INT32
721 RTPS_SequenceNumber_get_distance(
722 const struct REDA_SequenceNumber *s1,
723 const struct REDA_SequenceNumber *s2);
728 #define RTPS_BITMAP_32BITS_ARRAY_SIZE_MAX (8)
740 struct REDA_SequenceNumber lead;
759 RTI_UINT32 bits[RTPS_BITMAP_32BITS_ARRAY_SIZE_MAX];
763 #define RTPS_BITMAP_SIZE_MAX (256)
766 #define RTPS_BITMAP_DISTANCE_MAX (0x7FFFFFFF)
780 struct RTPS_Bitmap *me,
781 const struct REDA_SequenceNumber *sn,
782 RTI_INT32 bit_count);
799 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
800 RTPS_Bitmap_set_bit(
struct RTPS_Bitmap *me,
802 const struct REDA_SequenceNumber *num,
820 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
822 const struct RTPS_Bitmap *me,
824 const struct REDA_SequenceNumber *num);
838 SHOULD_CHECK_RETURN RTPSDllExport RTI_BOOL
839 RTPS_Bitmap_get_first_bit(
840 const struct RTPS_Bitmap *me,
841 struct REDA_SequenceNumber *position,
842 RTI_BOOL search_bit);
856 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
857 RTPS_Bitmap_get_last_bit(
858 const struct RTPS_Bitmap *me,
859 struct REDA_SequenceNumber *position,
860 RTI_BOOL search_bit);
873 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
875 struct RTPS_Bitmap *me,
876 const struct REDA_SequenceNumber *first_seq_num,
877 const struct REDA_SequenceNumber *last_seq_num,
895 struct RTPS_Bitmap *me,
896 const struct RTPS_Bitmap *source);
910 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
911 RTPS_Bitmap_shift(
struct RTPS_Bitmap *me,
912 const struct REDA_SequenceNumber *seq_num);
922 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
923 RTPS_Bitmap_get_unreserved_count(
struct RTPS_Bitmap *me,
924 const struct REDA_SequenceNumber *seq_num);
940 RTPS_Bitmap_truncate(
941 struct RTPS_Bitmap *me,
942 const struct REDA_SequenceNumber *seq_num);
955 RTPS_Bitmap_invert(
struct RTPS_Bitmap *me);
974 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
975 RTPS_Bitmap_deserialize(
976 struct RTPS_Bitmap *me,
977 const char **stream_ptr,
978 RTI_UINT32 max_bits_len,
979 RTI_BOOL need_byte_swap);
992 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
994 struct CDR_Stream_t *stream,
995 const struct RTPS_Guid *guid,
1008 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
1009 RTPS_Guid_deserialize(
1010 struct CDR_Stream_t *stream,
1011 struct RTPS_Guid *guid,
1022 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1023 RTPS_Guid_get_max_size_serialized(RTI_UINT32 size);
1036 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
1037 RTPS_serialize_ntp_time(
1038 struct CDR_Stream_t *stream,
1052 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
1053 RTPS_deserialize_ntp_time(
1054 struct CDR_Stream_t *stream,
1066 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1067 RTPS_get_ntp_time_max_size_serialized(RTI_UINT32 size);
1080 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
1081 RTPS_serialize_2_octets(
1082 struct CDR_Stream_t *stream,
1083 const RTI_UINT16 * in,
1096 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
1097 RTPS_deserialize_2_octets(
1098 struct CDR_Stream_t *stream,
1110 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1111 RTPS_get_2_octets_max_size_serialized(RTI_UINT32 size);
1124 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
1125 RTPS_serialize_ipv6_locator(
1126 struct CDR_Stream_t *stream,
1127 const struct RTPS_Locator_t *loc,
1140 MUST_CHECK_RETURN RTPSDllExport RTI_BOOL
1141 RTPS_deserialize_ipv6_locator(
1142 struct CDR_Stream_t *stream,
1143 struct RTPS_Locator_t *loc,
1154 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1155 RTPS_get_ipv6_locator_max_size_serialized(RTI_UINT32 size);
1168 RTPS_Epoch_deserialize(REDA_Epoch_T * me,
1169 const char **stream,
1170 RTI_BOOL need_byte_swap);
1174 typedef struct NETIO_Guid RTPS_GUID;
1177 typedef struct NETIO_GuidPrefix RTPS_GuidPrefix_T;
1180 typedef struct NETIO_GuidEntity RTPS_Entity_T;
1183 #define RTPS_GUIDPREFIX_UNKNOWN {{0,0,0,0,0,0,0,0,0,0,0,0}}
1186 #define RTPS_ENTITY_UNKNOWN {{0,0,0,0}}
1196 RTI_UINT32 fractions;
1207 struct RTPS_ProtocolVersion
1226 struct RTPS_ProtocolVersion protocol_version;
1229 struct RTPS_Vendor vendor_id;
1232 RTPS_GuidPrefix_T guid_prefix;
1236 #ifdef RTI_ENDIAN_LITTLE
1237 #define VALID_RTPS_HEADER 0x53505452
1239 #define VALID_RTPS_HEADER 0x52545053
1246 #define RTPS_PAD_KIND (0x01)
1249 #define RTPS_ACKNACK_KIND (0x06)
1252 #define RTPS_HEARTBEAT_KIND (0x07)
1255 #define RTPS_GAP_KIND (0x08)
1258 #define RTPS_INFO_TS_KIND (0x09)
1261 #define RTPS_INFO_SRC_KIND (0x0c)
1264 #define RTPS_INFO_REPLY_IP4_KIND (0x0d)
1267 #define RTPS_INFO_DST_KIND (0x0e)
1270 #define RTPS_INFO_REPLY_KIND (0x0f)
1273 #define RTPS_DATA_KIND (0x15)
1276 #define RTPS_DATA_BATCH_KIND (0x18)
1279 #define RTPS_HEARTBEAT_BATCH_KIND (0x19)
1282 #define RTPS_SUBMESSAGE_HEADER_LENGTH 4
1290 struct RTPS_SubmsgHdr
1303 #define RTPS_SUBMSG_FLAG_E 0x1
1310 struct RTPS_SubmsgHdr hdr;
1313 RTPS_Entity_T reader;
1316 RTPS_Entity_T writer;
1319 struct RTPS_Bitmap bitmap;
1326 #define RTPS_ACKNACKFLAGS_F 0x2
1338 struct RTPS_SubmsgHdr hdr;
1344 RTI_UINT16 qos_offset;
1347 RTPS_Entity_T reader;
1350 RTPS_Entity_T writer;
1353 struct REDA_SequenceNumber sn;
1357 #define RTPS_FLAGS_NONE 0x0
1360 #define RTPS_DATAFLAGS_Q 0x2
1363 #define RTPS_DATAFLAGS_D 0x4
1366 #define RTPS_DATAFLAGS_K 0x8
1369 #define RTPS_DATA_INLINEQOS_OFFSET 16
1378 struct RTPS_DATA_BATCH
1381 struct RTPS_SubmsgHdr hdr;
1387 RTI_UINT16 qos_offset;
1390 RTPS_Entity_T reader;
1393 RTPS_Entity_T writer;
1396 struct REDA_SequenceNumber batch_sn;
1399 struct REDA_SequenceNumber first_sample_sn;
1402 RTI_UINT32 offset_last_sn;
1405 RTI_UINT32 batch_sample_count;
1408 RTI_UINT32 encapsulation_offset;
1412 #define RTPS_DATABATCHFLAGS_T 0x1
1415 #define RTPS_DATABATCHFLAGS_Q 0x2
1418 #define RTPS_DATABATCHFLAGS_O 0x4
1421 #define RTPS_DATABATCHFLAGS_D 0x8
1424 #define RTPS_DATABATCHFLAGS_I 0x10
1427 #define RTPS_DATABATCHFLAGS_K 0x20
1434 struct RTPS_SubmsgHdr hdr;
1437 RTPS_Entity_T reader;
1440 RTPS_Entity_T writer;
1443 struct REDA_SequenceNumber sn_start;
1446 struct RTPS_Bitmap bitmap;
1451 struct RTPS_HEARTBEAT
1454 struct RTPS_SubmsgHdr hdr;
1457 RTPS_Entity_T reader;
1460 RTPS_Entity_T writer;
1463 struct REDA_SequenceNumber sn_first;
1466 struct REDA_SequenceNumber sn_last;
1474 struct RTPS_HEARTBEAT_BATCH
1477 struct RTPS_SubmsgHdr hdr;
1480 RTPS_Entity_T reader;
1483 RTPS_Entity_T writer;
1486 struct REDA_SequenceNumber sn_batch_first;
1489 struct REDA_SequenceNumber sn_batch_last;
1492 struct REDA_SequenceNumber sn_first;
1495 struct REDA_SequenceNumber sn_last;
1502 #define RTPS_HBFLAGS_F 0x02
1505 #define RTPS_HBFLAGS_L 0x04
1509 struct RTPS_INFO_DST
1512 struct RTPS_SubmsgHdr hdr;
1515 RTPS_GuidPrefix_T guid_prefix;
1523 struct RTPS_SubmsgHdr hdr;
1526 struct RTPS_Time timestamp;
1530 #define RTPS_INFO_TSFLAGS_I (0x2)
1541 struct RTPS_SubmsgHdr submsg;
1544 struct RTPS_Header header;
1547 struct RTPS_DATA data;
1550 struct RTPS_DATA_BATCH data_batch;
1553 struct RTPS_GAP gap;
1556 struct RTPS_HEARTBEAT hb;
1559 struct RTPS_HEARTBEAT_BATCH hb_batch;
1562 struct RTPS_ACKNACK acknack;
1565 struct RTPS_INFO_TS info_ts;
1568 struct RTPS_INFO_DST info_dst;
1576 RTPS_INTERFACEMODE_UNDEFINED,
1579 RTPS_INTERFACEMODE_WRITER,
1582 RTPS_INTERFACEMODE_READER,
1585 RTPS_INTERFACEMODE_EXTERNAL_RECEIVER
1586 } RTPS_InterfaceMode_t;
1589 struct RTPS_InterfaceProperty
1592 struct NETIO_InterfaceProperty _parent;
1595 RTPS_InterfaceMode_t mode;
1598 struct NETIO_Address intf_address;
1601 RTI_INT32 max_peer_count;
1618 RTI_SIZE_T samples_per_hb;
1621 RTI_UINT32 max_window_size;
1632 RTI_INT32 max_hb_retries;
1635 RTI_INT32 max_samples;
1636 #if OSAPI_ENABLE_TRACE
1637 const char *session_name;
1641 #if OSAPI_ENABLE_TRACE
1642 #define RTPS_SESSION_NAME_INIT ,NULL
1644 #define RTPS_SESSION_NAME_INIT
1648 #define RTPS_RETRIES_UNLIMITED (-1)
1651 #define RTPS_RECEIVE_WINDOW_MAX_SIZE (256)
1654 #define RTPS_InterfaceProperty_INITIALIZER \
1656 NETIO_InterfaceProperty_INITIALIZER,\
1657 RTPS_INTERFACEMODE_UNDEFINED,\
1658 NETIO_Address_INITIALIZER, \
1665 RTPS_RETRIES_UNLIMITED, \
1667 RTPS_SESSION_NAME_INIT \
1671 struct RTPS_RouteProperty
1674 struct NETIORouteProperty _parent;
1682 struct REDA_SequenceNumber first_sn;
1687 struct REDA_SequenceNumber last_sn;
1692 struct REDA_SequenceNumber last_acked_sn;
1696 #define RTPSRouteProperty_INITIALIZER \
1698 NETIORouteProperty_INITIALIZER, \
1700 REDA_SEQUENCE_NUMBER_ZERO,\
1701 REDA_SEQUENCE_NUMBER_ZERO, \
1702 REDA_SEQUENCE_NUMBER_ZERO \
1708 MUST_CHECK_RETURN RTPSDllExport
struct RT_ComponentFactoryI*
1709 RTPS_InterfaceFactory_get_interface(
void);