typedef struct client_str
{
struct client_str *next;
http_t http;
ipp_t *request,
*response;
time_t start;
http_state_t operation;
int bytes;
char username[33],
password[33],
uri[HTTP_MAX_URI],
*filename,
*command,
*options;
int file;
int file_ready;
int pipe_pid;
int got_fields,
field_col;
cups_lang_t *language;
} client_t;
#define HTTP(con) &((con)->http)
typedef struct
{
int fd;
struct sockaddr_in address;
http_encryption_t encryption;
} listener_t;
VAR int ListenBackLog VALUE(SOMAXCONN),
LocalPort VALUE(631);
VAR http_encryption_t LocalEncryption VALUE(HTTP_ENCRYPT_IF_REQUESTED);
VAR int NumListeners VALUE(0);
VAR listener_t *Listeners VALUE(NULL);
VAR int NumClients VALUE(0);
VAR client_t *Clients VALUE(NULL);
VAR struct sockaddr_in ServerAddr;
VAR char *ServerHeader VALUE(NULL);
VAR int CGIPipes[2] VALUE2(-1,-1);
#ifdef HAVE_CDSASSL
extern void cupsd_cdsa_init(void);
extern CFTypeID (*SecIdentityGetTypeIDProc)(void);
extern OSStatus (*SecIdentitySearchCopyNextProc)(SecIdentitySearchRef searchRef, SecIdentityRef *identity);
extern OSStatus (*SecIdentitySearchCreateProc)(CFTypeRef keychainOrArray, CSSM_KEYUSE keyUsage, SecIdentitySearchRef *searchRef);
extern OSStatus (*SecKeychainOpenProc)(const char *pathName, SecKeychainRef *keychain);
#endif
extern void AcceptClient(listener_t *lis);
extern void CloseAllClients(void);
extern int CloseClient(client_t *con);
extern int EncryptClient(client_t *con);
extern int IsCGI(client_t *con, const char *filename,
struct stat *filestats, mime_type_t *type);
extern void PauseListening(void);
extern int ProcessIPPRequest(client_t *con);
extern int ReadClient(client_t *con);
extern void ResumeListening(void);
extern int SendCommand(client_t *con, char *command, char *options);
extern int SendError(client_t *con, http_status_t code);
extern int SendFile(client_t *con, http_status_t code, char *filename,
char *type, struct stat *filestats);
extern int SendHeader(client_t *con, http_status_t code, char *type);
extern void ShutdownClient(client_t *con);
extern void StartListening(void);
extern void StopListening(void);
extern void UpdateCGI(void);
extern int WriteClient(client_t *con);