2 * "$Id: client.h 6503 2007-05-01 23:06:44Z mike $"
4 * Client definitions for the Common UNIX Printing System (CUPS) scheduler.
6 * Copyright 1997-2007 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
25 #ifdef HAVE_AUTHORIZATION_H
26 # include <Security/Authorization.h>
27 #endif /* HAVE_AUTHORIZATION_H */
30 * HTTP client structure...
35 http_t http
; /* HTTP client connection */
36 ipp_t
*request
, /* IPP request information */
37 *response
; /* IPP response information */
38 cupsd_location_t
*best
; /* Best match for AAA */
39 time_t start
; /* Request start time */
40 http_state_t operation
; /* Request operation */
41 off_t bytes
; /* Bytes transferred for this request */
42 char username
[33], /* Username from Authorization: line */
43 password
[33], /* Password from Authorization: line */
45 /* Localized URL/URI for GET/PUT */
46 *filename
, /* Filename of output file */
47 *command
, /* Command to run */
48 *options
, /* Options for command */
49 *query_string
; /* QUERY_STRING environment variable */
50 int file
; /* Input/output file */
51 int file_ready
; /* Input ready on file/pipe? */
52 int pipe_pid
; /* Pipe process ID (or 0 if not a pipe) */
53 int sent_header
, /* Non-zero if sent HTTP header */
54 got_fields
, /* Non-zero if all fields seen */
55 field_col
; /* Column within line */
56 cups_lang_t
*language
; /* Language to use */
58 int auto_ssl
; /* Automatic test for SSL/TLS */
60 http_addr_t clientaddr
; /* Client address */
61 char servername
[256];/* Server name for connection */
62 int serverport
; /* Server port for connection */
64 int no_negotiate
; /* Don't offer WWW-Authenticate: Negotiate */
65 gss_buffer_desc gss_output_token
;
66 /* Output token for Negotiate header */
67 gss_cred_id_t gss_delegated_cred
;
68 /* Credentials from client header */
69 #endif /* HAVE_GSSAPI */
70 #ifdef HAVE_AUTHORIZATION_H
71 AuthorizationRef authref
; /* Authorization ref */
72 #endif /* HAVE_AUTHORIZATION_H */
75 #define HTTP(con) &((con)->http)
79 * HTTP listener structure...
84 int fd
; /* File descriptor for this server */
85 http_addr_t address
; /* Bind address of socket */
86 http_encryption_t encryption
; /* To encrypt or not to encrypt... */
94 VAR
int ListenBackLog
VALUE(SOMAXCONN
),
95 /* Max backlog of pending connections */
97 /* Local port to use */
98 VAR http_encryption_t LocalEncryption
VALUE(HTTP_ENCRYPT_IF_REQUESTED
);
99 /* Local port encryption to use */
100 VAR cups_array_t
*Listeners
VALUE(NULL
);
101 /* Listening sockets */
102 VAR cups_array_t
*Clients
VALUE(NULL
);
104 VAR http_addrlist_t
*ServerAddrs
VALUE(NULL
);
105 /* Server address(es) */
106 VAR
char *ServerHeader
VALUE(NULL
);
107 /* Server header in requests */
108 VAR
int CGIPipes
[2] VALUE2(-1,-1);
109 /* Pipes for CGI error/debug output */
110 VAR cupsd_statbuf_t
*CGIStatusBuffer
VALUE(NULL
);
111 /* Status buffer for pipes */
118 extern void cupsdAcceptClient(cupsd_listener_t
*lis
);
119 extern void cupsdCloseAllClients(void);
120 extern int cupsdCloseClient(cupsd_client_t
*con
);
121 extern void cupsdDeleteAllListeners(void);
122 extern int cupsdFlushHeader(cupsd_client_t
*con
);
123 extern void cupsdPauseListening(void);
124 extern int cupsdProcessIPPRequest(cupsd_client_t
*con
);
125 extern void cupsdReadClient(cupsd_client_t
*con
);
126 extern void cupsdResumeListening(void);
127 extern int cupsdSendCommand(cupsd_client_t
*con
, char *command
,
128 char *options
, int root
);
129 extern int cupsdSendError(cupsd_client_t
*con
, http_status_t code
,
131 extern int cupsdSendHeader(cupsd_client_t
*con
, http_status_t code
,
132 char *type
, int auth_type
);
133 extern void cupsdShutdownClient(cupsd_client_t
*con
);
134 extern void cupsdStartListening(void);
135 extern void cupsdStopListening(void);
136 extern void cupsdUpdateCGI(void);
137 extern void cupsdWriteClient(cupsd_client_t
*con
);
141 * End of "$Id: client.h 6503 2007-05-01 23:06:44Z mike $".