OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::IP::RouteType< ADDR > Class Template Reference

#include <route.hpp>

Public Types

typedef ADDR Addr
 

Public Member Functions

 OPENVPN_EXCEPTION (route_error)
 
 RouteType ()
 
 RouteType (const ADDR &addr_arg, const unsigned int prefix_len_arg)
 
template<typename TITLE >
 RouteType (const std::string &rtstr, const TITLE &title)
 
 RouteType (const std::string &rtstr)
 
template<typename TITLE >
void validate_prefix_length (const TITLE &title)
 
bool defined () const
 
IP::Addr::Version version () const
 
IP::Addr::VersionMask version_mask () const
 
RouteType< IPv4::Addrto_ipv4 () const
 
RouteType< IPv6::Addrto_ipv6 () const
 
ADDR netmask () const
 
size_t extent () const
 
bool is_canonical () const
 
bool is_valid () const
 
ADDR canonical_addr () const
 
void force_canonical ()
 
void verify_canonical () const
 
bool is_host () const
 
unsigned int host_bits () const
 
bool contains (const ADDR &a) const
 
bool contains (const RouteType &r) const
 
bool split (RouteType &r1, RouteType &r2) const
 
std::string to_string () const
 
std::string to_string_by_netmask () const
 
std::string to_string_optional_prefix_len () const
 
bool operator== (const RouteType &other) const
 
bool operator!= (const RouteType &other) const
 
bool operator< (const RouteType &other) const
 
template<typename HASH >
void hash (HASH &h) const
 

Static Public Member Functions

template<typename TITLE >
static RouteType from_string (const std::string &rtstr, const TITLE &title)
 
static RouteType from_string (const std::string &rtstr)
 

Public Attributes

ADDR addr
 
unsigned int prefix_len
 

Static Private Member Functions

static IPv4::Addr netmask_ (const IPv4::Addr &, unsigned int prefix_len)
 
static IPv6::Addr netmask_ (const IPv6::Addr &, unsigned int prefix_len)
 
static IP::Addr netmask_ (const IP::Addr &addr, unsigned int prefix_len)
 
static bool version_eq (const IPv4::Addr &, const IPv4::Addr &)
 
static bool version_eq (const IPv6::Addr &, const IPv6::Addr &)
 
static bool version_eq (const IP::Addr &a1, const IP::Addr &a2)
 

Detailed Description

template<typename ADDR>
class openvpn::IP::RouteType< ADDR >

Definition at line 32 of file route.hpp.

Member Typedef Documentation

◆ Addr

template<typename ADDR >
typedef ADDR openvpn::IP::RouteType< ADDR >::Addr

Definition at line 35 of file route.hpp.

Constructor & Destructor Documentation

◆ RouteType() [1/4]

template<typename ADDR >
openvpn::IP::RouteType< ADDR >::RouteType ( )
inline

Definition at line 42 of file route.hpp.

◆ RouteType() [2/4]

template<typename ADDR >
openvpn::IP::RouteType< ADDR >::RouteType ( const ADDR &  addr_arg,
const unsigned int  prefix_len_arg 
)
inline

Definition at line 47 of file route.hpp.

◆ RouteType() [3/4]

template<typename ADDR >
template<typename TITLE >
openvpn::IP::RouteType< ADDR >::RouteType ( const std::string &  rtstr,
const TITLE &  title 
)
inline

Definition at line 57 of file route.hpp.

◆ RouteType() [4/4]

template<typename ADDR >
openvpn::IP::RouteType< ADDR >::RouteType ( const std::string &  rtstr)
inline

Definition at line 62 of file route.hpp.

Member Function Documentation

◆ canonical_addr()

template<typename ADDR >
ADDR openvpn::IP::RouteType< ADDR >::canonical_addr ( ) const
inline

Definition at line 179 of file route.hpp.

Here is the caller graph for this function:

◆ contains() [1/2]

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::contains ( const ADDR &  a) const
inline

Definition at line 208 of file route.hpp.

Here is the caller graph for this function:

◆ contains() [2/2]

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::contains ( const RouteType< ADDR > &  r) const
inline

Definition at line 216 of file route.hpp.

◆ defined()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::defined ( ) const
inline

Definition at line 134 of file route.hpp.

Here is the caller graph for this function:

◆ extent()

template<typename ADDR >
size_t openvpn::IP::RouteType< ADDR >::extent ( ) const
inline

Definition at line 164 of file route.hpp.

Here is the caller graph for this function:

◆ force_canonical()

template<typename ADDR >
void openvpn::IP::RouteType< ADDR >::force_canonical ( )
inline

Definition at line 184 of file route.hpp.

Here is the caller graph for this function:

◆ from_string() [1/2]

template<typename ADDR >
static RouteType openvpn::IP::RouteType< ADDR >::from_string ( const std::string &  rtstr)
inlinestatic

Definition at line 85 of file route.hpp.

◆ from_string() [2/2]

template<typename ADDR >
template<typename TITLE >
static RouteType openvpn::IP::RouteType< ADDR >::from_string ( const std::string &  rtstr,
const TITLE &  title 
)
inlinestatic

Definition at line 68 of file route.hpp.

Here is the caller graph for this function:

◆ hash()

template<typename ADDR >
template<typename HASH >
void openvpn::IP::RouteType< ADDR >::hash ( HASH &  h) const
inline

Definition at line 271 of file route.hpp.

◆ host_bits()

template<typename ADDR >
unsigned int openvpn::IP::RouteType< ADDR >::host_bits ( ) const
inline

