ipmi

package
v0.0.0-...-9a65667 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASF_TYPE_PING = 0x80
	ASF_TYPE_PONG = 0x40
)
View Source
const (
	IPMI_NETFN_CHASSIS         = 0x00
	IPMI_NETFN_BRIDGE          = 0x02
	IPMI_NETFN_SENSOR_EVENT    = 0x04
	IPMI_NETFN_APP             = 0x06
	IPMI_NETFN_FIRMWARE        = 0x08
	IPMI_NETFN_STORAGE         = 0x0a
	IPMI_NETFN_TRANSPORT       = 0x0c
	IPMI_NETFN_GROUP_EXTENSION = 0x2c
	IPMI_NETFN_OEM_GROUP       = 0x2e

	// Response Bit
	IPMI_NETFN_RESPONSE = 0x01
)

port from OpenIPMI Network Functions

View Source
const (
	IPMI_CMD_GET_DEVICE_ID                 = 0x01
	IPMI_CMD_BROADCAST_GET_DEVICE_ID       = 0x01
	IPMI_CMD_COLD_RESET                    = 0x02
	IPMI_CMD_WARM_RESET                    = 0x03
	IPMI_CMD_GET_SELF_TEST_RESULTS         = 0x04
	IPMI_CMD_MANUFACTURING_TEST_ON         = 0x05
	IPMI_CMD_SET_ACPI_POWER_STATE          = 0x06
	IPMI_CMD_GET_ACPI_POWER_STATE          = 0x07
	IPMI_CMD_GET_DEVICE_GUID               = 0x08
	IPMI_CMD_RESET_WATCHDOG_TIMER          = 0x22
	IPMI_CMD_SET_WATCHDOG_TIMER            = 0x24
	IPMI_CMD_GET_WATCHDOG_TIMER            = 0x25
	IPMI_CMD_SET_BMC_GLOBAL_ENABLES        = 0x2e
	IPMI_CMD_GET_BMC_GLOBAL_ENABLES        = 0x2f
	IPMI_CMD_CLEAR_MSG_FLAGS               = 0x30
	IPMI_CMD_GET_MSG_FLAGS                 = 0x31
	IPMI_CMD_ENABLE_MESSAGE_CHANNEL_RCV    = 0x32
	IPMI_CMD_GET_MSG                       = 0x33
	IPMI_CMD_SEND_MSG                      = 0x34
	IPMI_CMD_READ_EVENT_MSG_BUFFER         = 0x35
	IPMI_CMD_GET_BT_INTERFACE_CAPABILITIES = 0x36
	IPMI_CMD_GET_SYSTEM_GUID               = 0x37
	IPMI_CMD_GET_CHANNEL_AUTH_CAPABILITIES = 0x38
	IPMI_CMD_GET_SESSION_CHALLENGE         = 0x39
	IPMI_CMD_ACTIVATE_SESSION              = 0x3a
	IPMI_CMD_SET_SESSION_PRIVILEGE         = 0x3b
	IPMI_CMD_CLOSE_SESSION                 = 0x3c
	IPMI_CMD_GET_SESSION_INFO              = 0x3d

	IPMI_CMD_GET_AUTHCODE                  = 0x3f
	IPMI_CMD_SET_CHANNEL_ACCESS            = 0x40
	IPMI_CMD_GET_CHANNEL_ACCESS            = 0x41
	IPMI_CMD_GET_CHANNEL_INFO              = 0x42
	IPMI_CMD_SET_USER_ACCESS               = 0x43
	IPMI_CMD_GET_USER_ACCESS               = 0x44
	IPMI_CMD_SET_USER_NAME                 = 0x45
	IPMI_CMD_GET_USER_NAME                 = 0x46
	IPMI_CMD_SET_USER_PASSWORD             = 0x47
	IPMI_CMD_ACTIVATE_PAYLOAD              = 0x48
	IPMI_CMD_DEACTIVATE_PAYLOAD            = 0x49
	IPMI_CMD_GET_PAYLOAD_ACTIVATION_STATUS = 0x4a
	IPMI_CMD_GET_PAYLOAD_INSTANCE_INFO     = 0x4b
	IPMI_CMD_SET_USER_PAYLOAD_ACCESS       = 0x4c
	IPMI_CMD_GET_USER_PAYLOAD_ACCESS       = 0x4d
	IPMI_CMD_GET_CHANNEL_PAYLOAD_SUPPORT   = 0x4e
	IPMI_CMD_GET_CHANNEL_PAYLOAD_VERSION   = 0x4f
	IPMI_CMD_GET_CHANNEL_OEM_PAYLOAD_INFO  = 0x50

	IPMI_CMD_MASTER_READ_WRITE = 0x52

	IPMI_CMD_GET_CHANNEL_CIPHER_SUITES         = 0x54
	IPMI_CMD_SUSPEND_RESUME_PAYLOAD_ENCRYPTION = 0x55
	IPMI_CMD_SET_CHANNEL_SECURITY_KEY          = 0x56
	IPMI_CMD_GET_SYSTEM_INTERFACE_CAPABILITIES = 0x57
)

port from OpenIPMI App Network Function

View Source
const (
	AUTH_NONE = 0x00
	AUTH_MD2  = 0x01
	AUTH_MD5  = 0x02
)

Default Handler Implementation

