diff --git a/drivers/apc-ats-mib.c b/drivers/apc-ats-mib.c index 3765f79443..4212989a22 100644 --- a/drivers/apc-ats-mib.c +++ b/drivers/apc-ats-mib.c @@ -30,30 +30,30 @@ #define APC_ATS_OID_MODEL_NAME ".1.3.6.1.4.1.318.1.1.8.1.5.0" static info_lkp_t ats_sensitivity_info[] = { - { 1, "high" }, - { 2, "low" }, - { 0, NULL } + { 1, "high", NULL, NULL }, + { 2, "low", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ats_output_status_info[] = { - { 1, "OFF" }, /* fail */ - { 2, "OL" }, /* ok */ - { 0, NULL } + { 1, "OFF", NULL, NULL }, /* fail */ + { 2, "OL", NULL, NULL }, /* ok */ + { 0, NULL, NULL, NULL } }; static info_lkp_t ats_outletgroups_name_info[] = { - { 1, "total" }, - { 2, "bank1" }, - { 3, "bank2" }, - { 0, NULL } + { 1, "total", NULL, NULL }, + { 2, "bank1", NULL, NULL }, + { 3, "bank2", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ats_outletgroups_status_info[] = { - { 1, "OL" }, /* normal */ - { 2, "" }, /* lowload */ - { 3, "" }, /* nearoverload */ - { 4, "OVER" }, /* overload */ - { 0, NULL } + { 1, "OL", NULL, NULL }, /* normal */ + { 2, "", NULL, NULL }, /* lowload */ + { 3, "", NULL, NULL }, /* nearoverload */ + { 4, "OVER", NULL, NULL }, /* overload */ + { 0, NULL, NULL, NULL } }; /* APC ATS Snmp2NUT lookup table */ @@ -445,4 +445,4 @@ static snmp_info_t apc_ats_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t apc_ats = { "apc_ats", APC_ATS_MIB_VERSION, NULL, APC_ATS_OID_MODEL_NAME, apc_ats_mib, APC_ATS_SYSOID }; +mib2nut_info_t apc_ats = { "apc_ats", APC_ATS_MIB_VERSION, NULL, APC_ATS_OID_MODEL_NAME, apc_ats_mib, APC_ATS_SYSOID, NULL }; diff --git a/drivers/apc-hid.c b/drivers/apc-hid.c index 4fe6b86144..e7dce380e2 100644 --- a/drivers/apc-hid.c +++ b/drivers/apc-hid.c @@ -41,7 +41,7 @@ char * tweak_max_report[] = { /* Back-UPS ES 700 does NOT overflow. */ /* Back-UPS ES 725 does NOT overflow. */ /* Back-UPS ES 525 overflows on ReportID 0x0c - (UPS.PowerSummary.RemainingCapacity).*/ + (UPS.PowerSummary.RemainingCapacity). */ "Back-UPS ES 525", /* Back-UPS CS 650 overflows on ReportID 0x46 */ "Back-UPS CS", @@ -125,52 +125,52 @@ static const char *apc_date_conversion_fun(double value) } info_lkp_t apc_date_conversion[] = { - { 0, NULL, apc_date_conversion_fun } + { 0, NULL, apc_date_conversion_fun, NULL } }; /* This was determined empirically from observing a BackUPS LS 500 */ static info_lkp_t apcstatusflag_info[] = { - { 8, "!off", NULL }, /* Normal operation */ - { 16, "!off", NULL }, /* This occurs briefly during power-on, and corresponds to status 'DISCHRG'. */ - { 0, "off", NULL }, - { 0, NULL, NULL } + { 8, "!off", NULL, NULL }, /* Normal operation */ + { 16, "!off", NULL, NULL }, /* This occurs briefly during power-on, and corresponds to status 'DISCHRG'. */ + { 0, "off", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Reason of the last battery transfer (from apcupsd) */ static info_lkp_t apc_linefailcause_vrange_info[] = { - { 1, "vrange", NULL }, /* Low line voltage */ - { 2, "vrange", NULL }, /* High line voltage */ - { 4, "vrange", NULL }, /* notch, spike, or blackout */ - { 8, "vrange", NULL }, /* Notch or blackout */ - { 9, "vrange", NULL }, /* Spike or blackout */ - { 0, "!vrange", NULL }, /* No transfers have ocurred */ - { 0, NULL, NULL } + { 1, "vrange", NULL, NULL }, /* Low line voltage */ + { 2, "vrange", NULL, NULL }, /* High line voltage */ + { 4, "vrange", NULL, NULL }, /* notch, spike, or blackout */ + { 8, "vrange", NULL, NULL }, /* Notch or blackout */ + { 9, "vrange", NULL, NULL }, /* Spike or blackout */ + { 0, "!vrange", NULL, NULL }, /* No transfers have ocurred */ + { 0, NULL, NULL, NULL } }; static info_lkp_t apc_linefailcause_frange_info[] = { - { 7, "frange", NULL }, /* Input frequency out of range */ - { 0, "!frange", NULL }, /* No transfers have ocurred */ - { 0, NULL, NULL } + { 7, "frange", NULL, NULL }, /* Input frequency out of range */ + { 0, "!frange", NULL, NULL }, /* No transfers have ocurred */ + { 0, NULL, NULL, NULL } }; #if 0 /* these input.transfer.reason can't be mapped at the moment... */ - { 3, "ripple", NULL }, /* Ripple */ - { 5, "self test", NULL }, /* Self Test or Discharge Calibration commanded - * Test usage, front button, or 2 week self test */ - { 6, "forced", NULL }, /* DelayBeforeShutdown or APCDelayBeforeShutdown */ - { 10, "forced", NULL }, /* Graceful shutdown by accessories */ - { 11, "self test", NULL }, /* Test usage invoked */ - { 12, "self test", NULL }, /* Front button initiated self test */ - { 13, "self test", NULL }, /* 2 week self test */ - { 0, NULL, NULL } + { 3, "ripple", NULL, NULL }, /* Ripple */ + { 5, "self test", NULL, NULL }, /* Self Test or Discharge Calibration commanded + * Test usage, front button, or 2 week self test */ + { 6, "forced", NULL, NULL }, /* DelayBeforeShutdown or APCDelayBeforeShutdown */ + { 10, "forced", NULL, NULL }, /* Graceful shutdown by accessories */ + { 11, "self test", NULL, NULL }, /* Test usage invoked */ + { 12, "self test", NULL, NULL }, /* Front button initiated self test */ + { 13, "self test", NULL, NULL }, /* 2 week self test */ + { 0, NULL, NULL, NULL } #endif static info_lkp_t apc_sensitivity_info[] = { - { 0, "low", NULL }, - { 1, "medium", NULL }, - { 2, "high", NULL }, - { 0, NULL, NULL } + { 0, "low", NULL, NULL }, + { 1, "medium", NULL, NULL }, + { 2, "high", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* --------------------------------------------------------------- */ @@ -395,7 +395,7 @@ static hid_info_t apc_hid2nut[] = { /* { "ambient.temperature", 0, 0, "UPS.APCEnvironment.APCProbe2.Temperature", NULL, "%.1f", 0, kelvin_celsius_conversion }, { "ambient.humidity", 0, 0, "UPS.APCEnvironment.APCProbe2.Humidity", NULL, "%.1f", 0, NULL }, - */ +*/ /* instant commands. */ /* test.* split into subset while waiting for extradata support diff --git a/drivers/apc-mib.c b/drivers/apc-mib.c index 3d0d877bbf..a06e2a63ee 100644 --- a/drivers/apc-mib.c +++ b/drivers/apc-mib.c @@ -28,6 +28,10 @@ #define APCC_MIB_VERSION "1.3" +#define APC_UPS_DEVICE_MODEL ".1.3.6.1.4.1.318.1.1.1.1.1.1.0" +/* FIXME: Find a better oid_auto_check vs sysOID for this one? */ +#define APC_UPS_SYSOID APC_UPS_DEVICE_MODEL + /* Other APC sysOID: * * examples found on the Net and other sources: @@ -60,75 +64,75 @@ #define APCC_OID_BATT_STATUS ".1.3.6.1.4.1.318.1.1.1.2.1.1.0" /* Defines for APCC_OID_BATT_STATUS */ static info_lkp_t apcc_batt_info[] = { - { 1, "" }, /* unknown */ - { 2, "" }, /* batteryNormal */ - { 3, "LB" }, /* batteryLow */ - { 0, NULL } + { 1, "", NULL, NULL }, /* unknown */ + { 2, "", NULL, NULL }, /* batteryNormal */ + { 3, "LB", NULL, NULL }, /* batteryLow */ + { 0, NULL, NULL, NULL } } ; #define APCC_OID_POWER_STATUS ".1.3.6.1.4.1.318.1.1.1.4.1.1.0" /* Defines for APCC_OID_POWER_STATUS */ static info_lkp_t apcc_pwr_info[] = { - { 1, "" }, /* unknown */ - { 2, "OL" }, /* onLine */ - { 3, "OB" }, /* onBattery */ - { 4, "OL BOOST" }, /* onSmartBoost */ - { 5, "OFF" }, /* timedSleeping */ - { 6, "OFF" }, /* softwareBypass */ - { 7, "OFF" }, /* off */ - { 8, "" }, /* rebooting */ - { 9, "BYPASS" }, /* switchedBypass */ - { 10, "BYPASS" }, /* hardwareFailureBypass */ - { 11, "OFF" }, /* sleepingUntilPowerReturn */ - { 12, "OL TRIM" }, /* onSmartTrim */ - { 0, NULL } + { 1, "", NULL, NULL }, /* unknown */ + { 2, "OL", NULL, NULL }, /* onLine */ + { 3, "OB", NULL, NULL }, /* onBattery */ + { 4, "OL BOOST", NULL, NULL }, /* onSmartBoost */ + { 5, "OFF", NULL, NULL }, /* timedSleeping */ + { 6, "OFF", NULL, NULL }, /* softwareBypass */ + { 7, "OFF", NULL, NULL }, /* off */ + { 8, "", NULL, NULL }, /* rebooting */ + { 9, "BYPASS", NULL, NULL }, /* switchedBypass */ + { 10, "BYPASS", NULL, NULL }, /* hardwareFailureBypass */ + { 11, "OFF", NULL, NULL }, /* sleepingUntilPowerReturn */ + { 12, "OL TRIM", NULL, NULL }, /* onSmartTrim */ + { 0, NULL, NULL, NULL } } ; #define APCC_OID_CAL_RESULTS ".1.3.6.1.4.1.318.1.1.1.7.2.6.0" static info_lkp_t apcc_cal_info[] = { - { 1, "" }, /* Calibration Successful */ - { 2, "" }, /* Calibration not done, battery capacity below 100% */ - { 3, "CAL" }, /* Calibration in progress */ - { 0, NULL } + { 1, "", NULL, NULL }, /* Calibration Successful */ + { 2, "", NULL, NULL }, /* Calibration not done, battery capacity below 100% */ + { 3, "CAL", NULL, NULL }, /* Calibration in progress */ + { 0, NULL, NULL, NULL } }; #define APCC_OID_NEEDREPLBATT ".1.3.6.1.4.1.318.1.1.1.2.2.4.0" static info_lkp_t apcc_battrepl_info[] = { - { 1, "" }, /* No battery needs replacing */ - { 2, "RB" }, /* Batteries need to be replaced */ - { 0, NULL } + { 1, "", NULL, NULL }, /* No battery needs replacing */ + { 2, "RB", NULL, NULL }, /* Batteries need to be replaced */ + { 0, NULL, NULL, NULL } }; #define APCC_OID_TESTDIAGRESULTS ".1.3.6.1.4.1.318.1.1.1.7.2.3.0" static info_lkp_t apcc_testdiag_results[] = { - { 1, "Ok" }, - { 2, "Failed" }, - { 3, "InvalidTest" }, - { 4, "TestInProgress"}, - { 0, NULL } + { 1, "Ok", NULL, NULL }, + { 2, "Failed", NULL, NULL }, + { 3, "InvalidTest", NULL, NULL }, + { 4, "TestInProgress", NULL, NULL }, + { 0, NULL, NULL, NULL } }; #define APCC_OID_SENSITIVITY ".1.3.6.1.4.1.318.1.1.1.5.2.7.0" static info_lkp_t apcc_sensitivity_modes[] = { - { 1, "auto" }, - { 2, "low" }, - { 3, "medium" }, - { 4, "high" }, - { 0, NULL } + { 1, "auto", NULL, NULL }, + { 2, "low", NULL, NULL }, + { 3, "medium", NULL, NULL }, + { 4, "high", NULL, NULL }, + { 0, NULL, NULL, NULL } }; #define APCC_OID_TRANSFERREASON "1.3.6.1.4.1.318.1.1.1.3.2.5.0" static info_lkp_t apcc_transfer_reasons[] = { - { 1, "noTransfer" }, - { 2, "highLineVoltage" }, - { 3, "brownout" }, - { 4, "blackout" }, - { 5, "smallMomentarySag" }, - { 6, "deepMomentarySag" }, - { 7, "smallMomentarySpike" }, - { 8, "largeMomentarySpike" }, - { 9, "selfTest" }, - { 10, "rateOfVoltageChange" } + { 1, "noTransfer", NULL, NULL }, + { 2, "highLineVoltage", NULL, NULL }, + { 3, "brownout", NULL, NULL }, + { 4, "blackout", NULL, NULL }, + { 5, "smallMomentarySag", NULL, NULL }, + { 6, "deepMomentarySag", NULL, NULL }, + { 7, "smallMomentarySpike", NULL, NULL }, + { 8, "largeMomentarySpike", NULL, NULL }, + { 9, "selfTest", NULL, NULL }, + { 10, "rateOfVoltageChange", NULL, NULL } }; /* --- */ @@ -296,7 +300,7 @@ static snmp_info_t apcc_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t apc = { "apcc", APCC_MIB_VERSION, APCC_OID_POWER_STATUS, ".1.3.6.1.4.1.318.1.1.1.1.1.1.0", apcc_mib }; +mib2nut_info_t apc = { "apcc", APCC_MIB_VERSION, APCC_OID_POWER_STATUS, APC_UPS_DEVICE_MODEL, apcc_mib, APC_UPS_SYSOID, NULL }; /* vim:ts=4:sw=4:et: diff --git a/drivers/apc-pdu-mib.c b/drivers/apc-pdu-mib.c index dea0caded0..7ddfe7addb 100644 --- a/drivers/apc-pdu-mib.c +++ b/drivers/apc-pdu-mib.c @@ -28,18 +28,19 @@ #define APC_PDU_MIB_SYSOID_RPDU ".1.3.6.1.4.1.318.1.3.4.4" #define APC_PDU_MIB_SYSOID_RPDU2 ".1.3.6.1.4.1.318.1.3.4.5" #define APC_PDU_MIB_SYSOID_MSP ".1.3.6.1.4.1.318.1.3.4.6" +#define APC_PDU_DEVICE_MODEL ".1.3.6.1.4.1.318.1.1.4.1.4.0" static info_lkp_t apc_pdu_sw_outlet_status_info[] = { - { 1, "on" }, - { 2, "off" }, - { 0, NULL } + { 1, "on", NULL, NULL }, + { 2, "off", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t apc_pdu_sw_outlet_switchability_info[] = { - { 1, "yes" }, - { 2, "yes" }, - { 0, NULL } + { 1, "yes", NULL, NULL }, + { 2, "yes", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* POWERNET-MIB Snmp2NUT lookup table */ @@ -966,7 +967,6 @@ static snmp_info_t apc_pdu_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -#define APC_PDU_DEVICE_MODEL ".1.3.6.1.4.1.318.1.1.4.1.4.0" -mib2nut_info_t apc_pdu_rpdu = { "apc_pdu", APC_PDU_MIB_VERSION, NULL, APC_PDU_DEVICE_MODEL, apc_pdu_mib, APC_PDU_MIB_SYSOID_RPDU }; -mib2nut_info_t apc_pdu_rpdu2 = { "apc_pdu", APC_PDU_MIB_VERSION, NULL, APC_PDU_DEVICE_MODEL, apc_pdu_mib, APC_PDU_MIB_SYSOID_RPDU2 }; -mib2nut_info_t apc_pdu_msp = { "apc_pdu", APC_PDU_MIB_VERSION, NULL, APC_PDU_DEVICE_MODEL, apc_pdu_mib, APC_PDU_MIB_SYSOID_MSP }; +mib2nut_info_t apc_pdu_rpdu = { "apc_pdu", APC_PDU_MIB_VERSION, NULL, APC_PDU_DEVICE_MODEL, apc_pdu_mib, APC_PDU_MIB_SYSOID_RPDU, NULL }; +mib2nut_info_t apc_pdu_rpdu2 = { "apc_pdu", APC_PDU_MIB_VERSION, NULL, APC_PDU_DEVICE_MODEL, apc_pdu_mib, APC_PDU_MIB_SYSOID_RPDU2, NULL }; +mib2nut_info_t apc_pdu_msp = { "apc_pdu", APC_PDU_MIB_VERSION, NULL, APC_PDU_DEVICE_MODEL, apc_pdu_mib, APC_PDU_MIB_SYSOID_MSP, NULL }; diff --git a/drivers/apcsmart_tabs.c b/drivers/apcsmart_tabs.c index 9cefa42769..410c150e2a 100644 --- a/drivers/apcsmart_tabs.c +++ b/drivers/apcsmart_tabs.c @@ -23,55 +23,55 @@ /* APC_MULTI variables *must* be listed in order of preference */ apc_vartab_t apc_vartab[] = { +/* name cmd flags regex nlen0 cnt */ + { "ups.temperature", 'C', APC_POLL|APC_F_CELSIUS, NULL, 0, 0 }, + { "ups.load", 'P', APC_POLL|APC_F_PERCENT, NULL, 0, 0 }, + { "ups.test.interval", 'E', APC_F_HOURS, NULL, 0, 0 }, + { "ups.test.result", 'X', APC_POLL, NULL, 0, 0 }, + { "ups.delay.start", 'r', APC_F_SECONDS, NULL, 0, 0 }, + { "ups.delay.shutdown", 'p', APC_F_SECONDS, NULL, 0, 0 }, + { "ups.id", 'c', APC_STRING, NULL, 0, 0 }, + { "ups.contacts", 'i', APC_POLL|APC_F_HEX, NULL, 0, 0 }, + { "ups.display.language", '\014', 0, NULL, 0, 0 }, + { "input.voltage", 'L', APC_POLL|APC_F_VOLT, NULL, 0, 0 }, + { "input.frequency", 'F', APC_POLL|APC_F_DEC, NULL, 0, 0 }, + { "input.sensitivity", 's', 0, NULL, 0, 0 }, + { "input.quality", '9', APC_POLL|APC_F_HEX, NULL, 0, 0 }, + { "input.transfer.low", 'l', APC_F_VOLT, NULL, 0, 0 }, + { "input.transfer.high", 'u', APC_F_VOLT, NULL, 0, 0 }, + { "input.transfer.reason", 'G', APC_POLL|APC_F_REASON, NULL, 0, 0 }, + { "input.voltage.maximum", 'M', APC_POLL|APC_F_VOLT, NULL, 0, 0 }, + { "input.voltage.minimum", 'N', APC_POLL|APC_F_VOLT, NULL, 0, 0 }, + { "output.current", '/', APC_POLL|APC_F_AMP, NULL, 0, 0 }, + { "output.voltage", 'O', APC_POLL|APC_F_VOLT, NULL, 0, 0 }, + { "output.voltage.nominal", 'o', APC_F_VOLT, NULL, 0, 0 }, + { "ambient.humidity", 'h', APC_POLL|APC_F_PERCENT, NULL, 0, 0 }, + { "ambient.0.humidity", 'H', APC_POLL|APC_PACK|APC_F_PERCENT, NULL, 0, 0 }, + { "ambient.0.humidity.high", '{', APC_POLL|APC_PACK|APC_F_PERCENT, NULL, 0, 0 }, + { "ambient.0.humidity.low", '}', APC_POLL|APC_PACK|APC_F_PERCENT, NULL, 0, 0 }, + { "ambient.temperature", 't', APC_POLL|APC_F_CELSIUS, NULL, 0, 0 }, + { "ambient.0.temperature", 'T', APC_MULTI|APC_POLL|APC_PACK|APC_F_CELSIUS, "^[0-9]{2}\\.[0-9]{2}$", 0, 0 }, + { "ambient.0.temperature.high", '[', APC_POLL|APC_PACK|APC_F_CELSIUS, NULL, 0, 0 }, + { "ambient.0.temperature.low", ']', APC_POLL|APC_PACK|APC_F_CELSIUS, NULL, 0, 0 }, + { "battery.date", 'x', APC_STRING, NULL, 0, 0 }, + { "battery.charge", 'f', APC_POLL|APC_F_PERCENT, NULL, 0, 0 }, + { "battery.charge.restart", 'e', APC_F_PERCENT, NULL, 0, 0 }, + { "battery.voltage", 'B', APC_POLL|APC_F_VOLT, NULL, 0, 0 }, + { "battery.voltage.nominal", 'g', 0, NULL, 0, 0 }, + { "battery.runtime", 'j', APC_POLL|APC_F_MINUTES, NULL, 0, 0 }, + { "battery.runtime.low", 'q', APC_F_MINUTES, NULL, 0, 0 }, + { "battery.packs", '>', APC_F_DEC, NULL, 0, 0 }, + { "battery.packs.bad", '<', APC_F_DEC, NULL, 0, 0 }, + { "battery.alarm.threshold", 'k', 0, NULL, 0, 0 }, + { "device.uptime", 'T', APC_MULTI|APC_POLL|APC_F_HOURS, "^[0-9]{3}\\.[0-9]{1}$", 0, 0 }, + { "ups.serial", 'n', 0, NULL, 0, 0 }, + { "ups.mfr.date", 'm', 0, NULL, 0, 0 }, + { "ups.model", '\001', 0, NULL, 0, 0 }, + { "ups.firmware.aux", 'v', 0, NULL, 0, 0 }, + { "ups.firmware", 'b', APC_MULTI, "^[[:alnum:]]+\\.[[:alnum:]]+\\.[[:alnum:]]+$", 0, 0 }, + { "ups.firmware", 'V', APC_MULTI, NULL, 0, 0 }, - { "ups.temperature", 'C', APC_POLL|APC_F_CELSIUS }, - { "ups.load", 'P', APC_POLL|APC_F_PERCENT }, - { "ups.test.interval", 'E', APC_F_HOURS }, - { "ups.test.result", 'X', APC_POLL }, - { "ups.delay.start", 'r', APC_F_SECONDS }, - { "ups.delay.shutdown", 'p', APC_F_SECONDS }, - { "ups.id", 'c', APC_STRING }, - { "ups.contacts", 'i', APC_POLL|APC_F_HEX }, - { "ups.display.language", '\014' }, - { "input.voltage", 'L', APC_POLL|APC_F_VOLT }, - { "input.frequency", 'F', APC_POLL|APC_F_DEC }, - { "input.sensitivity", 's', }, - { "input.quality", '9', APC_POLL|APC_F_HEX }, - { "input.transfer.low", 'l', APC_F_VOLT }, - { "input.transfer.high", 'u', APC_F_VOLT }, - { "input.transfer.reason", 'G', APC_POLL|APC_F_REASON }, - { "input.voltage.maximum", 'M', APC_POLL|APC_F_VOLT }, - { "input.voltage.minimum", 'N', APC_POLL|APC_F_VOLT }, - { "output.current", '/', APC_POLL|APC_F_AMP }, - { "output.voltage", 'O', APC_POLL|APC_F_VOLT }, - { "output.voltage.nominal", 'o', APC_F_VOLT }, - { "ambient.humidity", 'h', APC_POLL|APC_F_PERCENT }, - { "ambient.0.humidity", 'H', APC_POLL|APC_PACK|APC_F_PERCENT }, - { "ambient.0.humidity.high", '{', APC_POLL|APC_PACK|APC_F_PERCENT }, - { "ambient.0.humidity.low", '}', APC_POLL|APC_PACK|APC_F_PERCENT }, - { "ambient.temperature", 't', APC_POLL|APC_F_CELSIUS }, - { "ambient.0.temperature", 'T', APC_MULTI|APC_POLL|APC_PACK|APC_F_CELSIUS, "^[0-9]{2}\\.[0-9]{2}$" }, - { "ambient.0.temperature.high", '[', APC_POLL|APC_PACK|APC_F_CELSIUS }, - { "ambient.0.temperature.low", ']', APC_POLL|APC_PACK|APC_F_CELSIUS }, - { "battery.date", 'x', APC_STRING }, - { "battery.charge", 'f', APC_POLL|APC_F_PERCENT }, - { "battery.charge.restart", 'e', APC_F_PERCENT }, - { "battery.voltage", 'B', APC_POLL|APC_F_VOLT }, - { "battery.voltage.nominal", 'g', }, - { "battery.runtime", 'j', APC_POLL|APC_F_MINUTES }, - { "battery.runtime.low", 'q', APC_F_MINUTES }, - { "battery.packs", '>', APC_F_DEC }, - { "battery.packs.bad", '<', APC_F_DEC }, - { "battery.alarm.threshold", 'k', }, - { "device.uptime", 'T', APC_MULTI|APC_POLL|APC_F_HOURS, "^[0-9]{3}\\.[0-9]{1}$" }, - { "ups.serial", 'n', }, - { "ups.mfr.date", 'm', }, - { "ups.model", '\001' }, - { "ups.firmware.aux", 'v', }, - { "ups.firmware", 'b', APC_MULTI, "^[[:alnum:]]+\\.[[:alnum:]]+\\.[[:alnum:]]+$" }, - { "ups.firmware", 'V', APC_MULTI }, - - { NULL } + { NULL, 0, 0, NULL, 0, 0 } /* todo: I = alarm enable (hex field) - split into alarm.n.enable @@ -156,6 +156,11 @@ apc_compattab_t apc_compattab[] = { upsdrv_info_t apc_tab_info = { "APC command table", - APC_TABLE_VERSION + APC_TABLE_VERSION, + "Russell Kroll \n" \ + "Nigel Metheringham \n" \ + "Michal Soltys ", + DRV_STABLE, + { NULL } }; diff --git a/drivers/baytech-mib.c b/drivers/baytech-mib.c index faacbafead..8cedd59f77 100644 --- a/drivers/baytech-mib.c +++ b/drivers/baytech-mib.c @@ -31,11 +31,11 @@ #define BAYTECH_OID_MODEL_NAME ".1.3.6.1.4.1.4779.1.3.5.2.1.24.1" static info_lkp_t outlet_status_info[] = { - { -1, "error" }, - { 0, "off" }, - { 1, "on" }, - { 2, "cycling" }, /* transitional status */ - { 0, NULL } + { -1, "error", NULL, NULL }, + { 0, "off", NULL, NULL }, + { 1, "on", NULL, NULL }, + { 2, "cycling", NULL, NULL }, /* transitional status */ + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table for BayTech MIBs */ @@ -89,4 +89,4 @@ static snmp_info_t baytech_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t baytech = { "baytech", BAYTECH_MIB_VERSION, NULL, BAYTECH_OID_MODEL_NAME, baytech_mib }; +mib2nut_info_t baytech = { "baytech", BAYTECH_MIB_VERSION, NULL, BAYTECH_OID_MODEL_NAME, baytech_mib, BAYTECH_OID_MIB, NULL }; diff --git a/drivers/bcmxcp.c b/drivers/bcmxcp.c index f793aaa7af..b756ea5af7 100644 --- a/drivers/bcmxcp.c +++ b/drivers/bcmxcp.c @@ -177,60 +177,60 @@ const char *horn_stat[3] = {"disabled", "enabled", "muted"}; /* Battery test results */ info_lkp_t batt_test_info[] = { - { 0, "No test initiated", NULL }, - { 1, "In progress", NULL }, - { 2, "Done and passed", NULL }, - { 3, "Aborted", NULL }, - { 4, "Done and error", NULL }, - { 5, "Test scheduled", NULL }, + { 0, "No test initiated", NULL, NULL }, + { 1, "In progress", NULL, NULL }, + { 2, "Done and passed", NULL, NULL }, + { 3, "Aborted", NULL, NULL }, + { 4, "Done and error", NULL, NULL }, + { 5, "Test scheduled", NULL, NULL }, /* Not sure about the meaning of the below ones! */ - { 6, NULL, NULL }, /* The string was present but it has now been removed */ - { 7, NULL, NULL }, /* The string was not installed at the last power up */ - { 0, NULL, NULL } + { 6, NULL, NULL, NULL }, /* The string was present but it has now been removed */ + { 7, NULL, NULL, NULL }, /* The string was not installed at the last power up */ + { 0, NULL, NULL, NULL } }; /* Topology map results */ info_lkp_t topology_info[] = { - { BCMXCP_TOPOLOGY_OFFLINE_SWITCHER_1P, "Off-line switcher, Single Phase", NULL }, - { BCMXCP_TOPOLOGY_LINEINT_UPS_1P, "Line-Interactive UPS, Single Phase", NULL }, - { BCMXCP_TOPOLOGY_LINEINT_UPS_2P, "Line-Interactive UPS, Two Phase", NULL }, - { BCMXCP_TOPOLOGY_LINEINT_UPS_3P, "Line-Interactive UPS, Three Phase", NULL }, - { BCMXCP_TOPOLOGY_DUAL_AC_ONLINE_UPS_1P, "Dual AC Input, On-Line UPS, Single Phase", NULL }, - { BCMXCP_TOPOLOGY_DUAL_AC_ONLINE_UPS_2P, "Dual AC Input, On-Line UPS, Two Phase", NULL }, - { BCMXCP_TOPOLOGY_DUAL_AC_ONLINE_UPS_3P, "Dual AC Input, On-Line UPS, Three Phase", NULL }, - { BCMXCP_TOPOLOGY_ONLINE_UPS_1P, "On-Line UPS, Single Phase", NULL }, - { BCMXCP_TOPOLOGY_ONLINE_UPS_2P, "On-Line UPS, Two Phase", NULL }, - { BCMXCP_TOPOLOGY_ONLINE_UPS_3P, "On-Line UPS, Three Phase", NULL }, - { BCMXCP_TOPOLOGY_PARA_REDUND_ONLINE_UPS_1P, "Parallel Redundant On-Line UPS, Single Phase", NULL }, - { BCMXCP_TOPOLOGY_PARA_REDUND_ONLINE_UPS_2P, "Parallel Redundant On-Line UPS, Two Phase", NULL }, - { BCMXCP_TOPOLOGY_PARA_REDUND_ONLINE_UPS_3P, "Parallel Redundant On-Line UPS, Three Phase", NULL }, - { BCMXCP_TOPOLOGY_PARA_CAPACITY_ONLINE_UPS_1P, "Parallel for Capacity On-Line UPS, Single Phase", NULL }, - { BCMXCP_TOPOLOGY_PARA_CAPACITY_ONLINE_UPS_2P, "Parallel for Capacity On-Line UPS, Two Phase", NULL }, - { BCMXCP_TOPOLOGY_PARA_CAPACITY_ONLINE_UPS_3P, "Parallel for Capacity On-Line UPS, Three Phase", NULL }, - { BCMXCP_TOPOLOGY_SYSTEM_BYPASS_MODULE_3P, "System Bypass Module, Three Phase", NULL }, - { BCMXCP_TOPOLOGY_HOT_TIE_CABINET_3P, "Hot-Tie Cabinet, Three Phase", NULL }, - { BCMXCP_TOPOLOGY_OUTLET_CONTROLLER_1P, "Outlet Controller, Single Phase", NULL }, - { BCMXCP_TOPOLOGY_DUAL_AC_STATIC_SWITCH_3P, "Dual AC Input Static Switch Module, 3 Phase", NULL }, - { 0, NULL, NULL } + { BCMXCP_TOPOLOGY_OFFLINE_SWITCHER_1P, "Off-line switcher, Single Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_LINEINT_UPS_1P, "Line-Interactive UPS, Single Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_LINEINT_UPS_2P, "Line-Interactive UPS, Two Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_LINEINT_UPS_3P, "Line-Interactive UPS, Three Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_DUAL_AC_ONLINE_UPS_1P, "Dual AC Input, On-Line UPS, Single Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_DUAL_AC_ONLINE_UPS_2P, "Dual AC Input, On-Line UPS, Two Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_DUAL_AC_ONLINE_UPS_3P, "Dual AC Input, On-Line UPS, Three Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_ONLINE_UPS_1P, "On-Line UPS, Single Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_ONLINE_UPS_2P, "On-Line UPS, Two Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_ONLINE_UPS_3P, "On-Line UPS, Three Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_PARA_REDUND_ONLINE_UPS_1P, "Parallel Redundant On-Line UPS, Single Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_PARA_REDUND_ONLINE_UPS_2P, "Parallel Redundant On-Line UPS, Two Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_PARA_REDUND_ONLINE_UPS_3P, "Parallel Redundant On-Line UPS, Three Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_PARA_CAPACITY_ONLINE_UPS_1P, "Parallel for Capacity On-Line UPS, Single Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_PARA_CAPACITY_ONLINE_UPS_2P, "Parallel for Capacity On-Line UPS, Two Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_PARA_CAPACITY_ONLINE_UPS_3P, "Parallel for Capacity On-Line UPS, Three Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_SYSTEM_BYPASS_MODULE_3P, "System Bypass Module, Three Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_HOT_TIE_CABINET_3P, "Hot-Tie Cabinet, Three Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_OUTLET_CONTROLLER_1P, "Outlet Controller, Single Phase", NULL, NULL }, + { BCMXCP_TOPOLOGY_DUAL_AC_STATIC_SWITCH_3P, "Dual AC Input Static Switch Module, 3 Phase", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Command map results */ info_lkp_t command_map_info[] = { - { PW_INIT_BAT_TEST, "test.battery.start", NULL }, - { PW_LOAD_OFF_RESTART, "shutdown.return", NULL }, - { PW_UPS_OFF, "shutdown.stayoff", NULL }, - { PW_UPS_ON, "load.on", NULL}, - { PW_GO_TO_BYPASS, "bypass.start", NULL}, - { 0, NULL, NULL } + { PW_INIT_BAT_TEST, "test.battery.start", NULL, NULL }, + { PW_LOAD_OFF_RESTART, "shutdown.return", NULL, NULL }, + { PW_UPS_OFF, "shutdown.stayoff", NULL, NULL }, + { PW_UPS_ON, "load.on", NULL, NULL }, + { PW_GO_TO_BYPASS, "bypass.start", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* System test capabilities results */ info_lkp_t system_test_info[] = { - { PW_SYS_TEST_GENERAL, "test.system.start", NULL }, -/* { PW_SYS_TEST_SCHEDULE_BATTERY_COMMISSION, "test.battery.start.delayed", NULL }, */ -/* { PW_SYS_TEST_ALTERNATE_AC_INPUT, "test.alternate_acinput.start", NULL }, */ - { PW_SYS_TEST_FLASH_LIGHTS, "test.panel.start", NULL }, - { 0, NULL, NULL } + { PW_SYS_TEST_GENERAL, "test.system.start", NULL, NULL }, +/* { PW_SYS_TEST_SCHEDULE_BATTERY_COMMISSION, "test.battery.start.delayed", NULL, NULL }, */ +/* { PW_SYS_TEST_ALTERNATE_AC_INPUT, "test.alternate_acinput.start", NULL, NULL }, */ + { PW_SYS_TEST_FLASH_LIGHTS, "test.panel.start", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* allocate storage for shared variables (extern in bcmxcp.h) */ diff --git a/drivers/belkin-hid.c b/drivers/belkin-hid.c index 67844cf223..2c6b3163b4 100644 --- a/drivers/belkin-hid.c +++ b/drivers/belkin-hid.c @@ -88,35 +88,35 @@ static const char *liebert_config_voltage_fun(double value); static const char *liebert_line_voltage_fun(double value); static info_lkp_t liebert_online_info[] = { - { 0, NULL, liebert_online_fun } + { 0, NULL, liebert_online_fun, NULL } }; static info_lkp_t liebert_discharging_info[] = { - { 0, NULL, liebert_discharging_fun } + { 0, NULL, liebert_discharging_fun, NULL } }; static info_lkp_t liebert_charging_info[] = { - { 0, NULL, liebert_charging_fun } + { 0, NULL, liebert_charging_fun, NULL } }; static info_lkp_t liebert_lowbatt_info[] = { - { 0, NULL, liebert_lowbatt_fun } + { 0, NULL, liebert_lowbatt_fun, NULL } }; static info_lkp_t liebert_replacebatt_info[] = { - { 0, NULL, liebert_replacebatt_fun } + { 0, NULL, liebert_replacebatt_fun, NULL } }; static info_lkp_t liebert_shutdownimm_info[] = { - { 0, NULL, liebert_shutdownimm_fun } + { 0, NULL, liebert_shutdownimm_fun, NULL } }; static info_lkp_t liebert_config_voltage_info[] = { - { 0, NULL, liebert_config_voltage_fun }, + { 0, NULL, liebert_config_voltage_fun, NULL }, }; static info_lkp_t liebert_line_voltage_info[] = { - { 0, NULL, liebert_line_voltage_fun }, + { 0, NULL, liebert_line_voltage_fun, NULL }, }; static double liebert_config_voltage_mult = 1.0; @@ -209,7 +209,7 @@ static const char *belkin_firmware_conversion_fun(double value) } static info_lkp_t belkin_firmware_conversion[] = { - { 0, NULL, belkin_firmware_conversion_fun } + { 0, NULL, belkin_firmware_conversion_fun, NULL } }; static const char *belkin_upstype_conversion_fun(double value) @@ -232,7 +232,7 @@ static const char *belkin_upstype_conversion_fun(double value) } static info_lkp_t belkin_upstype_conversion[] = { - { 0, NULL, belkin_upstype_conversion_fun } + { 0, NULL, belkin_upstype_conversion_fun, NULL } }; static const char *belkin_sensitivity_conversion_fun(double value) @@ -249,17 +249,17 @@ static const char *belkin_sensitivity_conversion_fun(double value) } static info_lkp_t belkin_sensitivity_conversion[] = { - { 0, NULL, belkin_sensitivity_conversion_fun } + { 0, NULL, belkin_sensitivity_conversion_fun, NULL } }; static info_lkp_t belkin_test_info[] = { - { 0, "No test initiated", NULL }, - { 1, "Done and passed", NULL }, - { 2, "Done and warning", NULL }, - { 3, "Done and error", NULL }, - { 4, "Aborted", NULL }, - { 5, "In progress", NULL }, - { 0, NULL, NULL } + { 0, "No test initiated", NULL, NULL }, + { 1, "Done and passed", NULL, NULL }, + { 2, "Done and warning", NULL, NULL }, + { 3, "Done and error", NULL, NULL }, + { 4, "Aborted", NULL, NULL }, + { 5, "In progress", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static const char *belkin_overload_conversion_fun(double value) @@ -272,7 +272,7 @@ static const char *belkin_overload_conversion_fun(double value) } static info_lkp_t belkin_overload_conversion[] = { - { 0, NULL, belkin_overload_conversion_fun } + { 0, NULL, belkin_overload_conversion_fun, NULL } }; static const char *belkin_overheat_conversion_fun(double value) @@ -285,7 +285,7 @@ static const char *belkin_overheat_conversion_fun(double value) } static info_lkp_t belkin_overheat_conversion[] = { - { 0, NULL, belkin_overheat_conversion_fun } + { 0, NULL, belkin_overheat_conversion_fun, NULL } }; static const char *belkin_commfault_conversion_fun(double value) @@ -298,7 +298,7 @@ static const char *belkin_commfault_conversion_fun(double value) } static info_lkp_t belkin_commfault_conversion[] = { - { 0, NULL, belkin_commfault_conversion_fun } + { 0, NULL, belkin_commfault_conversion_fun, NULL } }; static const char *belkin_awaitingpower_conversion_fun(double value) @@ -311,7 +311,7 @@ static const char *belkin_awaitingpower_conversion_fun(double value) } static info_lkp_t belkin_awaitingpower_conversion[] = { - { 0, NULL, belkin_awaitingpower_conversion_fun } + { 0, NULL, belkin_awaitingpower_conversion_fun, NULL } }; static const char *belkin_online_conversion_fun(double value) @@ -324,7 +324,7 @@ static const char *belkin_online_conversion_fun(double value) } static info_lkp_t belkin_online_conversion[] = { - { 0, NULL, belkin_online_conversion_fun } + { 0, NULL, belkin_online_conversion_fun, NULL } }; static const char *belkin_lowbatt_conversion_fun(double value) @@ -337,7 +337,7 @@ static const char *belkin_lowbatt_conversion_fun(double value) } static info_lkp_t belkin_lowbatt_conversion[] = { - { 0, NULL, belkin_lowbatt_conversion_fun } + { 0, NULL, belkin_lowbatt_conversion_fun, NULL } }; static const char *belkin_depleted_conversion_fun(double value) @@ -350,7 +350,7 @@ static const char *belkin_depleted_conversion_fun(double value) } static info_lkp_t belkin_depleted_conversion[] = { - { 0, NULL, belkin_depleted_conversion_fun } + { 0, NULL, belkin_depleted_conversion_fun, NULL } }; static const char *belkin_replacebatt_conversion_fun(double value) @@ -363,7 +363,7 @@ static const char *belkin_replacebatt_conversion_fun(double value) } static info_lkp_t belkin_replacebatt_conversion[] = { - { 0, NULL, belkin_replacebatt_conversion_fun } + { 0, NULL, belkin_replacebatt_conversion_fun, NULL } }; /* --------------------------------------------------------------- */ diff --git a/drivers/bestpower-mib.c b/drivers/bestpower-mib.c index baa8c4d2b1..ff58fdbfdd 100644 --- a/drivers/bestpower-mib.c +++ b/drivers/bestpower-mib.c @@ -32,11 +32,12 @@ /* TODO: find the right sysOID for this MIB * #define BESTPOWER_SYSOID ".1.3.6.1.4.1.2947???" */ +#define BESTPOWER_SYSOID BESTPOWER_OID_MODEL_NAME static info_lkp_t bestpower_power_status[] = { - { 1, "OL" }, - { 2, "OB" }, - { 0, NULL } + { 1, "OL", NULL, NULL }, + { 2, "OB", NULL, NULL }, + { 0, NULL, NULL, NULL } } ; /* Snmp2NUT lookup table for Best Power MIB */ @@ -81,4 +82,4 @@ static snmp_info_t bestpower_mib[] = { } ; mib2nut_info_t bestpower = { "bestpower", BESTPOWER_MIB_VERSION, NULL, - BESTPOWER_OID_MODEL_NAME, bestpower_mib }; + BESTPOWER_OID_MODEL_NAME, bestpower_mib, BESTPOWER_SYSOID, NULL }; diff --git a/drivers/compaq-mib.c b/drivers/compaq-mib.c index e087f518da..db72861bb9 100644 --- a/drivers/compaq-mib.c +++ b/drivers/compaq-mib.c @@ -84,87 +84,87 @@ /* Not used, as no longer supported by MIB ver. 1.76 (Github issue 118) static info_lkp_t cpqpower_alarm_ob[] = { - { 1, "OB" }, - { 0, NULL } + { 1, "OB", NULL, NULL }, + { 0, NULL, NULL, NULL } }; */ /* Not used, as no longer supported by MIB ver. 1.76 (Github issue 118) static info_lkp_t cpqpower_alarm_lb[] = { - { 1, "LB" }, - { 0, NULL } + { 1, "LB", NULL, NULL }, + { 0, NULL, NULL, NULL } }; */ /* Defines for CPQPOWER_OID_POWER_STATUS (1) */ static info_lkp_t cpqpower_pwr_info[] = { - { 1, "" /* other */ }, - { 2, "OFF" /* none */ }, - { 3, "OL" /* normal */ }, - { 4, "OL BYPASS" /* bypass */ }, - { 5, "OB" /* battery */ }, - { 6, "OL BOOST" /* booster */ }, - { 7, "OL TRIM" /* reducer */ }, - { 8, "OL" /* parallelCapacity */ }, - { 9, "OL" /* parallelRedundant */ }, - { 10, "OL" /* HighEfficiencyMode */ }, - { 0, NULL } + { 1, "" /* other */, NULL, NULL }, + { 2, "OFF" /* none */, NULL, NULL }, + { 3, "OL" /* normal */, NULL, NULL }, + { 4, "OL BYPASS" /* bypass */, NULL, NULL }, + { 5, "OB" /* battery */, NULL, NULL }, + { 6, "OL BOOST" /* booster */, NULL, NULL }, + { 7, "OL TRIM" /* reducer */, NULL, NULL }, + { 8, "OL" /* parallelCapacity */, NULL, NULL }, + { 9, "OL" /* parallelRedundant */, NULL, NULL }, + { 10, "OL" /* HighEfficiencyMode */, NULL, NULL }, + { 0, NULL, NULL, NULL } } ; static info_lkp_t cpqpower_mode_info[] = { - { 1, "" }, - { 2, "" }, - { 3, "normal" }, - { 4, "" }, - { 5, "" }, - { 6, "" }, - { 7, "" }, - { 8, "parallel capacity" }, - { 9, "parallel redundancy" }, - {10, "high efficiency" }, - { 0, NULL } + { 1, "", NULL, NULL }, + { 2, "", NULL, NULL }, + { 3, "normal", NULL, NULL }, + { 4, "", NULL, NULL }, + { 5, "", NULL, NULL }, + { 6, "", NULL, NULL }, + { 7, "", NULL, NULL }, + { 8, "parallel capacity", NULL, NULL }, + { 9, "parallel redundancy", NULL, NULL }, + {10, "high efficiency", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t cpqpower_battery_abm_status[] = { - { 1, "CHRG" }, - { 2, "DISCHRG" }, -/* { 3, "Floating" }, */ -/* { 4, "Resting" }, */ -/* { 5, "Unknown" }, */ - { 0, NULL } + { 1, "CHRG", NULL, NULL }, + { 2, "DISCHRG", NULL, NULL }, +/* { 3, "Floating", NULL, NULL }, */ +/* { 4, "Resting", NULL, NULL }, */ +/* { 5, "Unknown", NULL, NULL }, */ + { 0, NULL, NULL, NULL } } ; /* Defines for CPQPOWER_OID_UPS_TEST_RES */ static info_lkp_t cpqpower_test_res_info[] = { - { 1, "Unknown" }, - { 2, "Done and passed" }, - { 3, "Done and error" }, - { 4, "In progress" }, - { 5, "Not supported" }, - { 6, "Inhibited" }, - { 7, "Scheduled" }, - { 0, NULL } + { 1, "Unknown", NULL, NULL }, + { 2, "Done and passed", NULL, NULL }, + { 3, "Done and error", NULL, NULL }, + { 4, "In progress", NULL, NULL }, + { 5, "Not supported", NULL, NULL }, + { 6, "Inhibited", NULL, NULL }, + { 7, "Scheduled", NULL, NULL }, + { 0, NULL, NULL, NULL } } ; #define CPQPOWER_START_TEST "1" static info_lkp_t cpqpower_outlet_status_info[] = { - { 1, "on" }, - { 2, "off" }, - { 3, "pendingOff" }, /* transitional status */ - { 4, "pendingOn" }, /* transitional status */ - { 5, "unknown" }, - { 0, NULL } + { 1, "on", NULL, NULL }, + { 2, "off", NULL, NULL }, + { 3, "pendingOff", NULL, NULL }, /* transitional status */ + { 4, "pendingOn", NULL, NULL }, /* transitional status */ + { 5, "unknown", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Ugly hack: having the matching OID present means that the outlet is * switchable. So, it should not require this value lookup */ static info_lkp_t cpqpower_outlet_switchability_info[] = { - { 1, "yes" }, - { 2, "yes" }, - { 3, "yes" }, - { 4, "yes" }, - { 0, NULL } + { 1, "yes", NULL, NULL }, + { 2, "yes", NULL, NULL }, + { 3, "yes", NULL, NULL }, + { 4, "yes", NULL, NULL }, + { 0, NULL, NULL, NULL } }; #define CPQPOWER_OID_SD_AFTER_DELAY ".1.3.6.1.4.1.232.165.3.8.1.0" /* UPS-MIB::upsControlOutputOffDelay */ @@ -329,5 +329,5 @@ static snmp_info_t cpqpower_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t compaq = { "cpqpower", CPQPOWER_MIB_VERSION, NULL, CPQPOWER_OID_MFR_NAME, cpqpower_mib, CPQPOWER_SYSOID }; +mib2nut_info_t compaq = { "cpqpower", CPQPOWER_MIB_VERSION, NULL, CPQPOWER_OID_MFR_NAME, cpqpower_mib, CPQPOWER_SYSOID, NULL }; diff --git a/drivers/cps-hid.c b/drivers/cps-hid.c index e28afe2f8c..a349d0a22d 100644 --- a/drivers/cps-hid.c +++ b/drivers/cps-hid.c @@ -114,7 +114,7 @@ static const char *cps_battvolt_fun(double value) } static info_lkp_t cps_battvolt[] = { - { 0, NULL, &cps_battvolt_fun } + { 0, NULL, &cps_battvolt_fun, NULL } }; /* returns statically allocated string - must not use it again before @@ -130,7 +130,7 @@ static const char *cps_battcharge_fun(double value) } static info_lkp_t cps_battcharge[] = { - { 0, NULL, &cps_battcharge_fun } + { 0, NULL, &cps_battcharge_fun, NULL } }; /* --------------------------------------------------------------- */ diff --git a/drivers/cyberpower-mib.c b/drivers/cyberpower-mib.c index a7d16ca368..e397c295d7 100644 --- a/drivers/cyberpower-mib.c +++ b/drivers/cyberpower-mib.c @@ -31,34 +31,34 @@ #define CYBERPOWER_SYSOID ".1.3.6.1.4.1.3808.1.1.1" static info_lkp_t cyberpower_power_status[] = { - { 2, "OL" }, - { 3, "OB" }, - { 4, "OL BOOST" }, - { 5, "OFF" }, - { 7, "OL" }, - { 1, "NULL" }, - { 6, "OFF" }, - { 0, NULL } + { 2, "OL", NULL, NULL }, + { 3, "OB", NULL, NULL }, + { 4, "OL BOOST", NULL, NULL }, + { 5, "OFF", NULL, NULL }, + { 7, "OL", NULL, NULL }, + { 1, "NULL", NULL, NULL }, + { 6, "OFF", NULL, NULL }, + { 0, NULL, NULL, NULL } } ; static info_lkp_t cyberpower_battery_status[] = { - { 1, "" }, /* unknown */ - { 2, "" }, /* batteryNormal */ - { 3, "LB" }, /* batteryLow */ - { 0, NULL } + { 1, "", NULL, NULL }, /* unknown */ + { 2, "", NULL, NULL }, /* batteryNormal */ + { 3, "LB", NULL, NULL }, /* batteryLow */ + { 0, NULL, NULL, NULL } } ; static info_lkp_t cyberpower_cal_status[] = { - { 1, "" }, /* Calibration Successful */ - { 2, "" }, /* Calibration Invalid */ - { 3, "CAL" }, /* Calibration in progress */ - { 0, NULL } + { 1, "", NULL, NULL }, /* Calibration Successful */ + { 2, "", NULL, NULL }, /* Calibration Invalid */ + { 3, "CAL", NULL, NULL }, /* Calibration in progress */ + { 0, NULL, NULL, NULL } }; static info_lkp_t cyberpower_battrepl_status[] = { - { 1, "" }, /* No battery needs replacing */ - { 2, "RB" }, /* Batteries need to be replaced */ - { 0, NULL } + { 1, "", NULL, NULL }, /* No battery needs replacing */ + { 2, "RB", NULL, NULL }, /* Batteries need to be replaced */ + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table for CyberPower MIB */ @@ -147,4 +147,4 @@ static snmp_info_t cyberpower_mib[] = { } ; mib2nut_info_t cyberpower = { "cyberpower", CYBERPOWER_MIB_VERSION, NULL, - CYBERPOWER_OID_MODEL_NAME, cyberpower_mib, CYBERPOWER_SYSOID }; + CYBERPOWER_OID_MODEL_NAME, cyberpower_mib, CYBERPOWER_SYSOID, NULL }; diff --git a/drivers/delta_ups-mib.c b/drivers/delta_ups-mib.c index 81cbbfa4cd..08040ae8d4 100644 --- a/drivers/delta_ups-mib.c +++ b/drivers/delta_ups-mib.c @@ -32,31 +32,31 @@ /* To create a value lookup structure (as needed on the 2nd line of the example * below), use the following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * { 1, "OB", NULL, NULL }, + * { 2, "OL", NULL, NULL }, + * { 0, NULL, NULL, NULL } * }; */ static info_lkp_t delta_ups_upstype_info[] = { - { 1, "on-line" }, - { 2, "off-line" }, - { 3, "line-interactive" }, - { 4, "3phase" }, - { 5, "splite-phase" }, - { 0, NULL } + { 1, "on-line", NULL, NULL }, + { 2, "off-line", NULL, NULL }, + { 3, "line-interactive", NULL, NULL }, + { 4, "3phase", NULL, NULL }, + { 5, "splite-phase", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t delta_ups_pwr_info[] = { - { 0, "OL" }, /* normal */ - { 1, "OB" }, /* battery */ - { 2, "BYPASS" }, /* bypass */ - { 3, "TRIM" }, /* reducing */ - { 4, "BOOST" }, /* boosting */ - { 5, "BYPASS" }, /* manualBypass */ - /*{ 6, "NULL" },*/ /* other */ - { 7, "OFF" }, /* none */ - { 0, NULL } + { 0, "OL", NULL, NULL }, /* normal */ + { 1, "OB", NULL, NULL }, /* battery */ + { 2, "BYPASS", NULL, NULL }, /* bypass */ + { 3, "TRIM", NULL, NULL }, /* reducing */ + { 4, "BOOST", NULL, NULL }, /* boosting */ + { 5, "BYPASS", NULL, NULL }, /* manualBypass */ + /*{ 6, "NULL", NULL, NULL },*/ /* other */ + { 7, "OFF", NULL, NULL }, /* none */ + { 0, NULL, NULL, NULL } } ; /* DELTA_UPS Snmp2NUT lookup table */ @@ -357,4 +357,4 @@ static snmp_info_t delta_ups_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t delta_ups = { "delta_ups", DELTA_UPS_MIB_VERSION, NULL, NULL, delta_ups_mib, DELTA_UPS_SYSOID }; +mib2nut_info_t delta_ups = { "delta_ups", DELTA_UPS_MIB_VERSION, NULL, NULL, delta_ups_mib, DELTA_UPS_SYSOID, NULL }; diff --git a/drivers/eaton-ats16-mib.c b/drivers/eaton-ats16-mib.c index 37f36fea1a..39abcbe22b 100644 --- a/drivers/eaton-ats16-mib.c +++ b/drivers/eaton-ats16-mib.c @@ -32,51 +32,51 @@ #define EATON_ATS16_MODEL ".1.3.6.1.4.1.534.10.2.1.2.0" static info_lkp_t eaton_ats16_source_info[] = { - { 1, "init" }, - { 2, "diagnosis" }, - { 3, "off" }, - { 4, "1" }, - { 5, "2" }, - { 6, "safe" }, - { 7, "fault" }, - { 0, NULL } + { 1, "init", NULL, NULL }, + { 2, "diagnosis", NULL, NULL }, + { 3, "off", NULL, NULL }, + { 4, "1", NULL, NULL }, + { 5, "2", NULL, NULL }, + { 6, "safe", NULL, NULL }, + { 7, "fault", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t eaton_ats16_sensitivity_info[] = { - { 1, "normal" }, - { 2, "high" }, - { 3, "low" }, - { 0, NULL } + { 1, "normal", NULL, NULL }, + { 2, "high", NULL, NULL }, + { 3, "low", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t eaton_ats16_input_frequency_status_info[] = { - { 1, "good" }, /* No threshold triggered */ - { 2, "out-of-range" }, /* Frequency out of range triggered */ - { 0, NULL } + { 1, "good", NULL, NULL }, /* No threshold triggered */ + { 2, "out-of-range", NULL, NULL }, /* Frequency out of range triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t eaton_ats16_input_voltage_status_info[] = { - { 1, "good" }, /* No threshold triggered */ - { 2, "derated-range" }, /* Voltage derated */ - { 3, "out-of-range" }, /* Voltage out of range triggered */ - { 4, "unknown" }, /* "missing" */ - { 0, NULL } + { 1, "good", NULL, NULL }, /* No threshold triggered */ + { 2, "derated-range", NULL, NULL }, /* Voltage derated */ + { 3, "out-of-range", NULL, NULL }, /* Voltage out of range triggered */ + { 4, "unknown", NULL, NULL }, /* "missing" */ + { 0, NULL, NULL, NULL } }; static info_lkp_t eaton_ats16_test_result_info[] = { - { 1, "done and passed" }, - { 2, "done and warning" }, - { 3, "done and error" }, - { 4, "aborted" }, - { 5, "in progress" }, - { 6, "no test initiated" }, - { 0, NULL } + { 1, "done and passed", NULL, NULL }, + { 2, "done and warning", NULL, NULL }, + { 3, "done and error", NULL, NULL }, + { 4, "aborted", NULL, NULL }, + { 5, "in progress", NULL, NULL }, + { 6, "no test initiated", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t eaton_ats16_output_status_info[] = { - { 1, "OFF" }, /* Output not powered */ - { 2, "OL" }, /* Output powered */ - { 0, NULL } + { 1, "OFF", NULL, NULL }, /* Output not powered */ + { 2, "OL", NULL, NULL }, /* Output powered */ + { 0, NULL, NULL, NULL } }; /* EATON_ATS Snmp2NUT lookup table */ @@ -246,7 +246,7 @@ static snmp_info_t eaton_ats16_mib[] = { }; /* FIXME: The lines below are duplicated to fix an issue with the code generator (nut-snmpinfo.py -> line is discarding) */ -/*mib2nut_info_t eaton_ats16 = { "eaton_ats16", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN1 }; */ -mib2nut_info_t eaton_ats16 = { "eaton_ats16", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN1 }; -/*mib2nut_info_t eaton_ats16_g2 = { "eaton_ats16_g2", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN2 };*/ -mib2nut_info_t eaton_ats16_g2 = { "eaton_ats16", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN2 }; +/*mib2nut_info_t eaton_ats16 = { "eaton_ats16", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN1, NULL }; */ +mib2nut_info_t eaton_ats16 = { "eaton_ats16", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN1, NULL }; +/*mib2nut_info_t eaton_ats16_g2 = { "eaton_ats16_g2", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN2, NULL };*/ +mib2nut_info_t eaton_ats16_g2 = { "eaton_ats16", EATON_ATS16_MIB_VERSION, NULL, EATON_ATS16_MODEL, eaton_ats16_mib, EATON_ATS16_SYSOID_GEN2, NULL }; diff --git a/drivers/eaton-ats30-mib.c b/drivers/eaton-ats30-mib.c index 1848f7a6d4..7a80187b56 100644 --- a/drivers/eaton-ats30-mib.c +++ b/drivers/eaton-ats30-mib.c @@ -30,20 +30,20 @@ #define EATON_ATS30_MODEL ".1.3.6.1.4.1.534.10.1.2.1.0" static info_lkp_t eaton_ats30_source_info[] = { - { 1, "init" }, - { 2, "diagnosis" }, - { 3, "off" }, - { 4, "1" }, - { 5, "2" }, - { 6, "safe" }, - { 7, "fault" }, - { 0, NULL } + { 1, "init", NULL, NULL }, + { 2, "diagnosis", NULL, NULL }, + { 3, "off", NULL, NULL }, + { 4, "1", NULL, NULL }, + { 5, "2", NULL, NULL }, + { 6, "safe", NULL, NULL }, + { 7, "fault", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t eaton_ats30_input_sensitivity[] = { - { 1, "high" }, - { 2, "low" }, - { 0, NULL } + { 1, "high", NULL, NULL }, + { 2, "low", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* @@ -55,23 +55,23 @@ static info_lkp_t eaton_ats30_input_sensitivity[] = { * 4 atsFailureOverTemperature N/A */ static info_lkp_t eaton_ats30_status_info[] = { - { 0, "OL" }, - { 1, "OL" }, /* SwitchFault */ - { 2, "OFF" }, /* NoOutput */ - { 3, "OFF" }, /* SwitchFault + NoOutput */ - { 4, "OL OVER" }, /* OutputOC */ - { 5, "OL OVER" }, /* OutputOC + SwitchFault */ - { 6, "OFF OVER" }, /* OutputOC + NoOutput */ - { 7, "OFF OVER" }, /* OutputOC + SwitchFault + NoOutput */ - { 8, "OL" }, /* OverTemperature */ - { 9, "OL" }, /* OverTemperature + SwitchFault */ - { 10, "OFF" }, /* OverTemperature + NoOutput */ - { 11, "OFF" }, /* OverTemperature + SwitchFault + NoOutput */ - { 12, "OL OVER" }, /* OverTemperature + OutputOC */ - { 13, "OL OVER" }, /* OverTemperature + OutputOC + SwitchFault */ - { 14, "OFF OVER" }, /* OverTemperature + OutputOC + NoOutput */ - { 15, "OFF OVER" }, /* OverTemperature + OutputOC + SwitchFault + NoOutput */ - { 0, NULL } + { 0, "OL", NULL, NULL }, + { 1, "OL", NULL, NULL }, /* SwitchFault */ + { 2, "OFF", NULL, NULL }, /* NoOutput */ + { 3, "OFF", NULL, NULL }, /* SwitchFault + NoOutput */ + { 4, "OL OVER", NULL, NULL }, /* OutputOC */ + { 5, "OL OVER", NULL, NULL }, /* OutputOC + SwitchFault */ + { 6, "OFF OVER", NULL, NULL }, /* OutputOC + NoOutput */ + { 7, "OFF OVER", NULL, NULL }, /* OutputOC + SwitchFault + NoOutput */ + { 8, "OL", NULL, NULL }, /* OverTemperature */ + { 9, "OL", NULL, NULL }, /* OverTemperature + SwitchFault */ + { 10, "OFF", NULL, NULL }, /* OverTemperature + NoOutput */ + { 11, "OFF", NULL, NULL }, /* OverTemperature + SwitchFault + NoOutput */ + { 12, "OL OVER", NULL, NULL }, /* OverTemperature + OutputOC */ + { 13, "OL OVER", NULL, NULL }, /* OverTemperature + OutputOC + SwitchFault */ + { 14, "OFF OVER", NULL, NULL }, /* OverTemperature + OutputOC + NoOutput */ + { 15, "OFF OVER", NULL, NULL }, /* OverTemperature + OutputOC + SwitchFault + NoOutput */ + { 0, NULL, NULL, NULL } }; /* EATON_ATS30 Snmp2NUT lookup table */ @@ -369,4 +369,4 @@ static snmp_info_t eaton_ats30_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t eaton_ats30 = { "eaton_ats30", EATON_ATS30_MIB_VERSION, NULL, EATON_ATS30_MODEL, eaton_ats30_mib, EATON_ATS30_SYSOID }; +mib2nut_info_t eaton_ats30 = { "eaton_ats30", EATON_ATS30_MIB_VERSION, NULL, EATON_ATS30_MODEL, eaton_ats30_mib, EATON_ATS30_SYSOID, NULL }; diff --git a/drivers/eaton-pdu-genesis2-mib.c b/drivers/eaton-pdu-genesis2-mib.c index 80063f7459..78e5748091 100644 --- a/drivers/eaton-pdu-genesis2-mib.c +++ b/drivers/eaton-pdu-genesis2-mib.c @@ -86,4 +86,4 @@ static snmp_info_t eaton_aphel_genesisII_mib[] = { }; -mib2nut_info_t aphel_genesisII = { "aphel_genesisII", EATON_APHEL_GENESIS2_MIB_VERSION, NULL, APHEL1_OID_MODEL_NAME, eaton_aphel_genesisII_mib, APHEL1_SYSOID }; +mib2nut_info_t aphel_genesisII = { "aphel_genesisII", EATON_APHEL_GENESIS2_MIB_VERSION, NULL, APHEL1_OID_MODEL_NAME, eaton_aphel_genesisII_mib, APHEL1_SYSOID, NULL }; diff --git a/drivers/eaton-pdu-marlin-mib.c b/drivers/eaton-pdu-marlin-mib.c index 6482063ad9..f4ea885314 100644 --- a/drivers/eaton-pdu-marlin-mib.c +++ b/drivers/eaton-pdu-marlin-mib.c @@ -39,148 +39,148 @@ #define EATON_MARLIN_OID_MODEL_NAME ".1.3.6.1.4.1.534.6.6.7.1.2.1.2.0" static info_lkp_t marlin_outlet_status_info[] = { - { 0, "off" }, - { 1, "on" }, - { 2, "pendingOff" }, /* transitional status */ - { 3, "pendingOn" }, /* transitional status */ - { 0, NULL } + { 0, "off", NULL, NULL }, + { 1, "on", NULL, NULL }, + { 2, "pendingOff", NULL, NULL }, /* transitional status */ + { 3, "pendingOn", NULL, NULL }, /* transitional status */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_outletgroups_status_info[] = { - { 0, "off" }, - { 1, "on" }, - { 2, "rebooting" }, /* transitional status */ - { 3, "mixed" }, /* transitional status, not sure what it means! */ - { 0, NULL } + { 0, "off", NULL, NULL }, + { 1, "on", NULL, NULL }, + { 2, "rebooting", NULL, NULL }, /* transitional status */ + { 3, "mixed", NULL, NULL }, /* transitional status, not sure what it means! */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_outlet_switchability_info[] = { - { 1, "yes" }, /* switchable */ - { 2, "no" }, /* notSwitchable */ - { 0, NULL } + { 1, "yes", NULL, NULL }, /* switchable */ + { 2, "no", NULL, NULL }, /* notSwitchable */ + { 0, NULL, NULL, NULL } }; /* Overall outlets switchability info for the unit. * This is refined per-outlet, depending on user configuration, * possibly disabling switchability of some outlets */ static info_lkp_t marlin_unit_switchability_info[] = { - { 0, "no" }, /* unknown */ - { 1, "yes" }, /* switched */ - { 2, "no" }, /* advancedMonitored */ - { 3, "yes" }, /* managed */ - { 4, "no" }, /* monitored */ - { 0, NULL } + { 0, "no", NULL, NULL }, /* unknown */ + { 1, "yes", NULL, NULL }, /* switched */ + { 2, "no", NULL, NULL }, /* advancedMonitored */ + { 3, "yes", NULL, NULL }, /* managed */ + { 4, "no", NULL, NULL }, /* monitored */ + { 0, NULL, NULL, NULL } }; /* The physical type of outlet */ static info_lkp_t marlin_outlet_type_info[] = { - { 0, "unknown" }, - { 1, "iecC13" }, - { 2, "iecC19" }, - { 10, "uk" }, - { 11, "french" }, - { 12, "schuko" }, - { 20, "nema515" }, - { 21, "nema51520" }, - { 22, "nema520" }, - { 23, "nemaL520" }, - { 24, "nemaL530" }, - { 25, "nema615" }, - { 26, "nema620" }, - { 27, "nemaL620" }, - { 28, "nemaL630" }, - { 29, "nemaL715" }, - { 30, "rf203p277" }, - { 0, NULL } + { 0, "unknown", NULL, NULL }, + { 1, "iecC13", NULL, NULL }, + { 2, "iecC19", NULL, NULL }, + { 10, "uk", NULL, NULL }, + { 11, "french", NULL, NULL }, + { 12, "schuko", NULL, NULL }, + { 20, "nema515", NULL, NULL }, + { 21, "nema51520", NULL, NULL }, + { 22, "nema520", NULL, NULL }, + { 23, "nemaL520", NULL, NULL }, + { 24, "nemaL530", NULL, NULL }, + { 25, "nema615", NULL, NULL }, + { 26, "nema620", NULL, NULL }, + { 27, "nemaL620", NULL, NULL }, + { 28, "nemaL630", NULL, NULL }, + { 29, "nemaL715", NULL, NULL }, + { 30, "rf203p277", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_ambient_presence_info[] = { - { -1, "unknown" }, - { 0, "no" }, /* disconnected */ - { 1, "yes" }, /* connected */ - { 0, NULL } + { -1, "unknown", NULL, NULL }, + { 0, "no", NULL, NULL }, /* disconnected */ + { 1, "yes", NULL, NULL }, /* connected */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_threshold_status_info[] = { - { 0, "good" }, /* No threshold triggered */ - { 1, "warning-low" }, /* Warning low threshold triggered */ - { 2, "critical-low" }, /* Critical low threshold triggered */ - { 3, "warning-high" }, /* Warning high threshold triggered */ - { 4, "critical-high" }, /* Critical high threshold triggered */ - { 0, NULL } + { 0, "good", NULL, NULL }, /* No threshold triggered */ + { 1, "warning-low", NULL, NULL }, /* Warning low threshold triggered */ + { 2, "critical-low", NULL, NULL }, /* Critical low threshold triggered */ + { 3, "warning-high", NULL, NULL }, /* Warning high threshold triggered */ + { 4, "critical-high", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_threshold_frequency_status_info[] = { - { 0, "good" }, /* No threshold triggered */ - { 1, "out-of-range" }, /* Frequency out of range triggered */ - { 0, NULL } + { 0, "good", NULL, NULL }, /* No threshold triggered */ + { 1, "out-of-range", NULL, NULL }, /* Frequency out of range triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_ambient_drycontacts_info[] = { - { -1, "unknown" }, - { 0, "open" }, - { 1, "closed" }, - { 0, NULL } + { -1, "unknown", NULL, NULL }, + { 0, "open", NULL, NULL }, + { 1, "closed", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_threshold_voltage_alarms_info[] = { - { 0, "" }, /* No threshold triggered */ - { 1, "low voltage warning!" }, /* Warning low threshold triggered */ - { 2, "low voltage critical!" }, /* Critical low threshold triggered */ - { 3, "high voltage warning!" }, /* Warning high threshold triggered */ - { 4, "high voltage critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 0, "", NULL, NULL }, /* No threshold triggered */ + { 1, "low voltage warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 2, "low voltage critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 3, "high voltage warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 4, "high voltage critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_threshold_current_alarms_info[] = { - { 0, "" }, /* No threshold triggered */ - { 1, "low current warning!" }, /* Warning low threshold triggered */ - { 2, "low current critical!" }, /* Critical low threshold triggered */ - { 3, "high current warning!" }, /* Warning high threshold triggered */ - { 4, "high current critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 0, "", NULL, NULL }, /* No threshold triggered */ + { 1, "low current warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 2, "low current critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 3, "high current warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 4, "high current critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_threshold_frequency_alarm_info[] = { - { 0, "" }, /* No threshold triggered */ - { 1, "frequency out of range!" }, /* Frequency out of range triggered */ - { 0, NULL } + { 0, "", NULL, NULL }, /* No threshold triggered */ + { 1, "frequency out of range!", NULL, NULL }, /* Frequency out of range triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_threshold_temperature_alarms_info[] = { - { 0, "" }, /* No threshold triggered */ - { 1, "low temperature warning!" }, /* Warning low threshold triggered */ - { 2, "low temperature critical!" }, /* Critical low threshold triggered */ - { 3, "high temperature warning!" }, /* Warning high threshold triggered */ - { 4, "high temperature critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 0, "", NULL, NULL }, /* No threshold triggered */ + { 1, "low temperature warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 2, "low temperature critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 3, "high temperature warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 4, "high temperature critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_threshold_humidity_alarms_info[] = { - { 0, "" }, /* No threshold triggered */ - { 1, "low humidity warning!" }, /* Warning low threshold triggered */ - { 2, "low humidity critical!" }, /* Critical low threshold triggered */ - { 3, "high humidity warning!" }, /* Warning high threshold triggered */ - { 4, "high humidity critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 0, "", NULL, NULL }, /* No threshold triggered */ + { 1, "low humidity warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 2, "low humidity critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 3, "high humidity warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 4, "high humidity critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_outlet_group_type_info[] = { - { 0, "unknown" }, - { 1, "breaker1pole" }, - { 2, "breaker2pole" }, - { 3, "breaker3pole" }, - { 4, "outlet-section" }, - { 5, "user-defined" }, - { 0, NULL } + { 0, "unknown", NULL, NULL }, + { 1, "breaker1pole", NULL, NULL }, + { 2, "breaker2pole", NULL, NULL }, + { 3, "breaker3pole", NULL, NULL }, + { 4, "outlet-section", NULL, NULL }, + { 5, "user-defined", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t marlin_input_type_info[] = { - { 1, "1" }, /* singlePhase */ - { 2, "2" }, /* splitPhase */ - { 3, "3" }, /* threePhaseDelta */ - { 4, "3" }, /* threePhaseWye */ - { 0, NULL } + { 1, "1", NULL, NULL }, /* singlePhase */ + { 2, "2", NULL, NULL }, /* splitPhase */ + { 3, "3", NULL, NULL }, /* threePhaseDelta */ + { 4, "3", NULL, NULL }, /* threePhaseWye */ + { 0, NULL, NULL, NULL } }; static char marlin_scratch_buf[20]; @@ -210,8 +210,8 @@ static const char *marlin_outlet_group_phase_fun(int outlet_group_nb) return NULL; } static info_lkp_t marlin_outlet_group_phase_info[] = { - { 1, "dummy", marlin_outlet_group_phase_fun }, - { 0, NULL } + { 1, "dummy", marlin_outlet_group_phase_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table for Eaton Marlin MIB */ @@ -883,4 +883,4 @@ static snmp_info_t eaton_marlin_mib[] = { }; -mib2nut_info_t eaton_marlin = { "eaton_epdu", EATON_MARLIN_MIB_VERSION, NULL, EATON_MARLIN_OID_MODEL_NAME, eaton_marlin_mib, EATON_MARLIN_SYSOID }; +mib2nut_info_t eaton_marlin = { "eaton_epdu", EATON_MARLIN_MIB_VERSION, NULL, EATON_MARLIN_OID_MODEL_NAME, eaton_marlin_mib, EATON_MARLIN_SYSOID, NULL }; diff --git a/drivers/eaton-pdu-pulizzi-mib.c b/drivers/eaton-pdu-pulizzi-mib.c index d09ceb3dd5..aabdc508b1 100644 --- a/drivers/eaton-pdu-pulizzi-mib.c +++ b/drivers/eaton-pdu-pulizzi-mib.c @@ -53,16 +53,16 @@ static info_lkp_t pulizzi_sw_outlet_status_info[] = { - { 1, "on" }, - { 2, "off" }, - { 0, NULL } + { 1, "on", NULL, NULL }, + { 2, "off", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* simply remap the above status to "yes" */ static info_lkp_t pulizzi_sw_outlet_switchability_info[] = { - { 1, "yes" }, - { 2, "yes" }, - { 0, NULL } + { 1, "yes", NULL, NULL }, + { 2, "yes", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table for Eaton Pulizzi Switched ePDU MIB */ @@ -132,5 +132,5 @@ static snmp_info_t eaton_pulizzi_switched_mib[] = { /*mib2nut_info_t pulizzi_monitored = { "pulizzi_monitored", EATON_PULIZZI_MIB_VERSION, NULL, PULIZZI1_OID_MODEL_NAME, eaton_pulizzi_monitored_mib, PULIZZI1_OID_MIB };*/ -mib2nut_info_t pulizzi_switched1 = { "pulizzi_switched1", EATON_PULIZZI_SW_MIB_VERSION, NULL, EATON_PULIZZI_SWITCHED1_SYSOID, eaton_pulizzi_switched_mib, EATON_PULIZZI_SWITCHED1_SYSOID }; -mib2nut_info_t pulizzi_switched2 = { "pulizzi_switched2", EATON_PULIZZI_SW_MIB_VERSION, NULL, EATON_PULIZZI_SWITCHED1_SYSOID, eaton_pulizzi_switched_mib, EATON_PULIZZI_SWITCHED2_SYSOID }; +mib2nut_info_t pulizzi_switched1 = { "pulizzi_switched1", EATON_PULIZZI_SW_MIB_VERSION, NULL, EATON_PULIZZI_SWITCHED1_SYSOID, eaton_pulizzi_switched_mib, EATON_PULIZZI_SWITCHED1_SYSOID, NULL }; +mib2nut_info_t pulizzi_switched2 = { "pulizzi_switched2", EATON_PULIZZI_SW_MIB_VERSION, NULL, EATON_PULIZZI_SWITCHED1_SYSOID, eaton_pulizzi_switched_mib, EATON_PULIZZI_SWITCHED2_SYSOID, NULL }; diff --git a/drivers/eaton-pdu-revelation-mib.c b/drivers/eaton-pdu-revelation-mib.c index 83504cec0e..7d417106c2 100644 --- a/drivers/eaton-pdu-revelation-mib.c +++ b/drivers/eaton-pdu-revelation-mib.c @@ -55,21 +55,21 @@ #define AR_OID_OUTLET_STATUS AR_BASE_OID ".1.2.2.1.3" static info_lkp_t revelation_outlet_status_info[] = { - { -1, "error" }, - { 0, "off" }, - { 1, "on" }, - { 2, "cycling" }, /* transitional status */ - { 0, NULL } + { -1, "error", NULL, NULL }, + { 0, "off", NULL, NULL }, + { 1, "on", NULL, NULL }, + { 2, "cycling", NULL, NULL }, /* transitional status */ + { 0, NULL, NULL, NULL } }; /* Ugly hack: having the matching OID present means that the outlet is * switchable. So, it should not require this value lookup */ static info_lkp_t revelation_outlet_switchability_info[] = { - { -1, "yes" }, - { 0, "yes" }, - { 1, "yes" }, - { 2, "yes" }, - { 0, NULL } + { -1, "yes", NULL, NULL }, + { 0, "yes", NULL, NULL }, + { 1, "yes", NULL, NULL }, + { 2, "yes", NULL, NULL }, + { 0, NULL, NULL, NULL } }; #define DO_OFF "0" @@ -173,4 +173,4 @@ static snmp_info_t eaton_aphel_revelation_mib[] = { }; -mib2nut_info_t aphel_revelation = { "aphel_revelation", EATON_APHEL_REVELATION_MIB_VERSION, NULL, APHEL2_OID_MODEL_NAME, eaton_aphel_revelation_mib, APHEL2_SYSOID }; +mib2nut_info_t aphel_revelation = { "aphel_revelation", EATON_APHEL_REVELATION_MIB_VERSION, NULL, APHEL2_OID_MODEL_NAME, eaton_aphel_revelation_mib, APHEL2_SYSOID, NULL }; diff --git a/drivers/emerson-avocent-pdu-mib.c b/drivers/emerson-avocent-pdu-mib.c index 3eb73e1084..9b02d88a7f 100644 --- a/drivers/emerson-avocent-pdu-mib.c +++ b/drivers/emerson-avocent-pdu-mib.c @@ -60,19 +60,19 @@ #endif info_lkp_t avocent_outlet_status_info[] = { - { 1, "off" }, - { 2, "on" }, -/* { 3, "offLocked" }, - { 4, "onLocked" }, - { 5, "offCycle" }, - { 6, "onPendingOff" }, - { 7, "offPendingOn" }, - { 8, "onPendingCycle" }, - { 9, "notSet" }, - { 10, "onFixed" }, - { 11, "offShutdown" }, - { 12, "tripped" },*/ - { 0, NULL } + { 1, "off", NULL, NULL }, + { 2, "on", NULL, NULL }, +/* { 3, "offLocked", NULL, NULL }, + { 4, "onLocked", NULL, NULL }, + { 5, "offCycle", NULL, NULL }, + { 6, "onPendingOff", NULL, NULL }, + { 7, "offPendingOn", NULL, NULL }, + { 8, "onPendingCycle", NULL, NULL }, + { 9, "notSet", NULL, NULL }, + { 10, "onFixed", NULL, NULL }, + { 11, "offShutdown", NULL, NULL }, + { 12, "tripped", NULL, NULL },*/ + { 0, NULL, NULL, NULL } }; snmp_info_t emerson_avocent_pdu_mib[] = { @@ -182,4 +182,4 @@ snmp_info_t emerson_avocent_pdu_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t emerson_avocent_pdu = { "emerson_avocent_pdu", EMERSON_AVOCENT_MIB_VERSION, NULL, EMERSON_AVOCENT_OID_MODEL_NAME, emerson_avocent_pdu_mib, EMERSON_AVOCENT_SYSOID }; +mib2nut_info_t emerson_avocent_pdu = { "emerson_avocent_pdu", EMERSON_AVOCENT_MIB_VERSION, NULL, EMERSON_AVOCENT_OID_MODEL_NAME, emerson_avocent_pdu_mib, EMERSON_AVOCENT_SYSOID, NULL }; diff --git a/drivers/gamatronic.h b/drivers/gamatronic.h index 4ae5bcf5df..f790ce1013 100644 --- a/drivers/gamatronic.h +++ b/drivers/gamatronic.h @@ -80,7 +80,7 @@ struct { /* macro for checking whether a variable is supported */ -struct { +typedef struct { const char *setcmd; /* INFO_x define from shared.h */ const char *name; /* Human readable text (also in shared-tables.h) */ int unit; /* Variable should be divided by this */ @@ -90,98 +90,100 @@ struct { int poll; /* poll flag */ int flags; /* Flags for addinfo() */ char value[SEC_MAX_VARSIZE]; -} sec_varlist[] = { - { "", "", 0, "", 0, 0, 0, 0 }, - /*setcmd name unit cmd field size poll flags */ - { "", "Awaiting Power ", 1, SEC_ALARMSTAT, 13, 2, 0, FLAG_ALARM}, - { "", "Bypass Bad ", 1, SEC_ALARMSTAT, 5, 2, 0, FLAG_ALARM}, - { "", "Charger Failure ", 1, SEC_ALARMSTAT, 8, 2, 0, FLAG_ALARM}, - { "", "Fan Failure ", 1, SEC_ALARMSTAT, 10, 2, 0, FLAG_ALARM}, - { "", "Fuse Failure ", 1, SEC_ALARMSTAT, 11, 2, 0, FLAG_ALARM}, - { "", "General Fault ", 1, SEC_ALARMSTAT, 12, 2, 0, FLAG_ALARM}, - { "", "Input Bad ", 1, SEC_ALARMSTAT, 2, 2, 0, FLAG_ALARM}, - { "", "Output Bad ", 1, SEC_ALARMSTAT, 3, 2, 0, FLAG_ALARM}, - { "", "Output Off ", 1, SEC_ALARMSTAT, 6, 2, 0, FLAG_ALARM}, - { "", "Overload ", 1, SEC_ALARMSTAT, 4, 2, 0, FLAG_ALARM}, - { "", "Shutdown Imminent ", 1, SEC_ALARMSTAT, 15, 2, 0, FLAG_ALARM}, - { "", "Shutdown Pending ", 1, SEC_ALARMSTAT, 14, 2, 0, FLAG_ALARM}, - { "", "System Off ", 1, SEC_ALARMSTAT, 9, 2, 0, FLAG_ALARM}, - { "", "Temperature ", 1, SEC_ALARMSTAT, 1, 2, 0, FLAG_ALARM}, - { "", "UPS Shutdown ", 1, SEC_ALARMSTAT, 7, 2, 0, FLAG_ALARM}, - { "", "Audible Alarm", 1, SEC_NOMINAL, 8, 4, FLAG_POLLONCE, FLAG_RW}, - { "", "Auto Restart", 1, SEC_AUTORESTART, 1, 2, FLAG_POLLONCE, FLAG_RW}, - { "", "Battery Charge", 1, SEC_BATTSTAT, 3, 4, 0, 0}, - { "", "Battery Condition", 1, SEC_BATTSTAT, 1, 3, 0, 0}, - { "battery.current", "Battery Current", 10, SEC_BATTSTAT, 8, 9999, 0, 0 }, - { "battery.date", "Battery Installed", 1, SEC_NOMINAL, 11, 8, FLAG_POLLONCE, FLAG_STRING}, - { "", "Battery Status", 1, SEC_BATTSTAT, 2, 3, 0, 0 }, - { "battery.temperature", "Battery Temperature", 1, SEC_BATTSTAT, 9, 99, 0, 0 }, - { "battery.voltage", "Battery Voltage", 10, SEC_BATTSTAT, 7, 9999, 0, 0 }, - { "", "Bypass Current 1", 10, SEC_BYPASSSTAT, 4, 9999, 0, 0 }, - { "", "Bypass Current 2", 10, SEC_BYPASSSTAT, 7, 9999, 0, 0 }, - { "", "Bypass Current 3", 10, SEC_BYPASSSTAT, 10, 9999, 0, 0 }, - { "", "Bypass Frequency", 10, SEC_BYPASSSTAT, 1, 999, 0, 0 }, - { "", "Bypass Num Lines", 1, SEC_BYPASSSTAT, 2, 9, 0, 0 }, - { "", "Bypass Power 1", 1, SEC_BYPASSSTAT, 5, 99999, 0, 0 }, - { "", "Bypass Power 2", 1, SEC_BYPASSSTAT, 8, 99999, 0, 0 }, - { "", "Bypass Power 3", 1, SEC_BYPASSSTAT, 11, 99999, 0, 0 }, - { "", "Bypass Voltage 1", 10, SEC_BYPASSSTAT, 3, 9999, 0, 0 }, - { "", "Bypass Voltage 2", 10, SEC_BYPASSSTAT, 6, 9999, 0, 0 }, - { "", "Bypass Voltage 3", 10, SEC_BYPASSSTAT, 9, 9999, 0, 0 }, - { "battery.charge", "Estimated Charge", 1, SEC_BATTSTAT, 6, 999, 0, 0 }, - { "battery.runtime.low", "Estimated Minutes", 60, SEC_BATTSTAT, 5, 999, 0, FLAG_MULTI }, - { "input.transfer.high", "High Volt Xfer Pt", 1, SEC_NOMINAL, 10, 999, FLAG_POLLONCE, FLAG_STRING}, - { "ups.id", "Identification", 1, SEC_UPSID, 1, 64, FLAG_POLLONCE, FLAG_STRING}, - { "", "Input Current 1", 10, SEC_INPUTSTAT, 5, 9999, 0, 0 }, - { "", "Input Current 2", 10, SEC_INPUTSTAT, 9, 9999, 0, 0 }, - { "", "Input Current 3", 10, SEC_INPUTSTAT, 13, 9999, 0, 0 }, - { "input.frequency", "Input Frequency 1", 10, SEC_INPUTSTAT, 3, 999, 0, 0 }, - { "", "Input Frequency 2", 10, SEC_INPUTSTAT, 7, 999, 0, 0 }, - { "", "Input Frequency 3", 10, SEC_INPUTSTAT, 11, 999, 0, 0 }, - { "", "Input Line Bads", 1, SEC_INPUTSTAT, 1, 999, 0, 0 }, - { "", "Input Num Lines", 1, SEC_INPUTSTAT, 2, 9, 0, 0 }, - { "", "Input Power 1", 1, SEC_INPUTSTAT, 6, 99999, 0, 0 }, - { "", "Input Power 2", 1, SEC_INPUTSTAT, 10, 99999, 0, 0 }, - { "", "Input Power 3", 1, SEC_INPUTSTAT, 14, 99999, 0, 0 }, - { "input.voltage", "Input Voltage 1", 10, SEC_INPUTSTAT, 4, 9999, 0, 0 }, - { "", "Input Voltage 2", 10, SEC_INPUTSTAT, 8, 9999, 0, 0 }, - { "", "Input Voltage 3", 10, SEC_INPUTSTAT, 12, 9999, 0, 0 }, - { "input.transfer.low", "Low Volt Xfer Pt", 1, SEC_NOMINAL, 9, 999, FLAG_POLLONCE, FLAG_STRING}, - { "ups.mfr", "Manufacturer", 1, SEC_MFR, 1, 32, FLAG_POLLONCE, FLAG_STRING}, - { "ups.model", "Model", 1, SEC_MOD, 1, 64, FLAG_POLLONCE, FLAG_STRING}, - { "", "Nominal Battery Life", 1, SEC_NOMINAL, 12, 99999, FLAG_POLLONCE, FLAG_STRING}, - { "", "Nominal Input Frequency", 10, SEC_NOMINAL, 2, 999, FLAG_POLLONCE, FLAG_RW}, - { "input.voltage.nominal", "Nominal Input Voltage", 1, SEC_NOMINAL, 1, 999, FLAG_POLLONCE, FLAG_STRING}, - { "", "Nominal Low Battery Time", 1, SEC_NOMINAL, 7, 99, FLAG_POLLONCE, FLAG_STRING}, - { "", "Nominal Output Frequency", 10, SEC_NOMINAL, 4, 999, FLAG_POLLONCE, FLAG_RW}, - { "", "Nominal Output Power", 1, SEC_NOMINAL, 6, 99999, FLAG_POLLONCE, FLAG_STRING}, - { "", "Nominal Output Voltage", 1, SEC_NOMINAL, 3, 999, FLAG_POLLONCE, FLAG_STRING}, - { "ups.power.nominal", "Nominal VA Rating", 1, SEC_NOMINAL, 5, 99999, FLAG_POLLONCE, FLAG_STRING}, - { "output.current", "Output Current 1", 10, SEC_OUTPUTSTAT, 5, 9999, 0, 0 }, - { "", "Output Current 2", 10, SEC_OUTPUTSTAT, 9, 9999, 0, 0 }, - { "", "Output Current 3", 10, SEC_OUTPUTSTAT, 13, 9999, 0, 0 }, - { "output.frequency", "Output Frequency", 10, SEC_OUTPUTSTAT, 2, 999, 0, 0 }, - { "ups.load", "Output Load 1", 1, SEC_OUTPUTSTAT, 7, 999, 0, 0 }, - { "", "Output Load 2", 1, SEC_OUTPUTSTAT, 11, 999, 0, 0 }, - { "", "Output Load 3", 1, SEC_OUTPUTSTAT, 15, 999, 0, 0 }, - { "", "Output Num Lines", 1, SEC_OUTPUTSTAT, 3, 9, 0, 0 }, - { "", "Output Power 1", 1, SEC_OUTPUTSTAT, 6, 99999, 0, 0 }, - { "", "Output Power 2", 1, SEC_OUTPUTSTAT, 10, 99999, 0, 0 }, - { "", "Output Power 3", 1, SEC_OUTPUTSTAT, 14, 99999, 0, 0 }, - { "", "Output Source", 1, SEC_OUTPUTSTAT, 1, 6, 0, 0}, - { "output.voltage", "Output Voltage 1", 10, SEC_OUTPUTSTAT, 4, 9999, 0, 0 }, - { "", "Output Voltage 2", 10, SEC_OUTPUTSTAT, 8, 9999, 0, 0 }, - { "", "Output Voltage 3", 10, SEC_OUTPUTSTAT, 12, 9999, 0, 0 }, - { "", "Reboot With Duration", 1, SEC_REBOOT, 1, 9999999, FLAG_POLLONCE, FLAG_WONLY}, - { "battery.runtime", "Seconds on Battery", 1, SEC_BATTSTAT, 4, 99999, 0, 0 }, - { "", "Shutdown Type", 1, SEC_SHUTTYPE, 1, 2, FLAG_POLLONCE, FLAG_RW}, - { "ups.delay.shutdown", "Shutdown After Delay", 1, SEC_STARTDELAY, 1, 9999999, FLAG_POLLONCE, FLAG_WONLY}, - { "ups.firmware", "Software Version", 1, SEC_VERSION, 1, 32, FLAG_POLLONCE, FLAG_STRING}, - { "", "Startup After Delay", 1, SEC_STARTDELAY, 1, 9999999, FLAG_POLLONCE, FLAG_WONLY}, - { "", "Test Results Detail", 1, SEC_TESTRESULT, 2, 64, FLAG_POLLONCE, FLAG_STRING}, - { "", "Test Results Summary", 1, SEC_TESTRESULT, 1, 6, FLAG_POLLONCE, 0}, - { "", "Test Type", 1, SEC_TEST, 1, 5, FLAG_POLLONCE, FLAG_WONLY}, - { "", "Baud Rate", 1, SEC_BAUDRATE, 1, 19200, FLAG_POLLONCE, FLAG_RW}, +} sec_varlist_t; + +sec_varlist_t sec_varlist[] = { + { "", "", 0, "", 0, 0, 0, 0, "" }, + /*setcmd name unit cmd field size poll flags value */ + { "", "Awaiting Power ", 1, SEC_ALARMSTAT, 13, 2, 0, FLAG_ALARM, ""}, + { "", "Bypass Bad ", 1, SEC_ALARMSTAT, 5, 2, 0, FLAG_ALARM, ""}, + { "", "Charger Failure ", 1, SEC_ALARMSTAT, 8, 2, 0, FLAG_ALARM, ""}, + { "", "Fan Failure ", 1, SEC_ALARMSTAT, 10, 2, 0, FLAG_ALARM, ""}, + { "", "Fuse Failure ", 1, SEC_ALARMSTAT, 11, 2, 0, FLAG_ALARM, ""}, + { "", "General Fault ", 1, SEC_ALARMSTAT, 12, 2, 0, FLAG_ALARM, ""}, + { "", "Input Bad ", 1, SEC_ALARMSTAT, 2, 2, 0, FLAG_ALARM, ""}, + { "", "Output Bad ", 1, SEC_ALARMSTAT, 3, 2, 0, FLAG_ALARM, ""}, + { "", "Output Off ", 1, SEC_ALARMSTAT, 6, 2, 0, FLAG_ALARM, ""}, + { "", "Overload ", 1, SEC_ALARMSTAT, 4, 2, 0, FLAG_ALARM, ""}, + { "", "Shutdown Imminent ", 1, SEC_ALARMSTAT, 15, 2, 0, FLAG_ALARM, ""}, + { "", "Shutdown Pending ", 1, SEC_ALARMSTAT, 14, 2, 0, FLAG_ALARM, ""}, + { "", "System Off ", 1, SEC_ALARMSTAT, 9, 2, 0, FLAG_ALARM, ""}, + { "", "Temperature ", 1, SEC_ALARMSTAT, 1, 2, 0, FLAG_ALARM, ""}, + { "", "UPS Shutdown ", 1, SEC_ALARMSTAT, 7, 2, 0, FLAG_ALARM, ""}, + { "", "Audible Alarm", 1, SEC_NOMINAL, 8, 4, FLAG_POLLONCE, FLAG_RW, ""}, + { "", "Auto Restart", 1, SEC_AUTORESTART, 1, 2, FLAG_POLLONCE, FLAG_RW, ""}, + { "", "Battery Charge", 1, SEC_BATTSTAT, 3, 4, 0, 0, ""}, + { "", "Battery Condition", 1, SEC_BATTSTAT, 1, 3, 0, 0, ""}, + { "battery.current", "Battery Current", 10, SEC_BATTSTAT, 8, 9999, 0, 0, ""}, + { "battery.date", "Battery Installed", 1, SEC_NOMINAL, 11, 8, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Battery Status", 1, SEC_BATTSTAT, 2, 3, 0, 0, ""}, + { "battery.temperature", "Battery Temperature", 1, SEC_BATTSTAT, 9, 99, 0, 0, ""}, + { "battery.voltage", "Battery Voltage", 10, SEC_BATTSTAT, 7, 9999, 0, 0, ""}, + { "", "Bypass Current 1", 10, SEC_BYPASSSTAT, 4, 9999, 0, 0, ""}, + { "", "Bypass Current 2", 10, SEC_BYPASSSTAT, 7, 9999, 0, 0, ""}, + { "", "Bypass Current 3", 10, SEC_BYPASSSTAT, 10, 9999, 0, 0, ""}, + { "", "Bypass Frequency", 10, SEC_BYPASSSTAT, 1, 999, 0, 0, ""}, + { "", "Bypass Num Lines", 1, SEC_BYPASSSTAT, 2, 9, 0, 0, ""}, + { "", "Bypass Power 1", 1, SEC_BYPASSSTAT, 5, 99999, 0, 0, ""}, + { "", "Bypass Power 2", 1, SEC_BYPASSSTAT, 8, 99999, 0, 0, ""}, + { "", "Bypass Power 3", 1, SEC_BYPASSSTAT, 11, 99999, 0, 0, ""}, + { "", "Bypass Voltage 1", 10, SEC_BYPASSSTAT, 3, 9999, 0, 0, ""}, + { "", "Bypass Voltage 2", 10, SEC_BYPASSSTAT, 6, 9999, 0, 0, ""}, + { "", "Bypass Voltage 3", 10, SEC_BYPASSSTAT, 9, 9999, 0, 0, ""}, + { "battery.charge", "Estimated Charge", 1, SEC_BATTSTAT, 6, 999, 0, 0, ""}, + { "battery.runtime.low", "Estimated Minutes", 60, SEC_BATTSTAT, 5, 999, 0, FLAG_MULTI, ""}, + { "input.transfer.high", "High Volt Xfer Pt", 1, SEC_NOMINAL, 10, 999, FLAG_POLLONCE, FLAG_STRING, ""}, + { "ups.id", "Identification", 1, SEC_UPSID, 1, 64, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Input Current 1", 10, SEC_INPUTSTAT, 5, 9999, 0, 0, ""}, + { "", "Input Current 2", 10, SEC_INPUTSTAT, 9, 9999, 0, 0, ""}, + { "", "Input Current 3", 10, SEC_INPUTSTAT, 13, 9999, 0, 0, ""}, + { "input.frequency", "Input Frequency 1", 10, SEC_INPUTSTAT, 3, 999, 0, 0, ""}, + { "", "Input Frequency 2", 10, SEC_INPUTSTAT, 7, 999, 0, 0, ""}, + { "", "Input Frequency 3", 10, SEC_INPUTSTAT, 11, 999, 0, 0, ""}, + { "", "Input Line Bads", 1, SEC_INPUTSTAT, 1, 999, 0, 0, ""}, + { "", "Input Num Lines", 1, SEC_INPUTSTAT, 2, 9, 0, 0, ""}, + { "", "Input Power 1", 1, SEC_INPUTSTAT, 6, 99999, 0, 0, ""}, + { "", "Input Power 2", 1, SEC_INPUTSTAT, 10, 99999, 0, 0, ""}, + { "", "Input Power 3", 1, SEC_INPUTSTAT, 14, 99999, 0, 0, ""}, + { "input.voltage", "Input Voltage 1", 10, SEC_INPUTSTAT, 4, 9999, 0, 0, ""}, + { "", "Input Voltage 2", 10, SEC_INPUTSTAT, 8, 9999, 0, 0, ""}, + { "", "Input Voltage 3", 10, SEC_INPUTSTAT, 12, 9999, 0, 0, ""}, + { "input.transfer.low", "Low Volt Xfer Pt", 1, SEC_NOMINAL, 9, 999, FLAG_POLLONCE, FLAG_STRING, ""}, + { "ups.mfr", "Manufacturer", 1, SEC_MFR, 1, 32, FLAG_POLLONCE, FLAG_STRING, ""}, + { "ups.model", "Model", 1, SEC_MOD, 1, 64, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Nominal Battery Life", 1, SEC_NOMINAL, 12, 99999, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Nominal Input Frequency", 10, SEC_NOMINAL, 2, 999, FLAG_POLLONCE, FLAG_RW, ""}, + { "input.voltage.nominal", "Nominal Input Voltage", 1, SEC_NOMINAL, 1, 999, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Nominal Low Battery Time", 1, SEC_NOMINAL, 7, 99, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Nominal Output Frequency", 10, SEC_NOMINAL, 4, 999, FLAG_POLLONCE, FLAG_RW, ""}, + { "", "Nominal Output Power", 1, SEC_NOMINAL, 6, 99999, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Nominal Output Voltage", 1, SEC_NOMINAL, 3, 999, FLAG_POLLONCE, FLAG_STRING, ""}, + { "ups.power.nominal", "Nominal VA Rating", 1, SEC_NOMINAL, 5, 99999, FLAG_POLLONCE, FLAG_STRING, ""}, + { "output.current", "Output Current 1", 10, SEC_OUTPUTSTAT, 5, 9999, 0, 0, ""}, + { "", "Output Current 2", 10, SEC_OUTPUTSTAT, 9, 9999, 0, 0, ""}, + { "", "Output Current 3", 10, SEC_OUTPUTSTAT, 13, 9999, 0, 0, ""}, + { "output.frequency", "Output Frequency", 10, SEC_OUTPUTSTAT, 2, 999, 0, 0, ""}, + { "ups.load", "Output Load 1", 1, SEC_OUTPUTSTAT, 7, 999, 0, 0, ""}, + { "", "Output Load 2", 1, SEC_OUTPUTSTAT, 11, 999, 0, 0, ""}, + { "", "Output Load 3", 1, SEC_OUTPUTSTAT, 15, 999, 0, 0, ""}, + { "", "Output Num Lines", 1, SEC_OUTPUTSTAT, 3, 9, 0, 0, ""}, + { "", "Output Power 1", 1, SEC_OUTPUTSTAT, 6, 99999, 0, 0, ""}, + { "", "Output Power 2", 1, SEC_OUTPUTSTAT, 10, 99999, 0, 0, ""}, + { "", "Output Power 3", 1, SEC_OUTPUTSTAT, 14, 99999, 0, 0, ""}, + { "", "Output Source", 1, SEC_OUTPUTSTAT, 1, 6, 0, 0, ""}, + { "output.voltage", "Output Voltage 1", 10, SEC_OUTPUTSTAT, 4, 9999, 0, 0, ""}, + { "", "Output Voltage 2", 10, SEC_OUTPUTSTAT, 8, 9999, 0, 0, ""}, + { "", "Output Voltage 3", 10, SEC_OUTPUTSTAT, 12, 9999, 0, 0, ""}, + { "", "Reboot With Duration", 1, SEC_REBOOT, 1, 9999999, FLAG_POLLONCE, FLAG_WONLY, ""}, + { "battery.runtime", "Seconds on Battery", 1, SEC_BATTSTAT, 4, 99999, 0, 0, ""}, + { "", "Shutdown Type", 1, SEC_SHUTTYPE, 1, 2, FLAG_POLLONCE, FLAG_RW, ""}, + { "ups.delay.shutdown", "Shutdown After Delay", 1, SEC_STARTDELAY, 1, 9999999, FLAG_POLLONCE, FLAG_WONLY, ""}, + { "ups.firmware", "Software Version", 1, SEC_VERSION, 1, 32, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Startup After Delay", 1, SEC_STARTDELAY, 1, 9999999, FLAG_POLLONCE, FLAG_WONLY, ""}, + { "", "Test Results Detail", 1, SEC_TESTRESULT, 2, 64, FLAG_POLLONCE, FLAG_STRING, ""}, + { "", "Test Results Summary", 1, SEC_TESTRESULT, 1, 6, FLAG_POLLONCE, 0, ""}, + { "", "Test Type", 1, SEC_TEST, 1, 5, FLAG_POLLONCE, FLAG_WONLY, ""}, + { "", "Baud Rate", 1, SEC_BAUDRATE, 1, 19200, FLAG_POLLONCE, FLAG_RW, ""}, }; diff --git a/drivers/hpe-pdu-mib.c b/drivers/hpe-pdu-mib.c index d764d3baf5..3f0206b7cd 100644 --- a/drivers/hpe-pdu-mib.c +++ b/drivers/hpe-pdu-mib.c @@ -29,148 +29,148 @@ #define HPE_EPDU_OID_MODEL_NAME ".1.3.6.1.4.1.232.165.7.1.2.1.3.0" static info_lkp_t hpe_pdu_outlet_status_info[] = { - { 1, "off" }, - { 2, "on" }, - { 3, "pendingOff" }, /* transitional status */ - { 4, "pendingOn" }, /* transitional status */ - { 0, NULL } + { 1, "off", NULL, NULL }, + { 2, "on", NULL, NULL }, + { 3, "pendingOff", NULL, NULL }, /* transitional status */ + { 4, "pendingOn", NULL, NULL }, /* transitional status */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_outletgroups_status_info[] = { - { 1, "N/A" }, /* notApplicable, if group.type == outlet-section */ - { 2, "on" }, /* breakerOn */ - { 3, "off" }, /* breakerOff */ - { 0, NULL } + { 1, "N/A", NULL, NULL }, /* notApplicable, if group.type == outlet-section */ + { 2, "on", NULL, NULL }, /* breakerOn */ + { 3, "off", NULL, NULL }, /* breakerOff */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_outlet_switchability_info[] = { - { 1, "yes" }, - { 2, "no" }, - { 0, NULL } + { 1, "yes", NULL, NULL }, + { 2, "no", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* The physical type of outlet */ static info_lkp_t hpe_pdu_outlet_type_info[] = { - { 0, "unknown" }, - { 1, "iecC13" }, - { 2, "iecC19" }, - { 10, "uk" }, - { 11, "french" }, - { 12, "schuko" }, - { 20, "nema515" }, - { 21, "nema51520" }, - { 22, "nema520" }, - { 23, "nemaL520" }, - { 24, "nemaL530" }, - { 25, "nema615" }, - { 26, "nema620" }, - { 27, "nemaL620" }, - { 28, "nemaL630" }, - { 29, "nemaL715" }, - { 30, "rf203p277" }, - { 0, NULL } + { 0, "unknown", NULL, NULL }, + { 1, "iecC13", NULL, NULL }, + { 2, "iecC19", NULL, NULL }, + { 10, "uk", NULL, NULL }, + { 11, "french", NULL, NULL }, + { 12, "schuko", NULL, NULL }, + { 20, "nema515", NULL, NULL }, + { 21, "nema51520", NULL, NULL }, + { 22, "nema520", NULL, NULL }, + { 23, "nemaL520", NULL, NULL }, + { 24, "nemaL530", NULL, NULL }, + { 25, "nema615", NULL, NULL }, + { 26, "nema620", NULL, NULL }, + { 27, "nemaL620", NULL, NULL }, + { 28, "nemaL630", NULL, NULL }, + { 29, "nemaL715", NULL, NULL }, + { 30, "rf203p277", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_ambient_presence_info[] = { - { -1, "unknown" }, - { 1, "no" }, /* disconnected */ - { 2, "yes" }, /* connected */ - { 0, NULL } + { -1, "unknown", NULL, NULL }, + { 1, "no", NULL, NULL }, /* disconnected */ + { 2, "yes", NULL, NULL }, /* connected */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_threshold_status_info[] = { - { 1, "good" }, /* No threshold triggered */ - { 2, "warning-low" }, /* Warning low threshold triggered */ - { 3, "critical-low" }, /* Critical low threshold triggered */ - { 4, "warning-high" }, /* Warning high threshold triggered */ - { 5, "critical-high" }, /* Critical high threshold triggered */ - { 0, NULL } + { 1, "good", NULL, NULL }, /* No threshold triggered */ + { 2, "warning-low", NULL, NULL }, /* Warning low threshold triggered */ + { 3, "critical-low", NULL, NULL }, /* Critical low threshold triggered */ + { 4, "warning-high", NULL, NULL }, /* Warning high threshold triggered */ + { 5, "critical-high", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_threshold_frequency_status_info[] = { - { 1, "good" }, /* No threshold triggered */ - { 2, "out-of-range" }, /* Frequency out of range triggered */ - { 0, NULL } + { 1, "good", NULL, NULL }, /* No threshold triggered */ + { 2, "out-of-range", NULL, NULL }, /* Frequency out of range triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_ambient_drycontacts_info[] = { - { -1, "unknown" }, - { 0, "unknown" }, - { 1, "open" }, - { 2, "closed" }, - { 3, "bad" }, /* FIXME: what to do with that? */ - { 0, NULL } + { -1, "unknown", NULL, NULL }, + { 0, "unknown", NULL, NULL }, + { 1, "open", NULL, NULL }, + { 2, "closed", NULL, NULL }, + { 3, "bad", NULL, NULL }, /* FIXME: what to do with that? */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_threshold_voltage_alarms_info[] = { - { 1, "" }, /* No threshold triggered */ - { 2, "low voltage warning!" }, /* Warning low threshold triggered */ - { 3, "low voltage critical!" }, /* Critical low threshold triggered */ - { 4, "high voltage warning!" }, /* Warning high threshold triggered */ - { 5, "high voltage critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 1, "", NULL, NULL }, /* No threshold triggered */ + { 2, "low voltage warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 3, "low voltage critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 4, "high voltage warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 5, "high voltage critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_threshold_current_alarms_info[] = { - { 1, "" }, /* No threshold triggered */ - { 2, "low current warning!" }, /* Warning low threshold triggered */ - { 3, "low current critical!" }, /* Critical low threshold triggered */ - { 4, "high current warning!" }, /* Warning high threshold triggered */ - { 5, "high current critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 1, "", NULL, NULL }, /* No threshold triggered */ + { 2, "low current warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 3, "low current critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 4, "high current warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 5, "high current critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_threshold_frequency_alarm_info[] = { - { 1, "" }, /* No threshold triggered */ - { 2, "frequency out of range!" }, /* Frequency out of range triggered */ - { 0, NULL } + { 1, "", NULL, NULL }, /* No threshold triggered */ + { 2, "frequency out of range!", NULL, NULL }, /* Frequency out of range triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_threshold_temperature_alarms_info[] = { - { 1, "" }, /* No threshold triggered */ - { 2, "low temperature warning!" }, /* Warning low threshold triggered */ - { 3, "low temperature critical!" }, /* Critical low threshold triggered */ - { 4, "high temperature warning!" }, /* Warning high threshold triggered */ - { 5, "high temperature critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 1, "", NULL, NULL }, /* No threshold triggered */ + { 2, "low temperature warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 3, "low temperature critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 4, "high temperature warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 5, "high temperature critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_threshold_humidity_alarms_info[] = { - { 1, "" }, /* No threshold triggered */ - { 2, "low humidity warning!" }, /* Warning low threshold triggered */ - { 3, "low humidity critical!" }, /* Critical low threshold triggered */ - { 4, "high humidity warning!" }, /* Warning high threshold triggered */ - { 5, "high humidity critical!" }, /* Critical high threshold triggered */ - { 0, NULL } + { 1, "", NULL, NULL }, /* No threshold triggered */ + { 2, "low humidity warning!", NULL, NULL }, /* Warning low threshold triggered */ + { 3, "low humidity critical!", NULL, NULL }, /* Critical low threshold triggered */ + { 4, "high humidity warning!", NULL, NULL }, /* Warning high threshold triggered */ + { 5, "high humidity critical!", NULL, NULL }, /* Critical high threshold triggered */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_outlet_group_type_info[] = { - { 0, "unknown" }, - { 1, "unknown" }, - { 2, "breaker1pole" }, - { 3, "breaker2pole" }, - { 4, "breaker3pole" }, - { 5, "outlet-section" }, - { 0, NULL } + { 0, "unknown", NULL, NULL }, + { 1, "unknown", NULL, NULL }, + { 2, "breaker1pole", NULL, NULL }, + { 3, "breaker2pole", NULL, NULL }, + { 4, "breaker3pole", NULL, NULL }, + { 5, "outlet-section", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_input_type_info[] = { - { 1, "1" }, /* singlePhase */ - { 2, "2" }, /* splitPhase */ - { 3, "3" }, /* threePhaseDelta */ - { 4, "3" }, /* threePhaseWye */ - { 0, NULL } + { 1, "1", NULL, NULL }, /* singlePhase */ + { 2, "2", NULL, NULL }, /* splitPhase */ + { 3, "3", NULL, NULL }, /* threePhaseDelta */ + { 4, "3", NULL, NULL }, /* threePhaseWye */ + { 0, NULL, NULL, NULL } }; static info_lkp_t hpe_pdu_outlet_group_phase_info[] = { - { 1, "L1" }, /* singlePhase */ - { 2, "L1" }, /* phase1toN */ - { 3, "L2" }, /* phase2toN */ - { 4, "L3" }, /* phase3toN */ - { 5, "L1" }, /* phase1to2 */ - { 6, "L2" }, /* phase2to3 */ - { 7, "L3" }, /* phase3to1 */ - { 0, NULL } + { 1, "L1", NULL, NULL }, /* singlePhase */ + { 2, "L1", NULL, NULL }, /* phase1toN */ + { 3, "L2", NULL, NULL }, /* phase2toN */ + { 4, "L3", NULL, NULL }, /* phase3toN */ + { 5, "L1", NULL, NULL }, /* phase1to2 */ + { 6, "L2", NULL, NULL }, /* phase2to3 */ + { 7, "L3", NULL, NULL }, /* phase3to1 */ + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table for HPE PDU MIB */ @@ -891,5 +891,4 @@ static snmp_info_t hpe_pdu_mib[] = { }; -mib2nut_info_t hpe_pdu = { "hpe_epdu", HPE_EPDU_MIB_VERSION, NULL, HPE_EPDU_OID_MODEL_NAME, hpe_pdu_mib, HPE_EPDU_MIB_SYSOID }; - +mib2nut_info_t hpe_pdu = { "hpe_epdu", HPE_EPDU_MIB_VERSION, NULL, HPE_EPDU_OID_MODEL_NAME, hpe_pdu_mib, HPE_EPDU_MIB_SYSOID, NULL }; diff --git a/drivers/huawei-mib.c b/drivers/huawei-mib.c index 8374fd6b39..51424260cc 100644 --- a/drivers/huawei-mib.c +++ b/drivers/huawei-mib.c @@ -30,72 +30,72 @@ /* To create a value lookup structure (as needed on the 2nd line of the example * below), use the following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * { 1, "OB", NULL, NULL }, + * { 2, "OL", NULL, NULL }, + * { 0, NULL, NULL, NULL } * }; */ static info_lkp_t huawei_supplymethod_info[] = { - { 1, "" }, /* no supply */ - { 2, "OL BYPASS" }, - { 3, "OL" }, - { 4, "OB" }, - { 5, "" }, /* combined */ - { 6, "OL ECO" }, - { 7, "OB ECO" }, - { 0, NULL } + { 1, "", NULL, NULL }, /* no supply */ + { 2, "OL BYPASS", NULL, NULL }, + { 3, "OL", NULL, NULL }, + { 4, "OB", NULL, NULL }, + { 5, "", NULL, NULL }, /* combined */ + { 6, "OL ECO", NULL, NULL }, + { 7, "OB ECO", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t huawei_battstate_info[] = { - { 1, "" }, /* not connected */ - { 2, "" }, /* not charging or discharging */ - { 3, "" }, /* hibernation */ - { 4, "" }, /* float */ - { 5, "CHRG" }, /* equalized charging */ - { 6, "DISCHRG" }, - { 0, NULL } + { 1, "", NULL, NULL }, /* not connected */ + { 2, "", NULL, NULL }, /* not charging or discharging */ + { 3, "", NULL, NULL }, /* hibernation */ + { 4, "", NULL, NULL }, /* float */ + { 5, "CHRG", NULL, NULL }, /* equalized charging */ + { 6, "DISCHRG", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t huawei_phase_info[] = { - { 1, "1" }, - { 2, "3" }, - { 0, NULL } + { 1, "1", NULL, NULL }, + { 2, "3", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t huawei_voltrating_info[] = { - { 1, "200" }, - { 2, "208" }, - { 3, "220" }, - { 4, "380" }, - { 5, "400" }, - { 6, "415" }, - { 7, "480" }, - { 8, "600" }, - { 9, "690" }, - { 0, NULL } + { 1, "200", NULL, NULL }, + { 2, "208", NULL, NULL }, + { 3, "220", NULL, NULL }, + { 4, "380", NULL, NULL }, + { 5, "400", NULL, NULL }, + { 6, "415", NULL, NULL }, + { 7, "480", NULL, NULL }, + { 8, "600", NULL, NULL }, + { 9, "690", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t huawei_freqrating_info[] = { - { 1, "50" }, - { 2, "60" }, - { 0, NULL } + { 1, "50", NULL, NULL }, + { 2, "60", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t huawei_pwrrating_info[] = { - { 1, "80000" }, - { 2, "100000" }, - { 3, "120000" }, - { 4, "160000" }, - { 5, "200000" }, - { 6, "30000" }, - { 7, "40000" }, - { 8, "60000" }, - { 9, "2400000" }, - { 10, "2500000" }, - { 11, "2800000" }, - { 12, "3000000" }, - { 0, NULL } + { 1, "80000", NULL, NULL }, + { 2, "100000", NULL, NULL }, + { 3, "120000", NULL, NULL }, + { 4, "160000", NULL, NULL }, + { 5, "200000", NULL, NULL }, + { 6, "30000", NULL, NULL }, + { 7, "40000", NULL, NULL }, + { 8, "60000", NULL, NULL }, + { 9, "2400000", NULL, NULL }, + { 10, "2500000", NULL, NULL }, + { 11, "2800000", NULL, NULL }, + { 12, "3000000", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Note: This is currently identical to ietf_test_result_info from IETF MIB @@ -103,13 +103,13 @@ static info_lkp_t huawei_pwrrating_info[] = { * b) avoid namespace conflicts, especially with DMF loader of named objects */ static info_lkp_t huawei_test_result_info[] = { - { 1, "done and passed" }, - { 2, "done and warning" }, - { 3, "done and error" }, - { 4, "aborted" }, - { 5, "in progress" }, - { 6, "no test initiated" }, - { 0, NULL } + { 1, "done and passed", NULL, NULL }, + { 2, "done and warning", NULL, NULL }, + { 3, "done and error", NULL, NULL }, + { 4, "aborted", NULL, NULL }, + { 5, "in progress", NULL, NULL }, + { 6, "no test initiated", NULL, NULL }, + { 0, NULL, NULL, NULL } }; @@ -235,4 +235,4 @@ static snmp_info_t huawei_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t huawei = { "huawei", HUAWEI_MIB_VERSION, NULL, HUAWEI_OID_MODEL_NAME, huawei_mib, HUAWEI_SYSOID }; +mib2nut_info_t huawei = { "huawei", HUAWEI_MIB_VERSION, NULL, HUAWEI_OID_MODEL_NAME, huawei_mib, HUAWEI_SYSOID, NULL }; diff --git a/drivers/ietf-mib.c b/drivers/ietf-mib.c index c8b0a0ee03..e6bab56fe9 100644 --- a/drivers/ietf-mib.c +++ b/drivers/ietf-mib.c @@ -46,67 +46,67 @@ /* #define DEBUG */ static info_lkp_t ietf_battery_info[] = { - { 1, "" /* unknown */ }, - { 2, "" /* batteryNormal */}, - { 3, "LB" /* batteryLow */ }, - { 4, "LB" /* batteryDepleted */ }, - { 0, NULL } + { 1, "" /* unknown */, NULL, NULL }, + { 2, "" /* batteryNormal */, NULL, NULL }, + { 3, "LB" /* batteryLow */, NULL, NULL }, + { 4, "LB" /* batteryDepleted */, NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_power_source_info[] = { - { 1, "" /* other */ }, - { 2, "OFF" /* none */ }, - { 3, "OL" /* normal */ }, - { 4, "OL BYPASS" /* bypass */ }, - { 5, "OB" /* battery */ }, - { 6, "OL BOOST" /* booster */ }, - { 7, "OL TRIM" /* reducer */ }, - { 0, NULL } + { 1, "" /* other */, NULL, NULL }, + { 2, "OFF" /* none */, NULL, NULL }, + { 3, "OL" /* normal */, NULL, NULL }, + { 4, "OL BYPASS" /* bypass */, NULL, NULL }, + { 5, "OB" /* battery */, NULL, NULL }, + { 6, "OL BOOST" /* booster */, NULL, NULL }, + { 7, "OL TRIM" /* reducer */, NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_overload_info[] = { - { 1, "OVER" }, /* output overload */ - { 0, NULL } + { 1, "OVER", NULL, NULL }, /* output overload */ + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_test_active_info[] = { - { 1, "" }, /* upsTestNoTestsInitiated */ - { 2, "" }, /* upsTestAbortTestInProgress */ - { 3, "TEST" }, /* upsTestGeneralSystemsTest */ - { 4, "TEST" }, /* upsTestQuickBatteryTest */ - { 5, "CAL" }, /* upsTestDeepBatteryCalibration */ - { 0, NULL } + { 1, "", NULL, NULL }, /* upsTestNoTestsInitiated */ + { 2, "", NULL, NULL }, /* upsTestAbortTestInProgress */ + { 3, "TEST", NULL, NULL }, /* upsTestGeneralSystemsTest */ + { 4, "TEST", NULL, NULL }, /* upsTestQuickBatteryTest */ + { 5, "CAL", NULL, NULL }, /* upsTestDeepBatteryCalibration */ + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_test_result_info[] = { - { 1, "done and passed" }, - { 2, "done and warning" }, - { 3, "done and error" }, - { 4, "aborted" }, - { 5, "in progress" }, - { 6, "no test initiated" }, - { 0, NULL } + { 1, "done and passed", NULL, NULL }, + { 2, "done and warning", NULL, NULL }, + { 3, "done and error", NULL, NULL }, + { 4, "aborted", NULL, NULL }, + { 5, "in progress", NULL, NULL }, + { 6, "no test initiated", NULL, NULL }, + { 0, NULL, NULL, NULL } }; #ifdef DEBUG static info_lkp_t ietf_shutdown_type_info[] = { - { 1, "output" }, - { 2, "system" }, - { 0, NULL } + { 1, "output", NULL, NULL }, + { 2, "system", NULL, NULL }, + { 0, NULL, NULL, NULL } }; #endif static info_lkp_t ietf_yes_no_info[] = { - { 1, "yes" }, - { 2, "no" }, - { 0, NULL } + { 1, "yes", NULL, NULL }, + { 2, "no", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_beeper_status_info[] = { - { 1, "disabled" }, - { 2, "enabled" }, - { 3, "muted" }, - { 0, NULL } + { 1, "disabled", NULL, NULL }, + { 2, "enabled", NULL, NULL }, + { 3, "muted", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar */ @@ -288,9 +288,9 @@ static snmp_info_t ietf_mib[] = { /* FIXME: Rename the structure here (or even relocate to new file) * and in snmp-ups.c when the real TrippLite mappings get defined. */ /* FIXME: Duplicate the line below to fix an issue with the code generator (nut-snmpinfo.py -> line is discarding) */ -/*mib2nut_info_t tripplite_ietf = { "tripplite", IETF_MIB_VERSION, NULL, NULL, ietf_mib, TRIPPLITE_SYSOID };*/ -mib2nut_info_t tripplite_ietf = { "tripplite", IETF_MIB_VERSION, NULL, NULL, ietf_mib, TRIPPLITE_SYSOID }; +/*mib2nut_info_t tripplite_ietf = { "tripplite", IETF_MIB_VERSION, NULL, NULL, ietf_mib, TRIPPLITE_SYSOID, NULL };*/ +mib2nut_info_t tripplite_ietf = { "tripplite", IETF_MIB_VERSION, NULL, NULL, ietf_mib, TRIPPLITE_SYSOID, NULL }; /* FIXME: Duplicate the line below to fix an issue with the code generator (nut-snmpinfo.py -> line is discarding) */ -/*mib2nut_info_t ietf = { "ietf", IETF_MIB_VERSION, IETF_OID_UPS_MIB "4.1.0", IETF_OID_UPS_MIB "1.1.0", ietf_mib, IETF_SYSOID };*/ -mib2nut_info_t ietf = { "ietf", IETF_MIB_VERSION, IETF_OID_UPS_MIB "4.1.0", IETF_OID_UPS_MIB "1.1.0", ietf_mib, IETF_SYSOID }; +/*mib2nut_info_t ietf = { "ietf", IETF_MIB_VERSION, IETF_OID_UPS_MIB "4.1.0", IETF_OID_UPS_MIB "1.1.0", ietf_mib, IETF_SYSOID, NULL };*/ +mib2nut_info_t ietf = { "ietf", IETF_MIB_VERSION, IETF_OID_UPS_MIB "4.1.0", IETF_OID_UPS_MIB "1.1.0", ietf_mib, IETF_SYSOID, NULL }; diff --git a/drivers/mge-hid.c b/drivers/mge-hid.c index e0d26eb706..ea011840c3 100644 --- a/drivers/mge-hid.c +++ b/drivers/mge-hid.c @@ -195,8 +195,8 @@ static const char *eaton_abm_enabled_fun(double value) } static info_lkp_t eaton_abm_enabled_info[] = { - { 0, "dummy", eaton_abm_enabled_fun }, - { 0, NULL, NULL } + { 0, "dummy", eaton_abm_enabled_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* Note 1: This point will need more clarification! */ @@ -213,8 +213,8 @@ static const char *eaton_abm_enabled_legacy_fun(double value) } static info_lkp_t eaton_abm_enabled_legacy_info[] = { - { 0, "dummy", eaton_abm_enabled_legacy_fun }, - { 0, NULL, NULL } + { 0, "dummy", eaton_abm_enabled_legacy_fun, NULL }, + { 0, NULL, NULL, NULL } }; #endif /* if 0 */ @@ -260,8 +260,8 @@ static const char *eaton_abm_status_fun(double value) } static info_lkp_t eaton_abm_status_info[] = { - { 1, "dummy", eaton_abm_status_fun }, - { 0, NULL, NULL } + { 1, "dummy", eaton_abm_status_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* Used to process ABM flags, for ups.status (CHRG/DISCHRG/RB) */ @@ -294,8 +294,8 @@ static const char *eaton_abm_chrg_dischrg_fun(double value) } static info_lkp_t eaton_abm_chrg_dischrg_info[] = { - { 1, "dummy", eaton_abm_chrg_dischrg_fun }, - { 0, NULL, NULL } + { 1, "dummy", eaton_abm_chrg_dischrg_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* ABM also implies that standard CHRG/DISCHRG are processed according @@ -326,8 +326,8 @@ static const char *eaton_abm_check_dischrg_fun(double value) } static info_lkp_t eaton_discharging_info[] = { - { 1, "dummy", eaton_abm_check_dischrg_fun }, - { 0, NULL, NULL } + { 1, "dummy", eaton_abm_check_dischrg_fun, NULL }, + { 0, NULL, NULL, NULL } }; static const char *eaton_abm_check_chrg_fun(double value) @@ -352,8 +352,8 @@ static const char *eaton_abm_check_chrg_fun(double value) } static info_lkp_t eaton_charging_info[] = { - { 1, "dummy", eaton_abm_check_chrg_fun }, - { 0, NULL, NULL } + { 1, "dummy", eaton_abm_check_chrg_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* The HID path 'UPS.PowerSummary.Time' reports Unix time (ie the number of @@ -459,7 +459,7 @@ static const char *mge_battery_voltage_nominal_fun(double value) } static info_lkp_t mge_battery_voltage_nominal[] = { - { 0, NULL, mge_battery_voltage_nominal_fun } + { 0, NULL, mge_battery_voltage_nominal_fun, NULL } }; /* The HID path 'UPS.PowerSummary.Voltage' only reports @@ -483,7 +483,7 @@ static const char *mge_battery_voltage_fun(double value) } static info_lkp_t mge_battery_voltage[] = { - { 0, NULL, mge_battery_voltage_fun } + { 0, NULL, mge_battery_voltage_fun, NULL } }; static const char *mge_powerfactor_conversion_fun(double value) @@ -493,7 +493,7 @@ static const char *mge_powerfactor_conversion_fun(double value) } static info_lkp_t mge_powerfactor_conversion[] = { - { 0, NULL, mge_powerfactor_conversion_fun } + { 0, NULL, mge_powerfactor_conversion_fun, NULL } }; static const char *mge_battery_capacity_fun(double value) @@ -503,65 +503,65 @@ static const char *mge_battery_capacity_fun(double value) } static info_lkp_t mge_battery_capacity[] = { - { 0, NULL, mge_battery_capacity_fun } + { 0, NULL, mge_battery_capacity_fun, NULL } }; info_lkp_t eaton_enable_disable_info[] = { - { 0, "disabled", NULL }, - { 1, "enabled", NULL }, - { 0, NULL, NULL } + { 0, "disabled", NULL, NULL }, + { 1, "enabled", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_upstype_conversion[] = { - { 1, "offline / line interactive", NULL }, - { 2, "online", NULL }, - { 3, "online - unitary/parallel", NULL }, - { 4, "online - parallel with hot standy", NULL }, - { 5, "online - hot standby redundancy", NULL }, - { 0, NULL, NULL } + { 1, "offline / line interactive", NULL, NULL }, + { 2, "online", NULL, NULL }, + { 3, "online - unitary/parallel", NULL, NULL }, + { 4, "online - parallel with hot standy", NULL, NULL }, + { 5, "online - hot standby redundancy", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_sensitivity_info[] = { - { 0, "normal", NULL }, - { 1, "high", NULL }, - { 2, "low", NULL }, - { 0, NULL, NULL } + { 0, "normal", NULL, NULL }, + { 1, "high", NULL, NULL }, + { 2, "low", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_emergency_stop[] = { - { 1, "Emergency stop!", NULL }, - { 0, NULL, NULL } + { 1, "Emergency stop!", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_wiring_fault[] = { - { 1, "Wiring fault!", NULL }, - { 0, NULL, NULL } + { 1, "Wiring fault!", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_config_failure[] = { - { 1, "Fatal EEPROM fault!", NULL }, - { 0, NULL, NULL } + { 1, "Fatal EEPROM fault!", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_inverter_volthi[] = { - { 1, "Inverter AC voltage too high!", NULL }, - { 0, NULL, NULL } + { 1, "Inverter AC voltage too high!", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_inverter_voltlo[] = { - { 1, "Inverter AC voltage too low!", NULL }, - { 0, NULL, NULL } + { 1, "Inverter AC voltage too low!", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_short_circuit[] = { - { 1, "Output short circuit!", NULL }, - { 0, NULL, NULL } + { 1, "Output short circuit!", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t mge_onbatt_info[] = { - { 1, "!online", NULL }, - { 0, "online", NULL }, - { 0, NULL, NULL } + { 1, "!online", NULL, NULL }, + { 0, "online", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* allow limiting to ups.model = Protection Station, Ellipse Eco @@ -585,10 +585,10 @@ static const char *eaton_check_pegasus_fun(double value) } static info_lkp_t pegasus_threshold_info[] = { - { 10, "10", eaton_check_pegasus_fun }, - { 25, "25", eaton_check_pegasus_fun }, - { 60, "60", eaton_check_pegasus_fun }, - { 0, NULL, NULL } + { 10, "10", eaton_check_pegasus_fun, NULL }, + { 25, "25", eaton_check_pegasus_fun, NULL }, + { 60, "60", eaton_check_pegasus_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* allow limiting standard yes/no info (here, to enable ECO mode) to @@ -635,7 +635,7 @@ static double pegasus_yes_no_info_nuf(const char *value) info_lkp_t pegasus_yes_no_info[] = { { 0, "no", pegasus_yes_no_info_fun, pegasus_yes_no_info_nuf }, { 1, "yes", pegasus_yes_no_info_fun, pegasus_yes_no_info_nuf }, - { 0, NULL, NULL } + { 0, NULL, NULL, NULL } }; /* Determine country using UPS.PowerSummary.Country. @@ -650,8 +650,8 @@ static const char *eaton_check_country_fun(double value) } static info_lkp_t eaton_check_country_info[] = { - { 0, "dummy", eaton_check_country_fun }, - { 0, NULL, NULL } + { 0, "dummy", eaton_check_country_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* When UPS.PowerConverter.Output.ActivePower is not present, @@ -683,8 +683,8 @@ static const char *eaton_compute_realpower_fun(double value) } static info_lkp_t eaton_compute_realpower_info[] = { - { 0, "dummy", eaton_compute_realpower_fun }, - { 0, NULL, NULL } + { 0, "dummy", eaton_compute_realpower_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* Limit nominal output voltage according to HV or LV models */ @@ -774,19 +774,19 @@ static info_lkp_t nominal_output_voltage_info[] = { /* line-interactive, starting with Evolution, support both HV values */ /* HV models */ /* 208V */ - { 200, "200", nominal_output_voltage_fun }, - { 208, "208", nominal_output_voltage_fun }, + { 200, "200", nominal_output_voltage_fun, NULL }, + { 208, "208", nominal_output_voltage_fun, NULL }, /* HV models */ /* 230V */ - { 220, "220", nominal_output_voltage_fun }, - { 230, "230", nominal_output_voltage_fun }, - { 240, "240", nominal_output_voltage_fun }, + { 220, "220", nominal_output_voltage_fun, NULL }, + { 230, "230", nominal_output_voltage_fun, NULL }, + { 240, "240", nominal_output_voltage_fun, NULL }, /* LV models */ - { 100, "100", nominal_output_voltage_fun }, - { 110, "110", nominal_output_voltage_fun }, - { 120, "120", nominal_output_voltage_fun }, - { 127, "127", nominal_output_voltage_fun }, - { 0, NULL, NULL } + { 100, "100", nominal_output_voltage_fun, NULL }, + { 110, "110", nominal_output_voltage_fun, NULL }, + { 120, "120", nominal_output_voltage_fun, NULL }, + { 127, "127", nominal_output_voltage_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* Limit reporting "online / !online" to when "!off" */ @@ -801,8 +801,8 @@ static const char *eaton_converter_online_fun(double value) } info_lkp_t eaton_converter_online_info[] = { - { 0, "dummy", eaton_converter_online_fun }, - { 0, NULL, NULL } + { 0, "dummy", eaton_converter_online_fun, NULL }, + { 0, NULL, NULL, NULL } }; /* --------------------------------------------------------------- */ @@ -1066,7 +1066,7 @@ static models_name_t mge_model_names [] = { "Eaton 5P", "850", EATON_5P, "5P 850" }, { "Eaton 5P", "1150", EATON_5P, "5P 1150" }, { "Eaton 5P", "1550", EATON_5P, "5P 1550" }, - + /* Pulsar M models */ { "PULSAR M", "2200", MGE_PULSAR_M_2200, NULL }, { "PULSAR M", "3000", MGE_PULSAR_M_3000, NULL }, diff --git a/drivers/mge-mib.c b/drivers/mge-mib.c index 3b98930185..ff567cde15 100644 --- a/drivers/mge-mib.c +++ b/drivers/mge-mib.c @@ -38,98 +38,98 @@ #define MGE_OID_MODEL_NAME MGE_BASE_OID ".1.1.0" static info_lkp_t mge_lowbatt_info[] = { - { 1, "LB" }, - { 2, "" }, - { 0, NULL } + { 1, "LB", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_onbatt_info[] = { - { 1, "OB" }, - { 2, "OL" }, - { 0, NULL } + { 1, "OB", NULL, NULL }, + { 2, "OL", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_bypass_info[] = { - { 1, "BYPASS" }, - { 2, "" }, - { 0, NULL } + { 1, "BYPASS", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_boost_info[] = { - { 1, "BOOST" }, - { 2, "" }, - { 0, NULL } + { 1, "BOOST", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_trim_info[] = { - { 1, "TRIM" }, - { 2, "" }, - { 0, NULL } + { 1, "TRIM", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_overload_info[] = { - { 1, "OVER" }, - { 2, "" }, - { 0, NULL } + { 1, "OVER", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_replacebatt_info[] = { - { 1, "RB" }, - { 2, "" }, - { 0, NULL } + { 1, "RB", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_output_util_off_info[] = { - { 1, "OFF" }, - { 2, "" }, - { 0, NULL } + { 1, "OFF", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t mge_transfer_reason_info[] = { - { 1, "" }, - { 2, "input voltage out of range" }, - { 3, "input frequency out of range" }, - { 4, "utility off" }, - { 0, NULL } + { 1, "", NULL, NULL }, + { 2, "input voltage out of range", NULL, NULL }, + { 3, "input frequency out of range", NULL, NULL }, + { 4, "utility off", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_test_result_info[] = { - { 1, "done and passed" }, - { 2, "done and warning" }, - { 3, "done and error" }, - { 4, "aborted" }, - { 5, "in progress" }, - { 6, "no test initiated" }, - { 0, NULL } + { 1, "done and passed", NULL, NULL }, + { 2, "done and warning", NULL, NULL }, + { 3, "done and error", NULL, NULL }, + { 4, "aborted", NULL, NULL }, + { 5, "in progress", NULL, NULL }, + { 6, "no test initiated", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_beeper_status_info[] = { - { 1, "disabled" }, - { 2, "enabled" }, - { 3, "muted" }, - { 0, NULL } + { 1, "disabled", NULL, NULL }, + { 2, "enabled", NULL, NULL }, + { 3, "muted", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_yes_no_info[] = { - { 1, "yes" }, - { 2, "no" }, - { 0, NULL } + { 1, "yes", NULL, NULL }, + { 2, "no", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* FIXME: the below may introduce status redundancy, that needs to be * addressed by the driver, as for usbhid-ups! */ static info_lkp_t ietf_power_source_info[] = { - { 1, "" /* other */ }, - { 2, "OFF" /* none */ }, + { 1, "" /* other */, NULL, NULL }, + { 2, "OFF" /* none */, NULL, NULL }, #if 0 - { 3, "OL" /* normal */ }, + { 3, "OL" /* normal */, NULL, NULL }, #endif - { 4, "BYPASS" /* bypass */ }, - { 5, "OB" /* battery */ }, - { 6, "BOOST" /* booster */ }, - { 7, "TRIM" /* reducer */ }, - { 0, NULL } + { 4, "BYPASS" /* bypass */, NULL, NULL }, + { 5, "OB" /* battery */, NULL, NULL }, + { 6, "BOOST" /* booster */, NULL, NULL }, + { 7, "TRIM" /* reducer */, NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Parameters default values */ @@ -270,4 +270,4 @@ static snmp_info_t mge_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t mge = { "mge", MGE_MIB_VERSION, NULL, MGE_OID_MODEL_NAME, mge_mib, MGE_SYSOID }; +mib2nut_info_t mge = { "mge", MGE_MIB_VERSION, NULL, MGE_OID_MODEL_NAME, mge_mib, MGE_SYSOID, NULL }; diff --git a/drivers/netvision-mib.c b/drivers/netvision-mib.c index 89e2acf103..9affa6a0ec 100644 --- a/drivers/netvision-mib.c +++ b/drivers/netvision-mib.c @@ -39,19 +39,19 @@ /* UPS Battery */ #define NETVISION_OID_BATTERYSTATUS ".1.3.6.1.4.1.4555.1.1.1.1.2.1.0" static info_lkp_t netvision_batt_info[] = { - { 2, "" }, /* battery normal */ - { 3, "LB" }, /* battery low */ - { 4, "LB" }, /* battery depleted */ - { 5, "DISCHRG" }, /* battery discharging */ - { 6, "RB" }, /* battery failure */ - { 0, NULL } + { 2, "", NULL, NULL }, /* battery normal */ + { 3, "LB", NULL, NULL }, /* battery low */ + { 4, "LB", NULL, NULL }, /* battery depleted */ + { 5, "DISCHRG", NULL, NULL }, /* battery discharging */ + { 6, "RB", NULL, NULL }, /* battery failure */ + { 0, NULL, NULL, NULL } }; /* Battery status: upsAlarmOnBattery */ static info_lkp_t netvision_onbatt_info[] = { - { 0, "OL" }, /* Online */ - { 1, "OB" }, /* On battery */ - { 0, NULL } + { 0, "OL", NULL, NULL }, /* Online */ + { 1, "OB", NULL, NULL }, /* On battery */ + { 0, NULL, NULL, NULL } }; #define NETVISION_OID_SECONDSONBATTERY ".1.3.6.1.4.1.4555.1.1.1.1.2.2.0" @@ -101,16 +101,16 @@ static info_lkp_t netvision_onbatt_info[] = { #define NETVISION_OID_CONTROL_SHUTDOWN_DELAY ".1.3.6.1.4.1.4555.1.1.1.1.8.2" static info_lkp_t netvision_output_info[] = { - { 1, "" }, /* output source other */ - { 2, "" }, /* output source none */ - { 3, "OL" }, /* output source normal */ - { 4, "OL BYPASS" }, /* output source bypass */ - { 5, "OB" }, /* output source battery */ - { 6, "OL BOOST" }, /* output source booster */ - { 7, "OL TRIM" }, /* output source reducer */ - { 8, "OL" }, /* output source standby */ - { 9, "" }, /* output source ecomode */ - { 0, NULL } + { 1, "", NULL, NULL }, /* output source other */ + { 2, "", NULL, NULL }, /* output source none */ + { 3, "OL", NULL, NULL }, /* output source normal */ + { 4, "OL BYPASS", NULL, NULL }, /* output source bypass */ + { 5, "OB", NULL, NULL }, /* output source battery */ + { 6, "OL BOOST", NULL, NULL }, /* output source booster */ + { 7, "OL TRIM", NULL, NULL }, /* output source reducer */ + { 8, "OL", NULL, NULL }, /* output source standby */ + { 9, "", NULL, NULL }, /* output source ecomode */ + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table */ @@ -181,4 +181,4 @@ static snmp_info_t netvision_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t netvision = { "netvision", NETVISION_MIB_VERSION, NULL, NETVISION_OID_UPSIDENTMODEL, netvision_mib, NETVISION_SYSOID }; +mib2nut_info_t netvision = { "netvision", NETVISION_MIB_VERSION, NULL, NETVISION_OID_UPSIDENTMODEL, netvision_mib, NETVISION_SYSOID, NULL }; diff --git a/drivers/openups-hid.c b/drivers/openups-hid.c index 0205719974..5bad315991 100644 --- a/drivers/openups-hid.c +++ b/drivers/openups-hid.c @@ -135,47 +135,47 @@ static const char *openups_scale_cdischarge_fun(double value); static const char *openups_temperature_fun(double value); static info_lkp_t openups_charging_info[] = { - {0, NULL, openups_charging_fun} + {0, NULL, openups_charging_fun, NULL } }; static info_lkp_t openups_discharging_info[] = { - {0, NULL, openups_discharging_fun} + {0, NULL, openups_discharging_fun, NULL } }; static info_lkp_t openups_online_info[] = { - {0, NULL, openups_online_fun} + {0, NULL, openups_online_fun, NULL } }; static info_lkp_t openups_nobattery_info[] = { - {0, NULL, openups_nobattery_fun} + {0, NULL, openups_nobattery_fun, NULL } }; static info_lkp_t openups_off_info[] = { - {0, NULL, openups_off_fun} + {0, NULL, openups_off_fun, NULL } }; static info_lkp_t openups_vin_info[] = { - {0, NULL, openups_scale_vin_fun} + {0, NULL, openups_scale_vin_fun, NULL } }; static info_lkp_t openups_vout_info[] = { - {0, NULL, openups_scale_vout_fun} + {0, NULL, openups_scale_vout_fun, NULL } }; /* static info_lkp_t openups_vbat_info[] = { - {0, NULL, openups_scale_vbat_fun} + {0, NULL, openups_scale_vbat_fun, NULL } };*/ static info_lkp_t openups_ccharge_info[] = { - {0, NULL, openups_scale_ccharge_fun} + {0, NULL, openups_scale_ccharge_fun, NULL } }; static info_lkp_t openups_cdischarge_info[] = { - {0, NULL, openups_scale_cdischarge_fun} + {0, NULL, openups_scale_cdischarge_fun, NULL } }; static info_lkp_t openups_temperature_info[] = { - {0, NULL, openups_temperature_fun} + {0, NULL, openups_temperature_fun, NULL } }; static const char *openups_charging_fun(double value) diff --git a/drivers/optiups.c b/drivers/optiups.c index 32a237ffba..27505120d4 100644 --- a/drivers/optiups.c +++ b/drivers/optiups.c @@ -99,17 +99,19 @@ enum { typedef struct ezfill_s { const char *cmd; const char *var; - const float scale; + const float scale; /* if 0, no conversion is done and the string + is passed to dstate as is, otherwise a float + conversion with single decimal is applied */ } ezfill_t; /* These can be polled right into a string usable by NUT. * Others such as "AG" and "BV" require some transformation of the return value */ static ezfill_t _pollv[] = { - { "NV", "input.voltage" }, + { "NV", "input.voltage", 0 }, { "OL", "ups.load", 1.0 }, - { "OV", "output.voltage" }, + { "OV", "output.voltage", 0 }, { "FF", "input.frequency", 0.1 }, - { "BT", "ups.temperature" }, + { "BT", "ups.temperature", 0 }, }; static ezfill_t _pollv_zinto[] = { { "NV", "input.voltage", 2.0 }, @@ -117,14 +119,14 @@ static ezfill_t _pollv_zinto[] = { { "OV", "output.voltage", 2.0 }, { "OF", "output.frequency", 0.1 }, { "NF", "input.frequency", 0.1 }, - { "BT", "ups.temperature" }, + { "BT", "ups.temperature", 0 }, }; /* model "IO" is parsed differently in upsdrv_initinfo() */ static ezfill_t _initv[] = { - { "IM", "ups.mfr" }, - { "IZ", "ups.serial" }, - { "IS", "ups.firmware" }, + { "IM", "ups.mfr", 0 }, + { "IZ", "ups.serial", 0 }, + { "IS", "ups.firmware", 0 }, }; /* All serial reads of the OPTI-UPS go through here. We always expect a CR/LF terminated diff --git a/drivers/powercom-hid.c b/drivers/powercom-hid.c index fbe63325cd..d8fdef10e0 100644 --- a/drivers/powercom-hid.c +++ b/drivers/powercom-hid.c @@ -126,9 +126,9 @@ static info_lkp_t powercom_stayoff_info[] = { }; static info_lkp_t powercom_beeper_info[] = { - { 1, "enabled", NULL }, - { 2, "disabled", NULL }, /* muted? */ - { 0, NULL, NULL } + { 1, "enabled", NULL, NULL }, + { 2, "disabled", NULL, NULL }, /* muted? */ + { 0, NULL, NULL, NULL } }; static const char *powercom_voltage_conversion_fun(double value) @@ -139,7 +139,7 @@ static const char *powercom_voltage_conversion_fun(double value) } static info_lkp_t powercom_voltage_conversion[] = { - { 0, NULL, powercom_voltage_conversion_fun } + { 0, NULL, powercom_voltage_conversion_fun, NULL } }; static const char *powercom_upsfail_conversion_fun(double value) @@ -152,7 +152,7 @@ static const char *powercom_upsfail_conversion_fun(double value) } static info_lkp_t powercom_upsfail_conversion[] = { - { 0, NULL, powercom_upsfail_conversion_fun } + { 0, NULL, powercom_upsfail_conversion_fun, NULL } }; static const char *powercom_replacebatt_conversion_fun(double value) @@ -165,7 +165,7 @@ static const char *powercom_replacebatt_conversion_fun(double value) } static info_lkp_t powercom_replacebatt_conversion[] = { - { 0, NULL, powercom_replacebatt_conversion_fun } + { 0, NULL, powercom_replacebatt_conversion_fun, NULL } }; static const char *powercom_test_conversion_fun(double value) @@ -178,7 +178,7 @@ static const char *powercom_test_conversion_fun(double value) } static info_lkp_t powercom_test_conversion[] = { - { 0, NULL, powercom_test_conversion_fun } + { 0, NULL, powercom_test_conversion_fun, NULL } }; static const char *powercom_shutdownimm_conversion_fun(double value) @@ -191,7 +191,7 @@ static const char *powercom_shutdownimm_conversion_fun(double value) } static info_lkp_t powercom_shutdownimm_conversion[] = { - { 0, NULL, powercom_shutdownimm_conversion_fun } + { 0, NULL, powercom_shutdownimm_conversion_fun, NULL } }; static const char *powercom_online_conversion_fun(double value) @@ -204,7 +204,7 @@ static const char *powercom_online_conversion_fun(double value) } static info_lkp_t powercom_online_conversion[] = { - { 0, NULL, powercom_online_conversion_fun } + { 0, NULL, powercom_online_conversion_fun, NULL } }; static const char *powercom_lowbatt_conversion_fun(double value) @@ -217,7 +217,7 @@ static const char *powercom_lowbatt_conversion_fun(double value) } static info_lkp_t powercom_lowbatt_conversion[] = { - { 0, NULL, powercom_lowbatt_conversion_fun } + { 0, NULL, powercom_lowbatt_conversion_fun, NULL } }; static const char *powercom_trim_conversion_fun(double value) @@ -230,7 +230,7 @@ static const char *powercom_trim_conversion_fun(double value) } static info_lkp_t powercom_trim_conversion[] = { - { 0, NULL, powercom_trim_conversion_fun } + { 0, NULL, powercom_trim_conversion_fun, NULL } }; static const char *powercom_boost_conversion_fun(double value) @@ -243,7 +243,7 @@ static const char *powercom_boost_conversion_fun(double value) } static info_lkp_t powercom_boost_conversion[] = { - { 0, NULL, powercom_boost_conversion_fun } + { 0, NULL, powercom_boost_conversion_fun, NULL } }; static const char *powercom_overload_conversion_fun(double value) @@ -256,7 +256,7 @@ static const char *powercom_overload_conversion_fun(double value) } static info_lkp_t powercom_overload_conversion[] = { - { 0, NULL, powercom_overload_conversion_fun } + { 0, NULL, powercom_overload_conversion_fun, NULL } }; /* --------------------------------------------------------------- */ diff --git a/drivers/powerware-mib.c b/drivers/powerware-mib.c index 70ec578337..c99d51c8c2 100644 --- a/drivers/powerware-mib.c +++ b/drivers/powerware-mib.c @@ -102,96 +102,96 @@ #define DEFAULT_SHUTDOWNDELAY 0 static info_lkp_t pw_alarm_ob[] = { - { 1, "OB" }, - { 2, "" }, - { 0, NULL } + { 1, "OB", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } } ; static info_lkp_t pw_alarm_lb[] = { - { 1, "LB" }, - { 2, "" }, - { 0, NULL } + { 1, "LB", NULL, NULL }, + { 2, "", NULL, NULL }, + { 0, NULL, NULL, NULL } } ; static info_lkp_t pw_pwr_info[] = { - { 1, "" /* other */ }, - { 2, "OFF" /* none */ }, - { 3, "OL" /* normal */ }, - { 4, "BYPASS" /* bypass */ }, - { 5, "OB" /* battery */ }, - { 6, "OL BOOST" /* booster */ }, - { 7, "OL TRIM" /* reducer */ }, - { 8, "OL" /* parallel capacity */ }, - { 9, "OL" /* parallel redundancy */ }, - { 10, "OL" /* high efficiency */ }, + { 1, "" /* other */, NULL, NULL }, + { 2, "OFF" /* none */, NULL, NULL }, + { 3, "OL" /* normal */, NULL, NULL }, + { 4, "BYPASS" /* bypass */, NULL, NULL }, + { 5, "OB" /* battery */, NULL, NULL }, + { 6, "OL BOOST" /* booster */, NULL, NULL }, + { 7, "OL TRIM" /* reducer */, NULL, NULL }, + { 8, "OL" /* parallel capacity */, NULL, NULL }, + { 9, "OL" /* parallel redundancy */, NULL, NULL }, + { 10, "OL" /* high efficiency */, NULL, NULL }, /* Extended status values */ - { 240, "OB" /* battery (0xF0) */ }, - { 100, "BYPASS" /* maintenanceBypass (0x64) */ }, - { 96, "BYPASS" /* Bypass (0x60) */ }, - { 81, "OL" /* high efficiency (0x51) */ }, - { 80, "OL" /* normal (0x50) */ }, - { 64, "OL" /* UPS supporting load, normal degraded mode (0x40) */ }, - { 16, "OFF" /* none (0x10) */ }, - { 0, NULL } + { 240, "OB" /* battery (0xF0) */, NULL, NULL }, + { 100, "BYPASS" /* maintenanceBypass (0x64) */, NULL, NULL }, + { 96, "BYPASS" /* Bypass (0x60) */, NULL, NULL }, + { 81, "OL" /* high efficiency (0x51) */, NULL, NULL }, + { 80, "OL" /* normal (0x50) */, NULL, NULL }, + { 64, "OL" /* UPS supporting load, normal degraded mode (0x40) */, NULL, NULL }, + { 16, "OFF" /* none (0x10) */, NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t pw_mode_info[] = { - { 1, "" }, - { 2, "" }, - { 3, "normal" }, - { 4, "" }, - { 5, "" }, - { 6, "" }, - { 7, "" }, - { 8, "parallel capacity" }, - { 9, "parallel redundancy" }, - { 10, "high efficiency" }, + { 1, "", NULL, NULL }, + { 2, "", NULL, NULL }, + { 3, "normal", NULL, NULL }, + { 4, "", NULL, NULL }, + { 5, "", NULL, NULL }, + { 6, "", NULL, NULL }, + { 7, "", NULL, NULL }, + { 8, "parallel capacity", NULL, NULL }, + { 9, "parallel redundancy", NULL, NULL }, + { 10, "high efficiency", NULL, NULL }, /* Extended status values */ - { 240, "" /* battery (0xF0) */ }, - { 100, "" /* maintenanceBypass (0x64) */ }, - { 96, "" /* Bypass (0x60) */ }, - { 81, "high efficiency" /* high efficiency (0x51) */ }, - { 80, "normal" /* normal (0x50) */ }, - { 64, "" /* UPS supporting load, normal degraded mode (0x40) */ }, - { 16, "" /* none (0x10) */ }, - { 0, NULL } + { 240, "" /* battery (0xF0) */, NULL, NULL }, + { 100, "" /* maintenanceBypass (0x64) */, NULL, NULL }, + { 96, "" /* Bypass (0x60) */, NULL, NULL }, + { 81, "high efficiency" /* high efficiency (0x51) */, NULL, NULL }, + { 80, "normal" /* normal (0x50) */, NULL, NULL }, + { 64, "" /* UPS supporting load, normal degraded mode (0x40) */, NULL, NULL }, + { 16, "" /* none (0x10) */, NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Legacy implementation */ static info_lkp_t pw_battery_abm_status[] = { - { 1, "CHRG" }, - { 2, "DISCHRG" }, -/* { 3, "Floating" }, */ -/* { 4, "Resting" }, */ -/* { 5, "Unknown" }, */ - { 0, NULL } + { 1, "CHRG", NULL, NULL }, + { 2, "DISCHRG", NULL, NULL }, +/* { 3, "Floating", NULL, NULL }, */ +/* { 4, "Resting", NULL, NULL }, */ +/* { 5, "Unknown", NULL, NULL }, */ + { 0, NULL, NULL, NULL } } ; static info_lkp_t eaton_abm_status_info[] = { - { 1, "charging" }, - { 2, "discharging" }, - { 3, "floating" }, - { 4, "resting" }, - { 5, "unknown" }, /* Undefined - ABM is not activated */ - { 6, "disabled" }, /* ABM Charger Disabled */ - { 0, NULL } + { 1, "charging", NULL, NULL }, + { 2, "discharging", NULL, NULL }, + { 3, "floating", NULL, NULL }, + { 4, "resting", NULL, NULL }, + { 5, "unknown", NULL, NULL }, /* Undefined - ABM is not activated */ + { 6, "disabled", NULL, NULL }, /* ABM Charger Disabled */ + { 0, NULL, NULL, NULL } }; static info_lkp_t pw_batt_test_info[] = { - { 1, "Unknown" }, - { 2, "Done and passed" }, - { 3, "Done and error" }, - { 4, "In progress" }, - { 5, "Not supported" }, - { 6, "Inhibited" }, - { 7, "Scheduled" }, - { 0, NULL } + { 1, "Unknown", NULL, NULL }, + { 2, "Done and passed", NULL, NULL }, + { 3, "Done and error", NULL, NULL }, + { 4, "In progress", NULL, NULL }, + { 5, "Not supported", NULL, NULL }, + { 6, "Inhibited", NULL, NULL }, + { 7, "Scheduled", NULL, NULL }, + { 0, NULL, NULL, NULL } }; static info_lkp_t ietf_yes_no_info[] = { - { 1, "yes" }, - { 2, "no" }, - { 0, NULL } + { 1, "yes", NULL, NULL }, + { 2, "no", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table */ diff --git a/drivers/raritan-pdu-mib.c b/drivers/raritan-pdu-mib.c index 96c0ae3ca0..97c4cd0104 100644 --- a/drivers/raritan-pdu-mib.c +++ b/drivers/raritan-pdu-mib.c @@ -39,11 +39,11 @@ #define DO_CYCLE "2" static info_lkp_t outlet_status_info[] = { - { -1, "error" }, - { 0, "off" }, - { 1, "on" }, - { 2, "cycling" }, /* transitional status */ - { 0, NULL } + { -1, "error", NULL, NULL }, + { 0, "off", NULL, NULL }, + { 1, "on", NULL, NULL }, + { 2, "cycling", NULL, NULL }, /* transitional status */ + { 0, NULL, NULL, NULL } }; /* Snmp2NUT lookup table for Raritan MIB */ @@ -121,4 +121,4 @@ static snmp_info_t raritan_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t raritan = { "raritan", RARITAN_MIB_VERSION, NULL, RARITAN_OID_MODEL_NAME, raritan_mib, RARITAN_SYSOID }; +mib2nut_info_t raritan = { "raritan", RARITAN_MIB_VERSION, NULL, RARITAN_OID_MODEL_NAME, raritan_mib, RARITAN_SYSOID, NULL }; diff --git a/drivers/raritan-px2-mib.c b/drivers/raritan-px2-mib.c index 6dbff80339..bcd467cdf8 100644 --- a/drivers/raritan-px2-mib.c +++ b/drivers/raritan-px2-mib.c @@ -31,37 +31,37 @@ /* info elements */ /* FIXME: triage between status and alarms, and make it compliant! */ info_lkp_t raritanpx2_outlet_status_info[] = { - { -1, "unavailable" }, - { 0, "open" }, - { 1, "closed" }, - { 2, "belowLowerCritical" }, - { 3, "belowLowerWarning" }, - { 4, "normal" }, - { 5, "aboveUpperWarning" }, - { 6, "aboveUpperCritical" }, - { 7, "on" }, - { 8, "off" }, - { 9, "detected" }, - { 10, "notDetected" }, - { 11, "alarmed" }, - { 12, "ok" }, - { 13, "marginal" }, - { 14, "fail" }, - { 15, "yes" }, - { 16, "no" }, - { 17, "standby" }, - { 18, "one" }, - { 19, "two" }, - { 20, "inSync" }, - { 21, "outOfSync" }, - { 0, "NULL" } + { -1, "unavailable", NULL, NULL }, + { 0, "open", NULL, NULL }, + { 1, "closed", NULL, NULL }, + { 2, "belowLowerCritical", NULL, NULL }, + { 3, "belowLowerWarning", NULL, NULL }, + { 4, "normal", NULL, NULL }, + { 5, "aboveUpperWarning", NULL, NULL }, + { 6, "aboveUpperCritical", NULL, NULL }, + { 7, "on", NULL, NULL }, + { 8, "off", NULL, NULL }, + { 9, "detected", NULL, NULL }, + { 10, "notDetected", NULL, NULL }, + { 11, "alarmed", NULL, NULL }, + { 12, "ok", NULL, NULL }, + { 13, "marginal", NULL, NULL }, + { 14, "fail", NULL, NULL }, + { 15, "yes", NULL, NULL }, + { 16, "no", NULL, NULL }, + { 17, "standby", NULL, NULL }, + { 18, "one", NULL, NULL }, + { 19, "two", NULL, NULL }, + { 20, "inSync", NULL, NULL }, + { 21, "outOfSync", NULL, NULL }, + { 0, "NULL", NULL, NULL } }; static info_lkp_t outlet_switchability_info[] = { - { -1, "yes" }, - { 1, "yes" }, - { 2, "no" }, - { 0, NULL } + { -1, "yes", NULL, NULL }, + { 1, "yes", NULL, NULL }, + { 2, "no", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* PDU2-MIB Snmp2NUT lookup table */ @@ -97,8 +97,8 @@ static snmp_info_t raritan_px2_mib[] = { /* Input data: * Units are given in inletSensorUnits.1.1.%i * Value should be scaled by inletSensorDecimalDigits.1.1.%i - * For example, if the value is 1 and inletSensorDecimalDigits is 2, then actual value is 0.01. */ - /* measurementsInletSensorValue.1.1.rmsCurrent = Gauge32: 10 (A) */ + * For example, if the value is 1 and inletSensorDecimalDigits is 2, then actual value is 0.01. */ + /* measurementsInletSensorValue.1.1.rmsCurrent = Gauge32: 10 (A) */ { "input.load", 0, 0.1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.1", NULL, SU_FLAG_OK, NULL }, /* measurementsInletSensorValue.1.1.rmsVoltage = Gauge32: 119 (V) */ { "input.voltage", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.4", NULL, SU_FLAG_OK, NULL }, @@ -133,7 +133,7 @@ static snmp_info_t raritan_px2_mib[] = { /* FIXME: need RFC and standardization * { "outlet.%i.type", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.4.1.%i", NULL, SU_OUTLET | SU_FLAG_OK, NULL }, */ - /* RMS Current (divide by 10). e.g. 5 == 0.5A */ + /* RMS Current (divide by 10). e.g. 5 == 0.5A */ /* measurementsOutletSensorValue.1.%i.rmsCurrent = Gauge32: 10 */ { "outlet.%i.current", 0, 0.1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.1", NULL, SU_OUTLET | SU_FLAG_OK, NULL }, /* measurementsOutletSensorValue.1.%i.rmsVoltage = Gauge32: 119 */ @@ -578,4 +578,4 @@ static snmp_info_t raritan_px2_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t raritan_px2 = { "raritan-px2", RARITAN_PX2_MIB_VERSION, NULL, RARITAN_PX2_OID_MODEL_NAME, raritan_px2_mib, RARITAN_PX2_MIB_SYSOID }; +mib2nut_info_t raritan_px2 = { "raritan-px2", RARITAN_PX2_MIB_VERSION, NULL, RARITAN_PX2_OID_MODEL_NAME, raritan_px2_mib, RARITAN_PX2_MIB_SYSOID, NULL }; diff --git a/drivers/tripplite-hid.c b/drivers/tripplite-hid.c index 0229d904a2..5f123747f8 100644 --- a/drivers/tripplite-hid.c +++ b/drivers/tripplite-hid.c @@ -171,7 +171,7 @@ static const char *tripplite_chemistry_fun(double value) } static info_lkp_t tripplite_chemistry[] = { - { 0, NULL, tripplite_chemistry_fun } + { 0, NULL, tripplite_chemistry_fun, NULL } }; /* returns statically allocated string - must not use it again before @@ -186,7 +186,7 @@ static const char *tripplite_battvolt_fun(double value) } static info_lkp_t tripplite_battvolt[] = { - { 0, NULL, tripplite_battvolt_fun } + { 0, NULL, tripplite_battvolt_fun, NULL } }; static const char *tripplite_iovolt_fun(double value) @@ -199,7 +199,7 @@ static const char *tripplite_iovolt_fun(double value) } static info_lkp_t tripplite_iovolt[] = { - { 0, NULL, tripplite_iovolt_fun } + { 0, NULL, tripplite_iovolt_fun, NULL } }; static const char *tripplite_iofreq_fun(double value) @@ -212,7 +212,7 @@ static const char *tripplite_iofreq_fun(double value) } static info_lkp_t tripplite_iofreq[] = { - { 0, NULL, tripplite_iofreq_fun } + { 0, NULL, tripplite_iofreq_fun, NULL } }; static const char *tripplite_ioamp_fun(double value) @@ -225,7 +225,7 @@ static const char *tripplite_ioamp_fun(double value) } static info_lkp_t tripplite_ioamp[] = { - { 0, NULL, tripplite_ioamp_fun } + { 0, NULL, tripplite_ioamp_fun, NULL } }; /* --------------------------------------------------------------- */ diff --git a/drivers/upscode2.c b/drivers/upscode2.c index 723d16fe86..faca5069f7 100644 --- a/drivers/upscode2.c +++ b/drivers/upscode2.c @@ -168,273 +168,273 @@ static int /* Status codes for the STAT and STMF status responses */ static simple_t att[] = { - { "00", t_ignore }, - { "AC", t_alarm, "Aux contact failure", 0 }, - { "BA", t_alarm, "Batteries disconnected", 0 }, - { "BC", t_alarm, "Backfeed contact failure", 0 }, - { "BD", t_alarm, "Abnormal battery discharge", 0 }, - { "BF", t_alarm, "Battery fuse failure", 0 }, - { "BL", t_status, "Battery low limit", UPSC_STAT_LOBATT }, - { "BO", t_alarm, "Battery over voltage", 0 }, - { "BP", t_alarm, "Bypass fuse failure", 0 }, - { "BR", t_alarm, "Abnormal battery recharge", 0 }, - { "BT", t_alarm, "Battery over temperature", 0 }, - { "BX", t_alarm, "Bypass unavailable", 0 }, - { "BY", t_alarm, "Battery failure", 0 }, - { "CE", t_alarm, "Configuration error", 0 }, - { "CM", t_alarm, "Battery converter failure", 0 }, - { "CT", t_alarm, "Cabinet over temperature", 0 }, - { "DO", t_alarm, "DC over voltage", 0 }, - { "DU", t_alarm, "DC under voltage", 0 }, - { "EP", t_alarm, "Emergency power off", 0 }, - { "FF", t_alarm, "Fan failure", 0 }, - { "FH", t_alarm, "Line frequency high", 0 }, - { "FL", t_alarm, "Line frequency low", 0 }, - { "FT", t_alarm, "Filter over temperature", 0 }, - { "GF", t_alarm, "Ground failure", 0 }, - { "HT", t_alarm, "Charger over temperature", 0 }, - { "IB", t_alarm, "Internal data bus failure", 0 }, - { "IF", t_alarm, "Inverter fuse failure", 0 }, - { "IM", t_alarm, "Inverter failure", 0 }, - { "IO", t_alarm, "Inverter over voltage", 0 }, - { "IP", t_alarm, "Internal power supply failure", 0 }, - { "IT", t_alarm, "Inverter over temperature", 0 }, - { "IU", t_alarm, "Inverter under voltage", 0 }, - { "IV", t_alarm, "Inverter off", 0 }, - { "LR", t_alarm, "Loss of redundancy", 0 }, - { "NF", t_alarm, "Neutral fault", 0 }, - { "OD", t_status, "UPS not supplying load", UPSC_STAT_OFF }, - { "OF", t_alarm, "Oscillator failure", 0 }, - { "OL", t_status, "Overload", UPSC_STAT_OVERLOAD }, - { "OR", t_alarm, "Redundancy overload", 0 }, - { "OV", t_alarm, "Abnormal output voltage", 0 }, - { "OW", t_alarm, "Output failure", 0 }, - { "PB", t_alarm, "Parallel bus failure", 0 }, - { "PE", t_alarm, "Phase rotation error", 0 }, - { "RE", t_alarm, "Rectifier off", 0 }, - { "RF", t_alarm, "Rectifier fuse failure", 0 }, - { "RM", t_alarm, "Rectifier failure", 0 }, - { "RT", t_alarm, "Rectifier over temperature", 0 }, - { "SM", t_alarm, "Static switch failure", 0 }, - { "ST", t_alarm, "Static switch over temperature", 0 }, - { "TT", t_alarm, "Trafo over temperature", 0 }, - { "UD", t_alarm, "UPS disabled", 0 }, - { "UO", t_alarm, "Utility over voltage", 0 }, - { "US", t_alarm, "Unsynchronized", 0 }, - { "UU", t_alarm, "Utility under voltage", 0 }, - { "VE", t_alarm, "internal voltage error", 0 }, - { NULL } + { "00", t_ignore, NULL, 0, NULL, NULL }, + { "AC", t_alarm, "Aux contact failure", 0, NULL, NULL }, + { "BA", t_alarm, "Batteries disconnected", 0, NULL, NULL }, + { "BC", t_alarm, "Backfeed contact failure", 0, NULL, NULL }, + { "BD", t_alarm, "Abnormal battery discharge", 0, NULL, NULL }, + { "BF", t_alarm, "Battery fuse failure", 0, NULL, NULL }, + { "BL", t_status, "Battery low limit", UPSC_STAT_LOBATT, NULL, NULL }, + { "BO", t_alarm, "Battery over voltage", 0, NULL, NULL }, + { "BP", t_alarm, "Bypass fuse failure", 0, NULL, NULL }, + { "BR", t_alarm, "Abnormal battery recharge", 0, NULL, NULL }, + { "BT", t_alarm, "Battery over temperature", 0, NULL, NULL }, + { "BX", t_alarm, "Bypass unavailable", 0, NULL, NULL }, + { "BY", t_alarm, "Battery failure", 0, NULL, NULL }, + { "CE", t_alarm, "Configuration error", 0, NULL, NULL }, + { "CM", t_alarm, "Battery converter failure", 0, NULL, NULL }, + { "CT", t_alarm, "Cabinet over temperature", 0, NULL, NULL }, + { "DO", t_alarm, "DC over voltage", 0, NULL, NULL }, + { "DU", t_alarm, "DC under voltage", 0, NULL, NULL }, + { "EP", t_alarm, "Emergency power off", 0, NULL, NULL }, + { "FF", t_alarm, "Fan failure", 0, NULL, NULL }, + { "FH", t_alarm, "Line frequency high", 0, NULL, NULL }, + { "FL", t_alarm, "Line frequency low", 0, NULL, NULL }, + { "FT", t_alarm, "Filter over temperature", 0, NULL, NULL }, + { "GF", t_alarm, "Ground failure", 0, NULL, NULL }, + { "HT", t_alarm, "Charger over temperature", 0, NULL, NULL }, + { "IB", t_alarm, "Internal data bus failure", 0, NULL, NULL }, + { "IF", t_alarm, "Inverter fuse failure", 0, NULL, NULL }, + { "IM", t_alarm, "Inverter failure", 0, NULL, NULL }, + { "IO", t_alarm, "Inverter over voltage", 0, NULL, NULL }, + { "IP", t_alarm, "Internal power supply failure", 0, NULL, NULL }, + { "IT", t_alarm, "Inverter over temperature", 0, NULL, NULL }, + { "IU", t_alarm, "Inverter under voltage", 0, NULL, NULL }, + { "IV", t_alarm, "Inverter off", 0, NULL, NULL }, + { "LR", t_alarm, "Loss of redundancy", 0, NULL, NULL }, + { "NF", t_alarm, "Neutral fault", 0, NULL, NULL }, + { "OD", t_status, "UPS not supplying load", UPSC_STAT_OFF, NULL, NULL }, + { "OF", t_alarm, "Oscillator failure", 0, NULL, NULL }, + { "OL", t_status, "Overload", UPSC_STAT_OVERLOAD, NULL, NULL }, + { "OR", t_alarm, "Redundancy overload", 0, NULL, NULL }, + { "OV", t_alarm, "Abnormal output voltage", 0, NULL, NULL }, + { "OW", t_alarm, "Output failure", 0, NULL, NULL }, + { "PB", t_alarm, "Parallel bus failure", 0, NULL, NULL }, + { "PE", t_alarm, "Phase rotation error", 0, NULL, NULL }, + { "RE", t_alarm, "Rectifier off", 0, NULL, NULL }, + { "RF", t_alarm, "Rectifier fuse failure", 0, NULL, NULL }, + { "RM", t_alarm, "Rectifier failure", 0, NULL, NULL }, + { "RT", t_alarm, "Rectifier over temperature", 0, NULL, NULL }, + { "SM", t_alarm, "Static switch failure", 0, NULL, NULL }, + { "ST", t_alarm, "Static switch over temperature", 0, NULL, NULL }, + { "TT", t_alarm, "Trafo over temperature", 0, NULL, NULL }, + { "UD", t_alarm, "UPS disabled", 0, NULL, NULL }, + { "UO", t_alarm, "Utility over voltage", 0, NULL, NULL }, + { "US", t_alarm, "Unsynchronized", 0, NULL, NULL }, + { "UU", t_alarm, "Utility under voltage", 0, NULL, NULL }, + { "VE", t_alarm, "internal voltage error", 0, NULL, NULL }, + { NULL, t_ignore, NULL, 0, NULL, NULL } }; /* Status code for the STLR response */ static simple_t stlr[] = { - { "NO", t_ignore }, - { "SD", t_status, NULL, UPSC_STAT_TRIM }, - { "SU", t_status, NULL, UPSC_STAT_BOOST }, - { "DU", t_status, NULL, UPSC_STAT_BOOST }, - { NULL } + { "NO", t_ignore, NULL, 0, NULL, NULL }, + { "SD", t_status, NULL, UPSC_STAT_TRIM, NULL, NULL }, + { "SU", t_status, NULL, UPSC_STAT_BOOST, NULL, NULL }, + { "DU", t_status, NULL, UPSC_STAT_BOOST, NULL, NULL }, + { NULL, t_ignore, NULL, 0, NULL, NULL } }; /* Status code for the STEA and STEM responses */ static simple_t env[] = { - { "HH", t_ignore, "Humidity high", 0 }, - { "HL", t_ignore, "Humidity low", 0 }, - { "TH", t_ignore, "Temperature high", 0 }, - { "TL", t_ignore, "Temperature low", 0 }, - { "01", t_ignore, "Environment alarm 1", 0 }, - { "02", t_ignore, "Environment alarm 2", 0 }, - { "03", t_ignore, "Environment alarm 3", 0 }, - { "04", t_ignore, "Environment alarm 4", 0 }, - { "05", t_ignore, "Environment alarm 5", 0 }, - { "06", t_ignore, "Environment alarm 6", 0 }, - { "07", t_ignore, "Environment alarm 7", 0 }, - { "08", t_ignore, "Environment alarm 8", 0 }, - { "09", t_ignore, "Environment alarm 9", 0 }, - { NULL } + { "HH", t_ignore, "Humidity high", 0, NULL, NULL }, + { "HL", t_ignore, "Humidity low", 0, NULL, NULL }, + { "TH", t_ignore, "Temperature high", 0, NULL, NULL }, + { "TL", t_ignore, "Temperature low", 0, NULL, NULL }, + { "01", t_ignore, "Environment alarm 1", 0, NULL, NULL }, + { "02", t_ignore, "Environment alarm 2", 0, NULL, NULL }, + { "03", t_ignore, "Environment alarm 3", 0, NULL, NULL }, + { "04", t_ignore, "Environment alarm 4", 0, NULL, NULL }, + { "05", t_ignore, "Environment alarm 5", 0, NULL, NULL }, + { "06", t_ignore, "Environment alarm 6", 0, NULL, NULL }, + { "07", t_ignore, "Environment alarm 7", 0, NULL, NULL }, + { "08", t_ignore, "Environment alarm 8", 0, NULL, NULL }, + { "09", t_ignore, "Environment alarm 9", 0, NULL, NULL }, + { NULL, t_ignore, NULL, 0, NULL, NULL } }; /* Responses for UPSS and UPDS */ static simple_t simple[] = { - { "STAT", t_list, NULL, 0, 0, att }, - { "STBO", t_status, NULL, UPSC_STAT_ONBATT }, - { "STBL", t_status, NULL, UPSC_STAT_LOBATT }, - { "STBM", t_ignore }, - { "STBP", t_status, NULL, UPSC_STAT_BYPASS }, - { "STEA", t_list, NULL, 0, 0, env }, - { "STEM", t_list, NULL, 0, 0, env }, - { "STLR", t_list, NULL, 0, 0, stlr }, - { "STMF", t_list, NULL, 0, 0, att }, - { "STOK", t_ignore }, - { "STUF", t_status, NULL, UPSC_STAT_ONBATT }, - - { "BTIME", t_setval, NULL, 0, &batt_runtime }, - - { "METE1", t_value, "ambient.temperature" }, - { "MERH1", t_value, "ambient.humidity" }, - - { "MIFFF", t_value, "input.frequency" }, - { "MIIL1", t_value, "input.current" }, - { "MIIL2", t_value, "input.L2.current" }, - { "MIIL3", t_value, "input.L3.current" }, - { "MIPL1", t_value, "input.realpower" }, - { "MIPL2", t_value, "input.L2.realpower" }, - { "MIPL3", t_value, "input.L3.realpower" }, - { "MISL1", t_value, "input.power" }, - { "MISL2", t_value, "input.L2.power" }, - { "MISL3", t_value, "input.L3.power" }, - { "MIUL1", t_value, "input.voltage" }, - { "MIUL2", t_value, "input.L2-N.voltage" }, - { "MIUL3", t_value, "input.L3-N.voltage" }, - { "MIU12", t_value, "input.L1-L2.voltage" }, - { "MIU23", t_value, "input.L2-L3.voltage" }, - { "MIU31", t_value, "input.L3-L1.voltage" }, - - { "MBCH1", t_setval, NULL, 0, &batt_charge }, /* battery.charge */ - { "MBIII", t_setval, "battery.current", 0, &batt_current }, - { "MBINE", t_ignore, /* "battery.current.negative" */ }, - { "MBIPO", t_ignore, /* "battery.current.positive" */ }, - { "MBUNE", t_ignore, /* "battery.voltage.negative" */ }, - { "MBUPO", t_ignore, /* "battery.voltage.positive" */}, - { "MBUUU", t_setval, "battery.voltage", 0, &batt_volt }, - - { "MLUNE", t_ignore, /* "dc.voltage.negative" */ }, - { "MLUPO", t_ignore, /* "dc.voltage.positive" */ }, - { "MLUUU", t_ignore, /* "dc.voltage" */ }, - - { "MOFFF", t_final, "output.frequency" }, - { "MOIL1", t_value, "output.current" }, - { "MOIL2", t_value, "output.L2.current" }, - { "MOIL3", t_value, "output.L3.current" }, - { "MOIP1", t_value, "output.current.peak" }, - { "MOIP2", t_value, "output.L2.current.peak" }, - { "MOIP3", t_value, "output.L3.current.peak" }, - { "MOPL1", t_value, "output.realpower", 0, &kilo_to_unity }, - { "MOPL2", t_value, "output.L2.realpower", 0, &kilo_to_unity }, - { "MOPL3", t_value, "output.L3.realpower", 0, &kilo_to_unity }, - { "MOSL1", t_value, "output.power" }, - { "MOSL2", t_value, "output.L2.power" }, - { "MOSL3", t_value, "output.L3.power" }, - { "MOUL1", t_value, "output.voltage" }, - { "MOUL2", t_value, "output.L2-N.voltage" }, - { "MOUL3", t_value, "output.L3-N.voltage" }, - { "MOU12", t_value, "output.L1-L2.voltage" }, - { "MOU23", t_value, "output.L2-L3.voltage" }, - { "MOU31", t_value, "output.L3-L1.voltage" }, - - { "MPUL1", t_value, "input.bypass.L1-N.voltage" }, - { "MPUL2", t_value, "input.bypass.L2-N.voltage" }, - { "MPUL3", t_value, "input.bypass.L3-N.voltage" }, - - { "MUTE1", t_value, "ups.temperature" }, - { NULL } + { "STAT", t_list, NULL, 0, NULL, att }, + { "STBO", t_status, NULL, UPSC_STAT_ONBATT, NULL, NULL }, + { "STBL", t_status, NULL, UPSC_STAT_LOBATT, NULL, NULL }, + { "STBM", t_ignore, NULL, 0, NULL, NULL }, + { "STBP", t_status, NULL, UPSC_STAT_BYPASS, NULL, NULL }, + { "STEA", t_list, NULL, 0, NULL, env }, + { "STEM", t_list, NULL, 0, NULL, env }, + { "STLR", t_list, NULL, 0, NULL, stlr }, + { "STMF", t_list, NULL, 0, NULL, att }, + { "STOK", t_ignore, NULL, 0, NULL, NULL }, + { "STUF", t_status, NULL, UPSC_STAT_ONBATT, NULL, NULL }, + + { "BTIME", t_setval, NULL, 0, &batt_runtime, NULL }, + + { "METE1", t_value, "ambient.temperature", 0, NULL, NULL }, + { "MERH1", t_value, "ambient.humidity", 0, NULL, NULL }, + + { "MIFFF", t_value, "input.frequency", 0, NULL, NULL }, + { "MIIL1", t_value, "input.current", 0, NULL, NULL }, + { "MIIL2", t_value, "input.L2.current", 0, NULL, NULL }, + { "MIIL3", t_value, "input.L3.current", 0, NULL, NULL }, + { "MIPL1", t_value, "input.realpower", 0, NULL, NULL }, + { "MIPL2", t_value, "input.L2.realpower", 0, NULL, NULL }, + { "MIPL3", t_value, "input.L3.realpower", 0, NULL, NULL }, + { "MISL1", t_value, "input.power", 0, NULL, NULL }, + { "MISL2", t_value, "input.L2.power", 0, NULL, NULL }, + { "MISL3", t_value, "input.L3.power", 0, NULL, NULL }, + { "MIUL1", t_value, "input.voltage", 0, NULL, NULL }, + { "MIUL2", t_value, "input.L2-N.voltage", 0, NULL, NULL }, + { "MIUL3", t_value, "input.L3-N.voltage", 0, NULL, NULL }, + { "MIU12", t_value, "input.L1-L2.voltage", 0, NULL, NULL }, + { "MIU23", t_value, "input.L2-L3.voltage", 0, NULL, NULL }, + { "MIU31", t_value, "input.L3-L1.voltage", 0, NULL, NULL }, + + { "MBCH1", t_setval, NULL, 0, &batt_charge, NULL }, /* battery.charge */ + { "MBIII", t_setval, "battery.current", 0, &batt_current, NULL }, + { "MBINE", t_ignore, /* "battery.current.negative" */ NULL, 0, NULL, NULL }, + { "MBIPO", t_ignore, /* "battery.current.positive" */ NULL, 0, NULL, NULL }, + { "MBUNE", t_ignore, /* "battery.voltage.negative" */ NULL, 0, NULL, NULL }, + { "MBUPO", t_ignore, /* "battery.voltage.positive" */ NULL, 0, NULL, NULL }, + { "MBUUU", t_setval, "battery.voltage", 0, &batt_volt, NULL }, + + { "MLUNE", t_ignore, /* "dc.voltage.negative" */ NULL, 0, NULL, NULL }, + { "MLUPO", t_ignore, /* "dc.voltage.positive" */ NULL, 0, NULL, NULL }, + { "MLUUU", t_ignore, /* "dc.voltage" */ NULL, 0, NULL, NULL }, + + { "MOFFF", t_final, "output.frequency", 0, NULL, NULL }, + { "MOIL1", t_value, "output.current", 0, NULL, NULL }, + { "MOIL2", t_value, "output.L2.current", 0, NULL, NULL }, + { "MOIL3", t_value, "output.L3.current", 0, NULL, NULL }, + { "MOIP1", t_value, "output.current.peak", 0, NULL, NULL }, + { "MOIP2", t_value, "output.L2.current.peak", 0, NULL, NULL }, + { "MOIP3", t_value, "output.L3.current.peak", 0, NULL, NULL }, + { "MOPL1", t_value, "output.realpower", 0, &kilo_to_unity, NULL }, + { "MOPL2", t_value, "output.L2.realpower", 0, &kilo_to_unity, NULL }, + { "MOPL3", t_value, "output.L3.realpower", 0, &kilo_to_unity, NULL }, + { "MOSL1", t_value, "output.power", 0, NULL, NULL }, + { "MOSL2", t_value, "output.L2.power", 0, NULL, NULL }, + { "MOSL3", t_value, "output.L3.power", 0, NULL, NULL }, + { "MOUL1", t_value, "output.voltage", 0, NULL, NULL }, + { "MOUL2", t_value, "output.L2-N.voltage", 0, NULL, NULL }, + { "MOUL3", t_value, "output.L3-N.voltage", 0, NULL, NULL }, + { "MOU12", t_value, "output.L1-L2.voltage", 0, NULL, NULL }, + { "MOU23", t_value, "output.L2-L3.voltage", 0, NULL, NULL }, + { "MOU31", t_value, "output.L3-L1.voltage", 0, NULL, NULL }, + + { "MPUL1", t_value, "input.bypass.L1-N.voltage", 0, NULL, NULL }, + { "MPUL2", t_value, "input.bypass.L2-N.voltage", 0, NULL, NULL }, + { "MPUL3", t_value, "input.bypass.L3-N.voltage", 0, NULL, NULL }, + + { "MUTE1", t_value, "ups.temperature", 0, NULL, NULL }, + { NULL, t_ignore, NULL, 0, NULL, NULL } }; /* Responses for UPDV */ static simple_t nominal[] = { - { "NIUHH", t_value, "input.voltage.maximum" }, - { "NIULL", t_value, "input.voltage.minimum" }, - { "NIUNN", t_value, "input.voltage.nominal" }, - - { "NIIHH", t_value, "input.current.maximum" }, - { "NIILL", t_value, "input.current.minimum" }, - { "NIINN", t_value, "input.current.nominal" }, - - { "NIPHH", t_value, "input.realpower.maximum" }, - { "NIPNN", t_value, "input.realpower.nominal" }, - - { "NISHH", t_value, "input.power.maximum" }, - { "NISNN", t_value, "input.power.nominal" }, - - { "NBAHN", t_setval, "battery.capacity.nominal", 0, &batt_cap_nom }, - { "NBIHH", t_ignore, "battery charge current maximum" }, - { "NBILL", t_setval, NULL, 0, &batt_disch_curr_max}, - { "NBINN", t_value, "battery.current.nominal" }, - { "NBTHH", t_setval, NULL, 0, &batt_runtime_max}, - { "NBUHH", t_setval, "battery.voltage.maximum", 0, &batt_volt_high }, - { "NBULL", t_setval, "battery.voltage.minimum", 0, &batt_volt_low }, - { "NBUNN", t_setval, "battery.voltage.nominal", 0, &batt_volt_nom }, - - { "NOFHH", t_value, "output.frequency.maximum" }, - { "NOFLL", t_final, "output.frequency.minimum" }, - { "NOIHH", t_setval, "output.current.maximum", 0, &max_out_current }, - { "NOINN", t_setval, "output.current.nominal", 0, &nom_out_current }, - { "NOPNN", t_value, "output.realpower.nominal", 0, &outpwr_factor }, - { "NOSNN", t_value, "ups.power.nominal", 0, &outpwr_factor }, - { "NOUHH", t_value, "output.voltage.maximum" }, - { "NOULL", t_value, "output.voltage.minimum" }, - { "NOUNN", t_value, "output.voltage.nominal" }, - - { "NUTEH", t_value, "ups.temperature.maximum" }, - { NULL } + { "NIUHH", t_value, "input.voltage.maximum", 0, NULL, NULL }, + { "NIULL", t_value, "input.voltage.minimum", 0, NULL, NULL }, + { "NIUNN", t_value, "input.voltage.nominal", 0, NULL, NULL }, + + { "NIIHH", t_value, "input.current.maximum", 0, NULL, NULL }, + { "NIILL", t_value, "input.current.minimum", 0, NULL, NULL }, + { "NIINN", t_value, "input.current.nominal", 0, NULL, NULL }, + + { "NIPHH", t_value, "input.realpower.maximum", 0, NULL, NULL }, + { "NIPNN", t_value, "input.realpower.nominal", 0, NULL, NULL }, + + { "NISHH", t_value, "input.power.maximum", 0, NULL, NULL }, + { "NISNN", t_value, "input.power.nominal", 0, NULL, NULL }, + + { "NBAHN", t_setval, "battery.capacity.nominal", 0, &batt_cap_nom, NULL }, + { "NBIHH", t_ignore, "battery charge current maximum", 0, NULL, NULL }, + { "NBILL", t_setval, NULL, 0, &batt_disch_curr_max, NULL }, + { "NBINN", t_value, "battery.current.nominal", 0, NULL, NULL }, + { "NBTHH", t_setval, NULL, 0, &batt_runtime_max, NULL }, + { "NBUHH", t_setval, "battery.voltage.maximum", 0, &batt_volt_high, NULL }, + { "NBULL", t_setval, "battery.voltage.minimum", 0, &batt_volt_low, NULL }, + { "NBUNN", t_setval, "battery.voltage.nominal", 0, &batt_volt_nom, NULL }, + + { "NOFHH", t_value, "output.frequency.maximum", 0, NULL, NULL }, + { "NOFLL", t_final, "output.frequency.minimum", 0, NULL, NULL }, + { "NOIHH", t_setval, "output.current.maximum", 0, &max_out_current, NULL }, + { "NOINN", t_setval, "output.current.nominal", 0, &nom_out_current, NULL }, + { "NOPNN", t_value, "output.realpower.nominal", 0, &outpwr_factor, NULL }, + { "NOSNN", t_value, "ups.power.nominal", 0, &outpwr_factor, NULL }, + { "NOUHH", t_value, "output.voltage.maximum", 0, NULL, NULL }, + { "NOULL", t_value, "output.voltage.minimum", 0, NULL, NULL }, + { "NOUNN", t_value, "output.voltage.nominal", 0, NULL, NULL }, + + { "NUTEH", t_value, "ups.temperature.maximum", 0, NULL, NULL }, + { NULL, t_ignore, NULL, 0, NULL, NULL } }; /* Status responses for UPBS command */ static simple_t battery[] = { - { "MBTE1", t_value, "battery.1.temperature" }, - { "MBIN1", t_ignore, NULL /* aging index */ }, - { "BDAT1", t_string, "battery.1.date" }, - { "MBTE2", t_value, "battery.2.temperature.2" }, - { "MBIN2", t_ignore, NULL }, - { "BDAT2", t_string, "battery.2.date" }, - { "MBTE3", t_value, "battery.3.temperature" }, - { "MBIN3", t_ignore, NULL }, - { "BDAT3", t_string, "battery.3.date" }, - { "MBTE4", t_value, "battery.4.temperature" }, - { "MBIN4", t_ignore, NULL }, - { "BDAT4", t_string, "battery.4.date" }, - { "MBTE5", t_value, "battery.5.temperature" }, - { "MBIN5", t_ignore, NULL }, - { "BDAT5", t_string, "battery.5.date" }, - { "MBTE6", t_value, "battery.6.temperature" }, - { "MBIN6", t_ignore, NULL }, - { "BDAT6", t_string, "battery.6.date" }, - { "MBTE7", t_value, "battery.7.temperature" }, - { "MBIN7", t_ignore, NULL }, - { "BDAT7", t_string, "battery.7.date" }, - { "MBTE8", t_value, "battery.8.temperature" }, - { "MBIN8", t_ignore, NULL }, - { "BDAT8", t_finstr, "battery.8.date" }, - { NULL } + { "MBTE1", t_value, "battery.1.temperature", 0, NULL, NULL }, + { "MBIN1", t_ignore, NULL /* aging index */, 0, NULL, NULL }, + { "BDAT1", t_string, "battery.1.date", 0, NULL, NULL }, + { "MBTE2", t_value, "battery.2.temperature.2", 0, NULL, NULL }, + { "MBIN2", t_ignore, NULL, 0, NULL, NULL }, + { "BDAT2", t_string, "battery.2.date", 0, NULL, NULL }, + { "MBTE3", t_value, "battery.3.temperature", 0, NULL, NULL }, + { "MBIN3", t_ignore, NULL, 0, NULL, NULL }, + { "BDAT3", t_string, "battery.3.date", 0, NULL, NULL }, + { "MBTE4", t_value, "battery.4.temperature", 0, NULL, NULL }, + { "MBIN4", t_ignore, NULL, 0, NULL, NULL }, + { "BDAT4", t_string, "battery.4.date", 0, NULL, NULL }, + { "MBTE5", t_value, "battery.5.temperature", 0, NULL, NULL }, + { "MBIN5", t_ignore, NULL, 0, NULL, NULL }, + { "BDAT5", t_string, "battery.5.date", 0, NULL, NULL }, + { "MBTE6", t_value, "battery.6.temperature", 0, NULL, NULL }, + { "MBIN6", t_ignore, NULL, 0, NULL, NULL }, + { "BDAT6", t_string, "battery.6.date", 0, NULL, NULL }, + { "MBTE7", t_value, "battery.7.temperature", 0, NULL, NULL }, + { "MBIN7", t_ignore, NULL, 0, NULL, NULL }, + { "BDAT7", t_string, "battery.7.date", 0, NULL, NULL }, + { "MBTE8", t_value, "battery.8.temperature", 0, NULL, NULL }, + { "MBIN8", t_ignore, NULL, 0, NULL, NULL }, + { "BDAT8", t_finstr, "battery.8.date", 0, NULL, NULL }, + { NULL, t_ignore, NULL, 0, NULL, NULL } }; static cmd_t commands[] = { - { "load.off", NULL, NULL }, - { "load.on", NULL, NULL }, - { "shutdown.return", "UPPF", "IJHLDMGCIU" }, - { "shutdown.stayoff", "UPPD", "LGGNLMDPGV" }, - { "shutdown.stop", "UPPU", NULL }, - { "shutdown.reboot", "UPPC", "IJHLDMGCIU" }, - { "shutdown.reboot.graceful", NULL, NULL }, - { "test.panel.start", "UPIS", NULL }, - { "test.panel.stop", NULL, NULL }, - { "test.failure.start", NULL, NULL }, - { "test.failure.stop", NULL, NULL }, - { "test.battery.start", "UPBT", "1" }, - { "test.battery.stop", NULL, NULL }, - { "calibrate.start", NULL, NULL }, - { "calibrate.stop", NULL, NULL }, - { "bypass.start", NULL, NULL }, - { "bypass.stop", NULL, NULL }, - { "reset.input.minmax", NULL, NULL }, - { "reset.watchdog", NULL, NULL }, - { "beeper.enable", NULL, NULL }, - { "beeper.disable", NULL, NULL }, - { "beeper.on", NULL, NULL }, - { "beeper.off", NULL, NULL }, - { NULL } + { "load.off", NULL, NULL, 0 }, + { "load.on", NULL, NULL, 0 }, + { "shutdown.return", "UPPF", "IJHLDMGCIU", 0 }, + { "shutdown.stayoff", "UPPD", "LGGNLMDPGV", 0 }, + { "shutdown.stop", "UPPU", NULL, 0 }, + { "shutdown.reboot", "UPPC", "IJHLDMGCIU", 0 }, + { "shutdown.reboot.graceful", NULL, NULL, 0 }, + { "test.panel.start", "UPIS", NULL, 0 }, + { "test.panel.stop", NULL, NULL, 0 }, + { "test.failure.start", NULL, NULL, 0 }, + { "test.failure.stop", NULL, NULL, 0 }, + { "test.battery.start", "UPBT", "1", 0 }, + { "test.battery.stop", NULL, NULL, 0 }, + { "calibrate.start", NULL, NULL, 0 }, + { "calibrate.stop", NULL, NULL, 0 }, + { "bypass.start", NULL, NULL, 0 }, + { "bypass.stop", NULL, NULL, 0 }, + { "reset.input.minmax", NULL, NULL, 0 }, + { "reset.watchdog", NULL, NULL, 0 }, + { "beeper.enable", NULL, NULL, 0 }, + { "beeper.disable", NULL, NULL, 0 }, + { "beeper.on", NULL, NULL, 0 }, + { "beeper.off", NULL, NULL, 0 }, + { NULL, NULL, NULL, 0 } }; static cmd_t variables[] = { - { "ups.delay.reboot", "UPCD", "ACCD" }, - { "ups.delay.shutdown", "UPSD", "ACSD" }, - { NULL } + { "ups.delay.reboot", "UPCD", "ACCD", 0 }, + { "ups.delay.shutdown", "UPSD", "ACSD", 0 }, + { NULL, NULL, NULL, 0 } }; diff --git a/drivers/usbhid-ups.c b/drivers/usbhid-ups.c index ea198c4db9..491b26ae86 100644 --- a/drivers/usbhid-ups.c +++ b/drivers/usbhid-ups.c @@ -98,7 +98,7 @@ static subdriver_t *subdriver = NULL; /* Global vars */ static HIDDevice_t *hd = NULL; -static HIDDevice_t curDevice = { 0x0000, 0x0000, NULL, NULL, NULL, NULL }; +static HIDDevice_t curDevice = { 0x0000, 0x0000, NULL, NULL, NULL, NULL, 0 }; static HIDDeviceMatcher_t *subdriver_matcher = NULL; #ifndef SHUT_MODE static HIDDeviceMatcher_t *exact_matcher = NULL; @@ -203,178 +203,178 @@ static status_lkp_t status_info[] = { separately) */ info_lkp_t online_info[] = { - { 1, "online", NULL }, - { 0, "!online", NULL }, - { 0, NULL, NULL } + { 1, "online", NULL, NULL }, + { 0, "!online", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t discharging_info[] = { - { 1, "dischrg", NULL }, - { 0, "!dischrg", NULL }, - { 0, NULL, NULL } + { 1, "dischrg", NULL, NULL }, + { 0, "!dischrg", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t charging_info[] = { - { 1, "chrg", NULL }, - { 0, "!chrg", NULL }, - { 0, NULL, NULL } + { 1, "chrg", NULL, NULL }, + { 0, "!chrg", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t lowbatt_info[] = { - { 1, "lowbatt", NULL }, - { 0, "!lowbatt", NULL }, - { 0, NULL, NULL } + { 1, "lowbatt", NULL, NULL }, + { 0, "!lowbatt", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t overload_info[] = { - { 1, "overload", NULL }, - { 0, "!overload", NULL }, - { 0, NULL, NULL } + { 1, "overload", NULL, NULL }, + { 0, "!overload", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t replacebatt_info[] = { - { 1, "replacebatt", NULL }, - { 0, "!replacebatt", NULL }, - { 0, NULL, NULL } + { 1, "replacebatt", NULL, NULL }, + { 0, "!replacebatt", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t trim_info[] = { - { 1, "trim", NULL }, - { 0, "!trim", NULL }, - { 0, NULL, NULL } + { 1, "trim", NULL, NULL }, + { 0, "!trim", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t boost_info[] = { - { 1, "boost", NULL }, - { 0, "!boost", NULL }, - { 0, NULL, NULL } + { 1, "boost", NULL, NULL }, + { 0, "!boost", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t bypass_auto_info[] = { - { 1, "bypassauto", NULL }, - { 0, "!bypassauto", NULL }, - { 0, NULL, NULL } + { 1, "bypassauto", NULL, NULL }, + { 0, "!bypassauto", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t bypass_manual_info[] = { - { 1, "bypassman", NULL }, - { 0, "!bypassman", NULL }, - { 0, NULL, NULL } + { 1, "bypassman", NULL, NULL }, + { 0, "!bypassman", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* note: this value is reverted (0=set, 1=not set). We report "being off" rather than "being on", so that devices that don't implement this variable are "on" by default */ info_lkp_t off_info[] = { - { 0, "off", NULL }, - { 1, "!off", NULL }, - { 0, NULL, NULL } + { 0, "off", NULL, NULL }, + { 1, "!off", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t calibration_info[] = { - { 1, "cal", NULL }, - { 0, "!cal", NULL }, - { 0, NULL, NULL } + { 1, "cal", NULL, NULL }, + { 0, "!cal", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* note: this value is reverted (0=set, 1=not set). We report "battery not installed" rather than "battery installed", so that devices that don't implement this variable have a battery by default */ info_lkp_t nobattery_info[] = { - { 1, "!nobattery", NULL }, - { 0, "nobattery", NULL }, - { 0, NULL, NULL } + { 1, "!nobattery", NULL, NULL }, + { 0, "nobattery", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t fanfail_info[] = { - { 1, "fanfail", NULL }, - { 0, "!fanfail", NULL }, - { 0, NULL, NULL } + { 1, "fanfail", NULL, NULL }, + { 0, "!fanfail", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t shutdownimm_info[] = { - { 1, "shutdownimm", NULL }, - { 0, "!shutdownimm", NULL }, - { 0, NULL, NULL } + { 1, "shutdownimm", NULL, NULL }, + { 0, "!shutdownimm", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t overheat_info[] = { - { 1, "overheat", NULL }, - { 0, "!overheat", NULL }, - { 0, NULL, NULL } + { 1, "overheat", NULL, NULL }, + { 0, "!overheat", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t awaitingpower_info[] = { - { 1, "awaitingpower", NULL }, - { 0, "!awaitingpower", NULL }, - { 0, NULL, NULL } + { 1, "awaitingpower", NULL, NULL }, + { 0, "!awaitingpower", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t commfault_info[] = { - { 1, "commfault", NULL }, - { 0, "!commfault", NULL }, - { 0, NULL, NULL } + { 1, "commfault", NULL, NULL }, + { 0, "!commfault", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t timelimitexpired_info[] = { - { 1, "timelimitexp", NULL }, - { 0, "!timelimitexp", NULL }, - { 0, NULL, NULL } + { 1, "timelimitexp", NULL, NULL }, + { 0, "!timelimitexp", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t battvoltlo_info[] = { - { 1, "battvoltlo", NULL }, - { 0, "!battvoltlo", NULL }, - { 0, NULL, NULL } + { 1, "battvoltlo", NULL, NULL }, + { 0, "!battvoltlo", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t battvolthi_info[] = { - { 1, "battvolthi", NULL }, - { 0, "!battvolthi", NULL }, - { 0, NULL, NULL } + { 1, "battvolthi", NULL, NULL }, + { 0, "!battvolthi", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t chargerfail_info[] = { - { 1, "chargerfail", NULL }, - { 0, "!chargerfail", NULL }, - { 0, NULL, NULL } + { 1, "chargerfail", NULL, NULL }, + { 0, "!chargerfail", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t fullycharged_info[] = { /* used by CyberPower and TrippLite */ - { 1, "fullycharged", NULL }, - { 0, "!fullycharged", NULL }, - { 0, NULL, NULL } + { 1, "fullycharged", NULL, NULL }, + { 0, "!fullycharged", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t depleted_info[] = { - { 1, "depleted", NULL }, - { 0, "!depleted", NULL }, - { 0, NULL, NULL } + { 1, "depleted", NULL, NULL }, + { 0, "!depleted", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t vrange_info[] = { - { 0, "!vrange", NULL }, - { 1, "vrange", NULL }, - { 0, NULL, NULL } + { 0, "!vrange", NULL, NULL }, + { 1, "vrange", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t frange_info[] = { - { 0, "!frange", NULL }, - { 1, "frange", NULL }, - { 0, NULL, NULL } + { 0, "!frange", NULL, NULL }, + { 1, "frange", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t test_write_info[] = { - { 0, "No test", NULL }, - { 1, "Quick test", NULL }, - { 2, "Deep test", NULL }, - { 3, "Abort test", NULL }, - { 0, NULL, NULL } + { 0, "No test", NULL, NULL }, + { 1, "Quick test", NULL, NULL }, + { 2, "Deep test", NULL, NULL }, + { 3, "Abort test", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t test_read_info[] = { - { 1, "Done and passed", NULL }, - { 2, "Done and warning", NULL }, - { 3, "Done and error", NULL }, - { 4, "Aborted", NULL }, - { 5, "In progress", NULL }, - { 6, "No test initiated", NULL }, - { 7, "Test scheduled", NULL }, - { 0, NULL, NULL } + { 1, "Done and passed", NULL, NULL }, + { 2, "Done and warning", NULL, NULL }, + { 3, "Done and error", NULL, NULL }, + { 4, "Aborted", NULL, NULL }, + { 5, "In progress", NULL, NULL }, + { 6, "No test initiated", NULL, NULL }, + { 7, "Test scheduled", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t beeper_info[] = { - { 1, "disabled", NULL }, - { 2, "enabled", NULL }, - { 3, "muted", NULL }, - { 0, NULL, NULL } + { 1, "disabled", NULL, NULL }, + { 2, "enabled", NULL, NULL }, + { 3, "muted", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t yes_no_info[] = { - { 0, "no", NULL }, - { 1, "yes", NULL }, - { 0, NULL, NULL } + { 0, "no", NULL, NULL }, + { 1, "yes", NULL, NULL }, + { 0, NULL, NULL, NULL } }; info_lkp_t on_off_info[] = { - { 0, "off", NULL }, - { 1, "on", NULL }, - { 0, NULL, NULL } + { 0, "off", NULL, NULL }, + { 1, "on", NULL, NULL }, + { 0, NULL, NULL, NULL } }; /* returns statically allocated string - must not use it again before @@ -397,8 +397,9 @@ static const char *date_conversion_fun(double value) return buf; } +/* FIXME? Do we need an inverse "nuf()" here? */ info_lkp_t date_conversion[] = { - { 0, NULL, date_conversion_fun } + { 0, NULL, date_conversion_fun, NULL } }; /* returns statically allocated string - must not use it again before @@ -412,8 +413,9 @@ static const char *hex_conversion_fun(double value) return buf; } +/* FIXME? Do we need an inverse "nuf()" here? */ info_lkp_t hex_conversion[] = { - { 0, NULL, hex_conversion_fun } + { 0, NULL, hex_conversion_fun, NULL } }; /* returns statically allocated string - must not use it again before @@ -425,8 +427,9 @@ static const char *stringid_conversion_fun(double value) return HIDGetIndexString(udev, (int)value, buf, sizeof(buf)); } +/* FIXME? Do we need an inverse "nuf()" here? */ info_lkp_t stringid_conversion[] = { - { 0, NULL, stringid_conversion_fun } + { 0, NULL, stringid_conversion_fun, NULL } }; /* returns statically allocated string - must not use it again before @@ -440,8 +443,9 @@ static const char *divide_by_10_conversion_fun(double value) return buf; } +/* FIXME? Do we need an inverse "nuf()" here? */ info_lkp_t divide_by_10_conversion[] = { - { 0, NULL, divide_by_10_conversion_fun } + { 0, NULL, divide_by_10_conversion_fun, NULL } }; /* returns statically allocated string - must not use it again before @@ -465,8 +469,9 @@ static const char *kelvin_celsius_conversion_fun(double value) return buf; } +/* FIXME? Do we need an inverse "nuf()" here? */ info_lkp_t kelvin_celsius_conversion[] = { - { 0, NULL, kelvin_celsius_conversion_fun } + { 0, NULL, kelvin_celsius_conversion_fun, NULL } }; /*! diff --git a/drivers/xppc-mib.c b/drivers/xppc-mib.c index 056c282f0d..c5de064cc7 100644 --- a/drivers/xppc-mib.c +++ b/drivers/xppc-mib.c @@ -31,17 +31,18 @@ /* To create a value lookup structure (as needed on the 2nd line of the example * below), use the following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * { 1, "OB", NULL, NULL }, + * { 2, "OL", NULL, NULL }, + * { 0, NULL, NULL, NULL } * }; */ /* upsBaseBatteryStatus */ static info_lkp_t xpcc_onbatt_info[] = { - { 1, "" }, /* unknown */ - { 2, "" }, /* batteryNormal */ - { 3, "LB" } /* batteryLow */ + { 1, "", NULL, NULL }, /* unknown */ + { 2, "", NULL, NULL }, /* batteryNormal */ + { 3, "LB", NULL, NULL }, /* batteryLow */ + { 0, NULL, NULL, NULL } }; /* @@ -58,15 +59,16 @@ upsBaseOutputStatus OBJECT-TYPE onBuck(9) } */ static info_lkp_t xpcc_power_info[] = { - { 1, "" }, /* unknown */ - { 2, "OL" }, /* onLine */ - { 3, "OB" }, /* onBattery */ - { 4, "OL BOOST" }, /* onBoost */ - { 5, "OFF" }, /* sleeping */ - { 6, "BYPASS"}, /* onBypass */ - { 7, "" }, /* rebooting */ - { 8, "OFF" }, /* standBy */ - { 9, "OL TRIM"} /* onBuck */ + { 1, "", NULL, NULL }, /* unknown */ + { 2, "OL", NULL, NULL }, /* onLine */ + { 3, "OB", NULL, NULL }, /* onBattery */ + { 4, "OL BOOST", NULL, NULL }, /* onBoost */ + { 5, "OFF", NULL, NULL }, /* sleeping */ + { 6, "BYPASS", NULL, NULL }, /* onBypass */ + { 7, "", NULL, NULL }, /* rebooting */ + { 8, "OFF", NULL, NULL }, /* standBy */ + { 9, "OL TRIM", NULL, NULL }, /* onBuck */ + { 0, NULL, NULL, NULL } }; /* XPPC Snmp2NUT lookup table */ @@ -122,4 +124,4 @@ static snmp_info_t xppc_mib[] = { { NULL, 0, 0, NULL, NULL, 0, NULL } }; -mib2nut_info_t xppc = { "xppc", XPPC_MIB_VERSION, NULL, NULL, xppc_mib, XPPC_SYSOID }; +mib2nut_info_t xppc = { "xppc", XPPC_MIB_VERSION, NULL, NULL, xppc_mib, XPPC_SYSOID, NULL }; diff --git a/tools/nut-scanner/nutscan-serial.c b/tools/nut-scanner/nutscan-serial.c index ffb60011e4..7b657ebd86 100644 --- a/tools/nut-scanner/nutscan-serial.c +++ b/tools/nut-scanner/nutscan-serial.c @@ -71,7 +71,7 @@ device_portname_t device_portname[] = { /* { "/dev/ttyd%i", "=" }, */ /* { "/dev/ttyf%i", "=" }, */ /* FIXME: Mac OS X has no serial port, but maybe ttyUSB? */ - { NULL, 0 } + { NULL, 0, 0 } }; /* Return 1 if port_name is a full path name to a serial port,