OpenVPN 3 Core Library
|
#include <ip.hpp>
Public Types | |
enum | Version { UNSPEC , V4 , V6 } |
enum | { V4_MASK = (1 << 0) , V6_MASK = (1 << 1) } |
enum | VersionSize { V4_SIZE = IPv4::Addr::SIZE , V6_SIZE = IPv6::Addr::SIZE } |
typedef unsigned int | VersionMask |
Public Member Functions | |
template<typename TITLE > | |
Addr (const Addr &other, const TITLE &title, const Version required_version) | |
template<typename TITLE > | |
Addr (const Addr &other, const TITLE &title) | |
template<typename TITLE > | |
Addr (const std::string &ipstr, const TITLE &title, const Version required_version) | |
template<typename TITLE > | |
Addr (const std::string &ipstr, const TITLE &title) | |
Addr (const std::string &ipstr) | |
template<typename TITLE > | |
void | validate_version (const TITLE &title, const Version required_version) const |
const IPv4::Addr & | to_ipv4 () const |
IPv4::Addr | to_ipv4_zero () const |
const IPv6::Addr & | to_ipv6 () const |
IPv6::Addr | to_ipv6_zero () const |
const IPv4::Addr & | to_ipv4_nocheck () const |
const IPv6::Addr & | to_ipv6_nocheck () const |
unsigned long | to_ulong () const |
long | to_long () const |
void | to_byte_string (unsigned char *bytestr) const |
void | to_byte_string_variable (unsigned char *bytestr) const |
std::uint32_t | to_uint32_net () const |
Addr | netmask_from_this_as_extent () const |
std::string | to_string () const |
std::string | to_string_bracket_ipv6 () const |
std::string | to_hex () const |
std::string | arpa () const |
openvpn_io::ip::address | to_asio () const |
Addr | operator+ (const long delta) const |
Addr | operator- (const long delta) const |
Addr | operator<< (const unsigned int shift) const |
Addr | operator>> (const unsigned int shift) const |
Addr | operator~ () const |
Addr | network_addr (const unsigned int prefix_len) const |
bool | operator== (const Addr &other) const |
bool | operator!= (const Addr &other) const |
bool | operator< (const Addr &other) const |
bool | operator> (const Addr &other) const |
bool | operator<= (const Addr &other) const |
bool | operator>= (const Addr &other) const |
Addr | operator+ (const Addr &other) const |
Addr | operator- (const Addr &other) const |
Addr | operator* (const Addr &other) const |
Addr | operator/ (const Addr &other) const |
Addr | operator% (const Addr &other) const |
Addr | operator& (const Addr &other) const |
Addr | operator| (const Addr &other) const |
bool | unspecified () const |
bool | specified () const |
bool | all_zeros () const |
bool | all_ones () const |
bool | is_loopback () const |
bool | is_mapped_address () const |
IP::Addr | to_v4_addr () const |
bool | defined () const |
const char * | version_string () const |
Version | version () const |
VersionMask | version_mask () const |
int | version_index () const |
int | family () const |
bool | is_compatible (const Addr &other) const |
bool | is_ipv6 () const |
void | verify_version_consistency (const Addr &other) const |
void | validate_netmask () const |
unsigned int | prefix_len () const |
int | scope_id () const |
unsigned int | host_len () const |
Addr | extent_from_netmask () const |
unsigned int | size () const |
unsigned int | size_bytes () const |
template<typename HASH > | |
void | hash (HASH &h) const |
Addr () | |
void | reset () |
Addr & | operator= (const Addr &other) |
Addr & | operator++ () |
Addr & | operator+= (const long delta) |
Addr & | operator-= (const long delta) |
void | reset_ipv4_from_uint32 (const IPv4::Addr::base_type addr) |
Static Public Member Functions | |
template<typename TITLE > | |
static Addr | from_string (const std::string &ipstr, const TITLE &title, const Version required_version) |
template<typename TITLE > | |
static Addr | from_string (const std::string &ipstr, const TITLE &title) |
static Addr | from_string (const std::string &ipstr) |
template<typename TITLE > | |
static std::string | validate (const std::string &ipstr, const TITLE &title, const Version required_version) |
template<typename TITLE > | |
static std::string | validate (const std::string &ipstr, const TITLE &title) |
static std::string | validate (const std::string &ipstr) |
static bool | is_valid (const std::string &ipstr) |
static Addr | from_hex (Version v, const std::string &s) |
static Addr | from_ipv4 (IPv4::Addr addr) |
static Addr | from_ipv6 (IPv6::Addr addr) |
static Addr | from_sockaddr (const struct sockaddr *sa) |
static bool | sockaddr_defined (const struct sockaddr *sa) |
static Addr | from_ulong (Version v, unsigned long ul) |
static Addr | from_long (Version v, const long ul) |
static Addr | from_byte_string (const unsigned char *bytestr) |
static Addr | from_zero (const Version v) |
static Addr | from_one (const Version v) |
static Addr | from_zero_complement (const Version v) |
static bool | validate_prefix_len (Version v, const unsigned int prefix_len) |
static Addr | netmask_from_prefix_len (Version v, const unsigned int prefix_len) |
static Addr | from_asio (const openvpn_io::ip::address &addr) |
static const char * | version_string_static (Version ver) |
static VersionMask | version_mask (const Version ver) |
static unsigned int | version_size (Version v) |
Private Member Functions | |
template<typename Comparator > | |
bool | compare (const Addr &other, Comparator comp) const |
template<typename BinaryOp > | |
Addr | binary_op (const Addr &other, BinaryOp op) const |
Private Attributes | ||
union { | ||
IPv4::Addr v4 | ||
IPv6::Addr v6 | ||
} | u | |
Version | ver | |
typedef unsigned int openvpn::IP::Addr::VersionMask |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inlinestatic |
union { ... } openvpn::IP::Addr::u |
IPv4::Addr openvpn::IP::Addr::v4 |
IPv6::Addr openvpn::IP::Addr::v6 |