OpenVPN 3 Core Library
Loading...
Searching...
No Matches
test_capture.cpp File Reference
#include "test_common.hpp"
#include "test_generators.hpp"
#include <rapidcheck/state.h>
#include <iostream>
#include <openvpn/common/file.hpp>
#include <openvpn/tun/builder/capture.hpp>
Include dependency graph for test_capture.cpp:

Go to the source code of this file.

Classes

struct  SetRemoteAddress
 
struct  AddAddress
 
struct  RerouteGW
 
struct  SetRouteMetricDefault
 
struct  AddRoute
 
struct  ExcludeRoute
 
struct  SetLayer
 
struct  SetMTU
 
struct  SetSessionName
 
struct  AddProxyBypass
 
struct  SetProxyAutoConfigURL
 
struct  SetProxyHTTP
 
struct  SetProxyHTTPS
 
struct  AddWINSServer
 
struct  SetAllowFamily
 
struct  SetAllowLocalDNS
 
struct  ResetTunnelAddresses
 
struct  ResetDNSOptions
 
struct  VPN_IPv4
 
struct  VPN_IPv6
 
struct  VPN_IP
 

Functions

 TEST (misc, capture)
 
 TEST (RemoteAddress, EmptyIsNotDefined)
 
 RC_ASSERT (remote_address.defined())
 
 TEST (RemoteAddress, EmptyStringRepresentation)
 
 TEST (RemoteAddress, EmptyStringRepresentationIncludesIPv6Setting)
 
 RC_ASSERT_THROWS_AS (remote_address.validate(title), openvpn::IP::ip_exception)
 
remote_address validate (title)
 
from_json from_json (address_as_json, title)
 
 RC_ASSERT_THROWS_AS (from_json.validate(title), openvpn::IP::ip_exception)
 
from_json from_json (invalid_json, title)
 
 RC_ASSERT (from_json.ipv6==ipv6)
 
 TEST (RerouteGW, EmptyStringRepresentationReturnsUnsetOptions)
 
 if (flags &RedirectGatewayFlags::RG_ENABLE) ret+
 
 if (flags &RedirectGatewayFlags::RG_REROUTE_GW) ret+
 
 if (flags &RedirectGatewayFlags::RG_LOCAL) ret+
 
 if (flags &RedirectGatewayFlags::RG_AUTO_LOCAL) ret+
 
 if (flags &RedirectGatewayFlags::RG_DEF1) ret+
 
 if (flags &RedirectGatewayFlags::RG_BYPASS_DHCP) ret+
 
 if (flags &RedirectGatewayFlags::RG_BYPASS_DNS) ret+
 
 if (flags &RedirectGatewayFlags::RG_BLOCK_LOCAL) ret+
 
 if (flags &RedirectGatewayFlags::RG_IPv4) ret+
 
 if (flags &RedirectGatewayFlags::RG_IPv6) ret+
 
 RC_ASSERT (reroute_gw.to_string()==ipv4_and_ipv6_return_string+"flags="+ret)
 
from_json from_json (reroute_gw_as_json, title)
 
 RC_ASSERT_THROWS_AS (from_json.from_json(invalid_json, title), json::json_parse)
 
 TEST (ProxyBypass, EmptyIsNotDefined)
 
 RC_ASSERT (proxy_bypass.defined())
 
 TEST (ProxyBypass, EmptyStringRepresentation)
 
from_json from_json (proxy_bypass_as_json, title)
 
 TEST (ProxyAutoConfigURL, EmptyIsNotDefined)
 
 RC_ASSERT (proxy_autoconfig_url.defined())
 
 TEST (ProxyAutoConfigURL, EmptyStringRepresentation)
 
from_json from_json (proxy_autoconfig_url_as_json, title)
 
 TEST (ProxyHostPort, EmptyIsNotDefined)
 
 RC_ASSERT (proxy_host_port.defined())
 
 TEST (ProxyHostPort, EmptyStringRepresentationReturnsDefaultPort)
 
