Class IPFinder

Nested Relationships

Nested Types

Class Documentation

class IPFinder

Class IPFinder, to determine the IP of the NICs.

Public Types

enum IPTYPE

Enum IPTYPE, to define the type of IP obtained from the NICs.

Values:

enumerator IP4

IP4.

enumerator IP6

IP6.

enumerator IP4_LOCAL

IP4_LOCAL.

enumerator IP6_LOCAL

IP6_LOCAL.

typedef struct eprosima::fastrtps::rtps::IPFinder::info_IP info_IP

Structure info_IP with information about a specific IP obtained from a NIC.

typedef struct eprosima::fastrtps::rtps::IPFinder::info_MAC info_MAC

Structure info_MAC with information about a specific MAC obtained from a NIC.

Public Functions

IPFinder()
virtual ~IPFinder()

Public Static Functions

static RTPS_DllAPI bool getIPs (std::vector< info_IP > *vec_name, bool return_loopback=false)
static RTPS_DllAPI bool getIP4Address (LocatorList_t *locators)

Get the IP4Adresses in all interfaces.

Parameters:

locators[out] List of locators to be populated with the IP4 addresses.

static RTPS_DllAPI bool getIP6Address (LocatorList_t *locators)

Get the IP6Adresses in all interfaces.

Parameters:

locators[out] List of locators to be populated with the IP6 addresses.

static RTPS_DllAPI bool getAllIPAddress (LocatorList_t *locators)

Get all IP Adresses in all interfaces.

Parameters:

locators[out] List of locators to be populated with the addresses.

static RTPS_DllAPI bool parseIP4 (info_IP &info)

Parses an IP4 string, populating a info_IP with its value.

Parameters:

info[out] info_IP to populate.

static RTPS_DllAPI bool parseIP6 (info_IP &info)

Parses an IP6 string, populating a info_IP with its value.

Parameters:

info[out] info_IP to populate.

static RTPS_DllAPI std::string getIPv4Address (const std::string &name)
static RTPS_DllAPI std::string getIPv6Address (const std::string &name)
static RTPS_DllAPI bool getAllMACAddress (std::vector< info_MAC > *macs)

Get all MAC Adresses of all interfaces. Will return all unique MAC addresses for eadh of the interfaces returned by getAllIPAddress

Parameters:

macs[out] List of MAC addresses.

struct info_IP

Structure info_IP with information about a specific IP obtained from a NIC.

Public Members

IPTYPE type
std::string name
std::string dev
Locator_t locator
fastdds::rtps::LocatorWithMask masked_locator
struct info_MAC

Structure info_MAC with information about a specific MAC obtained from a NIC.

Public Functions

inline bool operator==(const info_MAC &other)

Public Members

unsigned char address[6]