OpenVPN 3 Core Library
Loading...
Searching...
No Matches
socket_protect.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_TRANSPORT_SOCKET_PROTECT_H
13#define OPENVPN_TRANSPORT_SOCKET_PROTECT_H
14
15#include <openvpn/addr/ip.hpp>
16#ifdef OPENVPN_PLATFORM_UWP
17#include <openvpn/transport/uwp_socket_protect.hpp>
18#endif
19
20namespace openvpn {
21// Used as an interface in cases where the high-level controlling app
22// needs early access to newly created transport sockets for making
23// property changes. For example, on Android, we need to "protect"
24// the socket from being routed into the VPN tunnel.
26{
27 public:
28 virtual ~BaseSocketProtect() = default;
29
30 virtual bool socket_protect(openvpn_io::detail::socket_type socket, IP::Addr endpoint) = 0;
31};
32
33#ifdef OPENVPN_PLATFORM_UWP
34typedef UWPSocketProtect SocketProtect;
35#else
37#endif
38} // namespace openvpn
39
40#endif
virtual ~BaseSocketProtect()=default
virtual bool socket_protect(openvpn_io::detail::socket_type socket, IP::Addr endpoint)=0
Support deferred server-side state creation when client connects.
Definition ovpncli.cpp:95
BaseSocketProtect SocketProtect