from_json from_json (proxy_host_port_as_json, title)
 
 TEST (WINSServer, EmptyStringRepresentation)
 
 RC_ASSERT (wins_server.to_string()==address)
 
 RC_ASSERT_THROWS_AS (wins_server.validate(title), openvpn::IP::ip_exception)
 
from_json from_json (wins_server_as_json, title)
 
 RC_ASSERT (tbc->tun_builder_set_remote_address(address, ipv6))
 
 RC_ASSERT (tbc->remote_address.address==address)
 
 RC_ASSERT (tbc->tun_builder_add_address(address, prefix_length, gateway, ipv6, net30))
 
 RC_ASSERT (vpn_address->address==address)
 
 RC_ASSERT (tbc->tun_builder_reroute_gw(ipv4, ipv6, flags))
 
 RC_ASSERT (tbc->reroute_gw.ipv4==ipv4)
 
 RC_ASSERT (tbc->tun_builder_set_route_metric_default(metric))
 
 RC_ASSERT (tbc->route_metric_default==metric)
 
 RC_ASSERT (tbc->tun_builder_add_route(address, prefix_length, metric, ipv6))
 
 RC_ASSERT (added_route.address==address)
 
 RC_ASSERT (excluded_route.address==address)
 
server addresses push_back ({address, port})
 
const TunBuilderCapture::Ptr tbc (new TunBuilderCapture)
 
 RC_ASSERT (tbc->tun_builder_set_dns_options(dns_options))
 
 RC_ASSERT (tbc->dns_options.search_domains.back().domain==search_domain)
 
 RC_ASSERT (tbc->dns_options.servers.at(0).addresses.back().address==address)
 
 RC_ASSERT (tbc->tun_builder_set_layer(layer))
 
 RC_ASSERT (tbc->layer.value()==layer)
 
 RC_ASSERT (tbc->tun_builder_set_mtu(mtu))
 
 RC_ASSERT (tbc->tun_builder_set_session_name(session_name))
 
 RC_ASSERT (tbc->tun_builder_add_proxy_bypass(bypass_host))
 
 RC_ASSERT (tbc->proxy_bypass.back().bypass_host==bypass_host)
 
 RC_ASSERT (tbc->tun_builder_set_proxy_auto_config_url(url))
 
 RC_ASSERT (tbc->proxy_auto_config_url.url==url)
 
 RC_ASSERT (tbc->tun_builder_set_proxy_http(host, port))
 
 RC_ASSERT (tbc->http_proxy.host==host)
 
 RC_ASSERT (tbc->https_proxy.host==host)
 
 RC_ASSERT (tbc->tun_builder_add_wins_server(address))
 
 RC_ASSERT (tbc->wins_servers.back().address==address)
 
 RC_ASSERT (tbc->tun_builder_set_allow_family(allow_family, allow))
 
 if (allow_family==AF_INET)
 
 RC_ASSERT (tbc->tun_builder_set_allow_local_dns(allow))
 
 RC_ASSERT_FALSE (tbc->block_outside_dns==allow)
 
 RC_ASSERT (tbc->tun_builder_add_address(address, prefix_length, gateway, !ipv6, net30))
 
 RC_ASSERT_FALSE (tbc->tunnel_addresses.empty())
 
 RC_ASSERT (tbc->tunnel_address_index_ipv4 > -1)
 
tbc reset_tunnel_addresses ()
 
 RC_ASSERT (tbc->tunnel_addresses.empty())
 
 RC_ASSERT_FALSE (tbc->dns_options.to_string().empty())
 
tbc reset_dns_options ()
 
 RC_ASSERT (tbc->dns_options.to_string().empty())
 
 RC_ASSERT (tbc->vpn_ipv4()==nullptr)
 
 RC_ASSERT (tbc->tun_builder_add_address(address, prefix_length, gateway, false, net30))
 
 RC_ASSERT (tbc->tun_builder_add_address(address, prefix_length, gateway, true, net30))
 
 RC_ASSERT (tbc->vpn_ip(IP::Addr::UNSPEC)==nullptr)
 
