Skip to content

Commit

Permalink
Revert "Use openvpn_io::detail::socket_type instead of "int""
Browse files Browse the repository at this point in the history
This reverts commit 8f7fdd1.
  • Loading branch information
schwabe committed Nov 30, 2023
1 parent c5d37c4 commit 7f2e42c
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions client/ovpncli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class MySocketProtect : public SocketProtect
rg_local = rg_local_arg;
}

bool socket_protect(openvpn_io::detail::socket_type socket, IP::Addr endpoint) override
bool socket_protect(int socket, IP::Addr endpoint) override
{
if (parent)
{
Expand Down Expand Up @@ -801,7 +801,7 @@ OPENVPN_CLIENT_EXPORT Status OpenVPNClient::provide_creds(const ProvideCreds &cr
return ret;
}

OPENVPN_CLIENT_EXPORT bool OpenVPNClient::socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6)
OPENVPN_CLIENT_EXPORT bool OpenVPNClient::socket_protect(int socket, std::string remote, bool ipv6)
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion client/ovpncli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6);
virtual bool socket_protect(int 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
Expand Down
6 changes: 3 additions & 3 deletions openvpn/asio/asiopolysock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Base : public RC<thread_unsafe_refcount>
{
}

virtual openvpn_io::detail::socket_type native_handle()
virtual int native_handle()
{
return -1;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ struct TCP : public Base
return false;
}

virtual openvpn_io::detail::socket_type native_handle() override
virtual int native_handle() override
{
return socket.native_handle();
}
Expand Down Expand Up @@ -320,7 +320,7 @@ struct Unix : public Base
return true;
}

virtual openvpn_io::detail::socket_type native_handle() override
virtual int native_handle() override
{
return socket.native_handle();
}
Expand Down
2 changes: 1 addition & 1 deletion openvpn/omi/openvpn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Client : public ClientAPI::OpenVPNClient
}

private:
bool socket_protect(openvpn_io::detail::socket_type socket, std::string remote, bool ipv6) override
bool socket_protect(int socket, std::string remote, bool ipv6) override
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion openvpn/transport/client/tcpcli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class Client : public TransportClient, AsyncResolvableTCP
return server_endpoint.port();
}

openvpn_io::detail::socket_type native_handle() override
int native_handle() override
{
return socket.native_handle();
}
Expand Down
2 changes: 1 addition & 1 deletion openvpn/transport/client/transbase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct TransportClient : public virtual RC<thread_unsafe_refcount>
{
return 0;
}
virtual openvpn_io::detail::socket_type native_handle()
virtual int native_handle()
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion openvpn/transport/client/udpcli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class Client : public TransportClient, AsyncResolvableUDP
return server_endpoint.port();
}

openvpn_io::detail::socket_type native_handle() override
int native_handle() override
{
return socket.native_handle();
}
Expand Down
2 changes: 1 addition & 1 deletion openvpn/transport/socket_protect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace openvpn {
class BaseSocketProtect
{
public:
virtual bool socket_protect(openvpn_io::detail::socket_type socket, IP::Addr endpoint) = 0;
virtual bool socket_protect(int socket, IP::Addr endpoint) = 0;
};

#ifdef OPENVPN_PLATFORM_UWP
Expand Down
4 changes: 2 additions & 2 deletions test/ovpncli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ClientBase : public ClientAPI::OpenVPNClient
tun->destroy(os);
}

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

0 comments on commit 7f2e42c

Please sign in to comment.