{"id":13376260,"url":"https://github.com/openvpn/openvpn3","last_synced_at":"2025-03-13T02:30:42.451Z","repository":{"id":37677750,"uuid":"68343749","full_name":"OpenVPN/openvpn3","owner":"OpenVPN","description":"OpenVPN 3 is a C++ class library that implements the functionality of an OpenVPN client, and is protocol-compatible with the OpenVPN 2.x branch.","archived":false,"fork":false,"pushed_at":"2025-03-11T11:29:06.000Z","size":10585,"stargazers_count":1043,"open_issues_count":67,"forks_count":410,"subscribers_count":74,"default_branch":"master","last_synced_at":"2025-03-11T12:28:26.788Z","etag":null,"topics":["security","vpn","vpn-client"],"latest_commit_sha":null,"homepage":"https://openvpn.net","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenVPN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-16T01:12:39.000Z","updated_at":"2025-03-11T11:29:11.000Z","dependencies_parsed_at":"2023-11-10T15:27:45.189Z","dependency_job_id":"3eae865b-8365-4c9e-af17-c59a5bd46aa8","html_url":"https://github.com/OpenVPN/openvpn3","commit_stats":{"total_commits":3988,"total_committers":31,"mean_commits":128.6451612903226,"dds":"0.35280842527582745","last_synced_commit":"47cd77442361bedd90af043c553758aae9f4a5fa"},"previous_names":[],"tags_count":112,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVPN%2Fopenvpn3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVPN%2Fopenvpn3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVPN%2Fopenvpn3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenVPN%2Fopenvpn3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenVPN","download_url":"https://codeload.github.com/OpenVPN/openvpn3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243327735,"owners_count":20273738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["security","vpn","vpn-client"],"created_at":"2024-07-30T05:02:37.704Z","updated_at":"2025-03-13T02:30:42.436Z","avatar_url":"https://github.com/OpenVPN.png","language":"C++","funding_links":[],"categories":["\u003ca id=\"7cf7e8a30b73997985f20698eaf6b0c9\"\u003e\u003c/a\u003eOpenVPN"],"sub_categories":["\u003ca id=\"8ea8f890cf767c3801b5e7951fca3570\"\u003e\u003c/a\u003e公网访问局域网"],"readme":"OpenVPN 3\n=========\n\nOpenVPN 3 is a C++ class library that implements the functionality of an\nOpenVPN client, and is protocol-compatible with the OpenVPN 2.x branch.\n\nOpenVPN 3 includes a minimal client wrapper (`cli`) that links in with\nthe library and provides basic command line functionality.\n\nOpenVPN 3 is currently used in production as the core of the OpenVPN\nConnect clients for iOS, Android, Linux, Windows, and Mac OS X.\n\nNOTE: OpenVPN 3 does not currently implement server functionality.\n\n[TOC]\n\nOpenVPN 3 Client API\n--------------------\n\nOpenVPN 3 is organized as a C++ class library, and the API is defined in\n[client/ovpncli.hpp](client/ovpncli.hpp).\n\nA simple command-line wrapper for the API is provided in\n[test/ovpncli/cli.cpp](test/ovpncli/cli.cpp).\n\nBuilding the OpenVPN 3 client on Linux\n--------------------------------------\n\nThese instructions were tested on Ubuntu 22.04.\n\nInstall essential dependencies:\n\n    $ sudo apt install --no-install-recommends ca-certificates cmake g++ git iproute2 ninja-build pkg-config\n    $ sudo apt install --no-install-recommends libasio-dev libcap-dev liblz4-dev libjsoncpp-dev libssl-dev libxxhash-dev\n\nPotentially install optional dependencies:\n\n    $ sudo apt install --no-install-recommends libmbedtls-dev liblzo2-dev python3-dev swig\n\nClone the OpenVPN 3 source repo:\n\n    $ git clone https://github.com/OpenVPN/openvpn3.git\n\nBuild the OpenVPN 3 client wrapper (cli) with OpenSSL library:\n\n    $ cd openvpn3 \u0026\u0026 mkdir build \u0026\u0026 cd build\n    $ cmake -GNinja ..\n    $ cmake --build .\n    $ ctest # Run Unit Tests\n\nTo use mbedTLS, use:\n\n    $ cmake -GNinja -DUSE_MBEDTLS=ON ..\n\nRun OpenVPN 3 client:\n\n    $ sudo test/ovpncli/ovpncli myprofile.ovpn route-nopull\n\nOptions used:\n\n-   `myprofile.ovpn` : OpenVPN config file (must have .ovpn extension)\n-   `route-nopull` : if you are connected via ssh, prevent ssh session\n    lockout\n\n### Using cli with ovpn-dco\n\novpn-dco is a kernel module which optimises data channel encryption and\ntransport, providing better performance. The cli will detect when the\nkernel module is available and enable dco automatically (use `--no-dco`\nto disable this).\n\nDownload, build and install ovpn-dco:\n\n    $ sudo apt install make\n    $ git clone https://github.com/OpenVPN/ovpn-dco.git\n    $ cd ovpn-dco\n    $ make \u0026\u0026 sudo make install\n    $ sudo modprobe ovpn-dco\n\nInstall core dependencies:\n\n    $ sudo apt install libnl-genl-3-dev\n\nBuild cli with ovpn-dco support:\n\n    $ cd $O3/core/build\n    $ cmake -DCLI_OVPNDCO=ON .. \u0026\u0026 cmake --build .\n    $ sudo test/ovpncli/ovpncli [--no-dco] myprofile.ovpn\n\nOptions:\n\n-   `myprofile.ovpn` : OpenVPN config file (must have .ovpn extension)\n-   `--no-dco` : disable data channel offload (optional)\n\nBuilding the OpenVPN 3 client on macOS\n--------------------------------------\n\nOpenVPN 3 should be built in a non-root macOS account. Make sure that\nXcode is installed with optional command-line tools.\n\nCreate the directory `~/src`:\n\n    $ mkdir -p ~/src\n\nClone the OpenVPN 3 repo:\n\n    $ cd ~/src\n    $ git clone https://github.com/OpenVPN/openvpn3.git openvpn3\n\nInstall the dependencies:\n\nEnsure that [homebrew](\u003chttps://brew.sh/\u003e) is set up.\n\n    $  brew install asio cmake jsoncpp lz4 openssl pkg-config xxhash\n\nNow build the OpenVPN 3 client executable:\n\nOn a ARM64 based Mac:\n\n    $ cd ~/src/\n    $ mkdir build-openvpn3\n    $ cd build-openvpn3\n    $ cmake -DOPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl -DCMAKE_PREFIX_PATH=/opt/homebrew ~/src/openvpn3\n    $ cmake --build .\n\nFor a build on a Intel based Mac:\n\n    $ cd ~/src/\n    $ mkdir build-openvpn3\n    $ cd build-openvpn3\n    $ cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCMAKE_PREFIX_PATH=/usr/local/opt ~/src/openvpn3\n    $ cmake --build .\n\nThis will build the OpenVPN 3 client library with a small client wrapper\n(`ovpncli`) and the unit tests.\n\nThese build scripts will create binaries with the same architecture as\nthe host it is running on. The Mac OS X tuntap driver is not required,\nas OpenVPN 3 can use the integrated utun interface if available.\n\nTo view the client wrapper options:\n\n    $ ./test/ovpncli/ovpncli -h\n\nTo connect:\n\n    $ ./test/ovpncli/ovpncli client.ovpn\n\nBuilding the OpenVPN 3 client for Windows\n-----------------------------------------\n\n![image](https://github.com/OpenVPN/openvpn3/actions/workflows/msbuild.yml/badge.svg)\n\n### Building with Visual Studio\n\nPrerequisites:\n\n-   Visual Studio 2019 or 2022\n-   CMake\n-   vcpkg\n-   git\n\nTo build:\n\n    \u003e git clone https://github.com/OpenVPN/openvpn3.git core \u0026\u0026 cd core\n    \u003e set VCPKG_ROOT=\u003cpath to vcpkg checkout\u003e\n    \u003e cmake --preset win-amd64-release\n    \u003e cmake --build --preset win-amd64-release --target ovpncli\n\n### Building with MinGW\n\nThis build should work on both Windows and Linux.\n\nPrerequisites:\n\n-   mingw-w64\n-   CMake\n-   vcpkg\n-   git\n\nTo build:\n\n    $ git clone https://github.com/OpenVPN/openvpn3.git core \u0026\u0026 cd core\n    $ export VCPKG_ROOT=\u003cpath to vcpkg checkout\u003e\n    $ cmake --preset mingw-x64-release\n    $ cmake --build --preset mingw-x64-release --target ovpncli\n\n\nTesting\n-------\n\nThe OpenVPN 3 core includes a stress/performance test of the OpenVPN\nprotocol implementation. The test basically creates a virtualized lossy\nnetwork between two OpenVPN protocol objects, triggers TLS negotiations\nbetween them, passes control/data channel messages, and measures the\nability of the OpenVPN protocol objects to perform and remain in a valid\nstate.\n\nThe OpenVPN protocol implementation that is being tested is here:\n[openvpn/ssl/proto.hpp](openvpn/ssl/proto.hpp)\n\nThe test code itself is here:\n[test/unittests/test\\_proto.cpp](test/unittests/test_proto.cpp) It will\nbe built and run as part of the unit test suite.\n\nThe unit tests are based on Google Test framework. To run unit tests,\nyou need to install CMake and build Google Test.\n\nBuild and run tests on Linux:\n\n    $ cd $O3/core/build\n    $ cmake --build . -- test/unittests/coreUnitTests\n    $ make test\n\nDeveloper Guide\n---------------\n\nOpenVPN 3 is written in C++17 and developers who are moving from C to\nC++ should take some time to familiarize themselves with key C++ design\npatterns such as\n[*RAII*](https://en.wikipedia.org/wiki/Resource_acquisition_is_initialization).\n\n### OpenVPN 3 Client Core\n\nOpenVPN 3 is designed as a class library, with an API that is\nessentially defined inside of **namespace openvpn::ClientAPI** with headers and\nimplementation in [client](client) and header-only library files under\n[openvpn](openvpn).\n\nThe concise definition of the client API is essentially\n**class openvpn::ClientAPI::OpenVPNClient** in [client/ovpncli.hpp](client/ovpncli.hpp) with\nseveral important extensions to the API found in:\n\n-   **class openvpn::TunBuilderBase** in\n    [openvpn/tun/builder/base.hpp](openvpn/tun/builder/base.hpp) ---\n    Provides an abstraction layer defining the *tun* interface, and is\n    especially useful for interfacing with an OS-layer VPN API.\n-   **class openvpn::ExternalPKIBase** in\n    [openvpn/pki/epkibase.hpp](openvpn/pki/epkibase.hpp) --- Provides a\n    callback for external private key operations, and is useful for\n    interfacing with an OS-layer Keychain such as the Keychain on iOS,\n    Mac OS X, and Android, and the Crypto API on Windows.\n-   **class openvpn::ClientAPI::LogReceiver** in [client/ovpncli.hpp](client/ovpncli.hpp) ---\n    Provides an abstraction layer for the delivery of logging messages.\n\nOpenVPN 3 includes a command-line reference client (`cli`) for testing\nthe API. See [test/ovpncli/cli.cpp](test/ovpncli/cli.cpp).\n\nThe basic approach to building an OpenVPN 3 client is to define a client\nclass that derives from openvpn::ClientAPI::OpenVPNClient, then provide\nimplementations for callbacks including event and logging notifications:\n\n    class Client : public ClientAPI::OpenVPNClient\n    {\n    public:\n        virtual void event(const Event\u0026) override {  // events delivered here\n          ...\n        }\n        virtual void log(const LogInfo\u0026) override {  // logging delivered here\n          ...\n        }\n\n        ...\n    };\n\nTo start the client, first create a **openvpn::ProtoContext::ProtoConfig** object and\ninitialize it with the OpenVPN config file and other options:\n\n    ProtoContext::ProtoConfig config;\n    config.content = \u003cconfig_file_content_as_multiline_string\u003e;\n    ...\n\nNext, create a client object and evaluate the configuration:\n\n    Client client;\n    ClientAPI::EvalConfig eval = client.eval_config(config);\n    if (eval.error)\n        throw ...;\n\nFinally, in a new worker thread, start the connection:\n\n    ClientAPI::Status connect_status = client.connect();\n\nNote that `client.connect()` will not return until the session has\nterminated.\n\n### Top Layer\n\nThe top layer of the OpenVPN 3 client is implemented in\n[test/ovpncli/cli.cpp](test/ovpncli/cli.cpp) and\n[openvpn/client/cliopt.hpp](openvpn/client/cliopt.hpp). Most of what\nthis code does is marshalling the configuration and dispatching the\nhigher-level objects that implement the OpenVPN client session.\n\n### Connection\n\n**class openvpn::ClientConnect** in\n[openvpn/client/cliconnect.hpp](openvpn/client/cliconnect.hpp)\nimplements the top-level connection logic for an OpenVPN client\nconnection. It is concerned with starting, stopping, pausing, and\nresuming OpenVPN client connections. It deals with retrying a connection\nand handles the connection timeout. It also deals with connection\nexceptions and understands the difference between an exception that\nshould halt any further reconnection attempts (such as `AUTH_FAILED`),\nand other exceptions such as network errors that would justify a retry.\n\nSome of the methods in the class (such as `stop`, `pause`, and\n`reconnect`) are often called by another thread that is controlling the\nconnection, therefore thread-safe methods are provided where the\nthread-safe function posts a message to the actual connection thread.\n\nIn an OpenVPN client connection, the following object stack would be\nused:\n\n1.  **class openvpn::ClientConnect** in\n    [openvpn/client/cliconnect.hpp](openvpn/client/cliconnect.hpp) ---\n    The top-layer object in an OpenVPN client connection.\n2.  **class openvpn::ClientProto::Session** in\n    [openvpn/client/cliproto.hpp](openvpn/client/cliproto.hpp) --- The\n    OpenVPN client protocol object that subinstantiates the transport\n    and tun layer objects.\n3.  **class openvpn::ProtoContext** in\n    [openvpn/ssl/proto.hpp](openvpn/ssl/proto.hpp) --- The core OpenVPN\n    protocol implementation that is common to both client and server.\n4.  **openvpn::ProtoStackBase** (with **openvpn::Packet**) in\n    [openvpn/ssl/protostack.hpp](openvpn/ssl/protostack.hpp) --- The\n    bottom-layer class that implements the basic functionality of\n    tunneling a protocol over a reliable or unreliable transport layer,\n    but isn't specific to OpenVPN per-se.\n\n### Transport Layer\n\nOpenVPN 3 defines abstract base classes for Transport layer\nimplementations in\n[openvpn/transport/client/transbase.hpp](openvpn/transport/client/transbase.hpp).\n\nCurrently, transport layer implementations are provided for:\n\n-   **UDP** ---\n    [openvpn/transport/client/udpcli.hpp](openvpn/transport/client/udpcli.hpp)\n-   **TCP** ---\n    [openvpn/transport/client/tcpcli.hpp](openvpn/transport/client/tcpcli.hpp)\n-   **HTTP Proxy** ---\n    [openvpn/transport/client/httpcli.hpp](openvpn/transport/client/httpcli.hpp)\n\n### Tun Layer\n\nOpenVPN 3 defines abstract base classes for Tun layer implementations in\n[openvpn/tun/client/tunbase.hpp](openvpn/tun/client/tunbase.hpp).\n\nThere are two possible approaches to define a Tun layer implementation:\n\n1.  Use a VPN API-centric model (such as for Android or iOS). These\n    models derive from **class openvpn::TunBuilderBase** in\n    [openvpn/tun/builder/base.hpp](openvpn/tun/builder/base.hpp)\n2.  Use an OS-specific model such as:\n    -   **Linux** ---\n        [openvpn/tun/linux/client/tuncli.hpp](openvpn/tun/linux/client/tuncli.hpp)\n    -   **Windows** ---\n        [openvpn/tun/win/client/tuncli.hpp](openvpn/tun/win/client/tuncli.hpp)\n    -   **Mac OS X** ---\n        [openvpn/tun/mac/client/tuncli.hpp](openvpn/tun/mac/client/tuncli.hpp)\n\n### Protocol Layer\n\nThe OpenVPN protocol is implemented in **class openvpn::ProtoContext** in\n[openvpn/ssl/proto.hpp](openvpn/ssl/proto.hpp).\n\n### Options Processing\n\nThe parsing and query of the OpenVPN config file is implemented by\n**class openvpn::OptionList** in\n[openvpn/common/options.hpp](openvpn/common/options.hpp).\n\nNote that OpenVPN 3 always assumes an *inline* style of configuration,\nwhere all certs, keys, etc. are defined inline rather than through an\nexternal file reference.\n\nFor config files that do use external file references,\n**class openvpn::ProfileMerge** in\n[openvpn/options/merge.hpp](openvpn/options/merge.hpp) is provided to\nmerge those external file references into an inline form.\n\n### Calling the Client API from other languages\n\nThe OpenVPN 3 client API, as defined by\n**class openvpn::ClientAPI::OpenVPNClient** in\n[client/ovpncli.hpp](client/ovpncli.hpp), can be wrapped by the\n[Swig](http://www.swig.org/) tool to create bindings for other\nlanguages.\n\nFor example, OpenVPN Connect for Android creates a Java binding of the\nAPI using [client/ovpncli.i](client/ovpncli.i).\n\nSecurity\n--------\n\nWhen developing security software in C++, it's very important to take\nadvantage of the language and OpenVPN library code to insulate code from\nthe kinds of bugs that can introduce security vulnerabilities.\n\nHere is a brief set of guidelines:\n\n-   When dealing with strings, use a `std::string` rather than a\n    `char *`.\n\n-   When dealing with binary data or buffers, always try to use a\n    `openvpn::Buffer`, `openvpn::ConstBuffer`, `openvpn::BufferAllocatedRc`,\n    or `openvpn::BufferPtr` object\n    to provide managed access to the buffer, to protect against security\n    bugs that arise when using raw buffer pointers. See\n    [openvpn/buffer/buffer.hpp](openvpn/buffer/buffer.hpp) for the\n    OpenVPN `Buffer` classes.\n\n-   When it's necessary to have a pointer to an object, use\n    `std::unique_ptr\u003c\u003e` for non-shared objects and reference-counted\n    smart pointers for shared objects. For shared-pointers, OpenVPN code\n    should use the smart pointer classes defined in\n    [openvpn/common/rc.hpp](openvpn/common/rc.hpp). Please see the\n    comments in this file for documentation.\n\n-   Never use `malloc` or `free`. When allocating objects, use the C++\n    `new` operator and then immediately construct a smart pointer to\n    reference the object:\n\n        std::unique_ptr\u003cMyObject\u003e ptr = new MyObject();\n        ptr-\u003emethod();\n\n-   When interfacing with C functions that deal with raw pointers,\n    memory allocation, etc., consider wrapping the functionality in C++.\n    For an example, see `enum_dir()` in\n    [openvpn/common/enumdir.hpp](openvpn/common/enumdir.hpp), a function\n    that returns a list of files in a directory (Unix only) via a\n    high-level string vector, while internally calling the low level\n    libc methods `opendir`, `readdir`, and `closedir`. Notice how\n    `unique_ptr_del` is used to wrap the `DIR` struct in a smart pointer\n    with a custom deletion function.\n\n-   When grabbing random entropy that is to be used for cryptographic\n    purposes (i.e. for keys, tokens, etc.), always ensure that the RNG\n    is crypto-grade by using **class openvpn::StrongRandomAPI** as the RNG type:\n\n        StrongRandomAPI::Ptr rng;\n        void set_rng(StrongRandomAPI::Ptr rng_arg) {\n            rng = std::move(rng_arg);\n        }\n\n-   Any variable whose value is not expected to change should be\n    declared `const`.\n\n-   Don't use non-const global or static variables unless absolutely\n    necessary.\n\n-   When formatting strings, don't use `snprintf`. Instead, use\n    `std::ostringstream` or build the string using the `+` `std::string`\n    operator:\n\n        std::string format_reconnecting(const int n_seconds) {\n            return \"Reconnecting in \" + openvpn::to_string(n_seconds) + \" seconds.\";\n        }\n\n    or:\n\n        std::string format_reconnecting(const int n_seconds) {\n            std::ostringstream os;\n            os \u003c\u003c \"Reconnecting in \" \u003c\u003c n_seconds \u003c\u003c \" seconds.\";\n            return os.str();\n        }\n\n-   OpenVPN 3 is a *header-only* library, therefore all free functions\n    outside of classes should have the `inline` attribute.\n\n### Conventions\n\n-   Use the **Asio** library for I/O and timers. Don't deal with\n    sockets directly.\n\n-   Never block. If you need to wait for something, use **Asio** timers\n    or sockets.\n\n-   Use the `OPENVPN_LOG()` macro to log stuff. Don't use `printf`.\n\n-   Don't call crypto/ssl libraries directly. Instead use the\n    abstraction layers ([openvpn/crypto](openvpn/crypto) and\n    [openvpn/ssl](openvpn/ssl)) that allow OpenVPN to link with\n    different crypto/ssl libraries (such as **OpenSSL** or **mbed\n    TLS**).\n\n-   Use openvpn::RandomAPI as a wrapper for random number generators\n    ([openvpn/random/randapi.hpp](openvpn/random/randapi.hpp)).\n\n-   If you need to deal with configuration file options, see\n    class openvpn::OptionList in\n    [openvpn/common/options.hpp](openvpn/common/options.hpp).\n\n-   If you need to deal with time or time durations, use the classes\n    under [openvpn/time](openvpn/time).\n\n-   If you need to deal with IP addresses, see the comprehensive classes\n    under [openvpn/addr](openvpn/addr).\n\n-   In general, if you need a general-purpose library class or function,\n    look under [openvpn/common](openvpn/common). Chances are good that\n    it's already been implemented.\n\n-   The OpenVPN 3 approach to errors is to count them, rather than\n    unconditionally log them. If you need to add a new error counter,\n    see [openvpn/error/error.hpp](openvpn/error/error.hpp).\n\n-   If you need to create a new event type which can be transmitted as a\n    notification back to the client API user, see\n    [openvpn/client/clievent.hpp](openvpn/client/clievent.hpp).\n\n-   Raw pointers or references can be okay when used by an object to\n    point back to its parent (or container), if you can guarantee that\n    the object will not outlive its parent. Backreferences to a parent\n    object is also a common use case for weak pointers.\n\n-   Use C++ exceptions for error handling and as an alternative to\n    `goto`. See OpenVPN's general exception classes and macros in\n    [openvpn/common/exception.hpp](openvpn/common/exception.hpp).\n\n-   Use C++ destructors for automatic object cleanup, and so that thrown\n    exceptions will not leak objects. Alternatively, use openvpn::Cleanup in\n    [openvpn/common/cleanup.hpp](openvpn/common/cleanup.hpp) when you\n    need to specify a code block to execute prior to scope exit. For\n    example, ensure that the file `pid_fn` is deleted before scope exit:\n\n        auto clean = Cleanup([pid_fn]() {\n            if (pid_fn)\n                ::unlink(pid_fn);\n        });\n\n-   When calling global methods (such as libc `fork`), prepend `::` to\n    the symbol name, e.g.:\n\n        struct dirent *e;\n        while ((e = ::readdir(dir.get())) != nullptr) {\n            ...\n        }\n\n-   Use `nullptr` instead of `NULL`.\n\n### Threading\n\nThe OpenVPN 3 client core is designed to run in a single thread, with\nthe UI or controller driving the OpenVPN API running in a different\nthread.\n\nIt's almost never necessary to create additional threads within the\nOpenVPN 3 client core.\n\nContributing\n------------\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\nLicense\n-------\n\nSee [LICENSE.md](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvpn%2Fopenvpn3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenvpn%2Fopenvpn3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenvpn%2Fopenvpn3/lists"}