View Source
const (
	AUTH_BITMASK_NONE         = 0x01
	AUTH_BITMASK_MD2          = 0x02
	AUTH_BITMASK_MD5          = 0x04
	AUTH_BITMASK_STRAIGHT_KEY = 0x10
	AUTH_BITMASK_OEM          = 0x20
	AUTH_BITMASK_IPMI_V2      = 0x80
)
View Source
const (
	AUTH_STATUS_ANONYMOUS     = 0x01
	AUTH_STATUS_NULL_USER     = 0x02
	AUTH_STATUS_NON_NULL_USER = 0x04
	AUTH_STATUS_USER_LEVEL    = 0x08
	AUTH_STATUS_PER_MESSAGE   = 0x10
	AUTH_STATUS_KG            = 0x20
)
View Source
const (
	COMPLETION_CODE_OK               = 0x00
	COMPLETION_CODE_INVALID_USERNAME = 0x81
)
View Source
const (
	FAKE_DEVICE_ID         = 0xF0
	FAKE_DEVICE_HAS_SDR    = 0
	FAKE_DEVICE_REVISION   = 0x01
	FAKE_FW_REVISION       = 0x01
	FAKE_FW_MINOR_REVISION = 0x00
	FAKE_IPMI_VERSION      = 0x51 // 1.5
)
View Source
const (
	ADDITIONAL_DEV_BITMASK_CHASSIS            = 0x80
	ADDITIONAL_DEV_BITMASK_BRIDGE             = 0x40
	ADDITIONAL_DEV_BITMASK_IPMB_EVT_GENERATOR = 0x20
	ADDITIONAL_DEV_BITMASK_IPMB_EVT_RECEIVER  = 0x10
	ADDITIONAL_DEV_BITMASK_FRU_INVENTORY      = 0x08
	ADDITIONAL_DEV_BITMASK_SEL                = 0x04
	ADDITIONAL_DEV_BITMASK_SDR_REPOSITORY     = 0x02
	ADDITIONAL_DEV_BITMASK_SENSOR             = 0x01
)
View Source
const (
	IPMI_CMD_GET_BRIDGE_STATE         = 0x00
	IPMI_CMD_SET_BRIDGE_STATE         = 0x01
	IPMI_CMD_GET_ICMB_ADDRESS         = 0x02
	IPMI_CMD_SET_ICMB_ADDRESS         = 0x03
	IPMI_CMD_SET_BRIDGE_PROXY_ADDRESS = 0x04
	IPMI_CMD_GET_BRIDGE_STATISTICS    = 0x05
	IPMI_CMD_GET_ICMB_CAPABILITIES    = 0x06

	IPMI_CMD_CLEAR_BRIDGE_STATISTICS  = 0x08
	IPMI_CMD_GET_BRIDGE_PROXY_ADDRESS = 0x09
	IPMI_CMD_GET_ICMB_CONNECTOR_INFO  = 0x0a
	IPMI_CMD_SET_ICMB_CONNECTOR_INFO  = 0x0b
	IPMI_CMD_SEND_ICMB_CONNECTION_ID  = 0x0c

	IPMI_CMD_PREPARE_FOR_DISCOVERY = 0x10
	IPMI_CMD_GET_ADDRESSES         = 0x11
	IPMI_CMD_SET_DISCOVERED        = 0x12
	IPMI_CMD_GET_CHASSIS_DEVICE_ID = 0x13
	IPMI_CMD_SET_CHASSIS_DEVICE_ID = 0x14

	IPMI_CMD_BRIDGE_REQUEST = 0x20
	IPMI_CMD_BRIDGE_MESSAGE = 0x21

	IPMI_CMD_GET_EVENT_COUNT           = 0x30
	IPMI_CMD_SET_EVENT_DESTINATION     = 0x31
	IPMI_CMD_SET_EVENT_RECEPTION_STATE = 0x32
	IPMI_CMD_SEND_ICMB_EVENT_MESSAGE   = 0x33
	IPMI_CMD_GET_EVENT_DESTIATION      = 0x34
	IPMI_CMD_GET_EVENT_RECEPTION_STATE = 0x35

	IPMI_CMD_ERROR_REPORT = 0xff
)

port from OpenIPMI Bridge Network Function

View Source
const (
	IPMI_CMD_GET_CHASSIS_CAPABILITIES = 0x00
	IPMI_CMD_GET_CHASSIS_STATUS       = 0x01
	IPMI_CMD_CHASSIS_CONTROL          = 0x02
	IPMI_CMD_CHASSIS_RESET            = 0x03
	IPMI_CMD_CHASSIS_IDENTIFY         = 0x04
	IPMI_CMD_SET_CHASSIS_CAPABILITIES = 0x05
	IPMI_CMD_SET_POWER_RESTORE_POLICY = 0x06
	IPMI_CMD_GET_SYSTEM_RESTART_CAUSE = 0x07
	IPMI_CMD_SET_SYSTEM_BOOT_OPTIONS  = 0x08
	IPMI_CMD_GET_SYSTEM_BOOT_OPTIONS  = 0x09
	IPMI_CMD_GET_POH_COUNTER          = 0x0f
)

Chassis Network Function

