123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- #ifndef IP_LOCATOR_H_
- #define IP_LOCATOR_H_
- #include <vector>
- #include <string>
- #include <fastdds/rtps/common/Locator.h>
- namespace eprosima {
- namespace fastrtps {
- namespace rtps {
- class IPLocator
- {
- public:
-
- RTPS_DllAPI static void createLocator(
- int32_t kindin,
- const std::string& address,
- uint32_t portin,
- Locator_t& locator);
-
- RTPS_DllAPI static bool setIPv4(
- Locator_t& locator,
- const unsigned char* addr);
-
- RTPS_DllAPI static bool setIPv4(
- Locator_t& locator,
- octet o1,
- octet o2,
- octet o3,
- octet o4);
-
- RTPS_DllAPI static bool setIPv4(
- Locator_t& locator,
- const std::string& ipv4);
-
- RTPS_DllAPI static bool setIPv4(
- Locator_t& destlocator,
- const Locator_t& origlocator);
-
- RTPS_DllAPI static const octet* getIPv4(const Locator_t& locator);
-
- RTPS_DllAPI static bool hasIPv4(const Locator_t& locator);
-
- RTPS_DllAPI static std::string toIPv4string(const Locator_t& locator);
-
- RTPS_DllAPI static bool copyIPv4(
- const Locator_t& locator,
- unsigned char* dest);
-
-
- RTPS_DllAPI static bool setIPv6(
- Locator_t& locator,
- const unsigned char* addr);
-
- RTPS_DllAPI static bool setIPv6(
- Locator_t& locator,
- uint16_t group0,
- uint16_t group1,
- uint16_t group2,
- uint16_t group3,
- uint16_t group4,
- uint16_t group5,
- uint16_t group6,
- uint16_t group7);
-
- RTPS_DllAPI static bool setIPv6(
- Locator_t& locator,
- const std::string& ipv6);
-
- RTPS_DllAPI static bool setIPv6(
- Locator_t& destlocator,
- const Locator_t& origlocator);
-
- RTPS_DllAPI static const octet* getIPv6(const Locator_t& locator);
-
- RTPS_DllAPI static bool hasIPv6(const Locator_t& locator);
-
- RTPS_DllAPI static std::string toIPv6string(const Locator_t& locator);
-
- RTPS_DllAPI static bool copyIPv6(
- const Locator_t& locator,
- unsigned char* dest);
-
- RTPS_DllAPI static bool ip(
- Locator_t& locator,
- const std::string& ip);
-
- RTPS_DllAPI static std::string ip_to_string(const Locator_t& locator);
-
-
- RTPS_DllAPI static bool setLogicalPort(
- Locator_t& locator,
- uint16_t port);
-
- RTPS_DllAPI static uint16_t getLogicalPort(const Locator_t& locator);
-
- RTPS_DllAPI static bool setPhysicalPort(
- Locator_t& locator,
- uint16_t port);
-
- RTPS_DllAPI static uint16_t getPhysicalPort(const Locator_t& locator);
-
-
- RTPS_DllAPI static bool setWan(
- Locator_t& locator,
- octet o1,
- octet o2,
- octet o3,
- octet o4);
-
- RTPS_DllAPI static bool setWan(
- Locator_t& locator,
- const std::string& wan);
-
- RTPS_DllAPI static const octet* getWan(const Locator_t& locator);
-
- RTPS_DllAPI static bool hasWan(const Locator_t& locator);
-
- RTPS_DllAPI static std::string toWanstring(const Locator_t& locator);
-
- RTPS_DllAPI static bool setLanID(
- Locator_t& locator,
- const std::string& lanId);
-
- RTPS_DllAPI static const octet* getLanID(const Locator_t& locator);
-
- RTPS_DllAPI static std::string toLanIDstring(const Locator_t& locator);
-
- RTPS_DllAPI static Locator_t toPhysicalLocator(const Locator_t& locator);
-
- RTPS_DllAPI static bool ip_equals_wan(const Locator_t& locator);
-
-
- RTPS_DllAPI static bool setPortRTPS(
- Locator_t& locator,
- uint16_t port);
-
- RTPS_DllAPI static uint16_t getPortRTPS(Locator_t& locator);
-
- RTPS_DllAPI static bool isLocal(const Locator_t& locator);
-
- RTPS_DllAPI static bool isAny(const Locator_t& locator);
-
- RTPS_DllAPI static bool compareAddress(
- const Locator_t& loc1,
- const Locator_t& loc2,
- bool fullAddress = false);
-
- RTPS_DllAPI static bool compareAddressAndPhysicalPort(
- const Locator_t& loc1,
- const Locator_t& loc2);
-
- RTPS_DllAPI static std::string to_string(const Locator_t& locator);
-
-
- RTPS_DllAPI static bool isMulticast(const Locator_t& locator);
- private:
- IPLocator();
- virtual ~IPLocator();
- };
- }
- }
- }
- #endif
|