]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/snmp.c
Load cups into easysw/current.
[thirdparty/cups.git] / backend / snmp.c
index 478dc5abd982533b7d1f235026ded191d77eef8b..8ac2dea4fd004c11f953fa41b194399c9d587fd9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: snmp.c 5479 2006-05-02 15:03:17Z mike $"
+ * "$Id: snmp.c 5663 2006-06-15 20:36:42Z mike $"
  *
  *   SNMP discovery backend for the Common UNIX Printing System (CUPS).
  *
  * Include necessary headers.
  */
 
-#include <cups/backend.h>
 #include <cups/http-private.h>
-#include <cups/cups.h>
-#include <cups/string.h>
+#include "backend-private.h"
 #include <cups/array.h>
 #include <cups/file.h>
-#include <errno.h>
-#include <signal.h>
-
-#define SNMP_BACKEND
-#include "ieee1284.c"
 
 
 /*
@@ -1647,6 +1640,14 @@ probe_device(snmp_cache_t *device)       /* I - Device */
             !strchr(info->values[0].string.text, ';')))
          info = NULL;
 
+       /*
+        * Don't use the printer-make-and-model if it contains a generic
+       * string like "Ricoh IPP Printer"...
+       */
+
+       if (model && strstr(model->values[0].string.text, "IPP Printer"))
+         model = NULL;
+
        /*
         * If we don't have a printer-make-and-model string from the printer
        * but do have the 1284 device ID string, generate a make-and-model
@@ -1656,7 +1657,9 @@ probe_device(snmp_cache_t *device)        /* I - Device */
        if (model)
           strlcpy(temp, model->values[0].string.text, sizeof(temp));
        else if (info)
-         get_make_model(info->values[0].string.text, temp, sizeof(temp));
+         backendGetMakeModel(info->values[0].string.text, temp, sizeof(temp));
+        else
+         temp[0] = '\0';
 
         fix_make_model(make_model, temp, sizeof(make_model));
 
@@ -1928,8 +1931,8 @@ read_snmp_response(int fd)                /* I - SNMP socket file descriptor */
       * Description is the IEEE-1284 device ID...
       */
 
-      get_make_model(packet.object_value.string, make_model,
-                     sizeof(make_model));
+      backendGetMakeModel(packet.object_value.string, make_model,
+                         sizeof(make_model));
     }
     else
     {
@@ -2212,5 +2215,5 @@ update_cache(snmp_cache_t *device,        /* I - Device */
 
 
 /*
- * End of "$Id: snmp.c 5479 2006-05-02 15:03:17Z mike $".
+ * End of "$Id: snmp.c 5663 2006-06-15 20:36:42Z mike $".
  */