7 #include "../core_export.h" 8 #include "../iequatable.h" 11 #include "../ustring.h" 74 explicit ip_address(
const std::vector<byte_t>& address);
82 ip_address(
const std::vector<byte_t>& address, uint32_t scope_id);
88 ip_address(byte_t quad_part_address1, byte_t quad_part_address2, byte_t quad_part_address3, byte_t quad_part_address4);
95 friend std::ostream& operator <<(std::ostream& os,
const ip_address& address) noexcept {
return os << address.
to_string();}
108 bool is_ip_v4_mapped_to_ip_v6() const noexcept;
112 bool is_ip_v6_link_local() const noexcept;
116 bool is_ip_v6_multicast() const noexcept;
120 bool is_ip_v6_site_local() const noexcept;
125 bool is_ip_v6_teredo() const noexcept;
130 uint32_t scope_id() const;
140 bool equals(const
object& other) const noexcept override;
141 bool equals(const
ip_address& other) const noexcept override;
145 std::vector<byte_t> get_address_bytes() const;
152 static
double host_to_network_order(
double host);
159 static int16_t host_to_network_order(int16_t host);
166 static int32_t host_to_network_order(int32_t host);
173 static int64_t host_to_network_order(int64_t host);
180 static
float host_to_network_order(
float host);
187 static uint16_t host_to_network_order(uint16_t host);
194 static uint32_t host_to_network_order(uint32_t host);
201 static uint64_t host_to_network_order(uint64_t host);
206 static
bool is_loopback(const
ip_address& address);
223 static
double network_to_host_order(
double network);
230 static int16_t network_to_host_order(int16_t network);
237 static int32_t network_to_host_order(int32_t host);
244 static int64_t network_to_host_order(int64_t network);
251 static
float network_to_host_order(
float network);
258 static uint16_t network_to_host_order(uint16_t network);
265 static uint32_t network_to_host_order(uint32_t network);
295 static constexpr const
size_t number_of_numbers_ = 8;
296 ip_address(const std::vector<uint16_t>& numbers, uint32_t scope_id);
297 uint32_t address_ = 0xFFFFFFFF;
298 std::vector<uint16_t> numbers_ = std::vector<uint16_t>(number_of_numbers_);
299 uint32_t scope_id_ = 0;
Provides an Internet Protocol (IP) address.
Definition: ip_address.h:34
Address for IP version 4.
value_t parse(const std::string &str)
Convert a string into a type.
Definition: parse.h:22
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
bool try_parse(const std::basic_string< char_t > &str, value_t &value)
Convert a string into a type.
Definition: parse.h:399
static ip_address ip_v6_loopback
Provides the IP loopback address. This field is constant.
Definition: ip_address.h:50
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:50
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1110
uint64_t uint64
Represents a 64-bit unsigned integer.
Definition: types.h:211
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:19
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:41
Socket options apply to all sockets.
static ip_address loopback
Provides the IP loopback address. This field is constant.
Definition: ip_address.h:57
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:30
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:54
Contains xtd::net::sockets::address_family enum.
ustring to_string() const noexcept override
Converts an Internet address to its standard notation.
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:47
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:60
static ip_address broadcast
Provides the IP broadcast address. This field is constant.
Definition: ip_address.h:44
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use...
Definition: address_family.h:27