OpenVPN 3 Core Library
Loading...
Searching...
No Matches
status.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#ifndef OPENVPN_HTTP_STATUS_H
13#define OPENVPN_HTTP_STATUS_H
14
15// HTTP status codes
16
18enum
19{
20 OK = 200,
21 Connected = 200,
25 Forbidden = 403,
26 NotFound = 404,
32};
33
34inline const char *to_string(const int status)
35{
36 switch (status)
37 {
38 case OK:
39 return "OK";
41 return "Switching Protocols";
42 case BadRequest:
43 return "Bad Request";
44 case Unauthorized:
45 return "Unauthorized";
46 case Forbidden:
47 return "Forbidden";
48 case NotFound:
49 return "Not Found";
51 return "Proxy Authentication Required";
53 return "Precondition Failed";
55 return "Internal Server Error";
56 case ProxyError:
57 return "Proxy Error";
59 return "Service Unavailable";
60 default:
61 return "";
62 }
63}
64} // namespace openvpn::HTTP::Status
65
66#endif
const char * to_string(const int status)
Definition status.hpp:34