From dbbf162dc9be0aef47f2d1f1fcddb7ae4e074d47 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 28 Apr 2004 20:59:48 +0000 Subject: Tons of fixes, debugging, changes, added apache module --- daemon/httpauthd.h | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'daemon/httpauthd.h') diff --git a/daemon/httpauthd.h b/daemon/httpauthd.h index 95187be..cd1d39e 100644 --- a/daemon/httpauthd.h +++ b/daemon/httpauthd.h @@ -177,16 +177,29 @@ ha_handler_t; -struct ha_options; +typedef struct ha_options +{ + /* Basic options */ + unsigned int types; + int cache_timeout; + int cache_max; + + /* For basic and digest auth: */ + const char* realm; + + /* For digest auth: */ + int digest_ignoreuri; + const char* digest_domains; + const char* digest_debugnonce; +} +ha_options_t; /* Context passed to the handler functions below */ typedef struct ha_context { const char* name; /* A name assigned by the configuration file */ ha_handler_t* handler; /* The original handler structure */ - unsigned int types; /* The types of authentication allowed */ - int cache_timeout; /* Timeout for cached connections */ - int cache_max; /* Maximum amount of cached connections */ + ha_options_t opts; /* The options */ void* data; /* Handler specific data */ } ha_context_t; @@ -202,7 +215,7 @@ ha_context_t; * should be no need to change it unless we're * adding or removing commands */ -#define MAX_ARGS 4 +#define HA_MAX_ARGS 4 /* * The maximum number of pertinent headers to read @@ -211,13 +224,13 @@ ha_context_t; * of valid headers in httpauthd.c */ -#define MAX_HEADERS 2 +#define HA_MAX_HEADERS 2 /* * The maximum number of handlers. If you add * handlers make sure to update this number. */ -#define MAX_HANDLERS 4 +#define HA_MAX_HANDLERS 4 /* A single header in memory */ @@ -241,8 +254,8 @@ ha_header_t; typedef struct ha_request { int type; - const char* args[MAX_ARGS]; - ha_header_t headers[MAX_HEADERS]; + const char* args[HA_MAX_ARGS]; + ha_header_t headers[HA_MAX_HEADERS]; } ha_request_t; @@ -250,7 +263,7 @@ ha_request_t; #define HA_SERVER_READY 100 #define HA_SERVER_ACCEPT 200 #define HA_SERVER_DECLINE 401 -#define HA_SERVER_BADREQ 402 +#define HA_SERVER_BADREQ 400 #define HA_SERVER_BUSY 500 /* A response to the client */ @@ -258,7 +271,7 @@ typedef struct ha_response { int code; const char* detail; - ha_header_t headers[MAX_HEADERS]; + ha_header_t headers[HA_MAX_HEADERS]; } ha_response_t; -- cgit v1.2.3