RTI Connext DDS Micro  Version 2.4.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
netio_interface.h
Go to the documentation of this file.
1 /*
2  * FILE: netio_interface.h - NETIO API
3  *
4  * Copyright 2012-2015 Real-Time Innovations, Inc.
5  *
6  * No duplications, whole or partial, manual or electronic, may be made
7  * without express written permission. Any such copies, or
8  * revisions thereof, must display this notice unaltered.
9  * This code contains trade secrets of Real-Time Innovations, Inc.
10  *
11  * Modification History
12  * --------------------
13  * 17dec2015,eh MICRO-1511: add NETIO_PacketInfo.valid_key
14  * 04nov2015,tk MICRO-1505 Reduce memory footprint
15  * 03feb2014,eh MICRO-714 Change ack to acknack
16  * 27jan2014,eh MICRO-714 Add post_event. For reliable reader activity change
17  * 17may2013,eh MICRO-385 Remove unused fns/fields of packet
18  * 25apr2012,tk Written
19  */
20 
21 /*ce
22  * \file
23  * \brief Generic NETIO_Interface functions
24  *
25  * \details
26  * This file contains generic NETIO interface functions. A NETIO_Interface is
27  * a base-class and is typically not instantiated on its own. Derived classes
28  * call methods here to initialize/finalize a base-class. This file also
29  * defines the NETIO interface structure as well as the NETIO_Packet structure
30  * and protocol types.
31  */
32 #ifndef netio_interface_h
33 #define netio_interface_h
34 
35 #ifndef netio_dll_h
36 #include "netio/netio_dll.h"
37 #endif
38 
39 #ifndef osapi_config_h
40 #include "osapi/osapi_config.h"
41 #endif
42 
43 #ifndef osapi_types_h
44 #include "osapi/osapi_types.h"
45 #endif
46 #ifndef osapi_time_h
47 #include "osapi/osapi_time.h"
48 #endif
49 #ifndef reda_sequenceNumber_h
50 #include "reda/reda_sequenceNumber.h"
51 #endif
52 
53 #ifndef db_api_h
54 #include "db/db_api.h"
55 #endif
56 
57 #ifndef rt_rt_h
58 #include "rt/rt_rt.h"
59 #endif
60 
61 #ifndef netio_address_h
62 #include "netio/netio_address.h"
63 #endif
64 
65 #ifndef cdr_stream_h
66 #include "cdr/cdr_stream.h"
67 #endif
68 
69 #ifdef __cplusplus
70 extern "C"
71 {
72 #endif
73 
74 /*ce
75  * \brief Default name for the automatically registered UDP transport
76  */
77 NETIODllVariable extern const char* const NETIO_DEFAULT_UDP_NAME;
78 
79 /*ce
80  * \brief Default name for the automatically registered INTRA transport
81  */
82 NETIODllVariable extern const char* const NETIO_DEFAULT_INTRA_NAME;
83 
84 /*ce
85  * \brief Default name for the automatically registered RTPS interface
86  */
87 NETIODllVariable extern const char* const NETIO_DEFAULT_RTPS_NAME;
88 
89 /*ci
90  * \defgroup NETIO_PacketClass NETIO Packet API
91  * \ingroup NETIOCommon
92  * \brief NETIO_Packet implementation
93  */
94 /*ci
95  * \addtogroup NETIO_PacketClass
96  * @{
97  */
98 /*
99  * The following constants are passed as part of a NETIO_Packet to
100  * indicate what protocol it originated from. It may be used the receiver
101  */
102 /*ci
103  * \def NETIO_PROTOCOL_INTRA
104  * \brief The packet originates from the INTRA protocol
105  */
106 #define NETIO_PROTOCOL_INTRA (1)
107 
108 /*ci
109  * \def NETIO_PROTOCOL_RTPS
110  * \brief The packet originates from the RTPS protocol
111  */
112 #define NETIO_PROTOCOL_RTPS (2)
113 
114 /*ci
115  * \def NETIO_PROTOCOL_UDP
116  * \brief The packet originates from the UDP protocol
117  */
118 #define NETIO_PROTOCOL_UDP (3)
119 
120 /*
121  * The following constants are passed as part of a NETIO_Packet to
122  * provide meta information about the content (if any).
123  */
124 /*ci
125  * \def NETIO_RTPS_FLAGS_DEFAULT
126  * \brief The packet has default flags set
127  */
128 #define NETIO_RTPS_FLAGS_DEFAULT (0x0)
129 
130 /*ci
131  * \def NETIO_RTPS_FLAGS_DISPOSE
132  * \brief The packet is a RTPS dispose message, a key is disposed
133  */
134 #define NETIO_RTPS_FLAGS_DISPOSE (0x1)
135 
136 /*ci
137  * \def NETIO_RTPS_FLAGS_UNREGISTER
138  * \brief The packet is a RTPS unregister message, a key has been unregistered
139  * by a writer
140  */
141 #define NETIO_RTPS_FLAGS_UNREGISTER (0x2)
142 
143 /*ci
144  * \def NETIO_RTPS_FLAGS_LIVELINESS
145  * \brief The packet counts as liveliness, even if it does not contain any data
146  */
147 #define NETIO_RTPS_FLAGS_LIVELINESS (0x4)
148 
149 /*ci
150  * \def NETIO_RTPS_FLAGS_INLINEQOS
151  * \brief The packet contains inline Qos as defined by RTPS
152  */
153 #define NETIO_RTPS_FLAGS_INLINEQOS (0x8)
154 
155 /*ci
156  * \def NETIO_RTPS_FLAGS_LOST_DATA
157  * \brief The flag indicates that some packets have been permanently lost
158  * and any attempt to wait for them should be aborted
159  */
160 #define NETIO_RTPS_FLAGS_LOST_DATA (0x10)
161 
162 /*ci
163  * \def NETIO_RTPS_FLAGS_COMMIT_DATA
164  * \brief The flag indicates that even if the packet does not contain
165  * data, it does contain information about which packets can be considered
166  * to be received in order.
167  */
168 #define NETIO_RTPS_FLAGS_COMMIT_DATA (0x20)
169 
170 /*ci
171  * \def NETIO_RTPS_FLAGS_DATA
172  * \brief The flag indicates that the packet contains data
173  */
174 #define NETIO_RTPS_FLAGS_DATA (0x40)
175 
176 /*ci
177  * \def NETIO_RTPS_FLAGS_LAST_WRITE_FOR_SN
178  * \brief
179  */
180 #define NETIO_RTPS_FLAGS_LAST_WRITE_FOR_SN (0x80)
181 
182 /*ci
183  * \def NETIO_RTPS_FLAGS_LITTLE_ENDIAN
184  * \brief The packet payload is in little endian format
185  */
186 #define NETIO_RTPS_FLAGS_LITTLE_ENDIAN (0x100)
187 
188 /*ci
189  * \def NETIO_RTPS_FLAGS_DATA_BATCH
190  * \brief The flag indicates that the packet contains batch data
191  */
192 #define NETIO_RTPS_FLAGS_DATA_BATCH (0x200)
193 
194 /*ci
195  * \brief RTPS protocol specific data
196  */
197 struct NETIO_RtpsInfo
198 {
199  /*ci
200  * \brief Pointer to beginning of data-payload
201  * This buffer is modified to point to the end of inline_data; this is
202  * needed to read the next sample_info in case a batch was received
203  */
204  struct REDA_Buffer *inline_data;
205 
206  /*ci
207  * Pointer to the beginning of serialized sample data when a batch is
208  * received. When the first sample in the batch is read this will
209  * point to the encapsulation id; for the following samples this will
210  * point to the beginning of serialized data
211  */
212  struct REDA_Buffer *serialized_data_batch;
213 
214  /*ci \brief need_byte_swap of stream. If header is not deserialized yet
215  * the value will be CDR_BYTESWAP_INVALID. This is useful to deserialize
216  * header only once.
217  */
218  RTI_BOOL stream_need_byte_swap;
219 
220  /*ci \brief Endianness of stream. Value is only valid if value of field
221  * stream_need_byte_swap is not CDR_BYTESWAP_INVALID.
222  * This is needed so header in the stream is deserialized only once.
223  */
224  RTI_UINT16 stream_endian;
225 
226  /*ci
227  * \brief The GUID prefix of the peer
228  */
229  struct NETIO_GuidPrefix guid_prefix;
230 };
231 
232 /*ci
233  * \brief INTRA protocol specific data
234  */
235 struct NETIO_IntraInfo
236 {
237  /*ci
238  * \brief opaque pointer to in-memory representation of data
239  */
240  const void *user_data;
241 
242  /*ci
243  * \brief Pointer to beginning of intra data-payload. Intra data-payload
244  * only contains inline Qos
245  */
246  struct REDA_Buffer *inline_data;
247 };
248 
249 /*ci
250  *\brief NETIO_IntraInfo initializer constant
251  */
252 #define NETIO_IntraInfo_INITIALIZER \
253 { \
254  NULL, /* user_data */ \
255  NULL, /* inline_data */ \
256 }
257 
258 /*ci
259  *\brief Structure containing meta-data about a \ref NETIO_Packet payload
260  */
261 struct NETIO_PacketInfo
262 {
263  /*ci
264  * \brief The SN of the packet. The SN and PacketId is synonymous.
265  * For a batch data this will be the batch SN (not the sample inside
266  * the batch SN).
267  */
268  struct REDA_SequenceNumber sn;
269 
270  /*ci
271  * \brief The virtual SN of the sample.
272  * If a batch is received 'sn' contains the RTPS packet SN (same for
273  * all samples in the batch), while 'virtual_sn' contains the user sample
274  * SN. When a sample is received 'sn' == 'virtual_sn'
275  */
276  struct REDA_SequenceNumber virtual_sn;
277 
278  /*ci
279  * \brief The reception time-stamp of the packet
280  */
281  struct OSAPI_NtpTime timestamp;
282 
283  /*ci
284  * \brief Whether the serialized-payload is valid data or not
285  */
286  RTI_UINT8 valid_data;
287 
288  /*ci
289  * \brief Whether the serialized-payload is a valid key or not
290  */
291  RTI_UINT8 valid_key;
292 
293  /*ci
294  * \brief Key for the sample
295  */
296  struct NETIO_Guid instance;
297 
298  /*ci
299  * \brief Flags describing the contents of the payload
300  */
301  RTI_UINT32 rtps_flags;
302 
303  /*ci
304  * \brief The committable_sn means that all SNs up to, but not including
305  * this SN can be committed (made available to the user).
306  */
307  struct REDA_SequenceNumber committable_sn;
308 
309  /*ci
310  * \brief The first_available_sn indicates the first available SN which is
311  * available. It is typically used downstream to boot-strap the
312  * reliability protocol.
313  */
314  struct REDA_SequenceNumber first_available_sn;
315 
316  /*ci
317  * \brief If NETIO_RTPS_FLAGS_LOST_DATA is set, this is the highest sequence
318  * number which has been lost.
319  */
320  struct REDA_SequenceNumber lost_sample_sn;
321 
322  /*ci
323  * \brief If NETIO_RTPS_FLAGS_LOST_DATA is set, this is the total number
324  * of samples that have been lost up to and including lost_sample_sn
325  */
326  RTI_UINT32 lost_sample_count;
327 
328  /*ci
329  * \brief Virtual SN of the last committed sample.
330  */
331  struct REDA_SequenceNumber last_committed_virtual_sn;
332 
333  /*ci
334  * \brief The protocol which produced this packet, it may change as the
335  * packet traverses a NETIO stack
336  */
337  RTI_INT32 protocol_id;
338 
339  /*ci
340  * \brief Protocol specific data based, protocol_id identifies which one
341  * is valid.
342  */
343  struct
344  {
345  struct NETIO_IntraInfo intra_info;
346  struct NETIO_RtpsInfo rtps_data;
347  } protocol_data;
348 };
349 
350 /*ci
351  * \def NETIO_PacketInfo_INITIALIZER
352  * \brief Constant to initialize NETIO_PacketInfo
353  */
354 #define NETIO_PacketInfo_INITIALIZER \
355 { \
356  REDA_SEQUENCE_NUMBER_ZERO, /* sn */\
357  REDA_SEQUENCE_NUMBER_ZERO, /* virtual_sn */\
358  OSAPI_NTP_TIME_ZERO, /* timestamp */ \
359  0, /* valid_data */ \
360  0, /* valid_key */ \
361  NETIO_ADDRESS_GUID_UNKNOWN, /* instance */ \
362  0, /* flags */ \
363  REDA_SEQUENCE_NUMBER_ZERO, /* committable_sn */ \
364  REDA_SEQUENCE_NUMBER_ZERO, /* first_available_sn */ \
365  REDA_SEQUENCE_NUMBER_ZERO, /* lost_sample_sn */ \
366  0, /* lost sample count */ \
367  REDA_SEQUENCE_NUMBER_ZERO, /* last_committed_virtual_sn */ \
368  0, /* protocol_id */\
369  {{NULL,NULL},\
370  {NULL,NULL,CDR_BYTESWAP_INVALID,0,\
371  {{0,0,0,0,0,0,0,0,0,0,0,0}}}}\
372 }
373 
374 /*ci
375  * \brief Implementation of the abstract NETIO_Packet type.
376  *
377  * \details
378  * The NETIO layers passed \ref NETIO_Packet structures upstream/downstream.
379  * Any meta-data about the packet must be encapsulated either in the packet
380  * payload or the packet info field.
381  */
382 struct NETIO_Packet
383 {
384  /*ci
385  * \brief The source of the packet, typically the peer address
386  */
387  struct NETIO_Address source;
388 
389  /*ci
390  * \brief The local source of the packet, the address it was received on.
391  */
392  struct NETIO_Address local_source;
393 
394  /*ci
395  * \brief Buffer holding a NETIO_Packet. The buffer must be allocated
396  * and managed outside of this structure. That, is NETIO_Packet
397  * only manages payloads by reference.
398  */
399  char *buffer;
400 
401  /*ci
402  * \brief The maximum number of bytes buffer can hold
403  */
404  RTI_SIZE_T max_length;
405 
406  /*ci
407  * \brief The current position of head cursor
408  */
409  RTI_SIZE_T head_pos;
410 
411  /*ci
412  * \brief The current position of tail cursor
413  */
414  RTI_SIZE_T tail_pos;
415 
416  /*ci
417  * \brief Temporary storage for the current head position so it can later
418  * be restored if a packet payload is traversed multiple times
419  */
420  RTI_SIZE_T saved_head_pos;
421 
422  /*ci
423  * \brief Temporary storage for the current tail position so it can later
424  * be restored if a packet payload is traversed multiple times
425  */
426  RTI_SIZE_T saved_tail_pos;
427 
428  /*ci
429  * \brief Meta data about the packet, refer to \ref NETIO_PacketInfo for
430  * details
431  */
432  struct NETIO_PacketInfo info;
433 
434  /*ci
435  * \brief Sequence of destinations for single packet. Memory owned by sender.
436  */
437  struct NETIO_AddressSeq *dests;
438 
439  /*ci
440  * \brief Application level reference pointer to be able to retrieve
441  * content based on the NETIO_Packet.
442  */
443  void *ref;
444 };
445 
446 /*ci
447  * \brief Abstract NETIO_Packet type
448  */
449 typedef struct NETIO_Packet NETIO_Packet_T;
450 
451 /*ci
452  * \brief Every packet must have a unique ID. Since RTPS SN does not wrap around,
453  * it is safe to use as a unique ID per data-writer. It also avoids having
454  * to map a between packet id to a RTPS SN.
455  */
456 typedef struct REDA_SequenceNumber NETIO_PacketId_T;
457 
458 /*ci
459  * \def NETIO_Packet_INITIALIZER
460  * \brief Constant to initialize a \ref NETIO_Packet
461  */
462 #define NETIO_Packet_INITIALIZER \
463 {\
464  NETIO_Address_INITIALIZER,\
465  NETIO_Address_INITIALIZER,\
466  NULL, /* buffer */\
467  0, /* max_length */\
468  0, /* head_pos */\
469  0, /* tail_pos */\
470  0, /* saved_head_pos */\
471  0, /* saved_tail_pos */\
472  NETIO_PacketInfo_INITIALIZER,\
473  NULL /* dests */,\
474  NULL /* ref */\
475 }
476 
477 /*ci
478  * \brief Adjust the head cursor in the packet payload
479  *
480  * \details
481  *
482  * Adjust the head cursor in the packet payload. A positive value moves the
483  * cursor forward, a negative value backwards.
484  *
485  * \param[in] packet Packet to adjust head cursor in
486  * \param[in] delta Adjustment to make
487  *
488  * \return RTI_TRUE on success, RTI_FALSE on failure
489  */
490 MUST_CHECK_RETURN NETIODllExport RTI_BOOL
491 NETIO_Packet_set_head(NETIO_Packet_T *const packet,RTI_INT32 delta);
492 
493 /*ci
494  * \brief Adjust the tail cursor in the packet payload
495  *
496  * \details
497  *
498  * Adjust the tail cursor in the packet payload. A positive value moves the
499  * cursor forward, a negative value backwards.
500  *
501  * \param[in] packet Packet to adjust tail cursor in
502  * \param[in] delta Adjustment to make
503  *
504  * \return RTI_TRUE on success, RTI_FALSE on failure
505  */
506 MUST_CHECK_RETURN NETIODllExport RTI_BOOL
507 NETIO_Packet_set_tail(NETIO_Packet_T *const packet,RTI_INT32 delta);
508 
509 /*ci
510  * \brief Get a pointer to the current head
511  *
512  * \details
513  *
514  * Get a pointer to the current head. Note that it can be assumed that the
515  * payload buffer is contiguous.
516  *
517  * \param[in] packet Packet to get the head pointer for
518  *
519  * \return pointer to packet head
520  *
521  * \sa \ref NETIO_Packet_set_head
522  */
523 MUST_CHECK_RETURN NETIODllExport void*
524 NETIO_Packet_get_head(const NETIO_Packet_T *const packet);
525 
526 /*ci
527  * \brief Get a pointer to the tail head
528  *
529  * \details
530  *
531  * Get a pointer to the current tail. Note that it can be assumed that the
532  * payload buffer is contiguous.
533  *
534  * \param[in] packet Packet to get the tail pointer for
535  *
536  * \return pointer to packet tail
537  *
538  * \sa \ref NETIO_Packet_set_tail
539  */
540 MUST_CHECK_RETURN NETIODllExport void*
541 NETIO_Packet_get_tail(const NETIO_Packet_T *const packet);
542 
543 /*ci
544  * \brief Initialize a packet with a payload buffer of the given length
545  *
546  * \details
547  *
548  * NETIO_Packet only manipulates payloads by reference. The actual buffer
549  * holding a payload must be managed outside of the packet structure. A
550  * payload buffer is assigned to the packet with the length and an initialized
551  * destination sequence.
552  *
553  * \param[in] packet Packet structure to initialize
554  * \param[in] init_buffer Payload buffer
555  * \param[in] init_length Initial length in bytes of the buffer
556  * \param[in] trailer_length The initial trail position in the payload
557  * \param[in] dest_seq Initialized sequence of destination address for
558  * the packet
559  *
560  * \return RTI_TRUE on successful initialization, RTI_FALSE on failure
561  */
562 MUST_CHECK_RETURN NETIODllExport RTI_BOOL
563 NETIO_Packet_initialize(NETIO_Packet_T *const packet,
564  void *init_buffer,
565  RTI_SIZE_T init_length,
566  RTI_SIZE_T trailer_length,
567  struct NETIO_AddressSeq *dest_seq);
568 
569 /*ci
570  * \brief Initialize a packet with a payload buffer of the given length
571  * and state from an existing buffer
572  *
573  * \details
574  *
575  * \param[in] out_packet Packet structure to initialize
576  * \param[in] in_packet Existing packet to copy state from
577  * \param[in] buffer The buffer to use
578  * \param[in] max_buffer_length The maximum length of the buffer
579  * \param[in] head_pos Offset of first valid byte
580  * \param[in] tail_pos Offset of first unused byte. If head==tail
581  * the buffer is empty.
582  *
583  * \return RTI_TRUE on successful initialization, RTI_FALSE on failure
584  */
585 MUST_CHECK_RETURN NETIODllExport RTI_BOOL
586 NETIO_Packet_initialize_from(NETIO_Packet_T *const out_packet,
587  const NETIO_Packet_T *const in_packet,
588  void *const buffer,
589  RTI_SIZE_T max_buffer_length,
590  RTI_SIZE_T head_pos,
591  RTI_SIZE_T tail_pos);
592 
593 #ifndef RTI_CERT
594 /*ci
595  * \brief Finalize a packet structure
596  *
597  * \details
598  *
599  * Finalize a packet structure
600  *
601  * \param[in] packet Packet structure to finalize
602  *
603  * \return RTI_TRUE on successful initialization, RTI_FALSE on failure
604  */
605 SHOULD_CHECK_RETURN NETIODllExport RTI_BOOL
606 NETIO_Packet_finalize(NETIO_Packet_T *const packet);
607 #endif /* !RTI_CERT */
608 
609 /*ci
610  * \brief Get pointer to the packet info
611  * *
612  * \param[in] packet Packet structure to get packet info for
613  *
614  * \return Pointer to packet info
615  */
616 MUST_CHECK_RETURN NETIODllExport struct NETIO_PacketInfo*
617 NETIO_Packet_get_info(NETIO_Packet_T *const packet);
618 
619 /*ci
620  * \brief Set the source address of a packet
621  *
622  * \param[in] packet Packet to set source address in
623  * \param[in] src Source address of packet
624  */
625 NETIODllExport void
626 NETIO_Packet_set_source(NETIO_Packet_T *const packet,
627  const struct NETIO_Address *const src);
628 
629 /*ci
630  * \brief Get the length the packet payload
631  *
632  * \details
633  *
634  * Get the length the packet payload
635  *
636  * \param[in] packet Packet to return the payload length for
637  *
638  * \return Length of payload
639  */
640 SHOULD_CHECK_RETURN NETIODllExport RTI_SIZE_T
641 NETIO_Packet_get_payload_length(const NETIO_Packet_T *const packet);
642 
643 /*ci
644  * \brief Save the current head and tail positions
645  *
646  * \details
647  *
648  * Save the current head and tail positions
649  *
650  * \param[in] packet Packet to save the head and tail positions for
651  *
652  *\sa \ref NETIO_Packet_restore_positions
653  *
654  */
655 NETIODllExport void
656 NETIO_Packet_save_positions(NETIO_Packet_T *const packet);
657 
658 /*ci
659  * \brief Restore the saved head and tail positions
660  *
661  * \details
662  *
663  * Restore the saved head and tail positions
664  *
665  * \param[in] packet Packet to restore the head and tail positions for
666  *
667  * \sa \ref NETIO_Packet_save_positions
668  */
669 NETIODllExport void
670 NETIO_Packet_restore_positions(NETIO_Packet_T *const packet);
671 
672 /*ci
673  * \brief Save the saved head and tail positions to external variables
674  *
675  * \details
676  *
677  * Save the saved head and tail positions to external variables
678  *
679  * \param[in] packet Packet to save the head and tail positions for
680  * \param[out] head Contains current head position for packet on return
681  * \param[out] tail Contains current tail position for packet on return
682  *
683  * \sa \ref NETIO_Packet_restore_positions_from
684  */
685 NETIODllExport void
686 NETIO_Packet_save_positions_to(const NETIO_Packet_T *const packet,
687  RTI_SIZE_T *const head,
688  RTI_SIZE_T *const tail);
689 
690 /*ci
691  * \brief Save the saved head and tail positions to external variables
692  *
693  * \details
694  *
695  * Restore the saved head and tail positions from external variables
696  *
697  * \param[in] packet Packet to restore the head and tail positions for
698  * \param[in] head Set head position for packet
699  * \param[in] tail Set tail position for packet
700  *
701  * \sa \ref NETIO_Packet_save_positions_to
702  */
703 NETIODllExport void
704 NETIO_Packet_restore_positions_from(NETIO_Packet_T *const packet,
705  RTI_SIZE_T head,
706  RTI_SIZE_T tail);
707 
708 /*ci @} */
709 
710 /*ci
711  * \defgroup NETIO_InterfaceClass NETIO Interface API
712  * \ingroup NETIOModule
713  */
714 /*ci \addtogroup NETIO_InterfaceClass
715  * @{
716  */
717 
718 /*ci
719  * \brief The required number of bytes to convert an component id and
720  * counter to a table name
721  */
722 #define NETIO_TABLE_NAME_SIZE (16)
723 
724 /*ci
725  * \brief NETIO base-class property
726  */
727 struct NETIO_InterfaceProperty
728 {
729  struct RT_ComponentProperty _parent;
730  RTI_INT32 max_routes;
731  RTI_INT32 max_binds;
732 };
733 
734 
735 /*ci
736  * \brief Constant to initialize \ref NETIO_InterfaceProperty
737  */
738 #define NETIO_InterfaceProperty_INITIALIZER \
739 {\
740  RT_ComponentProperty_INITIALIZER,\
741  0,\
742  0\
743 }
744 
745 /*ci
746  * \brief NETIO listener structure
747  *
748  * \details
749  *
750  * All NETIO interface are RT Components, and all NETIO layers derives
751  * the listener class from the RT_ComponentListener.
752  */
753 struct NETIO_InterfaceListener
754 {
755  /*ci
756  * \brief Derived from member
757  */
758  struct RT_ComponentListener _parent;
759 };
760 
761 /*ci
762  * \def NETIO_InterfaceListener_INITIALIZE
763  * \brief Constant to initialize \ref NETIO_InterfaceListener
764  */
765 #define NETIO_InterfaceListener_INITIALIZE \
766 {\
767  RT_ComponentListener_INITIALIZER \
768 }
769 
770 /*ci
771  * \brief Common NETIO Interface factory properties
772  *
773  * \details
774  *
775  * All NETIO layers are implemented as RT components. All NETIO layers
776  * are created from NETIO factories, and all NETIO factories are RT
777  * component factories that share common properties inherited from
778  * this structure.
779  */
780 struct NETIO_InterfaceFactoryProperty
781 {
782  /*ci
783  * \brief derived from member
784  */
785  struct RT_ComponentFactoryProperty _parent;
786 };
787 
788 /*ci
789  * \def NETIO_InterfaceFactoryProperty_INITIALIZER
790  * \brief Constant to initialize a \ref NETIO_InterfaceFactoryProperty
791  */
792 #define NETIO_InterfaceFactoryProperty_INITIALIZER \
793 {\
794  RT_ComponentFactoryProperty_INITIALIZER \
795 }
796 
797 /*ci
798  * \brief Definitions of valid NETIO interface states
799  */
800 typedef enum
801 {
802  /*ci
803  * \brief The interface has been created, but will not send/receive
804  */
805  NETIO_INTERFACESTATE_CREATED,
806 
807  /*ci
808  * \brief The interface is enabled, can send/receive
809  */
810  NETIO_INTERFACESTATE_ENABLED
811 } NETIO_InterfaceState_T;
812 
813 /*ci
814  * \brief Base-class definition for all NETIO interfaces
815  *
816  * \details
817  *
818  * All NETIO layers are RT components and are derived from RT components.
819  * All NETIO layers also share a common base class, \ref NETIO_Interface
820  * and share common properties.
821  */
822 struct NETIO_Interface
823 {
824  /*ci
825  * \brief Derived member
826  */
827  struct RT_Component _parent;
828 
829  /*ci
830  * \brief A route table with addresses to send to
831  */
832  DB_Table_T _rtable;
833 
834  /*ci
835  * \brief A bind table with addresses to listen to
836  */
837  DB_Table_T _btable;
838 
839  /*ci
840  * \brief The local address of the NETIO layer. The use is NETIO
841  * specific. It is not guaranteed to be unique outside of the
842  * stack the layer belongs to.
843  */
844  struct NETIO_Address local_address;
845 
846  /*ci
847  * \brief The current NETIO interface state
848  */
849  NETIO_InterfaceState_T state;
850 };
851 
852 /*ci
853  * \brief Abstract NETIO_Interface type
854  */
855 typedef struct NETIO_Interface NETIO_Interface_T;
856 
857 /*ci
858  * \brief Common bind properties
859  */
860 struct NETIOBindProperty
861 {
862  /*ci
863  * \brief The strength of the bind. Strength is a DDS concept and used to
864  * determine ownerships for instances.
865  */
866  RTI_UINT32 strength;
867 };
868 
869 /*ci
870  * \def NETIOBindProperty_INITIALIZER
871  * \brief Constant to initialize \ref NETIOBindProperty
872  */
873 #define NETIOBindProperty_INITIALIZER \
874 {\
875  0\
876 }
877 
878 /*ci
879  * \brief Common route properties
880  */
881 struct NETIORouteProperty
882 {
883  /*ci
884  * \brief There are no common route properties. This field is present
885  * because some compilers do not allow empty structures.
886  */
887  RTI_INT32 _dummy;
888 };
889 
890 /*ci
891  * \def NETIORouteProperty_INITIALIZER
892  * \brief Constant to initialize \ref NETIORouteProperty
893  */
894 #define NETIORouteProperty_INITIALIZER \
895 {\
896  0 \
897 }
898 
899 /*ci
900  * \brief Generic bind key to listen to a source
901  */
902 struct NETIOBindEntryKey
903 {
904  /*ci
905  * \brief The source address to listen to
906  */
907  struct NETIO_Address source;
908 
909  /*ci
910  * \brief The destination address listening to the source
911  */
912  struct NETIO_Address destination;
913 };
914 
915 /*ci
916  * \brief Generic bind entry
917  */
918 struct NETIOBindEntry
919 {
920  /*ci
921  * \brief The source address to listen to
922  */
923  struct NETIO_Address source;
924 
925  /*ci
926  * \brief The destination address listening to the source
927  */
928  struct NETIO_Address destination;
929 
930  /*ci
931  * \brief The interface to use to listen to the source
932  */
933  NETIO_Interface_T *intf;
934 };
935 
936 /*ci
937  * \brief The state of a route as determined by the protocol layer
938  */
939 typedef enum
940 {
941  /*ci
942  * \brief The route is active, it can send data
943  */
944  NETIO_ROUTESTATE_ACTIVE,
945 
946  /*ci
947  * \brief The route is inactive, it cannot send data
948  */
949  NETIO_ROUTESTATE_INACTIVE
950 } NETIO_RouteState_T;
951 
952 /*ci
953  * \brief Definition of generic route entry key. Typically all route entries
954  * inherit from this key
955  */
956 struct NETIORouteEntryKey
957 {
958  /*ci
959  * \brief The address which an be reached on this route
960  */
961  struct NETIO_Address destination;
962 
963  /*ci
964  * \brief The interface which can reach the destination
965  */
966  NETIO_Interface_T *intf;
967 
968  /*ci
969  * \brief The address of the interface itself (source)
970  */
971  struct NETIO_Address intf_address;
972 };
973 
974 /*ci
975  * \brief Generic route entry, typically all routes inherit from this type
976  */
977 struct NETIORouteEntry
978 {
979  /*ci
980  * \brief The destination address which can be reached
981  */
982  struct NETIO_Address destination;
983 
984  /*ci
985  * \brief The interface which can reach the address
986  */
987  NETIO_Interface_T *intf;
988 
989  /*ci
990  * \brief The address of the interface
991  */
992  struct NETIO_Address intf_address;
993 
994  /*ci
995  * \brief State of the route entry
996  */
997  NETIO_RouteState_T state;
998 };
999 
1000 /*ci
1001  * \brief Discriminator for status changes detected at protocol level
1002  */
1003 typedef enum
1004 {
1005  /*ci
1006  * \brief A NETIO layer has determined that the peer is inactive
1007  */
1008  NETIO_EVENTKIND_INACTIVE_PEER,
1009 
1010  /*ci
1011  * \brief A NETIO layer has determined that the peer is active
1012  */
1013  NETIO_EVENTKIND_ACTIVE_PEER,
1014 
1015  /*ci
1016  * \brief A NETIO layer has freed up N number of resources
1017  */
1018  NETIO_EVENTKIND_RESOURCES_FREED
1019 } NETIO_EventKind_T;
1020 
1021 /*ci
1022  * \brief Structure to signal protocol level status changes upstream/downstream
1023  */
1024 struct NETIO_Event_PeerActivity
1025 {
1026  /*ci
1027  * \brief Address of peer layer with the activity change
1028  */
1029  struct NETIO_Address peer_addr;
1030 
1031  /*ci
1032  * \brief Total number of times the peer has become inactive
1033  */
1034  RTI_INT32 inactive_total;
1035 
1036  /*ci
1037  * \brief Change in inactivity since last time signaled
1038  */
1039  RTI_INT32 inactive_change;
1040 
1041  /*ci
1042  * \brief Total number of times the peer has become active
1043  */
1044  RTI_INT32 active_total;
1045 
1046  /*ci
1047  * \brief Change in activity since last time signaled
1048  */
1049  RTI_INT32 active_change;
1050 };
1051 
1052 /*ci
1053  * \brief Structure to signal the number of resources released
1054  */
1055 struct NETIO_Event_ResourcesFreed
1056 {
1057  struct NETIO_Guid entity;
1058 
1059  RTI_INT32 count;
1060 };
1061 
1062 /*ci
1063  * \brief Generic event structure to signal status changes detected at the
1064  * protocol level
1065  */
1066 struct NETIO_Event
1067 {
1068  /*ci
1069  * \brief Event discriminator
1070  */
1071  NETIO_EventKind_T kind;
1072 
1073  /*ci
1074  * \brief Additional event information
1075  */
1076  union
1077  {
1078  struct NETIO_Event_PeerActivity peer_activity;
1079  struct NETIO_Event_ResourcesFreed resources_freed;
1080  } value;
1081 };
1082 
1083 struct NETIO_InterfaceI;
1084 
1085 /*ci
1086  * \brief Create a table name with a consistent format for NETIO route
1087  * and bind tables
1088  *
1089  * \param[out] tbl_name The resulting table name is placed here. It is assumed
1090  * that the buffer is long enough and is should be at least
1091  * NETIO_TABLE_NAME_SIZE bytes large.
1092  * \param[in] id The name of the factory owning the table
1093  * \param[in] suffix Single character identifying the type of table
1094  * \param[in] instance The instance the table is created from
1095  *
1096  */
1097 NETIODllExport void
1098 NETIO_Interface_Table_name_from_id(char *tbl_name,
1099  union RT_ComponentFactoryId *id,
1100  char suffix,
1101  RTI_INT32 instance);
1102 
1103 /*ci
1104  * \brief Initialize a NETIO_Interface base-class
1105  *
1106  * \param[in] netio The netio interface to initialize
1107  * \param[in] netio_intf Pointer to the NETIO interface implementation
1108  * \param[in] property The NETIO properties
1109  * \param[in] listener The NETIO listener
1110  *
1111  * \return This function always returns RTI_TRUE
1112  *
1113  * \sa \ref NETIO_Interface_finalize
1114  */
1115 MUST_CHECK_RETURN NETIODllExport RTI_BOOL
1116 NETIO_Interface_initialize(struct NETIO_Interface *netio,
1117  struct NETIO_InterfaceI *netio_intf,
1118  const struct NETIO_InterfaceProperty *const property,
1119  const struct NETIO_InterfaceListener *const listener);
1120 
1121 #ifndef RTI_CERT
1122 /*ci
1123  * \brief Finalize a NETIO_Interface base-class
1124  *
1125  * \param[in] netio The netio interface to finalize
1126  *
1127  * \return RTI_TRUE on success, RTI_FALSE on failure
1128  *
1129  * \sa \ref NETIO_Interface_initialize
1130  */
1131 SHOULD_CHECK_RETURN NETIODllExport RTI_BOOL
1132 NETIO_Interface_finalize(struct NETIO_Interface *netio);
1133 #endif /* !RTI_CERT */
1134 
1135 /*ci
1136  * \brief Implementation of required database function to compare
1137  * NETIO route records stored in a database
1138  *
1139  * \details
1140  *
1141  * This function is installed as the compare function for the
1142  * tables holding NETIO_Route records
1143  *
1144  * \param[in] flags Passed in from the database
1145  * \param[in] op1 Existing database record
1146  * \param[in] op2 New database record or key depending on flags
1147  *
1148  * \return positive integer if op1 is greater than op2,
1149  * negative integer if op1 is less than op2,
1150  * zero if op1 is equal to op2
1151  */
1152 MUST_CHECK_RETURN NETIODllExport RTI_INT32
1153 NETIO_Interface_compare_route(RTI_INT32 flags,
1154  const DB_Record_T op1, void *op2);
1155 
1156 /*ci
1157  * \brief Implementation of required database function to compare
1158  * NETIO route records stored in a database
1159  *
1160  * \details
1161  *
1162  * This function is installed as the compare function for the
1163  * tables holding NETIO_Bind records
1164  *
1165  * \param[in] flags Passed in from the database
1166  * \param[in] op1 Existing database record
1167  * \param[in] op2 New database record or key depending on flags
1168  *
1169  * \return positive integer if op1 is greater than op2,
1170  * negative integer if op1 is less than op2,
1171  * zero if op1 is equal to op2
1172  */
1173 MUST_CHECK_RETURN NETIODllExport RTI_INT32
1174 NETIO_Interface_compare_bind(RTI_INT32 flags,
1175  const DB_Record_T op1, void *op2);
1176 
1177 /*ci
1178  * \brief Definition of the \ref NETIO_InterfaceI send method
1179  *
1180  * \param[in] self NETIO interface to send from
1181  * \param[in] source The source interface for the packet
1182  * \param[in] destination The destination address for the packet
1183  * \param[in] packet The packet to send
1184  *
1185  * \return RTI_TRUE on success, RTI_FALSE on failure
1186  *
1187  * \sa \ref NETIO_Interface_send, \ref NETIO_InterfaceI
1188  */
1189 FUNCTION_MUST_TYPEDEF(
1190 RTI_BOOL
1191 (*NETIO_Interface_sendFunc)(NETIO_Interface_T *self,
1192  struct NETIO_Interface *source,
1193  struct NETIO_Address *destination,
1194  NETIO_Packet_T *packet)
1195 )
1196 
1197 /*ci
1198  * \brief Definition of the \ref NETIO_InterfaceI receive method
1199  *
1200  * \param[in] netio_intf NETIO interface to receive in
1201  * \param[in] src_addr The source address of the packet
1202  * \param[in] dst_addr The destination address for the packet
1203  * \param[in] packet The forwarded packet from downstream
1204  *
1205  * \return RTI_TRUE on success, RTI_FALSE on failure
1206  *
1207  * \sa \ref NETIO_Interface_receive, \ref NETIO_InterfaceI
1208  */
1209 FUNCTION_MUST_TYPEDEF(
1210 RTI_BOOL
1211 (*NETIO_Interface_receiveFunc)(NETIO_Interface_T *netio_intf,
1212  struct NETIO_Address *src_addr,
1213  struct NETIO_Address *dst_addr,
1214  NETIO_Packet_T *packet)
1215 )
1216 
1217 /*ci
1218  * \brief Definition of the \ref NETIO_InterfaceI acknack method
1219  *
1220  * \param[in] self The NETIO interface receiving the acknack
1221  * \param[in] source The peer source address of the acknack
1222  * \param[in] packet_id The packet_id/SN of the NETIO_Packet being acked/nacked
1223  * \param[in] nack RTI_TRUE if this is a negative acknowledgment
1224  *
1225  * \return RTI_TRUE on success, RTI_FALSE on failure
1226  *
1227  * \sa \ref NETIO_Interface_acknack, \ref NETIO_InterfaceI
1228  */
1229 FUNCTION_MUST_TYPEDEF(
1230 RTI_BOOL
1231 (*NETIO_Interface_acknackFunc)(NETIO_Interface_T *self,
1232  struct NETIO_Address *source,
1233  NETIO_PacketId_T *packet_id,
1234  RTI_BOOL nack)
1235 )
1236 
1237 /*ci
1238  * \brief Definition of the \ref NETIO_InterfaceI request method
1239  *
1240  * \param[in] self The NETIO interface receiving the request
1241  * \param[in] source The peer source address of the request
1242  * \param[in] dest The peer destination address of the request
1243  * \param[out] packet The requested packet if it existed, NULL
1244  * otherwise
1245  * \param[in] packet_id The packet_id/SN of the NETIO_Packet being
1246  * requested
1247  * \param[in] actual_packet_id The if packet_id is not available, the next
1248  * available SN/packet_id
1249  *
1250  * \return RTI_TRUE on success, RTI_FALSE on failure
1251  *
1252  * \sa \ref NETIO_Interface_return_loan, \ref NETIO_InterfaceI
1253  */
1254 FUNCTION_MUST_TYPEDEF(
1255 RTI_BOOL
1256 (*NETIO_Interface_requestFunc)(NETIO_Interface_T *self,
1257  struct NETIO_Address *source,
1258  struct NETIO_Address *dest,
1259  NETIO_Packet_T **packet,
1260  NETIO_PacketId_T *packet_id,
1261  NETIO_PacketId_T *actual_packet_id)
1262 )
1263 
1264 /*ci
1265  * \brief Definition of the \ref NETIO_InterfaceI return_loan method
1266  *
1267  * \param[in] self The NETIO interface receiving the request
1268  * \param[in] source The peer source address of the loan
1269  * \param[in] packet The packet being returned
1270  * \param[in] packet_id The packet_id/SN of the NETIO_Packet being returned
1271  * requested
1272  *
1273  * \return RTI_TRUE on success, RTI_FALSE on failure
1274  *
1275  * \sa \ref NETIO_Interface_request, \ref NETIO_InterfaceI
1276  */
1277 FUNCTION_MUST_TYPEDEF(
1278 RTI_BOOL
1279 (*NETIO_Interface_return_loanFunc)(NETIO_Interface_T *self,
1280  struct NETIO_Address *source,
1281  NETIO_Packet_T *packet,
1282  NETIO_PacketId_T *packet_id)
1283 )
1284 
1285 /*ci
1286  * \brief Definition of the \ref NETIO_InterfaceI xmit_remove method
1287  *
1288  * \param[in] self NETIO interface to cancel a transmit on
1289  * \param[in] destination The destination address of the packet
1290  * \param[in] packet_id The packet_id/SN of the NETIO_Packet to cancel
1291  *
1292  * \return RTI_TRUE on success, RTI_FALSE on failure
1293  *
1294  * \sa \ref NETIO_Interface_xmit_remove, \ref NETIO_InterfaceI
1295  */
1296 FUNCTION_MUST_TYPEDEF(
1297 RTI_BOOL
1298 (*NETIO_Interface_xmit_removeFunc)(NETIO_Interface_T *self,
1299  struct NETIO_Address *destination,
1300  NETIO_PacketId_T *packet_id)
1301 )
1302 
1303 /*ci
1304  * \brief Definition of the \ref NETIO_InterfaceI add_route method
1305  *
1306  * \param[in] self NETIO interface to add the route to
1307  * \param[in] dst_addr The destination address for the route
1308  * \param[in] via_intf The downstream interface
1309  * \param[in] via_addr The address to pass to the downstream interface
1310  * \param[in] property The route property
1311  * \param[in] existed Whether the route already existed
1312  *
1313  * \sa \ref NETIO_Interface_add_route, \ref NETIO_InterfaceI
1314  */
1315 FUNCTION_MUST_TYPEDEF(
1316 RTI_BOOL
1317 (*NETIO_Interface_add_routeFunc)(NETIO_Interface_T *self,
1318  struct NETIO_Address *dst_addr,
1319  NETIO_Interface_T *via_intf,
1320  struct NETIO_Address *via_addr,
1321  struct NETIORouteProperty *property,
1322  RTI_BOOL *existed)
1323 )
1324 
1325 /*ci
1326  * \brief Definition of the \ref NETIO_InterfaceI delete_route method
1327  *
1328  * \param[in] self NETIO interface to delete the route from
1329  * \param[in] dst_addr The destination address for the route
1330  * \param[in] via_intf The downstream interface
1331  * \param[in] via_addr The address to pass to the downstream interface
1332  * \param[out] existed Whether the route existed
1333  *
1334  * \return RTI_TRUE on success, RTI_FALSE on failure. Note that is it not
1335  * considered a failure if the interface didn't exist.
1336  *
1337  * \sa \ref NETIO_Interface_delete_route, \ref NETIO_InterfaceI
1338  */
1339 FUNCTION_MUST_TYPEDEF(
1340 RTI_BOOL
1341 (*NETIO_Interface_delete_routeFunc)(NETIO_Interface_T *self,
1342  struct NETIO_Address *dst_addr,
1343  NETIO_Interface_T *via_intf,
1344  struct NETIO_Address *via_addr,
1345  RTI_BOOL *existed)
1346 )
1347 
1348 /*ci
1349  * \brief Definition of the \ref NETIO_InterfaceI bind method
1350  *
1351  * \param[in] netio_intf NETIO interface to bind
1352  * \param[in] src_addr The address to bind to
1353  * \param[in] property The property to use for the bind
1354  * \param[out] existed Whether a previous bind existed or not
1355  *
1356  * \return RTI_TRUE on success, RTI_FALSE on failure.
1357  *
1358  * \sa \ref NETIO_Interface_bind, \ref NETIO_InterfaceI
1359  */
1360 FUNCTION_MUST_TYPEDEF(
1361 RTI_BOOL
1362 (*NETIO_Interface_bindFunc)(NETIO_Interface_T *netio_intf,
1363  struct NETIO_Address *src_addr,
1364  struct NETIOBindProperty *property,
1365  RTI_BOOL *existed)
1366 )
1367 
1368 /*ci
1369  * \brief Definition of the \ref NETIO_InterfaceI unbind method
1370  *
1371  * \param[in] netio_intf NETIO interface to unbind
1372  * \param[in] src_addr The address to unbind from
1373  * \param[in] dst_intf Interface to unbind from
1374  * \param[out] existed Whether a bind existed or not
1375  *
1376  * \return RTI_TRUE on success, RTI_FALSE on failure.
1377  *
1378  * \sa \ref NETIO_Interface_unbind, \ref NETIO_InterfaceI
1379  */
1380 FUNCTION_MUST_TYPEDEF(
1381 RTI_BOOL
1382 (*NETIO_Interface_unbindFunc)(NETIO_Interface_T *netio_intf,
1383  struct NETIO_Address *src_addr,
1384  NETIO_Interface_T *dst_intf,
1385  RTI_BOOL *existed)
1386 )
1387 
1388 /*ci
1389  * \brief Definition of the \ref NETIO_InterfaceI bind_external method
1390  *
1391  * \param[in] src_intf NETIO interface to bind to upstream interface
1392  * \param[in] src_addr The address to bind to
1393  * \param[in] dst_intf The upstream interface
1394  * \param[in] dst_addr The address to pass to the upstream interface
1395  * \param[in] property The properties for the bind
1396  * \param[out] existed Whether a previous bind already existed for this entry
1397  *
1398  * \return RTI_TRUE on success, RTI_FALSE on failure.
1399  *
1400  * \sa \ref NETIO_Interface_bind_external, \ref NETIO_InterfaceI
1401  */
1402 FUNCTION_MUST_TYPEDEF(
1403 RTI_BOOL
1404 (*NETIO_Interface_bind_externalFunc)(NETIO_Interface_T *src_intf,
1405  struct NETIO_Address *src_addr,
1406  NETIO_Interface_T *dst_intf,
1407  struct NETIO_Address *dst_addr,
1408  struct NETIOBindProperty *property,
1409  RTI_BOOL *existed)
1410 )
1411 
1412 /*ci
1413  * \brief Definition of the \ref NETIO_InterfaceI unbind_external method
1414  *
1415  * \param[in] src_intf NETIO interface to unbind from upstream interface
1416  * \param[in] src_addr The address to unbind from
1417  * \param[in] dst_intf The upstream interface
1418  * \param[in] dst_addr The address to passed to the upstream interface
1419  * \param[out] existed Whether a previous bind already existed for this entry
1420  *
1421  * \return RTI_TRUE on success, RTI_FALSE on failure.
1422  *
1423  * \sa \ref NETIO_Interface_unbind_external, \ref NETIO_InterfaceI
1424  */
1425 FUNCTION_MUST_TYPEDEF(
1426 RTI_BOOL
1427 (*NETIO_Interface_unbind_externalFunc)(NETIO_Interface_T *src_intf,
1428  struct NETIO_Address *src_addr,
1429  NETIO_Interface_T *dst_intf,
1430  struct NETIO_Address *dst_addr,
1431  RTI_BOOL *existed)
1432 )
1433 
1434 /*ci
1435  * \brief Definition of the \ref NETIO_InterfaceI get_external_interface method
1436  *
1437  * \param[in] netio_intf NETIO interface to get the external interface for
1438  * \param[in] src_addr The address to send to
1439  * \param[out] dst_intf The interface to use when sending to the address
1440  * \param[out] dst_addr The destination address to use when forwarding
1441  * packets to the destination interface
1442  *
1443  * \return RTI_TRUE on success, RTI_FALSE on failure.
1444  *
1445  * \sa \ref NETIO_Interface_get_external_interface, \ref NETIO_InterfaceI
1446  */
1447 FUNCTION_MUST_TYPEDEF(
1448 RTI_BOOL
1449 (*NETIO_Interface_get_external_interfaceFunc)(NETIO_Interface_T *netio_intf,
1450  struct NETIO_Address *src_addr,
1451  NETIO_Interface_T **dst_intf,
1452  struct NETIO_Address *dst_addr)
1453 )
1454 
1455 /*ci
1456  * \brief Definition of the \ref NETIO_InterfaceI reserve_address method
1457  *
1458  * \param[in] self NETIO interface to reserve addresses on
1459  * \param[in] req_address List of requested addresses
1460  * \param[inout] rsvd_address The downstream interface
1461  * \param[in] property Properties to use to listen on the reserved addresses
1462  *
1463  * \return RTI_TRUE on success, RTI_FALSE on failure.
1464  *
1465  * \sa \ref NETIO_Interface_reserve_address, \ref NETIO_InterfaceI
1466  */
1467 FUNCTION_MUST_TYPEDEF(
1468 RTI_BOOL
1469 (*NETIO_Interface_reserve_addressFunc)(NETIO_Interface_T *self,
1470  struct NETIO_AddressSeq *req_address,
1471  struct NETIO_AddressSeq *rsvd_address,
1472  struct NETIOBindProperty *property)
1473 )
1474 
1475 /*ci
1476  * \brief Definition of the \ref NETIO_InterfaceI release_address method
1477  *
1478  * \param[in] self NETIO interface to release addresses on
1479  * \param[in] src_addr Address to release
1480  *
1481  * \return RTI_TRUE on success, RTI_FALSE on failure.
1482  *
1483  * \sa \ref NETIO_Interface_release_address, \ref NETIO_InterfaceI
1484  */
1485 FUNCTION_MUST_TYPEDEF(
1486 RTI_BOOL
1487 (*NETIO_Interface_release_addressFunc)(NETIO_Interface_T *self,
1488  struct NETIO_Address *src_addr)
1489 )
1490 
1491 /*ci
1492  * \brief Definition of the \ref NETIO_InterfaceI set_state method
1493  *
1494  * \param[in] netio_intf NETIO interface to set state on
1495  * \param[in] state New state
1496  *
1497  * \return RTI_TRUE on success, RTI_FALSE on failure.
1498  *
1499  * \sa \ref NETIO_Interface_set_state, \ref NETIO_InterfaceI
1500  */
1501 FUNCTION_MUST_TYPEDEF(
1502 RTI_BOOL
1503 (*NETIO_Interface_set_stateFunc)(NETIO_Interface_T *netio_intf,
1504  NETIO_InterfaceState_T state)
1505 )
1506 
1507 /*ci
1508  * \brief Definition of the \ref NETIO_InterfaceI resolve_adddress method
1509  *
1510  * \param[out] netio_intf Interface
1511  * \param[in] address_string Address to convert
1512  * \param[out] address_value Converted address on success
1513  * \param[out] is_invalid Whether the address is valid or not
1514  *
1515  * \return RTI_TRUE on success, RTI_FALSE on failure.
1516  *
1517  * \sa \ref NETIO_Interface_resolve_adddress, \ref NETIO_InterfaceI
1518  */
1519 FUNCTION_MUST_TYPEDEF(
1520 RTI_BOOL
1521 (*NETIO_Interface_resolve_adddressFunc)(NETIO_Interface_T *netio_intf,
1522  const char *address_string,
1523  struct NETIO_Address *address_value,
1524  RTI_BOOL *invalid)
1525 )
1526 
1527 /*ci
1528  * \brief Definition of the \ref NETIO_InterfaceI get_route_table method
1529  *
1530  * \param[in] netio_intf The NETIO interface
1531  * \param[inout] address Sequence of NETIO addresses this interface understands
1532  * \param[inout] netmask Sequence of the corresponding netmasks
1533  *
1534  * \return RTI_TRUE on success, RTI_FALSE on failure.
1535  *
1536  * \sa \ref NETIO_Interface_get_route_table, \ref NETIO_InterfaceI
1537  */
1538 FUNCTION_MUST_TYPEDEF(
1539 RTI_BOOL
1540 (*NETIO_Interface_get_route_tableFunc)(NETIO_Interface_T *netio_intf,
1541  struct NETIO_AddressSeq *address,
1542  struct NETIO_NetmaskSeq *netmask)
1543 )
1544 
1545 /*ci
1546  * \brief Definition of the \ref NETIO_InterfaceI post_event method
1547  *
1548  * \param[in] self The datawriter interface the event occurred on
1549  * \param[in] src_intf The source of the event
1550  * \param[in] event The NETIO event
1551  *
1552  * \return RTI_TRUE if the event was handled successfully, RTI_FALSE if not
1553  *
1554  * \sa \ref NETIO_Interface_post_event, \ref NETIO_InterfaceI
1555  */
1556 FUNCTION_MUST_TYPEDEF(
1557 RTI_BOOL
1558 (*NETIO_Interface_post_eventFunc)(NETIO_Interface_T *self,
1559  NETIO_Interface_T *src_intf,
1560  struct NETIO_Event *event)
1561 )
1562 
1563 /*ci
1564  * \brief Definition of the \ref NETIO_InterfaceI lookup_route method
1565  *
1566  * \details
1567  *
1568  * Check if a NETIO interface has a route to a specific destination
1569  *
1570  * \param[in] netio_intf NETIO interface to get the external interface for
1571  * \param[in] dst_reader The address to send to
1572  * \param[in] via_intf The interface to use
1573  * \param[in] via_address The interface address to use
1574  * \param[out] route_exists RTI_TRUE if the route existed, RTI_FALSE if not
1575  *
1576  * \return RTI_TRUE if the event was handled successfully, RTI_FALSE if not
1577  */
1578 FUNCTION_MUST_TYPEDEF(
1579 RTI_BOOL
1580 (*NETIO_Interface_lookup_routeFunc)(struct NETIO_Interface *netio_intf,
1581  struct NETIO_Address *dst_reader,
1582  struct NETIO_Interface *via_intf,
1583  struct NETIO_Address *via_address,
1584  RTI_BOOL *route_exists)
1585 )
1586 
1587 /*ci
1588  * \brief NETIO_InterfaceI interface required to be implemented by all NETIO
1589  * layers.
1590  */
1591 struct NETIO_InterfaceI
1592 {
1593  /*ci
1594  * \brief Base-class interface
1595  */
1596  struct RT_ComponentI _parent;
1597 
1598  /*ci
1599  * \brief Method to send packets to one or more destinations
1600  */
1601  NETIO_Interface_sendFunc send;
1602 
1603  /*ci
1604  * \brief Method to ACK/NACK a packet upstream
1605  */
1606  NETIO_Interface_acknackFunc acknack;
1607 
1608  /*ci
1609  * \brief Method to request packet upstream
1610  */
1611  NETIO_Interface_requestFunc request;
1612 
1613  NETIO_Interface_return_loanFunc return_loan;
1614 
1615  /*ci
1616  * \brief Method to cancel a transmission downstream
1617  */
1618  NETIO_Interface_xmit_removeFunc xmit_remove;
1619 
1620  /*ci
1621  * \brief Method to add a destination route to an interface
1622  */
1623  NETIO_Interface_add_routeFunc add_route;
1624 
1625  /*ci
1626  * \brief Method to remove a route to a destination from an interface
1627  */
1628  NETIO_Interface_delete_routeFunc delete_route;
1629 
1630  /*ci
1631  * \brief Method to reserve addresses to listen to on an interface
1632  */
1633  NETIO_Interface_reserve_addressFunc reserve_address;
1634 
1635  /*ci
1636  * \brief Method to start listening for data from a peer interface
1637  */
1638  NETIO_Interface_bindFunc bind;
1639 
1640  /*ci
1641  * \brief Method to stop listening for data from a peer interface
1642  */
1643  NETIO_Interface_unbindFunc unbind;
1644 
1645  /*ci
1646  * \brief Method to forward a packet to an interface upstream
1647  */
1648  NETIO_Interface_receiveFunc receive;
1649 
1650  /*ci
1651  * \brief Method to get the interface to forward packets to from an
1652  * downstream interface
1653  */
1654  NETIO_Interface_get_external_interfaceFunc get_external_interface;
1655 
1656  /*ci
1657  * \brief Method to add a path from an interface to an upstream interface
1658  */
1659  NETIO_Interface_bind_externalFunc bind_external;
1660 
1661  /*ci
1662  * \brief Method to remove a path from an interface to an upstream interface
1663  */
1664  NETIO_Interface_unbind_externalFunc unbind_external;
1665 
1666  /*ci
1667  * \brief Method to set the state of an interface
1668  */
1669  NETIO_Interface_set_stateFunc set_state;
1670 
1671  /*ci
1672  * \brief Method to release addresses to listen to on an interface
1673  */
1674  NETIO_Interface_release_addressFunc release_address;
1675 
1676  /*ci
1677  * \brief Method to query an interface if it can resolve an address or not
1678  */
1679  NETIO_Interface_resolve_adddressFunc resolve_address;
1680 
1681  /*ci
1682  * \brief Method to query an interface for what addresses it can forward
1683  * packets to
1684  */
1685  NETIO_Interface_get_route_tableFunc get_route_table;
1686 
1687  /*ci
1688  * \brief Method to post external events to an interface
1689  */
1690  NETIO_Interface_post_eventFunc post_event;
1691 
1692  /*ci
1693  * \brief Method to lookup if a route exists to a destination
1694  */
1695  NETIO_Interface_lookup_routeFunc lookup_route;
1696 };
1697 
1698 /*ci
1699  * \brief Wrapper to call of the NETIO_InterfaceFactory->create_component
1700  *
1701  * \param[in] f_ The NETIO interface factory
1702  * \param[in] p_ The property
1703  * \param[in] l_ The listener
1704  */
1705 #define NETIO_InterfaceFactory_create_component(f_,p_,l_) \
1706  (NETIO_Interface_T*)((f_)->intf->create_component(\
1707  (f_),p_,l_))
1708 
1709 /*ci
1710  * \brief Wrapper to call of the NETIO_InterfaceFactory->delete_component
1711  *
1712  * \param[in] f_ The NETIO interface factory
1713  * \param[in] intf_ The NETIO interface to delete
1714  */
1715 #define NETIO_InterfaceFactory_delete_component(f_,intf_) \
1716  (f_)->intf->delete_component(f_,(&(intf_)->_parent))
1717 
1718 /*ci
1719  * \brief Wrapper to call the \ref NETIO_InterfaceI::send
1720  *
1721  * \details
1722  * Forward a packet from a source interface to a destination
1723  *
1724  * \param[in] self_ NETIO interface to send from
1725  * \param[in] src_intf_ The source interface for the packet
1726  * \param[in] dst_addr_ The destination address for the packet
1727  * \param[in] pkt_ The packet to send
1728  *
1729  * \return RTI_TRUE on success, RTI_FALSE on failure
1730  */
1731 #define NETIO_Interface_send(self_,src_intf_,dst_addr_,pkt_) \
1732  ((struct NETIO_InterfaceI*)(\
1733  (self_)->_parent._intf))->send(self_,src_intf_,dst_addr_,pkt_)
1734 
1735 /*ci
1736  * \brief Wrapper to call \ref NETIO_InterfaceI::acknack
1737  *
1738  * \details
1739  * An acknack is processed for a peer. If all peers who should receive this
1740  * sample has acked it, then it can be ack'ed in the queue and is up for removal
1741  * A peer (source parameter) must acknack a sample at most once.
1742  *
1743  * \param[in] self_ The NETIO interface receiving the acknack
1744  * \param[in] src_intf_ The peer source address of the acknack
1745  * \param[in] sn_ The packet_id/SN of the NETIO_Packet being acked/nacked
1746  * \param[in] nack_ RTI_TRUE if this is a negative acknowledgment
1747  *
1748  * \return RTI_TRUE on success, RTI_FALSE on failure
1749  */
1750 #define NETIO_Interface_acknack(self_,src_intf_,sn_,nack_) \
1751  ((struct NETIO_InterfaceI*)(\
1752  (self_)->_parent._intf))->acknack(self_,src_intf_,sn_,nack_)
1753 
1754 /*ci
1755  * \brief Wrapper to call \ref NETIO_InterfaceI::request
1756  *
1757  * \details
1758  * Request a SN from source interface and destination address.
1759  * if SN is not available nextpktid_ contains the next available
1760  * SN.
1761  *
1762  * \param[in] self_ The NETIO interface receiving the request
1763  * \param[in] src_ The peer source address of the request
1764  * \param[in] dst_ The peer destination address of the request
1765  * \param[in] pkt_ The requested packet if it existed, NULL
1766  * otherwise
1767  * \param[in] pktid_ The packet_id/SN of the NETIO_Packet being
1768  * requested
1769  * \param[in] nextpktid_ The if packet_id is not available, the next
1770  * available SN/packet_id
1771  *
1772  * \return RTI_TRUE on success, RTI_FALSE on failure
1773  */
1774 #define NETIO_Interface_request(self_,src_,dst_,pkt_,pktid_,nextpktid_) \
1775  ((struct NETIO_InterfaceI*)(\
1776  (self_)->_parent._intf))->request(self_,src_,dst_,pkt_,pktid_,nextpktid_)
1777 
1778 /*ci
1779  * \brief Wrapper to call \ref NETIO_InterfaceI::return_loan method
1780  *
1781  * \param[in] self_ The NETIO interface receiving the request
1782  * \param[in] src_ The peer source address of the loan
1783  * \param[in] pkt_ The packet being returned
1784  * \param[in] pkt_id_ The packet_id/SN of the NETIO_Packet being returned
1785  * requested
1786  *
1787  * \return RTI_TRUE on success, RTI_FALSE on failure
1788  *
1789  * \sa \ref NETIO_Interface_request, \ref NETIO_InterfaceI
1790  */
1791 #define NETIO_Interface_return_loan(self_,src_,pkt_,pkt_id_) \
1792  ((struct NETIO_InterfaceI*)(\
1793  (self_)->_parent._intf))->return_loan(self_,src_,pkt_,pkt_id_)
1794 
1795 /*ci
1796  * \brief Wrapper to call \ref NETIO_InterfaceI::xmit_remove
1797  *
1798  * \details
1799  * Inform all downstream interfaces all attempts at delivering a packet
1800  * should be cancelled.
1801  *
1802  * \param[in] self_ NETIO interface to cancel a transmit on
1803  * \param[in] dst_ The destination address of the packet
1804  * \param[in] pkt_id_ The packet_id/SN of the NETIO_Packet to cancel
1805  *
1806  * \return RTI_TRUE on success, RTI_FALSE on failure
1807  */
1808 #define NETIO_Interface_xmit_remove(self_,dst_,pkt_id_) \
1809  ((struct NETIO_InterfaceI*)(\
1810  (self_)->_parent._intf))->xmit_remove(self_,dst_,pkt_id_)
1811 
1812 /*ci
1813  * \brief Wrapper to call \ref NETIO_InterfaceI::add_route
1814  *
1815  * \details
1816  * Add route to a matching peer to be reached via a downstream interface
1817  * using the specified downstream address.
1818  *
1819  * \param[in] self_ NETIO interface to add the route to
1820  * \param[in] dst_ The destination address for the route
1821  * \param[in] intf_ The downstream interface
1822  * \param[in] intf_addr_ The address to pass to the downstream interface
1823  * \param[in] prop_ The route property
1824  * \param[in] ex_ Whether the route already existed
1825  *
1826  * \return RTI_TRUE on success, RTI_FALSE on failure
1827  */
1828 #define NETIO_Interface_add_route(self_,dst_,intf_,intf_addr,prop_,ex_) \
1829  ((struct NETIO_InterfaceI*)(\
1830  (self_)->_parent._intf))->add_route(self_,dst_,intf_,intf_addr,prop_,ex_)
1831 
1832 /*ci
1833  * \brief Wrapper to call \ref NETIO_InterfaceI::delete_route
1834  *
1835  * \details
1836  * Remove a route to a peer, either because it no longer matches or that the
1837  * peer has been deleted.
1838  *
1839  * \param[in] self_ NETIO interface to add the route to
1840  * \param[in] dst_ The destination address for the route
1841  * \param[in] intf_ The downstream interface
1842  * \param[in] intf_addr_ The address to pass to the downstream interface
1843  * \param[out] exist_ Whether the route existed
1844  *
1845  * \return RTI_TRUE on success, RTI_FALSE on failure. Note that is it not
1846  * considered a failure if the interface didn't exist.
1847  */
1848 #define NETIO_Interface_delete_route(self_,dst_,intf_,intf_addr_,exist_) \
1849  ((struct NETIO_InterfaceI*)(\
1850  (self_)->_parent._intf))->delete_route(self_,dst_,intf_,intf_addr_,exist_)
1851 
1852 /*ci
1853  * \brief Wrapper to call \ref NETIO_InterfaceI::reserve_address
1854  *
1855  * \details
1856  * Reserve addresses on an interface to listen to using the requested addresses
1857  * as the starting point. The resulting addresses may be fewer than requested,
1858  * even 0 is legal.
1859  *
1860  * \param[in] self_ NETIO interface to reserve addresses on
1861  * \param[in] src_addr_ List of requested addresses
1862  * \param[inout] pub_addr_ List of addresses that are reserved
1863  * \param[in] prop_ Properties to use to listen on the reserved addresses
1864  *
1865  * \return RTI_TRUE on success, RTI_FALSE on failure.
1866  */
1867 #define NETIO_Interface_reserve_address(self_,src_addr_,pub_addr_,prop_)\
1868  ((struct NETIO_InterfaceI*)(\
1869  (self_)->_parent._intf))->reserve_address(self_,src_addr_,pub_addr_,prop_)
1870 
1871 /*ci
1872  * \brief Wrapper to call \ref NETIO_InterfaceI::release_address
1873  *
1874  * Release an address previously reserved. The address will no longer be
1875  * listened on by the caller.
1876  *
1877  * \param[in] self_ NETIO interface to release addresses on
1878  * \param[in] src_addr_ Address to release
1879  *
1880  * \return RTI_TRUE on success, RTI_FALSE on failure.
1881  */
1882 #define NETIO_Interface_release_address(self_,src_addr_) \
1883  ((struct NETIO_InterfaceI*)(\
1884  (self_)->_parent._intf))->release_address(self_,src_addr_)
1885 
1886 /*ci
1887  * \brief Wrapper to call \ref NETIO_InterfaceI::bind
1888  *
1889  * \details
1890  * When an interface is matched with another interface (how is outside the
1891  * scope of this function) an entry in the bind-table for the interface is
1892  * created. The peer-to-peer state between the two interfaces should be
1893  * maintained based on this relationship until an unbind is performed.
1894  *
1895  * \param[in] self_ NETIO interface to bind
1896  * \param[in] src_ The address to bind to
1897  * \param[in] prop_ The property to use for the bind
1898  * \param[out] ex_ Whether a previous bind existed or not
1899  *
1900  * \return RTI_TRUE on success, RTI_FALSE on failure.
1901  */
1902 #define NETIO_Interface_bind(self_,src_,prop_,ex_) \
1903  ((struct NETIO_InterfaceI*)(\
1904  (self_)->_parent._intf))->bind(self_,src_,prop_,ex_)
1905 
1906 /*ci
1907  * \brief Wrapper to call \ref NETIO_InterfaceI::unbind
1908  *
1909  * \details
1910  * When an interface is unmatched from another interface (how is outside the
1911  * scope of this function) an entry in the bind-table for the interface can
1912  * safely be removed (although not required). No state is expected to be
1913  * maintained from this point on
1914  *
1915  * \param[in] self_ NETIO interface to unbind
1916  * \param[in] src_ The address to unbind from
1917  * \param[in] dst_ Interface to unbind from
1918  * \param[out] exist_ Whether a bind existed or not
1919  *
1920  * \return RTI_TRUE on success, RTI_FALSE on failure.
1921  */
1922 #define NETIO_Interface_unbind(self_,src_,dst_,exist_) \
1923  ((struct NETIO_InterfaceI*)(\
1924  (self_)->_parent._intf))->unbind(self_,src_,dst_,exist_)
1925 
1926 /*ci
1927  * \brief Wrapper to call \ref NETIO_InterfaceI::bind_external
1928  *
1929  * \details
1930  * When an upstream interface wants to listen to data from a local
1931  * downstream interface it binds to the downstream interface using the
1932  * external bind function. This typically means adding an interface to a
1933  * bind table in the downstream interface so the downstream interface is
1934  * able to forward data upstream.
1935  *
1936  * \param[in] src_intf_ NETIO interface to bind to upstream interface
1937  * \param[in] src_adr_ The address to bind to
1938  * \param[in] dst_intf_ The upstream interface
1939  * \param[in] dst_adr_ The address to pass to the upstream interface
1940  * \param[in] p_ The properties for the bind
1941  * \param[out] e_ Whether a previous bind already existed for this entry
1942  *
1943  * \return RTI_TRUE on success, RTI_FALSE on failure.
1944  */
1945 #define NETIO_Interface_bind_external(src_intf_,src_adr_,dst_intf_,dst_adr_,p_,e_) \
1946 ((struct NETIO_InterfaceI*)(\
1947  (src_intf_)->_parent._intf))->bind_external(src_intf_,src_adr_,dst_intf_,dst_adr_,p_,e_)
1948 
1949 /*ci
1950  * \brief Wrapper to call \ref NETIO_InterfaceI::unbind_external
1951  *
1952  * \details
1953  * When an upstream interface no longer wants to listen to data from a local
1954  * downstream interface it unbinds from the downstream interface using the
1955  * external unbind function. This typically means removing an interface from a
1956  * bind table in the downstream interface so the downstream interface no longer
1957  * forwards data upstream to a non-existent interface.
1958  *
1959  * \param[in] src_intf_ NETIO interface to unbind from upstream interface
1960  * \param[in] src_adr_ The address to unbind from
1961  * \param[in] dst_adr_ The upstream interface
1962  * \param[in] dst_intf_ The address to passed to the upstream interface
1963  * \param[out] exist_ Whether a previous bind already existed for this entry
1964  *
1965  * \return RTI_TRUE on success, RTI_FALSE on failure.
1966  */
1967 #define NETIO_Interface_unbind_external(src_intf_,src_adr_,dst_adr_,dst_intf_,exist_) \
1968 ((struct NETIO_InterfaceI*)(\
1969  (src_intf_)->_parent._intf))->unbind_external(src_intf_,src_adr_,dst_adr_,dst_intf_,exist_)
1970 
1971 /*ci
1972  * \brief Wrapper to call \ref NETIO_InterfaceI::receive
1973  *
1974  * \details
1975  *
1976  * A NETIO interface receives data from a downstream interface.
1977  * The data can be in different protocol formats. Depending on the
1978  * downstream protocol different actions may be taken, but semantically it
1979  * does not matter where data is coming from. The receive interface is
1980  * synchronous, _all_ processing takes place in the context of the downstream
1981  * receive context, such as a thread.
1982  *
1983  * \param[in] self_ The interface receiving data
1984  * \param[in] src_ The source address of the data
1985  * \param[in] dst_ The destination address of the data
1986  * \param[in] p_ A NETIO_Packet with the payload
1987  *
1988  * \return RTI_TRUE on success, RTI_FALSE on failure
1989  */
1990 #define NETIO_Interface_receive(self_,src_,dst_,p_) \
1991  ((struct NETIO_InterfaceI*)(\
1992  (self_)->_parent._intf))->receive(self_,src_,dst_,p_)
1993 
1994 /*ci
1995  * \brief Wrapper to call \ref NETIO_InterfaceI::get_external_interface
1996  *
1997  * \details
1998  * When an interface is bound to a downstream interface it must provide
1999  * which interface and address the downstream interface should use when
2000  * forwarding a NETIO_Packet.
2001  *
2002  * \param[in] self_ NETIO interface to get the external interface for
2003  * \param[in] src_ The address to send to
2004  * \param[out] ul_ The interface to use
2005  * \param[out] dst_ The destination address to use
2006  *
2007  * \return RTI_TRUE on success, RTI_FALSE on failure.
2008  */
2009 #define NETIO_Interface_get_external_interface(self_,src_,ul_,dst_) \
2010  ((struct NETIO_InterfaceI*)(\
2011  (self_)->_parent._intf))->get_external_interface(self_,src_,ul_,dst_)
2012 
2013 /*ci
2014  * \brief Wrapper to call \ref NETIO_InterfaceI::set_state
2015  *
2016  * \details
2017  * Set the state of an interface, the interface is not required to perform
2018  * any action as this is interface dependent.
2019  *
2020  * \param[in] self_ NETIO interface to set state on
2021  * \param[in] state_ New state
2022  *
2023  * \return RTI_TRUE on success, RTI_FALSE on failure.
2024  */
2025 #define NETIO_Interface_set_state(self_,state_) \
2026  ((struct NETIO_InterfaceI*)(\
2027  (self_)->_parent._intf))->set_state(self_,state_)
2028 
2029 /*ci
2030  * \brief Wrapper to call \ref NETIO_InterfaceI::resolve_address
2031  *
2032  * \details
2033  * Request an interface to convert a string address to a \ref NETIO_Address.
2034  * If an interface successfully translated it, is_invalid_ is set to RTI_TRUE,
2035  * otherwise false and the content of the output is undefined.
2036  *
2037  * \param[out] self_ Interface requested to do the conversion
2038  * \param[in] address_ Address to convert
2039  * \param[out] resolved_ Converted address on success
2040  * \param[out] is_invalid_ Whether the address is valid or not
2041  *
2042  * \return RTI_TRUE on success, RTI_FALSE on failure.
2043  */
2044 #define NETIO_Interface_resolve_address(self_,address_,resolved_,is_invalid_) \
2045 ((struct NETIO_InterfaceI*)(\
2046  (self_)->_parent._intf))->resolve_address(self_,address_,resolved_,is_invalid_)
2047 
2048 /*ci
2049  * \brief Wrapper to call \ref NETIO_InterfaceI::get_route_table
2050  *
2051  * \details
2052  * Query an interface for what addresses it can forward packets to. Not
2053  * all interfaces provides a routing table, this is implementation dependent.
2054  *
2055  * \param[in] self_ The NETIO interface
2056  * \param[inout] address_ Sequence of NETIO addresses this interface understands
2057  * \param[inout] netmask_ Sequence of the corresponding netmasks
2058  *
2059  * \return RTI_TRUE on success, RTI_FALSE on failure.
2060  */
2061 #define NETIO_Interface_get_route_table(self_,address_,netmask_) \
2062  ((struct NETIO_InterfaceI*)(\
2063  (self_)->_parent._intf))->get_route_table(self_,address_,netmask_)
2064 
2065 /*ci
2066  * \brief Wrapper to call \ref NETIO_InterfaceI::post_event
2067  *
2068  * \details
2069  * Post an external event on the interface
2070  *
2071  * \param[in] self_ The interface interface the event occurred on
2072  * \param[in] src_intf_ The source of the event
2073  * \param[in] event_ The NETIO event
2074  *
2075  * \return RTI_TRUE if the event was handled successfully, RTI_FALSE if not
2076  */
2077 #define NETIO_Interface_post_event(self_,src_intf_,event_) \
2078  ((struct NETIO_InterfaceI*)(\
2079  (self_)->_parent._intf))->post_event(self_,src_intf_,event_)
2080 
2081 /*ci
2082  * \brief Lookup if a route exists to a destination via an interface
2083  *
2084  * \param[in] self_ The source interface
2085  * \param[in] dst_reader_ The destination address
2086  * \param[in] via_intf_ The downstream interface
2087  * \param[in] via_address_ The address to pass to the downstream interface
2088  * \param[out] route_exists_ RTI_TRUE if the route existed, RTI_FALSE if not
2089  *
2090  * \return RTI_TRUE if the event was handled successfully, RTI_FALSE if not
2091  */
2092 #define NETIO_Interface_lookup_route(self_,dst_reader_,via_intf_,\
2093  via_address_,route_exists_) \
2094  ((struct NETIO_InterfaceI*)(\
2095  (self_)->_parent._intf))->lookup_route(self_,dst_reader_,via_intf_,\
2096  via_address_,route_exists_)
2097 
2098 #ifdef __cplusplus
2099 }
2100 #endif
2101 
2102 #endif /* netio_interface_h */
2103 
2104 /*ci @} */

RTI Connext DDS Micro Version 2.4.11 Copyright © Mon Jul 23 2018 Real-Time Innovations, Inc