]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/dirsvc.h
Merge pull request #4895 from EvertonMelo/patch-2
[thirdparty/cups.git] / scheduler / dirsvc.h
index b9da4e34e17b7a91e8730be5899707174ce5a847..dfc8584977ce240063e519ae43a4fe31b57e4f0e 100644 (file)
 /*
- * "$Id: dirsvc.h 4822 2005-11-04 21:13:20Z mike $"
+ * Directory services definitions for the CUPS scheduler.
  *
- *   Directory services definitions for the Common UNIX Printing System
- *   (CUPS) scheduler.
+ * Copyright 2007-2012 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
- *
- *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file.  If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
  */
 
-/*
- * Include necessary headers...
- */
-
-#ifdef HAVE_LIBSLP
-#  include <slp.h>
-#endif /* HAVE_LIBSLP */
-
-
 /*
  * Browse protocols...
  */
 
-#define BROWSE_CUPS    1               /* CUPS */
-#define        BROWSE_SLP      2               /* SLPv2 */
-#define BROWSE_LDAP    4               /* LDAP (not supported yet) */
+#define BROWSE_DNSSD   1               /* DNS Service Discovery (aka Bonjour) */
+#define BROWSE_SMB     2               /* SMB/Samba */
+#define BROWSE_LPD     4               /* LPD via xinetd or launchd */
 #define BROWSE_ALL     7               /* All protocols */
 
 
-/*
- * Browse address...
- */
-
-typedef struct
-{
-  char                 iface[32];      /* Destination interface */
-  http_addr_t          to;             /* Destination address */
-} cupsd_dirsvc_addr_t;
-
-
-/*
- * Relay structure...
- */
-
-typedef struct
-{
-  cupsd_authmask_t     from;           /* Source address/name mask */
-  http_addr_t          to;             /* Destination address */
-} cupsd_dirsvc_relay_t;
-
-
-/*
- * Polling structure...
- */
-
-typedef struct
-{
-  char                 hostname[64];   /* Hostname (actually, IP address) */
-  int                  port;           /* Port number */
-  int                  pid;            /* Current poll server PID */
-} cupsd_dirsvc_poll_t;
-
-
 /*
  * Globals...
  */
 
 VAR int                        Browsing        VALUE(TRUE),
                                        /* Whether or not browsing is enabled */
+                       BrowseWebIF     VALUE(FALSE),
+                                       /* Whether the web interface is advertised */
                        BrowseLocalProtocols
-                                       VALUE(BROWSE_ALL),
+                                       VALUE(BROWSE_ALL);
                                        /* Protocols to support for local printers */