View Source
const (
	CHASSIS_POWER_STATE_BITMASK_POWER_ON            = 0x01
	CHASSIS_POWER_STATE_BITMASK_POWER_OVERLOAD      = 0x02
	CHASSIS_POWER_STATE_BITMASK_INTERLOCK           = 0x04
	CHASSIS_POWER_STATE_BITMASK_POWER_FAULT         = 0x08
	CHASSIS_POWER_STATE_BITMASK_POWER_CONTROL_FAULT = 0x10

	// Bit 5 ~ 6
	CHASSIS_POWER_STATE_BITMASK_POWER_RESTORE_POWER_OFF = 0x00
	CHASSIS_POWER_STATE_BITMASK_POWER_RESTORE_RESTORE   = 0x20
	CHASSIS_POWER_STATE_BITMASK_POWER_RESTORE_POWER_UP  = 0x40
	CHASSIS_POWER_STATE_BITMASK_POWER_RESTORE_UNKNOWN   = 0x60
)
View Source
const (
	CHASSIS_LAST_POWER_AC_FAILED      = 0x01
	CHASSIS_LAST_POWER_DOWN_OVERLOAD  = 0x02
	CHASSIS_LAST_POWER_DOWN_INTERLOCK = 0x04
	CHASSIS_LAST_PWOER_DOWN_FAULT     = 0x08
	CHASSIS_LAST_POWER_ON_VIA_IPMI    = 0x10
)
View Source
const (
	CHASSIS_MISC_INTRUCTION_ACTIVE   = 0x01
	CHASSIS_MISC_FRONT_PANEL_LOCKOUT = 0x02
	CHASSIS_MISC_DRIVE_FAULT         = 0x04
	CHASSIS_MISC_COOLING_FAULT       = 0x08

	// Bit 4 ~ 5
	CHASSIS_MISC_IDENTIFY_OFF           = 0x00
	CHASSIS_MISC_IDENTIFY_TEMPERARY     = 0x10
	CHASSIS_MISC_IDENTIFY_INDEFINITE_ON = 0x20

	CHASSIS_MISC_IDENTIFY_SUPPORTED = 0x40
)
View Source
const (
	CHASSIS_CONTROL_POWER_DOWN  = 0x00
	CHASSIS_CONTROL_POWER_UP    = 0x01
	CHASSIS_CONTROL_POWER_CYCLE = 0x02
	CHASSIS_CONTROL_HARD_RESET  = 0x03
	CHASSIS_CONTROL_PULSE       = 0x04
	CHASSIS_CONTROL_POWER_SOFT  = 0x05
)
View Source
const (
	BOOT_SET_IN_PROGRESS                  = 0
	BOOT_SERVICE_PARTITION_SELECTOR       = 1
	BOOT_SERVICE_PARTITION_SCAN           = 2
	BOOT_BMC_BOOT_FLAG_VALID_BIT_CLEARING = 3
	BOOT_INFO_ACK                         = 4
	BOOT_FLAG                             = 5
	BOOT_INITIATOR_INFO                   = 6
	BOOT_INITIATOR_MAILBOX                = 7
)
View Source
const (
	BOOT_SET_IN_PROGRESS_SET_COMPLETE    = 0x00
	BOOT_SET_IN_PROGRESS_SET_IN_PROTRESS = 0x01
	BOOT_SET_IN_PROGRESS_COMMIT_WRITE    = 0x02
)
View Source
const (
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_0 = 0x01
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_1 = 0x02
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_2 = 0x04
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_3 = 0x08
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_4 = 0x10
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_5 = 0x20
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_6 = 0x40
	BOOT_INFO_ACK_BITMASK_WRITE_MASK_7 = 0x80
)
View Source
const (
	BOOT_INFO_ACK_BITMASK_BIOS_POST_HANDLED  = 0x01
	BOOT_INFO_ACK_BITMASK_OS_LOADER_HANDLED  = 0x02
	BOOT_INFO_ACK_BITMASK_OS_SERVICE_HANDLED = 0x04
	BOOT_INFO_ACK_BITMASK_SMS_HANDLED        = 0x08
	BOOT_INFO_ACK_BITMASK_OEM_HANDLED        = 0x10
)
View Source
const (
	BOOT_PARAM_BITMASK_VALID         = 0x80
	BOOT_PARAM_BITMASK_PERSISTENT    = 0x40
	BOOT_PARAM_BITMASK_BOOT_TYPE_EFI = 0x20
)

BootParam

View Source
const (
	BOOT_DEVICE_BITMASK_CMOS_CLEAR    = 0x80
	BOOT_DEVICE_BITMASK_LOCK_KEYBOARD = 0x40
	BOOT_DEVICE_BITMASK_DEVICE        = 0x3C
	BOOT_DEVICE_BITMASK_SCREEN_BLANK  = 0x02
	BOOT_DEVICE_BITMASK_LOCK_RESET    = 0x01
)

BootDevice

View Source
const (
	BOOT_DEVICE_FORCE_PXE            = 0x01
	BOOT_DEVICE_FORCE_HDD            = 0x02
	BOOT_DEVICE_FORCE_HDD_SAFE       = 0x03
	BOOT_DEVICE_FORCE_DIAG_PARTITION = 0x04
	BOOT_DEVICE_FORCE_CD             = 0x05
	BOOT_DEVICE_FORCE_BIOS           = 0x06
	BOOT_DEVICE_FORCE_REMOTE_FLOPPY  = 0x07
	BOOT_DEVICE_FORCE_REMOTE_MEDIA   = 0x08
	BOOT_DEVICE_FORCE_REMOTE_CD      = 0x09
	// 0x0A is reserved
	BOOT_DEVICE_FORCE_REMOTE_HDD = 0x0B
)
View Source
const (
	BOOT_BIOS_BITMASK_LOCK_VIA_POWER   = 0x80
	BOOT_BIOS_BITMASK_FIRMWARE         = 0x60
	BOOT_BIOS_BITMASK_EVENT_TRAP       = 0x10
	BOOT_BIOS_BITMASK_PASSWORD_BYPASS  = 0x08
	BOOT_BIOS_BITMASK_LOCK_SLEEP       = 0x04
	BOOT_BIOS_BITMASK_CONSOLE_REDIRECT = 0x03
)

Boot BIOS Verbosity

