]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/dirsvc.h
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / dirsvc.h
1 /*
2 * "$Id: dirsvc.h 5305 2006-03-18 03:05:12Z mike $"
3 *
4 * Directory services definitions for the Common UNIX Printing System
5 * (CUPS) scheduler.
6 *
7 * Copyright 1997-2005 by Easy Software Products, all rights reserved.
8 *
9 * These coded instructions, statements, and computer programs are the
10 * property of Easy Software Products and are protected by Federal
11 * copyright law. Distribution and use rights are outlined in the file
12 * "LICENSE.txt" which should have been included with this file. If this
13 * file is missing or damaged please contact Easy Software Products
14 * at:
15 *
16 * Attn: CUPS Licensing Information
17 * Easy Software Products
18 * 44141 Airport View Drive, Suite 204
19 * Hollywood, Maryland 20636 USA
20 *
21 * Voice: (301) 373-9600
22 * EMail: cups-info@cups.org
23 * WWW: http://www.cups.org
24 */
25
26 /*
27 * Include necessary headers...
28 */
29
30 #ifdef HAVE_LIBSLP
31 # include <slp.h>
32 #endif /* HAVE_LIBSLP */
33
34 #ifdef HAVE_OPENLDAP
35 # ifdef __sun
36 # include <lber.h>
37 # endif /* __sun */
38 # include <ldap.h>
39 #endif /* HAVE_OPENLDAP */
40
41 /*
42 * Browse protocols...
43 */
44
45 #define BROWSE_CUPS 1 /* CUPS */
46 #define BROWSE_SLP 2 /* SLPv2 */
47 #define BROWSE_LDAP 4 /* LDAP */
48 #define BROWSE_DNSSD 8 /* DNS Service Discovery aka Bonjour */
49 #define BROWSE_ALL 15 /* All protocols */
50
51
52 /*
53 * Browse address...
54 */
55
56 typedef struct
57 {
58 char iface[32]; /* Destination interface */
59 http_addr_t to; /* Destination address */
60 } cupsd_dirsvc_addr_t;
61
62
63 /*
64 * Relay structure...
65 */
66
67 typedef struct
68 {
69 cupsd_authmask_t from; /* Source address/name mask */
70 http_addr_t to; /* Destination address */
71 } cupsd_dirsvc_relay_t;
72
73
74 /*
75 * Polling structure...
76 */
77
78 typedef struct
79 {
80 char hostname[64]; /* Hostname (actually, IP address) */
81 int port; /* Port number */
82 int pid; /* Current poll server PID */
83 } cupsd_dirsvc_poll_t;
84
85
86 /*
87 * Globals...
88 */
89
90 VAR int Browsing VALUE(TRUE),
91 /* Whether or not browsing is enabled */
92 BrowseLocalProtocols
93 VALUE(BROWSE_ALL),
94 /* Protocols to support for local printers */
95 BrowseRemoteProtocols
96 VALUE(BROWSE_ALL),
97 /* Protocols to support for remote printers */
98 BrowseShortNames VALUE(TRUE),
99 /* Short names for remote printers? */
100 BrowseSocket VALUE(-1),
101 /* Socket for browsing */
102 BrowsePort VALUE(IPP_PORT),
103 /* Port number for broadcasts */
104 BrowseInterval VALUE(DEFAULT_INTERVAL),
105 /* Broadcast interval in seconds */
106 BrowseTimeout VALUE(DEFAULT_TIMEOUT),
107 /* Time out for printers in seconds */
108 UseNetworkDefault VALUE(CUPS_DEFAULT_USE_NETWORK_DEFAULT),
109 /* Use the network default printer? */
110 NumBrowsers VALUE(0);
111 /* Number of broadcast addresses */
112 VAR char *BrowseLocalOptions
113 VALUE(NULL),
114 /* Options to add to local printer URIs */
115 *BrowseRemoteOptions
116 VALUE(NULL);
117 /* Options to add to remote printer URIs */
118 VAR cupsd_dirsvc_addr_t *Browsers VALUE(NULL);
119 /* Broadcast addresses */
120 VAR cupsd_location_t *BrowseACL VALUE(NULL);
121 /* Browser access control list */
122 VAR cupsd_printer_t *BrowseNext VALUE(NULL);
123 /* Next class/printer to broadcast */
124 VAR int NumRelays VALUE(0);
125 /* Number of broadcast relays */
126 VAR cupsd_dirsvc_relay_t *Relays VALUE(NULL);
127 /* Broadcast relays */
128 VAR int NumPolled VALUE(0);
129 /* Number of polled servers */
130 VAR cupsd_dirsvc_poll_t *Polled VALUE(NULL);
131 /* Polled servers */
132 VAR int PollPipe VALUE(0);
133 /* Status pipe for pollers */
134 VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL);
135 /* Status buffer for pollers */
136
137 #ifdef HAVE_LIBSLP
138 VAR SLPHandle BrowseSLPHandle VALUE(NULL);
139 /* SLP API handle */
140 VAR time_t BrowseSLPRefresh VALUE(0);
141 /* Next SLP refresh time */
142 #endif /* HAVE_LIBSLP */
143
144 #ifdef HAVE_LDAP
145 # ifdef HAVE_OPENLDAP
146 VAR LDAP *BrowseLDAPHandle VALUE(NULL);
147 /* Handle to LDAP server */
148 # endif /* HAVE_OPENLDAP */
149 VAR time_t BrowseLDAPRefresh VALUE(0);
150 /* Next LDAP refresh time */
151 VAR char *BrowseLDAPBindDN VALUE(NULL),
152 /* LDAP login DN */
153 *BrowseLDAPDN VALUE(NULL),
154 /* LDAP search DN */
155 *BrowseLDAPPassword VALUE(NULL),
156 /* LDAP login password */
157 *BrowseLDAPServer VALUE(NULL);
158 /* LDAP server to use */
159 #endif /* HAVE_LDAP */
160
161
162 /*
163 * Prototypes...
164 */
165
166 extern void cupsdLoadRemoteCache(void);
167 extern void cupsdSaveRemoteCache(void);
168 extern void cupsdSendBrowseDelete(cupsd_printer_t *p);
169 extern void cupsdSendBrowseList(void);
170 extern void cupsdStartBrowsing(void);
171 extern void cupsdStartPolling(void);
172 extern void cupsdStopBrowsing(void);
173 extern void cupsdStopPolling(void);
174 extern void cupsdUpdateCUPSBrowse(void);
175 #ifdef HAVE_LDAP
176 extern void cupsdUpdateLDAPBrowse(void);
177 #endif /* HAVE_LDAP */
178 extern void cupsdUpdatePolling(void);
179 extern void cupsdUpdateSLPBrowse(void);
180
181
182 /*
183 * End of "$Id: dirsvc.h 5305 2006-03-18 03:05:12Z mike $".
184 */