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