View Source
const (
	BOOT_BIOS_FIRMWARE_SYSTEM_DEFAULT  = 0x00
	BOOT_BIOS_FIRMWARE_REQUEST_QUIET   = 0x01
	BOOT_BIOS_FIRMWARE_REQUEST_VERBOSE = 0x02
)
View Source
const (
	BOOT_BIOS_CONSOLE_REDIRECT_OCCURS_PER_BIOS_SETTING    = 0x00
	BOOT_BIOS_CONSOLE_REDIRECT_SUPRESS_CONSOLE_IF_ENABLED = 0x01
	BOOT_BIOS_CONSOLE_REDIRECT_REQUEST_ENABLED            = 0x02
)
View Source
const (
	BOOT_BIOS_SHARED_BITMASK_OVERRIDE             = 0x04
	BOOT_BIOS_SHARED_BITMASK_MUX_CONTROL_OVERRIDE = 0x03
)

BIOS Shared Mode

View Source
const (
	BOOT_BIOS_SHARED_MUX_RECOMMENDED = 0x00
	BOOT_BIOS_SHARED_MUX_TO_BMC      = 0x01
	BOOT_BIOS_SHARED_MUX_TO_SYSTEM   = 0x02
)
View Source
const (
	BOOT_FLAG_DONT_CLEAR_BITMASK_RESET_CYCLE_BY_PEF                       = 0x10
	BOOT_FLAG_DONT_CLEAR_BITMASK_CHASSIS_CTRL_NOT_RECV_WITHIN_60S_TIMEOUT = 0x08
	BOOT_FLAG_DONT_CLEAR_BITMASK_RESET_CYCLE_BY_WATCHDOG                  = 0x04
	BOOT_FLAG_DONT_CLEAR_BITMASK_PUSHBOTTON_OR_SOFT_RESET                 = 0x02
	BOOT_FLAG_DONT_CLEAR_BITMASK_POWER_UP_VIA_PUSHBUTTON                  = 0x01
)
View Source
const (
	IPMI_CMD_SET_EVENT_RECEIVER = 0x00
	IPMI_CMD_GET_EVENT_RECEIVER = 0x01
	IPMI_CMD_PLATFORM_EVENT     = 0x02

	IPMI_CMD_GET_PEF_CAPABILITIES        = 0x10
	IPMI_CMD_ARM_PEF_POSTPONE_TIMER      = 0x11
	IPMI_CMD_SET_PEF_CONFIG_PARMS        = 0x12
	IPMI_CMD_GET_PEF_CONFIG_PARMS        = 0x13
	IPMI_CMD_SET_LAST_PROCESSED_EVENT_ID = 0x14
	IPMI_CMD_GET_LAST_PROCESSED_EVENT_ID = 0x15
	IPMI_CMD_ALERT_IMMEDIATE             = 0x16
	IPMI_CMD_PET_ACKNOWLEDGE             = 0x17

	IPMI_CMD_GET_DEVICE_SDR_INFO           = 0x20
	IPMI_CMD_GET_DEVICE_SDR                = 0x21
	IPMI_CMD_RESERVE_DEVICE_SDR_REPOSITORY = 0x22
	IPMI_CMD_GET_SENSOR_READING_FACTORS    = 0x23
	IPMI_CMD_SET_SENSOR_HYSTERESIS         = 0x24
	IPMI_CMD_GET_SENSOR_HYSTERESIS         = 0x25
	IPMI_CMD_SET_SENSOR_THRESHOLD          = 0x26
	IPMI_CMD_GET_SENSOR_THRESHOLD          = 0x27
	IPMI_CMD_SET_SENSOR_EVENT_ENABLE       = 0x28
	IPMI_CMD_GET_SENSOR_EVENT_ENABLE       = 0x29
	IPMI_CMD_REARM_SENSOR_EVENTS           = 0x2a
	IPMI_CMD_GET_SENSOR_EVENT_STATUS       = 0x2b
	IPMI_CMD_GET_SENSOR_READING            = 0x2d
	IPMI_CMD_SET_SENSOR_TYPE               = 0x2e
	IPMI_CMD_GET_SENSOR_TYPE               = 0x2f
)

port from OpenIPMI Sensor/Event Network Function

View Source
const (
	IPMI_CMD_GET_FRU_INVENTORY_AREA_INFO = 0x10
	IPMI_CMD_READ_FRU_DATA               = 0x11
	IPMI_CMD_WRITE_FRU_DATA              = 0x12

	IPMI_CMD_GET_SDR_REPOSITORY_INFO       = 0x20
	IPMI_CMD_GET_SDR_REPOSITORY_ALLOC_INFO = 0x21
	IPMI_CMD_RESERVE_SDR_REPOSITORY        = 0x22
	IPMI_CMD_GET_SDR                       = 0x23
	IPMI_CMD_ADD_SDR                       = 0x24
	IPMI_CMD_PARTIAL_ADD_SDR               = 0x25
	IPMI_CMD_DELETE_SDR                    = 0x26
	IPMI_CMD_CLEAR_SDR_REPOSITORY          = 0x27
	IPMI_CMD_GET_SDR_REPOSITORY_TIME       = 0x28
	IPMI_CMD_SET_SDR_REPOSITORY_TIME       = 0x29
	IPMI_CMD_ENTER_SDR_REPOSITORY_UPDATE   = 0x2a
	IPMI_CMD_EXIT_SDR_REPOSITORY_UPDATE    = 0x2b
	IPMI_CMD_RUN_INITIALIZATION_AGENT      = 0x2c

	IPMI_CMD_GET_SEL_INFO             = 0x40
	IPMI_CMD_GET_SEL_ALLOCATION_INFO  = 0x41
	IPMI_CMD_RESERVE_SEL              = 0x42
	IPMI_CMD_GET_SEL_ENTRY            = 0x43
	IPMI_CMD_ADD_SEL_ENTRY            = 0x44
	IPMI_CMD_PARTIAL_ADD_SEL_ENTRY    = 0x45
	IPMI_CMD_DELETE_SEL_ENTRY         = 0x46
	IPMI_CMD_CLEAR_SEL                = 0x47
	IPMI_CMD_GET_SEL_TIME             = 0x48
	IPMI_CMD_SET_SEL_TIME             = 0x49
	IPMI_CMD_GET_AUXILIARY_LOG_STATUS = 0x5a
	IPMI_CMD_SET_AUXILIARY_LOG_STATUS = 0x5b
)

