| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
IPFinder Class Reference
eProsima Fast DDS API Reference » Shared Utilities

Class IPFinder, to determine the IP of the NICs. More...

`#include <IPFinder.hpp>`

## Classes

struct | info_IP
| Structure info_IP with information about a specific IP obtained from a NIC. More...
struct | info_MAC
| Structure info_MAC with information about a specific MAC obtained from a NIC. More...

## Public Types

enum | IPTYPE { IP4 , IP6 , IP4_LOCAL , IP6_LOCAL }
| Enum IPTYPE, to define the type of IP obtained from the NICs. More...
typedef struct eprosima::fastdds::rtps::IPFinder::info_IP | info_IP
| Structure info_IP with information about a specific IP obtained from a NIC.
typedef struct eprosima::fastdds::rtps::IPFinder::info_MAC | info_MAC
| Structure info_MAC with information about a specific MAC obtained from a NIC.

## Public Member Functions

| IPFinder ()
virtual | ~IPFinder ()

## Static Public Member Functions

static FASTDDS_EXPORTED_API bool | getIPs (std::vector< info_IP > *vec_name, bool return_loopback=false)
static FASTDDS_EXPORTED_API bool | getIP4Address (LocatorList_t *locators)
| Get the IP4Adresses in all interfaces.
static FASTDDS_EXPORTED_API bool | getIP6Address (LocatorList_t *locators)
| Get the IP6Adresses in all interfaces.
static FASTDDS_EXPORTED_API bool | getAllIPAddress (LocatorList_t *locators)
| Get all IP Adresses in all interfaces.
static FASTDDS_EXPORTED_API bool | parseIP4 (info_IP &info)
| Parses an IP4 string, populating a info_IP with its value.
static FASTDDS_EXPORTED_API bool | parseIP6 (info_IP &info)
| Parses an IP6 string, populating a info_IP with its value.
static FASTDDS_EXPORTED_API std::string | getIPv4Address (const std::string &name)
static FASTDDS_EXPORTED_API std::string | getIPv6Address (const std::string &name)
static FASTDDS_EXPORTED_API bool | getAllMACAddress (std::vector< info_MAC > *macs)
| Get all MAC Adresses of all interfaces.

## Detailed Description

Class IPFinder, to determine the IP of the NICs.

## Member Typedef Documentation

## ◆ info_IP

typedef struct eprosima::fastdds::rtps::IPFinder::info_IP info_IP

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

## ◆ info_MAC

typedef struct eprosima::fastdds::rtps::IPFinder::info_MAC info_MAC

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

## Member Enumeration Documentation

## ◆ IPTYPE

enum IPTYPE

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

Enumerator
IP4 | IP4.
IP6 | IP6.
IP4_LOCAL | IP4_LOCAL.
IP6_LOCAL | IP6_LOCAL.

## Constructor & Destructor Documentation

## ◆ IPFinder()

IPFinder | ( |  | ) |

## ◆ ~IPFinder()

virtual ~IPFinder | ( |  | ) |

virtual

## Member Function Documentation

## ◆ getAllIPAddress()

FASTDDS_EXPORTED_API bool getAllIPAddress | ( | LocatorList_t * | locators | ) |

static

Get all IP Adresses in all interfaces.

Parameters

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

## ◆ getAllMACAddress()

FASTDDS_EXPORTED_API bool getAllMACAddress | ( | std::vector< info_MAC > * | macs | ) |

static

Get all MAC Adresses of all interfaces.

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

Parameters

  [out] | macs | List of MAC addresses.

## ◆ getIP4Address()

FASTDDS_EXPORTED_API bool getIP4Address | ( | LocatorList_t * | locators | ) |

static

Get the IP4Adresses in all interfaces.

Parameters

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

## ◆ getIP6Address()

FASTDDS_EXPORTED_API bool getIP6Address | ( | LocatorList_t * | locators | ) |

static

Get the IP6Adresses in all interfaces.

Parameters

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

## ◆ getIPs()

FASTDDS_EXPORTED_API bool getIPs | ( | std::vector< info_IP > * | vec_name,
|  | bool | return_loopback = false )

static

## ◆ getIPv4Address()

FASTDDS_EXPORTED_API std::string getIPv4Address | ( | const std::string & | name | ) |

static

## ◆ getIPv6Address()

FASTDDS_EXPORTED_API std::string getIPv6Address | ( | const std::string & | name | ) |

static

## ◆ parseIP4()

FASTDDS_EXPORTED_API bool parseIP4 | ( | info_IP & | info | ) |

static

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

Parameters

  [out] | info | info_IP to populate.

## ◆ parseIP6()

FASTDDS_EXPORTED_API bool parseIP6 | ( | info_IP & | info | ) |

static

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

Parameters

  [out] | info | info_IP to populate.

The documentation for this class was generated from the following file:

- include/fastdds/utils/IPFinder.hpp