1 #ifndef HTTP_H
 2 #define HTTP_H
 3 
 4 #include "rh_buffer.h"
 5 
 6 #define NL      "\r\n"
 7 
 8 enum http_status {
 9         HTTP_STATUS_200_OK                              = 200,
10         
11         HTTP_STATUS_400_BAD_REQUEST                     = 400,
12         HTTP_STATUS_403_FORBIDDEN                       = 403,
13         HTTP_STATUS_404_NOT_FOUND                       = 404,
14         HTTP_STATUS_414_REQUEST_URI_TOO_LONG            = 414,
15         
16         HTTP_STATUS_500_INTERNAL_SERVER_ERROR           = 500,
17         HTTP_STATUS_501_NOT_IMPLEMENTED                 = 501,
18         HTTP_STATUS_503_SERVICE_UNAVAILABLE             = 503,
19         HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED      = 505
20         
21         
22 };
23 
24 enum http_method {
25         HTTP_METHOD_GET         = 1,
26         HTTP_METHOD_HEAD,
27         HTTP_METHOD_POST,
28         HTTP_METHOD_TRACE
29 };
30 
31 enum http_version {
32         HTTP_VERSION_10         = 10,
33         HTTP_VERSION_11         = 11
34 };
35 
36 typedef enum http_version       http_version_t;
37 typedef enum http_method        http_method_t;
38 typedef enum http_status        http_status_t;
39 
40 #define HTTP_ISSPACE(_ch)       ((_ch) == ' ' || (_ch) == '\t')
41 
42 #endif /* HTTP_H */


syntax highlighted by Code2HTML, v. 0.9.1