RTI Connext Traditional C++ API Version 7.7.0
transport_udpv4.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_udpv4_h
12#define transport_udpv4_h
13
14#include "transport/transport_udp.h"
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define NDDS_Transport_UDPv4 NDDS_Transport_UDP
21
22#define NDDS_Transport_UDPv4_InterfaceListener \
23 NDDS_Transport_UDP_InterfaceListener
24
25/* ================================================================= */
26/* Component: UDP/IPv4 Transport Plugin */
27/* ================================================================= */
28
29/*e \dref_UDPv4TransportBuiltinGroupDocs
30 */
31
32/*i \file
33 * \ingroup NDDS_Transport_UDPv4_Plugin
34 * \brief UDPv4 Transport Plugin interfaces and definitions.
35 */
36
37/* ================================================================= */
38/* UDPv4 Transport Properties */
39/* ================================================================= */
40
41#ifdef DOXYGEN_DOCUMENTATION_ONLY
42/*e \dref_UDPv4Transport_Property_t
43 */
45 /*e \dref_UDPv4Transport_Property_t_parent */
47
48 /*e \dref_UDPv4Transport_Property_t_send_socket_buffer_size */
50
51 /*e \dref_UDPv4Transport_Property_t_recv_socket_buffer_size */
53
54 /*e \dref_UDPv4Transport_Property_t_unicast_enabled */
55 RTI_INT32 unicast_enabled;
56
57 /*e \dref_UDPv4Transport_Property_t_multicast_enabled */
59
60 /*e \dref_UDPv4Transport_Property_t_multicast_ttl */
61 RTI_INT32 multicast_ttl;
62
63 /*e \dref_UDPv4Transport_Property_t_multicast_loopback_disabled */
65
66 /*e \dref_UDPv4Transport_Property_t_ignore_loopback_interface */
68
69 /*e \dref_UDPv4Transport_Property_t_ignore_nonup_interfaces */
71
72 /*e \dref_UDPv4Transport_Property_t_ignore_nonrunning_interfaces */
74
75 /*e \dref_UDPv4Transport_Property_t_no_zero_copy */
76 RTI_INT32 no_zero_copy;
77
78 /*e \dref_UDPv4Transport_Property_t_send_blocking */
79 RTI_INT32 send_blocking;
80
81 /*e \dref_UDPv4Transport_Property_t_use_checksum */
82 RTI_INT32 use_checksum;
83
84 /*e \dref_UDPv4Transport_Property_t_transport_priority_mask */
86
87 /*e \dref_UDPv4Transport_Property_t_transport_priority_mapping_low */
89
90 /*e \dref_UDPv4Transport_Property_t_transport_priority_mapping_high */
92
93 /*e \dref_UDPv4Transport_Property_t_send_ping */
94 RTI_INT32 send_ping;
95
96 /*e \dref_UDPv4Transport_Property_t_force_interface_poll_detection */
98
99 /*e \dref_UDPv4Transport_Property_t_interface_poll_period */
101
102 /*e \dref_UDPv4Transport_Property_t_reuse_multicast_receive_resource */
104
105 /*e \dref_UDPv4Transport_Property_t_protocol_overhead_max */
107
108 /*e \dref_UDPv4Transport_Property_t_disable_interface_tracking */
110
111 /*e \dref_UDPv4Transport_Property_t_join_multicast_group_timeout */
113
114 /*e \dref_UDPv4Transport_Property_t_public_address */
116
117 /*e \dref_UDPv4Transport_Property_t_port_offset */
118 RTI_INT32 port_offset;
119};
120#endif
121
122/* ================================================================= */
123/* Component: UDP/IPv4 WAN Transport Plugin */
124/* ================================================================= */
125
126/*e \dref_UDPv4WanTransportBuiltinGroupDocs */
127
128/*i \file
129 * \ingroup NDDS_Transport_UDPv4_WAN_Plugin
130 * \brief UDPv4 WAN Transport Plugin interfaces and definitions.
131 */
132
133/* ================================================================= */
134/* UDPv4 WAN Transport Properties */
135/* ================================================================= */
136
137#ifdef DOXYGEN_DOCUMENTATION_ONLY
138/*e \dref_UDPv4_WAN_Transport_Property_t
139 */
141 /*e \dref_UDPv4_WAN_Transport_Property_t_parent */
143
144 /*e \dref_UDPv4_WAN_Transport_Property_t_send_socket_buffer_size */
146
147 /*e \dref_UDPv4_WAN_Transport_Property_t_recv_socket_buffer_size */
149
150 /*e \dref_UDPv4_WAN_Transport_Property_t_ignore_loopback_interface */
152
153 /*e \dref_UDPv4_WAN_Transport_Property_t_ignore_nonup_interfaces */
155
156 /*e \dref_UDPv4_WAN_Transport_Property_t_ignore_nonrunning_interfaces */
158
159 /*e \dref_UDPv4_WAN_Transport_Property_t_no_zero_copy */
160 RTI_INT32 no_zero_copy;
161
162 /*e \dref_UDPv4_WAN_Transport_Property_t_send_blocking */
163 RTI_INT32 send_blocking;
164
165 /*e \dref_UDPv4_WAN_Transport_Property_t_use_checksum */
166 RTI_INT32 use_checksum;
167
168 /*e \dref_UDPv4_WAN_Transport_Property_t_transport_priority_mask */
170
171 /*e \dref_UDPv4_WAN_Transport_Property_t_transport_priority_mapping_low */
173
174 /*e \dref_UDPv4_WAN_Transport_Property_t_transport_priority_mapping_high */
176
177 /*e \dref_UDPv4_WAN_Transport_Property_t_send_ping */
178 RTI_INT32 send_ping;
179
180 /*e \dref_UDPv4_WAN_Transport_Property_t_force_interface_poll_detection */
182
183 /*e \dref_UDPv4_WAN_Transport_Property_t_interface_poll_period */
185
186 /*e \dref_UDPv4_WAN_Transport_Property_t_protocol_overhead_max */
188
189 /*e \dref_UDPv4_WAN_Transport_Property_t_disable_interface_tracking */
191
192 /*e \dref_UDPv4_WAN_Transport_Property_t_public_address */
194
195 /*e \dref_UDPv4_WAN_Transport_Property_t_comm_ports_list */
197
198 /*e \dref_UDPv4_WAN_Transport_Property_t_comm_ports_list_length */
200
201 /*e \dref_UDPv4_WAN_Transport_Property_t_port_offset */
202 RTI_INT32 port_offset;
203
204 /*e \dref_UDPv4_WAN_Transport_Property_t_binding_ping_period */
206};
207#endif
208
209#define NDDS_Transport_UDPv4_Property_t NDDS_Transport_UDP_Property_t
210#define NDDS_Transport_UDPv4_WAN_Property_t NDDS_Transport_UDP_Property_t
211
212/*i \ingroup NDDS_Transport_UDPv4_Plugin
213 * \brief UDPv4 plugin class string name
214 */
215#define NDDS_TRANSPORT_UDPV4_CLASS_NAME "udpv4"
216
217/*i \ingroup NDDS_Transport_UDPv4_Plugin
218 * \brief UDPv4 plugin class string name
219 */
220#define NDDS_TRANSPORT_UDPV4_WAN_CLASS_NAME "udpv4_wan"
221
222/*i \ingroup NDDS_Transport_UDPv4_Plugin
223 * \brief UDPv4 builtin plugin alias
224 */
225#define NDDS_TRANSPORT_BUILTIN_UDPV4_ALIAS "builtin.udpv4"
226
227/*i \ingroup NDDS_Transport_UDPv4_Plugin
228 * \brief UDPv4 builtin plugin alias
229 */
230#define NDDS_TRANSPORT_BUILTIN_UDPV4_WAN_ALIAS "builtin.udpv4_wan"
231
232/*e \ingroup NDDS_Transport_UDPv4_Plugin
233 * \brief Default value of NDDS_Transport_Property_t#address_bit_count
234 */
235#define NDDS_TRANSPORT_UDPV4_ADDRESS_BIT_COUNT (32)
236
237/*e \ingroup NDDS_Transport_UDPv4_Plugin
238 * \brief Default value of NDDS_Transport_Property_t#address_bit_count for
239 * UDPv4 asymmetric transport
240 */
241#define NDDS_TRANSPORT_UDPV4_WAN_ADDRESS_BIT_COUNT (128)
242
243/*e \ingroup NDDS_Transport_UDPv4_Plugin
244 * \brief Default value of NDDS_Transport_Property_t#properties_bitmap.
245 */
246#define NDDS_TRANSPORT_UDPV4_PROPERTIES_BITMAP_DEFAULT \
247 NDDS_TRANSPORT_UDP_PROPERTIES_BITMAP_DEFAULT
248
249/*e \ingroup NDDS_Transport_UDPv4_Plugin
250 * \brief Default value of
251 * NDDS_Transport_Property_t#gather_send_buffer_count_max.
252 *
253 * This is also the maximum value that can be used when instantiating the UDP
254 * transport.
255 *
256 * 16 is sufficient for \ndds, but more may improve discovery and reliable
257 * performance.
258 * Porting note: find out what the maximum gather buffer count is on your OS!
259 */
260#define NDDS_TRANSPORT_UDPV4_GATHER_SEND_BUFFER_COUNT_MAX_DEFAULT \
261 NDDS_TRANSPORT_UDP_GATHER_SEND_BUFFER_COUNT_MAX_DEFAULT
262
263/*e \dref_UDPv4Transport_SOCKET_BUFFER_SIZE_OS_MAX
264 */
265#define NDDS_TRANSPORT_UDPV4_SOCKET_BUFFER_SIZE_OS_MAX \
266 NDDS_TRANSPORT_UDP_SOCKET_BUFFER_SIZE_OS_MAX
267
268/*e \dref_UDPv4Transport_SOCKET_BUFFER_SIZE_OS_DEFAULT
269 */
270#define NDDS_TRANSPORT_UDPV4_SOCKET_BUFFER_SIZE_OS_DEFAULT \
271 NDDS_TRANSPORT_UDP_SOCKET_BUFFER_SIZE_OS_DEFAULT
272
273/*e \dref_UDPv4Transport_SEND_SOCKET_BUFFER_SIZE_DEFAULT
274 */
275#define NDDS_TRANSPORT_UDPV4_SEND_SOCKET_BUFFER_SIZE_DEFAULT \
276 NDDS_TRANSPORT_UDP_SEND_SOCKET_BUFFER_SIZE_DEFAULT
277
278/*e \dref_UDPv4Transport_RECV_SOCKET_BUFFER_SIZE_DEFAULT
279 */
280#define NDDS_TRANSPORT_UDPV4_RECV_SOCKET_BUFFER_SIZE_DEFAULT \
281 NDDS_TRANSPORT_UDP_RECV_SOCKET_BUFFER_SIZE_DEFAULT
282
283/*e \ingroup NDDS_Transport_UDPv4_Plugin
284 * \brief Maximum value of NDDS_Transport_Property_t#message_size_max.
285 */
286#define NDDS_TRANSPORT_UDPV4_PAYLOAD_SIZE_MAX (65507)
287
288/*e \ingroup NDDS_Transport_UDPv4_Plugin
289 * \brief Maximum value of NDDS_Transport_Property_t#message_size_max.
290 */
291#if defined(RTI_INTY)
292 #define NDDS_TRANSPORT_UDPV4_MESSAGE_SIZE_MAX_DEFAULT (9216)
293#else
294 #define NDDS_TRANSPORT_UDPV4_MESSAGE_SIZE_MAX_DEFAULT \
295 NDDS_TRANSPORT_UDPV4_PAYLOAD_SIZE_MAX
296#endif
297
298/*e \ingroup NDDS_Transport_UDPv4_WAN_Plugin
299 * \brief Maximum value of NDDS_Transport_Property_t#message_size_max.
300 */
301#define NDDS_TRANSPORT_UDPV4_WAN_MESSAGE_SIZE_MAX_DEFAULT (1400)
302
303#define NDDS_TRANSPORT_UDPV4_DATAGRAM_LENGTH_MAX \
304 NDDS_TRANSPORT_UDP_DATAGRAM_LENGTH_MAX
305
306/*e \ingroup NDDS_Transport_UDPv4_Plugin
307 * \brief Default value of NDDS_Transport_UDPv4_Property_t#multicast_ttl.
308 */
309#define NDDS_TRANSPORT_UDPV4_MULTICAST_TTL_DEFAULT \
310 NDDS_TRANSPORT_UDP_MULTICAST_TTL_DEFAULT
311
312
313#define NDDS_TRANSPORT_UDPV4_USE_MULTICAST_DEFAULT \
314 NDDS_TRANSPORT_UDP_USE_MULTICAST_DEFAULT
315
316
317/*e \dref_UDPv4Transport_IGNORE_LOOPBACK_DISABLED
318 */
319#define NDDS_TRANSPORT_UDPV4_IGNORE_LOOPBACK_DISABLED \
320 NDDS_TRANSPORT_UDP_IGNORE_LOOPBACK_DISABLED
321
322/*e \dref_UDPv4Transport_IGNORE_LOOPBACK_ENABLED
323 */
324#define NDDS_TRANSPORT_UDPV4_IGNORE_LOOPBACK_ENABLED \
325 NDDS_TRANSPORT_UDP_IGNORE_LOOPBACK_ENABLED
326
327/*e \dref_UDPv4Transport_IGNORE_LOOPBACK_AUTO
328 */
329#define NDDS_TRANSPORT_UDPV4_IGNORE_LOOPBACK_AUTO \
330 NDDS_TRANSPORT_UDP_IGNORE_LOOPBACK_AUTO
331
332
333/*e \dref_UDPv4Transport_USE_CHECKSUM_DISABLED
334 */
335#define NDDS_TRANSPORT_UDPV4_USE_CHECKSUM_DISABLED (0)
336
337/*e \dref_UDPv4Transport_USE_CHECKSUM_ENABLED
338 */
339#define NDDS_TRANSPORT_UDPV4_USE_CHECKSUM_ENABLED (1)
340
341
342/*e \dref_UDPv4Transport_BLOCKING_NEVER
343 */
344#define NDDS_TRANSPORT_UDPV4_BLOCKING_NEVER NDDS_TRANSPORT_UDP_BLOCKING_NEVER
345
346/*e \dref_UDPv4Transport_BLOCKING_ALWAYS
347 */
348#define NDDS_TRANSPORT_UDPV4_BLOCKING_ALWAYS NDDS_TRANSPORT_UDP_BLOCKING_ALWAYS
349#define NDDS_TRANSPORT_UDPV4_BLOCKING_UNICAST_ONLY \
350 NDDS_TRANSPORT_UDP_BLOCKING_UNICAST_ONLY
351
352/*e \dref_UDPv4Transport_BLOCKING_DEFAULT
353 */
354#define NDDS_TRANSPORT_UDPV4_BLOCKING_DEFAULT \
355 NDDS_TRANSPORT_UDP_BLOCKING_DEFAULT
356
357/*e \ingroup NDDS_Transport_UDPv4_Plugin
358 * \brief Use this to initialize a NDDS_Transport_UDPv4_Property_t structure.
359 */
360#define NDDS_TRANSPORT_UDPV4_PROPERTY_DEFAULT \
361 { \
362 { \
363 NDDS_TRANSPORT_CLASSID_UDPv4, \
364 NDDS_TRANSPORT_UDPV4_ADDRESS_BIT_COUNT, \
365 NDDS_TRANSPORT_UDPV4_PROPERTIES_BITMAP_DEFAULT, \
366 NDDS_TRANSPORT_UDPV4_GATHER_SEND_BUFFER_COUNT_MAX_DEFAULT, \
367 NDDS_TRANSPORT_UDPV4_MESSAGE_SIZE_MAX_DEFAULT, \
368 NULL, \
369 0, /* allow_interfaces_list */ \
370 NULL, \
371 0, /* deny_interfaces_list */ \
372 NULL, \
373 0, /* allow_multicast_interfaces_list */ \
374 NULL, \
375 0, /* deny_multicast_interfaces_list */ \
376 NDDS_TRANSPORT_UUID_UNKNOWN, /* transport_uuid */ \
377 NULL, /* domain_participant_ptr */ \
378 NULL, /* domain_participant_forwarder */ \
379 NULL, /* thread_name_prefix */ \
380 NDDS_TRANSPORT_LENGTH_UNLIMITED, /* max_interface_count */ \
381 }, \
382 NDDS_TRANSPORT_UDPV4_SEND_SOCKET_BUFFER_SIZE_DEFAULT, \
383 NDDS_TRANSPORT_UDPV4_RECV_SOCKET_BUFFER_SIZE_DEFAULT, \
384 1, /* unicast_enabled \
385 */ \
386 NDDS_TRANSPORT_UDPV4_USE_MULTICAST_DEFAULT, /* multicast_enabled \
387 */ \
388 NDDS_TRANSPORT_UDPV4_MULTICAST_TTL_DEFAULT, 0, /* multicast \
389 loopback \
390 enabled */ \
391 NDDS_TRANSPORT_UDPV4_IGNORE_LOOPBACK_AUTO, /* (auto-)ignore \
392 loopback */ \
393 1, /* ignore_nonup_interfaces */ \
394 1, /* ignore_nonrunning_interfaces */ \
395 0, /* no_zero_copy */ \
396 NDDS_TRANSPORT_UDPV4_BLOCKING_DEFAULT, 0, /* enable_v4mapped \
397 */ \
398 NDDS_TRANSPORT_UDPV4_USE_CHECKSUM_ENABLED, /* use_checksum */ \
399 0, 0, 0xff /* no mapping to IP_TOS by default */, \
400 1, /* send_ping \
401 */ \
402 0, /* don't force polling interface tracker by default */ \
403 500, /* 500 millisecs is the default polling period*/ \
404 1, /* reuse multicast receive resource */ \
405 28, /* protocol_overhead_max (UDP(8)+IP(20)) */ \
406 0, /* disable interface tracking */ \
407 5000, /* join_multicast_group_timeout */ \
408 NULL, /* public_address */ \
409 NULL, 0, /* comm_ports_list */ \
410 NULL, /* wan_listener */ \
411 0, /* port_offset */ \
412 0, /* binding_ping_period */ \
413 0, /* binding_ping_mapping_expiration */ \
414 NULL, /* plugin_enabled_function_ptr */ \
415 RTI_FALSE, /* gather_detailed_statistics */ \
416 RTI_FALSE, /* drop_samples_by_guid_prefix */ \
417 RTI_OSAPI_RTPS_GUID_PREFIX_UNKNOWN /* guid_prefix_to_drop */ \
418 }
419
420/*e \ingroup NDDS_Transport_UDPv4_WAN_Plugin
421 * \brief Use this to initialize a NDDS_Transport_UDPv4_WAN_Property_t
422 * structure.
423 */
424#define NDDS_TRANSPORT_UDPV4_WAN_PROPERTY_DEFAULT \
425 { \
426 { \
427 NDDS_TRANSPORT_CLASSID_UDPv4_WAN, \
428 NDDS_TRANSPORT_UDPV4_WAN_ADDRESS_BIT_COUNT, \
429 NDDS_TRANSPORT_UDPV4_PROPERTIES_BITMAP_DEFAULT, \
430 NDDS_TRANSPORT_UDPV4_GATHER_SEND_BUFFER_COUNT_MAX_DEFAULT, \
431 NDDS_TRANSPORT_UDPV4_WAN_MESSAGE_SIZE_MAX_DEFAULT, \
432 NULL, \
433 0, /* allow_interfaces_list */ \
434 NULL, \
435 0, /* deny_interfaces_list */ \
436 NULL, \
437 0, /* allow_multicast_interfaces_list */ \
438 NULL, \
439 0, /* deny_multicast_interfaces_list */ \
440 NDDS_TRANSPORT_UUID_UNKNOWN, /* transport_uuid */ \
441 NULL, /* domain_participant_ptr */ \
442 NULL, /* domain_participant_forwarder */ \
443 NULL, /* thread_name_prefix */ \
444 NDDS_TRANSPORT_LENGTH_UNLIMITED, /* max_interface_count */ \
445 }, \
446 NDDS_TRANSPORT_UDPV4_SEND_SOCKET_BUFFER_SIZE_DEFAULT, \
447 NDDS_TRANSPORT_UDPV4_RECV_SOCKET_BUFFER_SIZE_DEFAULT, \
448 1, /* unicast_enabled \
449 */ \
450 0, /* multicast_enabled */ \
451 NDDS_TRANSPORT_UDPV4_MULTICAST_TTL_DEFAULT, 0, /* multicast \
452 loopback \
453 enabled */ \
454 NDDS_TRANSPORT_UDPV4_IGNORE_LOOPBACK_AUTO, /* (auto-)ignore \
455 loopback */ \
456 1, /* ignore_nonup_interfaces */ \
457 1, /* ignore_nonrunning_interfaces */ \
458 0, /* no_zero_copy */ \
459 NDDS_TRANSPORT_UDPV4_BLOCKING_DEFAULT, 0, /* enable_v4mapped \
460 */ \
461 NDDS_TRANSPORT_UDPV4_USE_CHECKSUM_ENABLED, /* use_checksum */ \
462 0, 0, 0xff /* no mapping to IP_TOS by default */, \
463 1, /* send_ping \
464 */ \
465 0, /* don't force polling interface tracker by default */ \
466 500, /* 500 millisecs is the default polling period*/ \
467 1, /* reuse multicast receive resource */ \
468 28, /* protocol_overhead_max (UDP(8)+IP(20)) */ \
469 0, /* disable interface tracking */ \
470 5000, /* join_multicast_group_timeout */ \
471 NULL, /* public_address */ \
472 NULL, 0, /* comm_ports_list */ \
473 NULL, /* wan_listener */ \
474 125, /* port_offset */ \
475 1000, /* binding_ping_period */ \
476 0, /* binding_ping_mapping_expiration */ \
477 NULL, /* plugin_enabled_function_ptr */ \
478 RTI_FALSE, /* gather_detailed_statistics */ \
479 RTI_FALSE, /* drop_samples_by_guid_prefix */ \
480 RTI_OSAPI_RTPS_GUID_PREFIX_UNKNOWN /* guid_prefix_to_drop */ \
481 }
482
483/* ================================================================= */
484/* InterfaceListener Class */
485/* ================================================================= */
486
487/*i
488 * \defgroup NDDS_Transport_UDP_InterfaceListenerClass
489 * NDDS_Transport_UDP_InterfaceListener \ingroup NDDS_Transport_UDP_Plugin
490 * \brief Interface for IPv4 interface acceptance/rejection
491 *
492 * @mtsafety See NDDS_Transport_UDP_public UML diagram
493 *
494 * @see NDDS_Transport_UDPv4_newI
495 */
496#define NDDS_Transport_UDPv4_InterfaceListener \
497 NDDS_Transport_UDP_InterfaceListener
498
499/*i \ingroup NDDS_Transport_UDPv4_InterfaceListenerClass
500 * \brief A user-provided function to be used to filter out particular
501 * network interfaces to be used by the Transport Plugin.
502 *
503 * The user may implement this function and pass it to an
504 * instance of an UDPv4 Transport Plugin to reject or accept network
505 * interfaces that the plugin offers as ones to use to receive
506 * messages.
507 *
508 * When \ndds contacts other applications, it will provide a list of
509 * interfaces that other applications can use to send messages (on a
510 * plugin by plugin basis). The addresses of the interfaces are used
511 * as the destination addresses of messages that are sent. If a plugin
512 * rejects one of the available network interfaces, then that interface
513 * will not be offered as one to which other plugins should send
514 * messages.
515 *
516 * For interfaces that can be used by the plugin, this function also
517 * enables the user to select which interfaces \ndds is allowed to use
518 * in sending multicast messages. The set of interfaces enabled for
519 * multicast sending is a subset of the interfaces that can be used for
520 * receiving. That is, an interface cannot be enabled to send
521 * multicast messages but disabled for receiving unicast messages.
522 *
523 * Only IP network interfaces that are "UP" (enabled by the OS and
524 * ready to use) will be passed to this filter function. The ones that
525 * are "DOWN" will not be used by definition.
526 *
527 * @param plugin \st_in The instance of the plugin for which the filter
528 * is being called.
529 *
530 * @param multicast_enabled_out \st_out The filter should set whether
531 * or not the plugin is allowed to use this interface for
532 * sending/receiving multicast messages.
533 *
534 * @param interface_in \st_in An interface offered by the plugin as a
535 * candidate for receive messages.
536 *
537 * @return 1 to use the interface, 0 to reject using the interface.
538 * \c multicast_enabled_out will indicate whether it is also OK
539 * to use the interface to send multicast messages.
540 */
541#define NDDS_Transport_UDPv4_Interface_Filter_Fcn \
542 NDDS_Transport_UDP_Interface_Filter_Fcn
543
544/* ================================================================= */
545/* UDPv4/IPv4 InterfaceListener */
546/* ================================================================= */
547
548
549/*i \ingroup NDDS_Transport_UDPv4_InterfaceListenerClass
550 * \brief Default implementation of the Interface listener.
551 *
552 * The default interface listener applies the interface selection preferences
553 * specified in the NDDS_Transport_UDP_Property_t#parent:
554 * - NDDS_Transport_Property_t#allow_interfaces_list,
555 * - NDDS_Transport_Property_t#deny_interfaces_list,
556 * - NDDS_Transport_Property_t#allow_multicast_interfaces_list,
557 * - NDDS_Transport_Property_t#deny_multicast_interfaces_list
558 *
559 * The filter assumes that the strings passed in the address filter
560 * are in UDPv4 dot notation, possibly containing wildcards. For example:
561 * 10.10.30.232
562 * 10.10.*.*
563 * 192.168.1.*
564 * etc.
565 *
566 * @see NDDS_Transport_UDP_Interface_Filter_Fcn
567 */
568extern NDDS_Transport_DllExport RTI_INT32
569NDDS_Transport_UDPv4_InterfaceListener_onInterface(
570 struct NDDS_Transport_UDPv4_InterfaceListener *self,
571 struct NDDS_Transport_UDPv4 *plugin,
572 RTI_INT32 *multicast_enabled_out,
573 NDDS_Transport_Interface_t *interface_in,
574 const char *interface_name_in);
575
576/*i \ingroup NDDS_Transport_UDPv4_InterfaceListenerClass
577 * \brief Default interface listener.
578 */
579extern NDDS_Transport_DllVariable struct NDDS_Transport_UDP_InterfaceListener
580 NDDS_Transport_UDPv4_g_interfaceListener;
581
582/* ================================================================= */
583/* Socket Factory Class */
584/* ================================================================= */
585/*i
586 * \defgroup NDDS_Transport_UDP_SocketFactoryClass
587 * NDDS_Transport_UDP_SocketFactory \ingroup NDDS_Transport_UDPv4_Plugin \brief
588 * Interface for IPv4 socket creation and destruction.
589 *
590 * @mtsafety See NDDS_Transport_UDPv4_public UML diagram
591 *
592 * @see NDDS_Transport_UDPv4_new
593 */
594
595#define NDDS_Transport_UDPv4_SocketFactory_Send_Socket_Create_Fcn \
596 NDDS_Transport_UDP_SocketFactory_Send_Socket_Create_Fcn
597
598
599#define NDDS_Transport_UDPv4_SocketFactory_Receive_Socket_Create_Fcn \
600 NDDS_Transport_UDP_SocketFactory_Receive_Socket_Create_Fcn
601
602
603#define NDDS_Transport_UDPv4_SocketFactory_Socket_Destroy_Fcn \
604 NDDS_Transport_UDP_SocketFactory_Socket_Destroy_Fcn
605
606
607#define NDDS_Transport_UDPv4_SocketFactory NDDS_Transport_UDP_SocketFactory
608
609
610#define NDDS_Transport_UDPv4_SocketFactory_is_valid \
611 NDDS_Transport_UDP_SocketFactory_is_valid
612
613/* ================================================================= */
614/* IP Socket Factory Class */
615/* ================================================================= */
616
617/*i \ingroup NDDS_Transport_UDP_SocketFactoryClass
618 * \brief Default implementation of the socket creation factory method
619 * for UDPv4 transport.
620 *
621 * @post Sending socket is not bound.
622 *
623 * @see NDDS_Transport_UDP_SocketFactory_Send_Socket_Create_Fcn
624 */
625extern NDDS_Transport_DllExport RTI_INT32
626NDDS_Transport_UDPv4_SocketFactory_create_send_socket(
627 struct NDDS_Transport_UDPv4_SocketFactory *me,
628 NDDS_Transport_Port_t *port_out,
629 const struct NDDS_Transport_UDPv4 *ip_in,
630 const NDDS_Transport_Address_t *interface_address_in,
631 const int *interface_index_in);
632
633/*i \ingroup NDDS_Transport_UDP_SocketFactoryClass
634 * \brief Default implementation of the socket creation factory method.
635 *
636 * @post socket is created and bound
637 *
638 * @see NDDS_Transport_UDP_SocketFactory_Receive_Socket_Create_Fcn
639 */
640extern NDDS_Transport_DllExport RTI_INT32
641NDDS_Transport_UDPv4_SocketFactory_create_receive_socket(
642 struct NDDS_Transport_UDPv4_SocketFactory *me,
643 NDDS_Transport_Port_t *port_inout,
644 const struct NDDS_Transport_UDPv4 *ip_in,
645 const NDDS_Transport_Address_t *multicast_address_in);
646
647/*i \ingroup NDDS_Transport_UDP_SocketFactoryClass
648 * \brief Default implementation of the socket destroy factory method
649 * @see NDDS_Transport_UDP_SocketFactory_Socket_Destroy_Fcn
650 */
651extern NDDS_Transport_DllExport RTI_INT32
652NDDS_Transport_UDPv4_SocketFactory_destroy_socket(
653 struct NDDS_Transport_UDPv4_SocketFactory *me,
654 RTI_INT32 s_in);
655
656/*i \ingroup NDDS_Transport_UDP_SocketFactoryClass
657 * \brief Used to bind a socket to the desired port
658 *
659 * @param s_in \b In. socket to be bound
660 *
661 * @param port_desired_in \b In. port number to bind to, use 0 to be
662 * assigned an ephemeral port.
663 *
664 * @return if successful, the port number bound to or 0 if
665 * unsuccessful.
666 */
667extern NDDS_Transport_DllExport NDDS_Transport_Port_t
668NDDS_Transport_UDPv4_Socket_bind(
669 RTI_INT32 s_in,
670 const NDDS_Transport_Port_t port_desired_in);
671
672/*i \ingroup NDDS_Transport_UDP_SocketFactoryClass
673 * \brief Used to bind a socket to the desired port with specified IP
674 *
675 * @param s_in \b In. socket to be bound
676 *
677 * @param port_desired_in \b In. port number to bind to, use 0 to be
678 * assigned an ephemeral port.
679 *
680 * @param ip_in \b In. IP to bind
681 *
682 * @return if successful, the port number bound to or 0 if
683 * unsuccessful.
684 */
685extern NDDS_Transport_DllExport NDDS_Transport_Port_t
686NDDS_Transport_UDPv4_Socket_bind_with_ip(
687 RTI_INT32 s_in,
688 const NDDS_Transport_Port_t port_desired_in,
689 unsigned int ip_in);
690
691/*i \ingroup NDDS_Transport_UDP_SocketFactoryClass
692 * \brief Default socket factory.
693 */
694extern NDDS_Transport_DllVariable struct NDDS_Transport_UDPv4_SocketFactory
695 NDDS_Transport_UDPv4_g_socketFactory;
696
697/*i \ingroup NDDS_Transport_UDPv4_Plugin
698 * \brief Realization of NDDS_Transport_Get_Class_Name_Fcn_cEA for IPv4
699 * transports.
700 *
701 * Returns the string "udpv4".
702 *
703 * @see NDDS_Transport_Get_Class_Name_Fcn_cEA for complete
704 * documentation.
705 */
706#define NDDS_Transport_UDPv4_get_class_name_cEA \
707 NDDS_Transport_UDP_get_class_name_cEA
708
709/*e \ingroup NDDS_Transport_UDPv4_Plugin
710 * \brief Realization of NDDS_Transport_String_To_Address_Fcn_cEA for IP
711 * transports.
712 *
713 * Converts a host name string to a IPv4 address.
715 * @param self NOT USED. May be NULL.
716 *
717 * @param address_out \st_out The corresponding numerical value in IPv4
718 * format.
719 *
720 * @param address_in \st_in The name of the IPv4 address. It can be a
721 * dot notation name or a host name. If NULL, then the IP address of
722 * the localhost will be returned.
723 *
724 * @see NDDS_Transport_String_To_Address_Fcn_cEA for complete
725 * documentation.
726 */
727#define NDDS_Transport_UDPv4_string_to_address_cEA \
728 NDDS_Transport_UDP_string_to_address_cEA
729
730/* ================================================================= */
731/* UDP/IP Transport Plugin */
732/* ================================================================= */
733
734/*e \ingroup NDDS_Transport_UDPv4_Plugin
735 * \brief Create an instance of a UDPv4 Transport Plugin.
736 *
737 * An application may create and register multiple instances of this
738 * Transport Plugin with \ndds. Multiple instances of the plugin may be useful
739 * for partitioning the network interfaces across multiple \ndds domains.
740 * However, note that the underlying transport, the operating system's IP layer,
741 * is still a "singleton." For example, if a unicast transport has already
742 * bound to a port, and another unicast transport tries to bind to the same
743 * port, the second attempt will fail.
744 *
745 * The transport plugin honors the interface/multicast "white" and "black"
746 * lists specified in the NDDS_Transport_UDP_Property_t#parent:
747 * - NDDS_Transport_Property_t#allow_interfaces_list,
748 * - NDDS_Transport_Property_t#deny_interfaces_list,
749 * - NDDS_Transport_Property_t#allow_multicast_interfaces_list,
750 * - NDDS_Transport_Property_t#deny_multicast_interfaces_list
751 *
752 * The format of a string in these lists is assumed to be in standard IPv4
753 * dot notation, possibly containing wildcards. For example:
754 * - 10.10.30.232
755 * - 10.10.*.*
756 * - 192.168.1.*
757 * - etc.
758 * Strings not in the correct format will be ignored.
759 *
760 * @param property_in \st_in Desired behavior of this transport. May be
761 * NULL for default property.
762 *
763 * @return A UDPv4 Transport Plugin instance on success; or NULL on failure.
764 */
765extern NDDS_Transport_DllExport NDDS_Transport_Plugin *NDDS_Transport_UDPv4_new(
766 const struct NDDS_Transport_UDPv4_Property_t *property_in);
767
768/*e \ingroup NDDS_Transport_UDPv4_WAN_Plugin
769 * @brief Create an instance of a UDPv4_WAN Transport Plugin.
770 *
771 * An application may create and register multiple instances of this
772 * Transport Plugin with \ndds. Multiple instances of the plugin may be useful
773 * for partitioning the network interfaces across multiple \ndds domains.
774 * However, note that the underlying transport, the operating system's IP layer,
775 * is still a "singleton." For example, if a unicast transport has already
776 * bound to a port, and another unicast transport tries to bind to the same
777 * port, the second attempt will fail.
778 *
779 * The transport plugin honors the interface "white" and "black"
780 * lists specified in the NDDS_Transport_UDP_Property_t#parent:
781 * - NDDS_Transport_Property_t#allow_interfaces_list,
782 * - NDDS_Transport_Property_t#deny_interfaces_list,
783 *
784 * The format of a string in these lists is assumed to be in standard IPv4
785 * dot notation, possibly containing wildcards. For example:
786 * - 10.10.30.232
787 * - 10.10.*.*
788 * - 192.168.1.*
789 * - etc.
790 * Strings not in the correct format will be ignored.
791 *
792 * @param property_in \st_in Desired behavior of this transport. May be
793 * NULL for default property.
794 *
795 * @return A UDPv4_WAN Transport Plugin instance on success; or NULL on failure.
796 */
797extern NDDS_Transport_DllExport NDDS_Transport_Plugin *
799 const struct NDDS_Transport_UDPv4_WAN_Property_t *property_in);
800
801/*i \ingroup NDDS_Transport_UDPv4_Plugin
802 * \brief Create an instance of a UDPv4 Transport Plugin.
803 *
804 * \copydoc NDDS_Transport_UDPv4_new
805 *
806 * @param socket_factory_in \st_in The factory that will create all the
807 * sockets to be used in the transport. May be NULL if default factory
808 * is to be used. Only used by RTI internal testing.
809 * End users should set this parameter to NULL.
810 *
811 * @param interface_filter_in \st_in A function that will be used to
812 * filter out network interfaces that this plugin can use. May be NULL if
813 * default interface listener is to be used. The default listener uses
814 * The NDDS_Transport_UDP_Property_t#parent's lists to select the interfaces.
815 * Only used by RTI internal testing. End users should set this
816 * parameter to NULL.
817 *
818 * @exception RTI_LOG_MALLOC_FAILURE_d RTI_LOG_CREATION_FAILURE_s
819 * RTI_LOG_PRECONDITION_FAILURE RTI_LOG_INIT_FAILURE_s
820 */
821extern NDDS_Transport_DllExport NDDS_Transport_Plugin *
822NDDS_Transport_UDPv4_newI(
823 const struct NDDS_Transport_UDPv4_Property_t *property_in,
824 struct NDDS_Transport_UDPv4_SocketFactory *socket_factory_in,
825 struct NDDS_Transport_UDPv4_InterfaceListener *interface_listener_in);
826
827/*i \ingroup NDDS_Transport_UDPv4_WAN_Plugin
828 * @brief Create an instance of a UDPv4_WAN Transport Plugin.
829 *
830 * \copydoc NDDS_Transport_UDPv4_WAN_new
831 *
832 * @param socket_factory_in \st_in The factory that will create all the
833 * sockets to be used in the transport. May be NULL if default factory
834 * is to be used. Only used by RTI internal testing.
835 * End users should set this parameter to NULL.
836 *
837 * @param interface_filter_in \st_in A function that will be used to
838 * filter out network interfaces that this plugin can use. May be NULL if
839 * default interface listener is to be used. The default listener uses
840 * The NDDS_Transport_UDP_Property_t#parent's lists to select the interfaces.
841 * Only used by RTI internal testing. End users should set this
842 * parameter to NULL.
843 *
844 * @exception RTI_LOG_MALLOC_FAILURE_d RTI_LOG_CREATION_FAILURE_s
845 * RTI_LOG_PRECONDITION_FAILURE RTI_LOG_INIT_FAILURE_s
846 */
847extern NDDS_Transport_DllExport NDDS_Transport_Plugin *
848NDDS_Transport_UDPv4_WAN_newI(
849 const struct NDDS_Transport_UDPv4_WAN_Property_t *property_in,
850 struct NDDS_Transport_UDPv4_SocketFactory *socket_factory_in,
851 struct NDDS_Transport_UDPv4_InterfaceListener *interface_listener_in);
852
853
854#define NDDS_Transport_UDPv4_get_receive_interfaces_cEA \
855 NDDS_Transport_UDP_get_receive_interfaces_cEA
856
857
858#define NDDS_Transport_UDPv4_get_ignore_loopback_interface_status \
859 NDDS_Transport_UDP_get_ignore_loopback_interface_status
860
861
862#define NDDS_Transport_UDPv4_is_local_address \
863 NDDS_Transport_UDP_is_local_address
864
865
866#define NDDS_Transport_UDPv4_map_transport_priority \
867 NDDS_Transport_UDP_map_transport_priority
868
869/*i \ingroup NDDS_Transport_UDPv4_Plugin
870 \brief Definition of IPv4 local host.
871*/
872#define NDDS_TRANSPORT_UDPV4_ADDRESS_LOCALHOST \
873 { \
874 { \
875 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 0, 0, 1 \
876 } \
877 }
878
879
880#define NDDS_TRANSPORT_UDPV4_UNBLOCK_MESSAGE_SIZE \
881 NDDS_TRANSPORT_UDP_UNBLOCK_MESSAGE_SIZE
882
883
884#define NDDS_Transport_UDPv4_Statistics NDDS_Transport_UDP_Statistics
885
886
887#define NDDS_Transport_UDPv4_get_statistics NDDS_Transport_UDP_get_statistics
888
889
890#define NDDS_Transport_UDPv4_get_priority_range \
891 NDDS_Transport_UDP_get_priority_range
892
893#define NDDS_Transport_UDPv4_Address_print NDDS_Transport_UDP_Address_print
894
895extern NDDS_Transport_DllExport RTIBool
896NDDS_Transport_UDPv4_WAN_Address_to_string(
897 const NDDS_Transport_Address_t *me,
898 char *buffer,
899 size_t buffer_size_in);
900
901extern NDDS_Transport_DllExport void NDDS_Transport_UDPv4_WAN_Address_print(
902 const NDDS_Transport_Address_t *me,
903 const char *desc,
904 RTI_INT32 indent);
905
906
907#ifdef __cplusplus
908} /* extern "C" */
909#endif
910
911#include "transport/transport_udpv4_impl.h"
912
913#endif /* transport_udpv4_h */
RTI_UINT32 NDDS_Transport_Port_t
Type for storing RTI Connext RTPS ports.
Definition: transport_common.h:92
NDDS_Transport_Plugin * NDDS_Transport_UDPv4_new(const struct NDDS_Transport_UDPv4_Property_t *property_in)
Create an instance of a UDPv4 Transport Plugin.
NDDS_Transport_Plugin * NDDS_Transport_UDPv4_WAN_new(const struct NDDS_Transport_UDPv4_WAN_Property_t *property_in)
Create an instance of a UDPv4_WAN Transport Plugin.
Addresses are stored individually as network-ordered bytes.
Definition: transport_common_user.h:384
Storage for the description of a network interface used by a Transport Plugin.
Definition: transport_common.h:204
Base configuration structure that must be inherited by derived Transport Plugin classes.
Definition: transport_interface_user.h:38
Type for storing UDP WAN communication ports.
Definition: transport_udp.h:84
Configurable IPv4/UDP Transport-Plugin properties.
Definition: transport_udpv4.h:44
RTI_UINT32 transport_priority_mask
Set mask for use of transport priority field.
Definition: transport_udpv4.h:85
RTI_INT32 disable_interface_tracking
Disables detection of network interface changes.
Definition: transport_udpv4.h:109
RTI_INT32 port_offset
Port offset to allow multiple instances of UDPv4 transports in the same DDSDomainParticipant.
Definition: transport_udpv4.h:118
RTI_INT32 ignore_loopback_interface
Prevents the transport plugin from using the IP loopback interface.
Definition: transport_udpv4.h:67
RTI_INT32 send_blocking
Control blocking behavior of send sockets. CHANGING THIS FROM THE DEFAULT CAN CAUSE SIGNIFICANT PERFO...
Definition: transport_udpv4.h:79
struct NDDS_Transport_Property_t parent
Generic properties of all transport plugins.
Definition: transport_udpv4.h:46
RTI_INT32 transport_priority_mapping_high
Set high value of output range to IPv4 TOS.
Definition: transport_udpv4.h:91
RTI_INT32 send_ping
Configures whether to send PING messages.
Definition: transport_udpv4.h:94
RTI_INT32 multicast_ttl
Value for the time-to-live parameter for all multicast sends using this plugin.
Definition: transport_udpv4.h:61
RTI_INT32 multicast_enabled
Allows the transport plugin to use multicast for sending and receiving.
Definition: transport_udpv4.h:58
RTI_INT32 force_interface_poll_detection
Forces the interface tracker to use a polling mechanism to detect changes on the UDPv4 interfaces.
Definition: transport_udpv4.h:97
char * public_address
Public IP address associated with the transport instantiation.
Definition: transport_udpv4.h:115
RTI_INT32 multicast_loopback_disabled
Prevents the transport plugin from putting multicast packets onto the loopback interface.
Definition: transport_udpv4.h:64
RTI_INT32 no_zero_copy
[DEPRECATED] Prevents the transport plugin from doing a zero copy.
Definition: transport_udpv4.h:76
RTI_UINT32 interface_poll_period
Specifies the period in milliseconds to query for changes in the state of all the interfaces.
Definition: transport_udpv4.h:100
RTI_INT32 ignore_nonrunning_interfaces
Prevents the transport plugin from using a network interface that is not reported as RUNNING by the o...
Definition: transport_udpv4.h:73
RTI_INT32 send_socket_buffer_size
Size in bytes of the send buffer of a socket used for sending.
Definition: transport_udpv4.h:49
RTI_INT32 protocol_overhead_max
Maximum size in bytes of protocol overhead, including headers.
Definition: transport_udpv4.h:106
RTI_INT32 ignore_nonup_interfaces
[DEPRECATED] Prevents the transport plugin from using a network interface that is not reported as UP ...
Definition: transport_udpv4.h:70
RTI_UINT32 join_multicast_group_timeout
[Windows only] Defines how much time (milliseconds) to wait to join a multicast group address when a ...
Definition: transport_udpv4.h:112
RTI_INT32 transport_priority_mapping_low
Set low value of output range to IPv4 TOS.
Definition: transport_udpv4.h:88
RTI_INT32 use_checksum
Configures whether to send UDP checksum.
Definition: transport_udpv4.h:82
RTI_INT32 reuse_multicast_receive_resource
Controls whether or not to reuse multicast receive resources.
Definition: transport_udpv4.h:103
RTI_INT32 recv_socket_buffer_size
Size in bytes of the receive buffer of a socket used for receiving.
Definition: transport_udpv4.h:52
RTI_INT32 unicast_enabled
Allows the transport plugin to use unicast for sending and receiving.
Definition: transport_udpv4.h:55
Configurable IPv4/UDP WAN Transport-Plugin properties.
Definition: transport_udpv4.h:140
RTI_INT32 recv_socket_buffer_size
Size in bytes of the receive buffer of a socket used for receiving.
Definition: transport_udpv4.h:148
RTI_INT32 use_checksum
Configures whether to send UDP checksum.
Definition: transport_udpv4.h:166
RTI_INT32 send_blocking
Control blocking behavior of send sockets. CHANGING THIS FROM THE DEFAULT CAN CAUSE SIGNIFICANT PERFO...
Definition: transport_udpv4.h:163
RTI_UINT32 binding_ping_period
Specifies the period in milliseconds at which BINDING PINGS messages are sent to keep NAT mappings op...
Definition: transport_udpv4.h:205
RTI_INT32 no_zero_copy
[DEPRECATED] Prevents the transport plugin from doing a zero copy.
Definition: transport_udpv4.h:160
RTI_INT32 transport_priority_mapping_low
Set low value of output range to IPv4 TOS.
Definition: transport_udpv4.h:172
RTI_INT32 send_ping
Configures whether to send PING messages.
Definition: transport_udpv4.h:178
RTI_INT32 port_offset
Port offset to allow coexistence with built-in UDPv4 transport.
Definition: transport_udpv4.h:202
struct NDDS_Transport_UDP_WAN_CommPortsMappingInfo * comm_ports_list
Configures the public and private UDP ports that a transport instance uses to receive/send RTPS data.
Definition: transport_udpv4.h:196
struct NDDS_Transport_Property_t parent
Generic properties of all transport plugins.
Definition: transport_udpv4.h:142
RTI_INT32 ignore_nonup_interfaces
[DEPRECATED] Prevents the transport plugin from using a network interface that is not reported as UP ...
Definition: transport_udpv4.h:154
RTI_INT32 transport_priority_mapping_high
Set high value of output range to IPv4 TOS.
Definition: transport_udpv4.h:175
char * public_address
Public IP address associated with the transport instantiation.
Definition: transport_udpv4.h:193
RTI_INT32 send_socket_buffer_size
Size in bytes of the send buffer of a socket used for sending.
Definition: transport_udpv4.h:145
RTI_INT32 ignore_nonrunning_interfaces
Prevents the transport plugin from using a network interface that is not reported as RUNNING by the o...
Definition: transport_udpv4.h:157
RTI_INT32 comm_ports_list_length
Number of elements in the NDDS_Transport_UDPv4_WAN_Property_t::comm_ports_list.
Definition: transport_udpv4.h:199
RTI_UINT32 transport_priority_mask
Set mask for use of transport priority field.
Definition: transport_udpv4.h:169
RTI_INT32 disable_interface_tracking
Disables detection of network interface changes.
Definition: transport_udpv4.h:190
RTI_UINT32 interface_poll_period
Specifies the period in milliseconds to query for changes in the state of all the interfaces.
Definition: transport_udpv4.h:184
RTI_INT32 ignore_loopback_interface
Prevents the transport plugin from using the IP loopback interface.
Definition: transport_udpv4.h:151
RTI_INT32 force_interface_poll_detection
Forces the interface tracker to use a polling mechanism to detect changes on the UDPv4 interfaces.
Definition: transport_udpv4.h:181
RTI_INT32 protocol_overhead_max
Maximum size in bytes of protocol overhead, including headers.
Definition: transport_udpv4.h:187