]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/dirsvc.h
Merge changes from CUPS 1.5svn-r9641
[thirdparty/cups.git] / scheduler / dirsvc.h
CommitLineData
ef416fc2 1/*
b19ccc9e 2 * "$Id: dirsvc.h 7933 2008-09-11 00:44:58Z mike $"
ef416fc2 3 *
10d09e33 4 * Directory services definitions for the CUPS scheduler.
ef416fc2 5 *
10d09e33 6 * Copyright 2007-2010 by Apple Inc.
f7deaa1a 7 * Copyright 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 14 */
15
16/*
17 * Include necessary headers...
18 */
19
20#ifdef HAVE_LIBSLP
21# include <slp.h>
22#endif /* HAVE_LIBSLP */
23
749b1e90 24#ifdef HAVE_LDAP
b423cd4c 25# ifdef __sun
26# include <lber.h>
27# endif /* __sun */
28# include <ldap.h>
749b1e90
MS
29# ifdef HAVE_LDAP_SSL_H
30# include <ldap_ssl.h>
31# endif /* HAVE_LDAP_SSL_H */
32#endif /* HAVE_LDAP */
ef416fc2 33
34/*
35 * Browse protocols...
36 */
37
38#define BROWSE_CUPS 1 /* CUPS */
39#define BROWSE_SLP 2 /* SLPv2 */
b423cd4c 40#define BROWSE_LDAP 4 /* LDAP */
f7deaa1a 41#define BROWSE_DNSSD 8 /* DNS Service Discovery (aka Bonjour) */
2e4ff8af
MS
42#define BROWSE_SMB 16 /* SMB/Samba */
43#define BROWSE_LPD 32 /* LPD via xinetd or launchd */
44#define BROWSE_ALL 63 /* All protocols */
ef416fc2 45
46
47/*
48 * Browse address...
49 */
50
51typedef 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
62typedef struct
63{
10d09e33 64 cups_array_t *from; /* Source address/name mask(s) */
ef416fc2 65 http_addr_t to; /* Destination address */
66} cupsd_dirsvc_relay_t;
67
68
69/*
70 * Polling structure...
71 */
72
73typedef 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
85VAR int Browsing VALUE(TRUE),
86 /* Whether or not browsing is enabled */
b19ccc9e
MS
87 BrowseWebIF VALUE(FALSE),
88 /* Whether the web interface is advertised */
ef416fc2 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 */
e00b005a 105 UseNetworkDefault VALUE(CUPS_DEFAULT_USE_NETWORK_DEFAULT),
106 /* Use the network default printer? */
ef416fc2 107 NumBrowsers VALUE(0);
108 /* Number of broadcast addresses */
109VAR 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 */
115VAR cupsd_dirsvc_addr_t *Browsers VALUE(NULL);
116 /* Broadcast addresses */
117VAR cupsd_location_t *BrowseACL VALUE(NULL);
118 /* Browser access control list */
119VAR cupsd_printer_t *BrowseNext VALUE(NULL);
120 /* Next class/printer to broadcast */
121VAR int NumRelays VALUE(0);
122 /* Number of broadcast relays */
123VAR cupsd_dirsvc_relay_t *Relays VALUE(NULL);
124 /* Broadcast relays */
125VAR int NumPolled VALUE(0);
126 /* Number of polled servers */
127VAR cupsd_dirsvc_poll_t *Polled VALUE(NULL);
128 /* Polled servers */
129VAR int PollPipe VALUE(0);
130 /* Status pipe for pollers */
131VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL);
132 /* Status buffer for pollers */
133
7a14d768 134#ifdef HAVE_DNSSD
536bc2c6 135VAR char *DNSSDComputerName VALUE(NULL),
7a14d768 136 /* Computer/server name */
84315f46 137 *DNSSDHostName VALUE(NULL),
536bc2c6 138 /* Hostname */
84315f46
MS
139 *DNSSDRegType VALUE(NULL);
140 /* Bonjour registration type */
e07d4801
MS
141VAR cups_array_t *DNSSDAlias VALUE(NULL);
142 /* List of dynamic ServerAlias's */
7a14d768
MS
143VAR int DNSSDPort VALUE(0);
144 /* Port number to register */
145VAR cups_array_t *DNSSDPrinters VALUE(NULL);
146 /* Printers we have registered */
147VAR 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
ef416fc2 155#ifdef HAVE_LIBSLP
156VAR SLPHandle BrowseSLPHandle VALUE(NULL);
157 /* SLP API handle */
158VAR time_t BrowseSLPRefresh VALUE(0);
159 /* Next SLP refresh time */
160#endif /* HAVE_LIBSLP */
161
b423cd4c 162#ifdef HAVE_LDAP
b423cd4c 163VAR LDAP *BrowseLDAPHandle VALUE(NULL);
164 /* Handle to LDAP server */
b423cd4c 165VAR time_t BrowseLDAPRefresh VALUE(0);
166 /* Next LDAP refresh time */
167VAR char *BrowseLDAPBindDN VALUE(NULL),
168 /* LDAP login DN */
169 *BrowseLDAPDN VALUE(NULL),
170 /* LDAP search DN */
171 *BrowseLDAPPassword VALUE(NULL),
172 /* LDAP login password */
749b1e90 173 *BrowseLDAPServer VALUE(NULL);
b423cd4c 174 /* LDAP server to use */
749b1e90
MS
175VAR int BrowseLDAPUpdate VALUE(TRUE);
176 /* enables LDAP updates */
177# ifdef HAVE_LDAP_SSL
178VAR char *BrowseLDAPCACertFile VALUE(NULL);
bc44d920 179 /* LDAP CA CERT file to use */
749b1e90 180# endif /* HAVE_LDAP_SSL */
b423cd4c 181#endif /* HAVE_LDAP */
2e4ff8af
MS
182VAR char *LPDConfigFile VALUE(NULL),
183 /* LPD configuration file */
184 *SMBConfigFile VALUE(NULL);
185 /* SMB configuration file */
b423cd4c 186
ef416fc2 187
188/*
189 * Prototypes...
190 */
191
f7deaa1a 192extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit);
ef416fc2 193extern void cupsdLoadRemoteCache(void);
f7deaa1a 194extern void cupsdRegisterPrinter(cupsd_printer_t *p);
d09495fa 195extern void cupsdRestartPolling(void);
ef416fc2 196extern void cupsdSaveRemoteCache(void);
ef416fc2 197extern void cupsdSendBrowseList(void);
ef416fc2 198extern void cupsdStartBrowsing(void);
199extern void cupsdStartPolling(void);
200extern void cupsdStopBrowsing(void);
201extern void cupsdStopPolling(void);
f7deaa1a 202#ifdef HAVE_DNSSD
7a14d768 203extern void cupsdUpdateDNSSDName(void);
f7deaa1a 204#endif /* HAVE_DNSSD */
b423cd4c 205#ifdef HAVE_LDAP
206extern void cupsdUpdateLDAPBrowse(void);
207#endif /* HAVE_LDAP */
ef416fc2 208extern void cupsdUpdateSLPBrowse(void);
209
210
211/*
b19ccc9e 212 * End of "$Id: dirsvc.h 7933 2008-09-11 00:44:58Z mike $".
ef416fc2 213 */