]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/client.h
Remove svn:keywords since they cause svn_load_dirs.pl to complain about every file.
[thirdparty/cups.git] / scheduler / client.h
CommitLineData
ef416fc2 1/*
c07d5b2d 2 * "$Id: client.h 177 2006-06-21 00:20:03Z jlovell $"
ef416fc2 3 *
4 * Client definitions for the Common UNIX Printing System (CUPS) scheduler.
5 *
bd7854cb 6 * Copyright 1997-2006 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
25/*
26 * HTTP client structure...
27 */
28
29struct cupsd_client_s
30{
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 */
40 uri[HTTP_MAX_URI],
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 */
52#ifdef HAVE_SSL
53 int auto_ssl; /* Automatic test for SSL/TLS */
54#endif /* HAVE_SSL */
55 http_addr_t clientaddr; /* Client address */
56 char servername[256];/* Server name for connection */
57 int serverport; /* Server port for connection */
58};
59
60#define HTTP(con) &((con)->http)
61
62
63/*
64 * HTTP listener structure...
65 */
66
67typedef struct
68{
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... */
72} cupsd_listener_t;
73
74
75/*
76 * Globals...
77 */
78
79VAR int ListenBackLog VALUE(SOMAXCONN),
80 /* Max backlog of pending connections */
81 LocalPort VALUE(631);
82 /* Local port to use */
83VAR http_encryption_t LocalEncryption VALUE(HTTP_ENCRYPT_IF_REQUESTED);
84 /* Local port encryption to use */
bd7854cb 85VAR cups_array_t *Listeners VALUE(NULL);
ef416fc2 86 /* Listening sockets */
bd7854cb 87VAR cups_array_t *Clients VALUE(NULL);
ef416fc2 88 /* HTTP clients */
89VAR http_addrlist_t *ServerAddrs VALUE(NULL);
90 /* Server address(es) */
91VAR char *ServerHeader VALUE(NULL);
92 /* Server header in requests */
93VAR int CGIPipes[2] VALUE2(-1,-1);
94 /* Pipes for CGI error/debug output */
95VAR cupsd_statbuf_t *CGIStatusBuffer VALUE(NULL);
96 /* Status buffer for pipes */
97
98
99/*
100 * Prototypes...
101 */
102
103extern void cupsdAcceptClient(cupsd_listener_t *lis);
104extern void cupsdCloseAllClients(void);
105extern int cupsdCloseClient(cupsd_client_t *con);
bd7854cb 106extern void cupsdDeleteAllListeners(void);
ef416fc2 107extern void cupsdPauseListening(void);
108extern int cupsdProcessIPPRequest(cupsd_client_t *con);
109extern int cupsdReadClient(cupsd_client_t *con);
110extern void cupsdResumeListening(void);
111extern int cupsdSendCommand(cupsd_client_t *con, char *command,
112 char *options, int root);
113extern int cupsdSendError(cupsd_client_t *con, http_status_t code);
ef416fc2 114extern int cupsdSendHeader(cupsd_client_t *con, http_status_t code,
115 char *type);
116extern void cupsdShutdownClient(cupsd_client_t *con);
117extern void cupsdStartListening(void);
118extern void cupsdStopListening(void);
119extern void cupsdUpdateCGI(void);
120extern int cupsdWriteClient(cupsd_client_t *con);
121
122
123/*
c07d5b2d 124 * End of "$Id: client.h 177 2006-06-21 00:20:03Z jlovell $".
ef416fc2 125 */