#ifdef HAVE_AUTHORIZATION_H
# include <Security/Authorization.h>
#endif
struct cupsd_client_s
{
http_t http;
ipp_t *request,
*response;
cupsd_location_t *best;
struct timeval start;
http_state_t operation;
off_t bytes;
int type;
char username[HTTP_MAX_VALUE],
password[HTTP_MAX_VALUE],
uri[HTTP_MAX_URI],
*filename,
*command,
*options,
*query_string;
int file;
int file_ready;
int pipe_pid;
int sent_header,
got_fields,
header_used;
char header[2048];
cups_lang_t *language;
#ifdef HAVE_SSL
int auto_ssl;
#endif
http_addr_t clientaddr;
char servername[256];
int serverport;
#ifdef HAVE_GSSAPI
int have_gss;
uid_t gss_uid;
#endif
#ifdef HAVE_AUTHORIZATION_H
AuthorizationRef authref;
#endif
};
#define HTTP(con) &((con)->http)
typedef struct
{
int fd;
http_addr_t address;
http_encryption_t encryption;
} cupsd_listener_t;
VAR int ListenBackLog VALUE(SOMAXCONN),
LocalPort VALUE(631),
RemotePort VALUE(0);
VAR http_encryption_t LocalEncryption VALUE(HTTP_ENCRYPT_IF_REQUESTED);
VAR cups_array_t *Listeners VALUE(NULL);
VAR time_t ListeningPaused VALUE(0);
VAR cups_array_t *Clients VALUE(NULL),
*ActiveClients VALUE(NULL);
VAR char *ServerHeader VALUE(NULL);
VAR int CGIPipes[2] VALUE2(-1,-1);
VAR cupsd_statbuf_t *CGIStatusBuffer VALUE(NULL);
extern void cupsdAcceptClient(cupsd_listener_t *lis);
extern void cupsdCloseAllClients(void);
extern int cupsdCloseClient(cupsd_client_t *con);
extern void cupsdDeleteAllListeners(void);
extern int cupsdFlushHeader(cupsd_client_t *con);
extern void cupsdPauseListening(void);
extern int cupsdProcessIPPRequest(cupsd_client_t *con);
extern void cupsdReadClient(cupsd_client_t *con);
extern void cupsdResumeListening(void);
extern int cupsdSendCommand(cupsd_client_t *con, char *command,
char *options, int root);
extern int cupsdSendError(cupsd_client_t *con, http_status_t code,
int auth_type);
extern int cupsdSendHeader(cupsd_client_t *con, http_status_t code,
char *type, int auth_type);
extern void cupsdShutdownClient(cupsd_client_t *con);
extern void cupsdStartListening(void);
extern void cupsdStopListening(void);
extern void cupsdUpdateCGI(void);
extern void cupsdWriteClient(cupsd_client_t *con);
#ifdef HAVE_SSL
extern int cupsdEndTLS(cupsd_client_t *con);
extern int cupsdStartTLS(cupsd_client_t *con);
#endif