diff --git a/OpenVPN Adapter/OpenVPNClient.mm b/OpenVPN Adapter/OpenVPNClient.mm index da45138..041baae 100644 --- a/OpenVPN Adapter/OpenVPNClient.mm +++ b/OpenVPN Adapter/OpenVPNClient.mm @@ -10,6 +10,7 @@ #import +#import "TUNFactory.h" #import "OpenVPNAdapter+Internal.h" #import "OpenVPNClient.h" @@ -18,7 +19,7 @@ OpenVPNClient::OpenVPNClient(void *adapter) : ClientAPI::OpenVPNClient() { } TunClientFactory* OpenVPNClient::new_tun_factory(const ExternalTun::Config& conf, const OptionList& opt) { - return nullptr; + return new TUNFactory(); } bool OpenVPNClient::tun_builder_new() { diff --git a/OpenVPN Adapter/TUNFactory.h b/OpenVPN Adapter/TUNFactory.h new file mode 100644 index 0000000..953ac63 --- /dev/null +++ b/OpenVPN Adapter/TUNFactory.h @@ -0,0 +1,18 @@ +// +// TUNFactory.h +// OpenVPN Adapter +// +// Created by Sergey Abramchuk on 15.04.17. +// +// + +#import + +using namespace openvpn; + +class TUNFactory: public TunClientFactory { +public: + virtual TunClient::Ptr new_tun_client_obj(openvpn_io::io_context& io_context, + TunClientParent& parent, + TransportClient* transcli) override; +}; diff --git a/OpenVPN Adapter/TUNFactory.mm b/OpenVPN Adapter/TUNFactory.mm new file mode 100644 index 0000000..8f05bb1 --- /dev/null +++ b/OpenVPN Adapter/TUNFactory.mm @@ -0,0 +1,18 @@ +// +// TUNFactory.m +// OpenVPN Adapter +// +// Created by Sergey Abramchuk on 15.04.17. +// +// + +#import "TUNFactory.h" + +// !!! tuncli.hpp may be used as example of implementation + +TunClient::Ptr TUNFactory::new_tun_client_obj(openvpn_io::io_context& io_context, + TunClientParent& parent, + TransportClient* transcli) +{ + return nullptr; +}