*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",
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...
*/