]>
Commit | Line | Data |
---|---|---|
a129ddbd | 1 | /* |
1d9595ab | 2 | * "$Id: dirsvc.h,v 1.12.2.6 2003/01/07 18:27:20 mike Exp $" |
a129ddbd | 3 | * |
fd8b1cf8 | 4 | * Directory services definitions for the Common UNIX Printing System |
5 | * (CUPS) scheduler. | |
a129ddbd | 6 | * |
1d9595ab | 7 | * Copyright 1997-2003 by Easy Software Products, all rights reserved. |
a129ddbd | 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 | |
8784b6a6 | 18 | * 44141 Airport View Drive, Suite 204 |
a129ddbd | 19 | * Hollywood, Maryland 20636-3111 USA |
20 | * | |
21 | * Voice: (301) 373-9603 | |
22 | * EMail: cups-info@cups.org | |
23 | * WWW: http://www.cups.org | |
a129ddbd | 24 | */ |
25 | ||
753453e4 | 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 | ||
d7a9de63 | 45 | /* |
46 | * Browse address... | |
47 | */ | |
48 | ||
49 | typedef struct | |
50 | { | |
51 | char iface[32]; /* Destination interface */ | |
52 | http_addr_t to; /* Destination address */ | |
53 | } dirsvc_addr_t; | |
54 | ||
55 | ||
03081fd2 | 56 | /* |
57 | * Relay structure... | |
58 | */ | |
59 | ||
60 | typedef struct | |
61 | { | |
e5ebb675 | 62 | authmask_t from; /* Source address/name mask */ |
99de6da0 | 63 | http_addr_t to; /* Destination address */ |
03081fd2 | 64 | } dirsvc_relay_t; |
65 | ||
66 | ||
67 | /* | |
68 | * Polling structure... | |
69 | */ | |
70 | ||
71 | typedef struct | |
72 | { | |
99de6da0 | 73 | char hostname[64]; /* Hostname (actually, IP address) */ |
03081fd2 | 74 | int port; /* Port number */ |
75 | int pid; /* Current poll server PID */ | |
76 | } dirsvc_poll_t; | |
77 | ||
78 | ||
fd8b1cf8 | 79 | /* |
80 | * Globals... | |
81 | */ | |
82 | ||
83 | VAR int Browsing VALUE(TRUE), | |
84 | /* Whether or not browsing is enabled */ | |
753453e4 | 85 | BrowseProtocols VALUE(BROWSE_ALL), |
86 | /* Protocols to support */ | |
d6f1ff9a | 87 | BrowseShortNames VALUE(TRUE), |
88 | /* Short names for remote printers? */ | |
d6de4648 | 89 | BrowseSocket VALUE(-1), |
90 | /* Socket for browsing */ | |
5ff9dbae | 91 | BrowsePort VALUE(IPP_PORT), |
fd8b1cf8 | 92 | /* Port number for broadcasts */ |
fd8b1cf8 | 93 | BrowseInterval VALUE(DEFAULT_INTERVAL), |
94 | /* Broadcast interval in seconds */ | |
95 | BrowseTimeout VALUE(DEFAULT_TIMEOUT), | |
96 | /* Time out for printers in seconds */ | |
97 | NumBrowsers VALUE(0); | |
98 | /* Number of broadcast addresses */ | |
d7a9de63 | 99 | VAR dirsvc_addr_t Browsers[MAX_BROWSERS]; |
fd8b1cf8 | 100 | /* Broadcast addresses */ |
03081fd2 | 101 | VAR location_t *BrowseACL VALUE(NULL); |
102 | /* Browser access control list */ | |
103 | VAR int NumRelays VALUE(0); | |
104 | /* Number of broadcast relays */ | |
105 | VAR dirsvc_relay_t Relays[MAX_BROWSERS]; | |
106 | /* Broadcast relays */ | |
107 | VAR int NumPolled VALUE(0); | |
108 | /* Number of polled servers */ | |
109 | VAR dirsvc_poll_t Polled[MAX_BROWSERS]; | |
110 | /* Polled servers */ | |
5f46b7d1 | 111 | VAR int PollPipe VALUE(0); |
112 | /* Status pipe for pollers */ | |
fd8b1cf8 | 113 | |
753453e4 | 114 | #ifdef HAVE_LIBSLP |
115 | VAR SLPHandle BrowseSLPHandle VALUE(NULL); | |
116 | /* SLP API handle */ | |
117 | VAR time_t BrowseSLPRefresh VALUE(0); | |
118 | /* Next SLP refresh time */ | |
119 | #endif /* HAVE_LIBSLP */ | |
120 | ||
fd8b1cf8 | 121 | |
122 | /* | |
123 | * Prototypes... | |
a129ddbd | 124 | */ |
125 | ||
753453e4 | 126 | extern void ProcessBrowseData(const char *uri, cups_ptype_t type, |
127 | ipp_pstate_t state, const char *location, | |
128 | const char *info, const char *make_model); | |
fd8b1cf8 | 129 | extern void SendBrowseList(void); |
753453e4 | 130 | extern void SendCUPSBrowse(printer_t *p); |
131 | extern void SendSLPBrowse(printer_t *p); | |
132 | extern void StartBrowsing(void); | |
03081fd2 | 133 | extern void StartPolling(void); |
753453e4 | 134 | extern void StopBrowsing(void); |
03081fd2 | 135 | extern void StopPolling(void); |
753453e4 | 136 | extern void UpdateCUPSBrowse(void); |
5f46b7d1 | 137 | extern void UpdatePolling(void); |
753453e4 | 138 | extern void UpdateSLPBrowse(void); |
03081fd2 | 139 | |
a129ddbd | 140 | |
141 | /* | |
1d9595ab | 142 | * End of "$Id: dirsvc.h,v 1.12.2.6 2003/01/07 18:27:20 mike Exp $". |
a129ddbd | 143 | */ |