proxygen
|
#include <NetworkAddress.h>
Public Member Functions | |
NetworkAddress (const folly::SocketAddress &addr, unsigned prefixLen) | |
const folly::SocketAddress & | getAddress () const |
unsigned | getPrefixLength () const |
bool | contains (const folly::SocketAddress &addr) const |
bool | operator< (const NetworkAddress &other) const |
bool | operator== (const NetworkAddress &other) const |
Private Attributes | |
folly::SocketAddress | addr_ |
unsigned | prefixLen_ |
A simple wrapper around SocketAddress that represents a network in CIDR notation
Definition at line 26 of file NetworkAddress.h.
|
inline |
Create a NetworkAddress for an addr/prefixLen
addr | IPv4 or IPv6 address of the network |
prefixLen | Prefix length, in bits |
Definition at line 33 of file NetworkAddress.h.
|
inline |
Check whether a given address lies within the network
Definition at line 46 of file NetworkAddress.h.
References addr_, prefixLen_, and folly::SocketAddress::prefixMatch().
|
inline |
|
inline |
Get the prefix length in bits
Definition at line 43 of file NetworkAddress.h.
References prefixLen_.
|
inline |
Comparison operator to enable use in ordered collections
Definition at line 51 of file NetworkAddress.h.
References addr_, and prefixLen_.
|
inline |
|
private |
Definition at line 66 of file NetworkAddress.h.
Referenced by contains(), getAddress(), operator<(), and operator==().
|
private |
Definition at line 67 of file NetworkAddress.h.
Referenced by contains(), getPrefixLength(), operator<(), and operator==().