Index: backend/lpd.c =================================================================== --- backend/lpd.c (revision 10596) +++ backend/lpd.c (working copy) @@ -126,6 +126,7 @@ int port; /* Port number */ char portname[256]; /* Port name (string) */ http_addrlist_t *addrlist; /* List of addresses for printer */ + int snmp_enabled = 1; /* Is SNMP enabled? */ int snmp_fd; /* SNMP socket */ int fd; /* Print file */ int status; /* Status of LPD job */ @@ -356,7 +357,8 @@ */ if (!value[0] || !_cups_strcasecmp(value, "on") || - !_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true") || + !_cups_strcasecmp(value, "yes") || + !_cups_strcasecmp(value, "true") || !_cups_strcasecmp(value, "rfc1179")) reserve = RESERVE_RFC1179; else if (!_cups_strcasecmp(value, "any")) @@ -371,7 +373,8 @@ */ manual_copies = !value[0] || !_cups_strcasecmp(value, "on") || - !_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true"); + !_cups_strcasecmp(value, "yes") || + !_cups_strcasecmp(value, "true"); } else if (!_cups_strcasecmp(name, "sanitize_title")) { @@ -380,8 +383,19 @@ */ sanitize_title = !value[0] || !_cups_strcasecmp(value, "on") || - !_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true"); + !_cups_strcasecmp(value, "yes") || + !_cups_strcasecmp(value, "true"); } + else if (!_cups_strcasecmp(name, "snmp")) + { + /* + * Enable/disable SNMP stuff... + */ + + snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") || + _cups_strcasecmp(value, "yes") || + _cups_strcasecmp(value, "true"); + } else if (!_cups_strcasecmp(name, "timeout")) { /* @@ -428,7 +442,10 @@ } } - snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family); + if (snmp_enabled) + snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family); + else + snmp_fd = -1; /* * Wait for data from the filter... Index: backend/ipp.c =================================================================== --- backend/ipp.c (revision 10603) +++ backend/ipp.c (working copy) @@ -203,6 +203,7 @@ *value, /* Value of option */ sep; /* Separator character */ http_addrlist_t *addrlist; /* Address of printer */ + int snmp_enabled = 1; /* Is SNMP enabled? */ int snmp_fd, /* SNMP socket */ start_count, /* Page count via SNMP at start */ page_count, /* Page count via SNMP */ @@ -508,6 +509,16 @@ value); } } + else if (!_cups_strcasecmp(name, "snmp")) + { + /* + * Enable/disable SNMP stuff... + */ + + snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") || + _cups_strcasecmp(value, "yes") || + _cups_strcasecmp(value, "true"); + } else if (!_cups_strcasecmp(name, "version")) { if (!strcmp(value, "1.0")) @@ -659,11 +670,14 @@ * See if the printer supports SNMP... */ - if ((snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family)) >= 0) - { + if (snmp_enabled) + snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family); + else + snmp_fd = -1; + + if (snmp_fd >= 0) have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr), &start_count, NULL); - } else have_supplies = start_count = 0; Index: backend/socket.c =================================================================== --- backend/socket.c (revision 10596) +++ backend/socket.c (working copy) @@ -87,6 +87,7 @@ http_addrlist_t *addrlist, /* Address list */ *addr; /* Connected address */ char addrname[256]; /* Address name */ + int snmp_enabled = 1; /* Is SNMP enabled? */ int snmp_fd, /* SNMP socket */ start_count, /* Page count via SNMP at start */ page_count, /* Page count via SNMP */ @@ -246,6 +247,16 @@ waiteof = !value[0] || !_cups_strcasecmp(value, "on") || !_cups_strcasecmp(value, "yes") || !_cups_strcasecmp(value, "true"); } + else if (!_cups_strcasecmp(name, "snmp")) + { + /* + * Enable/disable SNMP stuff... + */ + + snmp_enabled = !value[0] || !_cups_strcasecmp(value, "on") || + _cups_strcasecmp(value, "yes") || + _cups_strcasecmp(value, "true"); + } else if (!_cups_strcasecmp(name, "contimeout")) { /* @@ -286,11 +297,14 @@ * See if the printer supports SNMP... */ - if ((snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family)) >= 0) - { + if (snmp_enabled) + snmp_fd = _cupsSNMPOpen(addrlist->addr.addr.sa_family); + else + snmp_fd = -1; + + if (snmp_fd >= 0) have_supplies = !backendSNMPSupplies(snmp_fd, &(addrlist->addr), &start_count, NULL); - } else have_supplies = start_count = 0; Index: doc/help/network.html =================================================================== --- doc/help/network.html (revision 10596) +++ doc/help/network.html (working copy) @@ -93,16 +93,22 @@
socket://ip-address-or-hostname -socket://ip-address-or-hostname/?waiteof=false +socket://ip-address-or-hostname/?option=value +socket://ip-address-or-hostname/?option=value&option=value socket://ip-address-or-hostname:port-number -socket://ip-address-or-hostname:port-number/?waiteof=false +socket://ip-address-or-hostname:port-number/?option=value +socket://ip-address-or-hostname:port-number/?option=value&option=value+
The "contimeout" option controls the number of seconds that the backend will wait to obtain a connection to the printer. The default is 1 week.
+ +The "snmp" option controls whether the socket backend queries for supply and page count information via SNMP.
+The "waiteof" option controls whether the socket backend waits for the printer to complete the printing of the job. The default is to wait.
IPP is the only protocol that CUPS supports natively and is supported by some network printers and print servers. However, since many printers do not implement IPP properly, only use IPP when the vendor actually documents official support for it. IPP printing normally happens over port 631 and uses the http and ipp URI schemes:
+IPP is the only protocol that CUPS supports natively and is supported by some network printers and print servers. However, since many printers do not implement IPP properly, only use IPP when the vendor actually documents official support for it. IPP printing normally happens over port 631 and uses the http, ipp, and ipps URI schemes:
http://ip-address-or-hostname:port-number/resource @@ -114,6 +120,12 @@ ipp://ip-address-or-hostname:port-number/resource ipp://ip-address-or-hostname:port-number/resource?option=value ipp://ip-address-or-hostname:port-number/resource?option=value&option=value +ipps://ip-address-or-hostname/resource +ipps://ip-address-or-hostname/resource?option=value +ipps://ip-address-or-hostname/resource?option=value&option=value +ipps://ip-address-or-hostname:port-number/resource +ipps://ip-address-or-hostname:port-number/resource?option=value +ipps://ip-address-or-hostname:port-number/resource?option=value&option=value
The ipp backend supports many options, which are summarized in Table 2.
@@ -148,16 +160,20 @@