]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/dirsvc.h
Import CUPS 1.4svn r7023 into easysw/current.
[thirdparty/cups.git] / scheduler / dirsvc.h
1 /*
2 * "$Id: dirsvc.h 6930 2007-09-08 00:28:06Z 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_LIBSLP
131 VAR SLPHandle BrowseSLPHandle VALUE(NULL);
132 /* SLP API handle */
133 VAR time_t BrowseSLPRefresh VALUE(0);
134 /* Next SLP refresh time */
135 #endif /* HAVE_LIBSLP */
136
137 #ifdef HAVE_LDAP
138 # ifdef HAVE_OPENLDAP
139 VAR LDAP *BrowseLDAPHandle VALUE(NULL);
140 /* Handle to LDAP server */
141 # endif /* HAVE_OPENLDAP */
142 VAR time_t BrowseLDAPRefresh VALUE(0);
143 /* Next LDAP refresh time */
144 VAR char *BrowseLDAPBindDN VALUE(NULL),
145 /* LDAP login DN */
146 *BrowseLDAPDN VALUE(NULL),
147 /* LDAP search DN */
148 *BrowseLDAPPassword VALUE(NULL),
149 /* LDAP login password */
150 *BrowseLDAPServer VALUE(NULL),
151 /* LDAP server to use */
152 *BrowseLDAPCACertFile VALUE(NULL);
153 /* LDAP CA CERT file to use */
154 #endif /* HAVE_LDAP */
155 VAR char *LPDConfigFile VALUE(NULL),
156 /* LPD configuration file */
157 *SMBConfigFile VALUE(NULL);
158 /* SMB configuration file */
159
160
161 /*
162 * Prototypes...
163 */
164
165 extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit);
166 extern void cupsdLoadRemoteCache(void);
167 extern void cupsdRegisterPrinter(cupsd_printer_t *p);
168 extern void cupsdRestartPolling(void);
169 extern void cupsdSaveRemoteCache(void);
170 extern void cupsdSendBrowseList(void);
171 extern void cupsdStartBrowsing(void);
172 extern void cupsdStartPolling(void);
173 extern void cupsdStopBrowsing(void);
174 extern void cupsdStopPolling(void);
175 #ifdef HAVE_DNSSD
176 extern void cupsdUpdateDNSSDBrowse(cupsd_printer_t *p);
177 #endif /* HAVE_DNSSD */
178 #ifdef HAVE_LDAP
179 extern void cupsdUpdateLDAPBrowse(void);
180 #endif /* HAVE_LDAP */
181 extern void cupsdUpdateSLPBrowse(void);
182
183
184 /*
185 * End of "$Id: dirsvc.h 6930 2007-09-08 00:28:06Z mike $".
186 */