vhost.h

00001 /*
00002  * Copyright (c) 2005-2012 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: vhost.h,v 1.3 2007/11/09 22:06:26 tat Exp $
00009  */
00010 
00011 #ifndef _KLONE_VHOST_H_
00012 #define _KLONE_VHOST_H_
00013 
00014 #include <u/libu.h>
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif 
00019 
00020 /* define page list */
00021 LIST_HEAD(vhost_list_s, vhost_s);
00022 
00023 struct http_s;
00024 struct klog_s;
00025 
00026 typedef struct vhost_s
00027 {
00028     LIST_ENTRY(vhost_s) np; /* next & prev pointers                          */
00029     struct http_s *http;    /* parent http object                            */
00030     struct klog_s *klog;    /* vhost logging facility                        */
00031     u_config_t *config;     /* vhost configuration                           */
00032     u_config_t *al_config;  /* cached access_log config ptr                  */
00033     const char *host;       /* hostname                                      */
00034     int id;                 /* position in the vhosts list                   */
00035 
00036     /* cached configuration options */
00037     const char *server_sig; /* server signature                              */
00038     const char *dir_root;   /* base html directory                           */
00039     const char *index;      /* user-provided index page(s)                   */
00040     int send_enc_deflate;   /* >0 if sending deflated content is not disabled*/
00041 } vhost_t;
00042 
00043 typedef struct vhost_list_s vhost_list_t;
00044 
00045 int vhost_create(vhost_t **pv);
00046 int vhost_free(vhost_t *v);
00047 
00048 int vhost_list_create(vhost_list_t **pvs);
00049 int vhost_list_free(vhost_list_t *vs);
00050 int vhost_list_add(vhost_list_t *vs, vhost_t *vhost);
00051 vhost_t* vhost_list_get_n(vhost_list_t *vs, int n);
00052 vhost_t* vhost_list_get(vhost_list_t *vs, const char *host);
00053 
00054 #ifdef __cplusplus
00055 }
00056 #endif 
00057 
00058 #endif

←Products
Copyright © 2005-2012 - KoanLogic S.r.l. - All rights reserved