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#ifdef SWIGJAVA
12%include "swiginterface.i"
13#endif
14
15// top-level C++ implementation file
16%{
17#include "ovpncli.hpp"
18%}
19
20#ifndef OPENVPN_PLATFORM_WIN
21// simplify interface, not picked up automatically
22%apply int { openvpn_io::detail::socket_type };
23%apply int { asio::detail::socket_type };
24#endif
25
26%apply size_t { openvpn::Error::Type };
27
28#ifdef SWIGJAVA
29%interface(openvpn::ClientAPI::LogReceiver);
30#endif
31
32// ignore these ClientAPI::OpenVPNClient bases
33%ignore openvpn::ExternalTun::Factory;
34%ignore openvpn::ExternalTransport::Factory;
35
36// modify exported C++ class names to incorporate their enclosing namespace
37%rename(ClientAPI_OpenVPNClient) OpenVPNClient;
38%rename(ClientAPI_OpenVPNClientHelper) OpenVPNClientHelper;
39%rename(ClientAPI_TunBuilderBase) TunBuilderBase;
40%rename(ClientAPI_ExternalPKIBase) ExternalPKIBase;
41%rename(ClientAPI_ServerEntry) ServerEntry;
42%rename(ClientAPI_EvalConfig) EvalConfig;
43%rename(ClientAPI_ProvideCreds) ProvideCreds;
44%rename(ClientAPI_SessionToken) SessionToken;
45%rename(ClientAPI_DynamicChallenge) DynamicChallenge;
46%rename(ClientAPI_KeyValue) KeyValue;
47%rename(ClientAPI_Config) Config;
48%rename(ClientAPI_Event) Event;
49%rename(ClientAPI_AppCustomControlMessageEvent) AppCustomControlMessageEvent;
50%rename(ClientAPI_ConnectionInfo) ConnectionInfo;
51%rename(ClientAPI_Status) Status;
52%rename(ClientAPI_LogInfo) LogInfo;
53%rename(ClientAPI_InterfaceStats) InterfaceStats;
54%rename(ClientAPI_TransportStats) TransportStats;
55%rename(ClientAPI_MergeConfig) MergeConfig;
56%rename(ClientAPI_ExternalPKIRequestBase) ExternalPKIRequestBase;
57%rename(ClientAPI_ExternalPKICertRequest) ExternalPKICertRequest;
58%rename(ClientAPI_ExternalPKISignRequest) ExternalPKISignRequest;
59%rename(ClientAPI_RemoteOverride) RemoteOverride;
60
61// declare vectors
62namespace std {
63 %template(ClientAPI_ServerEntryVector) vector<openvpn::ClientAPI::ServerEntry>;
64 %template(ClientAPI_LLVector) vector<long long>;
65 %template(ClientAPI_StringVec) vector<string>;
66};
67%template(DnsOptions_AddressList) std::vector<openvpn::DnsAddress>;
68%template(DnsOptions_DomainsList) std::vector<openvpn::DnsDomain>;
69%template(DnsOptions_ServersMap) std::map<int, openvpn::DnsServer>;
70
71// interface to be bridged between C++ and target language
72%include "openvpn/client/dns_options.hpp"
73%include "openvpn/pki/epkibase.hpp"
74%include "openvpn/tun/builder/base.hpp"
75%import "openvpn/tun/extern/fw.hpp" // ignored
76%import "openvpn/transport/client/extern/fw.hpp" // ignored
77%include "ovpncli.hpp"