OpenVPN 3 Core Library
Loading...
Searching...
No Matches
ovpncli.i
Go to the documentation of this file.
1// SWIG interface file for OpenVPN client
2
3// enable director feature for OpenVPNClientBase virtual method callbacks
4%module(directors="1") ovpncli
5%feature("director") OpenVPNClient;
6
7%include "std_string.i" // for std::string typemaps
8%include "std_vector.i"
9%include "std_map.i"
10
11// top-level C++ implementation file
12%{
13#include "ovpncli.hpp"
14%}
15
16#ifndef OPENVPN_PLATFORM_WIN
17// simplify interface, not picked up automatically
18%apply int { openvpn_io::detail::socket_type };
19%apply int { asio::detail::socket_type };
20#endif
21
22%apply size_t { openvpn::Error::Type };
23
24// ignore these ClientAPI::OpenVPNClient bases
25%ignore openvpn::ClientAPI::LogReceiver;
26%ignore openvpn::ExternalTun::Factory;
27%ignore openvpn::ExternalTransport::Factory;
28
29// modify exported C++ class names to incorporate their enclosing namespace
30%rename(ClientAPI_OpenVPNClient) OpenVPNClient;
31%rename(ClientAPI_OpenVPNClientHelper) OpenVPNClientHelper;
32%rename(ClientAPI_TunBuilderBase) TunBuilderBase;
33%rename(ClientAPI_ExternalPKIBase) ExternalPKIBase;
34%rename(ClientAPI_ServerEntry) ServerEntry;
35%rename(ClientAPI_EvalConfig) EvalConfig;
36%rename(ClientAPI_ProvideCreds) ProvideCreds;
37%rename(ClientAPI_SessionToken) SessionToken;
38%rename(ClientAPI_DynamicChallenge) DynamicChallenge;
39%rename(ClientAPI_KeyValue) KeyValue;
40%rename(ClientAPI_Config) Config;
41%rename(ClientAPI_Event) Event;
42%rename(ClientAPI_AppCustomControlMessageEvent) AppCustomControlMessageEvent;
43%rename(ClientAPI_ConnectionInfo) ConnectionInfo;
44%rename(ClientAPI_Status) Status;
45%rename(ClientAPI_LogInfo) LogInfo;
46%rename(ClientAPI_InterfaceStats) InterfaceStats;
47%rename(ClientAPI_TransportStats) TransportStats;
48%rename(ClientAPI_MergeConfig) MergeConfig;
49%rename(ClientAPI_ExternalPKIRequestBase) ExternalPKIRequestBase;
50%rename(ClientAPI_ExternalPKICertRequest) ExternalPKICertRequest;
51%rename(ClientAPI_ExternalPKISignRequest) ExternalPKISignRequest;
52%rename(ClientAPI_RemoteOverride) RemoteOverride;
53
54// declare vectors
55namespace std {
56 %template(ClientAPI_ServerEntryVector) vector<openvpn::ClientAPI::ServerEntry>;
57 %template(ClientAPI_LLVector) vector<long long>;
58 %template(ClientAPI_StringVec) vector<string>;
59};
60%template(DnsOptions_AddressList) std::vector<openvpn::DnsAddress>;
61%template(DnsOptions_DomainsList) std::vector<openvpn::DnsDomain>;
62%template(DnsOptions_ServersMap) std::map<int, openvpn::DnsServer>;
63
64// interface to be bridged between C++ and target language
65%include "openvpn/client/dns_options.hpp"
66%include "openvpn/pki/epkibase.hpp"
67%include "openvpn/tun/builder/base.hpp"
68%import "openvpn/tun/extern/fw.hpp" // ignored
69%import "openvpn/transport/client/extern/fw.hpp" // ignored
70%include "ovpncli.hpp"