]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/client.h
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / scheduler / client.h
CommitLineData
ef416fc2 1/*
5ec1fd3d 2 * Client definitions for the CUPS scheduler.
ef416fc2 3 *
1720786e 4 * Copyright 2007-2014 by Apple Inc.
5ec1fd3d 5 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 6 *
5ec1fd3d
MS
7 * These coded instructions, statements, and computer programs are the
8 * property of Apple Inc. and are protected by Federal copyright
9 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 * which should have been included with this file. If this file is
11 * file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 12 */
13
f7deaa1a 14#ifdef HAVE_AUTHORIZATION_H
15# include <Security/Authorization.h>
16#endif /* HAVE_AUTHORIZATION_H */
17
b19ccc9e 18
ef416fc2 19/*
20 * HTTP client structure...
21 */
22
23struct cupsd_client_s
24{
996acce8
MS
25 int number; /* Connection number */
26 http_t *http; /* HTTP client connection */
ef416fc2 27 ipp_t *request, /* IPP request information */
28 *response; /* IPP response information */
29 cupsd_location_t *best; /* Best match for AAA */
dfd5680b 30 struct timeval start; /* Request start time */
ef416fc2 31 http_state_t operation; /* Request operation */
32 off_t bytes; /* Bytes transferred for this request */
2fb76298 33 int type; /* AuthType for username */
3e7fe0ca
MS
34 char username[HTTP_MAX_VALUE],
35 /* Username from Authorization: line */
36 password[HTTP_MAX_VALUE],
37 /* Password from Authorization: line */
ef416fc2 38 uri[HTTP_MAX_URI],
39 /* Localized URL/URI for GET/PUT */
40 *filename, /* Filename of output file */
41 *command, /* Command to run */
b86bc4cf 42 *options, /* Options for command */
43 *query_string; /* QUERY_STRING environment variable */
ef416fc2 44 int file; /* Input/output file */
45 int file_ready; /* Input ready on file/pipe? */
46 int pipe_pid; /* Pipe process ID (or 0 if not a pipe) */
e200616a 47 http_status_t pipe_status; /* HTTP status from pipe process */
ef416fc2 48 int sent_header, /* Non-zero if sent HTTP header */
49 got_fields, /* Non-zero if all fields seen */
68b10830
MS
50 header_used; /* Number of header bytes used */
51 char header[2048]; /* Header from CGI program */
ef416fc2 52 cups_lang_t *language; /* Language to use */
53#ifdef HAVE_SSL
54 int auto_ssl; /* Automatic test for SSL/TLS */
55#endif /* HAVE_SSL */
996acce8 56 http_addr_t clientaddr; /* Client's server address */
f2534050
MS
57 char clientname[256];/* Client's server name for connection */
58 int clientport; /* Client's server port for connection */
ef416fc2 59 char servername[256];/* Server name for connection */
60 int serverport; /* Server port for connection */
f7deaa1a 61#ifdef HAVE_GSSAPI
97c9a8d7 62 int have_gss; /* Have GSS credentials? */
07ed0e9a 63 uid_t gss_uid; /* User ID for local prints */
f7deaa1a 64#endif /* HAVE_GSSAPI */
65#ifdef HAVE_AUTHORIZATION_H
66 AuthorizationRef authref; /* Authorization ref */
67#endif /* HAVE_AUTHORIZATION_H */
ef416fc2 68};
69
996acce8 70#define HTTP(con) ((con)->http)
ef416fc2 71
72
73/*
74 * HTTP listener structure...
75 */
76
77typedef struct
78{
79 int fd; /* File descriptor for this server */
80 http_addr_t address; /* Bind address of socket */
81 http_encryption_t encryption; /* To encrypt or not to encrypt... */
1720786e
MS
82#if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD)
83 int on_demand; /* Is this a socket from launchd/systemd? */
84#endif /* HAVE_LAUNCHD || HAVE_SYSTEMD */
ef416fc2 85} cupsd_listener_t;
86
87
88/*
89 * Globals...
90 */
91
996acce8
MS
92VAR int LastClientNumber VALUE(0),
93 /* Last client connection number */
94 ListenBackLog VALUE(SOMAXCONN),
ef416fc2 95 /* Max backlog of pending connections */
f11a948a 96 LocalPort VALUE(631),
ef416fc2 97 /* Local port to use */
f11a948a
MS
98 RemotePort VALUE(0);
99 /* Remote port to use */
ef416fc2 100VAR http_encryption_t LocalEncryption VALUE(HTTP_ENCRYPT_IF_REQUESTED);
101 /* Local port encryption to use */
bd7854cb 102VAR cups_array_t *Listeners VALUE(NULL);
ef416fc2 103 /* Listening sockets */
76cd9e37
MS
104VAR time_t ListeningPaused VALUE(0);
105 /* Time when listening was paused */
3dfe78b3 106VAR cups_array_t *Clients VALUE(NULL),
ef416fc2 107 /* HTTP clients */
3dfe78b3
MS
108 *ActiveClients VALUE(NULL);
109 /* Active HTTP clients */
ef416fc2 110VAR char *ServerHeader VALUE(NULL);
111 /* Server header in requests */
112VAR int CGIPipes[2] VALUE2(-1,-1);
113 /* Pipes for CGI error/debug output */
114VAR cupsd_statbuf_t *CGIStatusBuffer VALUE(NULL);
115 /* Status buffer for pipes */
116
117
118/*
119 * Prototypes...
120 */
121
122extern void cupsdAcceptClient(cupsd_listener_t *lis);
123extern void cupsdCloseAllClients(void);
124extern int cupsdCloseClient(cupsd_client_t *con);
bd7854cb 125extern void cupsdDeleteAllListeners(void);
ef416fc2 126extern void cupsdPauseListening(void);
127extern int cupsdProcessIPPRequest(cupsd_client_t *con);
f7deaa1a 128extern void cupsdReadClient(cupsd_client_t *con);
ef416fc2 129extern void cupsdResumeListening(void);
130extern int cupsdSendCommand(cupsd_client_t *con, char *command,
131 char *options, int root);
f899b121 132extern int cupsdSendError(cupsd_client_t *con, http_status_t code,
133 int auth_type);
ef416fc2 134extern int cupsdSendHeader(cupsd_client_t *con, http_status_t code,
f899b121 135 char *type, int auth_type);
ef416fc2 136extern void cupsdShutdownClient(cupsd_client_t *con);
137extern void cupsdStartListening(void);
138extern void cupsdStopListening(void);
139extern void cupsdUpdateCGI(void);
f7deaa1a 140extern void cupsdWriteClient(cupsd_client_t *con);
ef416fc2 141
82cc1f9a
MS
142#ifdef HAVE_SSL
143extern int cupsdEndTLS(cupsd_client_t *con);
144extern int cupsdStartTLS(cupsd_client_t *con);
145#endif /* HAVE_SSL */