]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
bc44d920 | 2 | * "$Id: dirsvc.h 6649 2007-07-11 21:46:42Z mike $" |
ef416fc2 | 3 | * |
4 | * Directory services definitions for the Common UNIX Printing System | |
5 | * (CUPS) scheduler. | |
6 | * | |
bc44d920 | 7 | * Copyright 2007 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 | ||
b423cd4c | 25 | #ifdef HAVE_OPENLDAP |
26 | # ifdef __sun | |
27 | # include <lber.h> | |
28 | # endif /* __sun */ | |
29 | # include <ldap.h> | |
30 | #endif /* HAVE_OPENLDAP */ | |
ef416fc2 | 31 | |
32 | /* | |
33 | * Browse protocols... | |
34 | */ | |
35 | ||
36 | #define BROWSE_CUPS 1 /* CUPS */ | |
37 | #define BROWSE_SLP 2 /* SLPv2 */ | |
b423cd4c | 38 | #define BROWSE_LDAP 4 /* LDAP */ |
f7deaa1a | 39 | #define BROWSE_DNSSD 8 /* DNS Service Discovery (aka Bonjour) */ |
a4d04587 | 40 | #define BROWSE_ALL 15 /* All protocols */ |
ef416fc2 | 41 | |
42 | ||
43 | /* | |
44 | * Browse address... | |
45 | */ | |
46 | ||
47 | typedef struct | |
48 | { | |
49 | char iface[32]; /* Destination interface */ | |
50 | http_addr_t to; /* Destination address */ | |
51 | } cupsd_dirsvc_addr_t; | |
52 | ||
53 | ||
54 | /* | |
55 | * Relay structure... | |
56 | */ | |
57 | ||
58 | typedef struct | |
59 | { | |
60 | cupsd_authmask_t from; /* Source address/name mask */ | |
61 | http_addr_t to; /* Destination address */ | |
62 | } cupsd_dirsvc_relay_t; | |
63 | ||
64 | ||
65 | /* | |
66 | * Polling structure... | |
67 | */ | |
68 | ||
69 | typedef struct | |
70 | { | |
71 | char hostname[64]; /* Hostname (actually, IP address) */ | |
72 | int port; /* Port number */ | |
73 | int pid; /* Current poll server PID */ | |
74 | } cupsd_dirsvc_poll_t; | |
75 | ||
76 | ||
77 | /* | |
78 | * Globals... | |
79 | */ | |
80 | ||
81 | VAR int Browsing VALUE(TRUE), | |
82 | /* Whether or not browsing is enabled */ | |
83 | BrowseLocalProtocols | |
84 | VALUE(BROWSE_ALL), | |
85 | /* Protocols to support for local printers */ | |
86 | BrowseRemoteProtocols | |
87 | VALUE(BROWSE_ALL), | |
88 | /* Protocols to support for remote printers */ | |
89 | BrowseShortNames VALUE(TRUE), | |
90 | /* Short names for remote printers? */ | |
91 | BrowseSocket VALUE(-1), | |
92 | /* Socket for browsing */ | |
93 | BrowsePort VALUE(IPP_PORT), | |
94 | /* Port number for broadcasts */ | |
95 | BrowseInterval VALUE(DEFAULT_INTERVAL), | |
96 | /* Broadcast interval in seconds */ | |
97 | BrowseTimeout VALUE(DEFAULT_TIMEOUT), | |
98 | /* Time out for printers in seconds */ | |
e00b005a | 99 | UseNetworkDefault VALUE(CUPS_DEFAULT_USE_NETWORK_DEFAULT), |
100 | /* Use the network default printer? */ | |
ef416fc2 | 101 | NumBrowsers VALUE(0); |
102 | /* Number of broadcast addresses */ | |
103 | VAR char *BrowseLocalOptions | |
104 | VALUE(NULL), | |
105 | /* Options to add to local printer URIs */ | |
106 | *BrowseRemoteOptions | |
107 | VALUE(NULL); | |
108 | /* Options to add to remote printer URIs */ | |
109 | VAR cupsd_dirsvc_addr_t *Browsers VALUE(NULL); | |
110 | /* Broadcast addresses */ | |
111 | VAR cupsd_location_t *BrowseACL VALUE(NULL); | |
112 | /* Browser access control list */ | |
113 | VAR cupsd_printer_t *BrowseNext VALUE(NULL); | |
114 | /* Next class/printer to broadcast */ | |
115 | VAR int NumRelays VALUE(0); | |
116 | /* Number of broadcast relays */ | |
117 | VAR cupsd_dirsvc_relay_t *Relays VALUE(NULL); | |
118 | /* Broadcast relays */ | |
119 | VAR int NumPolled VALUE(0); | |
120 | /* Number of polled servers */ | |
121 | VAR cupsd_dirsvc_poll_t *Polled VALUE(NULL); | |
122 | /* Polled servers */ | |
123 | VAR int PollPipe VALUE(0); | |
124 | /* Status pipe for pollers */ | |
125 | VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL); | |
126 | /* Status buffer for pollers */ | |
127 | ||
128 | #ifdef HAVE_LIBSLP | |
129 | VAR SLPHandle BrowseSLPHandle VALUE(NULL); | |
130 | /* SLP API handle */ | |
131 | VAR time_t BrowseSLPRefresh VALUE(0); | |
132 | /* Next SLP refresh time */ | |
133 | #endif /* HAVE_LIBSLP */ | |
134 | ||
b423cd4c | 135 | #ifdef HAVE_LDAP |
136 | # ifdef HAVE_OPENLDAP | |
137 | VAR LDAP *BrowseLDAPHandle VALUE(NULL); | |
138 | /* Handle to LDAP server */ | |
139 | # endif /* HAVE_OPENLDAP */ | |
140 | VAR time_t BrowseLDAPRefresh VALUE(0); | |
141 | /* Next LDAP refresh time */ | |
142 | VAR char *BrowseLDAPBindDN VALUE(NULL), | |
143 | /* LDAP login DN */ | |
144 | *BrowseLDAPDN VALUE(NULL), | |
145 | /* LDAP search DN */ | |
146 | *BrowseLDAPPassword VALUE(NULL), | |
147 | /* LDAP login password */ | |
bc44d920 | 148 | *BrowseLDAPServer VALUE(NULL), |
b423cd4c | 149 | /* LDAP server to use */ |
bc44d920 | 150 | *BrowseLDAPCACertFile VALUE(NULL); |
151 | /* LDAP CA CERT file to use */ | |
b423cd4c | 152 | #endif /* HAVE_LDAP */ |
153 | ||
ef416fc2 | 154 | |
155 | /* | |
156 | * Prototypes... | |
157 | */ | |
158 | ||
f7deaa1a | 159 | extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit); |
ef416fc2 | 160 | extern void cupsdLoadRemoteCache(void); |
f7deaa1a | 161 | extern void cupsdRegisterPrinter(cupsd_printer_t *p); |
d09495fa | 162 | extern void cupsdRestartPolling(void); |
ef416fc2 | 163 | extern void cupsdSaveRemoteCache(void); |
ef416fc2 | 164 | extern void cupsdSendBrowseList(void); |
ef416fc2 | 165 | extern void cupsdStartBrowsing(void); |
166 | extern void cupsdStartPolling(void); | |
167 | extern void cupsdStopBrowsing(void); | |
168 | extern void cupsdStopPolling(void); | |
f7deaa1a | 169 | #ifdef HAVE_DNSSD |
170 | extern void cupsdUpdateDNSSDBrowse(cupsd_printer_t *p); | |
171 | #endif /* HAVE_DNSSD */ | |
b423cd4c | 172 | #ifdef HAVE_LDAP |
173 | extern void cupsdUpdateLDAPBrowse(void); | |
174 | #endif /* HAVE_LDAP */ | |
ef416fc2 | 175 | extern void cupsdUpdateSLPBrowse(void); |
176 | ||
177 | ||
178 | /* | |
bc44d920 | 179 | * End of "$Id: dirsvc.h 6649 2007-07-11 21:46:42Z mike $". |
ef416fc2 | 180 | */ |