Imported Upstream version 2.6.3

This commit is contained in:
Arnaud Quette 2012-01-24 11:22:33 +01:00
parent 45043b58d0
commit fad6ced6f6
255 changed files with 11081 additions and 4629 deletions

View file

@ -44,6 +44,7 @@
#include "baytech-mib.h"
#include "compaq-mib.h"
#include "bestpower-mib.h"
#include "cyberpower-mib.h"
#include "ietf-mib.h"
static mib2nut_info_t *mib2nut[] = {
@ -58,6 +59,7 @@ static mib2nut_info_t *mib2nut[] = {
&baytech,
&compaq,
&bestpower,
&cyberpower,
/*
* Prepend vendor specific MIB mappings before IETF, so that
* if a device supports both IETF and vendor specific MIB,
@ -80,7 +82,7 @@ const char *mibvers;
static void disable_transfer_oids(void);
#define DRIVER_NAME "Generic SNMP UPS driver"
#define DRIVER_VERSION "0.56"
#define DRIVER_VERSION "0.58"
/* driver description structure */
upsdrv_info_t upsdrv_info = {
@ -982,20 +984,12 @@ int base_snmp_outlet_index(const char *OID_template)
if (outlet_index_base == -1)
{
/* not initialised yet */
/* Workaround for Eaton Marlin, while waiting for a FW fix and
* a driver rewrite (advanced hooks) */
if ((mibname != NULL) && (!strncmp(mibname, "eaton_epdu", 11)))
{
upsdebugx(3, "Appying Eaton Marlin workaround");
outlet_index_base = base_index = 1;
} else {
for (base_index = 0 ; base_index < 2 ; base_index++) {
sprintf(test_OID, OID_template, base_index);
if (nut_snmp_get(test_OID) != NULL)
break;
}
outlet_index_base = base_index;
for (base_index = 0 ; base_index < 2 ; base_index++) {
sprintf(test_OID, OID_template, base_index);
if (nut_snmp_get(test_OID) != NULL)
break;
}
outlet_index_base = base_index;
}
upsdebugx(3, "base_snmp_outlet_index: %i", outlet_index_base);
return base_index;
@ -1218,6 +1212,7 @@ bool_t snmp_ups_walk(int mode)
/* add outlet instant commands to the info database. */
if (SU_TYPE(su_info_p) == SU_TYPE_CMD) {
/* FIXME: only add if "su_ups_get(cur_info_p) == TRUE" */
if (mode == SU_WALKMODE_INIT)
dstate_addcmd(cur_info_p.info_type);
}