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];
617 #define RTPS_LOCATOR_DEFAULT_KIND (-1)
620 #define RTPS_LOCATOR_DEFAULT {\
621 RTPS_LOCATOR_DEFAULT_KIND, \
623 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} \
627 #define RTPS_Locator RTPS_Locator_t
630 struct RTPS_LocatorUdpv4_t
643 #define RTPS_LOCATOR_UDPV4_DEFAULT {\
644 RTPS_LOCATOR_DEFAULT_KIND, \
650 extern RTPSDllVariable
const struct RTPS_Locator_t RTPS_LOCATOR_INVALID;
653 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_INVALID;
656 extern RTPSDllVariable
const RTI_UINT32 RTPS_LOCATOR_PORT_INVALID;
659 extern RTPSDllVariable
const RTI_UINT8
660 RTPS_LOCATOR_ADDRESS_INVALID[RTPS_LOCATOR_ADDRESS_LENGTH_MAX];
663 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_UDPv4;
666 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_UDPv6;
669 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_RESERVED;
672 extern RTPSDllVariable
const RTI_INT32 RTPS_LOCATOR_KIND_SHMEM;
693 RTPS_SequenceNumber_deserialize(
char **src_buffer,
694 struct REDA_SequenceNumber *instance,
707 MUST_CHECK_RETURN RTPSDllExport RTI_INT32
708 RTPS_SequenceNumber_get_distance(
709 const struct REDA_SequenceNumber *s1,
710 const struct REDA_SequenceNumber *s2);
715 #define RTPS_BITMAP_32BITS_ARRAY_SIZE_MAX (8)
727 struct REDA_SequenceNumber lead;
746 RTI_UINT32 bits[RTPS_BITMAP_32BITS_ARRAY_SIZE_MAX];
750 #define RTPS_BITMAP_SIZE_MAX (256)
753 #define RTPS_BITMAP_DISTANCE_MAX (0x7FFFFFFF)
767 struct RTPS_Bitmap *me,
768 const struct REDA_SequenceNumber *sn,
769 RTI_INT32 bit_count);
786 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
787 RTPS_Bitmap_set_bit(
struct RTPS_Bitmap *me,
789 const struct REDA_SequenceNumber *num,
807 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
809 const struct RTPS_Bitmap *me,
811 const struct REDA_SequenceNumber *num);
825 SHOULD_CHECK_RETURN RTPSDllExport
RTI_BOOL
826 RTPS_Bitmap_get_first_bit(
827 const struct RTPS_Bitmap *me,
828 struct REDA_SequenceNumber *position,
843 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
844 RTPS_Bitmap_get_last_bit(
845 const struct RTPS_Bitmap *me,
846 struct REDA_SequenceNumber *position,
860 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
862 struct RTPS_Bitmap *me,
863 const struct REDA_SequenceNumber *first_seq_num,
864 const struct REDA_SequenceNumber *last_seq_num,
882 struct RTPS_Bitmap *me,
883 const struct RTPS_Bitmap *source);
897 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
899 struct RTPS_Bitmap *me,
900 const struct REDA_SequenceNumber *seq_num);
916 RTPS_Bitmap_truncate(
917 struct RTPS_Bitmap *me,
918 const struct REDA_SequenceNumber *seq_num);
931 RTPS_Bitmap_invert(
struct RTPS_Bitmap *me);
950 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
951 RTPS_Bitmap_deserialize(
952 struct RTPS_Bitmap *me,
953 const char **stream_ptr,
954 RTI_UINT32 max_bits_len,
968 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
970 struct CDR_Stream_t *stream,
971 const struct RTPS_Guid *guid,
984 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
985 RTPS_Guid_deserialize(
986 struct CDR_Stream_t *stream,
987 struct RTPS_Guid *guid,
998 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
999 RTPS_Guid_get_max_size_serialized(RTI_UINT32 size);
1012 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1013 RTPS_serialize_ntp_time(
1014 struct CDR_Stream_t *stream,
1028 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1029 RTPS_deserialize_ntp_time(
1030 struct CDR_Stream_t *stream,
1042 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1043 RTPS_get_ntp_time_max_size_serialized(RTI_UINT32 size);
1056 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1057 RTPS_serialize_2_octets(
1058 struct CDR_Stream_t *stream,
1059 const RTI_UINT16 * in,
1072 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1073 RTPS_deserialize_2_octets(
1074 struct CDR_Stream_t *stream,
1086 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1087 RTPS_get_2_octets_max_size_serialized(RTI_UINT32 size);
1100 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1101 RTPS_serialize_ipv6_locator(
1102 struct CDR_Stream_t *stream,
1103 const struct RTPS_Locator_t *loc,
1116 MUST_CHECK_RETURN RTPSDllExport
RTI_BOOL
1117 RTPS_deserialize_ipv6_locator(
1118 struct CDR_Stream_t *stream,
1119 struct RTPS_Locator_t *loc,
1130 MUST_CHECK_RETURN RTPSDllExport RTI_UINT32
1131 RTPS_get_ipv6_locator_max_size_serialized(RTI_UINT32 size);
1144 RTPS_Epoch_deserialize(REDA_Epoch_T * me,
1145 const char **stream,
1150 typedef struct NETIO_Guid RTPS_GUID;
1153 typedef struct NETIO_GuidPrefix RTPS_GuidPrefix_T;
1156 typedef struct NETIO_GuidEntity RTPS_Entity_T;
1159 #define RTPS_GUIDPREFIX_UNKNOWN {{0,0,0,0,0,0,0,0,0,0,0,0}}
1162 #define RTPS_ENTITY_UNKNOWN {{0,0,0,0}}
1172 RTI_UINT32 fractions;
1183 struct RTPS_ProtocolVersion
1202 struct RTPS_ProtocolVersion protocol_version;
1205 struct RTPS_Vendor vendor_id;
1208 RTPS_GuidPrefix_T guid_prefix;
1212 #ifdef RTI_ENDIAN_LITTLE
1213 #define VALID_RTPS_HEADER 0x53505452
1215 #define VALID_RTPS_HEADER 0x52545053
1222 #define RTPS_PAD_KIND (0x01)
1225 #define RTPS_ACKNACK_KIND (0x06)
1228 #define RTPS_HEARTBEAT_KIND (0x07)
1231 #define RTPS_GAP_KIND (0x08)
1234 #define RTPS_INFO_TS_KIND (0x09)
1237 #define RTPS_INFO_SRC_KIND (0x0c)
1240 #define RTPS_INFO_REPLY_IP4_KIND (0x0d)
1243 #define RTPS_INFO_DST_KIND (0x0e)
1246 #define RTPS_INFO_REPLY_KIND (0x0f)
1249 #define RTPS_DATA_KIND (0x15)
1252 #define RTPS_LARGEST_SUBMSG_KIND RTPS_DATA_KIND
1255 #define RTPS_SUBMESSAGE_HEADER_LENGTH 4
1264 struct RTPS_SubmsgHdr
1277 #define RTPS_SUBMSG_FLAG_E 0x1
1284 struct RTPS_SubmsgHdr hdr;
1287 RTPS_Entity_T reader;
1290 RTPS_Entity_T writer;
1293 struct RTPS_Bitmap bitmap;
1300 #define RTPS_ACKNACKFLAGS_F 0x2
1312 struct RTPS_SubmsgHdr hdr;
1318 RTI_UINT16 qos_offset;
1321 RTPS_Entity_T reader;
1324 RTPS_Entity_T writer;
1327 struct REDA_SequenceNumber sn;
1331 #define RTPS_FLAGS_NONE 0x0
1334 #define RTPS_DATAFLAGS_Q 0x2
1337 #define RTPS_DATAFLAGS_D 0x4
1340 #define RTPS_DATAFLAGS_K 0x8
1343 #define RTPS_DATA_INLINEQOS_OFFSET 16
1350 struct RTPS_SubmsgHdr hdr;
1353 RTPS_Entity_T reader;
1356 RTPS_Entity_T writer;
1359 struct REDA_SequenceNumber sn_start;
1362 struct RTPS_Bitmap bitmap;
1367 struct RTPS_HEARTBEAT
1370 struct RTPS_SubmsgHdr hdr;
1373 RTPS_Entity_T reader;
1376 RTPS_Entity_T writer;
1379 struct REDA_SequenceNumber sn_first;
1382 struct REDA_SequenceNumber sn_last;
1389 #define RTPS_HBFLAGS_F 0x02
1392 #define RTPS_HBFLAGS_L 0x04
1396 struct RTPS_INFO_DST
1399 struct RTPS_SubmsgHdr hdr;
1402 RTPS_GuidPrefix_T guid_prefix;
1410 struct RTPS_SubmsgHdr hdr;
1413 struct RTPS_Time timestamp;
1417 #define RTPS_INFO_TSFLAGS_I (0x2)
1428 struct RTPS_SubmsgHdr submsg;
1431 struct RTPS_Header header;
1434 struct RTPS_DATA data;
1437 struct RTPS_GAP gap;
1440 struct RTPS_HEARTBEAT hb;
1443 struct RTPS_ACKNACK acknack;
1446 struct RTPS_INFO_TS info_ts;
1449 struct RTPS_INFO_DST info_dst;
1457 RTPS_INTERFACEMODE_UNDEFINED,
1460 RTPS_INTERFACEMODE_WRITER,
1463 RTPS_INTERFACEMODE_READER,
1466 RTPS_INTERFACEMODE_EXTERNAL_RECEIVER
1467 } RTPS_InterfaceMode_t;
1470 struct RTPS_InterfaceProperty
1473 struct NETIO_InterfaceProperty _parent;
1476 RTPS_InterfaceMode_t mode;
1479 struct NETIO_Address intf_address;
1482 RTI_INT32 max_peer_count;
1499 RTI_SIZE_T samples_per_hb;
1502 RTI_UINT32 max_window_size;
1513 RTI_INT32 max_hb_retries;
1516 RTI_INT32 max_samples;
1517 #if OSAPI_ENABLE_TRACE
1518 const char *session_name;
1522 #if OSAPI_ENABLE_TRACE
1523 #define RTPS_SESSION_NAME_INIT ,NULL
1525 #define RTPS_SESSION_NAME_INIT
1529 #define RTPS_RETRIES_UNLIMITED (-1)
1532 #define RTPS_RECEIVE_WINDOW_MAX_SIZE (256)
1535 #define RTPS_InterfaceProperty_INITIALIZER \
1537 NETIO_InterfaceProperty_INITIALIZER,\
1538 RTPS_INTERFACEMODE_UNDEFINED,\
1539 NETIO_Address_INITIALIZER, \
1546 RTPS_RETRIES_UNLIMITED, \
1548 RTPS_SESSION_NAME_INIT \
1552 struct RTPS_RouteProperty
1555 struct NETIORouteProperty _parent;
1563 struct REDA_SequenceNumber first_sn;
1568 struct REDA_SequenceNumber last_sn;
1573 struct REDA_SequenceNumber last_acked_sn;
1577 #define RTPSRouteProperty_INITIALIZER \
1579 NETIORouteProperty_INITIALIZER, \
1581 REDA_SEQUENCE_NUMBER_ZERO,\
1582 REDA_SEQUENCE_NUMBER_ZERO, \
1583 REDA_SEQUENCE_NUMBER_ZERO \
1589 MUST_CHECK_RETURN RTPSDllExport
struct RT_ComponentFactoryI*
1590 RTPS_InterfaceFactory_get_interface(
void);