]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
75bd9771 | 2 | * "$Id: dirsvc.h 7676 2008-06-18 23:42:37Z mike $" |
ef416fc2 | 3 | * |
4 | * Directory services definitions for the Common UNIX Printing System | |
5 | * (CUPS) scheduler. | |
6 | * | |
1ff0402e | 7 | * Copyright 2007-2008 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 | ||
52 | typedef 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 | ||
63 | typedef 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 | ||
74 | typedef 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 | ||
86 | VAR int Browsing VALUE(TRUE), | |
87 | /* Whether or not browsing is enabled */ | |
88 | BrowseLocalProtocols | |
89 | VALUE(BROWSE_ALL), | |
90 | /* Protocols to support for local printers */ | |
91 | BrowseRemoteProtocols | |
92 | VALUE(BROWSE_ALL), | |
93 | /* Protocols to support for remote printers */ | |
94 | BrowseShortNames VALUE(TRUE), | |
95 | /* Short names for remote printers? */ | |
96 | BrowseSocket VALUE(-1), | |
97 | /* Socket for browsing */ | |
98 | BrowsePort VALUE(IPP_PORT), | |
99 | /* Port number for broadcasts */ | |
100 | BrowseInterval VALUE(DEFAULT_INTERVAL), | |
101 | /* Broadcast interval in seconds */ | |
102 | BrowseTimeout VALUE(DEFAULT_TIMEOUT), | |
103 | /* Time out for printers in seconds */ | |
e00b005a | 104 | UseNetworkDefault VALUE(CUPS_DEFAULT_USE_NETWORK_DEFAULT), |
105 | /* Use the network default printer? */ | |
ef416fc2 | 106 | NumBrowsers VALUE(0); |
107 | /* Number of broadcast addresses */ | |
108 | VAR char *BrowseLocalOptions | |
109 | VALUE(NULL), | |
110 | /* Options to add to local printer URIs */ | |
111 | *BrowseRemoteOptions | |
112 | VALUE(NULL); | |
113 | /* Options to add to remote printer URIs */ | |
114 | VAR cupsd_dirsvc_addr_t *Browsers VALUE(NULL); | |
115 | /* Broadcast addresses */ | |
116 | VAR cupsd_location_t *BrowseACL VALUE(NULL); | |
117 | /* Browser access control list */ | |
118 | VAR cupsd_printer_t *BrowseNext VALUE(NULL); | |
119 | /* Next class/printer to broadcast */ | |
120 | VAR int NumRelays VALUE(0); | |
121 | /* Number of broadcast relays */ | |
122 | VAR cupsd_dirsvc_relay_t *Relays VALUE(NULL); | |
123 | /* Broadcast relays */ | |
124 | VAR int NumPolled VALUE(0); | |
125 | /* Number of polled servers */ | |
126 | VAR cupsd_dirsvc_poll_t *Polled VALUE(NULL); | |
127 | /* Polled servers */ | |
128 | VAR int PollPipe VALUE(0); | |
129 | /* Status pipe for pollers */ | |
130 | VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL); | |
131 | /* Status buffer for pollers */ | |
132 | ||
7a14d768 MS |
133 | #ifdef HAVE_DNSSD |
134 | VAR char *DNSSDName VALUE(NULL); | |
135 | /* Computer/server name */ | |
136 | VAR int DNSSDPort VALUE(0); | |
137 | /* Port number to register */ | |
138 | VAR cups_array_t *DNSSDPrinters VALUE(NULL); | |
139 | /* Printers we have registered */ | |
140 | VAR DNSServiceRef DNSSDRef VALUE(NULL), | |
141 | /* Master DNS-SD service reference */ | |
142 | WebIFRef VALUE(NULL), | |
143 | /* Service reference for the web interface */ | |
144 | RemoteRef VALUE(NULL); | |
145 | /* Remote printer browse reference */ | |
146 | #endif /* HAVE_DNSSD */ | |
147 | ||
ef416fc2 | 148 | #ifdef HAVE_LIBSLP |
149 | VAR SLPHandle BrowseSLPHandle VALUE(NULL); | |
150 | /* SLP API handle */ | |
151 | VAR time_t BrowseSLPRefresh VALUE(0); | |
152 | /* Next SLP refresh time */ | |
153 | #endif /* HAVE_LIBSLP */ | |
154 | ||
b423cd4c | 155 | #ifdef HAVE_LDAP |
b423cd4c | 156 | VAR LDAP *BrowseLDAPHandle VALUE(NULL); |
157 | /* Handle to LDAP server */ | |
b423cd4c | 158 | VAR time_t BrowseLDAPRefresh VALUE(0); |
159 | /* Next LDAP refresh time */ | |
160 | VAR char *BrowseLDAPBindDN VALUE(NULL), | |
161 | /* LDAP login DN */ | |
162 | *BrowseLDAPDN VALUE(NULL), | |
163 | /* LDAP search DN */ | |
164 | *BrowseLDAPPassword VALUE(NULL), | |
165 | /* LDAP login password */ | |
749b1e90 | 166 | *BrowseLDAPServer VALUE(NULL); |
b423cd4c | 167 | /* LDAP server to use */ |
749b1e90 MS |
168 | VAR int BrowseLDAPUpdate VALUE(TRUE); |
169 | /* enables LDAP updates */ | |
170 | # ifdef HAVE_LDAP_SSL | |
171 | VAR char *BrowseLDAPCACertFile VALUE(NULL); | |
bc44d920 | 172 | /* LDAP CA CERT file to use */ |
749b1e90 | 173 | # endif /* HAVE_LDAP_SSL */ |
b423cd4c | 174 | #endif /* HAVE_LDAP */ |
2e4ff8af MS |
175 | VAR char *LPDConfigFile VALUE(NULL), |
176 | /* LPD configuration file */ | |
177 | *SMBConfigFile VALUE(NULL); | |
178 | /* SMB configuration file */ | |
b423cd4c | 179 | |
ef416fc2 | 180 | |
181 | /* | |
182 | * Prototypes... | |
183 | */ | |
184 | ||
f7deaa1a | 185 | extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit); |
ef416fc2 | 186 | extern void cupsdLoadRemoteCache(void); |
f7deaa1a | 187 | extern void cupsdRegisterPrinter(cupsd_printer_t *p); |
d09495fa | 188 | extern void cupsdRestartPolling(void); |
ef416fc2 | 189 | extern void cupsdSaveRemoteCache(void); |
ef416fc2 | 190 | extern void cupsdSendBrowseList(void); |
ef416fc2 | 191 | extern void cupsdStartBrowsing(void); |
192 | extern void cupsdStartPolling(void); | |
193 | extern void cupsdStopBrowsing(void); | |
194 | extern void cupsdStopPolling(void); | |
f7deaa1a | 195 | #ifdef HAVE_DNSSD |
7a14d768 | 196 | extern void cupsdUpdateDNSSDName(void); |
f7deaa1a | 197 | #endif /* HAVE_DNSSD */ |
b423cd4c | 198 | #ifdef HAVE_LDAP |
199 | extern void cupsdUpdateLDAPBrowse(void); | |
200 | #endif /* HAVE_LDAP */ | |
ef416fc2 | 201 | extern void cupsdUpdateSLPBrowse(void); |
202 | ||
203 | ||
204 | /* | |
75bd9771 | 205 | * End of "$Id: dirsvc.h 7676 2008-06-18 23:42:37Z mike $". |
ef416fc2 | 206 | */ |