os<< "Session Name: "<< tbc-> session_name<< '\n';os<< "Layer: "<< tbc-> layer str ()<< '\n'
 
os<< "Remote Address: "<< tbc-> remote_address to_string ()<< '\n'
 
 check (model, sut, rc::state::gen::execOneOfWithArgs< SetRemoteAddress, AddAddress, RerouteGW, SetRouteMetricDefault, AddRoute, ExcludeRoute, SetLayer, SetMTU, SetSessionName, AddProxyBypass, SetProxyAutoConfigURL, SetProxyHTTP, SetProxyHTTPS, AddWINSServer, SetAllowFamily, SetAllowLocalDNS, ResetTunnelAddresses, ResetDNSOptions, VPN_IPv4, VPN_IPv6, VPN_IP >())
 

Variables

TunBuilderCapture::RemoteAddress remote_address
 
remote_address address = address
 
remote_address ipv6 = true
 
const auto address_as_json = remote_address.to_json()
 
TunBuilderCapture::RemoteAddress from_json
 
const Json::Value invalid_json
 
reroute_gw ipv4 = ipv4
 
reroute_gw flags = flags
 
std::string ret = "[ "
 
const std::string ipv4_and_ipv6_return_string = {"IPv4=" + std::to_string(ipv4) + " IPv6=" + std::to_string(ipv6) + " "}
 
const auto reroute_gw_as_json = reroute_gw.to_json()
 
TunBuilderCapture::ProxyBypass proxy_bypass
 
proxy_bypass bypass_host = bypass_host
 
const auto proxy_bypass_as_json = proxy_bypass.to_json()
 
TunBuilderCapture::ProxyAutoConfigURL proxy_autoconfig_url
 
proxy_autoconfig_url url = url
 
const auto proxy_autoconfig_url_as_json = proxy_autoconfig_url.to_json()
 
TunBuilderCapture::ProxyHostPort proxy_host_port
 
proxy_host_port host = host
 
proxy_host_port port = port
 
const auto proxy_host_port_as_json = proxy_host_port.to_json()
 
const auto wins_server_as_json = wins_server.to_json()
 
const auto ip_version = ipv6 ? IP::Addr::V6 : IP::Addr::V4
 
const TunBuilderCapture::RouteAddressvpn_address = tbc->vpn_ip(ip_version)
 
const auto metric = *rc::gen::positive<int>().as("Valid route metric")
 
const auto & added_route = tbc->add_routes.back()
 
const auto & excluded_route = tbc->exclude_routes.back()
 
DnsOptions dns_options = {}
 
dns_options servers [0] = std::move(server)
 
dns_options search_domains = {{search_domain}}
 
const auto layer = *rc::gen::element(3, 2, 0).as("Layer - 3, 2 or 0")
 
const auto allow_family = *rc::gen::element(AF_INET, AF_INET6).as("Allow family - AF_INET or AF_INET6")
 
 else
 
std::ostringstream os = {}
 
