23 #include <fastdds/rtps/common/Types.h> 24 #include <fastdds/dds/log/Log.hpp> 54 const std::string& address,
59 RTPS_DllAPI
static bool setIPv4(
61 const unsigned char* addr);
64 RTPS_DllAPI
static bool setIPv4(
72 RTPS_DllAPI
static bool setIPv4(
74 const std::string& ipv4);
77 RTPS_DllAPI
static bool setIPv4(
78 Locator_t& destlocator,
79 const Locator_t& origlocator);
83 Locator_t& destlocator,
84 const std::string& lan,
85 const std::string& wan,
86 const std::string& ipv4);
89 RTPS_DllAPI
static const octet*
getIPv4(
90 const Locator_t& locator);
93 RTPS_DllAPI
static bool hasIPv4(
94 const Locator_t& locator);
98 const Locator_t& locator);
107 const Locator_t& locator,
108 unsigned char* dest);
118 const Locator_t& locator,
123 RTPS_DllAPI
static bool setIPv6(
125 const unsigned char* addr);
128 RTPS_DllAPI
static bool setIPv6(
140 RTPS_DllAPI
static bool setIPv6(
142 const std::string& ipv6);
145 RTPS_DllAPI
static bool setIPv6(
146 Locator_t& destlocator,
147 const Locator_t& origlocator);
150 RTPS_DllAPI
static const octet*
getIPv6(
151 const Locator_t& locator);
154 RTPS_DllAPI
static bool hasIPv6(
155 const Locator_t& locator);
159 const Locator_t& locator);
163 const Locator_t& locator,
164 unsigned char* dest);
167 RTPS_DllAPI
static bool ip(
169 const std::string&
ip);
173 const Locator_t& locator);
183 const Locator_t& locator);
192 const Locator_t& locator);
196 RTPS_DllAPI
static bool setWan(
204 RTPS_DllAPI
static bool setWan(
206 const std::string& wan);
209 RTPS_DllAPI
static const octet*
getWan(
210 const Locator_t& locator);
213 RTPS_DllAPI
static bool hasWan(
214 const Locator_t& locator);
218 const Locator_t& locator);
224 const Locator_t& locator);
229 const std::string& lanId);
232 RTPS_DllAPI
static const octet*
getLanID(
233 const Locator_t& locator);
237 const Locator_t& locator);
241 const Locator_t& locator);
245 const Locator_t& locator);
258 RTPS_DllAPI
static bool isLocal(
259 const Locator_t& locator);
262 RTPS_DllAPI
static bool isAny(
263 const Locator_t& locator);
267 const Locator_t& loc1,
268 const Locator_t& loc2,
269 bool fullAddress =
false);
278 const Locator_t& loc1,
283 const Locator_t& loc1,
284 const Locator_t& loc2);
287 RTPS_DllAPI
static std::string
to_string(
288 const Locator_t& locator);
293 const Locator_t& locator);
296 RTPS_DllAPI
static std::pair<std::set<std::string>, std::set<std::string>>
resolveNameDNS(
297 const std::string& address_name);
300 RTPS_DllAPI
static bool isIPv4(
301 const std::string& address);
303 RTPS_DllAPI
static bool isIPv6(
304 const std::string& address);
311 const Locator_t& locator);
315 const Locator_t& locator,
320 const std::string& ipv6);
Class IPLocator, to provide helper functions to the IP based transports.
Definition: IPLocator.h:41
static RTPS_DllAPI std::string ip_to_string(const Locator_t &locator)
Returns a string representation of the locator's IP.
static RTPS_DllAPI bool isAny(const Locator_t &locator)
Checks if a locator has any IP address.
static bool IPv6isCorrect(const std::string &ipv6)
static RTPS_DllAPI bool setPhysicalPort(Locator_t &locator, uint16_t port)
Sets locator's physical port (as in RTCP protocol)
static RTPS_DllAPI const octet * getIPv6(const Locator_t &locator)
Retrieves locator's IPv6 as octet array.
static RTPS_DllAPI std::string toIPv6string(const Locator_t &locator)
Returns a string representation of the locator's IPv6 following RFC 5952 recommendation.
static RTPS_DllAPI bool compareAddress(const Locator_t &loc1, const Locator_t &loc2, bool fullAddress=false)
Checks if both locators has the same IP address.
static RTPS_DllAPI bool setLogicalPort(Locator_t &locator, uint16_t port)
Sets locator's logical port (as in RTCP protocol)
static RTPS_DllAPI uint16_t getPhysicalPort(const Locator_t &locator)
Gets locator's physical port (as in RTCP protocol)
static RTPS_DllAPI bool isIPv4(const std::string &address)
Check whether a string contains an IPv4 format.
static RTPS_DllAPI std::string to_string(const Locator_t &locator)
Returns a string representation of the given locator.
static RTPS_DllAPI bool setLanID(Locator_t &locator, const std::string &lanId)
Sets locator's LAN ID (as in RTCP protocol)
static RTPS_DllAPI Locator_t WanToLanLocator(const Locator_t &locator)
This method is useful in the case of having a tcp client with an initial peer pointing to a WAN locat...
static RTPS_DllAPI bool hasIPv6(const Locator_t &locator)
Check if the locator has IPv6.
static RTPS_DllAPI const octet * getIPv4(const Locator_t &locator)
Retrieves locator's IPv4 as octet array.
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23
static RTPS_DllAPI std::string toLanIDstring(const Locator_t &locator)
Retrieves a string representation of the locator's LAN ID (as in RTCP protocol)
static RTPS_DllAPI bool setIPv4(Locator_t &locator, const unsigned char *addr)
Sets locator's IPv4.
static RTPS_DllAPI bool compareAddressAndPhysicalPort(const Locator_t &loc1, const Locator_t &loc2)
Checks if a both locators has the same IP address and physical port (as in RTCP protocol).
static RTPS_DllAPI bool setWan(Locator_t &locator, octet o1, octet o2, octet o3, octet o4)
Sets locator's WAN address (as in RTCP protocol)
static RTPS_DllAPI std::string toIPv4string(const Locator_t &locator)
Returns a string representation of the locator's IPv4.
static RTPS_DllAPI const octet * getWan(const Locator_t &locator)
Gets locator's WAN address (as in RTCP protocol)
static RTPS_DllAPI const octet * getLanID(const Locator_t &locator)
Gets locator's LAN ID (as in RTCP protocol)
static RTPS_DllAPI bool copy_address(const Locator_t &loc1, Locator_t &loc2)
Copies the whole address from one locator to another.
static bool isEmpty(const Locator_t &locator)
static RTPS_DllAPI bool isLocal(const Locator_t &locator)
Checks if a locator has local IP address.
static RTPS_DllAPI bool hasIPv4(const Locator_t &locator)
Check if the locator has IPv4.
static RTPS_DllAPI bool setIPv4address(Locator_t &destlocator, const std::string &lan, const std::string &wan, const std::string &ipv4)
Copies locator's IPv4.
static RTPS_DllAPI bool isIPv6(const std::string &address)
Check whether a string contains an IPv6 format.
static RTPS_DllAPI Locator_t toPhysicalLocator(const Locator_t &locator)
Returns a new locator without logical port (as in RTCP protocol).
static RTPS_DllAPI void createLocator(int32_t kindin, const std::string &address, uint32_t portin, Locator_t &locator)
Fills locator with the given parameters.
static RTPS_DllAPI bool copyIPv4(const Locator_t &locator, unsigned char *dest)
Copies locator's IPv4 to a destination array.
static RTPS_DllAPI bool ip(Locator_t &locator, const std::string &ip)
Sets locator's IP.
static RTPS_DllAPI std::string toWanstring(const Locator_t &locator)
Retrieves a string representation of the locator's WAN address (as in RTCP protocol) ...
static RTPS_DllAPI std::pair< std::set< std::string >, std::set< std::string > > resolveNameDNS(const std::string &address_name)
Resolve an address name by a DNS request and return the IP that this address references by a DNS serv...
static RTPS_DllAPI bool isMulticast(const Locator_t &locator)
Checks if the locator has a multicast IP address.
static RTPS_DllAPI bool ip_equals_wan(const Locator_t &locator)
Checks if a locator WAN address and IP address are the same (as in RTCP protocol).
static RTPS_DllAPI bool copyIPv6(const Locator_t &locator, unsigned char *dest)
Copies locator's IPv6.
static RTPS_DllAPI bool setPortRTPS(Locator_t &locator, uint16_t port)
Sets locator's RTCP port. Physical for UDP and logical for TCP (as in RTCP protocol) ...
static RTPS_DllAPI bool hasWan(const Locator_t &locator)
Checks if the locator has WAN address (as in RTCP protocol)
static RTPS_DllAPI bool setIPv6(Locator_t &locator, const unsigned char *addr)
Sets locator's IPv6.
static RTPS_DllAPI uint16_t getLogicalPort(const Locator_t &locator)
Gets locator's logical port (as in RTCP protocol)
static RTPS_DllAPI uint16_t getPortRTPS(Locator_t &locator)
Gets locator's RTCP port. Physical for UDP and logical for TCP (as in RTCP protocol) ...