]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Don't collect supply levels via SNMP if cupsSNMPSupplies is not true in PPD.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 6 Oct 2008 22:50:57 +0000 (22:50 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Mon, 6 Oct 2008 22:50:57 +0000 (22:50 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@8022 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
backend/snmp-supplies.c
doc/help/spec-ppd.html

index 9fd042a64f3c9ebd69c90028f0fcf3b365143bef..28f51230c5d092ff6b2ef4537b3424a3dd53b482 100644 (file)
@@ -1,9 +1,12 @@
-CHANGES.txt - 2008-10-01
+CHANGES.txt - 2008-10-06
 ------------------------
 
 CHANGES IN CUPS V1.4b1
 
        - Documentation updates (STR #2567)
+       - Now support the cupsSNMPSupplies keyword to control whether
+         the network backends query the SNMP Printer MIB for supply
+         levels.
        - Now support and use a new banner file format for better text
          support and easier customization (STR #2490)
        - The scheduler now sets the PRINTER_INFO and PRINTER_LOCATION
index dea84fcf14ca5480ed2640326b442da6cf9c73a9..b63ed85c329217d0464a4abc1def97bbef6948a2 100644 (file)
@@ -323,6 +323,8 @@ backend_init_supplies(
                *ptr,                   /* Pointer into value string */
                *name_ptr;              /* Pointer into name string */
   cups_snmp_t  packet;                 /* SNMP response packet */
+  ppd_file_t   *ppd;                   /* PPD file for this queue */
+  ppd_attr_t   *ppdattr;               /* cupsSNMPSupplies attribute */
   static const char * const types[] =  /* Supply types */
                {
                  "other",
@@ -371,6 +373,20 @@ backend_init_supplies(
 
   memset(supplies, 0, sizeof(supplies));
 
+ /*
+  * See if we should be getting supply levels via SNMP...
+  */
+
+  if ((ppd = ppdOpenFile(getenv("PPD"))) != NULL &&
+      (ppdattr = ppdFindAttr(ppd, "cupsSNMPSupplies", NULL)) != NULL &&
+      ppdattr->value && strcasecmp(ppdattr->value, "true"))
+  {
+    ppdClose(ppd);
+    return;
+  }
+
+  ppdClose(ppd);
+
  /*
   * Get the device description...
   */
index fe42bc259ad173061dc8af24d58d8f56ee32c989..9efc44cbbb2bd0b0491277b50c192dabfe6460bd 100644 (file)
@@ -1527,6 +1527,21 @@ before the filter that accepts the given MIME type.</p>
 *cupsPreFilter: "image/png 0 mypngprefilter"
 </pre>
 
+<h3><span class='info'>CUPS 1.4</span><a name='cupsSNMPSupplies'>cupsSNMPSupplies</a></h3>
+
+<p class='summary'>*cupsSNMPSupplies: boolean</p>
+
+<p>This attribute tells the standard network backends whether they should query
+the standard SNMP Printer MIB OIDs for supply levels. The default value is
+<code>True</code>.
+
+<p>Example:</p>
+
+<pre class='command'>
+<em>*% Do not use SNMP queries to report supply levels</em>
+*cupsSNMPSupplies: False
+</pre>
+
 <h3><a name='cupsVersion'>cupsVersion</a></h3>
 
 <p class='summary'>*cupsVersion: major.minor</p>
@@ -1831,6 +1846,9 @@ the device.</p>
        <li>Added <a href='#cupsPJLDisplay'><tt>cupsPJLDisplay</tt></a>
        attribute.</li>
 
+       <li>Added <a href='#cupsSNMPSupplies'><tt>cupsSNMPSupplies</tt></a>
+       attribute.</li>
+
        <li>Added <a href='#cupsUIResolver'><tt>cupsUIResolver</tt></a> and
        <a href='#cupsUIConstraints'><tt>cupsUIConstraints</tt></a>
        attributes.</li>