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_DEADLINE (0x0023)
162 #define RTPS_PID_LIVELINESS (0x001b)
171 #define RTPS_PID_RELIABILITY (0x001a)
179 #define RTPS_PID_OWNERSHIP (0x001f)
187 #define RTPS_PID_OWNERSHIP_STRENGTH (0x0006)
195 #define RTPS_PID_PROTOCOL_VERSION (0x0015)
203 #define RTPS_PID_VENDOR_ID (0x0016)
207 #define RTPS_PID_USERDATA_IPADDRESS_COUNT_MAX (4)
214 #define RTPS_PID_UNICAST_LOCATOR6 (0x002f)
221 #define RTPS_PID_MULTICAST_LOCATOR6 (0x0030)
228 #define RTPS_PID_DEFAULT_UNICAST_LOCATOR6 (0x0031)
235 #define RTPS_PID_METATRAFFIC_UNICAST_LOCATOR6 (0x0032)
242 #define RTPS_PID_METATRAFFIC_MULTICAST_LOCATOR6 (0x0033)
247 #define RTPS_PID_LEASE_DURATION (0x0002)
254 #define RTPS_PID_PROPERTY_LIST (0x0059)
259 #define RTPS_PID_PARTICIPANT_GUID (0x0050)
267 #define RTPS_PID_BUILTIN_ENDPOINT_MASK (0x0058)
272 #define RTPS_PID_ENDPOINT_GUID (0x005A)
277 #define RTPS_PID_ENTITY_NAME (0x0062)
283 #define RTPS_PID_KEY_HASH (0x0070)
286 #define RTPS_KEY_HASH_PARAM_LENGTH (16)
291 #define RTPS_PID_STATUS_INFO (0x0071)
294 #define RTPS_STATUS_INFO_PARAM_LENGTH (4)
297 #define RTPS_PID_SEND_QUEUE_SIZE_DEPRECATED (0x0013)
303 typedef RTI_UINT32 RTPS_HostId;
308 #define RTPS_HOST_ID_UNKNOWN (0x00000000)
313 typedef RTI_UINT32 RTPS_AppId;
318 #define RTPS_APP_ID_UNKNOWN (0x00000000)
323 typedef RTI_UINT32 RTPS_InstanceId;
328 #define RTPS_INSTANCE_ID_UNKNOWN (0x00000000)
333 typedef RTI_UINT32 RTPS_ObjectId;
338 #define RTPS_OBJECT_ID_UNKNOWN (0x00000000)
343 #define RTPS_OBJECT_ID_MAX (0xFFFFFFFF)
352 struct RTPS_GuidPrefix
367 RTPS_InstanceId instance_id ;
373 #define RTPS_GUID_PREFIX_UNKNOWN { \
374 RTPS_HOST_ID_UNKNOWN, \
375 RTPS_APP_ID_UNKNOWN, \
376 RTPS_INSTANCE_ID_UNKNOWN}
381 #define RTPS_GUID_PREFIX_SIZE (12)
389 struct RTPS_GuidPrefix prefix;
392 RTPS_ObjectId object_id;
398 #define RTPS_GUID_UNKNOWN { \
399 RTPS_GUID_PREFIX_UNKNOWN, \
400 RTPS_OBJECT_ID_UNKNOWN}
404 #define RTPS_OBJECT_ID_PARTICIPANT (0x000001C1)
407 #define RTPS_OBJECT_ID_WRITER_SDP_PARTICIPANT (0x000100C2)
410 #define RTPS_OBJECT_ID_WRITER_SDP_PUBLICATION (0x000003C2)
413 #define RTPS_OBJECT_ID_WRITER_SDP_SUBSCRIPTION (0x000004C2)
416 #define RTPS_OBJECT_ID_READER_SDP_PARTICIPANT (0x000100C7)
419 #define RTPS_OBJECT_ID_READER_SDP_PUBLICATION (0x000003C7)
422 #define RTPS_OBJECT_ID_READER_SDP_SUBSCRIPTION (0x000004C7)
426 #define RTPS_KEY_HASH_MAX_LENGTH 16
432 RTI_UINT8 value[RTPS_KEY_HASH_MAX_LENGTH];
439 #define RTPS_KEY_HASH_NIL {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
442 #define RTPS_KEY_HASH_DEFAULT { \
444 RTPS_KEY_HASH_MAX_LENGTH\
456 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
457 RTPS_Guid_equals(
struct RTPS_Guid *a,
struct RTPS_Guid *b);
467 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
468 RTPS_Guid_prefix_equals(
470 struct RTPS_Guid *b);
480 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
481 RTPS_Guid_suffix_equals(
483 struct RTPS_Guid *b);
487 typedef RTI_UINT16 RTPS_ProtocolVersion_T;
490 #define RTPS_PROTOCOL_VERSION_MAJOR (0x02)
493 #define RTPS_PROTOCOL_VERSION_MINOR (0x01)
496 typedef RTI_UINT16 RTPS_VendorId;
499 #define RTPS_VENDOR_ID_MAJOR (0x01)
502 #define RTPS_VENDOR_ID_MINOR (0x0A)
505 #define RTPS_VENDOR_ID_RTI_DDS (0x0101)
508 #define RTPS_VENDOR_ID_RTI_MICRO (0x010A)
518 RTPS_VendorId_get_major(RTPS_VendorId *me);
528 RTPS_VendorId_get_minor(RTPS_VendorId *me);
532 typedef RTI_UINT32 RTPS_StatusInfo;
535 #define RTPS_NO_STATUS_INFO (0x00000000)
538 #define RTPS_DISPOSE_STATUS_INFO (0x00000001)
541 #define RTPS_UNREGISTER_STATUS_INFO (0X00000002)
544 #define RTPS_ENDIAN_FLAG (0x01)
559 RTPS_OBJECT_NORMAL_USER_UNKNOWN = 0x00,
560 RTPS_OBJECT_NORMAL_USER_APPLICATION = 0x01,
562 RTPS_OBJECT_NORMAL_USER_CST_WRITER = 0x02,
564 RTPS_OBJECT_NORMAL_USER_PUBLICATION = 0x03,
566 RTPS_OBJECT_NORMAL_USER_SUBSCRIPTION = 0x04,
568 RTPS_OBJECT_NORMAL_USER_CST_READER = 0x07,
569 RTPS_OBJECT_NORMAL_USER_VIRTUAL_SUBSCRIPTION = 0x3C,
570 RTPS_OBJECT_NORMAL_USER_VIRTUAL_CST_READER = 0x3D,
571 RTPS_OBJECT_RESERVED_USER_UNKNOWN = 0x40,
572 RTPS_OBJECT_RESERVED_USER_APPLICATION = 0x41,
573 RTPS_OBJECT_RESERVED_USER_CST_WRITER = 0x42,
574 RTPS_OBJECT_RESERVED_USER_PUBLICATION = 0x43,
575 RTPS_OBJECT_RESERVED_USER_SUBSCRIPTION = 0x44,
576 RTPS_OBJECT_RESERVED_USER_CST_READER = 0x47,
577 RTPS_OBJECT_NORMAL_META_UNKNOWN = 0x80,
578 RTPS_OBJECT_NORMAL_META_APPLICATION = 0x81,
579 RTPS_OBJECT_NORMAL_META_CST_WRITER = 0x82,
580 RTPS_OBJECT_NORMAL_META_PUBLICATION = 0x83,
581 RTPS_OBJECT_NORMAL_META_SUBSCRIPTION = 0x84,
582 RTPS_OBJECT_NORMAL_META_CST_READER = 0x87,
583 RTPS_OBJECT_RESERVED_META_UNKNOWN = 0xc0,
584 RTPS_OBJECT_RESERVED_META_APPLICATION = 0xc1,
585 RTPS_OBJECT_RESERVED_META_CST_WRITER = 0xc2,
586 RTPS_OBJECT_RESERVED_META_PUBLICATION = 0xc3,
587 RTPS_OBJECT_RESERVED_META_SUBSCRIPTION = 0xc4,
588 RTPS_OBJECT_RESERVED_META_CST_READER = 0xc7
596 #define RTPS_LOCATOR_ADDRESS_LENGTH_MAX 16
601 #define RTPS_LOCATOR_ADDRESS_UDPV4_OFFSET 12
604 struct RTPS_Locator_t
613 RTI_UINT8 address[RTPS_LOCATOR_ADDRESS_LENGTH_MAX];
615 RTPS_CPP_SUPPORT_METHODS_BASIC(RTPS_Locator_t)
619 #define RTPS_LOCATOR_DEFAULT_KIND (-1)
622 #define RTPS_LOCATOR_DEFAULT {\
623 RTPS_LOCATOR_DEFAULT_KIND, \
625 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} \
629 #define RTPS_Locator RTPS_Locator_t
632 struct RTPS_LocatorUdpv4_t
645 #define RTPS_LOCATOR_UDPV4_DEFAULT {\
646 RTPS_LOCATOR_DEFAULT_KIND, \
652 extern RTPSDllVariable
const struct RTPS_Locator_t RTPS_LOCATOR_INVALID;
655 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_INVALID;
658 extern RTPSDllVariable
const RTI_UINT32 RTPS_LOCATOR_PORT_INVALID;
661 extern RTPSDllVariable
const RTI_UINT8
662 RTPS_LOCATOR_ADDRESS_INVALID[RTPS_LOCATOR_ADDRESS_LENGTH_MAX];
665 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_UDPv4;
668 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_UDPv6;
671 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_RESERVED;
674 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_SHMEM;
695 RTPS_SequenceNumber_deserialize(
char **src_buffer,
696 struct REDA_SequenceNumber *instance,
709 MUST_CHECK_RETURN RTPSDllExport RTI_INT32
710 RTPS_SequenceNumber_get_distance(
711 const struct REDA_SequenceNumber *s1,
712 const struct REDA_SequenceNumber *s2);
717 #define RTPS_BITMAP_32BITS_ARRAY_SIZE_MAX (8)
729 struct REDA_SequenceNumber lead;
748 RTI_UINT32 bits[RTPS_BITMAP_32BITS_ARRAY_SIZE_MAX];
752 #define RTPS_BITMAP_SIZE_MAX (256)
755 #define RTPS_BITMAP_DISTANCE_MAX (0x7FFFFFFF)
769 struct RTPS_Bitmap *me,
770 const struct REDA_SequenceNumber *sn,
771 RTI_INT32 bit_count);
788 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
789 RTPS_Bitmap_set_bit(
struct RTPS_Bitmap *me,
791 const struct REDA_SequenceNumber *num,
809 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
811 const struct RTPS_Bitmap *me,
813 const struct REDA_SequenceNumber *num);
827 SHOULD_CHECK_RETURN RTPSDllExport
RTI_BOOL
828 RTPS_Bitmap_get_first_bit(
829 const struct RTPS_Bitmap *me,
830 struct REDA_SequenceNumber *position,
845 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
846 RTPS_Bitmap_get_last_bit(
847 const struct RTPS_Bitmap *me,
848 struct REDA_SequenceNumber *position,
862 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
864 struct RTPS_Bitmap *me,
865 const struct REDA_SequenceNumber *first_seq_num,
866 const struct REDA_SequenceNumber *last_seq_num,
884 struct RTPS_Bitmap *me,
885 const struct RTPS_Bitmap *source);
899 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
901 struct RTPS_Bitmap *me,
902 const struct REDA_SequenceNumber *seq_num);
918 RTPS_Bitmap_truncate(
919 struct RTPS_Bitmap *me,
920 const struct REDA_SequenceNumber *seq_num);
933 RTPS_Bitmap_invert(
struct RTPS_Bitmap *me);
952 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
953 RTPS_Bitmap_deserialize(
954 struct RTPS_Bitmap *me,
955 const char **stream_ptr,
956 RTI_UINT32 max_bits_len,
970 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
972 struct CDR_Stream_t *stream,
973 const struct RTPS_Guid *guid,
986 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
987 RTPS_Guid_deserialize(
988 struct CDR_Stream_t *stream,
989 struct RTPS_Guid *guid,
1000 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1001 RTPS_Guid_get_max_size_serialized(RTI_UINT32 size);
1014 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1015 RTPS_serialize_ntp_time(
1016 struct CDR_Stream_t *stream,
1030 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1031 RTPS_deserialize_ntp_time(
1032 struct CDR_Stream_t *stream,
1044 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1045 RTPS_get_ntp_time_max_size_serialized(RTI_UINT32 size);
1058 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1059 RTPS_serialize_2_octets(
1060 struct CDR_Stream_t *stream,
1061 const RTI_UINT16 * in,
1074 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1075 RTPS_deserialize_2_octets(
1076 struct CDR_Stream_t *stream,
1088 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1089 RTPS_get_2_octets_max_size_serialized(RTI_UINT32 size);
1102 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1103 RTPS_serialize_ipv6_locator(
1104 struct CDR_Stream_t *stream,
1105 const struct RTPS_Locator_t *loc,
1118 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1119 RTPS_deserialize_ipv6_locator(
1120 struct CDR_Stream_t *stream,
1121 struct RTPS_Locator_t *loc,
1132 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1133 RTPS_get_ipv6_locator_max_size_serialized(RTI_UINT32 size);
1146 RTPS_Epoch_deserialize(REDA_Epoch_T * me,
1147 const char **stream,
1152 typedef struct NETIO_Guid RTPS_GUID;
1155 typedef struct NETIO_GuidPrefix RTPS_GuidPrefix_T;
1158 typedef struct NETIO_GuidEntity RTPS_Entity_T;
1161 #define RTPS_GUIDPREFIX_UNKNOWN {{0,0,0,0,0,0,0,0,0,0,0,0}}
1164 #define RTPS_ENTITY_UNKNOWN {{0,0,0,0}}
1174 RTI_UINT32 fractions;
1185 struct RTPS_ProtocolVersion
1204 struct RTPS_ProtocolVersion protocol_version;
1207 struct RTPS_Vendor vendor_id;
1210 RTPS_GuidPrefix_T guid_prefix;
1214 #ifdef RTI_ENDIAN_LITTLE
1215 #define VALID_RTPS_HEADER 0x53505452
1217 #define VALID_RTPS_HEADER 0x52545053
1224 #define RTPS_PAD_KIND (0x01)
1227 #define RTPS_ACKNACK_KIND (0x06)
1230 #define RTPS_HEARTBEAT_KIND (0x07)
1233 #define RTPS_GAP_KIND (0x08)
1236 #define RTPS_INFO_TS_KIND (0x09)
1239 #define RTPS_INFO_SRC_KIND (0x0c)
1242 #define RTPS_INFO_REPLY_IP4_KIND (0x0d)
1245 #define RTPS_INFO_DST_KIND (0x0e)
1248 #define RTPS_INFO_REPLY_KIND (0x0f)
1251 #define RTPS_DATA_KIND (0x15)
1254 #define RTPS_LARGEST_SUBMSG_KIND RTPS_DATA_KIND
1257 #define RTPS_SUBMESSAGE_HEADER_LENGTH 4
1266 struct RTPS_SubmsgHdr
1279 #define RTPS_SUBMSG_FLAG_E 0x1
1286 struct RTPS_SubmsgHdr hdr;
1289 RTPS_Entity_T reader;
1292 RTPS_Entity_T writer;
1295 struct RTPS_Bitmap bitmap;
1302 #define RTPS_ACKNACKFLAGS_F 0x2
1314 struct RTPS_SubmsgHdr hdr;
1320 RTI_UINT16 qos_offset;
1323 RTPS_Entity_T reader;
1326 RTPS_Entity_T writer;
1329 struct REDA_SequenceNumber sn;
1333 #define RTPS_FLAGS_NONE 0x0
1336 #define RTPS_DATAFLAGS_Q 0x2
1339 #define RTPS_DATAFLAGS_D 0x4
1342 #define RTPS_DATAFLAGS_K 0x8
1345 #define RTPS_DATA_INLINEQOS_OFFSET 16
1352 struct RTPS_SubmsgHdr hdr;
1355 RTPS_Entity_T reader;
1358 RTPS_Entity_T writer;
1361 struct REDA_SequenceNumber sn_start;
1364 struct RTPS_Bitmap bitmap;
1369 struct RTPS_HEARTBEAT
1372 struct RTPS_SubmsgHdr hdr;
1375 RTPS_Entity_T reader;
1378 RTPS_Entity_T writer;
1381 struct REDA_SequenceNumber sn_first;
1384 struct REDA_SequenceNumber sn_last;
1391 #define RTPS_HBFLAGS_F 0x02
1394 #define RTPS_HBFLAGS_L 0x04
1398 struct RTPS_INFO_DST
1401 struct RTPS_SubmsgHdr hdr;
1404 RTPS_GuidPrefix_T guid_prefix;
1412 struct RTPS_SubmsgHdr hdr;
1415 struct RTPS_Time timestamp;
1419 #define RTPS_INFO_TSFLAGS_I (0x2)
1430 struct RTPS_SubmsgHdr submsg;
1433 struct RTPS_Header header;
1436 struct RTPS_DATA data;
1439 struct RTPS_GAP gap;
1442 struct RTPS_HEARTBEAT hb;
1445 struct RTPS_ACKNACK acknack;
1448 struct RTPS_INFO_TS info_ts;
1451 struct RTPS_INFO_DST info_dst;
1459 RTPS_INTERFACEMODE_UNDEFINED,
1462 RTPS_INTERFACEMODE_WRITER,
1465 RTPS_INTERFACEMODE_READER,
1468 RTPS_INTERFACEMODE_EXTERNAL_RECEIVER
1469 } RTPS_InterfaceMode_t;
1472 struct RTPS_InterfaceProperty
1475 struct NETIO_InterfaceProperty _parent;
1478 RTPS_InterfaceMode_t mode;
1481 struct NETIO_Address intf_address;
1484 RTI_INT32 max_peer_count;
1501 RTI_SIZE_T samples_per_hb;
1504 RTI_UINT32 max_window_size;
1515 RTI_INT32 max_hb_retries;
1518 RTI_INT32 max_samples;
1519 #if OSAPI_ENABLE_TRACE
1520 const char *session_name;
1524 #if OSAPI_ENABLE_TRACE
1525 #define RTPS_SESSION_NAME_INIT ,NULL
1527 #define RTPS_SESSION_NAME_INIT
1531 #define RTPS_RETRIES_UNLIMITED (-1)
1534 #define RTPS_RECEIVE_WINDOW_MAX_SIZE (256)
1537 #define RTPS_InterfaceProperty_INITIALIZER \
1539 NETIO_InterfaceProperty_INITIALIZER,\
1540 RTPS_INTERFACEMODE_UNDEFINED,\
1541 NETIO_Address_INITIALIZER, \
1548 RTPS_RETRIES_UNLIMITED, \
1550 RTPS_SESSION_NAME_INIT \
1554 struct RTPS_RouteProperty
1557 struct NETIORouteProperty _parent;
1565 struct REDA_SequenceNumber first_sn;
1570 struct REDA_SequenceNumber last_sn;
1575 struct REDA_SequenceNumber last_acked_sn;
1579 #define RTPSRouteProperty_INITIALIZER \
1581 NETIORouteProperty_INITIALIZER, \
1583 REDA_SEQUENCE_NUMBER_ZERO,\
1584 REDA_SEQUENCE_NUMBER_ZERO, \
1585 REDA_SEQUENCE_NUMBER_ZERO \
1591 MUST_CHECK_RETURN RTPSDllExport
struct RT_ComponentFactoryI*
1592 RTPS_InterfaceFactory_get_interface(
void);