Definition at line 200 of file route.hpp.

Here is the caller graph for this function:

◆ is_canonical()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::is_canonical ( ) const
inline

Definition at line 169 of file route.hpp.

Here is the caller graph for this function:

◆ is_host()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::is_host ( ) const
inline

Definition at line 195 of file route.hpp.

Here is the caller graph for this function:

◆ is_valid()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::is_valid ( ) const
inline

Definition at line 174 of file route.hpp.

Here is the caller graph for this function:

◆ netmask()

template<typename ADDR >
ADDR openvpn::IP::RouteType< ADDR >::netmask ( ) const
inline

Definition at line 159 of file route.hpp.

Here is the caller graph for this function:

◆ netmask_() [1/3]

template<typename ADDR >
static IP::Addr openvpn::IP::RouteType< ADDR >::netmask_ ( const IP::Addr addr,
unsigned int  prefix_len 
)
inlinestaticprivate

Definition at line 297 of file route.hpp.

◆ netmask_() [2/3]

template<typename ADDR >
static IPv4::Addr openvpn::IP::RouteType< ADDR >::netmask_ ( const IPv4::Addr ,
unsigned int  prefix_len 
)
inlinestaticprivate

Definition at line 287 of file route.hpp.

Here is the caller graph for this function:

◆ netmask_() [3/3]

template<typename ADDR >
static IPv6::Addr openvpn::IP::RouteType< ADDR >::netmask_ ( const IPv6::Addr ,
unsigned int  prefix_len 
)
inlinestaticprivate

Definition at line 292 of file route.hpp.

◆ OPENVPN_EXCEPTION()

template<typename ADDR >
openvpn::IP::RouteType< ADDR >::OPENVPN_EXCEPTION ( route_error  )

◆ operator!=()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::operator!= ( const RouteType< ADDR > &  other) const
inline

Definition at line 260 of file route.hpp.

◆ operator<()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::operator< ( const RouteType< ADDR > &  other) const
inline

Definition at line 265 of file route.hpp.

◆ operator==()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::operator== ( const RouteType< ADDR > &  other) const
inline

Definition at line 255 of file route.hpp.

◆ split()

template<typename ADDR >
bool openvpn::IP::RouteType< ADDR >::split ( RouteType< ADDR > &  r1,
RouteType< ADDR > &  r2 
) const
inline

Definition at line 221 of file route.hpp.

Here is the caller graph for this function:

◆ to_ipv4()

template<typename ADDR >
RouteType< IPv4::Addr > openvpn::IP::RouteType< ADDR >::to_ipv4 ( ) const
inline

Definition at line 149 of file route.hpp.

◆ to_ipv6()

template<typename ADDR >
RouteType< IPv6::Addr > openvpn::IP::RouteType< ADDR >::to_ipv6 ( ) const
inline

Definition at line 154 of file route.hpp.

◆ to_string()

template<typename ADDR >
std::string openvpn::IP::RouteType< ADDR >::to_string ( ) const
inline

Definition at line 237 of file route.hpp.

Here is the caller graph for this function:

◆ to_string_by_netmask()

template<typename ADDR >
std::string openvpn::IP::RouteType< ADDR >::to_string_by_netmask ( ) const
inline

Definition at line 242 of file route.hpp.

◆ to_string_optional_prefix_len()

template<typename ADDR >
std::string openvpn::IP::RouteType< ADDR >::to_string_optional_prefix_len ( ) const
inline

Definition at line 247 of file route.hpp.

◆ validate_prefix_length()

template<typename ADDR >
template<typename TITLE >
void openvpn::IP::RouteType< ADDR >::validate_prefix_length ( const TITLE &  title)
inline

Definition at line 91 of file route.hpp.

Here is the caller graph for this function:

◆ verify_canonical()

template<typename ADDR >
void openvpn::IP::RouteType< ADDR >::verify_canonical ( ) const
inline

Definition at line 189 of file route.hpp.

◆ version()

template<typename ADDR >
IP::Addr::Version openvpn::IP::RouteType< ADDR >::version ( ) const
inline

Definition at line 139 of file route.hpp.

Here is the caller graph for this function:

◆ version_eq() [1/3]

template<typename ADDR >
static bool openvpn::IP::RouteType< ADDR >::version_eq ( const IP::Addr a1,
const IP::Addr a2 
)
inlinestaticprivate

Definition at line 312 of file route.hpp.

◆ version_eq() [2/3]

template<typename ADDR >
static bool openvpn::IP::RouteType< ADDR >::version_eq ( const IPv4::Addr ,
const IPv4::Addr  
)
inlinestaticprivate

Definition at line 302 of file route.hpp.

Here is the caller graph for this function:

◆ version_eq() [3/3]

template<typename ADDR >
static bool openvpn::IP::RouteType< ADDR >::version_eq ( const IPv6::Addr ,
const IPv6::Addr  
)
inlinestaticprivate

Definition at line 307 of file route.hpp.

◆ version_mask()

template<typename ADDR >
IP::Addr::VersionMask openvpn::IP::RouteType< ADDR >::version_mask ( ) const
inline

Definition at line 144 of file route.hpp.

Member Data Documentation

◆ addr

template<typename ADDR >
ADDR openvpn::IP::RouteType< ADDR >::addr

Definition at line 37 of file route.hpp.

◆ prefix_len

template<typename ADDR >
unsigned int openvpn::IP::RouteType< ADDR >::prefix_len

Definition at line 38 of file route.hpp.


The documentation for this class was generated from the following file: