Provides an Internet Protocol (IP) address.
Public Fields | |
static const ip_address | any |
Provides an IP address that indicates that the server must listen for client activity on all network interfaces. This field is constant. | |
static const ip_address | broadcast |
Provides the IP broadcast address. This field is constant. | |
static const ip_address | ip_v6_any |
The Socket::Bind method uses the cIPv6Any field to indicate that a Socket must listen for client activity on all network interfaces. This field is constant. | |
static const ip_address | ip_v6_loopback |
Provides the IP loopback address. This field is constant. | |
static const ip_address | ip_v6_none |
Provides an IP address that indicates that no network interface should be used. This field is constant. | |
static const ip_address | loopback |
Provides the IP loopback address. This field is constant. | |
static const ip_address | none |
Provides an IP address that indicates that no network interface should be used. This field is constant. | |
Public Constructors | |
ip_address ()=default | |
Initializes a new instance of the xtd::net::ip_address. | |
ip_address (uint32 address) | |
Initializes a new instance of the xtd::net::ip_address class with the address specified as an uint32. | |
ip_address (const std::vector< xtd::byte > &address) | |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array. | |
ip_address (const std::vector< xtd::byte > &address, uint32 scope_id) | |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array. | |
ip_address (xtd::byte quad_part_address1, xtd::byte quad_part_address2, xtd::byte quad_part_address3, xtd::byte quad_part_address4) | |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a four Bytes. | |
Public Properties | |
sockets::address_family | address_family () const noexcept |
Gets the address family of the IP address. | |
bool | is_ip_v4_mapped_to_ip_v6 () const noexcept |
Gets whether the IP address is an IPv4-mapped IPv6 address. | |
bool | is_ip_v6_link_local () const noexcept |
Gets whether the address is an IPv6 link local address. | |
bool | is_ip_v6_multicast () const noexcept |
Gets whether the address is an IPv6 multicast global address. | |
bool | is_ip_v6_site_local () const noexcept |
Gets whether the address is an IPv6 site local address. | |
bool | is_ip_v6_teredo () const noexcept |
Gets whether the address is an IPv6 Teredo address. | |
uint32 | scope_id () const |
Gets the IPv6 address scope identifier. | |
ip_address & | scope_id (uint32 value) |
Sets the IPv6 address scope identifier. | |
Public Methods | |
bool | equals (const ip_address &other) const noexcept override |
std::vector< xtd::byte > | get_address_bytes () const |
Provides a copy of the IPAddress as an array of bytes. | |
ip_address | map_to_ip_v4 () const noexcept |
Maps the xtd::net::ip_address object to an IPv4 address. | |
ip_address | map_to_ip_v6 () const noexcept |
Maps the xtd::net::ip_address object to an IPv6 address. | |
string | to_string () const noexcept override |
Converts an Internet address to its standard notation. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
template<typename object_a_t , typename object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
Public Static Methods | |
static double | host_to_network_order (double host) |
Converts a Double value from host byte order to network byte order. | |
static int16 | host_to_network_order (int16 host) |
Converts a short value from host byte order to network byte order. | |
static int32 | host_to_network_order (int32 host) |
Converts a integer value from host byte order to network byte order. | |
static int64 | host_to_network_order (int64 host) |
Converts a long value from host byte order to network byte order. | |
static float | host_to_network_order (float host) |
Converts a Single value from host byte order to network byte order. | |
static uint16 | host_to_network_order (uint16 host) |
Converts a short value from host byte order to network byte order. | |
static uint32 | host_to_network_order (uint32 host) |
Converts a integer value from host byte order to network byte order. | |
static uint64 | host_to_network_order (uint64 host) |
Converts a long value from host byte order to network byte order. | |
static bool | is_loopback (const ip_address &address) |
Indicates whether the specified IP address is the loopback address. | |
static double | network_to_host_order (double network) |
Converts a Double value from network byte order to host byte order. | |
static int16 | network_to_host_order (int16 network) |
Converts a short value from network byte order to host byte order. | |
static int32 | network_to_host_order (int32 host) |
Converts a integer value from network byte order to host byte order. | |
static int64 | network_to_host_order (int64 network) |
Converts a long value from network byte order to host byte order. | |
static float | network_to_host_order (float network) |
Converts a Single value from network byte order to host byte order. | |
static uint16 | network_to_host_order (uint16 network) |
Converts a short value from network byte order to host byte order. | |
static uint32 | network_to_host_order (uint32 network) |
Converts a integer value from network byte order to host byte order. | |
static uint64 | network_to_host_order (uint64 network) |
Converts a long value from network byte order to host byte order. | |
static ip_address | parse (const string &str) |
Converts an IP address string to an xtd::net::ip_address instance. | |
static bool | try_parse (const string &str, ip_address &address) noexcept |
Determines whether a string is a valid IP address. | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<typename object_t > | |
xtd::uptr< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
Public Member Functions inherited from xtd::iequatable< ip_address > | |
virtual bool | equals (const ip_address &) const noexcept=0 |
Indicates whether the current object is equal to another object of the same type. | |
Static Public Member Functions inherited from xtd::object | |
template<typename object_a_t , typename object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<typename object_a_t , typename object_b_t > | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
|
default |
Initializes a new instance of the xtd::net::ip_address.
|
explicit |
Initializes a new instance of the xtd::net::ip_address class with the address specified as an uint32.
address | The value of the IP address. For example, the value 0x2414188F in big-endian format would be the IP address "143.24.20.36". |
|
explicit |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array.
address | The byte array value of the IP address. |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array.
address | The byte array value of the IP address. |
scope_id | The long value of the scope identifier. |
xtd::argument_out_of_range_exception | scope_id < 0 or scope_id > 0x00000000FFFFFFFF. |
xtd::net::ip_address::ip_address | ( | xtd::byte | quad_part_address1, |
xtd::byte | quad_part_address2, | ||
xtd::byte | quad_part_address3, | ||
xtd::byte | quad_part_address4 | ||
) |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a four Bytes.
quad_part_address1 | The first quad part of the IP address. |
quad_part_address2 | The second quad part of the IP address. |
quad_part_address3 | The third quad part of the IP address. |
quad_part_address4 | The fourth quad part of the IP address. |
|
noexcept |
Gets the address family of the IP address.
|
noexcept |
Gets whether the IP address is an IPv4-mapped IPv6 address.
|
noexcept |
Gets whether the address is an IPv6 link local address.
|
noexcept |
Gets whether the address is an IPv6 multicast global address.
|
noexcept |
Gets whether the address is an IPv6 site local address.
|
noexcept |
Gets whether the address is an IPv6 Teredo address.
uint32 xtd::net::ip_address::scope_id | ( | ) | const |
Gets the IPv6 address scope identifier.
xtd::net::sockets::socket_exception | if address_family = sockets::address_family::inter_network |
ip_address & xtd::net::ip_address::scope_id | ( | uint32 | value | ) |
Sets the IPv6 address scope identifier.
value | A uint32 that specifies the scope of the address. |
xtd::net::sockets::socket_exception | if address_family = sockets::address_family::inter_network |
std::vector< xtd::byte > xtd::net::ip_address::get_address_bytes | ( | ) | const |
Provides a copy of the IPAddress as an array of bytes.
|
noexcept |
Maps the xtd::net::ip_address object to an IPv4 address.
|
noexcept |
Maps the xtd::net::ip_address object to an IPv6 address.
|
overridevirtualnoexcept |
Converts an Internet address to its standard notation.
Reimplemented from xtd::object.
|
static |
Converts a Double value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
Converts a short value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
Converts a integer value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
Converts a long value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
|
static |
Converts a Single value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
Converts a short value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
Converts a integer value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
Converts a long value from host byte order to network byte order.
host | The number to convert, expressed in host byte order. |
|
static |
Indicates whether the specified IP address is the loopback address.
address | An IP address. |
|
static |
Converts a Double value from network byte order to host byte order.
network | The number to convert, expressed in network byte order. |
Converts a short value from network byte order to host byte order.
network | The number to convert, expressed in network byte order. |
Converts a integer value from network byte order to host byte order.
host | The number to convert, expressed in network byte order. |
Converts a long value from network byte order to host byte order.
network | The number to convert, expressed in network byte order. |
|
static |
Converts a Single value from network byte order to host byte order.
network | The number to convert, expressed in host byte order. |
Converts a short value from network byte order to host byte order.
network | The number to convert, expressed in network byte order. |
Converts a integer value from network byte order to host byte order.
network | The number to convert, expressed in network byte order. |
Converts a long value from network byte order to host byte order.
network | The number to convert, expressed in network byte order. |
|
static |
Converts an IP address string to an xtd::net::ip_address instance.
str | A string that contains an IP address in dotted-quad notation for IPv4 and in colon-hexadecimal notation for IPv6. |
xtd::format_exception | str is not a valid IP address. |
|
staticnoexcept |
Determines whether a string is a valid IP address.
str | The string to validate. |
address | The xtd::net::ip_address version of the string. |
|
virtualnoexcept |
Determines whether the specified object is equal to the current object.
obj | The object to compare with the current object. |
Reimplemented from xtd::object.
|
inlinestaticnoexcept |
Determines whether the specified object instances are considered equal.
object_a | The first object to compare. |
object_b | The second object to compare. |
|
static |
Provides an IP address that indicates that the server must listen for client activity on all network interfaces. This field is constant.
|
static |
Provides the IP broadcast address. This field is constant.
|
static |
The Socket::Bind method uses the cIPv6Any field to indicate that a Socket must listen for client activity on all network interfaces. This field is constant.
|
static |
Provides the IP loopback address. This field is constant.
|
static |
Provides an IP address that indicates that no network interface should be used. This field is constant.
|
static |
Provides the IP loopback address. This field is constant.
|
static |
Provides an IP address that indicates that no network interface should be used. This field is constant.