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
17
namespace
openvpn::HTTP::Status
{
18
enum
19
{
20
OK
= 200,
21
Connected
= 200,
22
SwitchingProtocols
= 101,
23
BadRequest
= 400,
24
Unauthorized
= 401,
25
Forbidden
= 403,
26
NotFound
= 404,
27
ProxyAuthenticationRequired
= 407,
28
PreconditionFailed
= 412,
29
InternalServerError
= 500,
30
ProxyError
= 502,
31
ServiceUnavailable
= 503,
32
};
33
34
inline
const
char
*
to_string
(
const
int
status)
35
{
36
switch
(status)
37
{
38
case
OK
:
39
return
"OK"
;
40
case
SwitchingProtocols
:
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"
;
50
case
ProxyAuthenticationRequired
:
51
return
"Proxy Authentication Required"
;
52
case
PreconditionFailed
:
53
return
"Precondition Failed"
;
54
case
InternalServerError
:
55
return
"Internal Server Error"
;
56
case
ProxyError
:
57
return
"Proxy Error"
;
58
case
ServiceUnavailable
:
59
return
"Service Unavailable"
;
60
default
:
61
return
""
;
62
}
63
}
64
}
// namespace openvpn::HTTP::Status
65
66
#endif
openvpn::HTTP::Status
Definition
status.hpp:17
openvpn::HTTP::Status::InternalServerError
@ InternalServerError
Definition
status.hpp:29
openvpn::HTTP::Status::SwitchingProtocols
@ SwitchingProtocols
Definition
status.hpp:22
openvpn::HTTP::Status::BadRequest
@ BadRequest
Definition
status.hpp:23
openvpn::HTTP::Status::Forbidden
@ Forbidden
Definition
status.hpp:25
openvpn::HTTP::Status::OK
@ OK
Definition
status.hpp:20
openvpn::HTTP::Status::NotFound
@ NotFound
Definition
status.hpp:26
openvpn::HTTP::Status::ProxyAuthenticationRequired
@ ProxyAuthenticationRequired
Definition
status.hpp:27
openvpn::HTTP::Status::Unauthorized
@ Unauthorized
Definition
status.hpp:24
openvpn::HTTP::Status::ServiceUnavailable
@ ServiceUnavailable
Definition
status.hpp:31
openvpn::HTTP::Status::PreconditionFailed
@ PreconditionFailed
Definition
status.hpp:28
openvpn::HTTP::Status::ProxyError
@ ProxyError
Definition
status.hpp:30
openvpn::HTTP::Status::Connected
@ Connected
Definition
status.hpp:21
openvpn::HTTP::Status::to_string
const char * to_string(const int status)
Definition
status.hpp:34
openvpn
http
status.hpp
Generated by
1.9.8