Address

Transport-independent addressing scheme using IPv6 presentation strings and numerically stored in network-ordered format. More...

Classes

struct  NDDS_Transport_Address_t
 Addresses are stored individually as network-ordered bytes. More...

Defines

#define NDDS_TRANSPORT_ADDRESS_INVALID   {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
 An invalid transport address. Used as an initializer.
#define NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE   (40)
 The minimum size of the buffer that should be passed to NDDS_Transport_Address_to_string.

Functions

RTI_INT32 NDDS_Transport_Address_to_string (const NDDS_Transport_Address_t *self, char *buffer_inout, RTI_INT32 buffer_length_in)
 Converts a numerical address to a printable string representation.
RTI_INT32 NDDS_Transport_Address_from_string (NDDS_Transport_Address_t *address_out, const char *address_in)
 Converts an address (IPv4 dotted notation or IPv6 presentation string) into a numerical address.
void NDDS_Transport_Address_print (const NDDS_Transport_Address_t *address_in, const char *desc_in, RTI_INT32 indent_in)
 Prints an address to standard out.
RTI_INT32 NDDS_Transport_Address_is_ipv4 (const NDDS_Transport_Address_t *address_in)
 Checks if an address is an IPv4 address.
RTI_INT32 NDDS_Transport_Address_is_multicast (const NDDS_Transport_Address_t *address_in)
 Checks if an address is an IPv4 or IPv6 multicast address.

Detailed Description

Transport-independent addressing scheme using IPv6 presentation strings and numerically stored in network-ordered format.

The APIs of RTI Connext uses IPv6 address notation for all transports.

Transport-Plugin implementations that are not IP-based are required to map whatever addressing scheme natively used by the physical transport (if any) to an address in IPv6 notation and vice versa.

IPv6 addresses are numerically stored in 16 bytes. An IPv6 address can be presented In string notation in a variety of ways. For example,

  "00AF:0000:0037:FE01:0000:0000:034B:0089"
  "AF:0:37:FE01:0:0:34B:89"
  "AF:0:37:FE01::34B:89"

are all valid IPv6 presentation of the same address.

IPv4 address in dot notation can be used to specify the last 4 bytes of the address. For example,

  "0000:0000:0000:0000:0000:0000:192.168.0.1"
  "0:0:0:0:0:0:192.168.0.1"
  "::192.168.0.1"

are all valid IPv6 presentation of the same address.

For a complete description of valid IPv6 address notation, consult the IPv6 Addressing Architecture (RFC 2373).

Addresses are divided into unicast addresses and multicast addresses.

Multicast addresses are defined as

or an IPv4 multicast address

Multicast addresses do not refer to any specific destination (network interface). Instead, they usually refer to a group of network interfaces, often called a "multicast group".

Unicast addresses always refer to a specific network interface.


Define Documentation

#define NDDS_TRANSPORT_ADDRESS_INVALID   {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}

An invalid transport address. Used as an initializer.

For example: NDDS_Transport_Address_t address = NDDS_TRANSPORT_ADDRESS_INVALID

#define NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE   (40)

The minimum size of the buffer that should be passed to NDDS_Transport_Address_to_string.

The string size includes space for 8 tuples of 4 characters each plus 7 delimiting colons plus a terminating NULL.


Function Documentation

RTI_INT32 NDDS_Transport_Address_to_string ( const NDDS_Transport_Address_t self,
char *  buffer_inout,
RTI_INT32  buffer_length_in 
)

Converts a numerical address to a printable string representation.

Precondition:
The buffer_inout provided must be at least NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE characters long.
Parameters:
self <<in>> The address to be converted.
buffer_inout <<inout>> Storage passed in which to return the string corresponding to the address.
buffer_length_in <<in>> The length of the storage buffer. Must be >= NDDS_TRANSPORT_ADDRESS_STRING_BUFFER_SIZE
Returns:
1 upon success; 0 upon failure (not enough space in the provided buffer)

RTI_INT32 NDDS_Transport_Address_from_string ( NDDS_Transport_Address_t address_out,
const char *  address_in 
)

Converts an address (IPv4 dotted notation or IPv6 presentation string) into a numerical address.

The address string must be in IPv4 dotted notation (X.X.X.X) or IPv6 presentation notation. The string cannot be a hostname since this function does not perform a hostname lookup.

Parameters:
address_out <<out>> Numerical value of the address.
address_in <<in>> String representation of an address.
Returns:
1 if address_out contains a valid address

0 if it was not able to convert the string into an address.

void NDDS_Transport_Address_print ( const NDDS_Transport_Address_t address_in,
const char *  desc_in,
RTI_INT32  indent_in 
)

Prints an address to standard out.

Parameters:
address_in <<in>> Address to be printed.
desc_in <<in>> A prefix to be printed before the address.
indent_in <<in>> Indentation level for the printout.

RTI_INT32 NDDS_Transport_Address_is_ipv4 ( const NDDS_Transport_Address_t address_in  ) 

Checks if an address is an IPv4 address.

Parameters:
address_in <<in>> Address to be tested.
Note:
May be implemented as a macro for efficiency.
Returns:
1 if address is an IPv4 address

0 otherwise.

RTI_INT32 NDDS_Transport_Address_is_multicast ( const NDDS_Transport_Address_t address_in  ) 

Checks if an address is an IPv4 or IPv6 multicast address.

Parameters:
address_in <<in>> Address to be tested.
May be implemented as a macro for efficiency.

Returns:
1 if address is a multicast address

0 otherwise.


RTI Connext C++ API Version 4.5f Copyright © 17 Mar 2012 Real-Time Innovations, Inc