123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef IPFINDER_H_
- #define IPFINDER_H_
- #include <vector>
- #include <string>
- #include <fastdds/rtps/common/Locator.h>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- class IPFinder
- {
- public:
- #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
-
- enum IPTYPE
- {
- IP4,
- IP6,
- IP4_LOCAL,
- IP6_LOCAL
- };
-
- typedef struct info_IP
- {
- IPTYPE type;
- std::string name;
- std::string dev;
- Locator_t locator;
- }info_IP;
- #endif
- IPFinder();
- virtual ~IPFinder();
- RTPS_DllAPI static bool getIPs(std::vector<info_IP>* vec_name, bool return_loopback = false);
-
- RTPS_DllAPI static bool getIP4Address(LocatorList_t* locators);
-
- RTPS_DllAPI static bool getIP6Address(LocatorList_t* locators);
-
- RTPS_DllAPI static bool getAllIPAddress(LocatorList_t* locators);
-
- RTPS_DllAPI static bool parseIP4(info_IP& info);
-
- RTPS_DllAPI static bool parseIP6(info_IP& info);
- RTPS_DllAPI static std::string getIPv4Address(const std::string &name);
- RTPS_DllAPI static std::string getIPv6Address(const std::string &name);
- };
- }
- }
- }
- #endif
|