7 #include "../core_export.h"
8 #include "../iequatable.h"
11 #include "../ustring.h"
71 ip_address(
const std::vector<byte_t>& address, uint32_t scope_id);
77 ip_address(byte_t quad_part_address1, byte_t quad_part_address2, byte_t quad_part_address3, byte_t quad_part_address4);
83 friend std::ostream& operator <<(std::ostream& os,
const ip_address& address) noexcept {
return os << address.
to_string();}
93 bool is_ip_v4_mapped_to_ip_v6() const noexcept;
97 bool is_ip_v6_link_local() const noexcept;
101 bool is_ip_v6_multicast() const noexcept;
105 bool is_ip_v6_site_local() const noexcept;
110 bool is_ip_v6_teredo() const noexcept;
115 uint32_t scope_id() const;
121 bool equals(const
object& other) const noexcept override;
122 bool equals(const
ip_address& other) const noexcept override;
126 std::vector<byte_t> get_address_bytes() const;
133 static
double host_to_network_order(
double host);
140 static int16_t host_to_network_order(int16_t host);
147 static int32_t host_to_network_order(int32_t host);
154 static int64_t host_to_network_order(int64_t host);
161 static
float host_to_network_order(
float host);
168 static uint16_t host_to_network_order(uint16_t host);
175 static uint32_t host_to_network_order(uint32_t host);
182 static uint64_t host_to_network_order(uint64_t host);
204 static
double network_to_host_order(
double network);
211 static int16_t network_to_host_order(int16_t network);
218 static int32_t network_to_host_order(int32_t host);
225 static int64_t network_to_host_order(int64_t network);
232 static
float network_to_host_order(
float network);
239 static uint16_t network_to_host_order(uint16_t network);
246 static uint32_t network_to_host_order(uint32_t network);
274 friend
xtd::net::sockets::socket;
275 static constexpr const
size_t number_of_numbers_ = 8;
276 ip_address(const std::vector<uint16_t>& numbers, uint32_t scope_id);
277 uint32_t address_ = 0xFFFFFFFF;
278 std::vector<uint16_t> numbers_ = std::vector<uint16_t>(number_of_numbers_);
279 uint32_t scope_id_ = 0;
Contains xtd::net::sockets::address_family enum.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:19
Provides an Internet Protocol (IP) address.
Definition: ip_address.h:30
static ip_address broadcast
Provides the IP broadcast address. This field is constant.
Definition: ip_address.h:37
static ip_address ip_v6_any
The Socket::Bind method uses the cIPv6Any field to indicate that a Socket must listen for client acti...
Definition: ip_address.h:40
ip_address(const std::vector< byte_t > &address)
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte arr...
static ip_address ip_v6_none
Provides an IP address that indicates that no network interface should be used. This field is constan...
Definition: ip_address.h:47
ip_address(const std::vector< byte_t > &address, uint32_t scope_id)
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte arr...
ip_address()=default
Initializes a new instance of the xtd::net::ip_address.
static ip_address any
Provides an IP address that indicates that the server must listen for client activity on all network ...
Definition: ip_address.h:34
sockets::address_family address_family() const noexcept
Gets the address family of the IP address.
static ip_address none
Provides an IP address that indicates that no network interface should be used. This field is constan...
Definition: ip_address.h:53
ip_address(byte_t quad_part_address1, byte_t quad_part_address2, byte_t quad_part_address3, byte_t quad_part_address4)
Initializes a new instance of the xtd::net::ip_address class with the address specified as a four Byt...
ustring to_string() const noexcept override
Converts an Internet address to its standard notation.
static ip_address ip_v6_loopback
Provides the IP loopback address. This field is constant.
Definition: ip_address.h:43
ip_address(uint32_t address)
Initializes a new instance of the xtd::net::ip_address class with the address specified as an int64_t...
static ip_address loopback
Provides the IP loopback address. This field is constant.
Definition: ip_address.h:50
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define core_export_
Define shared library export.
Definition: core_export.h:13
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition: types.h:219
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use.
Definition: address_family.h:24
bool try_parse(const std::basic_string< char_t > &str, value_t &value)
Convert a type into a string.
Definition: parse.h:354
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37
value_t parse(const std::string &str)
Convert a type into a string.
Definition: parse.h:22
@ socket
Socket options apply to all sockets.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17