Wrapper for dealing with internet Ip addresses.
More...
#include <IpAddress.h>
|
using | IpString = AZStd::fixed_string< MaxIpStringLength > |
|
|
| IpAddress (const char *hostname, const char *service, ProtocolType type) |
|
| IpAddress (const char *hostname, uint16_t port, ProtocolType type) |
|
| IpAddress (uint8_t quadA, uint8_t quadB, uint8_t quadC, uint8_t quadD, uint16_t port) |
|
| IpAddress (ByteOrder byteOrder, uint32_t address, uint16_t port) |
|
uint32_t | GetAddress (ByteOrder byteOrder) const |
|
uint16_t | GetPort (ByteOrder byteOrder) const |
|
uint8_t | GetQuadA () const |
|
uint8_t | GetQuadB () const |
|
uint8_t | GetQuadC () const |
|
uint8_t | GetQuadD () const |
|
IpString | GetString () const |
|
IpString | GetIpString () const |
|
bool | operator== (const IpAddress &rhs) const |
|
bool | operator!= (const IpAddress &rhs) const |
|
bool | operator< (const IpAddress &rhs) const |
|
bool | operator<= (const IpAddress &rhs) const |
|
bool | operator> (const IpAddress &rhs) const |
|
bool | operator>= (const IpAddress &rhs) const |
|
bool | Serialize (ISerializer &serializer) |
|
|
static constexpr uint32_t | MaxIpStringLength = 32 |
|
Wrapper for dealing with internet Ip addresses.
◆ IpAddress() [1/4]
AzNetworking::IpAddress::IpAddress |
( |
const char * |
hostname, |
|
|
const char * |
service, |
|
|
ProtocolType |
type |
|
) |
| |
Construct from a string hostname.
- Parameters
-
hostname | hostname to convert to an IpAddress "amazon.com" or "127.0.0.1" |
service | service or port number "80" or "http" |
◆ IpAddress() [2/4]
AzNetworking::IpAddress::IpAddress |
( |
const char * |
hostname, |
|
|
uint16_t |
port, |
|
|
ProtocolType |
type |
|
) |
| |
Construct from a string hostname.
- Parameters
-
hostname | hostname to convert to an IpAddress "amazon.com" or "127.0.0.1" |
port | the port number |
◆ IpAddress() [3/4]
AzNetworking::IpAddress::IpAddress |
( |
uint8_t |
quadA, |
|
|
uint8_t |
quadB, |
|
|
uint8_t |
quadC, |
|
|
uint8_t |
quadD, |
|
|
uint16_t |
port |
|
) |
| |
Construct from a set of Ipv4 quads.
- Parameters
-
quadA | first quad of the address |
quadB | second quad of the address |
quadC | third quad of the address |
quadD | forth quad of the address |
port | port number given in host byte order |
◆ IpAddress() [4/4]
AzNetworking::IpAddress::IpAddress |
( |
ByteOrder |
byteOrder, |
|
|
uint32_t |
address, |
|
|
uint16_t |
port |
|
) |
| |
Construct from an IPv4Address and port number given in the provided byte order.
- Parameters
-
byteOrder | the byte order of the provided parameters |
address | IPv4Address given in host byte order |
port | port number given in host byte order |
◆ GetAddress()
uint32_t AzNetworking::IpAddress::GetAddress |
( |
ByteOrder |
byteOrder | ) |
const |
Returns the address in requested byte order
- Returns
- internal IPv4Address in requested byte order
◆ GetIpString()
IpString AzNetworking::IpAddress::GetIpString |
( |
| ) |
const |
Returns just the ip address with no port number in a human readable string form.
- Returns
- just the ip address with no port number in a human readable string form
◆ GetPort()
uint16_t AzNetworking::IpAddress::GetPort |
( |
ByteOrder |
byteOrder | ) |
const |
Returns the port number in requested byte order
- Returns
- internal port number in requested byte order
◆ GetQuadA()
uint8_t AzNetworking::IpAddress::GetQuadA |
( |
| ) |
const |
|
inline |
Return the first dotted quad of the internal Ipv4Address
- Returns
- first dotted quad of the internal Ipv4Address
◆ GetQuadB()
uint8_t AzNetworking::IpAddress::GetQuadB |
( |
| ) |
const |
|
inline |
Return the second dotted quad of the internal Ipv4Address
- Returns
- second dotted quad of the internal Ipv4Address
◆ GetQuadC()
uint8_t AzNetworking::IpAddress::GetQuadC |
( |
| ) |
const |
|
inline |
Return the third dotted quad of the internal Ipv4Address
- Returns
- third dotted quad of the internal Ipv4Address
◆ GetQuadD()
uint8_t AzNetworking::IpAddress::GetQuadD |
( |
| ) |
const |
|
inline |
Return the forth dotted quad of the internal Ipv4Address
- Returns
- forth dotted quad of the internal Ipv4Address
◆ GetString()
IpString AzNetworking::IpAddress::GetString |
( |
| ) |
const |
Returns the address in a human readable string form.
- Returns
- the address in a human readable string form
◆ operator!=()
bool AzNetworking::IpAddress::operator!= |
( |
const IpAddress & |
rhs | ) |
const |
|
inline |
Inequality operator
- Parameters
-
rhs | base type value to compare against |
- Returns
- boolean true if this != rhs
◆ operator<()
bool AzNetworking::IpAddress::operator< |
( |
const IpAddress & |
rhs | ) |
const |
|
inline |
Strictly less than operator.
- Parameters
-
rhs | base type value to compare against |
- Returns
- boolean true if this < rhs
◆ operator<=()
bool AzNetworking::IpAddress::operator<= |
( |
const IpAddress & |
rhs | ) |
const |
|
inline |
Less than equal to operator.
- Parameters
-
rhs | base type value to compare against |
- Returns
- boolean true if this <= rhs
◆ operator==()
bool AzNetworking::IpAddress::operator== |
( |
const IpAddress & |
rhs | ) |
const |
|
inline |
Equality operator.
- Parameters
-
rhs | base type value to compare against |
- Returns
- boolean true if this == rhs
◆ operator>()
bool AzNetworking::IpAddress::operator> |
( |
const IpAddress & |
rhs | ) |
const |
|
inline |
Strictly greater than operator.
- Parameters
-
rhs | base type value to compare against |
- Returns
- boolean true if this > rhs
◆ operator>=()
bool AzNetworking::IpAddress::operator>= |
( |
const IpAddress & |
rhs | ) |
const |
|
inline |
Greater than equal to operator.
- Parameters
-
rhs | base type value to compare against |
- Returns
- boolean true if this >= rhs
◆ Serialize()
bool AzNetworking::IpAddress::Serialize |
( |
ISerializer & |
serializer | ) |
|
Serializes the ipAddress using the provided serializer instance.
- Parameters
-
serializer | ISerializer instance to use for serialization |
- Returns
- boolean true for success, false for serialization failure
The documentation for this class was generated from the following files:
- Code/Framework/AzNetworking/AzNetworking/Utilities/IpAddress.h
- Code/Framework/AzNetworking/AzNetworking/Utilities/IpAddress.inl