OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::TunProp Class Reference

#include <tunprop.hpp>

Classes

struct  Config
 
struct  State
 

Public Member Functions

 OPENVPN_EXCEPTION (tun_prop_error)
 
 OPENVPN_EXCEPTION (tun_prop_route_error)
 
 OPENVPN_UNTAGGED_EXCEPTION_INHERIT (option_error, tun_prop_dns_option_error)
 
 OPENVPN_UNTAGGED_EXCEPTION_INHERIT (option_error, tun_prop_dhcp_option_error)
 

Static Public Member Functions

static void configure_builder (TunBuilderBase *tb, State *state, SessionStats *stats, const IP::Addr &server_addr, const Config &config, const OptionList &opt, const EmulateExcludeRouteFactory *eer_factory, const bool quiet)
 

Private Types

enum  { OPT_RENDER_FLAGS = Option::RENDER_TRUNC_64 | Option::RENDER_BRACKET }
 

Static Private Member Functions

static void add_route_metric_default (TunBuilderBase *tb, const OptionList &opt, const bool quiet)
 
static IP::Addr route_gateway (const OptionList &opt)
 
static void tun_mtu (TunBuilderBase *tb, State *state, const OptionList &opt, int config_mtu, int config_mtu_max)
 
static IP::Addr::VersionMask tun_ifconfig (TunBuilderBase *tb, State *state, const OptionList &opt)
 
static void add_route_tunbuilder (TunBuilderBase *tb, bool add, const IP::Addr &addr, int prefix_length, int metric, bool ipv6, EmulateExcludeRoute *eer)
 
static bool route_target (const Option &o, const size_t target_index)
 
static void add_routes (TunBuilderBase *tb, const OptionList &opt, const IPVerFlags &ipv, EmulateExcludeRoute *eer, const bool quiet)
 
static void add_remote_bypass_routes (TunBuilderBase *tb, const RemoteList &remote_list, const IP::Addr &server_addr, EmulateExcludeRoute *eer, const bool quiet)
 
static bool add_dns_options (TunBuilderBase *tb, const OptionList &opt, bool quiet, bool use_dhcp_search_domains_as_split_domains)
 Configure tun builder to use DNS related options if defined.
 
static void add_dhcp_options (TunBuilderBase *tb, const OptionList &opt, const bool quiet)
 Parse options for WINS and HTTP Proxy –dhcp-option(s) and add them to the tunbuilder (tb) passed.
 
static bool search_domains_exist (const OptionList &opt, const bool quiet)
 
static void add_google_dns (TunBuilderBase *tb)
 

Static Private Attributes

static constexpr int MAX_ROUTE_METRIC = 1000000
 

Detailed Description

Definition at line 34 of file tunprop.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
OPT_RENDER_FLAGS 

Definition at line 37 of file tunprop.hpp.

Member Function Documentation

◆ add_dhcp_options()

static void openvpn::TunProp::add_dhcp_options ( TunBuilderBase tb,
const OptionList opt,
const bool  quiet 
)
inlinestaticprivate

Parse options for WINS and HTTP Proxy –dhcp-option(s) and add them to the tunbuilder (tb) passed.

Parameters
tbpointer to tunbuilder to add setting to
optreference to the (pushed) options
quietboolean to silence log messages about issues processing the options

Definition at line 570 of file tunprop.hpp.

Here is the caller graph for this function:

◆ add_dns_options()

static bool openvpn::TunProp::add_dns_options ( TunBuilderBase tb,
const OptionList opt,
bool  quiet,
bool  use_dhcp_search_domains_as_split_domains 
)
inlinestaticprivate

Configure tun builder to use DNS related options if defined.

Parameters
tbpointer to the tun builder
optthe –dns options object
quietboolean to silence log messages about issues processing the options
use_dhcp_search_domains_as_split_domainsboolean to apply dhcp-option DNS search domains as split domains
Returns
bool flag when there were servers defined in the options

Definition at line 537 of file tunprop.hpp.

Here is the caller graph for this function:

◆ add_google_dns()

