OpenVPN 3 Core Library
Loading...
Searching...
No Matches
ipverflags.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#ifndef OPENVPN_CLIENT_IPVERFLAGS_H
13#define OPENVPN_CLIENT_IPVERFLAGS_H
14
15#include <openvpn/addr/ip.hpp>
18
19namespace openvpn {
21{
22 public:
30
31 bool rgv4() const
32 {
34 }
35
36 bool rgv6() const
37 {
39 }
40
41 bool v4() const
42 {
43 return (ip_ver_flags_ & IP::Addr::V4_MASK) ? true : false;
44 }
45
46 bool v6() const
47 {
48 return (ip_ver_flags_ & IP::Addr::V6_MASK) ? true : false;
49 }
50
52 {
54 if (rgv4())
56 if (rgv6())
58 return flags;
59 }
60
62 {
64 if (v4())
66 if (v6())
68 return flags;
69 }
70
71 // these flags are passed to tun_builder_reroute_gw method
72 unsigned int api_flags() const
73 {
74 return api_flags_ | rg_flags_();
75 }
76
81
82 private:
85 unsigned int api_flags_;
86};
87} // namespace openvpn
88
89#endif
const IP::Addr::VersionMask ip_ver_flags_
IP::Addr::VersionMask rg_ver_flags() const
IP::Addr::VersionMask ip_ver_flags() const
bool rgv6() const
IPVerFlags(const OptionList &opt, const IP::Addr::VersionMask ip_ver_flags)
bool rgv4() const
void set_emulate_exclude_routes()
unsigned int api_flags() const
const RedirectGatewayFlags rg_flags_
unsigned int api_flags_
unsigned int VersionMask
Definition ip.hpp:53
bool redirect_gateway_ipv6_enabled() const
Definition rgopt.hpp:72
bool redirect_gateway_ipv4_enabled() const
Definition rgopt.hpp:67
reroute_gw flags