directives to cupsd.conf, allowing for different browse protocols
for local and remote printers (STR #877)
man/cupsd.conf.man:
- Add new directives.
scheduler/conf.c:
- ReadConfiguration(): Initialize BrowseLocalProtocols and
BrowseRemoteProtocols.
- read_configuration(): Add support for BrowseLocalProtocols
and BrowseRemoteProtocols.
scheduler/dirsvc.c:
- SendBrowseDelete(): Use BrowseLocalProtocols.
- SendBrowseList(): Use BrowseLocalProtocols.
- StartBrowsing(): Use BrowseLocalProtocols and
BrowseRemoteProtocols.
- StopBrowsing(): Use BrowseLocalProtocols and
BrowseRemoteProtocols.
scheduler/dirsvc.h:
- Add BrowseLocalProtocols and BrowseRemoteProtocols.
- Remove BrowseProtocols.
scheduler/main.c:
- main(): Use BrowseLocalProtocols and
BrowseRemoteProtocols.
- select_timeout(): Use BrowseLocalProtocols.
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@4670
7a7537e8-13f0-0310-91df-
b6672ffda945
+ - Added new BrowseLocalProtocols and
+ BrowseRemoteProtocols directives to cupsd.conf,
+ allowing for different browse protocols for local and
+ remote printers (STR #877)
- PPD files can now contain strings up to 256k in length
(STR #1215)
- The pstops filter now supports the IncludeFeature DSC
- PPD files can now contain strings up to 256k in length
(STR #1215)
- The pstops filter now supports the IncludeFeature DSC
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
.\" EMail: cups-info@cups.org
.\" WWW: http://www.cups.org
.\"
-.TH cupsd.conf 5 "Common UNIX Printing System" "18 August 2004" "Easy Software Products"
+.TH cupsd.conf 5 "Common UNIX Printing System" "17 September 2005" "Easy Software Products"
.SH NAME
cupsd.conf \- server configuration file for cups
.SH DESCRIPTION
.SH NAME
cupsd.conf \- server configuration file for cups
.SH DESCRIPTION
.br
Specifies the protocols to use for printer browsing.
.TP 5
.br
Specifies the protocols to use for printer browsing.
.TP 5
+BrowseLocalProtocols
+.br
+Specifies the protocols to use for local printer browsing.
+.TP 5
+BrowseRemoteProtocols
+.br
+Specifies the protocols to use for remote printer browsing.
+.TP 5
BrowseRelay
.br
Specifies that printer information packets should be relayed from one host or
BrowseRelay
.br
Specifies that printer information packets should be relayed from one host or
.br
Specified the directory where data files can be found.
.TP 5
.br
Specified the directory where data files can be found.
.TP 5
+DefaultAuthType
+.br
+Specifies the default type of authentication to use.
+.TP 5
DefaultCharset
.br
Specifies the default character set to use for text.
DefaultCharset
.br
Specifies the default character set to use for text.
.br
Specifies the default language to use for text and web content.
.TP 5
.br
Specifies the default language to use for text and web content.
.TP 5
+DefaultPolicy
+.br
+Specifies the default access policy to use.
+.TP 5
Deny
.br
Denies access to the named host or address.
Deny
.br
Denies access to the named host or address.
.br
Specifies the connection timeout for HTTP Keep-Alive.
.TP 5
.br
Specifies the connection timeout for HTTP Keep-Alive.
.TP 5
+<Limit operations> ... </Limit>
+.br
+Specifies the IPP operations that are being limited inside a policy.
+.TP 5
<Limit methods> ... </Limit>
.TP 5
<LimitExcept methods> ... </LimitExcept>
<Limit methods> ... </Limit>
.TP 5
<LimitExcept methods> ... </LimitExcept>
.br
Specifies the page log filename.
.TP 5
.br
Specifies the page log filename.
.TP 5
+<Policy name> ... </Policy>
+.br
+Specifies access control for the named policy.
+.TP 5
Port
.br
Specifies a port number to listen to for HTTP requests.
Port
.br
Specifies a port number to listen to for HTTP requests.
RunAsUser = FALSE;
Timeout = DEFAULT_TIMEOUT;
RunAsUser = FALSE;
Timeout = DEFAULT_TIMEOUT;
- BrowseInterval = DEFAULT_INTERVAL;
- BrowsePort = ippPort();
- BrowseProtocols = BROWSE_CUPS;
- BrowseShortNames = TRUE;
- BrowseTimeout = DEFAULT_TIMEOUT;
- Browsing = TRUE;
+ BrowseInterval = DEFAULT_INTERVAL;
+ BrowsePort = ippPort();
+ BrowseLocalProtocols = BROWSE_CUPS;
+ BrowseRemoteProtocols = BROWSE_CUPS;
+ BrowseShortNames = TRUE;
+ BrowseTimeout = DEFAULT_TIMEOUT;
+ Browsing = TRUE;
ClearString(&BrowseLocalOptions);
ClearString(&BrowseRemoteOptions);
ClearString(&BrowseLocalOptions);
ClearString(&BrowseRemoteOptions);
LogMessage(L_ERROR, "Unknown BrowseOrder value %s on line %d.",
value, linenum);
}
LogMessage(L_ERROR, "Unknown BrowseOrder value %s on line %d.",
value, linenum);
}
- else if (!strcasecmp(line, "BrowseProtocols"))
+ else if (!strcasecmp(line, "BrowseProtocols") ||
+ !strcasecmp(line, "BrowseLocalProtocols") ||
+ !strcasecmp(line, "BrowseRemoteProtocols"))
{
/*
* "BrowseProtocol name [... name]"
*/
{
/*
* "BrowseProtocol name [... name]"
*/
+ if (strcasecmp(line, "BrowseLocalProtocols"))
+ BrowseRemoteProtocols = 0;
+ if (strcasecmp(line, "BrowseRemoteProtocols"))
+ BrowseLocalProtocols = 0;
}
if (!strcasecmp(value, "cups"))
}
if (!strcasecmp(value, "cups"))
- BrowseProtocols |= BROWSE_CUPS;
+ {
+ if (strcasecmp(line, "BrowseLocalProtocols"))
+ BrowseRemoteProtocols |= BROWSE_CUPS;
+ if (strcasecmp(line, "BrowseRemoteProtocols"))
+ BrowseLocalProtocols |= BROWSE_CUPS;
+ }
else if (!strcasecmp(value, "slp"))
else if (!strcasecmp(value, "slp"))
- BrowseProtocols |= BROWSE_SLP;
+ {
+ if (strcasecmp(line, "BrowseLocalProtocols"))
+ BrowseRemoteProtocols |= BROWSE_SLP;
+ if (strcasecmp(line, "BrowseRemoteProtocols"))
+ BrowseLocalProtocols |= BROWSE_SLP;
+ }
else if (!strcasecmp(value, "ldap"))
else if (!strcasecmp(value, "ldap"))
- BrowseProtocols |= BROWSE_LDAP;
+ {
+ if (strcasecmp(line, "BrowseLocalProtocols"))
+ BrowseRemoteProtocols |= BROWSE_LDAP;
+ if (strcasecmp(line, "BrowseRemoteProtocols"))
+ BrowseLocalProtocols |= BROWSE_LDAP;
+ }
else if (!strcasecmp(value, "all"))
else if (!strcasecmp(value, "all"))
- BrowseProtocols |= BROWSE_ALL;
+ {
+ if (strcasecmp(line, "BrowseLocalProtocols"))
+ BrowseRemoteProtocols |= BROWSE_ALL;
+ if (strcasecmp(line, "BrowseRemoteProtocols"))
+ BrowseLocalProtocols |= BROWSE_ALL;
+ }
else
{
LogMessage(L_ERROR, "Unknown browse protocol \"%s\" on line %d.",
else
{
LogMessage(L_ERROR, "Unknown browse protocol \"%s\" on line %d.",
* Announce the deletion...
*/
* Announce the deletion...
*/
- if (BrowseProtocols & BROWSE_CUPS)
+ if (BrowseLocalProtocols & BROWSE_CUPS)
SendCUPSBrowse(p);
#ifdef HAVE_LIBSLP
SendCUPSBrowse(p);
#ifdef HAVE_LIBSLP
- if (BrowseProtocols & BROWSE_SLP)
+ if (BrowseLocalProtocols & BROWSE_SLP)
SLPDeregPrinter(p);
#endif /* HAVE_LIBSLP */
}
SLPDeregPrinter(p);
#endif /* HAVE_LIBSLP */
}
- if (!Browsing || !BrowseProtocols)
+ if (!Browsing || !BrowseLocalProtocols)
p->browse_time = time(NULL);
p->browse_time = time(NULL);
- if (BrowseProtocols & BROWSE_CUPS)
+ if (BrowseLocalProtocols & BROWSE_CUPS)
SendCUPSBrowse(p);
#ifdef HAVE_LIBSLP
SendCUPSBrowse(p);
#ifdef HAVE_LIBSLP
- if (BrowseProtocols & BROWSE_SLP)
+ if (BrowseLocalProtocols & BROWSE_SLP)
SendSLPBrowse(p);
#endif /* HAVE_LIBSLP */
}
SendSLPBrowse(p);
#endif /* HAVE_LIBSLP */
}
struct sockaddr_in addr; /* Broadcast address */
struct sockaddr_in addr; /* Broadcast address */
- if (!Browsing || !BrowseProtocols)
+ if (!Browsing || !(BrowseLocalProtocols | BrowseRemoteProtocols))
- if (BrowseProtocols & BROWSE_CUPS)
+ if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS)
{
/*
* Create the broadcast socket...
{
/*
* Create the broadcast socket...
{
LogMessage(L_ERROR, "StartBrowsing: Unable to create broadcast socket - %s.",
strerror(errno));
{
LogMessage(L_ERROR, "StartBrowsing: Unable to create broadcast socket - %s.",
strerror(errno));
- BrowseProtocols &= ~BROWSE_CUPS;
+ BrowseLocalProtocols &= ~BROWSE_CUPS;
+ BrowseRemoteProtocols &= ~BROWSE_CUPS;
close(BrowseSocket);
#endif /* WIN32 */
close(BrowseSocket);
#endif /* WIN32 */
- BrowseSocket = -1;
- BrowseProtocols &= ~BROWSE_CUPS;
+ BrowseSocket = -1;
+ BrowseLocalProtocols &= ~BROWSE_CUPS;
+ BrowseRemoteProtocols &= ~BROWSE_CUPS;
close(BrowseSocket);
#endif /* WIN32 */
close(BrowseSocket);
#endif /* WIN32 */
- BrowseSocket = -1;
- BrowseProtocols &= ~BROWSE_CUPS;
+ BrowseSocket = -1;
+ BrowseLocalProtocols &= ~BROWSE_CUPS;
+ BrowseRemoteProtocols &= ~BROWSE_CUPS;
BrowseSocket = -1;
#ifdef HAVE_LIBSLP
BrowseSocket = -1;
#ifdef HAVE_LIBSLP
- if (BrowseProtocols & BROWSE_SLP)
+ if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP)
{
/*
* Open SLP handle...
{
/*
* Open SLP handle...
if (SLPOpen("en", SLP_FALSE, &BrowseSLPHandle) != SLP_OK)
{
LogMessage(L_ERROR, "Unable to open an SLP handle; disabling SLP browsing!");
if (SLPOpen("en", SLP_FALSE, &BrowseSLPHandle) != SLP_OK)
{
LogMessage(L_ERROR, "Unable to open an SLP handle; disabling SLP browsing!");
- BrowseProtocols &= ~BROWSE_SLP;
+ BrowseLocalProtocols &= ~BROWSE_SLP;
+ BrowseRemoteProtocols &= ~BROWSE_SLP;
void
StopBrowsing(void)
{
void
StopBrowsing(void)
{
- if (!Browsing || !BrowseProtocols)
+ if (!Browsing || !(BrowseLocalProtocols | BrowseRemoteProtocols))
- if (BrowseProtocols & BROWSE_CUPS)
+ if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS)
{
/*
* Close the socket and remove it from the input selection set.
{
/*
* Close the socket and remove it from the input selection set.
- if (BrowseProtocols & BROWSE_SLP)
+ if ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP)
{
/*
* Close SLP handle...
{
/*
* Close SLP handle...
VAR int Browsing VALUE(TRUE),
/* Whether or not browsing is enabled */
VAR int Browsing VALUE(TRUE),
/* Whether or not browsing is enabled */
- BrowseProtocols VALUE(BROWSE_ALL),
- /* Protocols to support */
+ BrowseLocalProtocols
+ 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),
BrowseShortNames VALUE(TRUE),
/* Short names for remote printers? */
BrowseSocket VALUE(-1),
* Update the browse list as needed...
*/
* Update the browse list as needed...
*/
- if (Browsing && BrowseProtocols)
+ if (Browsing && (BrowseLocalProtocols | BrowseRemoteProtocols))
{
if (BrowseSocket >= 0 && FD_ISSET(BrowseSocket, input))
UpdateCUPSBrowse();
{
if (BrowseSocket >= 0 && FD_ISSET(BrowseSocket, input))
UpdateCUPSBrowse();
UpdatePolling();
#ifdef HAVE_LIBSLP
UpdatePolling();
#ifdef HAVE_LIBSLP
- if ((BrowseProtocols & BROWSE_SLP) && BrowseSLPRefresh <= time(NULL))
+ if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_SLP) &&
+ BrowseSLPRefresh <= time(NULL))
UpdateSLPBrowse();
#endif /* HAVE_LIBSLP */
UpdateSLPBrowse();
#endif /* HAVE_LIBSLP */
* Update the browse list as needed...
*/
* Update the browse list as needed...
*/
- if (Browsing && BrowseProtocols)
+ if (Browsing && BrowseLocalProtocols)
- if ((BrowseProtocols & BROWSE_SLP) && (BrowseSLPRefresh < timeout))
+ if ((BrowseLocalProtocols & BROWSE_SLP) && (BrowseSLPRefresh < timeout))
{
timeout = BrowseSLPRefresh;
why = "update SLP browsing";
}
#endif /* HAVE_LIBSLP */
{
timeout = BrowseSLPRefresh;
why = "update SLP browsing";
}
#endif /* HAVE_LIBSLP */
- if (BrowseProtocols & BROWSE_CUPS)
+ if (BrowseLocalProtocols & BROWSE_CUPS)
{
for (p = Printers; p != NULL; p = p->next)
{
{
for (p = Printers; p != NULL; p = p->next)
{