]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/client.h
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / client.h
CommitLineData
ef416fc2 1/*
b94498cf 2 * "$Id: client.h 6503 2007-05-01 23:06:44Z mike $"
ef416fc2 3 *
4 * Client definitions for the Common UNIX Printing System (CUPS) scheduler.
5 *
b94498cf 6 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 7 *
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
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 */
24
f7deaa1a 25#ifdef HAVE_AUTHORIZATION_H
26# include <Security/Authorization.h>
27#endif /* HAVE_AUTHORIZATION_H */
28
ef416fc2 29/*
30 * HTTP client structure...
31 */
32
33struct cupsd_client_s
34{
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 */
44 uri[HTTP_MAX_URI],
45 /* Localized URL/URI for GET/PUT */
46 *filename, /* Filename of output file */
47 *command, /* Command to run */
b86bc4cf 48 *options, /* Options for command */
49 *query_string; /* QUERY_STRING environment variable */
ef416fc2 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 */
57#ifdef HAVE_SSL
58 int auto_ssl; /* Automatic test for SSL/TLS */
59#endif /* HAVE_SSL */
60 http_addr_t clientaddr; /* Client address */
61 char servername[256];/* Server name for connection */
62 int serverport; /* Server port for connection */
f7deaa1a 63#ifdef HAVE_GSSAPI
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 */
ef416fc2 73};
74
75#define HTTP(con) &((con)->http)
76
77
78/*
79 * HTTP listener structure...
80 */
81
82typedef struct
83{
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... */
87} cupsd_listener_t;
88
89
90/*
91 * Globals...
92 */
93
94VAR int ListenBackLog VALUE(SOMAXCONN),
95 /* Max backlog of pending connections */
96 LocalPort VALUE(631);
97 /* Local port to use */
98VAR http_encryption_t LocalEncryption VALUE(HTTP_ENCRYPT_IF_REQUESTED);
99 /* Local port encryption to use */
bd7854cb 100VAR cups_array_t *Listeners VALUE(NULL);
ef416fc2 101 /* Listening sockets */
bd7854cb 102VAR cups_array_t *Clients VALUE(NULL);
ef416fc2 103 /* HTTP clients */
104VAR http_addrlist_t *ServerAddrs VALUE(NULL);
105 /* Server address(es) */
106VAR char *ServerHeader VALUE(NULL);
107 /* Server header in requests */
108VAR int CGIPipes[2] VALUE2(-1,-1);
109 /* Pipes for CGI error/debug output */
110VAR cupsd_statbuf_t *CGIStatusBuffer VALUE(NULL);
111 /* Status buffer for pipes */
112
113
114/*
115 * Prototypes...
116 */
117
118extern void cupsdAcceptClient(cupsd_listener_t *lis);
119extern void cupsdCloseAllClients(void);
120extern int cupsdCloseClient(cupsd_client_t *con);
bd7854cb 121extern void cupsdDeleteAllListeners(void);
07725fee 122extern int cupsdFlushHeader(cupsd_client_t *con);
ef416fc2 123extern void cupsdPauseListening(void);
124extern int cupsdProcessIPPRequest(cupsd_client_t *con);
f7deaa1a 125extern void cupsdReadClient(cupsd_client_t *con);
ef416fc2 126extern void cupsdResumeListening(void);
127extern int cupsdSendCommand(cupsd_client_t *con, char *command,
128 char *options, int root);
f899b121 129extern int cupsdSendError(cupsd_client_t *con, http_status_t code,
130 int auth_type);
ef416fc2 131extern int cupsdSendHeader(cupsd_client_t *con, http_status_t code,
f899b121 132 char *type, int auth_type);
ef416fc2 133extern void cupsdShutdownClient(cupsd_client_t *con);
134extern void cupsdStartListening(void);
135extern void cupsdStopListening(void);
136extern void cupsdUpdateCGI(void);
f7deaa1a 137extern void cupsdWriteClient(cupsd_client_t *con);
ef416fc2 138
139
140/*
b94498cf 141 * End of "$Id: client.h 6503 2007-05-01 23:06:44Z mike $".
ef416fc2 142 */