RTI Connext C API Version 7.6.0
transport_common_user.h
1/*
2 * (c) Copyright, Real-Time Innovations, 2005-2024.
3 * All rights reserved.
4 *
5 * No duplications, whole or partial, manual or electronic, may be made
6 * without express written permission. Any such copies, or
7 * revisions thereof, must display this notice unaltered.
8 * This code contains trade secrets of Real-Time Innovations, Inc.
9 */
10
11#ifndef transport_common_user_h
12#define transport_common_user_h
13
14#include "osapi/osapi_type.h"
15#include "osapi/osapi_socket.h"
16#include "reda/reda_buffer.h"
17#include "transport/transport_dll.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/* ================================================================= */
24/* Fundamental types */
25/* ================================================================= */
26/*i
27 * \file
28 * \ingroup NDDS_TransportCommonComponent
29 * \brief Basic types and macros used by the \ndds Transport Plugin interface.
30 */
31
32/*e \dref_TransportConfigurationGroupDocs
33 */
34
35/* ================================================================= */
36/* Transport Allocation Settings */
37/* ================================================================= */
38/*e \ingroup NDDS_TransportConfigurationComponent
39 *
40 * \brief Allocation settings used by various internal buffers.
41 *
42 * An allocation setting structure defines the rules of memory management
43 * used by internal buffers.
44 *
45 * An internal buffer can provide blocks of memory of fixed size. They
46 * are used in several places of any transport, and this structure
47 * defines its starting size, limits, and how to increase its capacity.
48 *
49 * It contains three values:
50 * <ul><li>initial_count: the number of individual elements that are
51 * allocated when the buffer is created.
52 *
53 * <li>max_count: the maximum number of elements the buffer can
54 * hold. The buffer will grow up to this amount. After this
55 * limit is reached, new allocation requests will fail.
56 * For unlimited size, use the value
57 * NDDS_TRANSPORT_ALLOCATION_SETTINGS_MAX_COUNT_UNLIMITED
58 *
59 * <li>incremental_count: The amount of elements that are allocated
60 * at every increment.
61 * You can use the value:
62 * NDDS_TRANSPORT_ALLOCATION_SETTINGS_INCREMENTAL_COUNT_AUTOMATIC
63 * to have the buffer double its size at every reallocation request.
64 * </ul>
65 */
67 RTI_INT32 initial_count;
68 RTI_INT32 max_count;
69 RTI_INT32 incremental_count;
70};
71
72/*e \ingroup NDDS_TransportConfigurationComponent
73 *
74 * \brief The constant used as 'unlimited' for the 'max_count' field of the
75 * structure \ref TransportAllocationSettings_t
76 */
77#define NDDS_TRANSPORT_ALLOCATION_SETTINGS_MAX_COUNT_UNLIMITED (-1)
78
79/*e \ingroup NDDS_TransportConfigurationComponent
80 *
81 * \brief The constant used as 'automatic' for the 'incremental_count' field of
82 * the structure \ref TransportAllocationSettings_t
83 *
84 * Automatic means the buffer size will double at every reallocation.
85 */
86#define NDDS_TRANSPORT_ALLOCATION_SETTINGS_INCREMENTAL_COUNT_AUTOMATIC (-1)
87
88/*e \ingroup NDDS_TransportConfigurationComponent
89 *
90 * \brief The constant used as default value for the struct \ref
91 * TransportAllocationSettings_t
92 *
93 * The default value defined in this constant, sets the buffer to have:
94 * <ul><li>initial_count = 2 elements
95 * <li>max_count = \ref
96 * NDDS_TRANSPORT_ALLOCATION_SETTINGS_MAX_COUNT_UNLIMITED <li>incremental_count
97 * = NDDS_TRANSPORT_ALLOCATION_SETTINGS_INCREMENTAL_COUNT_AUTOMATIC
98 * </ul>
99 */
100#define NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT { \
101 2L, /* initial_count */ \
102 NDDS_TRANSPORT_ALLOCATION_SETTINGS_MAX_COUNT_UNLIMITED, /* max_count */ \
103 NDDS_TRANSPORT_ALLOCATION_SETTINGS_INCREMENTAL_COUNT_AUTOMATIC /* incremental_count */ \
104}
105
106/* ================================================================= */
107/* Transport Class ID type */
108/* ================================================================= */
109
110/*e
111 * \ingroup NDDS_TransportConfigurationComponent
112 * \brief Type for storing \ndds Transport Plugin class IDs.
113 *
114 * Each implementation of a Transport Plugin must have a unique ID. For
115 * example, a UDP/IP Transport Plugin implementation must have a different
116 * ID than a Shared Memory Transport Plugin.
117 *
118 * User-implemented Transport Plugins must have an ID higher than \ref
119 * NDDS_TRANSPORT_CLASSID_RESERVED_RANGE.
120 */
121typedef RTI_INT32 NDDS_Transport_ClassId_t;
122
123#define NDDS_TRANSPORT_CLASS_ID_LIST_SIZE 8
124
125/*i
126 * \ingroup NDDS_TransportConfigurationComponent
127 * @brief Array of NDDS_Transport_ClassId_t elements
128 *
129 * Used in Network Capture as a list of transports to capture frames from.
130 * This will be populated by
131 * RTINetioConfigurator_getTransportClassIdListFromString
132 * with the list of transports (given by the user)
133 * and then checked against the transport of the current frame in
134 * RTINetioCapManager_enqueueRtpsFrame
135 */
136struct NDDS_Transport_ClassId_List {
137 size_t size;
138 NDDS_Transport_ClassId_t elements[NDDS_TRANSPORT_CLASS_ID_LIST_SIZE];
139};
140
141/*e
142 * \ingroup NDDS_TransportConfigurationComponent
143 * \brief Invalid Transport Class ID
144 *
145 * Transport-Plugins implementations should set their class ID to a value
146 * different than this.
147 */
148#define NDDS_TRANSPORT_CLASSID_INVALID (-1)
149
150
151#define NDDS_Transport_ClassId_List_INITIALIZER \
152{ \
153 0, /* size */ \
154 { \
155 NDDS_TRANSPORT_CLASSID_INVALID, \
156 NDDS_TRANSPORT_CLASSID_INVALID, \
157 NDDS_TRANSPORT_CLASSID_INVALID, \
158 NDDS_TRANSPORT_CLASSID_INVALID, \
159 NDDS_TRANSPORT_CLASSID_INVALID, \
160 NDDS_TRANSPORT_CLASSID_INVALID, \
161 NDDS_TRANSPORT_CLASSID_INVALID, \
162 NDDS_TRANSPORT_CLASSID_INVALID \
163 } \
164}
165
166/*i \ingroup NDDS_TransportConfigurationComponent
167 * \brief Special \b wildcard transport class. Matches any transport class. A
168 * locator with this transport class is applicable to ALL Transport Plugin
169 * instances.
170 *
171 * Physical Transport-Plugins should return a value different than this.
172 *
173 * Used by \ndds internally, not useful for Transport Plugin implementors.
174 */
175#define NDDS_TRANSPORT_CLASSID_ANY (0)
176
177/*e
178 * \ingroup NDDS_TransportConfigurationComponent
179 * \brief Builtin IPv4 UDP/IP Transport Plugin class ID.
180 */
181#define NDDS_TRANSPORT_CLASSID_UDPv4 (1)
182
183/*e
184 * \ingroup NDDS_TransportConfigurationComponent
185 * \brief Builtin Shared-Memory Transport Plugin class ID.
186 */
187#define NDDS_TRANSPORT_CLASSID_SHMEM (0x01000000)
188
189/*e
190 * \ingroup NDDS_TransportConfigurationComponent
191 * \brief Builtin Shared-Memory Transport Plugin class ID for Connext 5.1.0 and
192 * earlier.
193 */
194#define NDDS_TRANSPORT_CLASSID_SHMEM_510 (2)
195
196/*i
197 * \ingroup NDDS_TransportConfigurationComponent
198 * \brief Builtin Intra-Process Transport Plugin class ID.
199 */
200#define NDDS_TRANSPORT_CLASSID_INTRA (3)
201
202/* NOTE: classid 4 was previously used for starfabric */
203
204/*e
205 * \ingroup NDDS_TransportConfigurationComponent
206 * \brief Builtin IPv6 UDP/IP Transport Plugin class ID.
207 */
208#define NDDS_TRANSPORT_CLASSID_UDPv6 (2)
209
210/*e
211 * \ingroup NDDS_TransportConfigurationComponent
212 * \brief Builtin IPv6 UDP/IP Transport Plugin class ID for Connext 5.1.0 and
213 * earlier.
214 */
215#define NDDS_TRANSPORT_CLASSID_UDPv6_510 (5)
216
217/*e
218 * \ingroup NDDS_TransportConfigurationComponent
219 * \brief IPv4 TCP/IP Transport Plugin class ID for LAN case
220 */
221#define NDDS_TRANSPORT_CLASSID_TCPV4_LAN (8)
222
223/*e
224 * \ingroup NDDS_TransportConfigurationComponent
225 * \brief IPv4 TCP/IP Transport Plugin class ID for WAN case
226 */
227#define NDDS_TRANSPORT_CLASSID_TCPV4_WAN (9)
228
229/*e
230 * \ingroup NDDS_TransportConfigurationComponent
231 * \brief IPv4 TCP/IP Transport Plugin class name for WAN case
232 */
233#define NDDS_TRANSPORT_CLASSNAME_TCPV4_WAN "tcpv4_wan"
234
235/*e
236 * \ingroup NDDS_TransportConfigurationComponent
237 * \brief IPv4 TCP/IP Transport Plugin class ID for LAN case with TLS enabled
238 */
239#define NDDS_TRANSPORT_CLASSID_TLSV4_LAN (10)
240
241/*e
242 * \ingroup NDDS_TransportConfigurationComponent
243 * \brief IPv4 TCP/IP Transport Plugin class ID for WAN case with TLS enabled
244 */
245#define NDDS_TRANSPORT_CLASSID_TLSV4_WAN (11)
246
247/*i
248 * \ingroup NDDS_TransportConfigurationComponent
249 * \brief PCIE Transport Plugin class ID.
250 */
251#define NDDS_TRANSPORT_CLASSID_PCIE (12)
252
253/*i
254 * \ingroup NDDS_TransportConfigurationComponent
255 * \brief Internet Transport Plugin class ID.
256 */
257#define NDDS_TRANSPORT_CLASSID_ITP (13)
258
259/*e
260 * \ingroup NDDS_TransportConfigurationComponent
261 * \brief Builtin IPv4 UDP/IP Asymmetric Transport Plugin class ID.
262 */
263#define NDDS_TRANSPORT_CLASSID_UDPv4_WAN (0x01000001)
264
265/*e
266 * \ingroup NDDS_TransportConfigurationComponent
267 * \brief Transport Plugin class IDs below this are reserved by RTI.
268 *
269 * User-defined Transport-Plugins should use a class ID greater than
270 * this number.
271 */
272#define NDDS_TRANSPORT_CLASSID_RESERVED_RANGE (1000)
273
274#define NDDS_Transport_ClassId_ignore_participant_index_for_initial_peers( \
275 class_id__) \
276 (class_id__ == NDDS_TRANSPORT_CLASSID_UDPv4_WAN)
277
278/* Class name definitions for pluggable transports */
279#define NDDS_TRANSPORT_IP_CLASSNAME_TCPV4_LAN "tcpv4_lan"
280#define NDDS_TRANSPORT_IP_CLASSNAME_TCPV4_WAN "tcpv4_wan"
281#define NDDS_TRANSPORT_IP_CLASSNAME_TLSV4_LAN "tlsv4_lan"
282#define NDDS_TRANSPORT_IP_CLASSNAME_TLSV4_WAN "tlsv4_wan"
283
284/* ================================================================= */
285/* Transport Short Name */
286/* ================================================================= */
287/*i \ingroup NDDSTransportModule
288 * \brief Transport short name. Specifies the short name of the transports.
289 */
290#define NDDS_TRANSPORT_SHORTNAME_SHMEM "SHMEM"
291#define NDDS_TRANSPORT_SHORTNAME_TCPV4 "TCP4"
292#define NDDS_TRANSPORT_SHORTNAME_TLS "TLS"
293#define NDDS_TRANSPORT_SHORTNAME_WAN "WAN"
294#define NDDS_TRANSPORT_SHORTNAME_UDP4 "UDP4"
295#define NDDS_TRANSPORT_SHORTNAME_UDP6 "UDP6"
296
297/* ================================================================= */
298/* Address Type */
299/* ================================================================= */
300
301/*e
302 * \defgroup NDDS_Transport_Address_t Transport Address
303 * \ingroup NDDSTransportModule
304 *
305 * \brief Transport-independent addressing scheme using IPv6
306 * presentation strings and numerically stored in network-ordered format.
307 *
308 * The APIs of \ndds uses IPv6 address notation for all transports.
309 *
310 * Transport Plugin implementations that are not IP-based are required to map
311 * whatever addressing scheme natively used by the physical transport (if any)
312 * to an address in IPv6 notation and vice versa.
313 *
314 * IPv6 addresses are numerically stored in 16 bytes. An IPv6 address can be
315 * presented In string notation in a variety of ways. For example,
316 *
317 * \code
318 * "00AF:0000:0037:FE01:0000:0000:034B:0089"
319 * "AF:0:37:FE01:0:0:34B:89"
320 * "AF:0:37:FE01::34B:89"
321 * \endcode
322 *
323 * are all valid IPv6 presentation of the same address.
324 *
325 * IPv4 address in dot notation can be used to specify the last 4 bytes of the
326 * address. For example,
327 *
328 * \code
329 * "0000:0000:0000:0000:0000:0000:192.168.0.1"
330 * "0:0:0:0:0:0:192.168.0.1"
331 * "::192.168.0.1"
332 * \endcode
333 *
334 * are all valid IPv6 presentation of the same address.
335 *
336 * For a complete description of valid IPv6 address notation, consult the IPv6
337 * Addressing Architecture (RFC 2373).
338 *
339 * Addresses are divided into unicast addresses and multicast addresses.
340 *
341 * Multicast addresses are defined as
342 *
343 * \li Addresses that start with 0xFF.
344 * That is \c FFxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx.
345 *
346 * or an IPv4 multicast address
347 *
348 * \li Address in the range \c [::224.0.0.0, ::239.255.255.255]
349 *
350 * Multicast addresses do not refer to any specific destination (network
351 * interface). Instead, they usually refer to a group of network interfaces,
352 * often called a "multicast group".
353 *
354 * Unicast addresses always refer to a specific network interface.
355 *
356 */
357
358#define NDDS_TRANSPORT_ADDRESS_LENGTH (16)
359#define NDDS_TRANSPORT_ADDRESS_BIT_LENGTH (128)
360
361/*e
362 * \ingroup NDDS_Transport_Address_t
363 * \brief Addresses are stored individually as network-ordered bytes.
364 *
365 * \ndds addresses are numerically stored in a transport independent manner.
366 * \ndds uses a IPv6-compatible format, which means that the data structure to
367 * hold an NDDS_Transport_Address_t is the same size as a data structure needed
368 * to hold an IPv6 address.
369 *
370 * In addition, the functions provided to translate a string representation of
371 * an \ndds address to a value assumes that the string presentation follows the
372 * IPv6 address presentation as specified in RFC 2373.
373 *
374 * An NDDS_Transport_Address_t always stores the address in network-byte order
375 * (which is Big Endian).
376 *
377 * For example, IPv4 multicast address of 225.0.0.0 is represented by
378 *
379 * {{0,0,0,0, 0,0,0,0, 0,0,0,0, 0xE1,0,0,0}} regardless of endianness,
380 *
381 * where 0xE1 is the 13th byte of the structure (\c network_ordered_value[12]).
382 *
383 */
384typedef struct {
385 /*e
386 * network-byte ordered (i.e., bit 0 is the most significant bit and bit 128
387 * is the least significant bit).
388 */
389 unsigned char network_ordered_value[NDDS_TRANSPORT_ADDRESS_LENGTH];
391
392/*i
393 * @brief Converts an IPv4 address to string.
394 *
395 * @return
396 * RTI_TRUE upon success; RTI_FALSE upon failure (not enough space in the
397 * provided buffer)
398 */
399extern NDDS_Transport_DllExport RTIBool NDDS_Transport_v4Address_to_string(
400 const NDDS_Transport_Address_t *me,
401 char *buffer,
402 size_t buffer_size_in);
403
404/*e
405 * \ingroup NDDS_Transport_Address_t
406 * \brief Converts a numerical address to a printable string representation.
407 *
408 * @pre The \c buffer_inout provided must be at least \ref
409 * NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE characters long.
410 *
411 * @param self \st_in The address to be converted.
412 *
413 * @param buffer_inout \st_inout Storage passed in which to return the string
414 * corresponding to the address.
415 *
416 * @param buffer_size_in \st_in The size of the storage buffer. Must be
417 * >= \ref NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE
418 *
419 * @return 1 upon success; 0 upon failure (not enough space in the provided
420 * buffer)
421 */
422extern NDDS_Transport_DllExport RTIBool NDDS_Transport_Address_to_string(
423 const NDDS_Transport_Address_t *self,
424 char *buffer_inout,
425 size_t buffer_size_in);
426
427/*e
428 * @brief Converts an address to string given its class ID.
429 *
430 * @return
431 * 1 upon success; 0 upon failure (not enough space in the provided buffer)
432 */
433extern NDDS_Transport_DllExport RTIBool
434NDDS_Transport_Address_to_string_with_class_id(
435 const NDDS_Transport_Address_t *me,
436 char *buffer,
437 size_t buffer_size_in,
438 NDDS_Transport_ClassId_t transport_class_id);
439
440/*e
441 * \ingroup NDDS_Transport_Address_t
442 * \brief Converts a numerical address to a printable string representation with
443 * IPv4 dotted notation or IPv6 presentation string depending on the provided
444 * protocol family.
445 *
446 * @pre The \c buffer_inout provided must be at least
447 * \ref NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE characters long.
448 *
449 * @param me \st_in The address to be converted.
450 *
451 * @param buffer \st_inout Storage passed in which to return the string
452 * corresponding to the address.
453 *
454 * @param buffer_size_in \st_in The size of the storage buffer. Must be
455 * >= \ref NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE
456 *
457 * @param family \st_in The protocol family RTI_OSAPI_SOCKET_AF_INET or
458 * RTI_OSAPI_SOCKET_AF_INET6
459 *
460 * @return RTI_TRUE upon success; 0 upon failure (not enough space in the
461 * provided buffer)
462 */
463extern NDDS_Transport_DllExport RTIBool
465 const NDDS_Transport_Address_t *me,
466 char *buffer,
467 size_t buffer_size_in,
468 RTIOsapiSocketAFKind family);
469
470/*e
471 * \ingroup NDDS_Transport_Address_t
472 * \brief Converts an address (IPv4 dotted notation or IPv6 presentation string)
473 * into a numerical address.
474 *
475 * The address string must be in IPv4 dotted notation (X.X.X.X) or IPv6
476 * presentation notation. The string cannot be a hostname since this
477 * function does not perform a hostname lookup.
478 *
479 * @param address_out \st_out Numerical value of the address.
480 *
481 * @param address_in \st_in String representation of an address.
482 *
483 * @return 1 if address_out contains a valid address, 0 if it was not able to
484 * convert the string into an address.
485 */
486extern NDDS_Transport_DllExport RTI_INT32 NDDS_Transport_Address_from_string(
487 NDDS_Transport_Address_t *address_out,
488 const char *address_in);
489
490/*e
491 * \ingroup NDDS_Transport_Address_t
492 * \brief Prints an address to standard out.
493 *
494 * @param address_in \st_in Address to be printed.
495 * @param desc_in \st_in A prefix to be printed before the address.
496 * @param indent_in \st_in Indentation level for the printout.
497 */
498extern NDDS_Transport_DllExport void NDDS_Transport_Address_print(
499 const NDDS_Transport_Address_t *address_in,
500 const char *desc_in,
501 RTI_INT32 indent_in);
502
503/*i
504 * \ingroup NDDS_Transport_Address_t
505 * \brief Copies an address.
506 *
507 * @param dst_out \st_out To where the address is copied.
508 * @param src_in \st_in From where the address is copied.
509 */
510extern NDDS_Transport_DllExport void NDDS_Transport_Address_copy(
512 const NDDS_Transport_Address_t *src_in);
513
514/*i
515 * \ingroup NDDS_Transport_Address_t
516 * \brief Compares two addresses for equality.
517 *
518 * Does the comparison (l_in == r_in) ?
519 *
520 * @param l_in \st_in Address left.
521 * @param r_in \st_in Address right.
522 *
523 * @return 1 if addresses are equal, 0 otherwise.
524 */
525extern NDDS_Transport_DllExport RTI_INT32 NDDS_Transport_Address_is_equal(
526 const NDDS_Transport_Address_t *l_in,
527 const NDDS_Transport_Address_t *r_in);
528
529/*i
530 * \ingroup NDDS_Transport_Address_t
531 * \brief Compares two addresses for equality using only significant bits.
532 *
533 * Does the comparison (l_in == r_in) using only the number of
534 * significant bits as indicated by \c transport_address_bit_count_in.
535 *
536 * @param l_in \st_in Address left.
537 * @param r_in \st_in Address right.
538 * @param transport_address_bit_count_in \st_in Only pays attention to this
539 * many least significant (i.e. right-most) bits in the address. The most
540 * significant (i.e. lesftmost) \c 128 - \c address_bit_count_in bits are
541 * ignored.
542 *
543 * @return 1 if the \c address_bit_count_in least significant (i.e. rightmost)
544 * bits are equal,0 otherwise.
545 */
546extern NDDS_Transport_DllExport RTI_INT32 NDDS_Transport_Address_bits_are_equal(
547 const NDDS_Transport_Address_t *l_in,
548 const NDDS_Transport_Address_t *r_in,
549 RTI_INT32 transport_address_bit_count_in);
550
551/*i
552 * \ingroup NDDS_Transport_Address_t
553 * \brief Compares the value of two addresses.
554 *
555 * This function treats the addresses as 16-byte numerical values, and
556 * then compares them.
557 *
558 * @param l_in \st_in Address left.
559 * @param r_in \st_in Address right.
560 *
561 * @return 1 if l_in > r_in, 0 if l_ in == r_in, -1 if l_in < r
562 */
563extern NDDS_Transport_DllExport RTI_INT32 NDDS_Transport_Address_compare(
564 const NDDS_Transport_Address_t *l_in,
565 const NDDS_Transport_Address_t *r_in);
566
567/*e
568 * \ingroup NDDS_Transport_Address_t
569 * \brief Checks if an address is an IPv4 address.
570 *
571 * @param address_in \st_in Address to be tested.
572 *
573 * @note May be implemented as a macro for efficiency.
574 *
575 * @return 1 if address is an IPv4 address, 0 otherwise.
576 */
577extern NDDS_Transport_DllExport RTI_INT32
579
580/*e
581 * \ingroup NDDS_Transport_Address_t
582 * \brief Checks if an address is an IPv4 or IPv6 multicast address.
583 *
584 * @param address_in \st_in Address to be tested.
585 *
586 * May be implemented as a macro for efficiency.
587 *
588 * @return 1 if address is a multicast address, 0 otherwise.
589 */
590extern NDDS_Transport_DllExport RTI_INT32
592
593/*i
594 * \ingroup NDDS_Transport_Address_t
595 * @brief Fill from host byte order IPv4 address
596 */
597extern NDDS_Transport_DllExport void NDDS_Transport_Address_from_ipv4_host_byte(
599 RTI_UINT32 ipv4AddressInHostOrderIn);
600
601/*i
602 * \ingroup NDDS_Transport_Address_t
603 * @brief convert to host byte order IPv4 address
604 */
605extern NDDS_Transport_DllExport RTI_UINT32
606NDDS_Transport_Address_to_ipv4_host_byte(const NDDS_Transport_Address_t *me);
607
608/*e
609 * \ingroup NDDS_Transport_Address_t
610 * \brief An invalid transport address. Used as an initializer.
611 *
612 * For example:
613 * NDDS_Transport_Address_t address =
614 * NDDS_TRANSPORT_ADDRESS_INVALID_INITIALIZER;
615 */
616#define NDDS_TRANSPORT_ADDRESS_INVALID_INITIALIZER \
617 { \
618 { \
619 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 \
620 } \
621 }
622
623/*e
624 * \ingroup NDDS_Transport_Address_t
625 * \brief An invalid transport address.
626 */
627extern NDDS_Transport_DllVariable const NDDS_Transport_Address_t
629
630/*e
631 * \ingroup NDDS_Transport_Address_t
632 * \brief The minimum size of the buffer that should be passed to
633 * \ref NDDS_Transport_Address_to_string.
634 *
635 * For regular addresses, the string size needs to be at least 40 to include
636 * space for 8 tuples of 4 characters each plus 7 delimiting colons plus a
637 * terminating NULL.
638 *
639 * To support UDPv4_WAN strings, it has been adjusted to 72 to fit the following
640 * representation (plus NULL terminator):
641 * f=XXXXRBPU,u={FF,FF,FF,FF,FF,FF,FF,FF,FF},p=255.255.255.255:65555:65555
642 */
643#define NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE (72)
644#define NDDS_TRANSPORT_V4_ADDRESS_STRING_BUFFER_SIZE (16)
645
646/* Functions that forward information from transport to dds_c */
647
648/*
649 * Called when preallocating memory for encoded content.
650 *
651 * Unlike the participant forwarder APIs, the transport ones don't have the
652 * worker as an input argument. They get it from the DomainParticipant when
653 * they require it. They do so because the concept of worker is not currently
654 * part of the pluggable transports APIs.
655 */
656typedef unsigned int (
657 *NDDS_Transport_Plugin_DomainParticipant_Get_Transformed_Outgoing_Message_Size_Function)(
658 void *domain_participant_ptr,
659 unsigned int message_size);
660
661/*
662 * Unlike the participant forwarder APIs, the transport ones don't have the
663 * worker as an input argument. They get it from the DomainParticipant when
664 * they require it. They do so because the concept of worker is not currently
665 * part of the pluggable transports APIs.
666 */
667typedef RTIBool (
668 *NDDS_Transport_Plugin_DomainParticipant_Transform_Outgoing_Message_Function)(
669 void *domain_participant_ptr,
670 /* output */
671 struct REDABuffer *transformed_message,
672 /* inputs */
673 const struct REDABuffer *message_buffers,
674 int message_buffer_count);
675
676/*
677 * Unlike the participant forwarder APIs, the transport ones don't have the
678 * worker as an input argument. They get it from the DomainParticipant when
679 * they require it. They do so because the concept of worker is not currently
680 * part of the pluggable transports APIs.
681 */
682typedef RTIBool (
683 *NDDS_Transport_Plugin_DomainParticipant_Transform_Incoming_Message_Function)(
684 void *domain_participant_ptr,
685 /* output */
686 struct REDABuffer *transformed_message,
687 /* input */
688 const struct REDABuffer *message_buffer);
689
690struct NDDS_Transport_Plugin_DomainParticipantForwarder {
691 NDDS_Transport_Plugin_DomainParticipant_Get_Transformed_Outgoing_Message_Size_Function
692 getTransformedOutgoingMessageSize;
693 NDDS_Transport_Plugin_DomainParticipant_Transform_Outgoing_Message_Function
694 transformOutgoingMessage;
695 NDDS_Transport_Plugin_DomainParticipant_Transform_Incoming_Message_Function
696 transformIncomingMessage;
697};
698
699#ifdef __cplusplus
700} /* extern "C" */
701#endif
702
703#endif /* transport_common_user_h */
RTI_INT32 NDDS_Transport_ClassId_t
Type for storing RTI Connext Transport Plugin class IDs.
Definition: transport_common_user.h:121
RTI_INT32 NDDS_Transport_Address_is_ipv4(const NDDS_Transport_Address_t *address_in)
Checks if an address is an IPv4 address.
RTI_INT32 NDDS_Transport_Address_from_string(NDDS_Transport_Address_t *address_out, const char *address_in)
Converts an address (IPv4 dotted notation or IPv6 presentation string) into a numerical address.
RTIBool NDDS_Transport_Address_to_string(const NDDS_Transport_Address_t *self, char *buffer_inout, size_t buffer_size_in)
Converts a numerical address to a printable string representation.
RTI_INT32 NDDS_Transport_Address_is_multicast(const NDDS_Transport_Address_t *address_in)
Checks if an address is an IPv4 or IPv6 multicast address.
RTIBool NDDS_Transport_Address_to_string_with_protocol_family_format(const NDDS_Transport_Address_t *me, char *buffer, size_t buffer_size_in, RTIOsapiSocketAFKind family)
Converts a numerical address to a printable string representation with IPv4 dotted notation or IPv6 p...
void NDDS_Transport_Address_print(const NDDS_Transport_Address_t *address_in, const char *desc_in, RTI_INT32 indent_in)
Prints an address to standard out.
const NDDS_Transport_Address_t NDDS_TRANSPORT_ADDRESS_INVALID
An invalid transport address.
Addresses are stored individually as network-ordered bytes.
Definition: transport_common_user.h:384
Allocation settings used by various internal buffers.
Definition: transport_common_user.h:66