]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/dirsvc.h
Import CUPS 1.4svn r7023 into easysw/current.
[thirdparty/cups.git] / scheduler / dirsvc.h
CommitLineData
ef416fc2 1/*
2e4ff8af 2 * "$Id: dirsvc.h 6930 2007-09-08 00:28:06Z 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) */
2e4ff8af
MS
40#define BROWSE_SMB 16 /* SMB/Samba */
41#define BROWSE_LPD 32 /* LPD via xinetd or launchd */
42#define BROWSE_ALL 63 /* All protocols */
ef416fc2 43
44
45/*
46 * Browse address...
47 */
48
49typedef struct
50{
51 char iface[32]; /* Destination interface */
52 http_addr_t to; /* Destination address */
53} cupsd_dirsvc_addr_t;
54
55
56/*
57 * Relay structure...
58 */
59
60typedef struct
61{
62 cupsd_authmask_t from; /* Source address/name mask */
63 http_addr_t to; /* Destination address */
64} cupsd_dirsvc_relay_t;
65
66
67/*
68 * Polling structure...
69 */
70
71typedef struct
72{
73 char hostname[64]; /* Hostname (actually, IP address) */
74 int port; /* Port number */
75 int pid; /* Current poll server PID */
76} cupsd_dirsvc_poll_t;
77
78
79/*
80 * Globals...
81 */
82
83VAR int Browsing VALUE(TRUE),
84 /* Whether or not browsing is enabled */
85 BrowseLocalProtocols
86 VALUE(BROWSE_ALL),
87 /* Protocols to support for local printers */
88 BrowseRemoteProtocols
89 VALUE(BROWSE_ALL),
90 /* Protocols to support for remote printers */
91 BrowseShortNames VALUE(TRUE),
92 /* Short names for remote printers? */
93 BrowseSocket VALUE(-1),
94 /* Socket for browsing */
95 BrowsePort VALUE(IPP_PORT),
96 /* Port number for broadcasts */
97 BrowseInterval VALUE(DEFAULT_INTERVAL),
98 /* Broadcast interval in seconds */
99 BrowseTimeout VALUE(DEFAULT_TIMEOUT),
100 /* Time out for printers in seconds */
e00b005a 101 UseNetworkDefault VALUE(CUPS_DEFAULT_USE_NETWORK_DEFAULT),
102 /* Use the network default printer? */
ef416fc2 103 NumBrowsers VALUE(0);
104 /* Number of broadcast addresses */
105VAR char *BrowseLocalOptions
106 VALUE(NULL),
107 /* Options to add to local printer URIs */
108 *BrowseRemoteOptions
109 VALUE(NULL);
110 /* Options to add to remote printer URIs */
111VAR cupsd_dirsvc_addr_t *Browsers VALUE(NULL);
112 /* Broadcast addresses */
113VAR cupsd_location_t *BrowseACL VALUE(NULL);
114 /* Browser access control list */
115VAR cupsd_printer_t *BrowseNext VALUE(NULL);
116 /* Next class/printer to broadcast */
117VAR int NumRelays VALUE(0);
118 /* Number of broadcast relays */
119VAR cupsd_dirsvc_relay_t *Relays VALUE(NULL);
120 /* Broadcast relays */
121VAR int NumPolled VALUE(0);
122 /* Number of polled servers */
123VAR cupsd_dirsvc_poll_t *Polled VALUE(NULL);
124 /* Polled servers */
125VAR int PollPipe VALUE(0);
126 /* Status pipe for pollers */
127VAR cupsd_statbuf_t *PollStatusBuffer VALUE(NULL);
128 /* Status buffer for pollers */
129
130#ifdef HAVE_LIBSLP
131VAR SLPHandle BrowseSLPHandle VALUE(NULL);
132 /* SLP API handle */
133VAR time_t BrowseSLPRefresh VALUE(0);
134 /* Next SLP refresh time */
135#endif /* HAVE_LIBSLP */
136
b423cd4c 137#ifdef HAVE_LDAP
138# ifdef HAVE_OPENLDAP
139VAR LDAP *BrowseLDAPHandle VALUE(NULL);
140 /* Handle to LDAP server */
141# endif /* HAVE_OPENLDAP */
142VAR time_t BrowseLDAPRefresh VALUE(0);
143 /* Next LDAP refresh time */
144VAR char *BrowseLDAPBindDN VALUE(NULL),
145 /* LDAP login DN */
146 *BrowseLDAPDN VALUE(NULL),
147 /* LDAP search DN */
148 *BrowseLDAPPassword VALUE(NULL),
149 /* LDAP login password */
bc44d920 150 *BrowseLDAPServer VALUE(NULL),
b423cd4c 151 /* LDAP server to use */
bc44d920 152 *BrowseLDAPCACertFile VALUE(NULL);
153 /* LDAP CA CERT file to use */
b423cd4c 154#endif /* HAVE_LDAP */
2e4ff8af
MS
155VAR char *LPDConfigFile VALUE(NULL),
156 /* LPD configuration file */
157 *SMBConfigFile VALUE(NULL);
158 /* SMB configuration file */
b423cd4c 159
ef416fc2 160
161/*
162 * Prototypes...
163 */
164
f7deaa1a 165extern void cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit);
ef416fc2 166extern void cupsdLoadRemoteCache(void);
f7deaa1a 167extern void cupsdRegisterPrinter(cupsd_printer_t *p);
d09495fa 168extern void cupsdRestartPolling(void);
ef416fc2 169extern void cupsdSaveRemoteCache(void);
ef416fc2 170extern void cupsdSendBrowseList(void);
ef416fc2 171extern void cupsdStartBrowsing(void);
172extern void cupsdStartPolling(void);
173extern void cupsdStopBrowsing(void);
174extern void cupsdStopPolling(void);
f7deaa1a 175#ifdef HAVE_DNSSD
176extern void cupsdUpdateDNSSDBrowse(cupsd_printer_t *p);
177#endif /* HAVE_DNSSD */
b423cd4c 178#ifdef HAVE_LDAP
179extern void cupsdUpdateLDAPBrowse(void);
180#endif /* HAVE_LDAP */
ef416fc2 181extern void cupsdUpdateSLPBrowse(void);
182
183
184/*
2e4ff8af 185 * End of "$Id: dirsvc.h 6930 2007-09-08 00:28:06Z mike $".
ef416fc2 186 */