• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Directory services definitions for the CUPS scheduler.
3  *
4  * Copyright 2007-2017 by Apple Inc.
5  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
6  *
7  * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
8  */
9 
10 /*
11  * Browse protocols...
12  */
13 
14 #define BROWSE_DNSSD	1		/* DNS Service Discovery (aka Bonjour) */
15 #define BROWSE_SMB	2		/* SMB/Samba */
16 #define BROWSE_LPD	4		/* LPD via xinetd or launchd */
17 #define BROWSE_ALL	7		/* All protocols */
18 
19 
20 /*
21  * Globals...
22  */
23 
24 VAR int			Browsing	VALUE(TRUE),
25 					/* Whether or not browsing is enabled */
26 			BrowseWebIF	VALUE(FALSE),
27 					/* Whether the web interface is advertised */
28 			BrowseLocalProtocols
29 					VALUE(BROWSE_ALL);
30 					/* Protocols to support for local printers */
31 #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
32 VAR char		*DNSSDComputerName VALUE(NULL),
33 					/* Computer/server name */
34 			*DNSSDHostName	VALUE(NULL),
35 					/* Hostname */
36 			*DNSSDSubTypes VALUE(NULL);
37 					/* Bonjour registration subtypes */
38 VAR cups_array_t	*DNSSDAlias	VALUE(NULL);
39 					/* List of dynamic ServerAlias's */
40 VAR int			DNSSDPort	VALUE(0);
41 					/* Port number to register */
42 VAR cups_array_t	*DNSSDPrinters	VALUE(NULL);
43 					/* Printers we have registered */
44 #  ifdef HAVE_DNSSD
45 VAR DNSServiceRef	DNSSDMaster	VALUE(NULL);
46 					/* Master DNS-SD service reference */
47 #  else /* HAVE_AVAHI */
48 VAR AvahiThreadedPoll	*DNSSDMaster	VALUE(NULL);
49 					/* Master polling interface for Avahi */
50 VAR AvahiClient		*DNSSDClient	VALUE(NULL);
51 					/* Client information */
52 #  endif /* HAVE_DNSSD */
53 VAR cupsd_srv_t		WebIFSrv	VALUE(NULL);
54 					/* Service reference for the web interface */
55 #endif /* HAVE_DNSSD || HAVE_AVAHI */
56 
57 VAR char		*LPDConfigFile	VALUE(NULL),
58 					/* LPD configuration file */
59 			*SMBConfigFile	VALUE(NULL);
60 					/* SMB configuration file */
61 
62 
63 /*
64  * Prototypes...
65  */
66 
67 extern void	cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit);
68 extern void	cupsdRegisterPrinter(cupsd_printer_t *p);
69 extern void	cupsdStartBrowsing(void);
70 extern void	cupsdStopBrowsing(void);
71 #if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
72 extern void	cupsdUpdateDNSSDName(void);
73 #endif /* HAVE_DNSSD || HAVE_AVAHI */
74