A representation of an IP address (IPv4 or IPv6).
Synopsis
Declared in <folly/IPAddress.h>
class IPAddress;
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
Converts an IPAddress to an IPAddressV4 instance. |
|
Converts an IPAddress to an IPAddressV6 instance |
|
The number of bits in the address representation |
|
The number of bytes in the address representation |
|
Returns a pointer to the to IP address bytes, in network byte order. |
|
Returns true if address is uninitialised |
|
Return then |
|
Get the nth bit of the IP address (0‐indexed). |
|
Get the nth byte of the IP address (0‐indexed). |
|
Get the nth most significant bit of the IP address (0‐indexed). |
|
Get the nth most significant byte of the IP address (0‐indexed). |
|
Returns a hash of the IP address. |
|
|
|
Check if an IPAddress belongs to the subnet with the given mask. |
|
Returns true if address is a v4 mapped address |
|
Return true if the IP address qualifies as link local |
|
Return true if the IP address qualifies as broadcast. |
|
Return true if the IP address qualifies as localhost. |
|
Return true if the IP address is a multicast address. |
|
Return true if the IP address is a special purpose address, as defined per RFC 6890 (i.e. 0.0.0.0). |
|
Return true if the IP address is private, as per RFC 1918 and RFC 4193. |
|
Returns true if this represents an IPv4 address |
|
Returns true if this represents an IPv6 address |
|
Returns true if the address is all zeros |
|
Creates an IPAddress instance with all but most significant numBits set to 0. |
|
Provides a string representation of address. |
|
Return the fully qualified string representation of the address. |
|
Same as toFullyQualified() but append to an output string. |
|
Get a json representation of the IP address. |
|
Given a |
|
Returns the IP address version. 0 if empty, 4 or 6 if nonempty. |
|
Returns true if address is initalised |
Static Member Functions
Name |
Description |
Return the IPAddressV4 representation of the address, converting from V6 to V4 if needed. |
|
Return the address as a IPAddressV6, converting from V4 to V6 if needed. |
|
Create a network and mask from a CIDR formatted address string. |
|
Create a new IPAddress instance from the provided binary data in network byte order. |
|
Create an IPAddress from a |
|
Create an IPAddress from a |
|
Given 2 (IPAddress, mask) pairs, extract the longest common pair. |
|
Return a string representation of a CIDR block created with createNetwork(). |
|
Create a network and mask from a CIDR formatted address string. |
|
Non‐throwing version of fromBinary(). On failure returns IPAddressFormatError. |
|
Tries to create a new IPAddress instance from the provided sockaddr. |
|
Tries to create a new IPAddress instance from provided string. |
|
Returns true if the input string can be parsed as an IP address. |
Non-Member Functions
Name |
Description |
|
|
Return true if two address are not equal |
|
Three‐way comparison for IPAddress. |
|
Return true if two addresses are equal. |
|
Append a string representation of the IP address to an fbstring. |
|
overloadbrief Define toAppend() to allow IPAddress to be used with |
Created with MrDocs