]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/snmp.c
Merge pull request #5913 from apple/bug-fix-rollup-1
[thirdparty/cups.git] / backend / snmp.c
index e66edc98021b399cbab5d397f2414bdd260bcf61..084c6f5118a28388c31000c68b6741ba40c38455 100644 (file)
@@ -1,16 +1,11 @@
 /*
  * SNMP discovery backend for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
- * Copyright 2006-2007 by Easy Software Products, all rights reserved.
+ * Copyright © 2007-2014 by Apple Inc.
+ * Copyright © 2006-2007 by Easy Software Products, all rights reserved.
  *
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- * "LICENSE" which should have been included with this file.  If this
- * file is missing or damaged, see the license at "http://www.cups.org/".
- *
- * This file is subject to the Apple OS-Developed Software exception.
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more
+ * information.
  */
 
 /*
@@ -159,6 +154,8 @@ static const int    UriOID[] = { CUPS_OID_ppmPortServiceNameOrURI, 1, 1, -1 };
 static const int       LexmarkProductOID[] = { 1,3,6,1,4,1,641,2,1,2,1,2,1,-1 };
 static const int       LexmarkProductOID2[] = { 1,3,6,1,4,1,674,10898,100,2,1,2,1,2,1,-1 };
 static const int       LexmarkDeviceIdOID[] = { 1,3,6,1,4,1,641,2,1,2,1,3,1,-1 };
+static const int       HPDeviceIdOID[] = { 1,3,6,1,4,1,11,2,3,9,1,1,7,0,-1 };
+static const int       RicohDeviceIdOID[] = { 1,3,6,1,4,1,367,3,2,1,1,1,11,0,-1 };
 static const int       XeroxProductOID[] = { 1,3,6,1,4,1,128,2,1,3,1,2,0,-1 };
 static cups_array_t    *DeviceURIs = NULL;
 static int             HostNameLookups = 0;
@@ -427,7 +424,7 @@ alarm_handler(int sig)                      /* I - Signal number */
 #endif /* !HAVE_SIGSET && !HAVE_SIGACTION */
 
   if (DebugLevel)
-    write(2, "DEBUG: ALARM!\n", 14);
+    backendMessage("DEBUG: ALARM!\n");
 }
 
 
@@ -974,9 +971,15 @@ read_snmp_response(int fd)         /* I - SNMP socket file descriptor */
        _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
                       packet.community, CUPS_ASN1_GET_REQUEST,
                       DEVICE_ID, LexmarkDeviceIdOID);
+       _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
+                      packet.community, CUPS_ASN1_GET_REQUEST,
+                      DEVICE_ID, RicohDeviceIdOID);
        _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
                       packet.community, CUPS_ASN1_GET_REQUEST,
                       DEVICE_PRODUCT, XeroxProductOID);
+       _cupsSNMPWrite(fd, &(packet.address), CUPS_SNMP_VERSION_1,
+                      packet.community, CUPS_ASN1_GET_REQUEST,
+                      DEVICE_ID, HPDeviceIdOID);
         break;
 
     case DEVICE_DESCRIPTION :