snmp.c revision 4e9cfc9a015e8ca7d41f7d018c74dc8a692305b3
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Licensed under the Academic Free License version 2.1
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <glib.h>
#include <libhal.h>
#include <logger.h>
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include "network-discovery.h"
#include "printer.h"
#define NP(x) (x?x:"NULL")
static void
{
/* most printers listen on the appsocket port (9100) */
char device[128];
}
/*
* This would be a good place to detect other types of devices or other
* device capabilities. scanners, removable media, storage, ...
*/
}
static int
{
char *name;
/* have we already seen this network device */
return (0);
}
char *network)
{
unsigned int oid_len = MAX_OID_LEN;
HAL_DEBUG(("scan_for_devices_using_snmp(0x%8.8x, %s, %s, %s)",
init_snmp("snmp-scan");
init_mib();
/* initialize the SNMP session */
return (FALSE);
/* initialize the request PDU */
/* add the requested data (everyone should have a sysDescr.0) */
snmp_perror("sysDescr.0");
/* detect any new devices */
while (1) {
if (fds < 0) {
perror("select failed");
continue;
} if (fds == 0) {
break;
} else {
}
}
snmp_close(ss);
/* add the newly detected devices */
}
return (TRUE);
}