Skip to content

Commit b3396be

Browse files
Add BrowseIPPSOnly boolean directive and update man page
1 parent de1dfc4 commit b3396be

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

man/cupsd.conf.5

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ The default is "dnssd" on systems that support DNS-SD and "none" otherwise.
6868
.br
6969
Specifies whether the CUPS web interface is advertised.
7070
The default is "No".
71+
.TP 5
72+
\fBBrowseIPPSOnly Yes\fR
73+
.TP 5
74+
\fBBrowseIPPSOnly No\fR
75+
.br
76+
Specifies whether to only advertise IPPS services.
77+
The default is "No".
7178
.\"#Browsing
7279
.TP 5
7380
\fBBrowsing Yes\fR

scheduler/conf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static const cupsd_var_t cupsd_vars[] =
6868
{
6969
{ "AutoPurgeJobs", &JobAutoPurge, CUPSD_VARTYPE_BOOLEAN },
7070
{ "BrowseDNSSDSubTypes", &DNSSDSubTypes, CUPSD_VARTYPE_NULLSTRING },
71+
{ "BrowseIPPSOnly", &BrowseIPPSOnly, CUPSD_VARTYPE_BOOLEAN },
7172
{ "BrowseWebIF", &BrowseWebIF, CUPSD_VARTYPE_BOOLEAN },
7273
{ "Browsing", &Browsing, CUPSD_VARTYPE_BOOLEAN },
7374
{ "Classification", &Classification, CUPSD_VARTYPE_STRING },

scheduler/conf.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ VAR int FilterLimit VALUE(0),
225225
/* multiple-operation-time-out value */
226226
WebInterface VALUE(CUPS_DEFAULT_WEBIF);
227227
/* Enable the web interface? */
228+
VAR int BrowseIPPSOnly VALUE(0);
229+
/* Only browse IPPS printers? */
228230
VAR cups_file_t *AccessFile VALUE(NULL),
229231
/* Access log file */
230232
*ErrorFile VALUE(NULL),

scheduler/dirsvc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "cupsd.h"
1313
#include <grp.h>
14+
extern int BrowseIPPSOnly;
1415

1516
#if defined(HAVE_MDNSRESPONDER) && defined(__APPLE__)
1617
# include <nameser.h>
@@ -44,6 +45,8 @@ cupsdDeregisterPrinter(
4445
{
4546
/*
4647
* Only deregister if browsing is enabled and it's a local printer...
48+
if (BrowseIPPSOnly && p->regtypes && !strstr(p->regtypes, "_ipps._tcp"))
49+
return;
4750
*/
4851

4952
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdDeregisterPrinter(p=%p(%s), removeit=%d)", (void *)p, p->name, removeit);
@@ -75,6 +78,9 @@ cupsdRegisterPrinter(cupsd_printer_t *p)/* I - Printer */
7578

7679
if (!Browsing || !BrowseLocalProtocols || (p->type & (CUPS_PTYPE_REMOTE | CUPS_PTYPE_SCANNER)))
7780
return;
81+
82+
if (BrowseIPPSOnly && p->regtypes && !strstr(p->regtypes, "_ipps._tcp"))
83+
return;
7884

7985
cupsdLogPrinter(p, CUPSD_LOG_DEBUG, "DNSSDContext=%p", (void *)DNSSDContext);
8086

0 commit comments

Comments
 (0)