access_control.h 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. written by
  12. Haivision Systems Inc.
  13. *****************************************************************************/
  14. #ifndef INC_F_ACCESS_CONTROL_H
  15. #define INC_F_ACCESS_CONTROL_H
  16. // A list of rejection codes that are SRT specific.
  17. #define SRT_REJX_FALLBACK 1000 // A code used in case when the application wants to report some problem, but can't precisely specify it.
  18. #define SRT_REJX_KEY_NOTSUP 1001 // The key used in the StreamID keyed string is not supported by the service.
  19. #define SRT_REJX_FILEPATH 1002 // The resource type designates a file and the path is either wrong syntax or not found
  20. #define SRT_REJX_HOSTNOTFOUND 1003 // The `h` host specification was not recognized by the service
  21. // The list of http codes adopted for SRT.
  22. // An example C++ header for HTTP codes can be found at:
  23. // https://github.com/j-ulrich/http-status-codes-cpp
  24. // Some of the unused code can be revived in the future, if there
  25. // happens to be a good reason for it.
  26. #define SRT_REJX_BAD_REQUEST 1400 // General syntax error in the SocketID specification (also a fallback code for undefined cases)
  27. #define SRT_REJX_UNAUTHORIZED 1401 // Authentication failed, provided that the user was correctly identified and access to the required resource would be granted
  28. #define SRT_REJX_OVERLOAD 1402 // The server is too heavily loaded, or you have exceeded credits for accessing the service and the resource.
  29. #define SRT_REJX_FORBIDDEN 1403 // Access denied to the resource by any kind of reason.
  30. #define SRT_REJX_NOTFOUND 1404 // Resource not found at this time.
  31. #define SRT_REJX_BAD_MODE 1405 // The mode specified in `m` key in StreamID is not supported for this request.
  32. #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.
  33. // CODE NOT IN USE 407: unused: proxy functionality not predicted
  34. // CODE NOT IN USE 408: unused: no timeout predicted for listener callback
  35. #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.
  36. // CODE NOT IN USE 410: unused: treated as a specific case of 404
  37. // CODE NOT IN USE 411: unused: no reason to include length in the protocol
  38. // CODE NOT IN USE 412: unused: preconditions not predicted in AC
  39. // CODE NOT IN USE 413: unused: AC size is already defined as 512
  40. // CODE NOT IN USE 414: unused: AC size is already defined as 512
  41. #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.
  42. // CODE NOT IN USE 416: unused: no detailed specification defined
  43. // CODE NOT IN USE 417: unused: expectations not supported
  44. // CODE NOT IN USE 418: unused: sharks do not drink tea
  45. // CODE NOT IN USE 419: not defined in HTTP
  46. // CODE NOT IN USE 420: not defined in HTTP
  47. // CODE NOT IN USE 421: unused: misdirection not supported
  48. // CODE NOT IN USE 422: unused: aligned to general 400
  49. #define SRT_REJX_LOCKED 1423 // The resource being accessed is locked for any access.
  50. #define SRT_REJX_FAILED_DEPEND 1424 // The request failed because it specified a dependent session ID that has been disconnected.
  51. // CODE NOT IN USE 425: unused: replaying not supported
  52. // CODE NOT IN USE 426: unused: tempting, but it requires resend in connected
  53. // CODE NOT IN USE 427: not defined in HTTP
  54. // CODE NOT IN USE 428: unused: renders to 409
  55. // CODE NOT IN USE 429: unused: renders to 402
  56. // CODE NOT IN USE 451: unused: renders to 403
  57. #define SRT_REJX_ISE 1500 // Unexpected internal server error
  58. #define SRT_REJX_UNIMPLEMENTED 1501 // The request was recognized, but the current version doesn't support it.
  59. #define SRT_REJX_GW 1502 // The server acts as a gateway and the target endpoint rejected the connection.
  60. #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.
  61. // CODE NOT IN USE 504: unused: timeout not supported
  62. #define SRT_REJX_VERSION 1505 // SRT version not supported. This might be either unsupported backward compatibility, or an upper value of a version.
  63. // CODE NOT IN USE 506: unused: negotiation and references not supported
  64. #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.
  65. // CODE NOT IN USE 508: unused: no redirection supported
  66. // CODE NOT IN USE 509: not defined in HTTP
  67. // CODE NOT IN USE 510: unused: extensions not supported
  68. // CODE NOT IN USE 511: unused: intercepting proxies not supported
  69. #endif