]> git.ipfire.org Git - thirdparty/cups.git/blob - scheduler/dirsvc.h
Merge changes from 1.1.x into 1.2 devel.
[thirdparty/cups.git] / scheduler / dirsvc.h
1 /*
2 * "$Id: dirsvc.h,v 1.12.2.2 2001/12/26 16:52:52 mike Exp $"
3 *
4 * Directory services definitions for the Common UNIX Printing System
5 * (CUPS) scheduler.
6 *
7 * Copyright 1997-2001 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-3111 USA
20 *
21 * Voice: (301) 373-9603
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
35 /*
36 * Browse protocols...
37 */
38
39 #define BROWSE_CUPS 1 /* CUPS */
40 #define BROWSE_SLP 2 /* SLPv2 */
41 #define BROWSE_LDAP 4 /* LDAP (not supported yet) */
42 #define BROWSE_ALL 7 /* All protocols */
43
44
45 /*
46 * Relay structure...
47 */
48
49 typedef struct
50 {
51 authmask_t from; /* Source address/name mask */
52 http_addr_t to; /* Destination address */
53 } dirsvc_relay_t;
54
55
56 /*
57 * Polling structure...
58 */
59
60 typedef struct
61 {
62 char hostname[64]; /* Hostname (actually, IP address) */
63 int port; /* Port number */
64 int pid; /* Current poll server PID */
65 } dirsvc_poll_t;
66
67
68 /*
69 * Globals...
70 */
71
72 VAR int Browsing VALUE(TRUE),
73 /* Whether or not browsing is enabled */
74 BrowseProtocols VALUE(BROWSE_ALL),
75 /* Protocols to support */
76 BrowseShortNames VALUE(TRUE),
77 /* Short names for remote printers? */
78 BrowseSocket VALUE(-1),
79 /* Socket for browsing */
80 BrowsePort VALUE(IPP_PORT),
81 /* Port number for broadcasts */
82 BrowseInterval VALUE(DEFAULT_INTERVAL),
83 /* Broadcast interval in seconds */
84 BrowseTimeout VALUE(DEFAULT_TIMEOUT),
85 /* Time out for printers in seconds */
86 NumBrowsers VALUE(0);
87 /* Number of broadcast addresses */
88 VAR http_addr_t Browsers[MAX_BROWSERS];
89 /* Broadcast addresses */
90 VAR location_t *BrowseACL VALUE(NULL);
91 /* Browser access control list */
92 VAR int NumRelays VALUE(0);
93 /* Number of broadcast relays */
94 VAR dirsvc_relay_t Relays[MAX_BROWSERS];
95 /* Broadcast relays */
96 VAR int NumPolled VALUE(0);
97 /* Number of polled servers */
98 VAR dirsvc_poll_t Polled[MAX_BROWSERS];
99 /* Polled servers */
100
101 #ifdef HAVE_LIBSLP
102 VAR SLPHandle BrowseSLPHandle VALUE(NULL);
103 /* SLP API handle */
104 VAR time_t BrowseSLPRefresh VALUE(0);
105 /* Next SLP refresh time */
106 #endif /* HAVE_LIBSLP */
107
108
109 /*
110 * Prototypes...
111 */
112
113 extern void ProcessBrowseData(const char *uri, cups_ptype_t type,
114 ipp_pstate_t state, const char *location,
115 const char *info, const char *make_model);
116 extern void SendBrowseList(void);
117 extern void SendCUPSBrowse(printer_t *p);
118 extern void SendSLPBrowse(printer_t *p);
119 extern void StartBrowsing(void);
120 extern void StartPolling(void);
121 extern void StopBrowsing(void);
122 extern void StopPolling(void);
123 extern void UpdateCUPSBrowse(void);
124 extern void UpdateSLPBrowse(void);
125
126
127 /*
128 * End of "$Id: dirsvc.h,v 1.12.2.2 2001/12/26 16:52:52 mike Exp $".
129 */