statcodes.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*******************************************************************************
  2. *
  3. * Copyright (c) 2000-2003 Intel Corporation
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions are met:
  8. *
  9. * - Redistributions of source code must retain the above copyright notice,
  10. * this list of conditions and the following disclaimer.
  11. * - Redistributions in binary form must reproduce the above copyright notice,
  12. * this list of conditions and the following disclaimer in the documentation
  13. * and/or other materials provided with the distribution.
  14. * - Neither name of Intel Corporation nor the names of its contributors
  15. * may be used to endorse or promote products derived from this software
  16. * without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
  22. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  23. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  24. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  25. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  26. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  27. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. ******************************************************************************/
  31. #ifndef GENLIB_NET_HTTP_STATCODES_H
  32. #define GENLIB_NET_HTTP_STATCODES_H
  33. /* HTTP response status codes */
  34. #define HTTP_CONTINUE 100
  35. #define HTTP_SWITCHING_PROCOTOLS 101
  36. #define HTTP_OK 200
  37. #define HTTP_CREATED 201
  38. #define HTTP_ACCEPTED 202
  39. #define HTTP_NON_AUTHORATATIVE 203
  40. #define HTTP_NO_CONTENT 204
  41. #define HTTP_RESET_CONTENT 205
  42. #define HTTP_PARTIAL_CONTENT 206
  43. #define HTTP_MULTIPLE_CHOICES 300
  44. #define HTTP_MOVED_PERMANENTLY 301
  45. #define HTTP_FOUND 302
  46. #define HTTP_SEE_OTHER 303
  47. #define HTTP_NOT_MODIFIED 304
  48. #define HTTP_USE_PROXY 305
  49. #define HTTP_UNUSED_3XX 306
  50. #define HTTP_TEMPORARY_REDIRECT 307
  51. #define HTTP_BAD_REQUEST 400
  52. #define HTTP_UNAUTHORIZED 401
  53. #define HTTP_PAYMENT_REQD 402
  54. #define HTTP_FORBIDDEN 403
  55. #define HTTP_NOT_FOUND 404
  56. #define HTTP_METHOD_NOT_ALLOWED 405
  57. #define HTTP_NOT_ACCEPTABLE 406
  58. #define HTTP_PROXY_AUTH_REQD 407
  59. #define HTTP_REQUEST_TIMEOUT 408
  60. #define HTTP_CONFLICT 409
  61. #define HTTP_GONE 410
  62. #define HTTP_LENGTH_REQUIRED 411
  63. #define HTTP_PRECONDITION_FAILED 412
  64. #define HTTP_REQ_ENTITY_TOO_LARGE 413
  65. #define HTTP_REQ_URI_TOO_LONG 414
  66. #define HTTP_UNSUPPORTED_MEDIA_TYPE 415
  67. #define HTTP_REQUEST_RANGE_NOT_SATISFIABLE 416
  68. #define HTTP_EXPECTATION_FAILED 417
  69. #define HTTP_INTERNAL_SERVER_ERROR 500
  70. #define HTTP_NOT_IMPLEMENTED 501
  71. #define HTTP_BAD_GATEWAY 502
  72. #define HTTP_SERVICE_UNAVAILABLE 503
  73. #define HTTP_GATEWAY_TIMEOUT 504
  74. #define HTTP_HTTP_VERSION_NOT_SUPPORTED 505
  75. #define HTTP_VARIANT_ALSO_NEGOTIATES 506
  76. #define HTTP_INSUFFICIENT_STORAGE 507
  77. #define HTTP_LOOP_DETECTED 508
  78. #define HTTP_NOT_EXTENDED 510
  79. /* HTTP lib error codes */
  80. #define HTTP_E_OUT_OF_MEMORY -2
  81. #define HTTP_E_BAD_MSG_FORMAT -3
  82. #define HTTP_E_TIMEDOUT -4
  83. #define HTTP_E_FILE_READ -5
  84. #ifdef __cplusplus
  85. extern "C" {
  86. #endif
  87. /************************************************************************
  88. * Function: http_get_code_text
  89. *
  90. * Parameters:
  91. * int statusCode ; Status code based on which the status table and
  92. * status message is returned
  93. *
  94. * Description: Return the right status message based on the passed in
  95. * int statusCode input parameter
  96. *
  97. * Returns:
  98. * const char* ptr - pointer to the status message string
  99. ************************************************************************/
  100. const char* http_get_code_text( int statusCode );
  101. #ifdef __cplusplus
  102. } /* extern C */
  103. #endif
  104. #endif /* GENLIB_NET_HTTP_STATCODES_H */