os<< "Block IPv4: "<<(tbc->block_ipv4 ? "yes" :"no")<< '\n';os<< "Block IPv6: "<<(tbc->block_ipv6 ? "yes" :"no")<< '\n';os<< "Block local DNS: "<<(tbc->block_outside_dns ? "yes" :"no")<< '\n';os<< "Add Routes:\n";os<< "Exclude Routes:\n";RC_ASSERT(tbc->to_string()==os.str());}struct TunBuilderCaptureModel{ std::string session_name;int mtu{0};Layer layer{Layer::OSI_LAYER_3};TunBuilderCapture::RemoteAddress remote_address{};std::vector< TunBuilderCapture::RouteAddresstunnel_addresses
 
int tunnel_address_index_ipv4 {-1}
 
int tunnel_address_index_ipv6 {-1}
 
TunBuilderCapture::RerouteGW reroute_gw {}
 
bool block_ipv4 {false}
 
bool block_ipv6 {false}
 
bool block_outside_dns {false}
 
int route_metric_default {-1}
 
std::vector< TunBuilderCapture::Routeadd_routes
 
std::vector< TunBuilderCapture::Routeexclude_routes
 
TunBuilderCapture::ProxyAutoConfigURL proxy_auto_config_url {}
 
TunBuilderCapture::ProxyHostPort http_proxy {}
 
TunBuilderCapture::ProxyHostPort https_proxy {}
 
std::vector< TunBuilderCapture::WINSServerwins_servers {}
 
static constexpr auto mtu_ipv4_maximum {65'535}
 
TunBuilderCapture sut {}
 

Function Documentation

◆ check()

◆ from_json() [1/7]

from_json from_json ( address_as_json  ,
title   
)

◆ from_json() [2/7]

from_json from_json ( invalid_json  ,
title   
)

◆ from_json() [3/7]

from_json from_json ( proxy_autoconfig_url_as_json  ,
title   
)

◆ from_json() [4/7]

from_json from_json ( proxy_bypass_as_json  ,
title   
)

◆ from_json() [5/7]

from_json from_json ( proxy_host_port_as_json  ,
title   
)

◆ from_json() [6/7]

from_json from_json ( reroute_gw_as_json  ,
title   
)

◆ from_json() [7/7]

from_json from_json ( wins_server_as_json  ,
title   
)

◆ if() [1/11]

if ( allow_family  = = AF_INET)

Definition at line 1001 of file test_capture.cpp.

◆ if() [2/11]

if ( flags &RedirectGatewayFlags::RG_AUTO_LOCAL  )

◆ if() [3/11]

if ( flags &RedirectGatewayFlags::RG_BLOCK_LOCAL  )

◆ if() [4/11]

if ( flags &RedirectGatewayFlags::RG_BYPASS_DHCP  )

◆ if() [5/11]

if ( flags &RedirectGatewayFlags::RG_BYPASS_DNS  )

◆ if() [6/11]

if ( flags &RedirectGatewayFlags::RG_DEF1  )

◆ if() [7/11]

if ( flags &RedirectGatewayFlags::RG_ENABLE  )
Here is the caller graph for this function:

◆ if() [8/11]

if ( flags &RedirectGatewayFlags::RG_IPv4  )

◆ if() [9/11]

if ( flags &RedirectGatewayFlags::RG_IPv6  )

◆ if() [10/11]

if ( flags &RedirectGatewayFlags::RG_LOCAL  )

◆ if() [11/11]

if ( flags &RedirectGatewayFlags::RG_REROUTE_GW  )

◆ push_back()

server addresses push_back ( {address, port )
Initial value:
{
DnsServer server = {}
DNS settings for a name server.
Here is the caller graph for this function:

◆ RC_ASSERT() [1/44]

RC_ASSERT ( added_route.  address = =address)

◆ RC_ASSERT() [2/44]

RC_ASSERT ( excluded_route.  address = =address)

◆ RC_ASSERT() [3/44]

RC_ASSERT ( from_json.  ipv6 = =ipv6)

◆ RC_ASSERT() [4/44]

RC_ASSERT ( proxy_autoconfig_url.  defined())

◆ RC_ASSERT() [5/44]

RC_ASSERT ( proxy_bypass.  defined())

◆ RC_ASSERT() [6/44]

RC_ASSERT ( proxy_host_port.  defined())

◆ RC_ASSERT() [7/44]

RC_ASSERT ( remote_address.  defined())
Here is the caller graph for this function:

◆ RC_ASSERT() [8/44]

RC_ASSERT ( reroute_gw.  to_string() = =ipv4_and_ipv6_return_string+"flags="+ret)

◆ RC_ASSERT() [9/44]

RC_ASSERT ( tbc->dns_options.search_domains.back().  domain = =search_domain)

◆ RC_ASSERT() [10/44]

RC_ASSERT ( tbc->dns_options.servers.at(0).addresses.back().  address = =address)

◆ RC_ASSERT() [11/44]

RC_ASSERT ( tbc->dns_options.  to_string).empty()

◆ RC_ASSERT() [12/44]

RC_ASSERT ( tbc->http_proxy.  host = =host)

◆ RC_ASSERT() [13/44]

RC_ASSERT ( tbc->https_proxy.  host = =host)

◆ RC_ASSERT() [14/44]

RC_ASSERT ( tbc->layer.  value() = =layer)

◆ RC_ASSERT() [15/44]

RC_ASSERT ( tbc->proxy_auto_config_url.  url = =url)

◆ RC_ASSERT() [16/44]

RC_ASSERT ( tbc->proxy_bypass.back().  bypass_host = =bypass_host)

◆ RC_ASSERT() [17/44]

RC_ASSERT ( tbc->remote_address.  address = =address)

◆ RC_ASSERT() [18/44]

RC_ASSERT ( tbc->reroute_gw.  ipv4 = =ipv4)

◆ RC_ASSERT() [19/44]

RC_ASSERT ( tbc->  route_metric_default = =metric)

◆ RC_ASSERT() [20/44]

RC_ASSERT ( tbc->  tun_builder_add_addressaddress, prefix_length, gateway, !ipv6, net30)

◆ RC_ASSERT() [21/44]

RC_ASSERT ( tbc->  tun_builder_add_addressaddress, prefix_length, gateway, false, net30)

◆ RC_ASSERT() [22/44]

RC_ASSERT ( tbc->  tun_builder_add_addressaddress, prefix_length, gateway, ipv6, net30)
Initial value:
{
const TunBuilderCapture::Ptr tbc(new TunBuilderCapture)

◆ RC_ASSERT() [23/44]

RC_ASSERT ( tbc->  tun_builder_add_addressaddress, prefix_length, gateway, true, net30)

◆ RC_ASSERT() [24/44]

RC_ASSERT ( tbc->  tun_builder_add_proxy_bypassbypass_host)

◆ RC_ASSERT() [25/44]

RC_ASSERT ( tbc->  tun_builder_add_routeaddress, prefix_length, metric, ipv6)
Initial value:

◆ RC_ASSERT() [26/44]

RC_ASSERT ( tbc->  tun_builder_add_wins_serveraddress)

◆ RC_ASSERT() [27/44]

RC_ASSERT ( tbc->  tun_builder_reroute_gwipv4, ipv6, flags)

◆ RC_ASSERT() [28/44]

RC_ASSERT ( tbc->  tun_builder_set_allow_familyallow_family, allow)

◆ RC_ASSERT() [29/44]

RC_ASSERT ( tbc->  tun_builder_set_allow_local_dnsallow)

◆ RC_ASSERT() [30/44]

RC_ASSERT ( tbc->  tun_builder_set_dns_optionsdns_options)

◆ RC_ASSERT() [31/44]

RC_ASSERT ( tbc->  tun_builder_set_layerlayer)

◆ RC_ASSERT() [32/44]

RC_ASSERT ( tbc->  tun_builder_set_mtumtu)

◆ RC_ASSERT() [33/44]

RC_ASSERT ( tbc->  tun_builder_set_proxy_auto_config_urlurl)

◆ RC_ASSERT() [34/44]

RC_ASSERT ( tbc->  tun_builder_set_proxy_httphost, port)
Initial value:

◆ RC_ASSERT() [35/44]

RC_ASSERT ( tbc->  tun_builder_set_remote_addressaddress, ipv6)

◆ RC_ASSERT() [36/44]

RC_ASSERT ( tbc->  tun_builder_set_route_metric_defaultmetric)

◆ RC_ASSERT() [37/44]

RC_ASSERT ( tbc->  tun_builder_set_session_namesession_name)

◆ RC_ASSERT() [38/44]

RC_ASSERT ( tbc->  tunnel_address_index_ipv4,
1 
)

◆ RC_ASSERT() [39/44]

RC_ASSERT ( tbc->tunnel_addresses.  empty())

◆ RC_ASSERT() [40/44]

RC_ASSERT ( tbc->  vpn_ipIP::Addr::UNSPEC = =nullptr)

◆ RC_ASSERT() [41/44]

RC_ASSERT ( tbc->  vpn_ipv4() = =nullptr)
Initial value:

◆ RC_ASSERT() [42/44]

RC_ASSERT ( tbc->wins_servers.back().  address = =address)

◆ RC_ASSERT() [43/44]

RC_ASSERT ( vpn_address->  address = =address)

◆ RC_ASSERT() [44/44]

RC_ASSERT ( wins_server.  to_string() = =address)

◆ RC_ASSERT_FALSE() [1/3]

RC_ASSERT_FALSE ( tbc->  block_outside_dns = =allow)
Here is the caller graph for this function:

◆ RC_ASSERT_FALSE() [2/3]

RC_ASSERT_FALSE ( tbc->dns_options.  to_string).empty()

◆ RC_ASSERT_FALSE() [3/3]

RC_ASSERT_FALSE ( tbc->tunnel_addresses.  empty())

◆ RC_ASSERT_THROWS_AS() [1/4]

RC_ASSERT_THROWS_AS ( from_json.  from_jsoninvalid_json, title,
json::json_parse   
)

◆ RC_ASSERT_THROWS_AS() [2/4]

RC_ASSERT_THROWS_AS ( from_json.  validatetitle,
openvpn::IP::ip_exception   
)

◆ RC_ASSERT_THROWS_AS() [3/4]

RC_ASSERT_THROWS_AS ( remote_address.  validatetitle,
openvpn::IP::ip_exception   
)
Initial value:
{
Represents a remote IP address with IPv4/IPv6 designation.
Definition capture.hpp:55
TunBuilderCapture::RemoteAddress remote_address

◆ RC_ASSERT_THROWS_AS() [4/4]

RC_ASSERT_THROWS_AS ( wins_server.  validatetitle,
openvpn::IP::ip_exception   
)
Initial value:
{
Windows Internet Name Service (WINS) server configuration.
Definition capture.hpp:565

◆ reset_dns_options()

tbc reset_dns_options ( )

◆ reset_tunnel_addresses()

tbc reset_tunnel_addresses ( )

◆ str()

os<< "Session Name: "<< tbc-> session_name<< '\n'; os<< "Layer: "<< tbc-> layer str ( )
Here is the caller graph for this function:

◆ tbc()

const TunBuilderCapture::Ptr tbc ( new  TunBuilderCapture)
Here is the caller graph for this function:

◆ TEST() [1/12]

TEST ( misc  ,
capture   
)

write_string(fn1, j1_txt);

Definition at line 12 of file test_capture.cpp.

◆ TEST() [2/12]

TEST ( ProxyAutoConfigURL  ,
EmptyIsNotDefined   
)

Definition at line 578 of file test_capture.cpp.

◆ TEST() [3/12]

TEST ( ProxyAutoConfigURL  ,
EmptyStringRepresentation   
)

Definition at line 592 of file test_capture.cpp.

◆ TEST() [4/12]

TEST ( ProxyBypass  ,
EmptyIsNotDefined   
)

Definition at line 486 of file test_capture.cpp.

◆ TEST() [5/12]

TEST ( ProxyBypass  ,
EmptyStringRepresentation   
)

Definition at line 500 of file test_capture.cpp.

◆ TEST() [6/12]

TEST ( ProxyHostPort  ,
EmptyIsNotDefined   
)

Definition at line 672 of file test_capture.cpp.

◆ TEST() [7/12]

TEST ( ProxyHostPort  ,
EmptyStringRepresentationReturnsDefaultPort   
)

Definition at line 686 of file test_capture.cpp.

◆ TEST() [8/12]

TEST ( RemoteAddress  ,
EmptyIsNotDefined   
)

Definition at line 72 of file test_capture.cpp.

◆ TEST() [9/12]

TEST ( RemoteAddress  ,
EmptyStringRepresentation   
)

Definition at line 86 of file test_capture.cpp.

◆ TEST() [10/12]

TEST ( RemoteAddress  ,
EmptyStringRepresentationIncludesIPv6Setting   
)

Definition at line 92 of file test_capture.cpp.

◆ TEST() [11/12]

TEST ( RerouteGW  ,
EmptyStringRepresentationReturnsUnsetOptions   
)

Definition at line 255 of file test_capture.cpp.

◆ TEST() [12/12]

TEST ( WINSServer  ,
EmptyStringRepresentation   
)

Definition at line 770 of file test_capture.cpp.

◆ to_string()

os<< "Remote Address: "<< tbc-> remote_address to_string ( )

◆ validate()

from_json validate ( title  )
Initial value:
{
Class for managing proxy bypass host configurations.
Definition capture.hpp:332
TunBuilderCapture::ProxyBypass proxy_bypass

Variable Documentation

◆ add_routes

std::vector<TunBuilderCapture::Route> add_routes

Definition at line 1114 of file test_capture.cpp.

◆ added_route

const auto& added_route = tbc->add_routes.back()

Definition at line 906 of file test_capture.cpp.

◆ address

wins_server address = address

Definition at line 82 of file test_capture.cpp.

◆ address_as_json

const auto address_as_json = remote_address.to_json()

Definition at line 158 of file test_capture.cpp.

◆ allow_family

const auto allow_family = *rc::gen::element(AF_INET, AF_INET6).as("Allow family - AF_INET or AF_INET6")

Definition at line 999 of file test_capture.cpp.

◆ block_ipv4

bool block_ipv4 {false}

Definition at line 1110 of file test_capture.cpp.

◆ block_ipv6

bool block_ipv6 {false}

Definition at line 1111 of file test_capture.cpp.

◆ block_outside_dns

bool block_outside_dns {false}

Definition at line 1112 of file test_capture.cpp.

◆ bypass_host

proxy_bypass bypass_host = bypass_host

Definition at line 496 of file test_capture.cpp.

◆ dns_options

DnsOptions dns_options = {}

Definition at line 928 of file test_capture.cpp.

◆ else

else
Initial value:
{
RC_ASSERT_FALSE(tbc->block_outside_dns==allow)

Definition at line 1005 of file test_capture.cpp.

◆ exclude_routes

std::vector<TunBuilderCapture::Route> exclude_routes

Definition at line 1115 of file test_capture.cpp.

◆ excluded_route

const auto& excluded_route = tbc->exclude_routes.back()

Definition at line 917 of file test_capture.cpp.

◆ flags

from_json flags = flags

Definition at line 266 of file test_capture.cpp.

◆ from_json

from_json from_json

Definition at line 159 of file test_capture.cpp.

◆ host

from_json host = host

Definition at line 682 of file test_capture.cpp.

◆ http_proxy

Definition at line 1119 of file test_capture.cpp.

◆ https_proxy

Definition at line 1120 of file test_capture.cpp.

◆ invalid_json

const Json::Value invalid_json
Initial value:
{
TunBuilderCapture::RemoteAddress from_json

Definition at line 245 of file test_capture.cpp.

◆ ip_version

const auto ip_version = ipv6 ? IP::Addr::V6 : IP::Addr::V4

Definition at line 877 of file test_capture.cpp.

◆ ipv4

from_json ipv4 = ipv4

Definition at line 264 of file test_capture.cpp.

◆ ipv4_and_ipv6_return_string

const std::string ipv4_and_ipv6_return_string = {"IPv4=" + std::to_string(ipv4) + " IPv6=" + std::to_string(ipv6) + " "}

Definition at line 291 of file test_capture.cpp.

◆ ipv6

from_json ipv6 = true

Definition at line 109 of file test_capture.cpp.

◆ layer

const auto layer = *rc::gen::element(3, 2, 0).as("Layer - 3, 2 or 0")

Definition at line 940 of file test_capture.cpp.

◆ metric

const auto metric = *rc::gen::positive<int>().as("Valid route metric")

Definition at line 904 of file test_capture.cpp.

◆ mtu_ipv4_maximum

constexpr auto mtu_ipv4_maximum {65'535}
staticconstexpr

Definition at line 1122 of file test_capture.cpp.

◆ os

os<< "Tunnel Addresses:\n" os<< "Reroute Gateway: "<< tbc-> reroute_gw to_string()<< '\n' = {}

Definition at line 1086 of file test_capture.cpp.

◆ port

from_json port = port

Definition at line 696 of file test_capture.cpp.

◆ proxy_auto_config_url

TunBuilderCapture::ProxyAutoConfigURL proxy_auto_config_url {}

Definition at line 1118 of file test_capture.cpp.

◆ proxy_autoconfig_url

Initial value:
{
const auto url = *rc::gen::nonEmpty<std::string>()
proxy_autoconfig_url url

Definition at line 587 of file test_capture.cpp.

◆ proxy_autoconfig_url_as_json

const auto proxy_autoconfig_url_as_json = proxy_autoconfig_url.to_json()

Definition at line 614 of file test_capture.cpp.

◆ proxy_bypass

std::vector< TunBuilderCapture::ProxyBypass > proxy_bypass
Initial value:
{
const auto bypass_host = *rc::gen::nonEmpty<std::string>()
proxy_bypass bypass_host

Definition at line 495 of file test_capture.cpp.

◆ proxy_bypass_as_json

const auto proxy_bypass_as_json = proxy_bypass.to_json()

Definition at line 522 of file test_capture.cpp.

◆ proxy_host_port

Initial value:
{
const auto host = *rc::gen::nonEmpty<std::string>()
proxy_host_port host

Definition at line 681 of file test_capture.cpp.

◆ proxy_host_port_as_json

const auto proxy_host_port_as_json = proxy_host_port.to_json()

Definition at line 709 of file test_capture.cpp.

◆ remote_address

Initial value:
{
const auto address = *rc::gen::nonEmpty<std::string>()
remote_address address

Definition at line 81 of file test_capture.cpp.

◆ reroute_gw

Definition at line 1109 of file test_capture.cpp.

◆ reroute_gw_as_json

const auto reroute_gw_as_json = reroute_gw.to_json()

Definition at line 298 of file test_capture.cpp.

◆ ret

ret = "[ "

Definition at line 268 of file test_capture.cpp.

◆ route_metric_default

int route_metric_default {-1}

Definition at line 1113 of file test_capture.cpp.

◆ search_domains

dns_options search_domains = {{search_domain}}

Definition at line 930 of file test_capture.cpp.

◆ servers

dns_options servers = std::move(server)

Definition at line 929 of file test_capture.cpp.

◆ sut

Definition at line 1785 of file test_capture.cpp.

◆ tunnel_address_index_ipv4

int tunnel_address_index_ipv4 {-1}

Definition at line 1107 of file test_capture.cpp.

◆ tunnel_address_index_ipv6

int tunnel_address_index_ipv6 {-1}

Definition at line 1108 of file test_capture.cpp.

◆ tunnel_addresses

os<< "Block IPv4: " << (tbc->block_ipv4 ? "yes" : "no") << '\n'; os << "Block IPv6: " << (tbc->block_ipv6 ? "yes" : "no") << '\n'; os << "Block local DNS: " << (tbc->block_outside_dns ? "yes" : "no") << '\n'; os << "Add Routes:\n"; os << "Exclude Routes:\n"; RC_ASSERT(tbc->to_string() == os.str());}struct TunBuilderCaptureModel{ std::string session_name; int mtu{0}; Layer layer{Layer::OSI_LAYER_3}; TunBuilderCapture::RemoteAddress remote_address{}; std::vector<TunBuilderCapture::RouteAddress> tunnel_addresses

Definition at line 1106 of file test_capture.cpp.

◆ url

from_json url = url

Definition at line 588 of file test_capture.cpp.

◆ vpn_address

const TunBuilderCapture::RouteAddress * vpn_address = tbc->vpn_ip(ip_version)

Definition at line 878 of file test_capture.cpp.

◆ wins_server_as_json

const auto wins_server_as_json = wins_server.to_json()

Definition at line 806 of file test_capture.cpp.

◆ wins_servers

std::vector<TunBuilderCapture::WINSServer> wins_servers {}

Definition at line 1121 of file test_capture.cpp.