SteamNetworkingIPAddr

Store an IP and port. IPv6 is always used; IPv4 is represented using "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd (RFC 4291 section 2.5.5.2.)

Members

Functions

Clear
void Clear()

Set everything to zero. E.g. [::]:0

GetFakeIPType
ESteamNetworkingFakeIPType GetFakeIPType()

See if two addresses are identical Classify address as FakeIP. This function never returns k_ESteamNetworkingFakeIPType_Invalid.

IsFakeIP
bool IsFakeIP()

Return true if we are a FakeIP

IsIPv4
bool IsIPv4()

Return true if IP is mapped IPv4

IsIPv6AllZeros
bool IsIPv6AllZeros()

Return true if the IP is ::0. (Doesn't check port.)

ParseString
bool ParseString(const(char)* pszStr)

Parse an IP address and optional port. If a port is not present, it is set to 0. (This means that you cannot tell if a zero port was explicitly specified.)

ToString
void ToString(char* buf, size_t cbBuf, bool bWithPort)

Print to a string, with or without the port. Mapped IPv4 addresses are printed as dotted decimal (12.34.56.78), otherwise this will print the canonical form according to RFC5952. If you include the port, IPv6 will be surrounded by brackets, e.g. [::1:2]:80. Your buffer should be at least k_cchMaxString bytes to avoid truncation

Manifest constants

k_cchMaxString
enum k_cchMaxString;

Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1)

Structs

IPv4MappedAddress
struct IPv4MappedAddress

RFC4038, section 4.2

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

m_port
ushort m_port;
Undocumented in source.

Meta