mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Declare tun factory and return its instance in new_tun_factory method
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#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() {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// TUNFactory.h
|
||||
// OpenVPN Adapter
|
||||
//
|
||||
// Created by Sergey Abramchuk on 15.04.17.
|
||||
//
|
||||
//
|
||||
|
||||
#import <openvpn/tun/client/tunbase.hpp>
|
||||
|
||||
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;
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user