port from OpenIPMI Storage Network Function

View Source
const (
	IPMI_CMD_SET_LAN_CONFIG_PARMS  = 0x01
	IPMI_CMD_GET_LAN_CONFIG_PARMS  = 0x02
	IPMI_CMD_SUSPEND_BMC_ARPS      = 0x03
	IPMI_CMD_GET_IP_UDP_RMCP_STATS = 0x04

	IPMI_CMD_SET_SERIAL_MODEM_CONFIG     = 0x10
	IPMI_CMD_GET_SERIAL_MODEM_CONFIG     = 0x11
	IPMI_CMD_SET_SERIAL_MODEM_MUX        = 0x12
	IPMI_CMD_GET_TAP_RESPONSE_CODES      = 0x13
	IPMI_CMD_SET_PPP_UDP_PROXY_XMIT_DATA = 0x14
	IPMI_CMD_GET_PPP_UDP_PROXY_XMIT_DATA = 0x15
	IPMI_CMD_SEND_PPP_UDP_PROXY_PACKET   = 0x16
	IPMI_CMD_GET_PPP_UDP_PROXY_RECV_DATA = 0x17
	IPMI_CMD_SERIAL_MODEM_CONN_ACTIVE    = 0x18
	IPMI_CMD_CALLBACK                    = 0x19
	IPMI_CMD_SET_USER_CALLBACK_OPTIONS   = 0x1a
	IPMI_CMD_GET_USER_CALLBACK_OPTIONS   = 0x1b

	IPMI_CMD_SOL_ACTIVATING                   = 0x20
	IPMI_CMD_SET_SOL_CONFIGURATION_PARAMETERS = 0x21
	IPMI_CMD_GET_SOL_CONFIGURATION_PARAMETERS = 0x22
)

Transport Network Function

View Source
const (
	RMCP_CLASS_ASF  = 0x06
	RMCP_CLASS_IPMI = 0x07
	RMCP_CLASS_OEM  = 0x08
)
View Source
const (
	ASF_RMCP_IANA = 0x000011be
)
View Source
const (
	GROUP_EXT_CMD_ATCA_GET_PICMG_PROP = 0x00
)
View Source
const (
	RMCP_VERSION_1 = 0x06
)

Variables

This section is empty.

Functions

func ASFDeserializeAndExecute

func ASFDeserializeAndExecute(buf io.Reader, addr *net.UDPAddr, server *net.UDPConn)

Comamand Analyzer and Executor

func BuildResponseMessageTemplate

func BuildResponseMessageTemplate(requestWrapper IPMISessionWrapper, requestMessage IPMIMessage, netfn uint8, command uint8) (IPMISessionWrapper, IPMIMessage)

func DeserializeAndExecute

func DeserializeAndExecute(buf io.Reader, addr *net.UDPAddr, server *net.UDPConn)

func DeserializeIPMI

func DeserializeIPMI(buf io.Reader) (length uint32, wrapper IPMISessionWrapper, message IPMIMessage)

func GetAuthenticationCode

func GetAuthenticationCode(authenticationType uint8, password string, sessionID uint32, message IPMIMessage, sessionSeq uint32) [16]byte

func GetAuthenticationCodePICMG

func GetAuthenticationCodePICMG(authenticationType uint8, password string, sessionID uint32, message PICMGData, sessionSeq uint32) [16]byte

func GetBootOptionParameterSelectorString

func GetBootOptionParameterSelectorString(selector int) string

func HandleASFPong

func HandleASFPong(pingHeader AlertStandardFormat, addr *net.UDPAddr, server *net.UDPConn)

Handlers

func HandleIPMIActivateSession

