]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/dirsvc.h
Merge changes from CUPS 1.4svn-r8540.
[thirdparty/cups.git] / scheduler / dirsvc.h
1 /*
2 * "$Id: dirsvc.h 7933 2008-09-11 00:44:58Z mike $"
3 *
4 * Directory services definitions for the Common UNIX Printing System
5 * (CUPS) scheduler.
6 *
7 * Copyright 2007-2009 by Apple Inc.
8 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
9 *
10 * These coded instructions, statements, and computer programs are the
11 * property of Apple Inc. and are protected by Federal copyright
12 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
13 * which should have been included with this file. If this file is
14 * file is missing or damaged, see the license at "http://www.cups.org/".
15 */
16
17 /*
18 * Include necessary headers...
19 */
20
21 #ifdef HAVE_LIBSLP
22 # include <slp.h>
23 #endif /* HAVE_LIBSLP */
24
25 #ifdef HAVE_LDAP
26 # ifdef __sun
27 # include <lber.h>
28 # endif /* __sun */
29 # include <ldap.h>
30 # ifdef HAVE_LDAP_SSL_H
31 # include <ldap_ssl.h>
32 # endif /* HAVE_LDAP_SSL_H */
33 #endif /* HAVE_LDAP */
34
35 /*
36 * Browse protocols...
37 */
38
39 #define BROWSE_CUPS 1 /* CUPS */
40 #define BROWSE_SLP 2 /* SLPv2 */
41 #define BROWSE_LDAP 4 /* LDAP */
42 #define BROWSE_DNSSD 8 /* DNS Service Discovery (aka Bonjour) */
43 #define BROWSE_SMB 16 /* SMB/Samba */
44 #define BROWSE_LPD 32 /* LPD via xinetd or launchd */
45 #define BROWSE_ALL 63 /* All protocols */
46
47
48 /*
49 * Browse address...
50 */
51
52 typedef struct
53 {
54 char iface[32]; /* Destination interface */
55 http_addr_t to; /* Destination address */
56 } cupsd_dirsvc_addr_t;
57
58
59 /*
60 * Relay structure...
61 */
62
63 typedef struct
64 {
65 cupsd_authmask_t from; /* Source address/name mask */
66 http_addr_t to; /* Destination address */
67 } cupsd_dirsvc_relay_t;
68
69
70 /*
71 * Polling structure...
72 */
73
74 typedef struct
75 {
76 char hostname[64]; /* Hostname (actually, IP address) */
77 int port; /* Port number */
78 int pid; /* Current poll server PID */
79 } cupsd_dirsvc_poll_t;
80
81
82 /*
83 * Globals...
84 */
85
86 VAR int Browsing VALUE(TRUE),
87 /* Whether or not browsing is enabled */
88 BrowseWebIF VALUE(FALSE),
89 /* Whether the web interface is advertised */
90 BrowseLocalProtocols
91 VALUE(BROWSE_ALL),
92 /* Protocols to support for local printers */
93 BrowseRemoteProtocols
94 VALUE(BROWSE_ALL),
95 /* Protocols to support for remote printers */
96 BrowseShortNames VALUE(TRUE),
97 /* Short names for remote printers? */
98 BrowseSocket VALUE(-1),
99 /* Socket for browsing */
100 BrowsePort VALUE(IPP_PORT),
101 /* Port number for broadcasts */
102 BrowseInterval VALUE(DEFAULT_INTERVAL),
103 /* Broadcast interval in seconds */
104 BrowseTimeout VALUE(DEFAULT_TIMEOUT),
105 /* Time out for printers in seconds */
106 UseNetworkDefault VALUE(CUPS_DEFAULT_USE_NETWORK_DEFAULT),
107 /* Use the network default printer? */
108 NumBrowsers VALUE(0);
109 /* Number of broadcast addresses */
110 VAR char *BrowseLocalOptions
111 VALUE(NULL),
112 /* Options to add to local printer URIs */
113 *BrowseRemoteOptions
114 VALUE(NULL);
115 /* Options to add to remote printer URIs */
116 VAR cupsd_dirsvc_addr_t *Browsers VALUE(NULL);
117 /* Broadcast addresses */
118 VAR cupsd_location_t *BrowseACL VALUE(NULL);
119 /* Browser access control list */
120 VAR cupsd_printer_t *BrowseNext VALUE(NULL);
121 /* Next class/printer to broadcast */
122 VAR int NumRelays VALUE(0);
123 /* Number of broadcast relays */
124 VAR cupsd_dirsvc_relay_t *Relays VALUE(NULL);
125 /* Broadcast relays */
126 VAR int NumPolled VALUE(0);
127 /* Number of polled servers */
128 VAR cupsd_dirsvc_poll_t *Polled VALUE(NULL);
129 /* Polled servers */
130 VAR int PollPipe VALUE(0);
131 /* Status pipe for pollers */
132 VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL);
133 /* Status buffer for pollers */
134
135 #ifdef HAVE_DNSSD
136 VAR char *DNSSDName VALUE(NULL);
137 /* Computer/server name */
138 VAR cups_array_t *DNSSDAlias VALUE(NULL);
139 /* List of dynamic ServerAlias's */
140 VAR int DNSSDPort VALUE(0);
141 /* Port number to register */
142 VAR cups_array_t *DNSSDPrinters VALUE(NULL);
143 /* Printers we have registered */
144 VAR DNSServiceRef DNSSDRef VALUE(NULL),
145 /* Master DNS-SD service reference */
146 WebIFRef VALUE(NULL),
147 /* Service reference for the web interface */
148 RemoteRef VALUE(NULL);
149 /* Remote printer browse reference */
150 #endif /* HAVE_DNSSD */
151
152 #ifdef HAVE_LIBSLP
153 VAR SLPHandle BrowseSLPHandle VALUE(NULL);
154 /* SLP API handle */
155 VAR time_t BrowseSLPRefresh VALUE(0);
156 /* Next SLP refresh time */
157 #endif /* HAVE_LIBSLP */
158
159 #ifdef HAVE_LDAP
160 VAR LDAP *BrowseLDAPHandle VALUE(NULL);
161 /* Handle to LDAP server */
162 VAR time_t BrowseLDAPRefresh VALUE(0);
163 /* Next LDAP refresh time */
164 VAR char *BrowseLDAPBindDN VALUE(NULL),
165 /* LDAP login DN */
166 *BrowseLDAPDN VALUE(NULL),
167 /* LDAP search DN */
168 *BrowseLDAPPassword VALUE(NULL),
169 /* LDAP login password */
170 *BrowseLDAPServer VALUE(NULL);
171 /* LDAP server to use */
172 VAR int BrowseLDAPUpdate VALUE(TRUE);
173 /* enables LDAP updates */
174 # ifdef HAVE_LDAP_SSL
175 VAR char *BrowseLDAPCACertFile VALUE(NULL);
176 /* LDAP CA CERT file to use */
177 # endif /* HAVE_LDAP_SSL */
178 #endif /* HAVE_LDAP */
179 VAR char *LPDConfigFile VALUE(NULL),
180 /* LPD configuration file */
181 *SMBConfigFile VALUE(NULL);
182 /* SMB configuration file */
183
184
185 /*
186 * Prototypes...
187 */
188
189 extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit);
190 extern void cupsdLoadRemoteCache(void);
191 extern void cupsdRegisterPrinter(cupsd_printer_t *p);
192 extern void cupsdRestartPolling(void);
193 extern void cupsdSaveRemoteCache(void);
194 extern void cupsdSendBrowseList(void);
195 extern void cupsdStartBrowsing(void);
196 extern void cupsdStartPolling(void);
197 extern void cupsdStopBrowsing(void);
198 extern void cupsdStopPolling(void);
199 #ifdef HAVE_DNSSD
200 extern void cupsdUpdateDNSSDName(void);
201 #endif /* HAVE_DNSSD */
202 #ifdef HAVE_LDAP
203 extern void cupsdUpdateLDAPBrowse(void);
204 #endif /* HAVE_LDAP */
205 extern void cupsdUpdateSLPBrowse(void);
206
207
208 /*
209 * End of "$Id: dirsvc.h 7933 2008-09-11 00:44:58Z mike $".
210 */