add freeipmi source

This commit is contained in:
dmacias72
2016-03-24 14:02:30 -06:00
parent 46d0c3615e
commit bc10199d49
398 changed files with 89602 additions and 0 deletions

View File

@ -0,0 +1,135 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_BMC_WATCHDOG_TIMER_CMDS_H
#define IPMI_BMC_WATCHDOG_TIMER_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_BIOS_FRB2 0x1
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_BIOS_POST 0x2
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_OS_LOAD 0x3
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_SMS_OS 0x4
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_OEM 0x5
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_VALID(__x) \
(((__x) == IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_BIOS_FRB2 \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_BIOS_POST \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_OS_LOAD \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_SMS_OS \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_OEM) ? 1 : 0)
#define IPMI_BMC_WATCHDOG_TIMER_STOP_TIMER_ENABLE 0x0
#define IPMI_BMC_WATCHDOG_TIMER_STOP_TIMER_DISABLE 0x1
#define IPMI_BMC_WATCHDOG_TIMER_STOP_TIMER_VALID(__x) \
(((__x) == IPMI_BMC_WATCHDOG_TIMER_STOP_TIMER_ENABLE \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_STOP_TIMER_DISABLE) ? 1 : 0)
#define IPMI_BMC_WATCHDOG_TIMER_LOG_ENABLE 0x0
#define IPMI_BMC_WATCHDOG_TIMER_LOG_DISABLE 0x1
#define IPMI_BMC_WATCHDOG_TIMER_LOG_VALID(__x) \
(((__x) == IPMI_BMC_WATCHDOG_TIMER_LOG_ENABLE \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_LOG_DISABLE) ? 1 : 0)
#define IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_NO_ACTION 0x0
#define IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_HARD_RESET 0x1
#define IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_POWER_DOWN 0x2
#define IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_POWER_CYCLE 0x3
#define IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_VALID(__x) \
(((__x) == IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_NO_ACTION \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_HARD_RESET \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_POWER_DOWN \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMEOUT_ACTION_POWER_CYCLE) ? 1 : 0)
#define IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_NONE 0x0
#define IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_SMI 0x1
#define IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_NMI 0x2
#define IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_MESSAGING_INTERRUPT 0x3
#define IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_VALID(__x) \
(((__x) == IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_NONE \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_SMI \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_NMI \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERRUPT_MESSAGING_INTERRUPT) ? 1 : 0)
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_EXPIRATION_CLEAR_TIMER_EXPIRATION_BIT 0x1
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_EXPIRATION_LEAVE_ALONE 0x0
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_EXPIRATION_VALID(__x) \
(((__x) == IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_EXPIRATION_CLEAR_TIMER_EXPIRATION_BIT \
|| (__x) == IPMI_BMC_WATCHDOG_TIMER_TIMER_USE_EXPIRATION_LEAVE_ALONE) ? 1 : 0)
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_STATE_RUNNING 0x1
#define IPMI_BMC_WATCHDOG_TIMER_TIMER_STATE_STOPPED 0x0
#define IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERVAL_MIN 0x00
#define IPMI_BMC_WATCHDOG_TIMER_PRE_TIMEOUT_INTERVAL_MAX 0xFF
#define IPMI_BMC_WATCHDOG_TIMER_INITIAL_COUNTDOWN_MIN 0x0000
#define IPMI_BMC_WATCHDOG_TIMER_INITIAL_COUNTDOWN_MAX 0xFFFF
#define IPMI_BMC_WATCHDOG_TIMER_INITIAL_COUNTDOWN_MIN_SECONDS IPMI_BMC_WATCHDOG_TIMER_INITIAL_COUNTDOWN_MIN
#define IPMI_BMC_WATCHDOG_TIMER_INITIAL_COUNTDOWN_MAX_SECONDS (IPMI_BMC_WATCHDOG_TIMER_INITIAL_COUNTDOWN_MAX/10)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_reset_watchdog_timer_rq;
extern fiid_template_t tmpl_cmd_reset_watchdog_timer_rs;
extern fiid_template_t tmpl_cmd_set_watchdog_timer_rq;
extern fiid_template_t tmpl_cmd_set_watchdog_timer_rs;
extern fiid_template_t tmpl_cmd_get_watchdog_timer_rq;
extern fiid_template_t tmpl_cmd_get_watchdog_timer_rs;
int fill_cmd_reset_watchdog_timer (fiid_obj_t obj_cmd_rq);
int fill_cmd_set_watchdog_timer (uint8_t timer_use,
uint8_t stop_timer,
uint8_t log,
uint8_t timeout_action,
uint8_t pre_timeout_interrupt,
uint8_t pre_timeout_interval,
uint8_t timer_use_expiration_flag_bios_frb2,
uint8_t timer_use_expiration_flag_bios_post,
uint8_t timer_use_expiration_flag_os_load,
uint8_t timer_use_expiration_flag_sms_os,
uint8_t timer_use_expiration_flag_oem,
uint16_t initial_countdown_value,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_watchdog_timer (fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_BMC_WATCHDOG_TIMER_CMDS_H */

View File

@ -0,0 +1,410 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_CHASSIS_CMDS_H
#define IPMI_CHASSIS_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_POWER_RESTORE_POLICY_POWERED_OFF_AFTER_AC_RETURNS 0x00
#define IPMI_POWER_RESTORE_POLICY_POWER_RESTORED_TO_STATE 0x01
#define IPMI_POWER_RESTORE_POLICY_POWERS_UP_AFTER_AC_RETURNS 0x02
#define IPMI_POWER_RESTORE_POLICY_UNKNOWN 0x03
#define IPMI_SYSTEM_POWER_IS_ON 1
#define IPMI_SYSTEM_POWER_IS_OFF 0
#define IPMI_LAST_POWER_EVENT_AC_FAILED 0x00
#define IPMI_LAST_POWER_EVENT_POWER_DOWN_POWER_OVERLOAD 0x01
#define IPMI_LAST_POWER_EVENT_POWER_DOWN_INTERLOCK_ACTIVATED 0x02
#define IPMI_LAST_POWER_EVENT_POWER_DOWN_POWER_FAULT 0x03
#define IPMI_LAST_POWER_EVENT_POWER_ON_VIA_IPMI 0x04
#define IPMI_LAST_POWER_EVENT_UNKNOWN 0x05
#define IPMI_CHASSIS_CONTROL_POWER_DOWN 0x00
#define IPMI_CHASSIS_CONTROL_POWER_UP 0x01
#define IPMI_CHASSIS_CONTROL_POWER_CYCLE 0x02
#define IPMI_CHASSIS_CONTROL_HARD_RESET 0x03
#define IPMI_CHASSIS_CONTROL_PULSE_DIAGNOSTIC_INTERRUPT 0x04
#define IPMI_CHASSIS_CONTROL_INITIATE_SOFT_SHUTDOWN 0x05
#define IPMI_CHASSIS_CONTROL_VALID(__chassis_control) \
(((__chassis_control) == IPMI_CHASSIS_CONTROL_POWER_DOWN \
|| (__chassis_control) == IPMI_CHASSIS_CONTROL_POWER_UP \
|| (__chassis_control) == IPMI_CHASSIS_CONTROL_POWER_CYCLE \
|| (__chassis_control) == IPMI_CHASSIS_CONTROL_HARD_RESET \
|| (__chassis_control) == IPMI_CHASSIS_CONTROL_PULSE_DIAGNOSTIC_INTERRUPT \
|| (__chassis_control) == IPMI_CHASSIS_CONTROL_INITIATE_SOFT_SHUTDOWN) ? 1 : 0)
#define IPMI_CHASSIS_FORCE_IDENTIFY_OFF 0x00
#define IPMI_CHASSIS_FORCE_IDENTIFY_ON 0x01
#define IPMI_CHASSIS_FORCE_IDENTIFY_VALID(__force_identify) \
(((__force_identify) == IPMI_CHASSIS_FORCE_IDENTIFY_OFF \
|| (__force_identify) == IPMI_CHASSIS_FORCE_IDENTIFY_ON) ? 1 : 0)
#define IPMI_CHASSIS_IDENTIFY_STATE_OFF 0x00
#define IPMI_CHASSIS_IDENTIFY_STATE_TEMPORARY_ON 0x01
#define IPMI_CHASSIS_IDENTIFY_STATE_INDEFINITE_ON 0x02
/* min is degenerate "off" case */
#define IPMI_CHASSIS_IDENTIFY_INTERVAL_MIN 0x00
#define IPMI_CHASSIS_IDENTIFY_INTERVAL_MAX 0xFF
/* min is degenerate "no delay" case */
#define IPMI_CHASSIS_POWER_CYCLE_INTERVAL_MIN 0x00
#define IPMI_CHASSIS_POWER_CYCLE_INTERVAL_MAX 0xFF
/* achu: it's backwards on buttons, I don't know why */
#define IPMI_CHASSIS_BUTTON_ENABLE 0x00
#define IPMI_CHASSIS_BUTTON_DISABLE 0x01
#define IPMI_CHASSIS_BUTTON_VALID(__button) \
(((__button) == IPMI_CHASSIS_BUTTON_ENABLE \
|| (__button) == IPMI_CHASSIS_BUTTON_DISABLE) ? 1 : 0)
#define IPMI_CHASSIS_BUTTON_DISABLE_ALLOWED 0x1
#define IPMI_CHASSIS_BUTTON_DISABLE_NOT_ALLOWED 0x0
#define IPMI_POWER_RESTORE_POLICY_ALWAYS_STAY_POWERED_OFF 0x00
#define IPMI_POWER_RESTORE_POLICY_RESTORE_POWER_TO_STATE_WHEN_AC_WAS_LOST 0x01
#define IPMI_POWER_RESTORE_POLICY_ALWAYS_POWER_UP_AFTER_AC_IS_LOST 0x02
#define IPMI_POWER_RESTORE_POLICY_NO_CHANGE 0x03
#define IPMI_POWER_RESTORE_POLICY_VALID(__policy) \
(((__policy) == IPMI_POWER_RESTORE_POLICY_NO_CHANGE \
|| (__policy) == IPMI_POWER_RESTORE_POLICY_ALWAYS_POWER_UP_AFTER_AC_IS_LOST \
|| (__policy) == IPMI_POWER_RESTORE_POLICY_RESTORE_POWER_TO_STATE_WHEN_AC_WAS_LOST \
|| (__policy) == IPMI_POWER_RESTORE_POLICY_ALWAYS_STAY_POWERED_OFF) ? 1 : 0)
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_UNKNOWN 0x00
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_CHASSIS_CONTROL_COMMAND 0x01
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_RESET_VIA_PUSHBUTTON 0x02
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_POWER_UP_VIA_POWER_PUSHBUTTON 0x03
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_WATCHDOG_EXPIRATION 0x04
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_OEM 0x05
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_AUTOMATIC_POWER_UP_ALWAYS_RESTORE 0x06
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_AUTOMATIC_POWER_UP_RESTORE_PREVIOUS 0x07
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_RESET_VIA_PEF 0x08
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_POWER_CYCLE_VIA_PEF 0x09
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_SOFT_RESET 0x0A
#define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_POWER_UP_VIA_RTC 0x0B
#define IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_VALID_UNLOCKED 0x0
#define IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_INVALID_LOCKED 0x1
#define IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_VALID_VALID(__value) \
(((__value) == IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_VALID_UNLOCKED \
|| (__value) == IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_INVALID_LOCKED) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTIONS_NO_SET_SELECTOR 0x0
#define IPMI_SYSTEM_BOOT_OPTIONS_NO_BLOCK_SELECTOR 0x0
#define IPMI_SYSTEM_BOOT_OPTION_SET_COMPLETE 0x00
#define IPMI_SYSTEM_BOOT_OPTION_SET_IN_PROGRESS 0x01
#define IPMI_SYSTEM_BOOT_OPTION_SET_COMMIT_WRITE 0x02
#define IPMI_SYSTEM_BOOT_OPTION_SET_IN_PROGRESS_VALID(__value) \
(((__value) == IPMI_SYSTEM_BOOT_OPTION_SET_COMPLETE \
|| (__value) == IPMI_SYSTEM_BOOT_OPTION_SET_IN_PROGRESS \
|| (__value) == IPMI_SYSTEM_BOOT_OPTION_SET_COMMIT_WRITE) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_INVALID 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_VALID 0x01
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_VALID_FOR_NEXT_BOOT 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_VALID_PERSISTENTLY 0x01
/* achu: below is not a typo, IPMI spec orders it 0x09, 0x08, 0x0B, 0x0F */
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_NO_OVERRIDE 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PXE 0x01
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE 0x02
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE_SAFE_MODE 0x03
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_DIAGNOSTIC_PARTITION 0x04
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_CD_DVD 0x05
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_BIOS_SETUP 0x06
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_FLOPPY_PRIMARY_REMOVEABLE_MEDIA 0x07
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PRIMARY_REMOTE_MEDIA 0x09
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_CD_DVD 0x08
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_HARD_DRIVE 0x0B
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_FLOPPY_REMOVEABLE_MEDIA 0x0F
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_VALID(__boot_device) \
(((__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_NO_OVERRIDE \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PXE \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE_SAFE_MODE \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_DIAGNOSTIC_PARTITION \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_CD_DVD \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_BIOS_SETUP \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_FLOPPY_PRIMARY_REMOVEABLE_MEDIA \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PRIMARY_REMOTE_MEDIA \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_CD_DVD \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_HARD_DRIVE \
|| (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_FLOPPY_REMOVEABLE_MEDIA) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_DEFAULT 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_BIOS_SETTING IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_DEFAULT
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_SUPPRESS 0x01
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_ENABLE 0x02
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_VALID(__console_redirection) \
(((__console_redirection) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_DEFAULT \
|| (__console_redirection) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_SUPPRESS \
|| (__console_redirection) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_ENABLE) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_NO 0x00
#define IPMI_SYSTEM_BOOT_OPTION_YES 0x01
#define IPMI_SYSTEM_BOOT_OPTION_DISABLE 0x00
#define IPMI_SYSTEM_BOOT_OPTION_ENABLE 0x01
#define IPMI_SYSTEM_BOOT_OPTION_ENABLE_VALID(__value) \
(((__value) == IPMI_SYSTEM_BOOT_OPTION_ENABLE \
|| (__value) == IPMI_SYSTEM_BOOT_OPTION_DISABLE) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_PC_COMPATIBLE 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_EFI 0x01
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BIOS_BOOT_TYPE_VALID(__boot_type) \
(((__boot_type) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_PC_COMPATIBLE \
|| (__boot_type) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_EFI) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_DEFAULT 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_QUIET 0x01
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_VERBOSE 0x02
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_VALID(__verbosity) \
(((__verbosity) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_DEFAULT \
|| (__verbosity) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_QUIET \
|| (__verbosity) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_VERBOSE) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_UNSPECIFIED 0x00
#define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DISCOVERED 0X01
#define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_UNDISCOVERED 0X00
#define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DISCOVERED_VALID(__value) \
(((__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DISCOVERED \
|| (__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_UNDISCOVERED) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_SCAN 0X01
#define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DO_NOT_SCAN 0X00
#define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_SCAN_VALID(__value) \
(((__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_SCAN \
|| (__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DO_NOT_SCAN) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_INFO_ACKNOWLEDGE 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_INFO_UNACKNOWLEDGE 0x01
#define IPMI_SYSTEM_BOOT_OPTION_DONT_CLEAR_VALID_BIT 0x01
#define IPMI_SYSTEM_BOOT_OPTION_CLEAR_VALID_BIT 0x00
#define IPMI_SYSTEM_BOOT_OPTION_CLEAR_VALID_BIT_VALID(__value) \
(((__value) == IPMI_SYSTEM_BOOT_OPTION_DONT_CLEAR_VALID_BIT \
|| (__value) == IPMI_SYSTEM_BOOT_OPTION_CLEAR_VALID_BIT) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_RECOMENDED_AT_END_OF_POST 0x00
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_BMC 0x01
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_SYSTEM 0x02
#define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_BIOS_MUX_CONTROL_OVERRIDE_VALID(__bios_mux_control) \
(((__bios_mux_control) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_RECOMENDED_AT_END_OF_POST \
|| (__bios_mux_control) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_BMC \
|| (__bios_mux_control) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_SYSTEM) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MIN 0x00
#define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MAX 0x31
#define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MIN 0x01
#define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MAX 0x15
/* To avoid gcc warnings, add +1 in comparison */
#define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_VALID(__value) \
((((__value) + 1) >= (IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MIN + 1) \
&& (__value) <= IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MAX) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_VALID(__value) \
(((__value) >= IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MIN \
&& (__value) <= IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MAX) ? 1 : 0)
#define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_INTERNAL_BITMASK 0x10
#define IPMI_SYSTEM_BOOT_OPTION_BLOCK_DATA_LEN_MAX 16
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_chassis_capabilities_rq;
extern fiid_template_t tmpl_cmd_get_chassis_capabilities_rs;
extern fiid_template_t tmpl_cmd_get_chassis_status_rq;
extern fiid_template_t tmpl_cmd_get_chassis_status_rs;
extern fiid_template_t tmpl_cmd_chassis_control_rq;
extern fiid_template_t tmpl_cmd_chassis_control_rs;
extern fiid_template_t tmpl_cmd_chassis_identify_rq;
extern fiid_template_t tmpl_cmd_chassis_identify_rs;
extern fiid_template_t tmpl_cmd_set_front_panel_enables_rq;
extern fiid_template_t tmpl_cmd_set_front_panel_enables_rs;
extern fiid_template_t tmpl_cmd_set_power_restore_policy_rq;
extern fiid_template_t tmpl_cmd_set_power_restore_policy_rs;
extern fiid_template_t tmpl_cmd_set_power_cycle_interval_rq;
extern fiid_template_t tmpl_cmd_set_power_cycle_interval_rs;
extern fiid_template_t tmpl_cmd_get_system_restart_cause_rq;
extern fiid_template_t tmpl_cmd_get_system_restart_cause_rs;
extern fiid_template_t tmpl_cmd_set_system_boot_options_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_rs;
extern fiid_template_t tmpl_cmd_set_system_boot_options_set_in_progress_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_service_partition_selector_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_service_partition_scan_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_BMC_boot_flag_valid_bit_clearing_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_info_acknowledge_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_flags_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_initiator_info_rq;
extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_initiator_mailbox_rq;
extern fiid_template_t tmpl_cmd_get_system_boot_options_rq;
extern fiid_template_t tmpl_cmd_get_system_boot_options_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_set_in_progress_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_service_partition_selector_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_service_partition_scan_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_BMC_boot_flag_valid_bit_clearing_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_info_acknowledge_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_flags_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_initiator_info_rs;
extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_initiator_mailbox_rs;
extern fiid_template_t tmpl_cmd_get_power_on_hours_counter_rq;
extern fiid_template_t tmpl_cmd_get_power_on_hours_counter_rs;
int fill_cmd_get_chassis_capabilities (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_chassis_status (fiid_obj_t obj_cmd_rq);
int fill_cmd_chassis_control (uint8_t chassis_control,
fiid_obj_t obj_cmd_rq);
int fill_cmd_chassis_identify (const uint8_t *identify_interval,
const uint8_t *force_identify,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_front_panel_enables (uint8_t disable_power_off_button_for_power_off_only,
uint8_t disable_reset_button,
uint8_t disable_diagnostic_interrupt_button,
uint8_t disable_standby_button_for_entering_standby,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_power_restore_policy (uint8_t power_restore_policy,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_power_cycle_interval (uint8_t interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_system_restart_cause (fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options (uint8_t parameter_selector,
uint8_t parameter_valid,
const void *configuration_parameter_data,
unsigned int configuration_parameter_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_set_in_progress (uint8_t parameter_valid,
uint8_t state,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_service_partition_selector (uint8_t parameter_valid,
uint8_t service_partition_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_service_partition_scan (uint8_t parameter_valid,
uint8_t service_partition_discovered,
uint8_t service_partition_scan,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_BMC_boot_flag_valid_bit_clearing (uint8_t parameter_valid,
uint8_t dont_clear_on_power_up,
uint8_t dont_clear_on_pushbutton_or_soft_reset,
uint8_t dont_clear_on_watchdog_timeout,
uint8_t dont_clear_on_chassis_control,
uint8_t dont_clear_on_PEF,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_boot_info_acknowledge (uint8_t parameter_valid,
const uint8_t *bios_or_post_handled_boot_info,
const uint8_t *os_loader_handled_boot_info,
const uint8_t *os_or_service_partition_handled_boot_info,
const uint8_t *sms_handled_boot_info,
const uint8_t *oem_handled_boot_info,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_boot_flags (uint8_t parameter_valid,
uint8_t bios_boot_type,
uint8_t boot_flags_persistent,
uint8_t boot_flags_valid,
uint8_t lock_out_reset_button,
uint8_t screen_blank,
uint8_t boot_device,
uint8_t lock_keyboard,
uint8_t clear_cmos,
uint8_t console_redirection,
uint8_t lock_out_sleep_button,
uint8_t user_password_bypass,
uint8_t force_progress_event_traps,
uint8_t firmware_bios_verbosity,
uint8_t lock_out_via_power_button,
uint8_t bios_mux_control_override,
uint8_t bios_shared_mode_override,
uint8_t device_instance_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_boot_initiator_info (uint8_t parameter_valid,
uint8_t boot_source_channel_number,
uint32_t session_id,
uint32_t boot_info_timestamp,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_boot_options_boot_initiator_mailbox (uint8_t parameter_valid,
uint8_t set_selector,
const void *block_data,
unsigned int block_data_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_system_boot_options (uint8_t parameter_selector,
uint8_t set_selector,
uint8_t block_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_power_on_hours_counter (fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_CHASSIS_CMDS_H */

View File

@ -0,0 +1,342 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*****************************************************************************\
* Copyright (C) 2009-2015 Lawrence Livermore National Security, LLC.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Albert Chu <chu11@llnl.gov>
* LLNL-CODE-413270
*
* This file is part of Ipmi-Dcmi, tools and libraries to support the
* data center manageability interface (DCMI). For details, see
* http://www.llnl.gov/linux/.
*
* Ipmi-Dcmi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* Ipmi-Dcmi is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with Ipmi-Dcmi. If not, see <http://www.gnu.org/licenses/>.
\*****************************************************************************/
#ifndef IPMI_DCMI_CMDS_H
#define IPMI_DCMI_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_SUPPORTED_DCMI_CAPABILITIES 0x01
#define IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_MANDATORY_PLATFORM_ATTRIBUTES 0x02
#define IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_OPTIONAL_PLATFORM_ATTRIBUTES 0x03
#define IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_MANAGEABILITY_ACCESS_ATTRIBUTES 0x04
#define IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_ENHANCED_SYSTEM_POWER_STATISTICS_ATTRIBUTES 0x05
#define IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_SELECTOR_VALID(__parameter_selector) \
((((__parameter_selector)) >= (IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_SUPPORTED_DCMI_CAPABILITIES) && \
((__parameter_selector)) <= (IPMI_DCMI_CAPABILITIES_INFO_PARAMETER_ENHANCED_SYSTEM_POWER_STATISTICS_ATTRIBUTES)) ? 1 : 0)
#define IPMI_DCMI_AVAILABLE 0x1
#define IPMI_DCMI_NOT_PRESENT 0x0
#define IPMI_DCMI_AVAILABLE 0x1
#define IPMI_DCMI_AT_LEAST_1_PRESENT 0x1
#define IPMI_DCMI_NOT_PRESENT 0x0
#define IPMI_DCMI_CHANNEL_NOT_SUPPORTED 0xFF
#define IPMI_DCMI_TIME_DURATION_UNITS_SECONDS 0x00
#define IPMI_DCMI_TIME_DURATION_UNITS_MINUTES 0x01
#define IPMI_DCMI_TIME_DURATION_UNITS_HOURS 0x02
#define IPMI_DCMI_TIME_DURATION_UNITS_DAYS 0x03
#define IPMI_DCMI_CONFIGURATION_PARAMETER_ACTIVATE_DHCP 0x01
#define IPMI_DCMI_CONFIGURATION_PARAMETER_DISCOVERY_CONFIGURATION 0x02
#define IPMI_DCMI_CONFIGURATION_PARAMETER_DHCP_TIMING_1 0x03
#define IPMI_DCMI_CONFIGURATION_PARAMETER_DHCP_TIMING_2 0x04
#define IPMI_DCMI_CONFIGURATION_PARAMETER_DHCP_TIMING_3 0x05
#define IPMI_DCMI_CONFIGURATION_PARAMETER_SELECTOR_VALID(__parameter_selector) \
((((__parameter_selector)) >= (IPMI_DCMI_CONFIGURATION_PARAMETER_ACTIVATE_DHCP) && \
((__parameter_selector)) <= (IPMI_DCMI_CONFIGURATION_PARAMETER_DHCP_TIMING_3)) ? 1 : 0)
#define IPMI_DCMI_DHCP_ACTIVATE 0x01
#define IPMI_DCMI_DHCP_INCLUDE_OPTION 0x01
#define IPMI_DCMI_DHCP_DO_NOT_INCLUDE_OPTION 0x00
#define IPMI_DCMI_DHCP_INCLUDE_OPTION_VALID(__val) \
((((__val)) == IPMI_DCMI_DHCP_INCLUDE_OPTION && \
((__val)) == IPMI_DCMI_DHCP_DO_NOT_INCLUDE_OPTION) ? 1 : 0)
#define IPMI_DCMI_DHCP_RANDOM_BACK_OFF_ENABLE 0x01
#define IPMI_DCMI_DHCP_RANDOM_BACK_OFF_DISABLE 0x00
#define IPMI_DCMI_DHCP_RANDOM_BACK_OFF_VALID(__val) \
((((__val)) == IPMI_DCMI_DHCP_RANDOM_BACK_OFF_ENABLE && \
((__val)) == IPMI_DCMI_DHCP_RANDOM_BACK_OFF_DISABLE) ? 1 : 0)
#define IPMI_DCMI_ASSET_TAG_NUMBER_OF_BYTES_TO_READ_MAX 16
#define IPMI_DCMI_ASSET_TAG_NUMBER_OF_BYTES_TO_WRITE_MAX 16
#define IPMI_DCMI_MAX_ASSET_TAG_LENGTH 63
#define IPMI_DCMI_ASSET_TAG_UTF8_BOM_BYTE0 0xEF
#define IPMI_DCMI_ASSET_TAG_UTF8_BOM_BYTE1 0xBB
#define IPMI_DCMI_ASSET_TAG_UTF8_BOM_BYTE2 0xBF
#define IPMI_DCMI_MANAGEMENT_CONTROLLER_IDENTIFIER_STRING_NUMBER_OF_BYTES_TO_READ_MAX 16
#define IPMI_DCMI_MANAGEMENT_CONTROLLER_IDENTIFIER_STRING_NUMBER_OF_BYTES_TO_WRITE_MAX 16
/* length includes NUL byte */
#define IPMI_DCMI_MAX_MANAGEMENT_CONTROLLER_IDENTIFIER_STRING_LENGTH 64
#define IPMI_DCMI_ENTITY_ID_INLET_TEMPERATURE 0x40
#define IPMI_DCMI_ENTITY_ID_CPU_TEMPERATURE 0x41
#define IPMI_DCMI_ENTITY_ID_BASEBOARD_TEMPERATURE 0x42
#define IPMI_DCMI_ENTITY_ID_INLET_TEMPERATURE_STR "Inlet Temperature"
#define IPMI_DCMI_ENTITY_ID_CPU_TEMPERATURE_STR "CPU Temperature"
#define IPMI_DCMI_ENTITY_ID_BASEBOARD_TEMPERATURE_STR "Baseboard temperature"
#define IPMI_DCMI_ENTITY_ID_VALID(__entity_id) \
(((__entity_id) == IPMI_DCMI_ENTITY_ID_INLET_TEMPERATURE \
|| (__entity_id) == IPMI_DCMI_ENTITY_ID_CPU_TEMPERATURE \
|| (__entity_id) == IPMI_DCMI_ENTITY_ID_BASEBOARD_TEMPERATURE) ? 1 : 0)
#define IPMI_DCMI_ENTITY_INSTANCE_ALL 0x00
#define IPMI_DCMI_POWER_READING_MODE_SYSTEM_POWER_STATISTICS 0x01
#define IPMI_DCMI_POWER_READING_MODE_POWER_STATISTICS IPMI_DCMI_POWER_READING_MODE_SYSTEM_POWER_STATISTICS
#define IPMI_DCMI_POWER_READING_MODE_ENHANCED_SYSTEM_POWER_STATISTICS 0x02
/* spec only lists one mode right now, assume there can/will be more in the future */
#define IPMI_DCMI_POWER_READING_MODE_VALID(__mode) \
(((__mode) == IPMI_DCMI_POWER_READING_MODE_POWER_STATISTICS \
|| (__mode) == IPMI_DCMI_POWER_READING_MODE_ENHANCED_SYSTEM_POWER_STATISTICS) ? 1 : 0)
#define IPMI_DCMI_POWER_READING_STATE_POWER_MEASUREMENT_ACTIVE 0x1
#define IPMI_DCMI_POWER_READING_STATE_NO_POWER_MEASUREMENT_AVAILABLE 0x0
/* HLiebig: specific value, not a bitmask */
/* With power limit commands */
#define IPMI_DCMI_EXCEPTION_ACTION_NO_ACTION 0x00
#define IPMI_DCMI_EXCEPTION_ACTION_HARD_POWER_OFF_SYSTEM 0x01
#define IPMI_DCMI_EXCEPTION_ACTION_OEM_MIN 0x02
#define IPMI_DCMI_EXCEPTION_ACTION_OEM_MAX 0x10
#define IPMI_DCMI_EXCEPTION_ACTION_LOG_EVENT_TO_SEL_ONLY 0x11
/* With thermal limit commands */
#define IPMI_DCMI_EXCEPTION_ACTION_BIT_ON 1
#define IPMI_DCMI_EXCEPTION_ACTION_BIT_OFF 0
#define IPMI_DCMI_EXCEPTION_ACTION_BIT_VALID(__bit) \
(((__bit) == IPMI_DCMI_EXCEPTION_ACTION_BIT_ON \
|| (__bit) == IPMI_DCMI_EXCEPTION_ACTION_BIT_OFF) ? 1 : 0)
/* achu: it's an 8 bit field, why not allow all 8 bitmasks? Beats
* me, that's what's in the spec
*/
#define IPMI_DCMI_EXCEPTION_ACTIONS_MIN 0x00
#define IPMI_DCMI_EXCEPTION_ACTIONS_MAX 0x1F
#define IPMI_DCMI_POWER_LIMIT_REQUESTED_MIN 0x0000
#define IPMI_DCMI_POWER_LIMIT_REQUESTED_MAX 0xFFFF
#define IPMI_DCMI_CORRECTION_TIME_LIMIT_MIN 0x00000000
#define IPMI_DCMI_CORRECTION_TIME_LIMIT_MAX 0xFFFFFFFF
#define IPMI_DCMI_MANAGEMENT_APPLICATION_STATISTICS_SAMPLING_PERIOD_MIN 0x0000
#define IPMI_DCMI_MANAGEMENT_APPLICATION_STATISTICS_SAMPLING_PERIOD_MAX 0xFFFF
#define IPMI_DCMI_EXCEPTION_ACTION_VALID(__exception_action) \
(((__exception_action) == IPMI_DCMI_EXCEPTION_ACTION_NO_ACTION \
|| (__exception_action) == IPMI_DCMI_EXCEPTION_ACTION_HARD_POWER_OFF_SYSTEM \
|| (__exception_action) == IPMI_DCMI_EXCEPTION_ACTION_LOG_EVENT_TO_SEL_ONLY \
|| ((__exception_action) >= IPMI_DCMI_EXCEPTION_ACTION_OEM_MIN && (__exception_action) <= IPMI_DCMI_EXCEPTION_ACTION_OEM_MAX)) ? 1 : 0)
#define IPMI_DCMI_POWER_LIMIT_ACTIVATION_DEACTIVATE_POWER_LIMIT 0x0
#define IPMI_DCMI_POWER_LIMIT_ACTIVATION_ACTIVATE_POWER_LIMIT 0x1
#define IPMI_DCMI_POWER_LIMIT_ACTIVATION_VALID(__power_limit_activation) \
(((__power_limit_activation) == IPMI_DCMI_POWER_LIMIT_ACTIVATION_DEACTIVATE_POWER_LIMIT \
|| (__power_limit_activation) == IPMI_DCMI_POWER_LIMIT_ACTIVATION_ACTIVATE_POWER_LIMIT) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_dcmi_rolling_average_time_period;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_capability_info_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_capability_info_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_capability_info_supported_dcmi_capabilities_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_capability_info_mandatory_platform_attributes_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_capability_info_optional_platform_attributes_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_capability_info_manageability_access_attributes_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_capability_info_enhanced_system_power_statistics_attributes_rs;
extern fiid_template_t tmpl_cmd_dcmi_set_dcmi_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_dcmi_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_dcmi_set_dcmi_configuration_parameters_activate_dhcp_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_dcmi_configuration_parameters_discovery_configuration_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_1_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_2_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_3_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_configuration_parameters_discovery_configuration_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_configuration_parameters_dhcp_timing_1_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_configuration_parameters_dhcp_timing_2_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_configuration_parameters_dhcp_timing_3_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_asset_tag_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_asset_tag_rs;
extern fiid_template_t tmpl_cmd_dcmi_set_asset_tag_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_asset_tag_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_management_controller_identifier_string_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_management_controller_identifier_string_rs;
extern fiid_template_t tmpl_cmd_dcmi_set_management_controller_identifier_string_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_management_controller_identifier_string_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_sensor_info_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_dcmi_sensor_info_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_power_reading_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_power_reading_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_power_limit_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_power_limit_rs;
extern fiid_template_t tmpl_cmd_dcmi_set_power_limit_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_power_limit_rs;
extern fiid_template_t tmpl_cmd_dcmi_activate_deactivate_power_limit_rq;
extern fiid_template_t tmpl_cmd_dcmi_activate_deactivate_power_limit_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_thermal_limit_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_thermal_limit_rs;
extern fiid_template_t tmpl_cmd_dcmi_set_thermal_limit_rq;
extern fiid_template_t tmpl_cmd_dcmi_set_thermal_limit_rs;
extern fiid_template_t tmpl_cmd_dcmi_get_temperature_reading_rq;
extern fiid_template_t tmpl_cmd_dcmi_get_temperature_reading_rs;
int fill_cmd_dcmi_get_dcmi_capability_info (uint8_t parameter_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_dcmi_configuration_parameters (uint8_t parameter_selector,
uint8_t set_selector,
const void *configuration_parameter_data,
unsigned int configuration_parameter_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_dcmi_configuration_parameters_activate_dhcp (uint8_t set_selector,
uint8_t activate,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_dcmi_configuration_parameters_discovery_configuration (uint8_t set_selector,
uint8_t option_12,
uint8_t option_60_with_option_43,
uint8_t random_back_off,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_1 (uint8_t set_selector,
uint8_t initial_timeout_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_2 (uint8_t set_selector,
uint16_t server_contact_timeout_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_dcmi_configuration_parameters_dhcp_timing_3 (uint8_t set_selector,
uint16_t server_contact_retry_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_dcmi_configuration_parameters (uint8_t parameter_selector,
uint8_t set_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_asset_tag (uint8_t offset_to_read,
uint8_t number_of_bytes_to_read,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_asset_tag (uint8_t offset_to_write,
uint8_t number_of_bytes_to_write,
const void *data,
unsigned int data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_management_controller_identifier_string (uint8_t offset_to_read,
uint8_t number_of_bytes_to_read,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_management_controller_identifier_string (uint8_t offset_to_write,
uint8_t number_of_bytes_to_write,
const void *data,
unsigned int data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_dcmi_sensor_info (uint8_t sensor_type,
uint8_t entity_id,
uint8_t entity_instance,
uint8_t entity_instance_start,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_power_reading (uint8_t mode,
uint8_t mode_attributes,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_power_limit (fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_power_limit (uint8_t exception_actions,
uint16_t power_limit_requested,
uint32_t correction_time_limit,
uint16_t management_application_statistics_sampling_period,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_activate_deactivate_power_limit (uint8_t power_limit_activation,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_thermal_limit (uint8_t entity_id,
uint8_t entity_instance,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_set_thermal_limit (uint8_t entity_id,
uint8_t entity_instance,
uint8_t temperature_limit,
uint8_t exception_actions_log_event_to_sel_only,
uint8_t exception_actions_hard_power_off_system_and_log_event,
uint16_t exception_time,
fiid_obj_t obj_cmd_rq);
int fill_cmd_dcmi_get_temperature_reading (uint8_t sensor_type,
uint8_t entity_id,
uint8_t entity_instance,
uint8_t entity_instance_start,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_DCMI_CMDS_H */

View File

@ -0,0 +1,33 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_DCMI_OEM_CMDS_H
#define IPMI_DCMI_OEM_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifdef __cplusplus
}
#endif
#endif /* IPMI_DCMI_OEM_CMDS_H */

View File

@ -0,0 +1,155 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_DEVICE_GLOBAL_CMDS_H
#define IPMI_DEVICE_GLOBAL_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_DEVICE_ID_UNSPECIFIED 0x00
#define IPMI_MANUFACTURER_ID_UNSPECIFIED 0x000000
#define IPMI_MANUFACTURER_ID_RESERVED 0x0FFFFF
#define IPMI_1_5_MAJOR_VERSION 1
#define IPMI_1_5_MINOR_VERSION 5
#define IPMI_2_0_MAJOR_VERSION 2
#define IPMI_2_0_MINOR_VERSION 0
#define IPMI_SELF_TEST_RESULT_NO_ERROR 0x55
#define IPMI_SELF_TEST_RESULT_SELF_TEST_FUNCTION_NOT_IMPLEMENTED_IN_THIS_CONTROLLER 0x56
#define IPMI_SELF_TEST_RESULT_CORRUPTED_OR_INACCESSIBLE_DATA_OR_DEVICES 0x57
#define IPMI_SELF_TEST_RESULT_FATAL_HARDWARE_ERROR 0x58
#define IPMI_ACPI_SYSTEM_POWER_STATE_S0_G0 0x00
#define IPMI_ACPI_SYSTEM_POWER_STATE_S1 0x01
#define IPMI_ACPI_SYSTEM_POWER_STATE_S2 0x02
#define IPMI_ACPI_SYSTEM_POWER_STATE_S3 0x03
#define IPMI_ACPI_SYSTEM_POWER_STATE_S4 0x04
#define IPMI_ACPI_SYSTEM_POWER_STATE_S5_G2 0x05
#define IPMI_ACPI_SYSTEM_POWER_STATE_S4_S5 0x06
#define IPMI_ACPI_SYSTEM_POWER_STATE_G3 0x07
#define IPMI_ACPI_SYSTEM_POWER_STATE_SLEEPING 0x08
#define IPMI_ACPI_SYSTEM_POWER_STATE_G1_SLEEPING 0x09
#define IPMI_ACPI_SYSTEM_POWER_STATE_OVERRIDE 0x0A
#define IPMI_ACPI_SYSTEM_POWER_STATE_LEGACY_ON 0x20
#define IPMI_ACPI_SYSTEM_POWER_STATE_LEGACY_OFF 0x21
#define IPMI_ACPI_SYSTEM_POWER_STATE_UNKNOWN 0x2A
#define IPMI_ACPI_SYSTEM_POWER_STATE_NO_CHANGE 0x7F
#define IPMI_ACPI_SYSTEM_POWER_STATE_VALID(__acpi_system_power_state) \
(((__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_S0_G0 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_S1 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_S2 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_S3 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_S4 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_S5_G2 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_S4_S5 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_G3 \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_SLEEPING \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_G1_SLEEPING \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_OVERRIDE \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_LEGACY_ON \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_LEGACY_OFF \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_UNKNOWN \
|| (__acpi_system_power_state) == IPMI_ACPI_SYSTEM_POWER_STATE_NO_CHANGE) ? 1 : 0)
#define IPMI_ACPI_SET_SYSTEM_POWER_STATE_SET_SYSTEM_POWER_STATE 0x1
#define IPMI_ACPI_SET_SYSTEM_POWER_STATE_DONT_SET_SYSTEM_POWER_STATE 0x0
#define IPMI_ACPI_SET_SYSTEM_POWER_STATE_VALID(__set_system_power_state) \
(((__set_system_power_state) == IPMI_ACPI_SET_SYSTEM_POWER_STATE_SET_SYSTEM_POWER_STATE \
|| (__set_system_power_state) == IPMI_ACPI_SET_SYSTEM_POWER_STATE_DONT_SET_SYSTEM_POWER_STATE) ? 1 : 0)
#define IPMI_ACPI_DEVICE_POWER_STATE_D0 0x00
#define IPMI_ACPI_DEVICE_POWER_STATE_D1 0x01
#define IPMI_ACPI_DEVICE_POWER_STATE_D2 0x02
#define IPMI_ACPI_DEVICE_POWER_STATE_D3 0x03
#define IPMI_ACPI_DEVICE_POWER_STATE_UNKNOWN 0x2A
#define IPMI_ACPI_DEVICE_POWER_STATE_NO_CHANGE 0x7F
#define IPMI_ACPI_DEVICE_POWER_STATE_VALID(__acpi_device_power_state) \
(((__acpi_device_power_state) == IPMI_ACPI_DEVICE_POWER_STATE_D0 \
|| (__acpi_device_power_state) == IPMI_ACPI_DEVICE_POWER_STATE_D1 \
|| (__acpi_device_power_state) == IPMI_ACPI_DEVICE_POWER_STATE_D2 \
|| (__acpi_device_power_state) == IPMI_ACPI_DEVICE_POWER_STATE_D3 \
|| (__acpi_device_power_state) == IPMI_ACPI_DEVICE_POWER_STATE_UNKNOWN \
|| (__acpi_device_power_state) == IPMI_ACPI_DEVICE_POWER_STATE_NO_CHANGE) ? 1 : 0)
#define IPMI_ACPI_SET_DEVICE_POWER_STATE_SET_DEVICE_POWER_STATE 0x1
#define IPMI_ACPI_SET_DEVICE_POWER_STATE_DONT_SET_DEVICE_POWER_STATE 0x0
#define IPMI_ACPI_SET_DEVICE_POWER_STATE_VALID(__set_device_power_state) \
(((__set_device_power_state) == IPMI_ACPI_SET_DEVICE_POWER_STATE_SET_DEVICE_POWER_STATE \
|| (__set_device_power_state) == IPMI_ACPI_SET_DEVICE_POWER_STATE_DONT_SET_DEVICE_POWER_STATE) ? 1 : 0)
#define IPMI_SYSTEM_GUID_LENGTH 16
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_device_id_rq;
extern fiid_template_t tmpl_cmd_get_device_id_rs;
extern fiid_template_t tmpl_cmd_cold_reset_rq;
extern fiid_template_t tmpl_cmd_cold_reset_rs;
extern fiid_template_t tmpl_cmd_warm_reset_rq;
extern fiid_template_t tmpl_cmd_warm_reset_rs;
extern fiid_template_t tmpl_cmd_get_self_test_results_rq;
extern fiid_template_t tmpl_cmd_get_self_test_results_rs;
extern fiid_template_t tmpl_cmd_set_acpi_power_state_rq;
extern fiid_template_t tmpl_cmd_set_acpi_power_state_rs;
extern fiid_template_t tmpl_cmd_get_acpi_power_state_rq;
extern fiid_template_t tmpl_cmd_get_acpi_power_state_rs;
extern fiid_template_t tmpl_cmd_get_device_guid_rq;
extern fiid_template_t tmpl_cmd_get_device_guid_rs;
extern fiid_template_t tmpl_cmd_get_device_guid_format_rs;
int fill_cmd_get_device_id (fiid_obj_t obj_cmd_rq);
int fill_cmd_cold_reset (fiid_obj_t obj_cmd_rq);
int fill_cmd_warm_reset (fiid_obj_t obj_cmd_rq);
int fill_cmd_set_acpi_power_state (uint8_t system_power_state_enumeration,
uint8_t set_system_power_state,
uint8_t device_power_state_enumeration,
uint8_t set_device_power_state,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_acpi_power_state (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_self_test_results (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_device_guid (fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_DEVICE_GLOBAL_CMDS_H */

View File

@ -0,0 +1,69 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_EVENT_CMDS_H
#define IPMI_EVENT_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_set_event_receiver_rq;
extern fiid_template_t tmpl_cmd_set_event_receiver_rs;
extern fiid_template_t tmpl_cmd_get_event_receiver_rq;
extern fiid_template_t tmpl_cmd_get_event_receiver_rs;
extern fiid_template_t tmpl_cmd_platform_event_rq;
extern fiid_template_t tmpl_cmd_platform_event_rs;
int fill_cmd_set_event_receiver (uint8_t event_receiver_slave_address,
uint8_t event_receiver_lun,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_event_receiver (fiid_obj_t obj_cmd_rq);
/* generator_id is optional */
int fill_cmd_platform_event (uint8_t *generator_id,
uint8_t event_message_format_version,
uint8_t sensor_type,
uint8_t sensor_number,
uint8_t event_type_code,
uint8_t event_dir,
uint8_t event_data1,
uint8_t event_data2,
uint8_t event_data3,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_EVENT_CMDS_H */

View File

@ -0,0 +1,197 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_CMDS_H
#define IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_NETFN_LUN_SUPPORT_NO_COMMANDS_SUPPORTED 0x0
#define IPMI_NETFN_LUN_SUPPORT_COMMANDS_FOLLOW_BASE_IPMI_SPECIFICATION 0x1
#define IPMI_NETFN_LUN_SUPPORT_COMMANDS_EXIST_ON_LUN 0x2
#define IPMI_NETFN_PAIR_IS_NOT_USED 0x0
#define IPMI_NETFN_PAIR_IS_USED 0x1
#define IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_OPERATION_00H_TO_7FH 0x0
#define IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_OPERATION_80H_TO_FFH 0x1
#define IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_OPERATION_VALID(__val) \
(((__val) == IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_OPERATION_00H_TO_7FH \
|| (__val) == IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_OPERATION_80H_TO_FFH) ? 1 : 0)
/* achu: Yes, this one is backwards. I don't know why */
#define IPMI_COMMAND_AVAILABLE 0x0
#define IPMI_COMMAND_UNAVAILABLE 0x1
/* achu: Yes, this one is backwards. I don't know why */
#define IPMI_SUB_FUNCTION_AVAILABLE 0x0
#define IPMI_SUB_FUNCTION_UNAVAILABLE 0x1
#define IPMI_COMMAND_NOT_CONFIGURABLE 0x0
#define IPMI_COMMAND_CAN_BE_ENABLED_DISABLED 0x1
#define IPMI_SUB_FUNCTION_NOT_CONFIGURABLE 0x0
#define IPMI_SUB_FUNCTION_CAN_BE_ENABLED_DISABLED 0x1
#define IPMI_COMMAND_DISABLED_OR_NOT_SUPPORTED 0x0
#define IPMI_COMMAND_ENABLED 0x1
#define IPMI_SUB_FUNCTION_DISABLED_OR_NOT_SUPPORTED 0x0
#define IPMI_SUB_FUNCTION_ENABLED 0x1
#define IPMI_SPECIFICATION_TYPE_IPMI 0x0
#define IPMI_SPECIFICATION_TYPE_IPMB 0x1
#define IPMI_SPECIFICATION_TYPE_ICMB 0x2
#define IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_ENABLE_DISABLE_BITMASK_LEN 16
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_netfn_support_rq;
extern fiid_template_t tmpl_cmd_get_netfn_support_rs;
extern fiid_template_t tmpl_cmd_get_command_support_rq;
extern fiid_template_t tmpl_cmd_get_command_support_rs;
extern fiid_template_t tmpl_cmd_get_command_sub_function_support_rq;
extern fiid_template_t tmpl_cmd_get_command_sub_function_support_specification_errata_rs;
extern fiid_template_t tmpl_cmd_get_command_sub_function_support_extension_errata_rs;
extern fiid_template_t tmpl_cmd_get_configurable_commands_rq;
extern fiid_template_t tmpl_cmd_get_configurable_commands_rs;
extern fiid_template_t tmpl_cmd_get_configurable_command_sub_functions_rq;
extern fiid_template_t tmpl_cmd_get_configurable_command_sub_functions_rs;
extern fiid_template_t tmpl_cmd_set_command_enables_rq;
extern fiid_template_t tmpl_cmd_set_command_enables_rs;
extern fiid_template_t tmpl_cmd_get_command_enables_rq;
extern fiid_template_t tmpl_cmd_get_command_enables_rs;
extern fiid_template_t tmpl_cmd_set_command_sub_function_enables_rq;
extern fiid_template_t tmpl_cmd_set_command_sub_function_enables_defining_body_code_rq;
extern fiid_template_t tmpl_cmd_set_command_sub_function_enables_oem_iana_rq;
extern fiid_template_t tmpl_cmd_set_command_sub_function_enables_rs;
extern fiid_template_t tmpl_cmd_get_command_sub_function_enables_rq;
extern fiid_template_t tmpl_cmd_get_command_sub_function_enables_rs;
extern fiid_template_t tmpl_cmd_get_oem_netfn_iana_support_rq;
extern fiid_template_t tmpl_cmd_get_oem_netfn_iana_support_rs;
int fill_cmd_get_netfn_support (uint8_t channel_number,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_command_support (uint8_t channel_number,
uint8_t net_fn,
uint8_t operation,
uint8_t lun,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_command_sub_function_support (uint8_t channel_number,
uint8_t net_fn,
uint8_t lun,
uint8_t command,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_configurable_commands (uint8_t channel_number,
uint8_t net_fn,
uint8_t operation,
uint8_t lun,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_configurable_command_sub_functions (uint8_t channel_number,
uint8_t net_fn,
uint8_t lun,
uint8_t command,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_command_enables (uint8_t channel_number,
uint8_t net_fn,
uint8_t operation,
uint8_t lun,
uint8_t *enable_disable_bitmask,
unsigned int enable_disable_bitmask_len,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_command_enables (uint8_t channel_number,
uint8_t net_fn,
uint8_t operation,
uint8_t lun,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_command_sub_function_enables (uint8_t channel_number,
uint8_t net_fn,
uint8_t lun,
uint8_t command,
uint32_t sub_function_enables1,
uint32_t *sub_function_enables2,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_command_sub_function_enables_defining_body_code (uint8_t channel_number,
uint8_t net_fn,
uint8_t lun,
uint8_t command,
uint8_t defining_body_code,
uint32_t sub_function_enables1,
uint32_t *sub_function_enables2,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_command_sub_function_enables_oem_iana (uint8_t channel_number,
uint8_t net_fn,
uint8_t lun,
uint8_t command,
uint32_t oem_iana,
uint32_t sub_function_enables1,
uint32_t *sub_function_enables2,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_command_sub_function_enables (uint8_t channel_number,
uint8_t net_fn,
uint8_t lun,
uint8_t command,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_oem_netfn_iana_support (uint8_t channel_number,
uint8_t net_fn,
uint8_t list_index,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_FIRMWARE_FIREWALL_COMMAND_DISCOVERY_CMDS_H */

View File

@ -0,0 +1,94 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/*****************************************************************************\
* Copyright (C) 2007-2015 Lawrence Livermore National Security, LLC.
* Copyright (C) 2007 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Albert Chu <chu11@llnl.gov>
* UCRL-CODE-232183
*
* This file is part of Ipmi-fru, a tool used for retrieving
* motherboard field replaceable unit (FRU) information. For details,
* see http://www.llnl.gov/linux/.
*
* Ipmi-fru is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* Ipmi-fru is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with Ipmi-fru. If not, see <http://www.gnu.org/licenses/>.
\*****************************************************************************/
#ifndef IPMI_FRU_INVENTORY_DEVICE_CMDS_H
#define IPMI_FRU_INVENTORY_DEVICE_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_FRU_DEVICE_ID_DEFAULT 0x00 /* FRU for Management Controller - Chap 38 */
#define IPMI_FRU_DEVICE_ID_RESERVED 0xFF
#define IPMI_FRU_DEVICE_ID_MIN 0x00
#define IPMI_FRU_DEVICE_ID_MAX 0xFE
#define IPMI_FRU_INVENTORY_AREA_SIZE_MAX 65536 /* 16 bit field for length */
#define IPMI_FRU_DATA_MAX 255
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_fru_inventory_area_info_rq;
extern fiid_template_t tmpl_cmd_get_fru_inventory_area_info_rs;
extern fiid_template_t tmpl_cmd_read_fru_data_rq;
extern fiid_template_t tmpl_cmd_read_fru_data_rs;
extern fiid_template_t tmpl_cmd_write_fru_data_rq;
extern fiid_template_t tmpl_cmd_write_fru_data_rs;
int fill_cmd_get_fru_inventory_area_info (uint8_t fru_device_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_read_fru_data (uint8_t fru_device_id,
uint16_t fru_inventory_offset_to_read,
uint8_t count_to_read,
fiid_obj_t obj_cmd_rq);
int fill_cmd_write_fru_data (uint8_t fru_device_id,
uint16_t fru_inventory_offset_to_write,
const void *data_to_write,
unsigned int data_to_write_len,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_FRU_INVENTORY_DEVICE_CMDS_H */

View File

@ -0,0 +1,399 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_LAN_CMDS_H
#define IPMI_LAN_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_LAN_CONFIGURATION_PARAMETERS_NO_SET_SELECTOR 0x0
#define IPMI_LAN_CONFIGURATION_PARAMETERS_NO_BLOCK_SELECTOR 0x0
#define IPMI_LAN_CONFIGURATION_PARAMETERS_SET_COMPLETE 0x00
#define IPMI_LAN_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS 0x01
#define IPMI_LAN_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE 0x02
#define IPMI_LAN_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS_VALID(__value) \
(((__value) == IPMI_LAN_CONFIGURATION_PARAMETERS_SET_COMPLETE \
|| (__value) == IPMI_LAN_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS \
|| (__value) == IPMI_LAN_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE) ? 1 : 0)
#define IPMI_AUTHENTICATION_TYPE_SUPPORTED 0x1
#define IPMI_AUTHENTICATION_TYPE_UNSUPPORTED 0x0
#define IPMI_AUTHENTICATION_TYPE_ENABLE 0x1
#define IPMI_AUTHENTICATION_TYPE_DISABLE 0x0
#define IPMI_AUTHENTICATION_TYPE_ENABLE_VALID(__val) \
(((__val) == IPMI_AUTHENTICATION_TYPE_ENABLE \
|| (__val) == IPMI_AUTHENTICATION_TYPE_DISABLE) ? 1 : 0)
#define IPMI_IP_ADDRESS_SOURCE_UNSPECIFIED 0x0
#define IPMI_IP_ADDRESS_SOURCE_STATIC 0x1
#define IPMI_IP_ADDRESS_SOURCE_DHCP 0x2
#define IPMI_IP_ADDRESS_SOURCE_BIOS 0x3
#define IPMI_IP_ADDRESS_SOURCE_OTHER 0x4
#define IPMI_IP_ADDRESS_SOURCE_VALID(__val) \
(((__val) == IPMI_IP_ADDRESS_SOURCE_UNSPECIFIED \
|| (__val) == IPMI_IP_ADDRESS_SOURCE_STATIC \
|| (__val) == IPMI_IP_ADDRESS_SOURCE_DHCP \
|| (__val) == IPMI_IP_ADDRESS_SOURCE_BIOS \
|| (__val) == IPMI_IP_ADDRESS_SOURCE_OTHER) ? 1 : 0)
#define IPMI_BMC_GENERATED_GRATUITOUS_ARPS_ENABLE 0x1
#define IPMI_BMC_GENERATED_GRATUITOUS_ARPS_DISABLE 0x0
#define IPMI_BMC_GENERATED_GRATUITOUS_ARPS_VALID(__val) \
(((__val) == IPMI_BMC_GENERATED_GRATUITOUS_ARPS_ENABLE \
|| (__val) == IPMI_BMC_GENERATED_GRATUITOUS_ARPS_DISABLE) ? 1 : 0)
#define IPMI_BMC_GENERATED_ARP_RESPONSES_ENABLE 0x1
#define IPMI_BMC_GENERATED_ARP_RESPONSES_DISABLE 0x0
#define IPMI_BMC_GENERATED_ARP_RESPONSES_VALID(__val) \
(((__val) == IPMI_BMC_GENERATED_ARP_RESPONSES_ENABLE \
|| (__val) == IPMI_BMC_GENERATED_ARP_RESPONSES_DISABLE) ? 1 : 0)
#define IPMI_MAX_COMMUNITY_STRING_LENGTH 18
#define IPMI_DESTINATION_SELECTOR_MIN 0
#define IPMI_DESTINATION_SELECTOR_MAX 15
/* To avoid gcc warnings, add +1 in comparison */
#define IPMI_DESTINATION_SELECTOR_VALID(__val) \
(((__val + 1) >= (IPMI_DESTINATION_SELECTOR_MIN + 1) \
|| (__val) <= IPMI_DESTINATION_SELECTOR_MAX) ? 1 : 0)
#define IPMI_DESTINATION_TYPE_PET_TRAP_DESTINATION 0x0
#define IPMI_DESTINATION_TYPE_OEM1 0x6
#define IPMI_DESTINATION_TYPE_OEM2 0x7
#define IPMI_DESTINATION_TYPE_VALID(__val) \
(((__val) == IPMI_DESTINATION_TYPE_PET_TRAP_DESTINATION \
|| (__val) == IPMI_DESTINATION_TYPE_OEM1 \
|| (__val) == IPMI_DESTINATION_TYPE_OEM2) ? 1 : 0)
#define IPMI_ALERT_UNACKNOWLEDGED 0
#define IPMI_ALERT_ACKNOWLEDGED 1
#define IPMI_ALERT_VALID(__val) \
(((__val) == IPMI_ALERT_UNACKNOWLEDGED \
|| (__val) == IPMI_ALERT_ACKNOWLEDGED) ? 1 : 0)
#define IPMI_ADDRESS_FORMAT_IPV4 0
#define IPMI_GATEWAY_SELECTOR_DEFAULT 0
#define IPMI_GATEWAY_SELECTOR_BACKUP 1
#define IPMI_GATEWAY_SELECTOR_VALID(__val) \
(((__val) == IPMI_GATEWAY_SELECTOR_DEFAULT \
|| (__val) == IPMI_GATEWAY_SELECTOR_BACKUP) ? 1 : 0)
/* 3 bit number */
#define IPMI_ALERT_RETRIES_MAX 7
#define IPMI_VLAN_ID_ENABLE 0x1
#define IPMI_VLAN_ID_DISABLE 0x0
#define IPMI_VLAN_ID_ENABLE_VALID(__val) \
(((__val) == IPMI_VLAN_ID_ENABLE \
|| (__val) == IPMI_VLAN_ID_DISABLE) ? 1 : 0)
#define IPMI_BMC_GENERATED_GRATUITOUS_ARP_DO_NOT_SUSPEND 0x0
#define IPMI_BMC_GENERATED_GRATUITOUS_ARP_SUSPEND 0x1
#define IPMI_BMC_GENERATED_GRATUITOUS_ARP_VALID(__val) \
(((__val) == IPMI_BMC_GENERATED_GRATUITOUS_ARP_DO_NOT_SUSPEND \
|| (__val) == IPMI_BMC_GENERATED_GRATUITOUS_ARP_SUSPEND) ? 1 : 0)
#define IPMI_BMC_GENERATED_ARP_RESPONSE_DO_NOT_SUSPEND 0x0
#define IPMI_BMC_GENERATED_ARP_RESPONSE_SUSPEND 0x1
#define IPMI_BMC_GENERATED_ARP_RESPONSE_VALID(__val) \
(((__val) == IPMI_BMC_GENERATED_ARP_RESPONSE_DO_NOT_SUSPEND \
|| (__val) == IPMI_BMC_GENERATED_ARP_RESPONSE_SUSPEND) ? 1 : 0)
#define IPMI_USER_DISABLED_EVENT_MESSAGE_ON 0x1
#define IPMI_USER_DISABLED_EVENT_MESSAGE_OFF 0x0
#define IPMI_USER_DISABLED_EVENT_MESSAGE_VALID(__val) \
(((__val) == IPMI_USER_DISABLED_EVENT_MESSAGE_ON \
|| (__val) == IPMI_USER_DISABLED_EVENT_MESSAGE_OFF) ? 1 : 0)
#define IPMI_GET_LAN_PARAMETER 0x0
#define IPMI_GET_LAN_PARAMETER_REVISION_ONLY 0x1
#define IPMI_GET_LAN_PARAMETER_VALID(__val) \
(((__val) == IPMI_GET_LAN_PARAMETER \
|| (__val) == IPMI_GET_LAN_PARAMETER_REVISION_ONLY) ? 1 : 0)
#define IPMI_CLEAR_ALL_STATISTICS 0x1
#define IPMI_DONT_CLEAR_ALL_STATISTICS 0x0
#define IPMI_CLEAR_ALL_STATISTICS_VALID(__val) \
(((__val) == IPMI_CLEAR_ALL_STATISTICS \
|| (__val) == IPMI_DONT_CLEAR_ALL_STATISTICS) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_set_in_progress_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_authentication_type_enables_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_ip_address_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_ip_address_source_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_mac_address_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_subnet_mask_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_ipv4_header_parameters_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_primary_rmcp_port_number_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_secondary_rmcp_port_number_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_bmc_generated_arp_control_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_gratuitous_arp_interval_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_default_gateway_address_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_default_gateway_mac_address_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_backup_gateway_address_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_backup_gateway_mac_address_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_community_string_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_destination_type_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_destination_addresses_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_vlan_id_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_vlan_priority_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_rmcpplus_messaging_cipher_suite_privilege_levels_rq;
extern fiid_template_t tmpl_cmd_set_lan_configuration_parameters_bad_password_threshold_rq;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_set_in_progress_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_authentication_type_support_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_authentication_type_enables_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ip_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ip_address_source_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_mac_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_subnet_mask_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_ipv4_header_parameters_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_primary_rmcp_port_number_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_secondary_rmcp_port_number_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_bmc_generated_arp_control_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_gratuitous_arp_interval_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_default_gateway_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_default_gateway_mac_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_backup_gateway_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_backup_gateway_mac_address_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_community_string_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_number_of_destinations_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_destination_type_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_destination_addresses_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_vlan_id_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_vlan_priority_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rmcpplus_messaging_cipher_suite_entry_support_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rmcpplus_messaging_cipher_suite_entries_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_rmcpplus_messaging_cipher_suite_privilege_levels_rs;
extern fiid_template_t tmpl_cmd_get_lan_configuration_parameters_bad_password_threshold_rs;
extern fiid_template_t tmpl_cmd_suspend_bmc_arps_rq;
extern fiid_template_t tmpl_cmd_suspend_bmc_arps_rs;
extern fiid_template_t tmpl_cmd_get_ip_udp_rmcp_statistics_rq;
extern fiid_template_t tmpl_cmd_get_ip_udp_rmcp_statistics_rs;
int fill_cmd_set_lan_configuration_parameters (uint8_t channel_number,
uint8_t parameter_selector,
const void *configuration_parameter_data,
unsigned int configuration_parameter_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_set_in_progress (uint8_t channel_number,
uint8_t state,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_authentication_type_enables (uint8_t channel_number,
uint8_t callback_level_none,
uint8_t callback_level_md2,
uint8_t callback_level_md5,
uint8_t callback_level_straight_password,
uint8_t callback_level_oem_proprietary,
uint8_t user_level_none,
uint8_t user_level_md2,
uint8_t user_level_md5,
uint8_t user_level_straight_password,
uint8_t user_level_oem_proprietary,
uint8_t operator_level_none,
uint8_t operator_level_md2,
uint8_t operator_level_md5,
uint8_t operator_level_straight_password,
uint8_t operator_level_oem_proprietary,
uint8_t admin_level_none,
uint8_t admin_level_md2,
uint8_t admin_level_md5,
uint8_t admin_level_straight_password,
uint8_t admin_level_oem_proprietary,
uint8_t oem_level_none,
uint8_t oem_level_md2,
uint8_t oem_level_md5,
uint8_t oem_level_straight_password,
uint8_t oem_level_oem_proprietary,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_ip_address (uint8_t channel_number,
uint32_t ip_address,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_ip_address_source (uint8_t channel_number,
uint8_t ip_address_source,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_mac_address (uint8_t channel_number,
uint64_t mac_address,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_subnet_mask (uint8_t channel_number,
uint32_t subnet_mask,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_ipv4_header_parameters (uint8_t channel_number,
uint8_t time_to_live,
uint8_t flags,
uint8_t type_of_service,
uint8_t precedence,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_primary_rmcp_port_number (uint8_t channel_number,
uint16_t primary_rmcp_port_number,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_secondary_rmcp_port_number (uint8_t channel_number,
uint16_t secondary_rmcp_port_number,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_bmc_generated_arp_control (uint8_t channel_number,
uint8_t bmc_generated_gratuitous_arps,
uint8_t bmc_generated_arp_responses,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_gratuitous_arp_interval (uint8_t channel_number,
uint8_t gratuitous_arp_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_default_gateway_address (uint8_t channel_number,
uint32_t ip_address,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_default_gateway_mac_address (uint8_t channel_number,
uint64_t mac_address,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_backup_gateway_address (uint8_t channel_number,
uint32_t ip_address,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_backup_gateway_mac_address (uint8_t channel_number,
uint64_t mac_address,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_community_string (uint8_t channel_number,
const char *community_string,
unsigned int community_string_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_destination_type (uint8_t channel_number,
uint8_t destination_selector,
uint8_t destination_type,
uint8_t alert_acknowledge,
uint8_t alert_acknowledge_timeout,
uint8_t retries,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_destination_addresses (uint8_t channel_number,
uint8_t destination_selector,
uint8_t gateway_selector,
uint32_t alerting_ip_address,
uint64_t alerting_mac_address,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_vlan_id (uint8_t channel_number,
uint16_t vlan_id,
uint8_t vlan_id_enable,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_vlan_priority (uint8_t channel_number,
uint8_t vlan_priority,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_rmcpplus_messaging_cipher_suite_privilege_levels (uint8_t channel_number,
uint8_t maximum_privilege_for_cipher_suite_1,
uint8_t maximum_privilege_for_cipher_suite_2,
uint8_t maximum_privilege_for_cipher_suite_3,
uint8_t maximum_privilege_for_cipher_suite_4,
uint8_t maximum_privilege_for_cipher_suite_5,
uint8_t maximum_privilege_for_cipher_suite_6,
uint8_t maximum_privilege_for_cipher_suite_7,
uint8_t maximum_privilege_for_cipher_suite_8,
uint8_t maximum_privilege_for_cipher_suite_9,
uint8_t maximum_privilege_for_cipher_suite_10,
uint8_t maximum_privilege_for_cipher_suite_11,
uint8_t maximum_privilege_for_cipher_suite_12,
uint8_t maximum_privilege_for_cipher_suite_13,
uint8_t maximum_privilege_for_cipher_suite_14,
uint8_t maximum_privilege_for_cipher_suite_15,
uint8_t maximum_privilege_for_cipher_suite_16,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_lan_configuration_parameters_bad_password_threshold (uint8_t channel_number,
uint8_t user_disabled_event_message,
uint8_t bad_password_threshold_number,
uint16_t attempt_count_reset_interval,
uint16_t user_lockout_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_lan_configuration_parameters (uint8_t channel_number,
uint8_t get_parameter,
uint8_t parameter_selector,
uint8_t set_selector,
uint8_t block_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_suspend_bmc_arps (uint8_t channel_number,
uint8_t gratuitous_arp_suspend,
uint8_t arp_response_suspend,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_ip_udp_rmcp_statistics (uint8_t channel_number,
uint8_t clear_all_statistics,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_LAN_CMDS_H */

View File

@ -0,0 +1,654 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_MESSAGING_SUPPORT_CMDS_H
#define IPMI_MESSAGING_SUPPORT_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_MAX_USER_NAME_LENGTH 16
#define IPMI_1_5_MAX_PASSWORD_LENGTH 16
#define IPMI_2_0_MAX_PASSWORD_LENGTH 20
#define IPMI_MAX_PASSWORD_LENGTH IPMI_2_0_MAX_PASSWORD_LENGTH
#define IPMI_CHALLENGE_STRING_LENGTH 16
#define IPMI_MAX_K_R_LENGTH 20
#define IPMI_MAX_K_G_LENGTH 20
#define IPMI_BMC_GLOBAL_ENABLES_ENABLED 0x1
#define IPMI_BMC_GLOBAL_ENALBES_DISABLED 0x0
#define IPMI_BMC_GLOBAL_ENABLES_VALID(__val) \
(((__val) == IPMI_BMC_GLOBAL_ENABLES_ENABLED \
|| (__val) == IPMI_BMC_GLOBAL_ENALBES_DISABLED) ? 1 : 0)
#define IPMI_MESSAGE_FLAGS_CLEAR 0x1
#define IPMI_MESSAGE_FLAGS_DONT_CLEAR 0x0
#define IPMI_MESSAGE_FLAGS_VALID(__val) \
(((__val) == IPMI_MESSAGE_FLAGS_CLEAR \
|| (__val) == IPMI_MESSAGE_FLAGS_DONT_CLEAR) ? 1 : 0)
#define IPMI_CHANNEL_OPERATION_DISABLE_CHANNEL 0x00
#define IPMI_CHANNEL_OPERATION_ENABLE_CHANNEL 0x01
#define IPMI_CHANNEL_OPERATION_GET_CHANNEL_ENABLE_DISABLE_STATE 0x02
#define IPMI_CHANNEL_OPERATION_VALID(__val) \
(((__val) == IPMI_CHANNEL_OPERATION_DISABLE_CHANNEL \
|| (__val) == IPMI_CHANNEL_OPERATION_ENABLE_CHANNEL \
|| (__val) == IPMI_CHANNEL_OPERATION_GET_CHANNEL_ENABLE_DISABLE_STATE) ? 1 : 0)
#define IPMI_CHANNEL_DISABLED 0x00
#define IPMI_CHANNEL_ENABLED 0x01
#define IPMI_SEND_MESSAGE_WITH_AUTHENTICATION 0x1
#define IPMI_SEND_MESSAGE_AUTHENTICATION_NOT_REQUIRED 0x0
#define IPMI_SEND_MESSAGE_AUTHENTICATION_VALID(__val) \
(((__val) == IPMI_SEND_MESSAGE_WITH_AUTHENTICATION \
|| (__val) == IPMI_SEND_MESSAGE_AUTHENTICATION_NOT_REQUIRED) ? 1 : 0)
#define IPMI_SEND_MESSAGE_WITH_ENCRYPTION 0x1
#define IPMI_SEND_MESSAGE_ENCRYPTION_NOT_REQUIRED 0x0
#define IPMI_SEND_MESSAGE_ENCRYPTION_VALID(__val) \
(((__val) == IPMI_SEND_MESSAGE_WITH_ENCRYPTION \
|| (__val) == IPMI_SEND_MESSAGE_ENCRYPTION_NOT_REQUIRED) ? 1 : 0)
#define IPMI_SEND_MESSAGE_TRACKING_OPERATION_NO_TRACKING 0x0
#define IPMI_SEND_MESSAGE_TRACKING_OPERATION_TRACKING_REQUEST 0x1
#define IPMI_SEND_MESSAGE_TRACKING_OPERATION_SEND_RAW 0x2
#define IPMI_SEND_MESSAGE_TRACKING_VALID(__val) \
(((__val) == IPMI_SEND_MESSAGE_TRACKING_OPERATION_NO_TRACKING \
|| (__val) == IPMI_SEND_MESSAGE_TRACKING_OPERATION_TRACKING_REQUEST \
|| (__val) == IPMI_SEND_MESSAGE_TRACKING_OPERATION_SEND_RAW) ? 1 : 0)
#define IPMI_SYSTEM_INTERFACE_SSIF 0x00
#define IPMI_SYSTEM_INTERFACE_KCS 0x01
#define IPMI_SYSTEM_INTERFACE_SMIC 0x02
#define IPMI_SYSTEM_INTERFACE_VALID(__val) \
(((__val) == IPMI_SYSTEM_INTERFACE_SSIF \
|| (__val) == IPMI_SYSTEM_INTERFACE_KCS \
|| (__val) == IPMI_SYSTEM_INTERFACE_SMIC) ? 1 : 0)
#define IPMI_SSIF_SYSTEM_INTERFACE_VERSION_1 0x0
#define IPMI_SSIF_SYSTEM_INTERFACE_IMPLEMENTS_PEC 0x1
#define IPMI_SSIF_SYSTEM_INTERFACE_DOES_NOT_SUPPORT_PEC 0x0
#define IPMI_SSIF_SYSTEM_INTERFACE_TRANSACTION_SUPPORT_SINGLE_PART_READS_WRITES_SUPPORTED 0x0
#define IPMI_SSIF_SYSTEM_INTERFACE_TRANSACTION_SUPPORT_MULTI_PART_READS_WRITES_SUPPORTED_START_AND_END_ONLY 0x1
#define IPMI_SSIF_SYSTEM_INTERFACE_TRANSACTION_SUPPORT_MULTI_PART_READS_WRITES_SUPPORTED_START_MIDDLE_END 0x2
#define IPMI_KCS_SYSTEM_INTERFACE_VERSION_1 0x0
#define IPMI_BUS_TYPE_PUBLIC 0x0
#define IPMI_BUS_TYPE_PRIVATE 0x1
#define IPMI_BUS_TYPE_VALID(__bus_type) \
(((__bus_type) == IPMI_BUS_TYPE_PUBLIC \
|| (__bus_type) == IPMI_BUS_TYPE_PRIVATE) ? 1 : 0)
#define IPMI_GET_IPMI_V20_EXTENDED_DATA 0x01
#define IPMI_GET_IPMI_V15_DATA 0x00
#define IPMI_GET_IPMI_DATA_VALID(__val) \
(((__val) == IPMI_GET_IPMI_V20_EXTENDED_DATA \
|| (__val) == IPMI_GET_IPMI_V15_DATA) ? 1 : 0)
#define IPMI_GET_SYSTEM_INFO_PARAMETER 0x0
#define IPMI_GET_SYSTEM_INFO_PARAMETER_REVISION_ONLY 0x1
#define IPMI_GET_SYSTEM_INFO_PARAMETER_VALID(__val) \
(((__val) == IPMI_GET_SYSTEM_INFO_PARAMETER \
|| (__val) == IPMI_GET_SYSTEM_INFO_PARAMETER_REVISION_ONLY) ? 1 : 0)
#define IPMI_SYSTEM_INFO_PARAMETERS_NO_SET_SELECTOR 0x0
#define IPMI_SYSTEM_INFO_PARAMETERS_NO_BLOCK_SELECTOR 0x0
#define IPMI_SYSTEM_INFO_PARAMETERS_SET_COMPLETE 0x00
#define IPMI_SYSTEM_INFO_PARAMETERS_SET_IN_PROGRESS 0x01
#define IPMI_SYSTEM_INFO_PARAMETERS_SET_COMMIT_WRITE 0x02
#define IPMI_SYSTEM_INFO_PARAMETERS_SET_IN_PROGRESS_VALID(__value) \
(((__value) == IPMI_SYSTEM_INFO_PARAMETERS_SET_COMPLETE \
|| (__value) == IPMI_SYSTEM_INFO_PARAMETERS_SET_IN_PROGRESS \
|| (__value) == IPMI_SYSTEM_INFO_PARAMETERS_SET_COMMIT_WRITE) ? 1 : 0)
#define IPMI_SYSTEM_INFO_ENCODING_ASCII_LATIN1 0x0
#define IPMI_SYSTEM_INFO_ENCODING_UTF_8 0x1
#define IPMI_SYSTEM_INFO_ENCODING_UNICODE 0x2
#define IPMI_SYSTEM_INFO_ENCODING_VALID(__val) \
(((__val) == IPMI_SYSTEM_INFO_ENCODING_ASCII_LATIN1 \
|| (__val) == IPMI_SYSTEM_INFO_ENCODING_UTF_8 \
|| (__val) == IPMI_SYSTEM_INFO_ENCODING_UNICODE) ? 1 : 0)
#define IPMI_SYSTEM_INFO_FIRST_SET_STRING_LEN_MAX 14
#define IPMI_SYSTEM_INFO_SET_STRING_LEN_MAX 16
#define IPMI_SYSTEM_INFO_STRING_LEN_MAX 255
#define IPMI_LIST_ALGORITHMS_BY_CIPHER_SUITE 0x1
#define IPMI_LIST_SUPPORTED_ALGORITHMS 0x0
#define IPMI_LIST_ALGORITHM_TYPE_VALID(__val) \
(((__val) == IPMI_LIST_ALGORITHMS_BY_CIPHER_SUITE \
|| (__val) == IPMI_LIST_SUPPORTED_ALGORITHMS) ? 1 : 0)
#define IPMI_MESSAGING_ACCESS_MODE_DISABLED 0x0
#define IPMI_MESSAGING_ACCESS_MODE_PRE_BOOT_ONLY 0x1
#define IPMI_MESSAGING_ACCESS_MODE_ALWAYS_AVAILABLE 0x2
#define IPMI_MESSAGING_ACCESS_MODE_SHARED 0x3
#define IPMI_MESSAGING_ACCESS_MODE_VALID(__access_mode) \
(((__access_mode) == IPMI_MESSAGING_ACCESS_MODE_DISABLED \
|| (__access_mode) == IPMI_MESSAGING_ACCESS_MODE_PRE_BOOT_ONLY \
|| (__access_mode) == IPMI_MESSAGING_ACCESS_MODE_ALWAYS_AVAILABLE \
|| (__access_mode) == IPMI_MESSAGING_ACCESS_MODE_SHARED) ? 1 : 0)
#define IPMI_USER_LEVEL_AUTHENTICATION_ENABLE 0x0
#define IPMI_USER_LEVEL_AUTHENTICATION_DISABLE 0x1
#define IPMI_USER_LEVEL_AUTHENTICATION_VALID(__val) \
(((__val) == IPMI_USER_LEVEL_AUTHENTICATION_ENABLE \
|| (__val) == IPMI_USER_LEVEL_AUTHENTICATION_DISABLE) ? 1 : 0)
#define IPMI_PER_MESSAGE_AUTHENTICATION_ENABLE 0x0
#define IPMI_PER_MESSAGE_AUTHENTICATION_DISABLE 0x1
#define IPMI_PER_MESSAGE_AUTHENTICATION_VALID(__val) \
(((__val) == IPMI_PER_MESSAGE_AUTHENTICATION_ENABLE \
|| (__val) == IPMI_PER_MESSAGE_AUTHENTICATION_DISABLE) ? 1 : 0)
#define IPMI_PEF_ALERTING_ENABLE 0x0
#define IPMI_PEF_ALERTING_DISABLE 0x1
#define IPMI_PEF_ALERTING_VALID(__val) \
(((__val) == IPMI_PEF_ALERTING_ENABLE \
|| (__val) == IPMI_PEF_ALERTING_DISABLE) ? 1 : 0)
#define IPMI_CHANNEL_ACCESS_NO_CHANGE 0x0
#define IPMI_CHANNEL_ACCESS_SET_NON_VOLATILE 0x1
#define IPMI_CHANNEL_ACCESS_SET_VOLATILE 0x2
#define IPMI_CHANNEL_ACCESS_RESERVED 0x3
#define IPMI_CHANNEL_ACCESS_VALID(__access_mode) \
(((__access_mode) == IPMI_CHANNEL_ACCESS_NO_CHANGE \
|| (__access_mode) == IPMI_CHANNEL_ACCESS_SET_NON_VOLATILE \
|| (__access_mode) == IPMI_CHANNEL_ACCESS_SET_VOLATILE) ? 1 : 0)
#define IPMI_PRIVILEGE_LEVEL_LIMIT_NO_CHANGE 0x0
#define IPMI_PRIVILEGE_LEVEL_LIMIT_SET_NON_VOLATILE 0x1
#define IPMI_PRIVILEGE_LEVEL_LIMIT_SET_VOLATILE 0x2
#define IPMI_PRIVILEGE_LEVEL_LIMIT_RESERVED 0x3
#define IPMI_PRIVILEGE_LEVEL_LIMIT_SET_VALID(__privilege_level_limit) \
(((__privilege_level_limit) == IPMI_PRIVILEGE_LEVEL_LIMIT_NO_CHANGE \
|| (__privilege_level_limit) == IPMI_PRIVILEGE_LEVEL_LIMIT_SET_NON_VOLATILE \
|| (__privilege_level_limit) == IPMI_PRIVILEGE_LEVEL_LIMIT_SET_VOLATILE) ? 1 : 0)
#define IPMI_CHANNEL_ACCESS_GET_NON_VOLATILE 0x1
#define IPMI_CHANNEL_ACCESS_GET_VOLATILE 0x2
#define IPMI_CHANNEL_ACCESS_GET_VALID(__val) \
(((__val) == IPMI_CHANNEL_ACCESS_GET_NON_VOLATILE \
|| (__val) == IPMI_CHANNEL_ACCESS_GET_VOLATILE) ? 1 : 0)
#define IPMI_USER_RESTRICTED_TO_CALLBACK_ENABLE 0x1
#define IPMI_USER_RESTRICTED_TO_CALLBACK_DISABLE 0x0
#define IPMI_USER_RESTRICTED_TO_CALLBACK_VALID(__val) \
(((__val) == IPMI_USER_RESTRICTED_TO_CALLBACK_ENABLE \
|| (__val) == IPMI_USER_RESTRICTED_TO_CALLBACK_DISABLE) ? 1 : 0)
#define IPMI_PRIVILEGE_LEVEL_LIMIT_VALID(__privilege_level) \
(((__privilege_level) == IPMI_PRIVILEGE_LEVEL_CALLBACK \
|| (__privilege_level) == IPMI_PRIVILEGE_LEVEL_USER \
|| (__privilege_level) == IPMI_PRIVILEGE_LEVEL_OPERATOR \
|| (__privilege_level) == IPMI_PRIVILEGE_LEVEL_ADMIN \
|| (__privilege_level) == IPMI_PRIVILEGE_LEVEL_OEM \
|| (__privilege_level) == IPMI_PRIVILEGE_LEVEL_NO_ACCESS) ? 1 : 0)
#define IPMI_USER_LINK_AUTHENTICATION_ENABLE 0x1
#define IPMI_USER_LINK_AUTHENTICATION_DISABLE 0x0
#define IPMI_USER_LINK_AUTHENTICATION_VALID(__val) \
(((__val) == IPMI_USER_LINK_AUTHENTICATION_ENABLE \
|| (__val) == IPMI_USER_LINK_AUTHENTICATION_DISABLE) ? 1 : 0)
#define IPMI_USER_IPMI_MESSAGING_ENABLE 0x1
#define IPMI_USER_IPMI_MESSAGING_DISABLE 0x0
#define IPMI_USER_IPMI_MESSAGING_VALID(__val) \
(((__val) == IPMI_USER_IPMI_MESSAGING_ENABLE \
|| (__val) == IPMI_USER_IPMI_MESSAGING_DISABLE) ? 1 : 0)
#define IPMI_CHANGE_BITS_YES 0x1
#define IPMI_CHANGE_BITS_NO 0x0
#define IPMI_CHANGE_BITS_VALID(__val) \
(((__val) == IPMI_CHANGE_BITS_YES \
|| (__val) == IPMI_CHANGE_BITS_NO) ? 1 : 0)
#define IPMI_SESSION_SUPPORT_SESSION_LESS 0x00
#define IPMI_SESSION_SUPPORT_SINGLE_SESSION 0x01
#define IPMI_SESSION_SUPPORT_MULTI_SESSION 0x02
#define IPMI_SESSION_SUPPORT_SESSION_BASED 0x03
#define IPMI_CHANNEL_SECURITY_KEYS_OPERATION_READ_KEY 0x0
#define IPMI_CHANNEL_SECURITY_KEYS_OPERATION_SET_KEY 0x1
#define IPMI_CHANNEL_SECURITY_KEYS_OPERATION_LOCK_KEY 0x2
#define IPMI_CHANNEL_SECURITY_KEYS_OPERATION_VALID(__val) \
(((__val) == IPMI_CHANNEL_SECURITY_KEYS_OPERATION_READ_KEY \
|| (__val) == IPMI_CHANNEL_SECURITY_KEYS_OPERATION_SET_KEY \
|| (__val) == IPMI_CHANNEL_SECURITY_KEYS_OPERATION_LOCK_KEY) ? 1 : 0)
#define IPMI_CHANNEL_SECURITY_KEYS_KEY_ID_K_R 0x0
#define IPMI_CHANNEL_SECURITY_KEYS_KEY_ID_K_G 0x1
#define IPMI_CHANNEL_SECURITY_KEYS_KEY_ID_VALID(__val) \
(((__val) == IPMI_CHANNEL_SECURITY_KEYS_KEY_ID_K_R \
|| (__val) == IPMI_CHANNEL_SECURITY_KEYS_KEY_ID_K_G) ? 1 : 0)
#define IPMI_CHANNEL_SECURITY_KEYS_LOCK_STATUS_KEY_IS_NOT_LOCKABLE 0x0
#define IPMI_CHANNEL_SECURITY_KEYS_LOCK_STATUS_KEY_IS_LOCKED 0x1
#define IPMI_CHANNEL_SECURITY_KEYS_LOCK_STATUS_KEY_IS_UNLOCKED 0x2
#define IPMI_PASSWORD_OPERATION_DISABLE_USER 0x0
#define IPMI_PASSWORD_OPERATION_ENABLE_USER 0x1
#define IPMI_PASSWORD_OPERATION_SET_PASSWORD 0x2
#define IPMI_PASSWORD_OPERATION_TEST_PASSWORD 0x3
#define IPMI_PASSWORD_OPERATION_VALID(__operation) \
(((__operation) == IPMI_PASSWORD_OPERATION_DISABLE_USER \
|| (__operation) == IPMI_PASSWORD_OPERATION_ENABLE_USER \
|| (__operation) == IPMI_PASSWORD_OPERATION_SET_PASSWORD \
|| (__operation) == IPMI_PASSWORD_OPERATION_TEST_PASSWORD) ? 1 : 0)
#define IPMI_PASSWORD_SIZE_16_BYTES 0x0
#define IPMI_PASSWORD_SIZE_20_BYTES 0x1
#define IPMI_PASSWORD_SIZE_VALID(__password_size) \
(((__password_size) == IPMI_PASSWORD_SIZE_16_BYTES \
|| (__password_size) == IPMI_PASSWORD_SIZE_20_BYTES) ? 1 : 0)
#define IPMI_USER_ID_ENABLE_STATUS_UNSPECIFIED 0x0
#define IPMI_USER_ID_ENABLE_STATUS_ENABLED 0x1
#define IPMI_USER_ID_ENABLE_STATUS_DISABLED 0x2
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_set_bmc_global_enables_rq;
extern fiid_template_t tmpl_cmd_set_bmc_global_enables_rs;
extern fiid_template_t tmpl_cmd_get_bmc_global_enables_rq;
extern fiid_template_t tmpl_cmd_get_bmc_global_enables_rs;
extern fiid_template_t tmpl_cmd_clear_message_flags_rq;
extern fiid_template_t tmpl_cmd_clear_message_flags_rs;
extern fiid_template_t tmpl_cmd_get_message_flags_rq;
extern fiid_template_t tmpl_cmd_get_message_flags_rs;
extern fiid_template_t tmpl_cmd_enable_message_channel_receive_rq;
extern fiid_template_t tmpl_cmd_enable_message_channel_receive_rs;
extern fiid_template_t tmpl_cmd_get_message_rq;
extern fiid_template_t tmpl_cmd_get_message_rs;
extern fiid_template_t tmpl_cmd_send_message_rq;
extern fiid_template_t tmpl_cmd_send_message_rs;
extern fiid_template_t tmpl_cmd_read_event_message_buffer_rq;
extern fiid_template_t tmpl_cmd_read_event_message_buffer_rs;
extern fiid_template_t tmpl_cmd_get_system_interface_capabilities_rq;
extern fiid_template_t tmpl_cmd_get_system_interface_capabilities_rs;
extern fiid_template_t tmpl_cmd_get_system_interface_capabilities_ssif_rs;
extern fiid_template_t tmpl_cmd_get_system_interface_capabilities_kcs_rs;
extern fiid_template_t tmpl_cmd_get_bt_interface_capabilities_rq;
extern fiid_template_t tmpl_cmd_get_bt_interface_capabilities_rs;
extern fiid_template_t tmpl_cmd_master_write_read_rq;
extern fiid_template_t tmpl_cmd_master_write_read_rs;
extern fiid_template_t tmpl_cmd_get_channel_authentication_capabilities_rq;
extern fiid_template_t tmpl_cmd_get_channel_authentication_capabilities_rs;
extern fiid_template_t tmpl_cmd_get_system_guid_rq;
extern fiid_template_t tmpl_cmd_get_system_guid_rs;
extern fiid_template_t tmpl_cmd_get_device_guid_format_rs;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_rs;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_set_in_progress_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_system_firmware_version_first_set_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_system_firmware_version_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_system_name_first_set_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_system_name_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_primary_operating_system_name_first_set_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_primary_operating_system_name_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_operating_system_name_first_set_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_operating_system_name_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_present_os_version_number_first_set_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_present_os_version_number_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_bmc_url_first_set_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_bmc_url_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_base_os_hypervisor_url_first_set_rq;
extern fiid_template_t tmpl_cmd_set_system_info_parameters_base_os_hypervisor_url_rq;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_rq;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_set_in_progress_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_system_firmware_version_first_set_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_system_firmware_version_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_system_name_first_set_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_system_name_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_primary_operating_system_name_first_set_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_primary_operating_system_name_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_operating_system_name_first_set_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_operating_system_name_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_present_os_version_number_first_set_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_present_os_version_number_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_bmc_url_first_set_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_bmc_url_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_base_os_hypervisor_url_first_set_rs;
extern fiid_template_t tmpl_cmd_get_system_info_parameters_base_os_hypervisor_url_rs;
extern fiid_template_t tmpl_cmd_get_channel_cipher_suites_rq;
extern fiid_template_t tmpl_cmd_get_channel_cipher_suites_rs;
extern fiid_template_t tmpl_cmd_get_session_challenge_rq;
extern fiid_template_t tmpl_cmd_get_session_challenge_rs;
extern fiid_template_t tmpl_cmd_activate_session_rq;
extern fiid_template_t tmpl_cmd_activate_session_rs;
extern fiid_template_t tmpl_cmd_set_session_privilege_level_rq;
extern fiid_template_t tmpl_cmd_set_session_privilege_level_rs;
extern fiid_template_t tmpl_cmd_close_session_rq;
extern fiid_template_t tmpl_cmd_close_session_rs;
extern fiid_template_t tmpl_cmd_set_channel_access_rq;
extern fiid_template_t tmpl_cmd_set_channel_access_rs;
extern fiid_template_t tmpl_cmd_get_channel_access_rq;
extern fiid_template_t tmpl_cmd_get_channel_access_rs;
extern fiid_template_t tmpl_cmd_get_channel_info_rq;
extern fiid_template_t tmpl_cmd_get_channel_info_rs;
extern fiid_template_t tmpl_cmd_set_channel_security_keys_rq;
extern fiid_template_t tmpl_cmd_set_channel_security_keys_rs;
extern fiid_template_t tmpl_cmd_set_user_access_rq;
extern fiid_template_t tmpl_cmd_set_user_access_rs;
extern fiid_template_t tmpl_cmd_get_user_access_rq;
extern fiid_template_t tmpl_cmd_get_user_access_rs;
extern fiid_template_t tmpl_cmd_set_user_name_rq;
extern fiid_template_t tmpl_cmd_set_user_name_rs;
extern fiid_template_t tmpl_cmd_get_user_name_rq;
extern fiid_template_t tmpl_cmd_get_user_name_rs;
extern fiid_template_t tmpl_cmd_set_user_password_rq;
extern fiid_template_t tmpl_cmd_set_user_password_rs;
int fill_cmd_set_bmc_global_enables (uint8_t receive_message_queue_interrupt,
uint8_t event_message_buffer_full_interrupt,
uint8_t event_message_buffer,
uint8_t system_event_logging,
uint8_t oem_0,
uint8_t oem_1,
uint8_t oem_2,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_bmc_global_enables (fiid_obj_t obj_cmd_rq);
int fill_cmd_clear_message_flags (uint8_t receive_message_queue,
uint8_t event_message_buffer,
uint8_t watchdog_pre_timeout_interrupt_flag,
uint8_t oem_0,
uint8_t oem_1,
uint8_t oem_2,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_message_flags (fiid_obj_t obj_cmd_rq);
int fill_cmd_enable_message_channel_receive (uint8_t channel_number,
uint8_t channel_operation,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_message (fiid_obj_t obj_cmd_rq);
int fill_cmd_send_message (uint8_t channel_number,
uint8_t message_authentication,
uint8_t message_encryption,
uint8_t tracking_operation,
const void *message_data,
unsigned int message_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_read_event_message_buffer (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_system_interface_capabilities (uint8_t system_interface,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_bt_interface_capabilities (fiid_obj_t obj_cmd_rq);
int fill_cmd_master_write_read (uint8_t bus_type,
uint8_t bus_id,
uint8_t channel_number,
uint8_t slave_address,
uint8_t read_count,
const void *data,
unsigned int data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_channel_authentication_capabilities (uint8_t channel_number,
uint8_t maximum_privilege_level,
uint8_t get_ipmi_v20_extended_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_system_guid (fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters (uint8_t parameter_selector,
const void *configuration_parameter_data,
unsigned int configuration_parameter_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_set_in_progress (uint8_t state,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_system_firmware_version_first_set (uint8_t set_selector,
uint8_t encoding,
uint8_t string_length,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_system_firmware_version (uint8_t set_selector,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_system_name_first_set (uint8_t set_selector,
uint8_t encoding,
uint8_t string_length,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_system_name (uint8_t set_selector,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_primary_operating_system_name_first_set (uint8_t set_selector,
uint8_t encoding,
uint8_t string_length,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_primary_operating_system_name (uint8_t set_selector,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_operating_system_name_first_set (uint8_t set_selector,
uint8_t encoding,
uint8_t string_length,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_operating_system_name (uint8_t set_selector,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_present_os_version_number_first_set (uint8_t set_selector,
uint8_t encoding,
uint8_t string_length,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_present_os_version_number (uint8_t set_selector,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_bmc_url_first_set (uint8_t set_selector,
uint8_t encoding,
uint8_t string_length,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_bmc_url (uint8_t set_selector,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_base_os_hypervisor_url_first_set (uint8_t set_selector,
uint8_t encoding,
uint8_t string_length,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_system_info_parameters_base_os_hypervisor_url (uint8_t set_selector,
const void *string_block,
unsigned int string_block_length,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_system_info_parameters (uint8_t get_parameter,
uint8_t parameter_selector,
uint8_t set_selector,
uint8_t block_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_channel_cipher_suites (uint8_t channel_number,
uint8_t payload_type,
uint8_t list_index,
uint8_t list_algorithm_type,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_session_challenge (uint8_t authentication_type,
const char *user_name,
unsigned int user_name_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_activate_session (uint8_t authentication_type,
uint8_t maximum_privilege_level,
const void *challenge_string,
unsigned int challenge_string_len,
uint32_t initial_outbound_sequence_number,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_session_privilege_level (uint8_t privilege_level,
fiid_obj_t obj_cmd_rq);
int fill_cmd_close_session (uint32_t session_id,
uint8_t *session_handle,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_channel_access (uint8_t channel_number,
uint8_t ipmi_messaging_access_mode,
uint8_t user_level_authentication,
uint8_t per_message_authentication,
uint8_t pef_alerting,
uint8_t channel_access_set,
uint8_t channel_privilege_level_limit,
uint8_t channel_privilege_level_limit_set,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_channel_access (uint8_t channel_number,
uint8_t channel_access_get,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_channel_info (uint8_t channel_number, fiid_obj_t obj_cmd_rq);
int fill_cmd_set_channel_security_keys (uint8_t channel_number,
uint8_t operation,
uint8_t key_id,
const void *key_value,
unsigned int key_value_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_user_access (uint8_t channel_number,
uint8_t user_ipmi_messaging,
uint8_t user_link_authentication,
uint8_t user_restricted_to_callback,
uint8_t change_bits_in_byte,
uint8_t user_id,
uint8_t user_privilege_level_limit,
uint8_t user_session_limit,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_user_access (uint8_t channel_number,
uint8_t user_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_user_name (uint8_t user_id,
const char *user_name,
unsigned int user_name_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_user_name (uint8_t user_id, fiid_obj_t obj_cmd_rq);
int fill_cmd_set_user_password (uint8_t user_id,
uint8_t password_size,
uint8_t operation,
const char *password,
unsigned int password_len,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_MESSAGING_SUPPORT_CMDS_H */

View File

@ -0,0 +1,537 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_OEM_INTEL_NODE_MANAGER_CMDS_H
#define IPMI_OEM_INTEL_NODE_MANAGER_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
/*
* Intel Node Manager
*
* For Intel Chips, not just Intel Motherboards. Confirmed for:
*
* Intel S5500WB/Penguin Computing Relion 700
* Intel S2600JF/Appro 512X
* Intel S2600KP
* Intel S2600WT2
* Intel S2600WTT
* Inventec 5441/Dell Xanadu II
* Inventec 5442/Dell Xanadu III
* Quanta S99Q/Dell FS12-TY
* Quanta QSSC-S4R/Appro GB812X-CN
*/
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_MIN 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_MAX 0xF
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_ENTIRE_PLATFORM 0x00
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_CPU_SUBSYSTEM 0x01
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_MEMORY_SUBSYSTEM 0x02
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_RESERVED 0x03
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_HIGH_POWER_IO_SUBSYSTEM 0x04
#define IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_ENTIRE_PLATFORM \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_CPU_SUBSYSTEM \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_MEMORY_SUBSYSTEM \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_DOMAIN_ID_HIGH_POWER_IO_SUBSYSTEM) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_GLOBAL_DISABLE_NODE_MANAGER_POLICY_CONTROL 0x00
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_GLOBAL_ENABLE_NODE_MANAGER_POLICY_CONTROL 0x01
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_DOMAIN_DISABLE_NODE_MANAGER_POLICIES 0x02
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_DOMAIN_ENABLE_NODE_MANAGER_POLITICES 0x03
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_POLICY_DISABLE_NODE_MANAGER_POLICIES 0x04
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_POLICY_ENABLE_NODE_MANAGER_POLITICES 0x05
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_GLOBAL_DISABLE_NODE_MANAGER_POLICY_CONTROL \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_GLOBAL_ENABLE_NODE_MANAGER_POLICY_CONTROL \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_DOMAIN_DISABLE_NODE_MANAGER_POLICIES \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_DOMAIN_ENABLE_NODE_MANAGER_POLITICES \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_POLICY_DISABLE_NODE_MANAGER_POLICIES \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLE_DISABLE_PER_POLICY_ENABLE_NODE_MANAGER_POLITICES) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLED 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_DISABLED 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLED_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ENABLED \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_DISABLED) ? 1 : 0)
/* Celsius */
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_NO_POLICY_TRIGGER 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_INLET_TEMPERATURE_LIMIT_POLICY_TRIGGER 0x1
/* 1/10 seconds units */
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_MISSING_POWER_READING_TIMEOUT 0x2
/* 1/10 seconds units */
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_TIME_AFTER_PLATFORM_RESET_TRIGGER 0x3
/* Only to domain 0 = Entire Platform */
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_BOOT_TIME_POLICY 0x4
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_NO_POLICY_TRIGGER \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_INLET_TEMPERATURE_LIMIT_POLICY_TRIGGER \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_MISSING_POWER_READING_TIMEOUT \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_TIME_AFTER_PLATFORM_RESET_TRIGGER \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TRIGGER_TYPE_BOOT_TIME_POLICY) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_CONFIGURATION_ACTION_POLICY_POINTED_BY_POLICY_ID_SHALL_BE_REMOVED 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_CONFIGURATION_ACTION_ADD_POWER_POLICY 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_CONFIGURATION_ACTION_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_CONFIGURATION_ACTION_POLICY_POINTED_BY_POLICY_ID_SHALL_BE_REMOVED \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_CONFIGURATION_ACTION_ADD_POWER_POLICY) ? 1 : 0)
/* achu: not in spec, assume it to be true */
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_EXCEPTION_ACTION_ENABLE 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_EXCEPTION_ACTION_DISABLE 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_EXCEPTION_ACTION_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_EXCEPTION_ACTION_ENABLE \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_EXCEPTION_ACTION_DISABLE) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_PER_DOMAIN_NODE_MANAGER_POLICY_CONTROL_ENABLED 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_PER_DOMAIN_NODE_MANAGER_POLICY_CONTROL_DISABLED 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_GLOBAL_NODE_MANAGER_POLICY_CONTROL_ENABLED 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_GLOBAL_NODE_MANAGER_POLICY_CONTROL_DISABLED 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_CREATED_AND_MANAGED_BY_OTHER_MANAGEMENT 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_NOT_CREATED_AND_MANAGED_BY_OTHER_MANAGEMENT 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_AGGRESSIVE_CPU_POWER_CORRECTION_AUTOMATIC 0x00
#define IPMI_OEM_INTEL_NODE_MANAGER_AGGRESSIVE_CPU_POWER_CORRECTION_NON_AGGRESSIVE 0x01
#define IPMI_OEM_INTEL_NODE_MANAGER_AGGRESSIVE_CPU_POWER_CORRECTION_AGGRESSIVE 0x02
#define IPMI_OEM_INTEL_NODE_MANAGER_AGGRESSIVE_CPU_POWER_CORRECTION_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_AGGRESSIVE_CPU_POWER_CORRECTION_AUTOMATIC \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_AGGRESSIVE_CPU_POWER_CORRECTION_NON_AGGRESSIVE \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_AGGRESSIVE_CPU_POWER_CORRECTION_AGGRESSIVE) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_STORAGE_PERSISTENT_STORAGE 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_STORAGE_VOLATILE_MEMORY 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_STORAGE_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_STORAGE_PERSISTENT_STORAGE \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_STORAGE_VOLATILE_MEMORY) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_PLATFORM_BOOTING_MODE_BOOT_IN_POWER_OPTIMIZED_MODE 0
#define IPMI_OEM_INTEL_NODE_MANAGER_PLATFORM_BOOTING_MODE_BOOT_IN_PERFORMANCE_OPTIMIZED_MODE 1
#define IPMI_OEM_INTEL_NODE_MANAGER_PLATFORM_BOOTING_MODE_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_PLATFORM_BOOTING_MODE_BOOT_IN_POWER_OPTIMIZED_MODE \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_PLATFORM_BOOTING_MODE_BOOT_IN_PERFORMANCE_OPTIMIZED_MODE) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TYPE_POWER_CONTROL_POLICY 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TYPE_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_TYPE_POWER_CONTROL_POLICY) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_POWER_DOMAIN_POWER_PRIMARY_SIDE_POWER_DOMAIN 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_POWER_DOMAIN_POWER_SECONDARY_SIDE_POWER_DOMAIN 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_POWER_DOMAIN_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_POWER_DOMAIN_POWER_PRIMARY_SIDE_POWER_DOMAIN \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_POLICY_POWER_DOMAIN_POWER_SECONDARY_SIDE_POWER_DOMAIN) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ALERT_THRESHOLDS_MAX 3
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_START_TIME_MIN 0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_START_TIME_MAX 239
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_START_TIME_VALID(__val) \
((((__val) + 1) >= (IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_START_TIME_MIN + 1) \
&& (__val) <= IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_START_TIME_MAX) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_STOP_TIME_MIN 0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_STOP_TIME_MAX 240
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_STOP_TIME_VALID(__val) \
((((__val) + 1) >= (IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_STOP_TIME_MIN + 1) \
&& (__val) <= IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_STOP_TIME_MAX) ? 1 : 0)
/* achu: not in spec, assume it to be true */
#define IPMI_OEM_INTEL_NODE_MANAGER_REPEAT_THE_SUSPEND_PERIOD 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_DO_NOT_REPEAT_THE_SUSPEND_PERIOD 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_SUSPEND_PERIOD_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_REPEAT_THE_SUSPEND_PERIOD \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_DO_NOT_REPEAT_THE_SUSPEND_PERIOD) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_SUSPEND_PERIODS_MAX 5
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_RESET_GLOBAL_STATISTICS 0x00
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_PER_POLICY_STATISTICS 0x01
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_GLOBAL_HOST_UNHANDLED_REQUESTS_STATISTICS 0x1B
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_HOST_RESPONSE_TIME_STATISTICS 0x1C
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_CPU_THROTTLING_STATISTICS 0x1D
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_MEMORY_THROTTLING_STATISTICS 0x1E
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_HOST_COMMUNICATION_FAILURE_STATISTICS 0x1F
#define IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_RESET_GLOBAL_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_PER_POLICY_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_GLOBAL_HOST_UNHANDLED_REQUESTS_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_HOST_RESPONSE_TIME_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_CPU_THROTTLING_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_MEMORY_THROTTLING_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_RESET_MODE_HOST_COMMUNICATION_FAILURE_STATISTICS) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_POWER_STATISTICS 0x01
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_INLET_TEMPERATURE_STATISTICS 0x02
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_THROTTLING_STATISTICS 0x03
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_VOLUMETRIC_AIRFLOW_STATISTICS 0x04
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_OUTLET_AIRFLOW_TEMPERATURE_STATISTICS 0x05
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_CHASSIS_POWER_STATISTICS 0x06
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_PER_POLICY_POWER_STATISTICS 0x11
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_PER_POLICY_TRIGGER_STATISTICS 0x12
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_PER_POLICY_THROTTLING_STATISTICS 0x13
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_HOST_UNHANDLED_REQUESTS_STATISTICS 0x1B
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_HOST_RESPONSE_TIME_STATISTICS 0x1C
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_CPU_THROTTLING_STATISTICS 0x1D
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_MEMORY_THROTTLING_STATISTICS 0x1E
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_HOST_COMMUNICATION_FAILURE_STATISTICS 0x1F
#define IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_POWER_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_INLET_TEMPERATURE_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_THROTTLING_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_VOLUMETRIC_AIRFLOW_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_OUTLET_AIRFLOW_TEMPERATURE_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_CHASSIS_POWER_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_PER_POLICY_POWER_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_PER_POLICY_TRIGGER_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_PER_POLICY_THROTTLING_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_HOST_UNHANDLED_REQUESTS_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_HOST_RESPONSE_TIME_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_CPU_THROTTLING_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_MEMORY_THROTTLING_STATISTICS \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_STATISTICS_MODE_GLOBAL_HOST_COMMUNICATION_FAILURE_STATISTICS) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_GLOBAL_ADMINISTRATIVE_STATE_ENABLED 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_GLOBAL_ADMINISTRATIVE_STATE_OTHERWISE 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_OPERATIONAL_STATE_ACTIVELY_MONITORING_DEFINED_TRIGGER 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_OPERATIONAL_STATE_SUSPENDED 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_MEASUREMENTS_STATE_IN_PROGRESS 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_MEASUREMENTS_STATE_SUSPENDED 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ACTIVATION_STATE_TRIGGERED_AND_ACTIVELY_LIMITING_TARGET 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_POLICY_ACTIVATION_STATE_NOT_TRIGGERED 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_LIMITING_TYPE_PLATFORM_POWER_LIMITING 0 /* Legacy, no longer in 2.0 spec */
#define IPMI_OEM_INTEL_NODE_MANAGER_LIMITING_TYPE_CPU_POWER_LIMITING 1 /* Legacy, no longer in 2.0 spec */
#define IPMI_OEM_INTEL_NODE_MANAGER_LIMITING_BASED_ON_WALL_INPUT_POWER_PSU_INPUT_POWER 0
#define IPMI_OEM_INTEL_NODE_MANAGER_LIMITING_BASED_ON_DC_POWER_PSU_OUTPUT_POWER_OR_BLADED_SYSTEM 1
#define IPMI_OEM_INTEL_NODE_MANAGER_VERSION_1_0 0x01
#define IPMI_OEM_INTEL_NODE_MANAGER_VERSION_1_5 0x02
#define IPMI_OEM_INTEL_NODE_MANAGER_VERSION_2_0 0x03
#define IPMI_OEM_INTEL_NODE_MANAGER_VERSION_2_5 0x04
#define IPMI_OEM_INTEL_NODE_MANAGER_VERSION_3_0 0x05
#define IPMI_OEM_INTEL_NODE_MANAGER_IPMI_INTERFACE_VERSION_1_0 0x01
#define IPMI_OEM_INTEL_NODE_MANAGER_IPMI_INTERFACE_VERSION_2_0 0x02
#define IPMI_OEM_INTEL_NODE_MANAGER_IPMI_INTERFACE_VERSION_3_0 0x03
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_REGISTER_ALERT_RECEIVER 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_UNREGISTER_ALERT_RECEIVER 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_REGISTER_ALERT_RECEIVER \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_UNREGISTER_ALERT_RECEIVER) ? 1 : 0)
/* legacy names */
#define IPMI_OEM_INTEL_NODE_MANAGER_DESTINATION_INFORMATION_OPERATION_REGISTER_ALERT_RECEIVER IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_REGISTER_ALERT_RECEIVER
#define IPMI_OEM_INTEL_NODE_MANAGER_DESTINATION_INFORMATION_OPERATION_UNREGISTER_ALERT_RECEIVER IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_UNREGISTER_ALERT_RECEIVER
#define IPMI_OEM_INTEL_NODE_MANAGER_DESTINATION_INFORMATION_OPERATION_VALID(__val) \
IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_VALID((__val))
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_STRING_SELECTOR_USE_VOLATILE_ALERT_STRING 0x00
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_STRING_SELECTOR_MIN 0x00
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_STRING_SELECTOR_MAX 0x7F
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_STRING_SELECTOR_VALID(__val) \
((((__val) + 1) >= (IPMI_OEM_INTEL_NODE_MANAGER_ALERT_STRING_SELECTOR_MIN + 1) \
&& (__val) <= IPMI_OEM_INTEL_NODE_MANAGER_ALERT_STRING_SELECTOR_MAX) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_DONT_SEND_AN_ALERT_STRING 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_SEND_ALERT_STRING_IDENTIFIED_BY_STRING_SELECTOR 0x1
#define IPMI_OEM_INTEL_NODE_MANAGER_SEND_ALERT_STRING_VALID(__val) \
(((__val) == IPMI_OEM_INTEL_NODE_MANAGER_DONT_SEND_AN_ALERT_STRING \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_SEND_ALERT_STRING_IDENTIFIED_BY_STRING_SELECTOR) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_CONFIGURATION_VALID 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_CONFIGURATION_INVALID 0x1
/* legacy names */
#define IPMI_OEM_INTEL_NODE_MANAGER_DESTINATION_INFORMATION_OPERATION_CONFIGURATION_VALID IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_CONFIGURATION_VALID
#define IPMI_OEM_INTEL_NODE_MANAGER_DESTINATION_INFORMATION_OPERATION_CONFIGURATION_INVALID IPMI_OEM_INTEL_NODE_MANAGER_ALERT_RECEIVER_DEACTIVATION_CONFIGURATION_INVALID
#define IPMI_OEM_INTEL_NODE_MANAGER_DESTINATION_SELECTOR_OPERATOR_USE_VOLATILE_DESTINATION_INFO 0x0
#define IPMI_OEM_INTEL_NODE_MANAGER_CPU_SOCKET_MIN 0
#define IPMI_OEM_INTEL_NODE_MANAGER_CPU_SOCKET_MAX 7
#define IPMI_OEM_INTEL_NODE_MANAGER_CPU_SOCKET_ALL_SOCKETS 0xFF
#define IPMI_OEM_INTEL_NODE_MANAGER_CPU_SOCKET_VALID(__val) \
((((__val) >= IPMI_OEM_INTEL_NODE_MANAGER_CPU_SOCKET_MIN \
&& (__val) <= IPMI_OEM_INTEL_NODE_MANAGER_CPU_SOCKET_MAX) \
|| (__val) == IPMI_OEM_INTEL_NODE_MANAGER_CPU_SOCKET_ALL_SOCKETS) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_ACTIVE_CORES_CONFIGURATION_RESERVED 0x00
#define IPMI_OEM_INTEL_NODE_MANAGER_ACTIVE_CORES_CONFIGURATION_APPLY_SETTINGS_TO_ALL_ACTIVE_CORES_CONFIGURATION 0xFF
#define IPMI_OEM_INTEL_NODE_MANAGER_SET_ACTIVE_CORES_CONFIGURATION_VALID(__val) \
(((__val) != IPMI_OEM_INTEL_NODE_MANAGER_ACTIVE_CORES_CONFIGURATION_RESERVED \
&& ((__val) == IPMI_OEM_INTEL_NODE_MANAGER_ACTIVE_CORES_CONFIGURATION_APPLY_SETTINGS_TO_ALL_ACTIVE_CORES_CONFIGURATION \
|| (__val) > 0)) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_GET_ACTIVE_CORES_CONFIGURATION_VALID(__val) \
(((__val) != IPMI_OEM_INTEL_NODE_MANAGER_ACTIVE_CORES_CONFIGURATION_RESERVED) ? 1 : 0)
#define IPMI_OEM_INTEL_NODE_MANAGER_TURBO_RATIO_LIMIT_RESTORE_DEFAULT_SETTINGS 0x00
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_enable_disable_node_manager_policy_control_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_enable_disable_node_manager_policy_control_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_boot_time_policy_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_policy_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_policy_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_alert_thresholds_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_alert_thresholds_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_policy_alert_thresholds_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_policy_alert_thresholds_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_suspend_periods_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_policy_suspend_periods_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_policy_suspend_periods_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_policy_suspend_periods_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_reset_node_manager_statistics_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_reset_node_manager_statistics_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_statistics_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_statistics_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_capabilities_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_capabilities_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_version_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_version_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_power_draw_range_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_power_draw_range_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_alert_destination_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_alert_destination_ipmb_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_alert_destination_lan_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_node_manager_alert_destination_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_alert_destination_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_node_manager_alert_destination_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_turbo_synchronization_ratio_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_set_turbo_synchronization_ratio_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_turbo_synchronization_ratio_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_turbo_synchronization_ratio_rs;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_limiting_policy_id_rq;
extern fiid_template_t tmpl_cmd_oem_intel_node_manager_get_limiting_policy_id_rs;
int fill_cmd_oem_intel_node_manager_enable_disable_node_manager_policy_control (uint8_t policy_enable_disable,
uint8_t domain_id,
uint8_t policy_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_policy (uint8_t domain_id,
uint8_t policy_enabled,
uint8_t policy_id,
uint8_t policy_trigger_type,
uint8_t policy_configuration_action,
uint8_t aggressive_cpu_power_correction,
uint8_t policy_storage_option,
uint8_t policy_exception_actions_send_alert,
uint8_t policy_exception_actions_shutdown_system,
uint8_t policy_power_domain,
uint16_t policy_target_limit,
uint32_t correction_time_limit,
uint16_t policy_trigger_limit,
uint16_t statistics_reporting_period,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_policy_boot_time_policy (uint8_t domain_id,
uint8_t policy_enabled,
uint8_t policy_id,
uint8_t policy_trigger_type,
uint8_t policy_configuration_action,
uint8_t aggressive_cpu_power_correction,
uint8_t policy_storage_option,
uint8_t policy_exception_actions_send_alert,
uint8_t policy_exception_actions_shutdown_system,
uint8_t policy_power_domain,
uint8_t platform_booting_mode,
uint8_t cores_disabled,
uint32_t correction_time_limit,
uint16_t policy_trigger_limit,
uint16_t statistics_reporting_period,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_node_manager_policy (uint8_t domain_id,
uint8_t policy_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_policy_alert_thresholds (uint8_t domain_id,
uint8_t policy_id,
uint16_t *alert_threshold1,
uint16_t *alert_threshold2,
uint16_t *alert_threshold3,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_node_manager_policy_alert_thresholds (uint8_t domain_id,
uint8_t policy_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_policy_suspend_periods (uint8_t domain_id,
uint8_t policy_id,
uint8_t *policy1_suspend_start_time,
uint8_t *policy1_suspend_stop_time,
uint8_t *policy1_suspend_period_recurrence_monday,
uint8_t *policy1_suspend_period_recurrence_tuesday,
uint8_t *policy1_suspend_period_recurrence_wednesday,
uint8_t *policy1_suspend_period_recurrence_thursday,
uint8_t *policy1_suspend_period_recurrence_friday,
uint8_t *policy1_suspend_period_recurrence_saturday,
uint8_t *policy1_suspend_period_recurrence_sunday,
uint8_t *policy2_suspend_start_time,
uint8_t *policy2_suspend_stop_time,
uint8_t *policy2_suspend_period_recurrence_monday,
uint8_t *policy2_suspend_period_recurrence_tuesday,
uint8_t *policy2_suspend_period_recurrence_wednesday,
uint8_t *policy2_suspend_period_recurrence_thursday,
uint8_t *policy2_suspend_period_recurrence_friday,
uint8_t *policy2_suspend_period_recurrence_saturday,
uint8_t *policy2_suspend_period_recurrence_sunday,
uint8_t *policy3_suspend_start_time,
uint8_t *policy3_suspend_stop_time,
uint8_t *policy3_suspend_period_recurrence_monday,
uint8_t *policy3_suspend_period_recurrence_tuesday,
uint8_t *policy3_suspend_period_recurrence_wednesday,
uint8_t *policy3_suspend_period_recurrence_thursday,
uint8_t *policy3_suspend_period_recurrence_friday,
uint8_t *policy3_suspend_period_recurrence_saturday,
uint8_t *policy3_suspend_period_recurrence_sunday,
uint8_t *policy4_suspend_start_time,
uint8_t *policy4_suspend_stop_time,
uint8_t *policy4_suspend_period_recurrence_monday,
uint8_t *policy4_suspend_period_recurrence_tuesday,
uint8_t *policy4_suspend_period_recurrence_wednesday,
uint8_t *policy4_suspend_period_recurrence_thursday,
uint8_t *policy4_suspend_period_recurrence_friday,
uint8_t *policy4_suspend_period_recurrence_saturday,
uint8_t *policy4_suspend_period_recurrence_sunday,
uint8_t *policy5_suspend_start_time,
uint8_t *policy5_suspend_stop_time,
uint8_t *policy5_suspend_period_recurrence_monday,
uint8_t *policy5_suspend_period_recurrence_tuesday,
uint8_t *policy5_suspend_period_recurrence_wednesday,
uint8_t *policy5_suspend_period_recurrence_thursday,
uint8_t *policy5_suspend_period_recurrence_friday,
uint8_t *policy5_suspend_period_recurrence_saturday,
uint8_t *policy5_suspend_period_recurrence_sunday,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_node_manager_policy_suspend_periods (uint8_t domain_id,
uint8_t policy_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_reset_node_manager_statistics (uint8_t mode,
uint8_t domain_id,
uint8_t policy_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_node_manager_statistics (uint8_t mode,
uint8_t domain_id,
uint8_t policy_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_node_manager_capabilities (uint8_t domain_id,
uint8_t policy_trigger_type,
uint8_t policy_type,
uint8_t policy_power_domain,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_node_manager_version (fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_power_draw_range (uint8_t domain_id,
uint16_t minimum_power_draw,
uint16_t maximum_power_draw,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_alert_destination (uint8_t channel_number,
uint8_t alert_receiver_deactivation,
uint8_t destination_information,
uint8_t alert_string_selector,
uint8_t send_alert_string,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_alert_destination_ipmb (uint8_t channel_number,
uint8_t alert_receiver_deactivation,
uint8_t slave_address,
uint8_t alert_string_selector,
uint8_t send_alert_string,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_node_manager_alert_destination_lan (uint8_t channel_number,
uint8_t alert_receiver_deactivation,
uint8_t destination_selector,
uint8_t alert_string_selector,
uint8_t send_alert_string,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_node_manager_alert_destination (fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_set_turbo_synchronization_ratio (uint8_t cpu_socket_number,
uint8_t active_cores_configuration,
uint8_t turbo_ratio_limit,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_turbo_synchronization_ratio (uint8_t cpu_socket_number,
uint8_t active_cores_configuration,
fiid_obj_t obj_cmd_rq);
int fill_cmd_oem_intel_node_manager_get_limiting_policy_id (uint8_t domain_id,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_OEM_INTEL_NODE_MANAGER_CMDS_H */

View File

@ -0,0 +1,494 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_PEF_AND_ALERTING_CMDS_H
#define IPMI_PEF_AND_ALERTING_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#include <freeipmi/spec/ipmi-sensor-types-spec.h>
#define IPMI_PEF_CONFIGURATION_PARAMETERS_NO_SET_SELECTOR 0x0
#define IPMI_PEF_CONFIGURATION_PARAMETERS_NO_BLOCK_SELECTOR 0x0
#define IPMI_PEF_CONFIGURATION_PARAMETERS_SET_COMPLETE 0x00
#define IPMI_PEF_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS 0x01
#define IPMI_PEF_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE 0x02
#define IPMI_PEF_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS_VALID(__value) \
(((__value) == IPMI_PEF_CONFIGURATION_PARAMETERS_SET_COMPLETE \
|| (__value) == IPMI_PEF_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS \
|| (__value) == IPMI_PEF_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE) ? 1 : 0)
#define IPMI_PEF_POSTPONE_TIMER_DISABLE 0x00
#define IPMI_PEF_POSTPONE_TIMER_TEMPORARY_DISABLE 0xFE
#define IPMI_PEF_POSTPONE_TIMER_GET_PRESENT_COUNTDOWN_VALUE 0xFF
#define IPMI_PEF_ENABLE 0x1
#define IPMI_PEF_DISABLE 0x0
#define IPMI_PEF_VALID(__val) \
(((__val) == IPMI_PEF_ENABLE \
|| (__val) == IPMI_PEF_DISABLE) ? 1 : 0)
#define IPMI_PEF_ENABLE 0x1
#define IPMI_PEF_DISABLE 0x0
#define IPMI_PEF_VALID(__val) \
(((__val) == IPMI_PEF_ENABLE \
|| (__val) == IPMI_PEF_DISABLE) ? 1 : 0)
#define IPMI_PEF_EVENT_MESSAGES_ENABLE 0x1
#define IPMI_PEF_EVENT_MESSAGES_DISABLE 0x0
#define IPMI_PEF_EVENT_MESSAGES_VALID(__val) \
(((__val) == IPMI_PEF_EVENT_MESSAGES_ENABLE \
|| (__val) == IPMI_PEF_EVENT_MESSAGES_DISABLE) ? 1 : 0)
#define IPMI_PEF_STARTUP_DELAY_ENABLE 0x1
#define IPMI_PEF_STARTUP_DELAY_DISABLE 0x0
#define IPMI_PEF_STARTUP_DELAY_VALID(__val) \
(((__val) == IPMI_PEF_STARTUP_DELAY_ENABLE \
|| (__val) == IPMI_PEF_STARTUP_DELAY_DISABLE) ? 1 : 0)
#define IPMI_PEF_ALERT_STARTUP_DELAY_ENABLE 0x1
#define IPMI_PEF_ALERT_STARTUP_DELAY_DISABLE 0x0
#define IPMI_PEF_ALERT_STARTUP_DELAY_VALID(__val) \
(((__val) == IPMI_PEF_ALERT_STARTUP_DELAY_ENABLE \
|| (__val) == IPMI_PEF_ALERT_STARTUP_DELAY_DISABLE) ? 1 : 0)
#define IPMI_PEF_ALERT_ACTION_ENABLE 0x1
#define IPMI_PEF_ALERT_ACTION_DISABLE 0x0
#define IPMI_PEF_ALERT_ACTION_VALID(__val) \
(((__val) == IPMI_PEF_ALERT_ACTION_ENABLE \
|| (__val) == IPMI_PEF_ALERT_ACTION_DISABLE) ? 1 : 0)
#define IPMI_PEF_POWER_DOWN_ACTION_ENABLE 0x1
#define IPMI_PEF_POWER_DOWN_ACTION_DISABLE 0x0
#define IPMI_PEF_POWER_DOWN_ACTION_VALID(__val) \
(((__val) == IPMI_PEF_POWER_DOWN_ACTION_ENABLE \
|| (__val) == IPMI_PEF_POWER_DOWN_ACTION_DISABLE) ? 1 : 0)
#define IPMI_PEF_RESET_ACTION_ENABLE 0x1
#define IPMI_PEF_RESET_ACTION_DISABLE 0x0
#define IPMI_PEF_RESET_ACTION_VALID(__val) \
(((__val) == IPMI_PEF_RESET_ACTION_ENABLE \
|| (__val) == IPMI_PEF_RESET_ACTION_DISABLE) ? 1 : 0)
#define IPMI_PEF_POWER_CYCLE_ACTION_ENABLE 0x1
#define IPMI_PEF_POWER_CYCLE_ACTION_DISABLE 0x0
#define IPMI_PEF_POWER_CYCLE_ACTION_VALID(__val) \
(((__val) == IPMI_PEF_POWER_CYCLE_ACTION_ENABLE \
|| (__val) == IPMI_PEF_POWER_CYCLE_ACTION_DISABLE) ? 1 : 0)
#define IPMI_PEF_OEM_ACTION_ENABLE 0x1
#define IPMI_PEF_OEM_ACTION_DISABLE 0x0
#define IPMI_PEF_OEM_ACTION_VALID(__val) \
(((__val) == IPMI_PEF_OEM_ACTION_ENABLE \
|| (__val) == IPMI_PEF_OEM_ACTION_DISABLE) ? 1 : 0)
#define IPMI_PEF_DIAGNOSTIC_INTERRUPT_ENABLE 0x1
#define IPMI_PEF_DIAGNOSTIC_INTERRUPT_DISABLE 0x0
#define IPMI_PEF_DIAGNOSTIC_INTERRUPT_VALID(__val) \
(((__val) == IPMI_PEF_DIAGNOSTIC_INTERRUPT_ENABLE \
|| (__val) == IPMI_PEF_DIAGNOSTIC_INTERRUPT_DISABLE) ? 1 : 0)
#define IPMI_FILTER_CONFIGURATION_MANUFACTURER_PRE_CONFIGURED_FILTER 0x2
#define IPMI_FILTER_CONFIGURATION_SOFTWARE_CONFIGURABLE_FILTER 0x0
#define IPMI_FILTER_CONFIGURATION_FILTER_TYPE_VALID(__val) \
(((__val) == IPMI_FILTER_CONFIGURATION_MANUFACTURER_PRE_CONFIGURED_FILTER \
|| (__val) == IPMI_FILTER_CONFIGURATION_SOFTWARE_CONFIGURABLE_FILTER) ? 1 : 0)
#define IPMI_FILTER_CONFIGURATION_FILTER_ENABLE 0x1
#define IPMI_FILTER_CONFIGURATION_FILTER_DISABLE 0x0
#define IPMI_FILTER_CONFIGURATION_FILTER_VALID(__val) \
(((__val) == IPMI_FILTER_CONFIGURATION_FILTER_ENABLE \
|| (__val) == IPMI_FILTER_CONFIGURATION_FILTER_DISABLE) ? 1 : 0)
#define IPMI_EVENT_FILTER_ACTION_ALERT 0x1
#define IPMI_EVENT_FILTER_ACTION_NO_ALERT 0x0
#define IPMI_EVENT_FILTER_ACTION_ALERT_VALID(__val) \
(((__val) == IPMI_EVENT_FILTER_ACTION_ALERT \
|| (__val) == IPMI_EVENT_FILTER_ACTION_NO_ALERT) ? 1 : 0)
#define IPMI_EVENT_FILTER_ACTION_POWER_OFF 0x1
#define IPMI_EVENT_FILTER_ACTION_NO_POWER_OFF 0x0
#define IPMI_EVENT_FILTER_ACTION_POWER_OFF_VALID(__val) \
(((__val) == IPMI_EVENT_FILTER_ACTION_POWER_OFF \
|| (__val) == IPMI_EVENT_FILTER_ACTION_NO_POWER_OFF) ? 1 : 0)
#define IPMI_EVENT_FILTER_ACTION_RESET 0x1
#define IPMI_EVENT_FILTER_ACTION_NO_RESET 0x0
#define IPMI_EVENT_FILTER_ACTION_RESET_VALID(__val) \
(((__val) == IPMI_EVENT_FILTER_ACTION_RESET \
|| (__val) == IPMI_EVENT_FILTER_ACTION_NO_RESET) ? 1 : 0)
#define IPMI_EVENT_FILTER_ACTION_POWER_CYCLE 0x1
#define IPMI_EVENT_FILTER_ACTION_NO_POWER_CYCLE 0x0
#define IPMI_EVENT_FILTER_ACTION_POWER_CYCLE_VALID(__val) \
(((__val) == IPMI_EVENT_FILTER_ACTION_POWER_CYCLE \
|| (__val) == IPMI_EVENT_FILTER_ACTION_NO_POWER_CYCLE) ? 1 : 0)
#define IPMI_EVENT_FILTER_ACTION_OEM_ACTION 0x1
#define IPMI_EVENT_FILTER_ACTION_NO_OEM 0x0
#define IPMI_EVENT_FILTER_ACTION_OEM_VALID(__val) \
(((__val) == IPMI_EVENT_FILTER_ACTION_OEM_ACTION \
|| (__val) == IPMI_EVENT_FILTER_ACTION_NO_OEM) ? 1 : 0)
#define IPMI_EVENT_FILTER_ACTION_DIAGNOSTIC_INTERRUPT 0x1
#define IPMI_EVENT_FILTER_ACTION_NO_DIAGNOSTIC_INTERRUPT 0x0
#define IPMI_EVENT_FILTER_ACTION_DIAGNOSTIC_INTERRUPT_VALID(__val) \
(((__val) == IPMI_EVENT_FILTER_ACTION_DIAGNOSTIC_INTERRUPT \
|| (__val) == IPMI_EVENT_FILTER_ACTION_NO_DIAGNOSTIC_INTERRUPT) ? 1 : 0)
#define IPMI_EVENT_FILTER_ACTION_GROUP_CONTROL_OPERATION 0x1
#define IPMI_EVENT_FILTER_ACTION_NO_GROUP_CONTROL_OPERATION 0x0
#define IPMI_EVENT_FILTER_ACTION_GROUP_CONTROL_OPERATION_VALID(__val) \
(((__val) == IPMI_EVENT_FILTER_ACTION_GROUP_CONTROL_OPERATION \
|| (__val) == IPMI_EVENT_FILTER_ACTION_NO_GROUP_CONTROL_OPERATION) ? 1 : 0)
#define IPMI_EVENT_SEVERITY_UNSPECIFIED 0x00
#define IPMI_EVENT_SEVERITY_MONITOR 0x01
#define IPMI_EVENT_SEVERITY_INFORMATION 0x02
#define IPMI_EVENT_SEVERITY_OK 0x04
#define IPMI_EVENT_SEVERITY_NON_CRITICAL_CONDITION 0x08
#define IPMI_EVENT_SEVERITY_CRITICAL_CONDITION 0x10
#define IPMI_EVENT_SEVERITY_NON_RECOVERABLE_CONDITION 0x20
#define IPMI_EVENT_SEVERITY_VALID(__val) \
(((__val) == IPMI_EVENT_SEVERITY_UNSPECIFIED \
|| (__val) == IPMI_EVENT_SEVERITY_MONITOR \
|| (__val) == IPMI_EVENT_SEVERITY_INFORMATION \
|| (__val) == IPMI_EVENT_SEVERITY_OK \
|| (__val) == IPMI_EVENT_SEVERITY_NON_CRITICAL_CONDITION \
|| (__val) == IPMI_EVENT_SEVERITY_CRITICAL_CONDITION \
|| (__val) == IPMI_EVENT_SEVERITY_NON_RECOVERABLE_CONDITION) ? 1 : 0)
#define IPMI_EVENT_SENSOR_TYPE_RESERVED IPMI_SENSOR_TYPE_RESERVED
#define IPMI_EVENT_SENSOR_TYPE_TEMPERATURE IPMI_SENSOR_TYPE_TEMPERATURE
#define IPMI_EVENT_SENSOR_TYPE_VOLTAGE IPMI_SENSOR_TYPE_VOLTAGE
#define IPMI_EVENT_SENSOR_TYPE_CURRENT IPMI_SENSOR_TYPE_CURRENT
#define IPMI_EVENT_SENSOR_TYPE_FAN IPMI_SENSOR_TYPE_FAN
#define IPMI_EVENT_SENSOR_TYPE_PHYSICAL_SECURITY IPMI_SENSOR_TYPE_PHYSICAL_SECURITY
#define IPMI_EVENT_SENSOR_TYPE_PLATFORM_SECURITY_VIOLATION_ATTEMPT IPMI_SENSOR_TYPE_PLATFORM_SECURITY_VIOLATION_ATTEMPT
#define IPMI_EVENT_SENSOR_TYPE_PROCESSOR IPMI_SENSOR_TYPE_PROCESSOR
#define IPMI_EVENT_SENSOR_TYPE_POWER_SUPPLY IPMI_SENSOR_TYPE_POWER_SUPPLY
#define IPMI_EVENT_SENSOR_TYPE_POWER_UNIT IPMI_SENSOR_TYPE_POWER_UNIT
#define IPMI_EVENT_SENSOR_TYPE_COOLING_DEVICE IPMI_SENSOR_TYPE_COOLING_DEVICE
#define IPMI_EVENT_SENSOR_TYPE_OTHER_UNITS_BASED_SENSOR IPMI_SENSOR_TYPE_OTHER_UNITS_BASED_SENSOR
#define IPMI_EVENT_SENSOR_TYPE_MEMORY IPMI_SENSOR_TYPE_MEMORY
#define IPMI_EVENT_SENSOR_TYPE_DRIVE_SLOT IPMI_SENSOR_TYPE_DRIVE_SLOT
#define IPMI_EVENT_SENSOR_TYPE_POST_MEMORY_RESIZE IPMI_SENSOR_TYPE_POST_MEMORY_RESIZE
#define IPMI_EVENT_SENSOR_TYPE_SYSTEM_FIRMWARE_PROGRESS IPMI_SENSOR_TYPE_SYSTEM_FIRMWARE_PROGRESS
#define IPMI_EVENT_SENSOR_TYPE_EVENT_LOGGING_DISABLED IPMI_SENSOR_TYPE_EVENT_LOGGING_DISABLED
#define IPMI_EVENT_SENSOR_TYPE_WATCHDOG1 IPMI_SENSOR_TYPE_WATCHDOG1
#define IPMI_EVENT_SENSOR_TYPE_SYSTEM_EVENT IPMI_SENSOR_TYPE_SYSTEM_EVENT
#define IPMI_EVENT_SENSOR_TYPE_CRITICAL_INTERRUPT IPMI_SENSOR_TYPE_CRITICAL_INTERRUPT
#define IPMI_EVENT_SENSOR_TYPE_BUTTON_SWITCH IPMI_SENSOR_TYPE_BUTTON_SWITCH
#define IPMI_EVENT_SENSOR_TYPE_MODULE_BOARD IPMI_SENSOR_TYPE_MODULE_BOARD
#define IPMI_EVENT_SENSOR_TYPE_MICROCONTROLLER_COPROCESSOR IPMI_SENSOR_TYPE_MICROCONTROLLER_COPROCESSOR
#define IPMI_EVENT_SENSOR_TYPE_ADD_IN_CARD IPMI_SENSOR_TYPE_ADD_IN_CARD
#define IPMI_EVENT_SENSOR_TYPE_CHASSIS IPMI_SENSOR_TYPE_CHASSIS
#define IPMI_EVENT_SENSOR_TYPE_CHIP_SET IPMI_SENSOR_TYPE_CHIP_SET
#define IPMI_EVENT_SENSOR_TYPE_OTHER_FRU IPMI_SENSOR_TYPE_OTHER_FRU
#define IPMI_EVENT_SENSOR_TYPE_CABLE_INTERCONNECT IPMI_SENSOR_TYPE_CABLE_INTERCONNECT
#define IPMI_EVENT_SENSOR_TYPE_TERMINATOR IPMI_SENSOR_TYPE_TERMINATOR
#define IPMI_EVENT_SENSOR_TYPE_SYSTEM_BOOT_INITIATED IPMI_SENSOR_TYPE_SYSTEM_BOOT_INITIATED
#define IPMI_EVENT_SENSOR_TYPE_BOOT_ERROR IPMI_SENSOR_TYPE_BOOT_ERROR
#define IPMI_EVENT_SENSOR_TYPE_OS_BOOT IPMI_SENSOR_TYPE_OS_BOOT
#define IPMI_EVENT_SENSOR_TYPE_OS_CRITICAL_STOP IPMI_SENSOR_TYPE_OS_CRITICAL_STOP
#define IPMI_EVENT_SENSOR_TYPE_SLOT_CONNECTOR IPMI_SENSOR_TYPE_SLOT_CONNECTOR
#define IPMI_EVENT_SENSOR_TYPE_SYSTEM_ACPI_POWER_STATE IPMI_SENSOR_TYPE_SYSTEM_ACPI_POWER_STATE
#define IPMI_EVENT_SENSOR_TYPE_WATCHDOG2 IPMI_SENSOR_TYPE_WATCHDOG2
#define IPMI_EVENT_SENSOR_TYPE_PLATFORM_ALERT IPMI_SENSOR_TYPE_PLATFORM_ALERT
#define IPMI_EVENT_SENSOR_TYPE_ENTITY_PRESENCE IPMI_SENSOR_TYPE_ENTITY_PRESENCE
#define IPMI_EVENT_SENSOR_TYPE_MONITOR_ASIC_IC IPMI_SENSOR_TYPE_MONITOR_ASIC_IC
#define IPMI_EVENT_SENSOR_TYPE_LAN IPMI_SENSOR_TYPE_LAN
#define IPMI_EVENT_SENSOR_TYPE_MANAGEMENT_SUBSYSTEM_HEALTH IPMI_SENSOR_TYPE_MANAGEMENT_SUBSYSTEM_HEALTH
#define IPMI_EVENT_SENSOR_TYPE_BATTERY IPMI_SENSOR_TYPE_BATTERY
#define IPMI_EVENT_SENSOR_TYPE_SESSION_AUDIT IPMI_SENSOR_TYPE_SESSION_AUDIT
#define IPMI_EVENT_SENSOR_TYPE_VERSION_CHANGE IPMI_SENSOR_TYPE_VERSION_CHANGE
#define IPMI_EVENT_SENSOR_TYPE_FRU_STATE IPMI_SENSOR_TYPE_FRU_STATE
#define IPMI_EVENT_SENSOR_TYPE_ANY 0xff
#define IPMI_STRING_SELECTOR_MIN 0x00
#define IPMI_STRING_SELECTOR_MAX 0x7F
#define IPMI_STRING_SELECTOR_VOLATILE 0x0
/* To avoid gcc warnings, add +1 in comparison */
#define IPMI_STRING_SELECTOR_VALID(__val) \
(((__val+1) >= (IPMI_STRING_SELECTOR_MIN + 1) \
&& (__val) <= IPMI_STRING_SELECTOR_MAX) ? 1 : 0)
#define IPMI_SET_RECORD_ID_FOR_LAST_RECORD_PROCESSED_BY_SOFTWARE 0x0
#define IPMI_SET_RECORD_ID_FOR_LAST_RECORD_PROCESSED_BY_BMC 0x1
#define IPMI_SET_RECORD_ID_FOR_LAST_RECORD_PROCESSED_VALID(__val) \
(((__val) == IPMI_SET_RECORD_ID_FOR_LAST_RECORD_PROCESSED_BY_SOFTWARE \
|| (__val) == IPMI_SET_RECORD_ID_FOR_LAST_RECORD_PROCESSED_BY_BMC) ? 1 : 0)
#define IPMI_ALERT_IMMEDIATE_OPERATION_INITIATE_ALERT 0x0
#define IPMI_ALERT_IMMEDIATE_OPERATION_GET_ALERT_IMMEDIATE_STATUS 0x1
#define IPMI_ALERT_IMMEDIATE_OPERATION_CLEAR_ALERT_IMMEDIATE_STATUS 0x2
#define IPMI_ALERT_IMMEDIATE_OPERATION_RESERVED 0x3
#define IPMI_ALERT_IMMEDIATE_OPERATION_VALID(__val) \
(((__val) == IPMI_ALERT_IMMEDIATE_OPERATION_INITIATE_ALERT \
|| (__val) == IPMI_ALERT_IMMEDIATE_OPERATION_GET_ALERT_IMMEDIATE_STATUS \
|| (__val) == IPMI_ALERT_IMMEDIATE_OPERATION_CLEAR_ALERT_IMMEDIATE_STATUS) ? 1 : 0)
#define IPMI_SEND_ALERT_STRING_IDENTIFIED_BY_STRING_SELECTOR 0x1
#define IPMI_DO_NOT_SEND_AN_ALERT_STRING 0x0
#define IPMI_SEND_ALERT_STRING_VALID(__val) \
(((__val) == IPMI_SEND_ALERT_STRING_IDENTIFIED_BY_STRING_SELECTOR \
|| (__val) == IPMI_DO_NOT_SEND_AN_ALERT_STRING) ? 1 : 0)
#define IPMI_GET_PEF_PARAMETER 0x0
#define IPMI_GET_PEF_PARAMETER_REVISION_ONLY 0x1
#define IPMI_GET_PEF_PARAMETER_VALID(__val) \
(((__val) == IPMI_GET_PEF_PARAMETER \
|| (__val) == IPMI_GET_PEF_PARAMETER_REVISION_ONLY) ? 1 : 0)
#define IPMI_PEF_ALERT_STRINGS_BLOCK_SIZE 16
#define IPMI_PEF_ALERT_STRINGS_BLOCK_SIZE_VALID(__val) \
(((__val) <= IPMI_PEF_ALERT_STRINGS_BLOCK_SIZE) ? 1 : 0)
#define IPMI_ALERT_POLICY_ALWAYS_SEND_TO_THIS_DESTINATION 0x0
#define IPMI_ALERT_POLICY_PROCEED_TO_NEXT_ENTRY 0x1
#define IPMI_ALERT_POLICY_DO_NOT_PROCEED_ANY_MORE_ENTRIES 0x2
#define IPMI_ALERT_POLICY_PROCEED_TO_NEXT_ENTRY_DIFFERENT_CHANNEL 0x3
#define IPMI_ALERT_POLICY_PROCEED_TO_NEXT_ENTRY_DIFFERENT_DESTINATION_TYPE 0x4
#define IPMI_ALERT_POLICY_TABLE_POLICY_TYPE_VALID(__val) \
(((__val) == IPMI_ALERT_POLICY_ALWAYS_SEND_TO_THIS_DESTINATION \
|| (__val) == IPMI_ALERT_POLICY_PROCEED_TO_NEXT_ENTRY \
|| (__val) == IPMI_ALERT_POLICY_DO_NOT_PROCEED_ANY_MORE_ENTRIES \
|| (__val) == IPMI_ALERT_POLICY_PROCEED_TO_NEXT_ENTRY_DIFFERENT_CHANNEL \
|| (__val) == IPMI_ALERT_POLICY_PROCEED_TO_NEXT_ENTRY_DIFFERENT_DESTINATION_TYPE) ? 1 : 0)
#define IPMI_ALERT_POLICY_DISABLED 0x0
#define IPMI_ALERT_POLICY_ENABLED 0x1
#define IPMI_ALERT_POLICY_ENABLED_DISABLED_VALID(__val) \
(((__val) == IPMI_ALERT_POLICY_DISABLED \
|| (__val) == IPMI_ALERT_POLICY_ENABLED) ? 1 : 0)
#define IPMI_EVENT_SPECIFIC_ALERT_STRING_NO 0x0
#define IPMI_EVENT_SPECIFIC_ALERT_STRING_YES 0x1
#define IPMI_EVENT_SPECIFIC_ALERT_STRING_VALID(__val) \
(((__val) == IPMI_EVENT_SPECIFIC_ALERT_STRING_NO \
|| (__val) == IPMI_EVENT_SPECIFIC_ALERT_STRING_YES) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_pef_capabilities_rq;
extern fiid_template_t tmpl_cmd_get_pef_capabilities_rs;
extern fiid_template_t tmpl_cmd_arm_pef_postpone_timer_rq;
extern fiid_template_t tmpl_cmd_arm_pef_postpone_timer_rs;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_set_in_progress_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_pef_control_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_pef_action_global_control_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_pef_startup_delay_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_pef_alert_startup_delay_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_event_filter_table_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_event_filter_table_data1_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_alert_string_keys_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_alert_strings_rq;
extern fiid_template_t tmpl_cmd_set_pef_configuration_parameters_alert_policy_table_rq;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_set_in_progress_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_pef_control_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_pef_action_global_control_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_pef_startup_delay_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_pef_alert_startup_delay_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_number_of_event_filters_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_event_filter_table_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_event_filter_table_data1_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_number_of_alert_policy_entries_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_number_of_alert_strings_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_alert_string_keys_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_alert_strings_rs;
extern fiid_template_t tmpl_cmd_get_pef_configuration_parameters_alert_policy_table_rs;
extern fiid_template_t tmpl_cmd_set_last_processed_event_id_rq;
extern fiid_template_t tmpl_cmd_set_last_processed_event_id_rs;
extern fiid_template_t tmpl_cmd_get_last_processed_event_id_rq;
extern fiid_template_t tmpl_cmd_get_last_processed_event_id_rs;
extern fiid_template_t tmpl_cmd_alert_immediate_rq;
extern fiid_template_t tmpl_cmd_alert_immediate_rs;
extern fiid_template_t tmpl_cmd_pet_acknowledge_rq;
extern fiid_template_t tmpl_cmd_pet_acknowledge_rs;
int fill_cmd_get_pef_capabilities (fiid_obj_t obj_cmd_rq);
int fill_cmd_arm_pef_postpone_timer (uint8_t pef_postpone_timeout,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters (uint8_t parameter_selector,
const void *configuration_parameter_data,
unsigned int configuration_parameter_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_set_in_progress (uint8_t state,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_pef_control (uint8_t pef,
uint8_t pef_event_messages,
uint8_t pef_startup_delay,
uint8_t pef_alert_startup_delay,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_pef_action_global_control (uint8_t alert_action,
uint8_t power_down_action,
uint8_t reset_action,
uint8_t power_cycle_action,
uint8_t oem_action,
uint8_t diagnostic_interrupt,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_pef_startup_delay (uint8_t pef_startup_delay,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_pef_alert_startup_delay (uint8_t pef_alert_startup_delay,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_event_filter_table (uint8_t filter_number,
uint8_t filter_configuration_type,
uint8_t filter_configuration_enable,
uint8_t event_filter_action_alert,
uint8_t event_filter_action_power_off,
uint8_t event_filter_action_reset,
uint8_t event_filter_action_power_cycle,
uint8_t event_filter_action_oem,
uint8_t event_filter_action_diagnostic_interrupt,
uint8_t event_filter_action_group_control_operation,
uint8_t alert_policy_number_policy_number,
uint8_t alert_policy_number_group_control_selector,
uint8_t event_severity,
uint8_t generator_id_byte1,
uint8_t generator_id_byte2,
uint8_t sensor_type,
uint8_t sensor_number,
uint8_t event_trigger,
uint16_t event_data1_offset_mask,
uint8_t event_data1_AND_mask,
uint8_t event_data1_compare1,
uint8_t event_data1_compare2,
uint8_t event_data2_AND_mask,
uint8_t event_data2_compare1,
uint8_t event_data2_compare2,
uint8_t event_data3_AND_mask,
uint8_t event_data3_compare1,
uint8_t event_data3_compare2,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_event_filter_table_data1 (uint8_t filter_number,
uint8_t filter_configuration_type,
uint8_t filter_configuration_enable,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_alert_string_keys (uint8_t string_selector,
uint8_t filter_number,
uint8_t set_number_for_string,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_alert_strings (uint8_t string_selector,
uint8_t block_selector,
const uint8_t *string_data,
unsigned int string_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_pef_configuration_parameters_alert_policy_table (uint8_t alert_policy_entry_number,
uint8_t policy_type,
uint8_t policy_enabled,
uint8_t policy_number,
uint8_t destination_selector,
uint8_t channel_number,
uint8_t alert_string_set_selector,
uint8_t event_specific_alert_string,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_pef_configuration_parameters (uint8_t parameter_selector,
uint8_t get_parameter,
uint8_t set_selector,
uint8_t block_selector,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_last_processed_event_id (uint8_t set_record_id_for_last_record,
uint16_t record_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_last_processed_event_id (fiid_obj_t obj_cmd_rq);
int fill_cmd_alert_immediate (uint8_t channel_number,
uint8_t destination_selector,
uint8_t operation,
uint8_t string_selector,
uint8_t send_alert_string,
fiid_obj_t obj_cmd_rq);
int fill_cmd_pet_acknowledge (uint16_t sequence_number,
uint32_t local_timestamp,
uint8_t event_source_type,
uint8_t sensor_device,
uint8_t sensor_number,
uint32_t event_data,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_PEF_AND_ALERTING_CMDS_H */

View File

@ -0,0 +1,210 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_RMCPPLUS_SUPPORT_AND_PAYLOAD_CMDS_H
#define IPMI_RMCPPLUS_SUPPORT_AND_PAYLOAD_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
/* achu: 4 bit field is 1 based
*
* note that Get Payload Activation Status returns instance status for
* 16 instances, which is not possible.
*/
#define IPMI_PAYLOAD_INSTANCE_MIN 1
#define IPMI_PAYLOAD_INSTANCE_MAX 15
#define IPMI_PAYLOAD_INSTANCE_VALID(__val) \
(((__val) >= IPMI_PAYLOAD_INSTANCE_MIN \
|| (__val) <= IPMI_PAYLOAD_INSTANCE_MAX) ? 1 : 0)
#define IPMI_SOL_STARTUP_HANDSHAKE_CTS_AND_DCD_SDR_ASSERTED 0x0
#define IPMI_SOL_STARTUP_HANDSHAKE_CTS_AND_DCD_SDR_DEASSERTED 0x1
#define IPMI_SOL_STARTUP_HANDSHAKE_CTS_AND_DCD_SDR_VALID(__val) \
(((__val) == IPMI_SOL_STARTUP_HANDSHAKE_CTS_AND_DCD_SDR_ASSERTED \
|| (__val) == IPMI_SOL_STARTUP_HANDSHAKE_CTS_AND_DCD_SDR_DEASSERTED) ? 1 : 0)
#define IPMI_SERIAL_MODEM_ALERTS_FAIL_WHILE_SOL_ACTIVE 0x0
#define IPMI_SERIAL_MODEM_ALERTS_DEFERRED_WHILE_SOL_ACTIVE 0x1
#define IPMI_SERIAL_MODEM_ALERTS_SUCCEED_WHILE_SOL_ACTIVE 0x2
#define IPMI_SERIAL_MODEM_ALERTS_RESERVED 0x3
#define IPMI_SERIAL_MODEM_ALERTS_VALID(__val) \
(((__val) == IPMI_SERIAL_MODEM_ALERTS_FAIL_WHILE_SOL_ACTIVE \
|| (__val) == IPMI_SERIAL_MODEM_ALERTS_DEFERRED_WHILE_SOL_ACTIVE \
|| (__val) == IPMI_SERIAL_MODEM_ALERTS_SUCCEED_WHILE_SOL_ACTIVE) ? 1 : 0)
#define IPMI_TEST_MODE_ACTIVATED 0x1
#define IPMI_TEST_MODE_DEACTIVATED 0x0
#define IPMI_TEST_MODE_VALID(__val) \
(((__val) == IPMI_TEST_MODE_ACTIVATED \
|| (__val) == IPMI_TEST_MODE_DEACTIVATED) ? 1 : 0)
#define IPMI_ACTIVATE_PAYLOAD_WITH_AUTHENTICATION 0x1
#define IPMI_ACTIVATE_PAYLOAD_WITHOUT_AUTHENTICATION 0x0
#define IPMI_AUTHENTICATION_ACTIVATION_VALID(__val) \
(((__val) == IPMI_ACTIVATE_PAYLOAD_WITH_AUTHENTICATION \
|| (__val) == IPMI_ACTIVATE_PAYLOAD_WITHOUT_AUTHENTICATION) ? 1 : 0)
#define IPMI_ACTIVATE_PAYLOAD_WITH_ENCRYPTION 0x1
#define IPMI_ACTIVATE_PAYLOAD_WITHOUT_ENCRYPTION 0x0
#define IPMI_ENCRYPTION_ACTIVATION_VALID(__val) \
(((__val) == IPMI_ACTIVATE_PAYLOAD_WITH_ENCRYPTION \
|| (__val) == IPMI_ACTIVATE_PAYLOAD_WITHOUT_ENCRYPTION) ? 1 : 0)
#define IPMI_TEST_MODE_NOT_SUPPORTED 0x0
#define IPMI_TEST_MODE_ENABLED 0x1
#define IPMI_SUSPEND_ENCRYPTION 0x0
#define IPMI_RESUME_ENCRYPTION 0x1
#define IPMI_REGENERATE_INITIALIZATION_VECTOR 0x2
#define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTION_OPERATION_VALID(__val) \
(((__val) == IPMI_SUSPEND_ENCRYPTION \
|| (__val) == IPMI_RESUME_ENCRYPTION \
|| (__val) == IPMI_REGENERATE_INITIALIZATION_VECTOR) ? 1 : 0)
#define IPMI_SET_USER_PAYLOAD_OPERATION_ENABLE 0x00
#define IPMI_SET_USER_PAYLOAD_OPERATION_DISABLE 0x01
#define IPMI_SET_USER_PAYLOAD_OPERATION_VALID(__val) \
(((__val) == IPMI_SET_USER_PAYLOAD_OPERATION_ENABLE \
|| (__val) == IPMI_SET_USER_PAYLOAD_OPERATION_DISABLE) ? 1 : 0)
/* achu: See IPMI Spec Set User Payload Access command. Enable may be
* 0 or 1, and Disable may be 0 or 1 as well.
*/
#define IPMI_PAYLOAD_ACCESS_VALID(__val) \
(((__val) == 0 \
|| (__val) == 1) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_activate_payload_rq;
extern fiid_template_t tmpl_cmd_activate_payload_sol_rq;
extern fiid_template_t tmpl_cmd_activate_payload_rs;
extern fiid_template_t tmpl_cmd_activate_payload_sol_rs;
extern fiid_template_t tmpl_cmd_deactivate_payload_rq;
extern fiid_template_t tmpl_cmd_deactivate_payload_rs;
extern fiid_template_t tmpl_cmd_suspend_resume_payload_encryption_rq;
extern fiid_template_t tmpl_cmd_suspend_resume_payload_encryption_rq;
extern fiid_template_t tmpl_cmd_get_payload_activation_status_rq;
extern fiid_template_t tmpl_cmd_get_payload_activation_status_rs;
extern fiid_template_t tmpl_cmd_get_payload_instance_info_rq;
extern fiid_template_t tmpl_cmd_get_payload_instance_info_rs;
extern fiid_template_t tmpl_cmd_set_user_payload_access_rq;
extern fiid_template_t tmpl_cmd_set_user_payload_access_rs;
extern fiid_template_t tmpl_cmd_get_user_payload_access_rq;
extern fiid_template_t tmpl_cmd_get_user_payload_access_rs;
extern fiid_template_t tmpl_cmd_get_channel_payload_support_rq;
extern fiid_template_t tmpl_cmd_get_channel_payload_support_rs;
extern fiid_template_t tmpl_cmd_get_channel_payload_version_rq;
extern fiid_template_t tmpl_cmd_get_channel_payload_version_rs;
extern fiid_template_t tmpl_cmd_get_channel_oem_payload_info_rq;
extern fiid_template_t tmpl_cmd_get_channel_oem_payload_info_rs;
int fill_cmd_activate_payload (uint8_t payload_type,
uint8_t payload_instance,
const void *auxiliary_request_data,
unsigned int auxiliary_request_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_activate_payload_sol (uint8_t payload_type,
uint8_t payload_instance,
uint8_t sol_startup_handshake,
uint8_t shared_serial_alert_behavior,
uint8_t test_mode,
uint8_t authentication_activation,
uint8_t encryption_activation,
fiid_obj_t obj_cmd_rq);
int fill_cmd_deactivate_payload (uint8_t payload_type,
uint8_t payload_instance,
uint32_t payload_auxiliary_data,
fiid_obj_t obj_cmd_rq);
int fill_cmd_suspend_resume_payload_encryption (uint8_t payload_type,
uint8_t payload_instance,
uint8_t operation,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_payload_activation_status (uint8_t payload_type,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_payload_instance_info (uint8_t payload_type,
uint8_t payload_instance,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_user_payload_access (uint8_t channel_number,
uint8_t user_id,
uint8_t operation,
uint8_t standard_payload_1,
uint8_t standard_payload_2,
uint8_t standard_payload_3,
uint8_t standard_payload_4,
uint8_t standard_payload_5,
uint8_t standard_payload_6,
uint8_t standard_payload_7,
uint8_t oem_payload_0,
uint8_t oem_payload_1,
uint8_t oem_payload_2,
uint8_t oem_payload_3,
uint8_t oem_payload_4,
uint8_t oem_payload_5,
uint8_t oem_payload_6,
uint8_t oem_payload_7,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_user_payload_access (uint8_t channel_number,
uint8_t user_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_channel_payload_support (uint8_t channel_number,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_channel_payload_version (uint8_t channel_number,
uint8_t payload_type,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_channel_oem_payload_info (uint8_t channel_number,
uint8_t payload_type,
uint32_t oem_iana,
uint16_t oem_payload_id,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_RMCPPLUS_SUPPORT_AND_PAYLOAD_CMDS_H */

View File

@ -0,0 +1,87 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_SDR_REPOSITORY_CMDS_H
#define IPMI_SDR_REPOSITORY_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_SDR_MODAL_NON_MODAL_REPOSITORY_UPDATE_OP_UNSPECIFIED 0x0
#define IPMI_SDR_NON_MODAL_REPOSITORY_UPDATE_OP_SUPPORTED 0x1
#define IPMI_SDR_MODAL_REPOSITORY_UPDATE_OP_SUPPORTED 0x2
#define IPMI_SDR_MODAL_NON_MODAL_REPOSITORY_UPDATE_OP_SUPPORTED 0x3
#define IPMI_SDR_IPMB_SLAVE_ADDRESS 0x0
#define IPMI_SDR_SYSTEM_SOFTWARE_ID 0x1
#define IPMI_SDR_RECORD_ID_FIRST 0x0000
#define IPMI_SDR_RECORD_ID_LAST 0xFFFF
#define IPMI_SDR_READ_ENTIRE_RECORD_BYTES_TO_READ 0xFF
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_sdr_repository_info_rq;
extern fiid_template_t tmpl_cmd_get_sdr_repository_info_rs;
extern fiid_template_t tmpl_cmd_get_sdr_repository_allocation_info_rq;
extern fiid_template_t tmpl_cmd_get_sdr_repository_allocation_info_rs;
extern fiid_template_t tmpl_cmd_reserve_sdr_repository_rq;
extern fiid_template_t tmpl_cmd_reserve_sdr_repository_rs;
extern fiid_template_t tmpl_cmd_get_sdr_rq;
extern fiid_template_t tmpl_cmd_get_sdr_rs;
extern fiid_template_t tmpl_cmd_get_sdr_repository_time_rq;
extern fiid_template_t tmpl_cmd_get_sdr_repository_time_rs;
extern fiid_template_t tmpl_cmd_set_sdr_repository_time_rq;
extern fiid_template_t tmpl_cmd_set_sdr_repository_time_rs;
int fill_cmd_get_repository_info (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_repository_allocation_info (fiid_obj_t obj_cmd_rq);
int fill_cmd_reserve_sdr_repository (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sdr (uint16_t reservation_id,
uint16_t record_id,
uint8_t offset_into_record,
uint8_t bytes_to_read,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sdr_repository_time (fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sdr_repository_time (uint32_t time, fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_SDR_REPOSITORY_CMDS_H */

View File

@ -0,0 +1,150 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_SEL_CMDS_H
#define IPMI_SEL_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_SEL_GET_RECORD_ID_FIRST_ENTRY 0x0000
#define IPMI_SEL_GET_RECORD_ID_LAST_ENTRY 0xFFFF
#define IPMI_SEL_CLEAR_OPERATION_INITIATE_ERASE 0xAA
#define IPMI_SEL_CLEAR_OPERATION_GET_ERASURE_STATUS 0x0
#define IPMI_SEL_CLEAR_OPERATION_VALID(__val) \
(((__val) == IPMI_SEL_CLEAR_OPERATION_INITIATE_ERASE \
|| (__val) == IPMI_SEL_CLEAR_OPERATION_GET_ERASURE_STATUS) ? 1 : 0)
#define IPMI_SEL_CLEAR_ERASURE_IN_PROGRESS 0x0
#define IPMI_SEL_CLEAR_ERASE_COMPLETED 0x1
#define IPMI_SEL_READ_ENTIRE_RECORD_BYTES_TO_READ 0xFF
#define IPMI_SEL_TIME_UTC_OFFSET_MIN -1440
#define IPMI_SEL_TIME_UTC_OFFSET_MAX 1440
#define IPMI_SEL_TIME_UTC_OFFSET_UNSPECIFIED 0x07FF
#define IPMI_SEL_TIME_UTC_OFFSET_VALID(__val) \
((((__val) >= IPMI_SEL_TIME_UTC_OFFSET_MIN \
&& (__val) <= IPMI_SEL_TIME_UTC_OFFSET_MAX) \
|| (__val) == IPMI_SEL_TIME_UTC_OFFSET_UNSPECIFIED) ? 1 : 0)
#define IPMI_AUXILIARY_LOG_TYPE_MCA 0x00
#define IPMI_AUXILIARY_LOG_TYPE_OEM1 0x01
#define IPMI_AUXILIARY_LOG_TYPE_OEM2 0x02
#define IPMI_AUXILIARY_LOG_TYPE_VALID(__val) \
(((__val) == IPMI_AUXILIARY_LOG_TYPE_MCA \
|| (__val) == IPMI_AUXILIARY_LOG_TYPE_OEM1 \
|| (__val) == IPMI_AUXILIARY_LOG_TYPE_OEM2) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_sel_info_rq;
extern fiid_template_t tmpl_cmd_get_sel_info_rs;
extern fiid_template_t tmpl_cmd_get_sel_allocation_info_rq;
extern fiid_template_t tmpl_cmd_get_sel_allocation_info_rs;
extern fiid_template_t tmpl_cmd_reserve_sel_rq;
extern fiid_template_t tmpl_cmd_reserve_sel_rs;
extern fiid_template_t tmpl_cmd_get_sel_entry_rq;
extern fiid_template_t tmpl_cmd_get_sel_entry_rs;
extern fiid_template_t tmpl_cmd_delete_sel_entry_rq;
extern fiid_template_t tmpl_cmd_delete_sel_entry_rs;
extern fiid_template_t tmpl_cmd_clear_sel_rq;
extern fiid_template_t tmpl_cmd_clear_sel_rs;
extern fiid_template_t tmpl_cmd_get_sel_time_rq;
extern fiid_template_t tmpl_cmd_get_sel_time_rs;
extern fiid_template_t tmpl_cmd_set_sel_time_rq;
extern fiid_template_t tmpl_cmd_set_sel_time_rs;
extern fiid_template_t tmpl_cmd_get_sel_time_utc_offset_rq;
extern fiid_template_t tmpl_cmd_get_sel_time_utc_offset_rs;
extern fiid_template_t tmpl_cmd_set_sel_time_utc_offset_rq;
extern fiid_template_t tmpl_cmd_set_sel_time_utc_offset_rs;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_rq;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_rs;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_mca_rs;
extern fiid_template_t tmpl_cmd_get_auxiliary_log_status_oem_rs;
extern fiid_template_t tmpl_cmd_set_auxiliary_log_status_rq;
extern fiid_template_t tmpl_cmd_set_auxiliary_log_status_rs;
int fill_cmd_get_sel_info (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sel_allocation_info (fiid_obj_t obj_cmd_rq);
int fill_cmd_reserve_sel (fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sel_entry (uint16_t reservation_id,
uint16_t record_id,
uint8_t offset_into_record,
uint8_t bytes_to_read,
fiid_obj_t obj_cmd_rq);
int fill_cmd_delete_sel_entry (uint16_t reservation_id,
uint16_t record_id,
fiid_obj_t obj_cmd_rq);
int fill_cmd_clear_sel (uint16_t reservation_id,
uint8_t operation,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sel_time (fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sel_time (uint32_t time, fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sel_time_utc_offset (fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sel_time_utc_offset (int16_t offset, fiid_obj_t obj_cmd_rq);
int fill_cmd_get_auxiliary_log_status (uint8_t log_type,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_auxiliary_log_status (uint8_t log_type,
const void *log_data,
unsigned int log_data_len,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_SEL_CMDS_H */

View File

@ -0,0 +1,321 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_SENSOR_CMDS_H
#define IPMI_SENSOR_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_SENSOR_GET_SENSOR_COUNT 0x00
#define IPMI_SENSOR_GET_SDR_COUNT 0x01
#define IPMI_SENSOR_GET_SDR_INFO_OPERATION_VALID(__val) \
(((__val) == IPMI_SENSOR_GET_SENSOR_COUNT \
|| (__val) == IPMI_SENSOR_GET_SDR_COUNT) ? 1 : 0)
#define IPMI_SENSOR_STATIC_SENSOR_POPULATION 0x0
#define IPMI_SENSOR_DYNAMIC_SENSOR_POPULATION 0x1
/* achu: as of IPMI 2.0 hysteresis_mask reserved for future - write as 0xFF */
#define IPMI_SENSOR_HYSTERESIS_MASK 0xFF
#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_DO_NOT_CHANGE_INDIVIDUAL_ENABLES 0x0
#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_ENABLE_SELECTED_EVENT_MESSAGES 0x1
#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_DISABLE_SELECTED_EVENT_MESSAGES 0x2
#define IPMI_SENSOR_EVENT_MESSAGE_ACTION_VALID(__val) \
(((__val) == IPMI_SENSOR_EVENT_MESSAGE_ACTION_DO_NOT_CHANGE_INDIVIDUAL_ENABLES \
|| (__val) == IPMI_SENSOR_EVENT_MESSAGE_ACTION_ENABLE_SELECTED_EVENT_MESSAGES \
|| (__val) == IPMI_SENSOR_EVENT_MESSAGE_ACTION_DISABLE_SELECTED_EVENT_MESSAGES) ? 1 : 0)
#define IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_ENABLE 0x1
#define IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_DISABLE 0x0
#define IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_VALID(__val) \
(((__val) == IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_ENABLE \
|| (__val) == IPMI_SENSOR_SCANNING_ON_THIS_SENSOR_DISABLE) ? 1 : 0)
#define IPMI_SENSOR_ALL_EVENT_MESSAGES_ENABLE 0x1
#define IPMI_SENSOR_ALL_EVENT_MESSAGES_DISABLE 0x0
#define IPMI_SENSOR_ALL_EVENT_MESSAGES_VALID(__val) \
(((__val) == IPMI_SENSOR_ALL_EVENT_MESSAGES_ENABLE \
|| (__val) == IPMI_SENSOR_ALL_EVENT_MESSAGES_DISABLE) ? 1 : 0)
#define IPMI_SENSOR_EVENT_FLAG_ENABLE 0x1
#define IPMI_SENSOR_EVENT_FLAG_DISABLE 0x0
#define IPMI_SENSOR_EVENT_FLAG_VALID(__val) \
(((__val) == IPMI_SENSOR_EVENT_FLAG_ENABLE \
|| (__val) == IPMI_SENSOR_EVENT_FLAG_DISABLE) ? 1 : 0)
/* achu: Yes, this one is backwards. I don't know why */
#define IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_ENABLED 0x0
#define IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_DISABLED 0x1
#define IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_VALID(__val) \
(((__val) == IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_ENABLED \
|| (__val) == IPMI_SENSOR_RE_ARM_ALL_EVENT_STATUS_DISABLED) ? 1 : 0)
/* achu: Yes, this one is backwards. I don't know why */
#define IPMI_SENSOR_READING_STATE_UNAVAILABLE 0x1
#define IPMI_SENSOR_READING_STATE_AVAILABLE 0x0
#define IPMI_SENSOR_THRESHOLD_SET 0x1
#define IPMI_SENSOR_THRESHOLD_NOT_SET 0x0
#define IPMI_SENSOR_READING_OPERATION_WRITE_GIVEN_VALUE_TO_SENSOR_READING_BYTE 0x01
#define IPMI_SENSOR_READING_OPERATION_DONT_CHANGE_SENSOR_READING_BYTE 0x00
#define IPMI_SENSOR_READING_OPERATION_VALID(__val) \
(((__val) == IPMI_SENSOR_READING_OPERATION_WRITE_GIVEN_VALUE_TO_SENSOR_READING_BYTE \
|| (__val) == IPMI_SENSOR_READING_OPERATION_DONT_CHANGE_SENSOR_READING_BYTE) ? 1 : 0)
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_CLEAR_EVENT_STATUS_BITS 0x03
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_SET_EVENT_STATUS_BITS 0x02
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_WRITE_EVENT_STATUS_BITS 0x01
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_DONT_CHANGE_EVENT_STATUS_BITS 0x00
#define IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_VALID(__val) \
(((__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_CLEAR_EVENT_STATUS_BITS \
|| (__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_SET_EVENT_STATUS_BITS \
|| (__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_WRITE_EVENT_STATUS_BITS \
|| (__val) == IPMI_ASSERTION_DEASSERTION_EVENT_STATUS_BITS_OPERATION_DONT_CHANGE_EVENT_STATUS_BITS) ? 1 : 0)
#define IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_EXCLUDING_EVENT_OFFSET 0x02
#define IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_INCLUDING_EVENT_OFFSET 0x01
#define IPMI_EVENT_DATA_BYTES_OPERATION_DONT_WRITE_EVENT_DATA_BYTES 0x00
#define IPMI_EVENT_DATA_BYTES_OPERATION_VALID(__val) \
(((__val) == IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_EXCLUDING_EVENT_OFFSET \
|| (__val) == IPMI_EVENT_DATA_BYTES_OPERATION_WRITE_EVENT_DATA_BYTES_INCLUDING_EVENT_OFFSET \
|| (__val) == IPMI_EVENT_DATA_BYTES_OPERATION_DONT_WRITE_EVENT_DATA_BYTES) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_get_device_sdr_info_rq;
extern fiid_template_t tmpl_cmd_get_device_sdr_info_rs;
extern fiid_template_t tmpl_cmd_get_device_sdr_rq;
extern fiid_template_t tmpl_cmd_get_device_sdr_rs;
extern fiid_template_t tmpl_cmd_reserve_device_sdr_repository_rq;
extern fiid_template_t tmpl_cmd_reserve_device_sdr_repository_rs;
extern fiid_template_t tmpl_cmd_get_sensor_reading_factors_rq;
extern fiid_template_t tmpl_cmd_get_sensor_reading_factors_rs;
extern fiid_template_t tmpl_cmd_set_sensor_hysteresis_rq;
extern fiid_template_t tmpl_cmd_set_sensor_hysteresis_rs;
extern fiid_template_t tmpl_cmd_get_sensor_hysteresis_rq;
extern fiid_template_t tmpl_cmd_get_sensor_hysteresis_rs;
extern fiid_template_t tmpl_cmd_set_sensor_thresholds_rq;
extern fiid_template_t tmpl_cmd_set_sensor_thresholds_rs;
extern fiid_template_t tmpl_cmd_get_sensor_thresholds_rq;
extern fiid_template_t tmpl_cmd_get_sensor_thresholds_rs;
extern fiid_template_t tmpl_cmd_set_sensor_event_enable_rq;
extern fiid_template_t tmpl_cmd_set_sensor_event_enable_threshold_rq;
extern fiid_template_t tmpl_cmd_set_sensor_event_enable_discrete_rq;
extern fiid_template_t tmpl_cmd_set_sensor_event_enable_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_enable_rq;
extern fiid_template_t tmpl_cmd_get_sensor_event_enable_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_enable_threshold_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_enable_discrete_rs;
extern fiid_template_t tmpl_cmd_re_arm_sensor_events_rq;
extern fiid_template_t tmpl_cmd_re_arm_sensor_events_threshold_rq;
extern fiid_template_t tmpl_cmd_re_arm_sensor_events_discrete_rq;
extern fiid_template_t tmpl_cmd_re_arm_sensor_events_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_status_rq;
extern fiid_template_t tmpl_cmd_get_sensor_event_status_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_status_threshold_rs;
extern fiid_template_t tmpl_cmd_get_sensor_event_status_discerete_rs;
extern fiid_template_t tmpl_cmd_get_sensor_reading_rq;
extern fiid_template_t tmpl_cmd_get_sensor_reading_rs;
extern fiid_template_t tmpl_cmd_get_sensor_reading_threshold_rs;
extern fiid_template_t tmpl_cmd_get_sensor_reading_discrete_rs;
extern fiid_template_t tmpl_cmd_set_sensor_type_rq;
extern fiid_template_t tmpl_cmd_set_sensor_type_rs;
extern fiid_template_t tmpl_cmd_get_sensor_type_rq;
extern fiid_template_t tmpl_cmd_get_sensor_type_rs;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_threshold_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_discrete_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_event_fields_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_threshold_event_fields_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_discrete_event_fields_rq;
extern fiid_template_t tmpl_cmd_set_sensor_reading_and_event_status_rs;
int fill_cmd_get_device_sdr_info (uint8_t operation,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_device_sdr (uint16_t reservation_id,
uint16_t record_id,
uint8_t offset_into_record,
uint8_t bytes_to_read,
fiid_obj_t obj_cmd_rq);
int fill_cmd_reserve_device_sdr_repository (fiid_obj_t obj_cmd_rq);
/* achu: as of IPMI 2.0 hysteresis_mask reserved for future - write as 0xFF */
int fill_cmd_set_sensor_hysteresis (uint8_t sensor_number,
uint8_t hysteresis_mask,
uint8_t positive_going_threshold_hysteresis_value,
uint8_t negative_going_threshold_hysteresis_value,
fiid_obj_t obj_cmd_rq);
/* achu: as of IPMI 2.0 hysteresis_mask reserved for future - write as 0xFF */
int fill_cmd_get_sensor_hysteresis (uint8_t sensor_number,
uint8_t hysteresis_mask,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sensor_thresholds (uint8_t sensor_number,
const uint8_t *lower_non_critical_threshold,
const uint8_t *lower_critical_threshold,
const uint8_t *lower_non_recoverable_threshold,
const uint8_t *upper_non_critical_threshold,
const uint8_t *upper_critical_threshold,
const uint8_t *upper_non_recoverable_threshold,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sensor_thresholds (uint8_t sensor_number, fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sensor_event_enable (uint8_t sensor_number,
uint8_t event_message_action,
uint8_t scanning_on_this_sensor,
uint8_t all_event_messages,
uint16_t assertion_event_bitmask,
uint16_t deassertion_event_bitmask,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sensor_event_enable_threshold (uint8_t sensor_number,
uint8_t event_message_action,
uint8_t scanning_on_this_sensor,
uint8_t all_event_messages,
uint8_t assertion_event_lower_non_critical_going_low,
uint8_t assertion_event_lower_non_critical_going_high,
uint8_t assertion_event_lower_critical_going_low,
uint8_t assertion_event_lower_critical_going_high,
uint8_t assertion_event_lower_non_recoverable_going_low,
uint8_t assertion_event_lower_non_recoverable_going_high,
uint8_t assertion_event_upper_non_critical_going_low,
uint8_t assertion_event_upper_non_critical_going_high,
uint8_t assertion_event_upper_critical_going_low,
uint8_t assertion_event_upper_critical_going_high,
uint8_t assertion_event_upper_non_recoverable_going_low,
uint8_t assertion_event_upper_non_recoverable_going_high,
uint8_t deassertion_event_lower_non_critical_going_low,
uint8_t deassertion_event_lower_non_critical_going_high,
uint8_t deassertion_event_lower_critical_going_low,
uint8_t deassertion_event_lower_critical_going_high,
uint8_t deassertion_event_lower_non_recoverable_going_low,
uint8_t deassertion_event_lower_non_recoverable_going_high,
uint8_t deassertion_event_upper_non_critical_going_low,
uint8_t deassertion_event_upper_non_critical_going_high,
uint8_t deassertion_event_upper_critical_going_low,
uint8_t deassertion_event_upper_critical_going_high,
uint8_t deassertion_event_upper_non_recoverable_going_low,
uint8_t deassertion_event_upper_non_recoverable_going_high,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sensor_event_enable_discrete (uint8_t sensor_number,
uint8_t event_message_action,
uint8_t scanning_on_this_sensor,
uint8_t all_event_messages,
uint8_t assertion_event_state_bit_0,
uint8_t assertion_event_state_bit_1,
uint8_t assertion_event_state_bit_2,
uint8_t assertion_event_state_bit_3,
uint8_t assertion_event_state_bit_4,
uint8_t assertion_event_state_bit_5,
uint8_t assertion_event_state_bit_6,
uint8_t assertion_event_state_bit_7,
uint8_t assertion_event_state_bit_8,
uint8_t assertion_event_state_bit_9,
uint8_t assertion_event_state_bit_10,
uint8_t assertion_event_state_bit_11,
uint8_t assertion_event_state_bit_12,
uint8_t assertion_event_state_bit_13,
uint8_t assertion_event_state_bit_14,
uint8_t deassertion_event_state_bit_0,
uint8_t deassertion_event_state_bit_1,
uint8_t deassertion_event_state_bit_2,
uint8_t deassertion_event_state_bit_3,
uint8_t deassertion_event_state_bit_4,
uint8_t deassertion_event_state_bit_5,
uint8_t deassertion_event_state_bit_6,
uint8_t deassertion_event_state_bit_7,
uint8_t deassertion_event_state_bit_8,
uint8_t deassertion_event_state_bit_9,
uint8_t deassertion_event_state_bit_10,
uint8_t deassertion_event_state_bit_11,
uint8_t deassertion_event_state_bit_12,
uint8_t deassertion_event_state_bit_13,
uint8_t deassertion_event_state_bit_14,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sensor_event_enable (uint8_t sensor_number, fiid_obj_t obj_cmd_rq);
int fill_cmd_re_arm_sensor_events (uint8_t sensor_number,
uint8_t re_arm_all_event_status_from_this_sensor,
uint16_t *re_arm_assertion_event,
uint16_t *re_arm_deassertion_event,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sensor_reading (uint8_t sensor_number, fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sensor_reading_and_event_status (uint8_t sensor_number,
uint8_t sensor_reading_operation,
uint8_t deassertion_bits_operation,
uint8_t assertion_bits_operation,
uint8_t event_data_bytes_operation,
uint8_t sensor_reading,
uint16_t assertion_event_bitmask,
uint16_t deassertion_event_bitmask,
uint8_t event_data1,
uint8_t event_data2,
uint8_t event_data3,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_SENSOR_CMDS_H */

View File

@ -0,0 +1,173 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_SERIAL_MODEM_CMDS_H
#define IPMI_SERIAL_MODEM_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_SERIAL_MODEM_CONFIGURATION_NO_SET_SELECTOR 0x0
#define IPMI_SERIAL_MODEM_CONFIGURATION_NO_BLOCK_SELECTOR 0x0
#define IPMI_SERIAL_MODEM_CONFIGURATION_PARAMETERS_SET_COMPLETE 0x00
#define IPMI_SERIAL_MODEM_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS 0x01
#define IPMI_SERIAL_MODEM_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE 0x02
#define IPMI_SERIAL_MODEM_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS_VALID(__value) \
(((__value) == IPMI_SERIAL_MODEM_CONFIGURATION_PARAMETERS_SET_COMPLETE \
|| (__value) == IPMI_SERIAL_MODEM_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS \
|| (__value) == IPMI_SERIAL_MODEM_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE) ? 1 : 0)
#define IPMI_BASIC_MODE_ENABLE 0x1
#define IPMI_BASIC_MODE_DISABLE 0x0
#define IPMI_BASIC_MODE_VALID(__val) \
(((__val) == IPMI_BASIC_MODE_ENABLE \
|| (__val) == IPMI_BASIC_MODE_DISABLE) ? 1 : 0)
#define IPMI_PPP_MODE_ENABLE 0x1
#define IPMI_PPP_MODE_DISABLE 0x0
#define IPMI_PPP_MODE_VALID(__val) \
(((__val) == IPMI_PPP_MODE_ENABLE \
|| (__val) == IPMI_PPP_MODE_DISABLE) ? 1 : 0)
#define IPMI_TERMINAL_MODE_ENABLE 0x1
#define IPMI_TERMINAL_MODE_DISABLE 0x0
#define IPMI_TERMINAL_MODE_VALID(__val) \
(((__val) == IPMI_TERMINAL_MODE_ENABLE \
|| (__val) == IPMI_TERMINAL_MODE_DISABLE) ? 1 : 0)
#define IPMI_CONNECT_MODE_DIRECT 0x1
#define IPMI_CONNECT_MODE_MODEM 0x0
#define IPMI_CONNECT_MODE_VALID(__val) \
(((__val) == IPMI_CONNECT_MODE_DIRECT \
|| (__val) == IPMI_CONNECT_MODE_MODEM) ? 1 : 0)
#define IPMI_DTR_HANGUP_ENABLE 0x1
#define IPMI_DTR_HANGUP_DISABLE 0x0
#define IPMI_DTR_HANGUP_VALID(__val) \
(((__val) == IPMI_DTR_HANGUP_ENABLE \
|| (__val) == IPMI_DTR_HANGUP_DISABLE) ? 1 : 0)
#define IPMI_FLOW_CONTROL_NO_FLOW_CONTROL 0x0
#define IPMI_FLOW_CONTROL_RTS_CTS_FLOW_CONTROL 0x1
#define IPMI_FLOW_CONTROL_XON_XOFF_FLOW_CONTROL 0x2
#define IPMI_FLOW_CONTROL_RESERVED 0x3
#define IPMI_FLOW_CONTROL_VALID(__val) \
(((__val) == IPMI_FLOW_CONTROL_NO_FLOW_CONTROL \
|| (__val) == IPMI_FLOW_CONTROL_RTS_CTS_FLOW_CONTROL \
|| (__val) == IPMI_FLOW_CONTROL_XON_XOFF_FLOW_CONTROL) ? 1 : 0)
#define IPMI_BIT_RATE_9600_BPS 0x6
#define IPMI_BIT_RATE_19200_BPS 0x7
#define IPMI_BIT_RATE_38400_BPS 0x8
#define IPMI_BIT_RATE_57600_BPS 0x9
#define IPMI_BIT_RATE_115200_BPS 0xA
#define IPMI_BIT_RATE_VALID(__val) \
(((__val) == IPMI_BIT_RATE_9600_BPS \
|| (__val) == IPMI_BIT_RATE_19200_BPS \
|| (__val) == IPMI_BIT_RATE_38400_BPS \
|| (__val) == IPMI_BIT_RATE_57600_BPS \
|| (__val) == IPMI_BIT_RATE_115200_BPS) ? 1 : 0)
#define IPMI_GET_SERIAL_MODEM_PARAMETER 0x0
#define IPMI_GET_SERIAL_MODEM_PARAMETER_REVISION_ONLY 0x1
#define IPMI_GET_SERIAL_MODEM_PARAMETER_VALID(__flag) \
(((__flag) == IPMI_GET_SERIAL_MODEM_PARAMETER \
|| (__flag) == IPMI_GET_SERIAL_MODEM_PARAMETER_REVISION_ONLY) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_set_serial_modem_configuration_rq;
extern fiid_template_t tmpl_cmd_set_serial_modem_configuration_rs;
extern fiid_template_t tmpl_cmd_set_serial_modem_configuration_set_in_progress_rq;
extern fiid_template_t tmpl_cmd_set_serial_modem_configuration_connection_mode_rq;
extern fiid_template_t tmpl_cmd_set_serial_modem_configuration_ipmi_messaging_comm_settings_rq;
extern fiid_template_t tmpl_cmd_set_serial_modem_configuration_page_blackout_interval_rq;
extern fiid_template_t tmpl_cmd_set_serial_modem_configuration_call_retry_interval_rq;
extern fiid_template_t tmpl_cmd_get_serial_modem_configuration_rq;
extern fiid_template_t tmpl_cmd_get_serial_modem_configuration_rs;
extern fiid_template_t tmpl_cmd_get_serial_modem_configuration_set_in_progress_rs;
extern fiid_template_t tmpl_cmd_get_serial_modem_configuration_connection_mode_rs;
extern fiid_template_t tmpl_cmd_get_serial_modem_configuration_ipmi_messaging_comm_settings_rs;
extern fiid_template_t tmpl_cmd_get_serial_modem_configuration_page_blackout_interval_rs;
extern fiid_template_t tmpl_cmd_get_serial_modem_configuration_call_retry_interval_rs;
int fill_cmd_set_serial_modem_configuration (uint8_t channel_number,
uint8_t parameter_selector,
const void *configuration_parameter_data,
unsigned int configuration_parameter_data_len,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_serial_modem_configuration_set_in_progress (uint8_t channel_number,
uint8_t state,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_serial_modem_configuration_connection_mode (uint8_t channel_number,
uint8_t basic_mode,
uint8_t ppp_mode,
uint8_t terminal_mode,
uint8_t connect_mode,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_serial_modem_configuration_ipmi_messaging_comm_settings (uint8_t channel_number,
uint8_t dtr_hangup,
uint8_t flow_control,
uint8_t bit_rate,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_serial_modem_configuration_page_blackout_interval (uint8_t channel_number,
uint8_t page_blackout_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_serial_modem_configuration_call_retry_interval (uint8_t channel_number,
uint8_t call_retry_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_serial_modem_configuration (uint8_t channel_number,
uint8_t parameter_type,
uint8_t parameter_selector,
uint8_t set_selector,
uint8_t block_selector,
fiid_obj_t obj_cmd_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_SERIAL_MODEM_CMDS_H */

View File

@ -0,0 +1,169 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IPMI_SOL_CMDS_H
#define IPMI_SOL_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
#define IPMI_SOL_CONFIGURATION_PARAMETERS_NO_SET_SELECTOR 0x0
#define IPMI_SOL_CONFIGURATION_PARAMETERS_NO_BLOCK_SELECTOR 0x0
#define IPMI_SOL_CONFIGURATION_PARAMETERS_SET_COMPLETE 0x00
#define IPMI_SOL_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS 0x01
#define IPMI_SOL_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE 0x02
#define IPMI_SOL_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS_VALID(__value) \
(((__value) == IPMI_SOL_CONFIGURATION_PARAMETERS_SET_COMPLETE \
|| (__value) == IPMI_SOL_CONFIGURATION_PARAMETERS_SET_IN_PROGRESS \
|| (__value) == IPMI_SOL_CONFIGURATION_PARAMETERS_SET_COMMIT_WRITE) ? 1 : 0)
#define IPMI_SOL_SOL_DISABLE 0x0
#define IPMI_SOL_SOL_ENABLE 0x1
#define IPMI_SOL_SOL_ENABLE_VALID(__val) \
(((__val) == IPMI_SOL_SOL_DISABLE \
|| (__val) == IPMI_SOL_SOL_ENABLE) ? 1 : 0)
#define IPMI_SOL_FORCE_SOL_PAYLOAD_AUTHENTICATION 0x1
#define IPMI_SOL_AUTHENTICATION_CONTROLLED_BY_REMOTE_SOFTWARE 0x0
#define IPMI_SOL_FORCE_SOL_PAYLOAD_AUTHENTICATION_VALID(__val) \
(((__val) == IPMI_SOL_FORCE_SOL_PAYLOAD_AUTHENTICATION \
|| (__val) == IPMI_SOL_AUTHENTICATION_CONTROLLED_BY_REMOTE_SOFTWARE) ? 1 : 0)
#define IPMI_SOL_FORCE_SOL_PAYLOAD_ENCRYPTION 0x1
#define IPMI_SOL_ENCRYPTION_CONTROLLED_BY_REMOTE_SOFTWARE 0x0
#define IPMI_SOL_FORCE_SOL_PAYLOAD_ENCRYPTION_VALID(__val) \
(((__val) == IPMI_SOL_FORCE_SOL_PAYLOAD_ENCRYPTION \
|| (__val) == IPMI_SOL_ENCRYPTION_CONTROLLED_BY_REMOTE_SOFTWARE) ? 1 : 0)
#define IPMI_SOL_BIT_RATE_SERIAL_BIT_RATE 0x0
#define IPMI_SOL_BIT_RATE_96_KBPS 0x6
#define IPMI_SOL_BIT_RATE_192_KBPS 0x7
#define IPMI_SOL_BIT_RATE_384_KBPS 0x8
#define IPMI_SOL_BIT_RATE_576_KBPS 0x9
#define IPMI_SOL_BIT_RATE_1152_KBPS 0xA
#define IPMI_SOL_BIT_RATE_VALID(__val) \
(((__val) == IPMI_SOL_BIT_RATE_SERIAL_BIT_RATE \
|| (__val) == IPMI_SOL_BIT_RATE_96_KBPS \
|| (__val) == IPMI_SOL_BIT_RATE_192_KBPS \
|| (__val) == IPMI_SOL_BIT_RATE_384_KBPS \
|| (__val) == IPMI_SOL_BIT_RATE_576_KBPS \
|| (__val) == IPMI_SOL_BIT_RATE_1152_KBPS) ? 1 : 0)
#define IPMI_GET_SOL_PARAMETER 0x0
#define IPMI_GET_SOL_PARAMETER_REVISION_ONLY 0x1
#define IPMI_GET_SOL_PARAMETER_VALID(__val) \
(((__val) == IPMI_GET_SOL_PARAMETER \
|| (__val) == IPMI_GET_SOL_PARAMETER_REVISION_ONLY) ? 1 : 0)
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_set_in_progress_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_sol_enable_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_sol_authentication_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_character_accumulate_interval_and_send_threshold_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_sol_retry_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_sol_non_volatile_bit_rate_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_sol_volatile_bit_rate_rq;
extern fiid_template_t tmpl_cmd_set_sol_configuration_parameters_sol_payload_port_number_rq;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_rq;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_set_in_progress_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_sol_enable_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_sol_authentication_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_character_accumulate_interval_and_send_threshold_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_sol_retry_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_sol_non_volatile_bit_rate_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_sol_volatile_bit_rate_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_sol_payload_channel_rs;
extern fiid_template_t tmpl_cmd_get_sol_configuration_parameters_sol_payload_port_number_rs;
int fill_cmd_set_sol_configuration_parameters (uint8_t channel_number,
uint8_t parameter_selector,
const void *configuration_parameter_data,
unsigned int configuration_parameter_data_len,
fiid_obj_t obj_data_rq);
int fill_cmd_set_sol_configuration_parameters_set_in_progress (uint8_t channel_number,
uint8_t state,
fiid_obj_t obj_data_rq);
int fill_cmd_set_sol_configuration_parameters_sol_enable (uint8_t channel_number,
uint8_t sol_enable,
fiid_obj_t obj_data_rq);
int fill_cmd_set_sol_configuration_parameters_sol_authentication (uint8_t channel_number,
uint8_t sol_privilege_level,
uint8_t force_sol_payload_authentication,
uint8_t force_sol_payload_encryption,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sol_configuration_parameters_character_accumulate_interval_and_send_threshold (uint8_t channel_number,
uint8_t character_accumulate_interval,
uint8_t character_send_threshold,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sol_configuration_parameters_sol_retry (uint8_t channel_number,
uint8_t retry_count,
uint8_t retry_interval,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sol_configuration_parameters_sol_non_volatile_bit_rate (uint8_t channel_number,
uint8_t bit_rate,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sol_configuration_parameters_sol_volatile_bit_rate (uint8_t channel_number,
uint8_t bit_rate,
fiid_obj_t obj_cmd_rq);
int fill_cmd_set_sol_configuration_parameters_sol_payload_port_number (uint8_t channel_number,
uint16_t port_number,
fiid_obj_t obj_cmd_rq);
int fill_cmd_get_sol_configuration_parameters (uint8_t channel_number,
uint8_t get_parameter,
uint8_t parameter_selector,
uint8_t set_selector,
uint8_t block_selector,
fiid_obj_t obj_data_rq);
#ifdef __cplusplus
}
#endif
#endif /* IPMI_SOL_CMDS_H */

View File

@ -0,0 +1,53 @@
/*
* Copyright (C) 2003-2015 FreeIPMI Core Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef RMCP_CMDS_H
#define RMCP_CMDS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <freeipmi/fiid/fiid.h>
/*
* fill* functions return 0 on success, -1 on error.
*
* obj_cmd_rq must be for the fill function's respective fiid
* template request.
*
* see freeipmi/templates/ for template definitions
*/
extern fiid_template_t tmpl_cmd_asf_presence_ping;
extern fiid_template_t tmpl_cmd_asf_presence_pong;
/* MESSAGE_TAG:
achu: Consecutive ping messages should use different message tags,
ranging from 0x00 to 0xFE. This is because the RMCP consumers may
optionally discard duplicate messages. */
int fill_cmd_asf_presence_ping (uint8_t message_tag, fiid_obj_t obj_cmd);
#ifdef __cplusplus
}
#endif
#endif /* RMCP_CMDS_H */