1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
|
/********************************************************************
* $Author: lindner $
* $Revision: 3.25 $
* $Date: 1995/09/26 04:59:46 $
* $Source: /home/arcwelder/GopherSrc/CVS/gopher+/gopherd/gopherdconf.h,v $
* $State: Exp $
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: gopherdconf.h
* Header file for routines in gopherdconf.c
*********************************************************************
* Revision History:
* $Log: gopherdconf.h,v $
* Revision 3.25 1995/09/26 04:59:46 lindner
* Fix abort routines, change to Die/Warn hash over access routines..
*
* Revision 3.24 1995/09/25 05:02:37 lindner
* Convert to ANSI C
*
* Revision 3.23 1995/08/30 20:13:14 lindner
* Remove tixfile
*
* Revision 3.22 1995/07/29 04:39:38 lindner
* Smaller struct for sites with no authentication
*
* Revision 3.21 1995/06/30 20:33:30 lindner
* Add group authentication
*
* Revision 3.20 1995/04/15 07:14:00 lindner
* Add http port to gopherd.conf
*
* Revision 3.19 1995/02/13 19:07:06 lindner
* Add MaxConnection limit for total server
*
* Revision 3.18 1995/02/11 06:21:27 lindner
* remove pid junk
*
* Revision 3.17 1994/12/15 17:33:20 lindner
* Add BlockScript: keyword support
*
* Revision 3.16 1994/08/18 22:28:47 lindner
* Abstract for top level and malloc casts
*
* Revision 3.15 1994/07/22 22:56:19 lindner
* More NO_AUTH stuff..
*
* Revision 3.14 1994/07/22 22:32:28 lindner
* fix num args
*
* Revision 3.13 1994/07/22 22:29:01 lindner
* Remove tix.h
*
* Revision 3.12 1994/07/21 17:23:06 lindner
* Add File Separator code
*
* Revision 3.11 1994/06/29 05:30:10 lindner
* Add code to handle lists of authscripts and authitems
*
* Revision 3.10 1994/03/17 04:31:01 lindner
* Many, many parameter additions
*
* Revision 3.9 1994/03/08 15:56:03 lindner
* gcc -Wall fixes
*
* Revision 3.8 1994/01/21 03:59:54 lindner
* Add support for Timezone
*
* Revision 3.7 1993/09/30 17:05:15 lindner
* start of subconf
*
* Revision 3.6 1993/09/21 04:16:52 lindner
* Move cache settings into gopherd.conf
*
* Revision 3.5 1993/08/23 19:37:32 lindner
* Add a semicolon
*
* Revision 3.4 1993/08/23 18:46:20 lindner
* Crude addition of a veronica top-level block
*
* Revision 3.3 1993/08/20 18:03:11 lindner
* Mods to allow gopherd.conf files control ftp gateway access
*
* Revision 3.2 1993/03/24 20:25:46 lindner
* Addition for secureusers file
*
* Revision 3.1.1.1 1993/02/11 18:02:52 lindner
* Gopher+1.2beta release
*
* Revision 1.2 1993/01/30 23:57:44 lindner
* Added macros for Geog and Lang
*
* Revision 1.1 1992/12/10 23:13:27 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifndef GOPHERDCONF_H
#define GOPHERDCONF_H
#include "boolean.h"
#include "STRstring.h"
#include "STAarray.h"
#include "ext.h" /** Filename extensions **/
#include "site.h" /** Hostname/IP security **/
#include "AUTH.h" /** Username/pw security */
/**************************************************************************
* A structure that defines all the changable parameters of a gopher server
* Read from the file gopherd.conf
*/
struct gdconf_struct {
ExtArray *Extensions; /* Filename extensions */
#ifndef NO_AUTHENTICATION
SiteArray *Sites; /* IPnum/hostname based security */
AUTHarray *Authroutines; /* Authentication routines/scripts */
AUTHITEMS *Authitems; /* list of items to authenticate */
String *groupdir; /* directory where group files exist */
String *Serverpw; /* The internal server password */
Accesslevel Defaccess; /* Default access level for unknowns **/
#endif
boolean RunFromInetd; /* -I option **/
boolean Caching; /* -C option **/
int Cachetime; /* Cachetime: ***/
String *Logfile; /* The filename for the logfile **/
String *Errorfile; /* The filename for the Errorfile **/
String *BummerMsg; /* Message given to non-secure sites **/
String *Data_Dir; /* Where our data directory is **/
String *Hostname; /* A FQDN for the host **/
int Port; /* The Port we're running at **/
boolean chroot; /* Are we chroot()ing? **/
boolean Securityon; /* Are we restricting access or not? **/
String *Admin; /* Administrator info **/
String *AdminEmail; /* E-mail address of administrator **/
String *Site; /* Description of site **/
String *Org; /* Name of Organization **/
String *Loc; /* Location of site **/
String *Geog; /* Latitude and Longitude **/
String *Lang; /* Default language ***/
double MaxLoad; /* Maximum Load Average ***/
int TZ; /* Timezone **/
String *TimeZoneText; /* Timezone in Text Format ***/
boolean VeronicaIndex; /* Index it or not? **/
String *Abstract; /* The abstract for the server */
StrArray *other_dirs; /* Subdirectories ***/
StrArray *other_gdcs; /* The associated gdc file ***/
StrArray *FileSeparators; /* Separators for Multipart files */
StrArray *BlkScriptBlocks;/* Block Names for block generation */
StrArray *BlkScripts; /* Associated Script to run for Block */
int MaxConnections; /* # of connections we can handle.. */
int HTTPport; /* Port to use for HTTP connections */
};
typedef struct gdconf_struct GDCobj;
#define GDCgetDefAccess(a) ((a)->Defaccess)
#define GDCgetInetdActive(a) ((a)->RunFromInetd)
#define GDCsetInetdActive(a,b) ((a)->RunFromInetd=(b))
#define GDCgetCaching(a) ((a)->Caching)
#define GDCsetCaching(a,b) ((a)->Caching=(b))
#define GDCgetCachetime(a) ((a)->Cachetime)
#define GDCsetCachetime(a,b) ((a)->Cachetime=(b))
#define GDCgetLogfile(a) STRget((a)->Logfile)
#define GDCsetLogfile(a,b) STRset((a)->Logfile,(b))
#define GDCgetErrorfile(a) STRget((a)->Errorfile)
#define GDCsetErrorfile(a,b) STRset((a)->Errorfile,(b))
#define GDCgetDatadir(a) STRget((a)->Data_Dir)
#define GDCgetHostname(a) STRget((a)->Hostname)
#define GDCsetHostname(a,b) STRset((a)->Hostname,(b))
#define GDCgetPort(a) ((a)->Port)
#define GDCgetchroot(a) ((a)->chroot)
#define GDCgetBummerMsg(a) STRget((a)->BummerMsg)
#define GDCsetBummerMsg(a,b) STRset((a)->BummerMsg,(b))
#define GDCgetAdmin(a) STRget((a)->Admin)
#define GDCsetAdmin(a,b) STRset((a)->Admin,(b))
#define GDCgetAdminEmail(a) STRget((a)->AdminEmail)
#define GDCsetAdminEmail(a,b) STRset((a)->AdminEmail,(b))
#define GDCgetSite(a) STRget((a)->Site)
#define GDCsetSite(a,b) STRset((a)->Site,(b))
#define GDCgetOrg(a) STRget((a)->Org)
#define GDCsetOrg(a,b) STRset((a)->Org,(b))
#define GDCgetLoc(a) STRget((a)->Loc)
#define GDCsetLoc(a,b) STRset((a)->Loc,(b))
#define GDCsetGeog(a,b) STRset((a)->Geog,(b))
#define GDCgetGeog(a) STRget((a)->Geog)
#define GDCgetLang(a) STRget((a)->Lang)
#define GDCsetLang(a,b) STRset((a)->Lang,(b))
#define GDCgetTixfile(a) STRget((a)->Tixfile)
#define GDCsetTixfile(a,b) STRset((a)->Tixfile,(b))
#define GDCgetShouldIndex(a) ((a)->VeronicaIndex)
#define GDCsetShouldIndex(a,b) ((a)->VeronicaIndex=(b))
#define GDCgetOtherGDCpath(a,b) (STAgetText((a)->other_dirs,(b)))
#define GDCgetOtherGDCconf(a,b) (STAgetText((a)->other_gdcs,(b)))
#define GDCgetTZ(a) (a)->TZ
#define GDCsetTZ(a,b) ((a)->TZ=(b))
#define GDCgetTimeZone(a) STRget((a)->TimeZoneText)
#define GDCsetTimeZone(a,b) STRset((a)->TimeZoneText,(b))
#define GDCgetMaxLoad(a) (a)->MaxLoad
#define GDCsetMaxLoad(a,b) ((a)->MaxLoad=(b))
#define GDCgetPW(a) (STRget((a)->Serverpw))
#define GDCsetPW(a,b) (STRset((a)->Serverpw,(b)))
#define GDCgetAbstract(a) (STRget((a)->Abstract))
#define GDCsetAbstract(a,b) (STRset((a)->Abstract,(b)))
#define GDCgetFileSep(a,b) (STAgetText((a)->FileSeparators,(b)))
#define GDCgetNumFileSep(a) (STAgetTop((a)->FileSeparators))
#define GDCnumBlkScripts(a) (STAgetTop((a)->BlkScripts))
#define GDCgetBlkName(a,b) (STAgetText((a)->BlkScriptBlocks,(b)))
#define GDCgetBlkScript(a,b) (STAgetText((a)->BlkScripts,(b)))
#define GDCgetMaxconns(a) ((a)->MaxConnections)
#define GDCsetMaxconns(a,b) ((a)->MaxConnections=(b))
#define GDCgetHTTPport(a) ((a)->HTTPport)
#define GDCsetHTTPport(a,b) ((a)->HTTPport = (b))
#define GDCgetGroupdir(a) (STRget((a)->groupdir))
#define GDCsetGroupdir(a,b) (STRset((a)->groupdir,(b)))
/*
* Real live functions in gopherdconf.c
*/
GDCobj *GDCnew();
void GDCdestroy(GDCobj *gdc);
boolean GDCignore(GDCobj *, char *);
#ifndef NO_AUTHENTICATION
AccessResult GDCaccess(GDCobj *, char *, char *, int, Accesslevel);
char *GDCauthType(GDCobj*, char*);
char *GDCauthExtraArgs(GDCobj*, char*);
AUTHresult GDCvalidate(GDCobj*, char*, char*, char*, char*, char*,
char*);
char **GDCauthAsk(GDCobj*, char*);
#else
# define GDCCanRead(a,b,c,d) (SITE_OK)
# define GDCCanBrowse(a,b,c,d) (SITE_OK)
# define GDCCanSearch(a,b,c,d) (SITE_OK)
# define GDCCanFTP(a,b,c,d) (SITE_OK)
# define GDCauthType(a,b) (NULL)
# define GDCvalidate(a,b,c,d,e,f) (AUTHRES_OK)
# define GDCauthAsk(a,b) (NULL)
#endif
void GDCpushOtherGDC(GDCobj *, char *, char*);
void GDCaddFileSep(GDCobj *, char*);
void GDCpushBlockScript(GDCobj *, char*, char*);
#endif /* GOPHERDCONF_H */
|