mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 18:23:36 +00:00
Compare commits
12 Commits
master
...
cleanup/nm
Author | SHA1 | Date | |
---|---|---|---|
2bf9964ce5 | |||
b6098c3bdb | |||
0c8ceb78a4 | |||
97da8c83ae | |||
8e4459f3dc | |||
161bb88c6e | |||
67928205e7 | |||
7469522fbb | |||
5372a57297 | |||
be9f1660fb | |||
e0811437a2 | |||
75eada4859 |
@ -25,22 +25,21 @@
|
||||
/* DCMI commands per DCMI 1.5 SPEC */
|
||||
|
||||
#define IPMI_DCMI 0xDC /* Group Extension Identification */
|
||||
#define IPMI_DCMI_COMPAT 0x01
|
||||
#define IPMI_DCMI_GETRED 0x02
|
||||
#define IPMI_DCMI_GETLMT 0x03
|
||||
#define IPMI_DCMI_SETLMT 0x04
|
||||
#define IPMI_DCMI_PWRACT 0x05
|
||||
#define IPMI_DCMI_GETASSET 0x06
|
||||
#define IPMI_DCMI_SETASSET 0x08
|
||||
#define IPMI_DCMI_GETMNGCTRLIDS 0x09
|
||||
#define IPMI_DCMI_SETMNGCTRLIDS 0x0A
|
||||
#define IPMI_DCMI_SETTERMALLIMIT 0x0B
|
||||
#define IPMI_DCMI_GETTERMALLIMIT 0x0C
|
||||
#define IPMI_DCMI_GETSNSR 0x07
|
||||
#define IPMI_DCMI_PWRMGT 0x08
|
||||
#define IPMI_DCMI_GETTEMPRED 0x10
|
||||
#define IPMI_DCMI_SETCONFPARAM 0x12
|
||||
#define IPMI_DCMI_GETCONFPARAM 0x13
|
||||
#define IPMI_DCMI_GET_CAPS 0x01 /* Get Capabilities */
|
||||
#define IPMI_DCMI_GET_PWR_READING 0x02 /* Get Power Reading */
|
||||
#define IPMI_DCMI_GET_PWR_LIM 0x03 /* Get Power Limit */
|
||||
#define IPMI_DCMI_SET_PWR_LIM 0x04 /* Set Power Limit */
|
||||
#define IPMI_DCMI_ACT_PWR_LIM 0x05 /* Activate/Deactivate Power Limit */
|
||||
#define IPMI_DCMI_GET_ASSET_TAG 0x06 /* Get Asset Tag */
|
||||
#define IPMI_DCMI_SET_ASSET_TAG 0x08 /* Set Asset Tag */
|
||||
#define IPMI_DCMI_GET_MC_ID 0x09 /* Get Management Controller ID String */
|
||||
#define IPMI_DCMI_SET_MC_ID 0x0A /* Set Management Controller ID String */
|
||||
#define IPMI_DCMI_SET_THERM_LIM 0x0B /* Set Thermal Limit */
|
||||
#define IPMI_DCMI_GET_THERM_LIM 0x0C /* Get Thermal Limit */
|
||||
#define IPMI_DCMI_GET_SENSOR_INFO 0x07 /* Get DCMI Sensor Info */
|
||||
#define IPMI_DCMI_GET_TEMP 0x10 /* Get Temperature Readings */
|
||||
#define IPMI_DCMI_SET_CONF_PARAM 0x12 /* Set DCMI Configuration Parameters */
|
||||
#define IPMI_DCMI_GET_CONF_PARAM 0x13 /* Get DCMI Configuration Parameters */
|
||||
|
||||
#define IPMI_DCMI_CONFORM 0x0001
|
||||
#define IPMI_DCMI_1_1_CONFORM 0x0101
|
||||
@ -52,53 +51,6 @@
|
||||
#define GOOD_PWR_GLIMIT_CCODE(ccode) ((ccode = ((ccode == 0x80) ? 0 : ccode)))
|
||||
#define GOOD_ASSET_TAG_CCODE(ccode) ((ccode = (((ccode == 0x80) || (ccode == 0x81) || (ccode == 0x82) || (ccode == 0x83)) ? 0 : ccode)))
|
||||
|
||||
/* External Node Manager Configuration and Control Commands per spec 2.0 */
|
||||
|
||||
#define IPMI_NM_POLICY_CTL 0xC0
|
||||
#define IPMI_NM_SET_POLICY 0xC1
|
||||
#define IPMI_NM_GET_POLICY 0xC2
|
||||
#define IPMI_NM_SET_ALERT_TH 0xC3
|
||||
#define IPMI_NM_GET_ALERT_TH 0xC4
|
||||
#define IPMI_NM_SET_SUSPEND 0xC5
|
||||
#define IPMI_NM_GET_SUSPEND 0xC6
|
||||
#define IPMI_NM_RESET_STATS 0xC7
|
||||
#define IPMI_NM_GET_STATS 0xC8
|
||||
#define IPMI_NM_GET_CAP 0xC9
|
||||
#define IPMI_NM_GET_VERSION 0xCA
|
||||
#define IPMI_NM_SET_POWER 0xCB
|
||||
#define IPMI_NM_SET_ALERT_DS 0xCE
|
||||
#define IPMI_NM_GET_ALERT_DS 0xCF
|
||||
#define IPMI_NM_LIMITING 0xF2
|
||||
|
||||
/* Node Manager Policy Control Flags */
|
||||
#define IPMI_NM_GLOBAL_ENABLE 0x01
|
||||
#define IPMI_NM_DOMAIN_ENABLE 0x02
|
||||
#define IPMI_NM_PER_POLICY_ENABLE 0x04
|
||||
|
||||
/* Node Manager Set Policy Enable */
|
||||
#define IPMI_NM_POLICY_ENABLE 0x10
|
||||
|
||||
/* Node Manager Policy Trigger Codes */
|
||||
#define IPMI_NM_NO_POLICY_TRIG 0x00
|
||||
#define IPMI_NM_TEMP_TRIGGER 0x01
|
||||
#define IPMI_NM_NO_READ_TRIG 0x02
|
||||
#define IPMI_NM_RESET_TRIGGER 0x03
|
||||
#define IPMI_NM_BOOT_TRIGGER 0x04
|
||||
|
||||
/* Policy Exception Actions flags */
|
||||
#define IPMI_NM_POLICY_ALERT 0x01
|
||||
#define IPMI_NM_POLICY_SHUT 0x02
|
||||
|
||||
/* Power Correction codes for Policy action */
|
||||
#define IPMI_NM_PWR_AUTO_CORR 0x00
|
||||
#define IPMI_NM_PWR_SOFT_CORR 0x01
|
||||
#define IPMI_NM_PWR_AGGR_CORR 0x02
|
||||
|
||||
/* Set Threshold message size */
|
||||
#define IPMI_NM_SET_THRESH_LEN 12
|
||||
|
||||
/* Number of Suspend Periods */
|
||||
#define IPMI_NM_SUSPEND_PERIOD_MAX 5
|
||||
|
||||
struct dcmi_cmd {
|
||||
uint16_t val;
|
||||
@ -106,6 +58,13 @@ struct dcmi_cmd {
|
||||
const char * desc;
|
||||
};
|
||||
|
||||
/*
|
||||
* This is a termination macro for all struct dcmi_cmd arrays,
|
||||
* def argument is the default value returned by str2val2()
|
||||
* when string is not found in the array
|
||||
*/
|
||||
#define DCMI_CMD_END(def) { (def), NULL, NULL }
|
||||
|
||||
/* make a struct for the return from the get limit command */
|
||||
struct power_limit {
|
||||
uint8_t grp_id; /* first byte: Group Extension ID */
|
||||
@ -172,99 +131,11 @@ struct thermal_limit {
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int ipmi_dcmi_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
uint16_t dcmi_str2val(const char *str, const struct dcmi_cmd *vs);
|
||||
const char *dcmi_val2str(uint16_t val, const struct dcmi_cmd *vs);
|
||||
void dcmi_print_strs(const struct dcmi_cmd * vs,
|
||||
const char * title,
|
||||
int loglevel,
|
||||
int verthorz);
|
||||
|
||||
/* Node Manager discover command */
|
||||
struct nm_discover {
|
||||
uint8_t intel_id[3]; /* Always returns 000157 */
|
||||
uint8_t nm_version;
|
||||
uint8_t ipmi_version;
|
||||
uint8_t patch_version;
|
||||
uint8_t major_rev;
|
||||
uint8_t minor_rev;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager get capabilities command */
|
||||
struct nm_capability {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t max_settings;
|
||||
uint16_t max_value; /* max power/thermal/time after reset */
|
||||
uint16_t min_value; /* min "" */
|
||||
uint32_t min_corr; /* min correction time inmillesecs */
|
||||
uint32_t max_corr;
|
||||
uint16_t min_stats;
|
||||
uint16_t max_stats;
|
||||
uint8_t scope;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager get statistics command */
|
||||
struct nm_statistics {
|
||||
uint8_t intel_id[3];
|
||||
uint16_t curr_value;
|
||||
uint16_t min_value;
|
||||
uint16_t max_value;
|
||||
uint16_t ave_value;
|
||||
uint32_t time_stamp;
|
||||
uint32_t stat_period;
|
||||
uint8_t id_state;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set policy */
|
||||
struct nm_policy {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_id;
|
||||
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
|
||||
uint8_t policy_exception; /* exception actions */
|
||||
uint16_t policy_limits;
|
||||
uint32_t corr_time;
|
||||
uint16_t trigger_limit;
|
||||
uint16_t stats_period;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Maager get policy */
|
||||
struct nm_get_policy {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
|
||||
uint8_t policy_exception; /* exception actions */
|
||||
uint16_t policy_limits;
|
||||
uint32_t corr_time;
|
||||
uint16_t trigger_limit;
|
||||
uint16_t stats_period;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set alert destination */
|
||||
struct nm_set_alert {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t chan; /* 0:3 BMC chan, 4:6 reserved, bit 7=0 register alert receiver =1 invalidate */
|
||||
uint8_t dest; /* lan destination */
|
||||
uint8_t string; /* alert string selector */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set alert threshold */
|
||||
struct nm_thresh {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_id;
|
||||
uint8_t count;
|
||||
uint16_t thresholds[3];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager suspend period struct */
|
||||
struct nm_period {
|
||||
uint8_t start;
|
||||
uint8_t stop;
|
||||
uint8_t repeat;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set suspend period */
|
||||
struct nm_suspend {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_id;
|
||||
uint8_t count;
|
||||
struct nm_period period[IPMI_NM_SUSPEND_PERIOD_MAX];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int ipmi_nm_main(struct ipmi_intf * intf, int argc, char ** argv);
|
||||
#endif /*IPMI_DCMI_H*/
|
||||
|
202
include/ipmitool/ipmi_nm.h
Normal file
202
include/ipmitool/ipmi_nm.h
Normal file
@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Intel Corporation.
|
||||
* All rights reserved
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ipmitool/ipmi.h>
|
||||
#include <ipmitool/helper.h>
|
||||
|
||||
/* Configuration and control commands per
|
||||
* Intel Intelligent Power Node Manager 2.0
|
||||
* External Interface Specification Using IPMI
|
||||
*/
|
||||
|
||||
#define IPMI_NM_POLICY_CTL 0xC0
|
||||
#define IPMI_NM_SET_POLICY 0xC1
|
||||
#define IPMI_NM_GET_POLICY 0xC2
|
||||
#define IPMI_NM_SET_ALERT_TH 0xC3
|
||||
#define IPMI_NM_GET_ALERT_TH 0xC4
|
||||
#define IPMI_NM_SET_SUSPEND 0xC5
|
||||
#define IPMI_NM_GET_SUSPEND 0xC6
|
||||
#define IPMI_NM_RESET_STATS 0xC7
|
||||
#define IPMI_NM_GET_STATS 0xC8
|
||||
#define IPMI_NM_GET_CAP 0xC9
|
||||
#define IPMI_NM_GET_VERSION 0xCA
|
||||
#define IPMI_NM_SET_POWER 0xCB
|
||||
#define IPMI_NM_SET_ALERT_DS 0xCE
|
||||
#define IPMI_NM_GET_ALERT_DS 0xCF
|
||||
#define IPMI_NM_LIMITING 0xF2
|
||||
|
||||
/* Node Manager identification */
|
||||
#define IPMI_NM_ID 0x000157 /* Three bytes */
|
||||
|
||||
/* Node Manager Policy Control Flags */
|
||||
#define IPMI_NM_GLOBAL_ENABLE 0x01
|
||||
#define IPMI_NM_DOMAIN_ENABLE 0x02
|
||||
#define IPMI_NM_PER_POLICY_ENABLE 0x04
|
||||
|
||||
/* Node Manager Set Policy Enable */
|
||||
#define IPMI_NM_POLICY_ENABLE 0x10
|
||||
|
||||
/* Node Manager Policy Trigger Codes */
|
||||
#define IPMI_NM_NO_POLICY_TRIG 0x00
|
||||
#define IPMI_NM_TEMP_TRIGGER 0x01
|
||||
#define IPMI_NM_NO_READ_TRIG 0x02
|
||||
#define IPMI_NM_RESET_TRIGGER 0x03
|
||||
#define IPMI_NM_BOOT_TRIGGER 0x04
|
||||
|
||||
/* Node Manager status codes, as per
|
||||
* "Intel Intelligent Power Node Manager 3.0
|
||||
* External Interface Specification using IPMI"
|
||||
*/
|
||||
#define IPMI_NM_CC_POLICY_ID_INVALID 0x80
|
||||
#define IPMI_NM_CC_POLICY_DOMAIN_INVALID 0x81
|
||||
#define IPMI_NM_CC_POLICY_TRIGGER_UNKNOWN 0x82
|
||||
#define IPMI_NM_CC_POLICY_CORRECTION_RANGE 0x85
|
||||
#define IPMI_NM_CC_POLICY_TRIGGER_RANGE 0x86
|
||||
#define IPMI_NM_CC_POLICY_STATS_RANGE 0x89
|
||||
#define IPMI_NM_CC_POLICY_LIMIT_NONE 0xA1
|
||||
#define IPMI_NM_CC_POLICY_PARAM_BUSY 0xD5
|
||||
#define IPMI_NM_CC_POLICY_DOMAIN_ERR 0xD6
|
||||
#define IPMI_NM_CC_POLICY_VALUE_INVALID 0x8B
|
||||
#define IPMI_NM_CC_STATS_MODE_INVALID 0x88
|
||||
#define IPMI_NM_CC_POWER_LIMIT_RANGE 0x84
|
||||
|
||||
/* Policy Exception Actions flags */
|
||||
#define IPMI_NM_POLICY_ALERT 0x01
|
||||
#define IPMI_NM_POLICY_SHUT 0x02
|
||||
|
||||
/* Power Correction codes for Policy action */
|
||||
#define IPMI_NM_PWR_AUTO_CORR 0x00
|
||||
#define IPMI_NM_PWR_SOFT_CORR 0x01
|
||||
#define IPMI_NM_PWR_AGGR_CORR 0x02
|
||||
|
||||
/* Set Threshold message size */
|
||||
#define IPMI_NM_SET_THRESH_LEN 12
|
||||
|
||||
/* Number of Suspend Periods */
|
||||
#define IPMI_NM_SUSPEND_PERIOD_MAX 5
|
||||
|
||||
/* Node Manager discover command */
|
||||
struct nm_discover {
|
||||
uint8_t intel_id[3]; /* Always returns 000157 */
|
||||
uint8_t nm_version;
|
||||
uint8_t ipmi_version;
|
||||
uint8_t patch_version;
|
||||
uint8_t major_rev;
|
||||
uint8_t minor_rev;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager get capabilities command */
|
||||
struct nm_capability {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t max_settings;
|
||||
uint16_t max_value; /* max power/thermal/time after reset */
|
||||
uint16_t min_value; /* min "" */
|
||||
uint32_t min_corr; /* min correction time inmillesecs */
|
||||
uint32_t max_corr;
|
||||
uint16_t min_stats;
|
||||
uint16_t max_stats;
|
||||
uint8_t scope;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager get statistics command */
|
||||
struct nm_statistics {
|
||||
uint8_t intel_id[3];
|
||||
uint16_t curr_value;
|
||||
uint16_t min_value;
|
||||
uint16_t max_value;
|
||||
uint16_t ave_value;
|
||||
uint32_t time_stamp;
|
||||
uint32_t stat_period;
|
||||
uint8_t id_state;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set policy */
|
||||
struct nm_policy {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_id;
|
||||
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
|
||||
uint8_t policy_exception; /* exception actions */
|
||||
uint16_t policy_limits;
|
||||
uint32_t corr_time;
|
||||
uint16_t trigger_limit;
|
||||
uint16_t stats_period;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Maager get policy */
|
||||
struct nm_get_policy {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_type; /* 0:3 trigger type 4 = action 5:6 correction */
|
||||
uint8_t policy_exception; /* exception actions */
|
||||
uint16_t policy_limits;
|
||||
uint32_t corr_time;
|
||||
uint16_t trigger_limit;
|
||||
uint16_t stats_period;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set alert destination */
|
||||
struct nm_set_alert {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t chan; /* 0:3 BMC chan
|
||||
* 4:6 reserved
|
||||
* 7 = 0 register alert receiver
|
||||
* = 1 invalidate
|
||||
*/
|
||||
uint8_t dest; /* LAN destination */
|
||||
uint8_t string; /* alert string selector */
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set alert threshold */
|
||||
struct nm_thresh {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_id;
|
||||
uint8_t count;
|
||||
uint16_t thresholds[3];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager suspend period struct */
|
||||
struct nm_period {
|
||||
uint8_t start;
|
||||
uint8_t stop;
|
||||
uint8_t repeat;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Node Manager set suspend period */
|
||||
struct nm_suspend {
|
||||
uint8_t intel_id[3];
|
||||
uint8_t domain; /* 0:3 are domain, 4 = Policy enabled */
|
||||
uint8_t policy_id;
|
||||
uint8_t count;
|
||||
struct nm_period period[IPMI_NM_SUSPEND_PERIOD_MAX];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
int ipmi_nm_main(struct ipmi_intf *intf, int argc, char **argv);
|
||||
|
||||
static inline void nm_set_id(void *buf)
|
||||
{
|
||||
htoipmi24(IPMI_NM_ID, buf);
|
||||
}
|
||||
|
||||
static inline bool nm_check_id(void *buf)
|
||||
{
|
||||
return IPMI_NM_ID == ipmi24toh(buf);
|
||||
}
|
@ -59,5 +59,17 @@ int log_level_get(void);
|
||||
void lprintf(int level, const char * format, ...);
|
||||
void lperror(int level, const char * format, ...);
|
||||
|
||||
/**
|
||||
* @brief Print to log or to STDOUT depending on the \p ll argument.
|
||||
* @param[in] ll Log level. Negative values meant "print to stdout".
|
||||
* @param[in] fmt The printf format string. No '\n' is needed at the end.
|
||||
*/
|
||||
#define uprintf(ll, fmt, ...) do { \
|
||||
if (ll < 0) \
|
||||
printf(fmt "\n", ##__VA_ARGS__); \
|
||||
else \
|
||||
lprintf(ll, fmt, ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
|
||||
#endif /*IPMITOOL_LOG_H*/
|
||||
|
||||
|
@ -40,7 +40,7 @@ libipmitool_la_SOURCES = helper.c ipmi_sdr.c ipmi_sel.c ipmi_sol.c ipmi_pef.c \
|
||||
ipmi_oem.c ipmi_isol.c ipmi_sunoem.c ipmi_fwum.c ipmi_picmg.c \
|
||||
ipmi_main.c ipmi_tsol.c ipmi_firewall.c ipmi_kontronoem.c \
|
||||
ipmi_hpmfwupg.c ipmi_sdradd.c ipmi_ekanalyzer.c ipmi_gendev.c \
|
||||
ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c hpm2.c ipmi_vita.c \
|
||||
ipmi_ime.c ipmi_delloem.c ipmi_dcmi.c ipmi_nm.c hpm2.c ipmi_vita.c \
|
||||
ipmi_lanp6.c ipmi_cfgp.c ipmi_quantaoem.c ipmi_time.c \
|
||||
../src/plugins/lan/md5.c ../src/plugins/lan/md5.h
|
||||
|
||||
|
55
lib/helper.c
55
lib/helper.c
@ -669,38 +669,22 @@ print_valstr(const struct valstr * vs, const char * title, int loglevel)
|
||||
return;
|
||||
|
||||
if (title) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n", title);
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
uprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
|
||||
if (loglevel < 0) {
|
||||
printf(" VALUE\tHEX\tSTRING\n");
|
||||
printf("==============================================\n");
|
||||
} else {
|
||||
lprintf(loglevel, " VAL\tHEX\tSTRING");
|
||||
lprintf(loglevel, "==============================================");
|
||||
}
|
||||
uprintf(loglevel, " VALUE\tHEX\tSTRING");
|
||||
uprintf(loglevel, "==============================================");
|
||||
|
||||
for (i = 0; vs[i].str; i++) {
|
||||
if (loglevel < 0) {
|
||||
if (vs[i].val < 256)
|
||||
printf(" %d\t0x%02x\t%s\n", vs[i].val, vs[i].val, vs[i].str);
|
||||
uprintf(loglevel, " %d\t0x%02x\t%s",
|
||||
vs[i].val, vs[i].val, vs[i].str);
|
||||
else
|
||||
printf(" %d\t0x%04x\t%s\n", vs[i].val, vs[i].val, vs[i].str);
|
||||
} else {
|
||||
if (vs[i].val < 256)
|
||||
lprintf(loglevel, " %d\t0x%02x\t%s", vs[i].val, vs[i].val, vs[i].str);
|
||||
else
|
||||
lprintf(loglevel, " %d\t0x%04x\t%s", vs[i].val, vs[i].val, vs[i].str);
|
||||
}
|
||||
uprintf(loglevel, " %d\t0x%04x\t%s",
|
||||
vs[i].val, vs[i].val, vs[i].str);
|
||||
}
|
||||
|
||||
if (loglevel < 0)
|
||||
printf("\n");
|
||||
else
|
||||
lprintf(loglevel, "");
|
||||
uprintf(loglevel, "");
|
||||
}
|
||||
|
||||
/* print_valstr_2col - print value string list in two columns to log or stdout
|
||||
@ -718,37 +702,22 @@ print_valstr_2col(const struct valstr * vs, const char * title, int loglevel)
|
||||
return;
|
||||
|
||||
if (title) {
|
||||
if (loglevel < 0)
|
||||
printf("\n%s:\n\n", title);
|
||||
else
|
||||
lprintf(loglevel, "\n%s:\n", title);
|
||||
uprintf(loglevel, "\n%s:\n", title);
|
||||
}
|
||||
|
||||
for (i = 0; vs[i].str; i++) {
|
||||
if (!vs[i+1].str) {
|
||||
/* last one */
|
||||
if (loglevel < 0) {
|
||||
printf(" %4d %-32s\n", vs[i].val, vs[i].str);
|
||||
} else {
|
||||
lprintf(loglevel, " %4d %-32s\n", vs[i].val, vs[i].str);
|
||||
}
|
||||
uprintf(loglevel, " %4d %-32s\n", vs[i].val, vs[i].str);
|
||||
}
|
||||
else {
|
||||
if (loglevel < 0) {
|
||||
printf(" %4d %-32s %4d %-32s\n",
|
||||
uprintf(loglevel, " %4d %-32s %4d %-32s\n",
|
||||
vs[i].val, vs[i].str, vs[i+1].val, vs[i+1].str);
|
||||
} else {
|
||||
lprintf(loglevel, " %4d %-32s %4d %-32s\n",
|
||||
vs[i].val, vs[i].str, vs[i+1].val, vs[i+1].str);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (loglevel < 0)
|
||||
printf("\n");
|
||||
else
|
||||
lprintf(loglevel, "");
|
||||
uprintf(loglevel, ""); /* Empty spacer line */
|
||||
}
|
||||
|
||||
/* ipmi_csum - calculate an ipmi checksum
|
||||
|
1932
lib/ipmi_dcmi.c
1932
lib/ipmi_dcmi.c
File diff suppressed because it is too large
Load Diff
1899
lib/ipmi_nm.c
Normal file
1899
lib/ipmi_nm.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -65,6 +65,7 @@
|
||||
#include <ipmitool/ipmi_ekanalyzer.h>
|
||||
#include <ipmitool/ipmi_ime.h>
|
||||
#include <ipmitool/ipmi_dcmi.h>
|
||||
#include <ipmitool/ipmi_nm.h>
|
||||
#include <ipmitool/ipmi_vita.h>
|
||||
#include <ipmitool/ipmi_quantaoem.h>
|
||||
|
||||
|
Reference in New Issue
Block a user