2 * "$Id: client.h 5889 2006-08-24 21:44:35Z mike $"
4 * Client definitions for the Common UNIX Printing System (CUPS) scheduler.
6 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
26 * HTTP client structure...
31 http_t http
; /* HTTP client connection */
32 ipp_t
*request
, /* IPP request information */
33 *response
; /* IPP response information */
34 cupsd_location_t
*best
; /* Best match for AAA */
35 time_t start
; /* Request start time */
36 http_state_t operation
; /* Request operation */
37 off_t bytes
; /* Bytes transferred for this request */
38 char username
[33], /* Username from Authorization: line */
39 password
[33], /* Password from Authorization: line */
41 /* Localized URL/URI for GET/PUT */
42 *filename
, /* Filename of output file */
43 *command
, /* Command to run */
44 *options
; /* Options for command */
45 int file
; /* Input/output file */
46 int file_ready
; /* Input ready on file/pipe? */
47 int pipe_pid
; /* Pipe process ID (or 0 if not a pipe) */
48 int sent_header
, /* Non-zero if sent HTTP header */
49 got_fields
, /* Non-zero if all fields seen */
50 field_col
; /* Column within line */
51 cups_lang_t
*language
; /* Language to use */
53 int auto_ssl
; /* Automatic test for SSL/TLS */
55 http_addr_t clientaddr
; /* Client address */
56 char servername
[256];/* Server name for connection */
57 int serverport
; /* Server port for connection */
60 #define HTTP(con) &((con)->http)
64 * HTTP listener structure...
69 int fd
; /* File descriptor for this server */
70 http_addr_t address
; /* Bind address of socket */
71 http_encryption_t encryption
; /* To encrypt or not to encrypt... */
79 VAR
int ListenBackLog
VALUE(SOMAXCONN
),
80 /* Max backlog of pending connections */
82 /* Local port to use */
83 VAR http_encryption_t LocalEncryption
VALUE(HTTP_ENCRYPT_IF_REQUESTED
);
84 /* Local port encryption to use */
85 VAR cups_array_t
*Listeners
VALUE(NULL
);
86 /* Listening sockets */
87 VAR cups_array_t
*Clients
VALUE(NULL
);
89 VAR http_addrlist_t
*ServerAddrs
VALUE(NULL
);
90 /* Server address(es) */
91 VAR
char *ServerHeader
VALUE(NULL
);
92 /* Server header in requests */
93 VAR
int CGIPipes
[2] VALUE2(-1,-1);
94 /* Pipes for CGI error/debug output */
95 VAR cupsd_statbuf_t
*CGIStatusBuffer
VALUE(NULL
);
96 /* Status buffer for pipes */
103 extern void cupsdAcceptClient(cupsd_listener_t
*lis
);
104 extern void cupsdCloseAllClients(void);
105 extern int cupsdCloseClient(cupsd_client_t
*con
);
106 extern void cupsdDeleteAllListeners(void);
107 extern void cupsdFlushHeader(cupsd_client_t
*con
);
108 extern void cupsdPauseListening(void);
109 extern int cupsdProcessIPPRequest(cupsd_client_t
*con
);
110 extern int cupsdReadClient(cupsd_client_t
*con
);
111 extern void cupsdResumeListening(void);
112 extern int cupsdSendCommand(cupsd_client_t
*con
, char *command
,
113 char *options
, int root
);
114 extern int cupsdSendError(cupsd_client_t
*con
, http_status_t code
);
115 extern int cupsdSendHeader(cupsd_client_t
*con
, http_status_t code
,
117 extern void cupsdShutdownClient(cupsd_client_t
*con
);
118 extern void cupsdStartListening(void);
119 extern void cupsdStopListening(void);
120 extern void cupsdUpdateCGI(void);
121 extern int cupsdWriteClient(cupsd_client_t
*con
);
125 * End of "$Id: client.h 5889 2006-08-24 21:44:35Z mike $".