-                       BrowseRemoteProtocols
-                                       VALUE(BROWSE_ALL),
-                                       /* Protocols to support for remote printers */
-                       BrowseShortNames VALUE(TRUE),
-                                       /* Short names for remote printers? */
-                       BrowseSocket    VALUE(-1),
-                                       /* Socket for browsing */
-                       BrowsePort      VALUE(IPP_PORT),
-                                       /* Port number for broadcasts */
-                       BrowseInterval  VALUE(DEFAULT_INTERVAL),
-                                       /* Broadcast interval in seconds */
-                       BrowseTimeout   VALUE(DEFAULT_TIMEOUT),
-                                       /* Time out for printers in seconds */
-                       NumBrowsers     VALUE(0);
-                                       /* Number of broadcast addresses */
-VAR char               *BrowseLocalOptions
-                                       VALUE(NULL),
-                                       /* Options to add to local printer URIs */
-                       *BrowseRemoteOptions
-                                       VALUE(NULL);
-                                       /* Options to add to remote printer URIs */
-VAR cupsd_dirsvc_addr_t        *Browsers       VALUE(NULL);
-                                       /* Broadcast addresses */
-VAR cupsd_location_t   *BrowseACL      VALUE(NULL);
-                                       /* Browser access control list */
-VAR cupsd_printer_t    *BrowseNext     VALUE(NULL);
-                                       /* Next class/printer to broadcast */
-VAR int                        NumRelays       VALUE(0);
-                                       /* Number of broadcast relays */
-VAR cupsd_dirsvc_relay_t *Relays       VALUE(NULL);
-                                       /* Broadcast relays */
-VAR int                        NumPolled       VALUE(0);
-                                       /* Number of polled servers */
-VAR cupsd_dirsvc_poll_t        *Polled         VALUE(NULL);
-                                       /* Polled servers */
-VAR int                        PollPipe        VALUE(0);
-                                       /* Status pipe for pollers */
-VAR cupsd_statbuf_t    *PollStatusBuffer VALUE(NULL);
-                                       /* Status buffer for pollers */
-
-#ifdef HAVE_LIBSLP
-VAR SLPHandle          BrowseSLPHandle VALUE(NULL);
-                                       /* SLP API handle */
-VAR time_t             BrowseSLPRefresh VALUE(0);
-                                       /* Next SLP refresh time */
-#endif /* HAVE_LIBSLP */
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
+VAR char               *DNSSDComputerName VALUE(NULL),
+                                       /* Computer/server name */
+                       *DNSSDHostName  VALUE(NULL),
+                                       /* Hostname */
+                       *DNSSDSubTypes VALUE(NULL);
+                                       /* Bonjour registration subtypes */
+VAR cups_array_t       *DNSSDAlias     VALUE(NULL);
+                                       /* List of dynamic ServerAlias's */
+VAR int                        DNSSDPort       VALUE(0);
+                                       /* Port number to register */
+VAR cups_array_t       *DNSSDPrinters  VALUE(NULL);
+                                       /* Printers we have registered */
+#  ifdef HAVE_DNSSD
+VAR DNSServiceRef      DNSSDMaster     VALUE(NULL);
+                                       /* Master DNS-SD service reference */
+#  else /* HAVE_AVAHI */
+VAR AvahiThreadedPoll  *DNSSDMaster    VALUE(NULL);
+                                       /* Master polling interface for Avahi */
+VAR AvahiClient                *DNSSDClient    VALUE(NULL);
+                                       /* Client information */
+#  endif /* HAVE_DNSSD */
+VAR cupsd_srv_t                WebIFSrv        VALUE(NULL);
+                                       /* Service reference for the web interface */
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
+
+VAR char               *LPDConfigFile  VALUE(NULL),
+                                       /* LPD configuration file */
+                       *SMBConfigFile  VALUE(NULL);
+                                       /* SMB configuration file */
 
 
 /*
  * Prototypes...
  */
 
-extern void    cupsdLoadRemoteCache(void);
-extern void    cupsdProcessBrowseData(const char *uri, cups_ptype_t type,
-                                      ipp_pstate_t state, const char *location,
-                                      const char *info, const char *make_model,
-                                      int num_attrs, cups_option_t *attrs);
-extern void    cupsdProcessImplicitClasses(void);
-extern void    cupsdSaveRemoteCache(void);
-extern void    cupsdSendBrowseDelete(cupsd_printer_t *p);
-extern void    cupsdSendBrowseList(void);
-extern void    cupsdSendCUPSBrowse(cupsd_printer_t *p);
-extern void    cupsdSendSLPBrowse(cupsd_printer_t *p);
+extern void    cupsdDeregisterPrinter(cupsd_printer_t *p, int removeit);
+extern void    cupsdRegisterPrinter(cupsd_printer_t *p);
 extern void    cupsdStartBrowsing(void);
-extern void    cupsdStartPolling(void);
 extern void    cupsdStopBrowsing(void);
-extern void    cupsdStopPolling(void);
-extern void    cupsdUpdateCUPSBrowse(void);
-extern void    cupsdUpdatePolling(void);
-extern void    cupsdUpdateSLPBrowse(void);
-
-
-/*
- * End of "$Id: dirsvc.h 4822 2005-11-04 21:13:20Z mike $".
- */
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
+extern void    cupsdUpdateDNSSDName(void);
+#endif /* HAVE_DNSSD || HAVE_AVAHI */