Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

http.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005, 2006 by KoanLogic s.r.l. <http://www.koanlogic.com>
00003  * All rights reserved.
00004  *
00005  * This file is part of KLone, and as such it is subject to the license stated
00006  * in the LICENSE file which you have received as part of this distribution.
00007  *
00008  * $Id: http.h,v 1.12 2007/10/25 20:26:56 tat Exp $
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_INTERNAL_SERVER_ERROR     = 500,
00056     HTTP_STATUS_NOT_IMPLEMENTED           = 501,
00058     HTTP_STATUS_BAD_GATEWAY               = 502,
00060     HTTP_STATUS_SERVICE_UNAVAILABLE       = 503 
00062 };
00063 
00065 enum http_method_e
00066 { 
00067     HM_UNKNOWN,   
00068     HM_GET,       
00069     HM_HEAD,      
00070     HM_POST,      
00071     HM_PUT,       
00072     HM_DELETE     
00073 };
00074 
00075 struct http_s;
00076 typedef struct http_s http_t;
00077 
00078 struct session_opt_s;
00079 struct request_s;
00080 
00081 u_config_t *http_get_config(http_t* http);
00082 struct session_opt_s *http_get_session_opt(http_t* http);
00083 
00084 const char *http_vhost_config_value(http_t *h, struct request_s *rq, 
00085         const char *key);
00086 int http_get_vhost_config(http_t *h, struct request_s *rq, u_config_t **pc);
00087 int http_alias_resolv(http_t *h, struct request_s *rq, char *dst, 
00088         const char *uri, size_t sz);
00089 const char* http_get_status_desc(int status);
00090 
00091 #ifdef __cplusplus
00092 }
00093 #endif 
00094 
00095 #endif