OpenVPN 3 Core Library
Loading...
Searching...
No Matches
servhalt.hpp
Go to the documentation of this file.
1// OpenVPN -- An application to securely tunnel IP networks
2// over a single port, with support for SSL/TLS-based
3// session authentication and key exchange,
4// packet encryption, packet authentication, and
5// packet compression.
6//
7// Copyright (C) 2012- OpenVPN Inc.
8//
9// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10//
11
12#pragma once
13
14#include <string>
15
17enum Type
18{
19 HALT, // disconnect
20 RESTART, // restart, don't preserve session token
21 RESTART_PSID, // restart, preserve session token
22 RESTART_PASSIVE, // restart, preserve session token and local client instance object
23 AUTH_FAILED, // auth fail, don't preserve session token
24 RAW, // pass raw message to client
25};
26
27inline std::string to_string(Type type)
28{
29 switch (type)
30 {
31 case HALT:
32 return "HALT";
33 case RESTART:
34 return "RESTART";
35 case RESTART_PSID:
36 return "RESTART_PSID";
37 case RESTART_PASSIVE:
38 return "RESTART_PASSIVE";
39 case AUTH_FAILED:
40 return "AUTH_FAILED";
41 case RAW:
42 return "RAW";
43 default:
44 return "HaltRestart_?";
45 }
46}
47} // namespace openvpn::HaltRestart