static void openvpn::TunProp::add_google_dns ( TunBuilderBase tb)
inlinestaticprivate

Definition at line 697 of file tunprop.hpp.

Here is the caller graph for this function:

◆ add_remote_bypass_routes()

static void openvpn::TunProp::add_remote_bypass_routes ( TunBuilderBase tb,
const RemoteList remote_list,
const IP::Addr server_addr,
EmulateExcludeRoute eer,
const bool  quiet 
)
inlinestaticprivate

Definition at line 501 of file tunprop.hpp.

Here is the caller graph for this function:

◆ add_route_metric_default()

static void openvpn::TunProp::add_route_metric_default ( TunBuilderBase tb,
const OptionList opt,
const bool  quiet 
)
inlinestaticprivate

Definition at line 216 of file tunprop.hpp.

Here is the caller graph for this function:

◆ add_route_tunbuilder()

static void openvpn::TunProp::add_route_tunbuilder ( TunBuilderBase tb,
bool  add,
const IP::Addr addr,
int  prefix_length,
int  metric,
bool  ipv6,
EmulateExcludeRoute eer 
)
inlinestaticprivate

Definition at line 395 of file tunprop.hpp.

Here is the caller graph for this function:

◆ add_routes()

static void openvpn::TunProp::add_routes ( TunBuilderBase tb,
const OptionList opt,
const IPVerFlags ipv,
EmulateExcludeRoute eer,
const bool  quiet 
)
inlinestaticprivate

Definition at line 436 of file tunprop.hpp.

◆ configure_builder()

static void openvpn::TunProp::configure_builder ( TunBuilderBase tb,
State state,
SessionStats stats,
const IP::Addr server_addr,
const Config config,
const OptionList opt,
const EmulateExcludeRouteFactory eer_factory,
const bool  quiet 
)
inlinestatic

Definition at line 92 of file tunprop.hpp.

Here is the caller graph for this function:

◆ OPENVPN_EXCEPTION() [1/2]

openvpn::TunProp::OPENVPN_EXCEPTION ( tun_prop_error  )

◆ OPENVPN_EXCEPTION() [2/2]

openvpn::TunProp::OPENVPN_EXCEPTION ( tun_prop_route_error  )

◆ OPENVPN_UNTAGGED_EXCEPTION_INHERIT() [1/2]

openvpn::TunProp::OPENVPN_UNTAGGED_EXCEPTION_INHERIT ( option_error  ,
tun_prop_dhcp_option_error   
)

◆ OPENVPN_UNTAGGED_EXCEPTION_INHERIT() [2/2]

openvpn::TunProp::OPENVPN_UNTAGGED_EXCEPTION_INHERIT ( option_error  ,
tun_prop_dns_option_error   
)

◆ route_gateway()

static IP::Addr openvpn::TunProp::route_gateway ( const OptionList opt)
inlinestaticprivate

Definition at line 239 of file tunprop.hpp.

Here is the caller graph for this function:

◆ route_target()

static bool openvpn::TunProp::route_target ( const Option o,
const size_t  target_index 
)
inlinestaticprivate

Definition at line 420 of file tunprop.hpp.

Here is the caller graph for this function:

◆ search_domains_exist()

static bool openvpn::TunProp::search_domains_exist ( const OptionList opt,
const bool  quiet 
)
inlinestaticprivate

Definition at line 673 of file tunprop.hpp.

◆ tun_ifconfig()

static IP::Addr::VersionMask openvpn::TunProp::tun_ifconfig ( TunBuilderBase tb,
State state,
const OptionList opt 
)
inlinestaticprivate

Definition at line 284 of file tunprop.hpp.

Here is the caller graph for this function:

◆ tun_mtu()

static void openvpn::TunProp::tun_mtu ( TunBuilderBase tb,
State state,
const OptionList opt,
int  config_mtu,
int  config_mtu_max 
)
inlinestaticprivate

Definition at line 252 of file tunprop.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ MAX_ROUTE_METRIC

constexpr int openvpn::TunProp::MAX_ROUTE_METRIC = 1000000
staticconstexprprivate

Definition at line 43 of file tunprop.hpp.


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