| 1 |
/* |
| 2 |
* SRT - Secure, Reliable, Transport |
| 3 |
* Copyright (c) 2020 Haivision Systems Inc. |
| 4 |
* |
| 5 |
* This Source Code Form is subject to the terms of the Mozilla Public |
| 6 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 |
* |
| 9 |
*/ |
| 10 |
|
| 11 |
/***************************************************************************** |
| 12 |
written by |
| 13 |
Haivision Systems Inc. |
| 14 |
*****************************************************************************/ |
| 15 |
|
| 16 |
#ifndef INC_F_ACCESS_CONTROL_H |
| 17 |
#define INC_F_ACCESS_CONTROL_H |
| 18 |
|
| 19 |
// A list of rejection codes that are SRT specific. |
| 20 |
|
| 21 |
#define SRT_REJX_FALLBACK 1000 // A code used in case when the application wants to report some problem, but can't precisely specify it. |
| 22 |
#define SRT_REJX_KEY_NOTSUP 1001 // The key used in the StreamID keyed string is not supported by the service. |
| 23 |
#define SRT_REJX_FILEPATH 1002 // The resource type designates a file and the path is either wrong syntax or not found |
| 24 |
#define SRT_REJX_HOSTNOTFOUND 1003 // The `h` host specification was not recognized by the service |
| 25 |
|
| 26 |
// The list of http codes adopted for SRT. |
| 27 |
// An example C++ header for HTTP codes can be found at: |
| 28 |
// https://github.com/j-ulrich/http-status-codes-cpp |
| 29 |
|
| 30 |
// Some of the unused code can be revived in the future, if there |
| 31 |
// happens to be a good reason for it. |
| 32 |
|
| 33 |
#define SRT_REJX_BAD_REQUEST 1400 // General syntax error in the SocketID specification (also a fallback code for undefined cases) |
| 34 |
#define SRT_REJX_UNAUTHORIZED 1401 // Authentication failed, provided that the user was correctly identified and access to the required resource would be granted |
| 35 |
#define SRT_REJX_OVERLOAD 1402 // The server is too heavily loaded, or you have exceeded credits for accessing the service and the resource. |
| 36 |
#define SRT_REJX_FORBIDDEN 1403 // Access denied to the resource by any kind of reason. |
| 37 |
#define SRT_REJX_NOTFOUND 1404 // Resource not found at this time. |
| 38 |
#define SRT_REJX_BAD_MODE 1405 // The mode specified in `m` key in StreamID is not supported for this request. |
| 39 |
#define SRT_REJX_UNACCEPTABLE 1406 // The requested parameters specified in SocketID cannot be satisfied for the requested resource. Also when m=publish and the data format is not acceptable. |
| 40 |
// CODE NOT IN USE 407: unused: proxy functionality not predicted |
| 41 |
// CODE NOT IN USE 408: unused: no timeout predicted for listener callback |
| 42 |
#define SRT_REJX_CONFLICT 1409 // The resource being accessed is already locked for modification. This is in case of m=publish and the specified resource is currently read-only. |
| 43 |
// CODE NOT IN USE 410: unused: treated as a specific case of 404 |
| 44 |
// CODE NOT IN USE 411: unused: no reason to include length in the protocol |
| 45 |
// CODE NOT IN USE 412: unused: preconditions not predicted in AC |
| 46 |
// CODE NOT IN USE 413: unused: AC size is already defined as 512 |
| 47 |
// CODE NOT IN USE 414: unused: AC size is already defined as 512 |
| 48 |
#define SRT_REJX_NOTSUP_MEDIA 1415 // The media type is not supported by the application. This is the `t` key that specifies the media type as stream, file and auth, possibly extended by the application. |
| 49 |
// CODE NOT IN USE 416: unused: no detailed specification defined |
| 50 |
// CODE NOT IN USE 417: unused: expectations not supported |
| 51 |
// CODE NOT IN USE 418: unused: sharks do not drink tea |
| 52 |
// CODE NOT IN USE 419: not defined in HTTP |
| 53 |
// CODE NOT IN USE 420: not defined in HTTP |
| 54 |
// CODE NOT IN USE 421: unused: misdirection not supported |
| 55 |
// CODE NOT IN USE 422: unused: aligned to general 400 |
| 56 |
#define SRT_REJX_LOCKED 1423 // The resource being accessed is locked for any access. |
| 57 |
#define SRT_REJX_FAILED_DEPEND 1424 // The request failed because it specified a dependent session ID that has been disconnected. |
| 58 |
// CODE NOT IN USE 425: unused: replaying not supported |
| 59 |
// CODE NOT IN USE 426: unused: tempting, but it requires resend in connected |
| 60 |
// CODE NOT IN USE 427: not defined in HTTP |
| 61 |
// CODE NOT IN USE 428: unused: renders to 409 |
| 62 |
// CODE NOT IN USE 429: unused: renders to 402 |
| 63 |
// CODE NOT IN USE 451: unused: renders to 403 |
| 64 |
#define SRT_REJX_ISE 1500 // Unexpected internal server error |
| 65 |
#define SRT_REJX_UNIMPLEMENTED 1501 // The request was recognized, but the current version doesn't support it. |
| 66 |
#define SRT_REJX_GW 1502 // The server acts as a gateway and the target endpoint rejected the connection. |
| 67 |
#define SRT_REJX_DOWN 1503 // The service has been temporarily taken over by a stub reporting this error. The real service can be down for maintenance or crashed. |
| 68 |
// CODE NOT IN USE 504: unused: timeout not supported |
| 69 |
#define SRT_REJX_VERSION 1505 // SRT version not supported. This might be either unsupported backward compatibility, or an upper value of a version. |
| 70 |
// CODE NOT IN USE 506: unused: negotiation and references not supported |
| 71 |
#define SRT_REJX_NOROOM 1507 // The data stream cannot be archived due to lacking storage space. This is in case when the request type was to send a file or the live stream to be archived. |
| 72 |
// CODE NOT IN USE 508: unused: no redirection supported |
| 73 |
// CODE NOT IN USE 509: not defined in HTTP |
| 74 |
// CODE NOT IN USE 510: unused: extensions not supported |
| 75 |
// CODE NOT IN USE 511: unused: intercepting proxies not supported |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
#endif |