2014-08-11 03:07:22 +02:00
|
|
|
// OpenVPN -- An application to securely tunnel IP networks
|
|
|
|
// over a single port, with support for SSL/TLS-based
|
|
|
|
// session authentication and key exchange,
|
|
|
|
// packet encryption, packet authentication, and
|
|
|
|
// packet compression.
|
|
|
|
//
|
2022-09-29 11:41:13 +02:00
|
|
|
// Copyright (C) 2012-2022 OpenVPN Inc.
|
2014-08-11 03:07:22 +02:00
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
2017-12-21 21:42:20 +01:00
|
|
|
// it under the terms of the GNU Affero General Public License Version 3
|
2014-08-11 03:07:22 +02:00
|
|
|
// as published by the Free Software Foundation.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2017-12-21 21:42:20 +01:00
|
|
|
// GNU Affero General Public License for more details.
|
2014-08-11 03:07:22 +02:00
|
|
|
//
|
2017-12-21 21:42:20 +01:00
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
2014-08-11 03:07:22 +02:00
|
|
|
// along with this program in the COPYING file.
|
|
|
|
// If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
#ifndef OPENVPN_HTTP_STATUS_H
|
|
|
|
#define OPENVPN_HTTP_STATUS_H
|
|
|
|
|
|
|
|
// HTTP status codes
|
|
|
|
|
|
|
|
namespace openvpn {
|
|
|
|
namespace HTTP {
|
|
|
|
namespace Status {
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
OK = 200,
|
|
|
|
Connected = 200,
|
2017-08-19 08:13:05 +02:00
|
|
|
SwitchingProtocols = 101,
|
2015-06-28 00:25:24 +02:00
|
|
|
BadRequest = 400,
|
2015-07-05 00:00:05 +02:00
|
|
|
Unauthorized = 401,
|
2014-08-11 03:07:22 +02:00
|
|
|
Forbidden = 403,
|
|
|
|
NotFound = 404,
|
|
|
|
ProxyAuthenticationRequired = 407,
|
2015-09-02 12:13:57 +02:00
|
|
|
PreconditionFailed = 412,
|
2015-04-22 23:42:46 +02:00
|
|
|
InternalServerError = 500,
|
2014-08-11 03:07:22 +02:00
|
|
|
ProxyError = 502,
|
|
|
|
ServiceUnavailable = 503,
|
|
|
|
};
|
2015-04-19 03:10:47 +02:00
|
|
|
|
|
|
|
inline const char *to_string(const int status)
|
|
|
|
{
|
|
|
|
switch (status)
|
|
|
|
{
|
|
|
|
case OK:
|
|
|
|
return "OK";
|
2017-08-19 08:13:05 +02:00
|
|
|
case SwitchingProtocols:
|
|
|
|
return "Switching Protocols";
|
2015-06-28 00:25:24 +02:00
|
|
|
case BadRequest:
|
2015-06-28 08:33:16 +02:00
|
|
|
return "Bad Request";
|
2015-07-05 00:00:05 +02:00
|
|
|
case Unauthorized:
|
|
|
|
return "Unauthorized";
|
2015-04-19 03:10:47 +02:00
|
|
|
case Forbidden:
|
|
|
|
return "Forbidden";
|
|
|
|
case NotFound:
|
|
|
|
return "Not Found";
|
|
|
|
case ProxyAuthenticationRequired:
|
|
|
|
return "Proxy Authentication Required";
|
2015-09-02 12:13:57 +02:00
|
|
|
case PreconditionFailed:
|
|
|
|
return "Precondition Failed";
|
2015-04-22 23:42:46 +02:00
|
|
|
case InternalServerError:
|
|
|
|
return "Internal Server Error";
|
2015-04-19 03:10:47 +02:00
|
|
|
case ProxyError:
|
|
|
|
return "Proxy Error";
|
|
|
|
case ServiceUnavailable:
|
|
|
|
return "Service Unavailable";
|
|
|
|
default:
|
|
|
|
return "";
|
2014-08-11 03:07:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace Status
|
|
|
|
} // namespace HTTP
|
|
|
|
} // namespace openvpn
|
|
|
|
|
|
|
|
#endif
|