func HandleIPMIActivateSession(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIAuthenticationCapabilities

func HandleIPMIAuthenticationCapabilities(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIChassisBootOptionNotSupport

func HandleIPMIChassisBootOptionNotSupport(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage, selector IPMIChassisBootOptionParameterSelector)

Default Handler Implementation

func HandleIPMIChassisControl

func HandleIPMIChassisControl(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIChassisGetBootOptionBootFlags

func HandleIPMIChassisGetBootOptionBootFlags(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage, selector IPMIChassisBootOptionParameterSelector)

func HandleIPMIChassisSetBootOptionBootFlags

func HandleIPMIChassisSetBootOptionBootFlags(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage, selector IPMIChassisBootOptionParameterSelector)

func HandleIPMIChassisSetBootOptionBootInfoAck

func HandleIPMIChassisSetBootOptionBootInfoAck(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage, selector IPMIChassisBootOptionParameterSelector)

func HandleIPMIChassisSetBootOptionSetInProgress

func HandleIPMIChassisSetBootOptionSetInProgress(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage, selector IPMIChassisBootOptionParameterSelector)

func HandleIPMIChassisSetBootOptionValidBitClearing

func HandleIPMIChassisSetBootOptionValidBitClearing(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage, selector IPMIChassisBootOptionParameterSelector)

func HandleIPMICloseSession

func HandleIPMICloseSession(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIGetChassisStatus

func HandleIPMIGetChassisStatus(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIGetDeviceID

func HandleIPMIGetDeviceID(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIGetSessionChallenge

func HandleIPMIGetSessionChallenge(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIGroupExtATCAGetPICMGPropHandler

func HandleIPMIGroupExtATCAGetPICMGPropHandler(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMISetSessionPrivilegeLevel

func HandleIPMISetSessionPrivilegeLevel(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIUnsupportedAppCommand

func HandleIPMIUnsupportedAppCommand(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func HandleIPMIUnsupportedChassisCommand

func HandleIPMIUnsupportedChassisCommand(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

Default Handler Implementation

func HandleIPMIUnsupportedGroupExtCommand

func HandleIPMIUnsupportedGroupExtCommand(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

Default Handler Implementation

func IPMIDeserializeAndExecute

func IPMIDeserializeAndExecute(buf io.Reader, addr *net.UDPAddr, server *net.UDPConn)

func IPMIServerHandler

func IPMIServerHandler(BMCIP string, BMCPORT string)

func IPMIServerServiceRun

func IPMIServerServiceRun()

func IPMI_APP_DeserializeAndExecute

func IPMI_APP_DeserializeAndExecute(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func IPMI_APP_SetHandler

func IPMI_APP_SetHandler(command int, handler IPMI_App_Handler)

func IPMI_CHASSIS_DeserializeAndExecute

func IPMI_CHASSIS_DeserializeAndExecute(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func IPMI_CHASSIS_GET_BOOT_OPTION_SetHandler

func IPMI_CHASSIS_GET_BOOT_OPTION_SetHandler(command int, handler IPMI_Chassis_BootOpt_Handler)

func IPMI_CHASSIS_GetBootOption_DeserializeAndExecute

func IPMI_CHASSIS_GetBootOption_DeserializeAndExecute(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func IPMI_CHASSIS_SET_BOOT_OPTION_SetHandler

func IPMI_CHASSIS_SET_BOOT_OPTION_SetHandler(command int, handler IPMI_Chassis_BootOpt_Handler)

func IPMI_CHASSIS_SetBootOption_DeserializeAndExecute

func IPMI_CHASSIS_SetBootOption_DeserializeAndExecute(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func IPMI_CHASSIS_SetHandler

func IPMI_CHASSIS_SetHandler(command int, handler IPMI_Chassis_Handler)

func IPMI_GROUPEXT_DeserializeAndExecute

func IPMI_GROUPEXT_DeserializeAndExecute(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

func IPMI_GROUPEXT_SetHandler

func IPMI_GROUPEXT_SetHandler(command int, handler IPMI_GroupExt_Handler)

func RMCPDeserializeAndExecute

func RMCPDeserializeAndExecute(buf io.Reader, addr *net.UDPAddr, server *net.UDPConn)

func RemoveSession

func RemoveSession(id uint32)

func SendIPMIChassisSetBootOptionResponseBack

func SendIPMIChassisSetBootOptionResponseBack(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

Utility

func SerializeASF

func SerializeASF(buf *bytes.Buffer, header AlertStandardFormat)

func SerializeIPMI

func SerializeIPMI(buf *bytes.Buffer, wrapper IPMISessionWrapper, message IPMIMessage, bmcpass string)

func SerializeIPMIMessage

func SerializeIPMIMessage(buf *bytes.Buffer, message IPMIMessage)

func SerializeIPMISessionWrapper

func SerializeIPMISessionWrapper(buf *bytes.Buffer, wrapper IPMISessionWrapper)

func SerializeRMCP

func SerializeRMCP(buf *bytes.Buffer, header RemoteManagementControlProtocol)

Types

type AlertStandardFormat

type AlertStandardFormat struct {
	IANA        uint32
	MessageType uint8
	MessageTag  uint8
	Reserved    uint8
	DataLen     uint8
	Data        []uint8
}

func DeserializeASF

func DeserializeASF(buf io.Reader) (length uint32, header AlertStandardFormat)

type IPMIActivateSessionRequest

type IPMIActivateSessionRequest struct {
	AuthenticationType       uint8
	RequestMaxPrivilegeLevel uint8
	Challenge                [16]byte
	InitialOutboundSeq       uint32
}

type IPMIActivateSessionResponse

type IPMIActivateSessionResponse struct {
	AuthenticationType uint8
	SessionId          uint32
	InitialOutboundSeq uint32
	MaxPrivilegeLevel  uint8
}

type IPMIAppHandlerSet

type IPMIAppHandlerSet struct {
	GetDeviceIDHandler                IPMI_App_Handler
	BroadcastGetDeviceIDHandler       IPMI_App_Handler
	ColdResetHandler                  IPMI_App_Handler
	WarmResetHandler                  IPMI_App_Handler
	GetSelfTestResultHandler          IPMI_App_Handler
	ManufacturingTestOnHandler        IPMI_App_Handler
	SetACPIPowerStateHandler          IPMI_App_Handler
	GetACPIPowerStateHandler          IPMI_App_Handler
	GetDeviceGUIDHandler              IPMI_App_Handler
	ResetWatchdogTimerHandler         IPMI_App_Handler
	SetWatchdogTimerHandler           IPMI_App_Handler
	GetWatchdogTimerHandler           IPMI_App_Handler
	SetBMCGlobalEnablesHandler        IPMI_App_Handler
	GetBMCGlobalEnablesHandler        IPMI_App_Handler
	ClearMsgFlagsHandler              IPMI_App_Handler
	GetMsgFlagsHandler                IPMI_App_Handler
	EnableMessageChannelRcvHandler    IPMI_App_Handler
	GetMsgHandler                     IPMI_App_Handler
	SendMsgHandler                    IPMI_App_Handler
	ReadEventMsgBufferHandler         IPMI_App_Handler
	GetBTInterfaceCapabilitiesHandler IPMI_App_Handler
	GetSystemGUIDHandler              IPMI_App_Handler
	GetChannelAuthCapabilitiesHandler IPMI_App_Handler
	GetSessionChallengeHandler        IPMI_App_Handler
	ActivateSessionHandler            IPMI_App_Handler
	SetSessionPrivilegeHandler        IPMI_App_Handler
	CloseSessionHandler               IPMI_App_Handler
	GetSessionInfoHandler             IPMI_App_Handler

	GetAuthCodeHandler                IPMI_App_Handler
	SetChannelAccessHandler           IPMI_App_Handler
	GetChannelAccessHandler           IPMI_App_Handler
	GetChannelInfoHandler             IPMI_App_Handler
	SetUserAccessHandler              IPMI_App_Handler
	GetUserAccessHandler              IPMI_App_Handler
	SetUserNameHandler                IPMI_App_Handler
	GetUserNameHandler                IPMI_App_Handler
	SetUserPasswordHandler            IPMI_App_Handler
	ActivatePayloadHandler            IPMI_App_Handler
	DeactivatePayloadHandler          IPMI_App_Handler
	GetPayloadActivationStatusHandler IPMI_App_Handler
	GetPayloadInstanceInfoHandler     IPMI_App_Handler
	SetUserPayloadAccessHandler       IPMI_App_Handler
	GetUserPayloadAccessHandler       IPMI_App_Handler
	GetChannelPayloadSupportHandler   IPMI_App_Handler
	GetChannelPayloadVersionHandler   IPMI_App_Handler
	GetChannelOEMPayloadInfoHandler   IPMI_App_Handler

	MasterReadWriteHandler IPMI_App_Handler

	GetChannelCipherSuiteHandler          IPMI_App_Handler
	SuspendResumePayloadEncryptionHandler IPMI_App_Handler
	SetChannelSecurityKeyHandler          IPMI_App_Handler
	GetSystemInterfaceCapabilitiesHandler IPMI_App_Handler

	Unsupported IPMI_App_Handler
}
var IPMIAppHandler IPMIAppHandlerSet = IPMIAppHandlerSet{}

type IPMIAuthenticationCapabilitiesRequest

type IPMIAuthenticationCapabilitiesRequest struct {
	AutnticationTypeSupport uint8
	RequestedPrivilegeLevel uint8
}

type IPMIAuthenticationCapabilitiesResponse

type IPMIAuthenticationCapabilitiesResponse struct {
	Channel                   uint8
	AuthenticationTypeSupport uint8
	AuthenticationStatus      uint8
	ExtCapabilities           uint8 // In IPMI v1.5, 0 is always put here. (Reserved)
	OEMID                     [3]uint8
	OEMAuxiliaryData          uint8
}

type IPMIChassisBootOptionBootInfoReuqest

type IPMIChassisBootOptionBootInfoReuqest struct {
	WriteMask            uint8
	BootInitiatorAckData uint8
}

type IPMIChassisBootOptionParameterSelector

type IPMIChassisBootOptionParameterSelector struct {
	Validity                    bool
	BootOptionParameterSelector uint8
	Parameters                  []uint8
}

type IPMIChassisBootOptionSetInProgressRequest

type IPMIChassisBootOptionSetInProgressRequest struct {
	SetInProgressParameter uint8
}

type IPMIChassisControlRequest

type IPMIChassisControlRequest struct {
	ChassisControl uint8
}

type IPMIChassisGetBootOptHandlerSet

type IPMIChassisGetBootOptHandlerSet struct {
	SetInProgressHandler               IPMI_Chassis_BootOpt_Handler
	ServicePartitionSelectorHandler    IPMI_Chassis_BootOpt_Handler
	ServicePartitionScanHandler        IPMI_Chassis_BootOpt_Handler
	BMCBootFlagValidBitClearingHandler IPMI_Chassis_BootOpt_Handler
	BootInfoAcknowledgementHandler     IPMI_Chassis_BootOpt_Handler
	BootFlagHandler                    IPMI_Chassis_BootOpt_Handler
	BootInitiatorInfoHandler           IPMI_Chassis_BootOpt_Handler
	BootInitiatorMailbox               IPMI_Chassis_BootOpt_Handler
	Unsupported                        IPMI_Chassis_BootOpt_Handler
}

type IPMIChassisGetBootOptionBootFlags

type IPMIChassisGetBootOptionBootFlags struct {
	ParamVersion    uint8
	BootOptSelector uint8
	BootParam       uint8
	BootDevice      uint8
	BIOSVerbosity   uint8
	BIOSSharedMode  uint8
	Reserved        uint8
}

type IPMIChassisHandlerSet

type IPMIChassisHandlerSet struct {
	GetChassisCapabilities IPMI_Chassis_Handler
	GetChassisStatus       IPMI_Chassis_Handler
	ChassisControl         IPMI_Chassis_Handler
	ChassisReset           IPMI_Chassis_Handler
	ChassisIdentify        IPMI_Chassis_Handler
	SetChassisCapabilities IPMI_Chassis_Handler
	SetPowerRestorePolicy  IPMI_Chassis_Handler
	GetSystemRestartCause  IPMI_Chassis_Handler
	SetSystemBootOptions   IPMI_Chassis_Handler
	GetSystemBootOptions   IPMI_Chassis_Handler
	GetPOHCounter          IPMI_Chassis_Handler
	Unsupported            IPMI_Chassis_Handler
}
var IPMIChassisHandler IPMIChassisHandlerSet = IPMIChassisHandlerSet{}

type IPMIChassisSetBootOptHandlerSet

type IPMIChassisSetBootOptHandlerSet struct {
	SetInProgressHandler               IPMI_Chassis_BootOpt_Handler
	ServicePartitionSelectorHandler    IPMI_Chassis_BootOpt_Handler
	ServicePartitionScanHandler        IPMI_Chassis_BootOpt_Handler
	BMCBootFlagValidBitClearingHandler IPMI_Chassis_BootOpt_Handler
	BootInfoAcknowledgementHandler     IPMI_Chassis_BootOpt_Handler
	BootFlagHandler                    IPMI_Chassis_BootOpt_Handler
	BootInitiatorInfoHandler           IPMI_Chassis_BootOpt_Handler
	BootInitiatorMailbox               IPMI_Chassis_BootOpt_Handler
	Unsupported                        IPMI_Chassis_BootOpt_Handler
}

type IPMIChassisSetBootOptionBootFlags

type IPMIChassisSetBootOptionBootFlags struct {
	BootParam      uint8
	BootDevice     uint8
	BIOSVerbosity  uint8
	BIOSSharedMode uint8
	Reserved       uint8
}

type IPMICloseSessionRequest

type IPMICloseSessionRequest struct {
	SessionID uint32
}

type IPMIGetChassisStatusResponse

type IPMIGetChassisStatusResponse struct {
	CurrentPowerState            uint8
	LastPowerEvent               uint8
	MiscChassisState             uint8
	FrontPanelButtonCapabilities uint8
}

type IPMIGetDeviceIDResponse

type IPMIGetDeviceIDResponse struct {
	DeviceID                uint8
	DeviceRevision          uint8
	FirmwareRevision        uint8
	FirmwareMinorRev        uint8
	IPMIVersion             uint8
	AdditionalDevSupport    uint8
	ManufactureID           [3]uint8
	ProductID               uint16
	AuxiliaryFWRevisionInfo [3]uint8
}

type IPMIGetSessionChallengeRequest

type IPMIGetSessionChallengeRequest struct {
	AuthenticationType uint8
	Username           [16]byte
}

type IPMIGetSessionChallengeResponse

type IPMIGetSessionChallengeResponse struct {
	TempSessionID uint32
	Challenge     [16]byte
}

type IPMIGroupExtGetPICMGPropertiesRequest

type IPMIGroupExtGetPICMGPropertiesRequest struct {
	Signature uint8
}

type IPMIGroupExtHandlerSet

type IPMIGroupExtHandlerSet struct {
	GetPICMGPropHandler IPMI_GroupExt_Handler
	UnsupportedHandler  IPMI_GroupExt_Handler
}
var IPMIGroupExtHandler IPMIGroupExtHandlerSet = IPMIGroupExtHandlerSet{}

type IPMIMessage

type IPMIMessage struct {
	TargetAddress  uint8
	TargetLun      uint8 // NetFn (6) + Lun (2)
	Checksum       uint8
	SourceAddress  uint8
	SourceLun      uint8 // SequenceNumber (6) + Lun (2)
	Command        uint8
	CompletionCode uint8
	Data           []uint8
	DataChecksum   uint8
}

type IPMISession

type IPMISession struct {
	SessionID                   uint32
	RemoteSessionSequenceNumber uint32
	LocalSessionSequenceNumber  uint32
	User                        bmc.BMCUser
}

func GetNewSession

func GetNewSession(user bmc.BMCUser) IPMISession

func GetSession

func GetSession(id uint32) (IPMISession, bool)

func (*IPMISession) Inc

func (session *IPMISession) Inc()

func (*IPMISession) Save

func (session *IPMISession) Save()

type IPMISessionWrapper

type IPMISessionWrapper struct {
	AuthenticationType uint8
	SequenceNumber     uint32
	SessionId          uint32
	AuthenticationCode [16]byte
	MessageLen         uint8
}

type IPMISetSessionPrivilegeLevelRequest

type IPMISetSessionPrivilegeLevelRequest struct {
	RequestPrivilegeLevel uint8
}

type IPMISetSessionPrivilegeLevelResponse

type IPMISetSessionPrivilegeLevelResponse struct {
	NewPrivilegeLevel uint8
}

type IPMI_App_Handler

type IPMI_App_Handler func(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

type IPMI_Chassis_BootOpt_Handler

type IPMI_Chassis_BootOpt_Handler func(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage, selector IPMIChassisBootOptionParameterSelector)

type IPMI_Chassis_Handler

type IPMI_Chassis_Handler func(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

type IPMI_GroupExt_Handler

type IPMI_GroupExt_Handler func(addr *net.UDPAddr, server *net.UDPConn, wrapper IPMISessionWrapper, message IPMIMessage)

type PICMGData

type PICMGData struct {
	// contains filtered or unexported fields
}

type RemoteManagementControlProtocol

type RemoteManagementControlProtocol struct {
	Version  uint8
	Reserved uint8
	Sequence uint8
	Class    uint8
}

func BuildUpRMCPForIPMI

func BuildUpRMCPForIPMI() (rmcp RemoteManagementControlProtocol)

func DeserializeRMCP

func DeserializeRMCP(buf io.Reader) (length uint32, header RemoteManagementControlProtocol)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL