http.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_HTTP_H_
00012 #define _KLONE_HTTP_H_
00013
00014 #include <u/libu.h>
00015
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019
00023 enum {
00024 HTTP_STATUS_EMPTY = 0,
00026 HTTP_STATUS_OK = 200,
00028 HTTP_STATUS_CREATED = 201,
00030 HTTP_STATUS_ACCEPTED = 202,
00032 HTTP_STATUS_NO_CONTENT = 204,
00034 HTTP_STATUS_MOVED_PERMANENTLY = 301,
00036 HTTP_STATUS_MOVED_TEMPORARILY = 302,
00038 HTTP_STATUS_NOT_MODIFIED = 304,
00040 HTTP_STATUS_BAD_REQUEST = 400,
00042 HTTP_STATUS_UNAUTHORIZED = 401,
00044 HTTP_STATUS_FORBIDDEN = 403,
00046 HTTP_STATUS_NOT_FOUND = 404,
00048 HTTP_STATUS_REQUEST_TIMEOUT = 408,
00050 HTTP_STATUS_LENGTH_REQUIRED = 411,
00052 HTTP_STATUS_REQUEST_TOO_LARGE = 413,
00054 HTTP_STATUS_EXT_KEY_NEEDED = 430,
00056 HTTP_STATUS_INTERNAL_SERVER_ERROR = 500,
00058 HTTP_STATUS_NOT_IMPLEMENTED = 501,
00060 HTTP_STATUS_BAD_GATEWAY = 502,
00062 HTTP_STATUS_SERVICE_UNAVAILABLE = 503
00064 };
00065
00067 enum http_method_e
00068 {
00069 HM_UNKNOWN,
00070 HM_GET,
00071 HM_HEAD,
00072 HM_POST,
00073 HM_PUT,
00074 HM_DELETE
00075 };
00076
00077 struct http_s;
00078 typedef struct http_s http_t;
00079
00080 struct session_opt_s;
00081 struct request_s;
00082 struct vhost_s;
00083
00084 u_config_t *http_get_config(http_t* http);
00085 struct session_opt_s *http_get_session_opt(http_t* http);
00086
00087 struct vhost_s* http_get_vhost(http_t *h, struct request_s *rq);
00088 struct vhost_list_s* http_get_vhost_list(http_t *h);
00089 int http_alias_resolv(http_t *h, struct request_s *rq, char *dst,
00090 const char *uri, size_t sz);
00091 const char* http_get_status_desc(int status);
00092
00093 #ifdef __cplusplus
00094 }
00095 #endif
00096
00097 #endif