Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

websmcphandler.h

Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 2005 Russell Leighton
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 
00020 
00021 
00022 #ifndef __AWHANDLER_WEBSMCP__
00023 #define __AWHANDLER_WEBSMCP__
00024 
00025 #include "monitor.h"
00026 
00027 #include "model.h"
00028 
00029 #include "hash.h"
00030 
00031 #include "wwwhandler.h"
00032 
00033 #include "pagelayout.h"
00034 
00036 /*\@{*/
00037 
00100 #define AW_WEBSMCP_MAX_CONNECTIONS_DEFAULT 256
00101 #define AW_WEBSMCP_SESSION_DEFAULT_TIMEOUT  (30 *(60 * AW_TIMESTAMP_PER_SEC))
00102 
00104 typedef struct {
00105 
00106   /* important paths */
00107   struct {
00108 
00109     byte_t *docroot; 
00110     byte_t *image  ; 
00111     byte_t *js     ; 
00112     byte_t *css;     
00113     byte_t *html;    
00115     byte_t *db;      
00117   } paths;
00118 
00119   /* describes the ui */
00120   aw_websmcphandler_layout_t
00121    page_layout;
00122 
00123   /* model options */
00124   aw_model_options_t
00125    model_options;
00126 
00127 } aw_websmcphandler_config_t;
00128 
00129 
00131 typedef struct {
00132   
00133   /* MUST BE 1st! */
00134   aw_wwwhandler_t 
00135    wwwhandler;
00136 
00137   /* systems model */
00138   aw_model_t
00139    sysmodel;
00140 
00141   /* session tracking */
00142   struct {
00143 
00144     /* authentication options */
00145     struct {
00146 
00147       /* only allow logins from single client */
00148       u_int32_t single; 
00149 
00150     } auth;
00151 
00152     /* timeout for user session */
00153     aw_timestamp_t
00154      timeout;
00155 
00156     /* maps sessionkey -> session object */
00157     aw_hash32_t
00158      *key2session;
00159 
00160     /* maps logind -> session object */
00161     aw_hashString_t
00162      *loginid2session;
00163 
00164     aw_address_t
00165      reaper_event_id;
00166 
00167   } session;
00168 
00169   aw_websmcphandler_config_t
00170    config;
00171 
00172 } aw_websmcphandler_t;
00173 
00174 
00176 typedef struct {
00177 
00178   /* controls for sessions */
00179   struct {
00180 
00181     /* authentication options */
00182     struct {
00183 
00184       /* only allow logins from single client */
00185       u_int32_t single; 
00186 
00187     } auth;
00188 
00189     /* timeout for user session */
00190     aw_timestamp_t
00191      timeout;
00192 
00193   } session ;
00194 
00195   /* model options */
00196   aw_model_options_t
00197    model_options;
00198 
00199   /* ui options */
00200   aw_websmcphandler_layout_t
00201    page_layout;
00202 
00203   /* controls events from wwwhandler */
00204   aw_wwwhandler_xtn_events_t 
00205    events; 
00206 
00207   /* ip to bind to */
00208   aw_ip_addr_t
00209    bind;
00210 
00211   /* max concurrent connections */
00212   u_int32_t
00213    max_connections;
00214 
00215 } aw_websmcphandler_options_t;
00216 
00217 
00218 
00227 aw_websmcphandler_t *aw_create_websmcphandler( u_int32_t port,
00228                                                const byte_t *dir,
00229                                                aw_websmcphandler_options_t *options,
00230                                                aw_logger_t *logger
00231                                                );
00232 
00237 void aw_free_websmcphandler(aw_websmcphandler_t *h);
00238 
00239 /*\@}*/
00240 
00241 #endif
00242 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)