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