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