]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
2 | * "$Id: dirsvc.h 4822 2005-11-04 21:13:20Z 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 | ||
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 | * Browse address... | |
47 | */ | |
48 | ||
49 | typedef 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 | ||
60 | typedef 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 | ||
71 | typedef 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 | ||
83 | VAR 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 */ | |
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 | ||
135 | ||
136 | /* | |
137 | * Prototypes... | |
138 | */ | |
139 | ||
140 | extern void cupsdLoadRemoteCache(void); | |
141 | extern void cupsdProcessBrowseData(const char *uri, cups_ptype_t type, | |
142 | ipp_pstate_t state, const char *location, | |
143 | const char *info, const char *make_model, | |
144 | int num_attrs, cups_option_t *attrs); | |
145 | extern void cupsdProcessImplicitClasses(void); | |
146 | extern void cupsdSaveRemoteCache(void); | |
147 | extern void cupsdSendBrowseDelete(cupsd_printer_t *p); | |
148 | extern void cupsdSendBrowseList(void); | |
149 | extern void cupsdSendCUPSBrowse(cupsd_printer_t *p); | |
150 | extern void cupsdSendSLPBrowse(cupsd_printer_t *p); | |
151 | extern void cupsdStartBrowsing(void); | |
152 | extern void cupsdStartPolling(void); | |
153 | extern void cupsdStopBrowsing(void); | |
154 | extern void cupsdStopPolling(void); | |
155 | extern void cupsdUpdateCUPSBrowse(void); | |
156 | extern void cupsdUpdatePolling(void); | |
157 | extern void cupsdUpdateSLPBrowse(void); | |
158 | ||
159 | ||
160 | /* | |
161 | * End of "$Id: dirsvc.h 4822 2005-11-04 21:13:20Z mike $". | |
162 | */ |