0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-19 19:52:15 +02:00

Use openvpn_io::detail::socket_type instead of "int"

On Linux those might be identical, but not on Windows.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
This commit is contained in:
Frank Lichtenheld 2023-08-23 14:48:23 +02:00 committed by David Sommerseth
parent cc5e61e81b
commit 8f7fdd10ff
No known key found for this signature in database
GPG Key ID: 86CF944C9671FDF2
9 changed files with 13 additions and 13 deletions

View File

@ -271,7 +271,7 @@ class MySocketProtect : public SocketProtect
rg_local = rg_local_arg;
}
bool socket_protect(int socket, IP::Addr endpoint) override
bool socket_protect(openvpn_io::detail::socket_type socket, IP::Addr endpoint) override
{
if (parent)
{
@ -801,7 +801,7 @@ OPENVPN_CLIENT_EXPORT Status OpenVPNClient::provide_creds(const ProvideCreds &cr
return ret;
}
OPENVPN_CLIENT_EXPORT bool OpenVPNClient::socket_protect(int socket, std::string remote, bool ipv6)
OPENVPN_CLIENT_EXPORT bool OpenVPNClient::socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6)
{
return true;
}

View File

@ -607,7 +607,7 @@ class OpenVPNClient : public TunBuilderBase, // expose tun builder v
// Callback to "protect" a socket from being routed through the tunnel.
// Will be called from the thread executing connect().
// The remote and ipv6 are the remote host this socket will connect to
virtual bool socket_protect(int socket, std::string remote, bool ipv6);
virtual bool socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6);
// Primary VPN client connect method, doesn't return until disconnect.
// Should be called by a worker thread. This method will make callbacks

View File

@ -86,7 +86,7 @@ class Base : public RC<thread_unsafe_refcount>
{
}
virtual int native_handle()
virtual openvpn_io::detail::socket_type native_handle()
{
return -1;
}
@ -216,7 +216,7 @@ struct TCP : public Base
return false;
}
virtual int native_handle() override
virtual openvpn_io::detail::socket_type native_handle() override
{
return socket.native_handle();
}
@ -320,7 +320,7 @@ struct Unix : public Base
return true;
}
virtual int native_handle() override
virtual openvpn_io::detail::socket_type native_handle() override
{
return socket.native_handle();
}

View File

@ -69,7 +69,7 @@ class Client : public ClientAPI::OpenVPNClient
}
private:
bool socket_protect(int socket, std::string remote, bool ipv6) override
bool socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6) override
{
return true;
}

View File

@ -171,7 +171,7 @@ class Client : public TransportClient, AsyncResolvableTCP
return server_endpoint.port();
}
int native_handle() override
openvpn_io::detail::socket_type native_handle() override
{
return socket.native_handle();
}

View File

@ -59,7 +59,7 @@ struct TransportClient : public virtual RC<thread_unsafe_refcount>
{
return 0;
}
virtual int native_handle()
virtual openvpn_io::detail::socket_type native_handle()
{
return 0;
}

View File

@ -171,7 +171,7 @@ class Client : public TransportClient, AsyncResolvableUDP
return server_endpoint.port();
}
int native_handle() override
openvpn_io::detail::socket_type native_handle() override
{
return socket.native_handle();
}

View File

@ -35,7 +35,7 @@ namespace openvpn {
class BaseSocketProtect
{
public:
virtual bool socket_protect(int socket, IP::Addr endpoint) = 0;
virtual bool socket_protect(openvpn_io::detail::socket_type socket, IP::Addr endpoint) = 0;
};
#ifdef OPENVPN_PLATFORM_UWP

View File

@ -189,7 +189,7 @@ class ClientBase : public ClientAPI::OpenVPNClient
tun->destroy(os);
}
bool socket_protect([[maybe_unused]] int socket, std::string remote, bool ipv6) override
bool socket_protect([[maybe_unused]] openvpn_io::detail::socket_type socket, std::string remote, bool ipv6) override
{
std::ostringstream os;
auto os_print = Cleanup([&os]()
@ -205,7 +205,7 @@ class ClientBase : public ClientAPI::OpenVPNClient
class ClientBase : public ClientAPI::OpenVPNClient
{
public:
bool socket_protect(int socket, std::string remote, bool ipv6) override
bool socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6) override
{
std::cout << "NOT IMPLEMENTED: *** socket_protect " << socket << " " << remote << std::endl;
return true;