ipmi

package module
v0.0.0-...-c122506 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

README

go-ipmi

go-ipmi is a pure golang native IPMI library. It DOES NOT wraps ipmitool.

Usage

import (
	"fmt"
	"github.com/xstp/go-ipmi"
)

func main() {
	host := "10.0.0.1"
	port := 623
	username := "root"
	password := "123456"

	client, err := ipmi.NewClient(host, port, username, password)
	// Support local mode client if runs directly on linux
	// client, err := ipmi.NewOpenClient()
	if err != nil {
		panic(err)
	}

	// you can optionally open debug switch
	// client.WithDebug(true)

	// Connect will create an authenticated session for you.
	if err := client.Connect(); err != nil {
		panic(err)
	}

	// Now you can execute other IPMI commands that need authentication.

	res, err := client.GetDeviceID()
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Format())

	selEntries, err := client.GetSELEntries(0)
	if err != nil {
		panic(err)
	}
	fmt.Println(ipmi.FormatSELs(selEntries, nil))
}

Functions Comparision with ipmitool

Each command defined in the IPMI specification is a pair of request/response messages. These IPMI commands are implemented as methods of the ipmi.Client struct in this library.

Some ipmitool cmdline usages are implemented by calling just one IPMI command, but others are not. Like ipmitool sdr list, it's a loop of GetSDR IPMI command.

So this library also implements some methods that are not IPMI commands defined in IPMI sepcification, but just some common helpers, like GetSDRs to get all SDRs. These methods are marked with an asterisk (*) after the method name in the following docs.

The implementation logic of IPMI commands is almost same. See Contributing

More commmands are ongoing ...

IPM Device Global Commands
Method Status corresponding ipmitool usage
GetDeviceID mc info
ColdReset mc reset cold
WarmReset mc reset warm
GetSelfTestResults mc selftest, chassis selftest
ManufacturingTestOn
SetACPIPowerState
GetACPIPowerState
GetDeviceGUID
GetNetFnSupport
GetCommandSupport
GetCommandSubfunctionSupport
GetConfigurableCommands
GetConfigurableCommandSubfunctions
SetCommandEnables
GetCommandEnables
GetCommandSubfunctionsEnables
GetSubfunctionsEnables
GetOEMNetFnIanaSupport
BMC Watchdog Timer Commands
Method Status corresponding ipmitool usage
ResetWatchdogTimer mc watchdog reset
SetWatchdogTimer
GetWatchdogTimer mc watchdog get
BMC Device and Messaging Commands
Method Status corresponding ipmitool usage
SetBMCGlobalEnables
GetBMCGlobalEnables
ClearMessageFlags
GetMessageFlags
EnableMessageChannelReceive
GetMessage
SendMessage
ReadEventMessageBuffer
GetBTInterfaceCapabilities
GetSystemGUID mc guid
SetSystemInfoParameters
GetSystemInfoParameters
GetChannelAuthCapabilities
GetSessionChallenge
ActivateSession
SetSessionPrivilegeLevel
CloseSession
GetSessionInfo session info
GetAuthCode
SetChannelAccess channel setaccess
GetChannelAccess channel info/getaccess
GetChannelInfo channel info
SetUserAccess
GetUserAccess user summary
GetUsers (*) user list
SetUsername user set name
DisableUser (*) user disable
EnableUser (*) user enable
GetUsername
SetUserPassword user set password
TestUserPassword (*) user test
ActivatePayload
DeactivatePayload
GetPayloadActivationStatus
GetPayloadInstanceInfo
SetUserPayloadAccess
GetUserPayloadAccess
GetChannelPayloadSupport
GetChannelPayloadVersion
GetChannelOEMPayloadInfo
MasterWriteRead
GetChannelCipherSuites
SuspendOrResumeEncryption
SetChannelCipherSuites
GetSystemInterfaceCapabilities
Chassis Device Commands
Method Status corresponding ipmitool usage
GetChassisCapabilities
GetChassisStatus chassis status, chassis power status
ChassisControl chassis power on/off/cycle/reset/diag/soft
ChassisReset
ChassisIdentify chassis identify
SetChassisCapabilities
SetPowerRestorePolicy chassis policy list/always-on/previous/always-off
GetSystemRestartCause chassis restart_cause
SetSystemBootOptions chassis bootparam set
SetBootParamBootFlags (*) chassis bootdev
GetSystemBootOptions chassis bootparam get
SetFrontPanelEnables
SetPowerCycleInterval
GetPOHCounter chassis poh
Event Commands
Method Status corresponding ipmitool usage
SetEventReceiver
GetEventReceiver
PlatformEventMessage
PEF and Alerting Commands
Method Status corresponding ipmitool usage
GetPEFCapabilities pef capabilities
ArmPEFPostponeTimer
SetPEFConfigParameters
GetPEFConfigParameters
SetLastProcessedEventId
GetLastProcessedEventId
AlertImmediate
PEFAck
Sensor Device Commands
Method Status corresponding ipmitool usage
GetDeviceSDRInfo
GetDeviceSDR
ReserveDeviceSDRRepo
GetSensorReadingFactors
SetSensorHysteresis
GetSensorHysteresis
SetSensorThresholds
GetSensorThresholds
SetSensorEventEnable
GetSensorEventEnable
RearmSensorEvents
GetSensorEventStatus
GetSensorReading
SetSensorType
GetSensorType
SetSensorReadingAndEventStatus
GetSensors (*) sensor list
GetSensorByID (*)
GetSensorByName (*) sensor get
FRU Device Commands
Method Status corresponding ipmitool usage
GetFRUInventoryAreaInfo
ReadFRUData
WriteFRUData
GetFRU (*) fru print
GetFRUs (*) fru print
SDR Device Commands
Method Status corresponding ipmitool usage
GetSDRRepoInfo sdr info
GetSDRRepoAllocInfo sdr info
ReserveSDRRepo
GetSDR
GetSDRs (*)
GetSDRBySensorID (*)
GetSDRBySensorName (*)
AddSDR
PartialAddSDR
DeleteSDR
ClearSDRRepo
GetSDRRepoTime
SetSDRRepoTime
EnterSDRRepoUpateMode
ExitSDRRepoUpdateMode
RunInitializationAgent
SEL Device Commands
Method Status corresponding ipmitool usage
GetSELInfo sel info
GetSELAllocInfo sel info
ReserveSEL
GetSELEntry
AddSELEntry
PartialAddSELEntry
DeleteSELEntry
ClearSEL sel clear
GetSELTime
SetSELTime
GetAuxLogStatus
SetAuxLogStatus
GetSELTimeUTCOffset
SetSELTimeUTCOffset
LAN Device Commands
Method Status corresponding ipmitool usage
SetLanConfigParams
GetLanConfigParams
SuspendARPs
GetIpStatistics
Serial/Modem Device Commands
Method Status corresponding ipmitool usage
SetSerialConfig
GetSerialConfig
SetSerialMux
GetTapResponseCodes
SetPPPTransmitData
GetPPPTransmitData
SendPPPPacket
GetPPPReceiveData
SerialConnectionActive
Callback
SetUserCallbackOptions
GetUserCallbackOptions
SetSerialRoutingMux
SOLActivating
GetSOLConfigParams
SetSOLConfigParams
SOLInfo sol info
Command Forwarding Commands
Method Status corresponding ipmitool usage
Fowarded
SetForwarded
GetForwarded
EnableForwarded
Bridge Management Commands (ICMB)
Method Status corresponding ipmitool usage
GetBridgeState
SetBridgeState
GetICMBAddress
SetICMBAddress
SetBridgeProxyAddress
GetBridgeStatistics
GetICMBCapabilities
ClearBridgeStatistics
GetBridgeProxyAddress
GetICMBConnectorInfo
GetICMBConnectionID
SendICMBConnectionID
Discovery Commands (ICMB)
Method Status corresponding ipmitool usage
PrepareForDiscovery
GetAddresses
SetDiscovered
GetChassisDeviceId
SetChassisDeviceId
Bridging Commands (ICMB)
Method Status corresponding ipmitool usage
BridgeRequest
BridgeMessage
Event Commands (ICMB)
Method Status corresponding ipmitool usage
GetEventCount
SetEventDestination
SetEventReceptionState
SendICMBEventMessage
GetEventDestination
GetEventReceptionState
Other Bridge Commands
Method Status corresponding ipmitool usage
ErrorReport

Reference

Documentation

Index

Constants

View Source
const (
	InterfaceLan     Interface = "lan"
	InterfaceLanplus Interface = "lanplus"
	InterfaceOpen    Interface = "open"
	InterfaceTool    Interface = "tool"

	DefaultExchangeTimeoutSec int = 20
	DefaultBufferSize         int = 1024
)
View Source
const (
	CommandRangeMask007F uint8 = 0x00
	CommandRangeMask80FF uint8 = 0x01
)
View Source
const (
	RmcpOpenSessionRequestSize     int = 32
	RmcpOpenSessionResponseSize    int = 36
	RmcpOpenSessionResponseMinSize int = 8
)
View Source
const (
	SystemPowerStateS0G0       uint8 = 0x00
	SystemPowerStateS1         uint8 = 0x01
	SystemPowerStateS2         uint8 = 0x02
	SystemPowerStateS3         uint8 = 0x03
	SystemPowerStateS4         uint8 = 0x04
	SystemPowerStateS5G2       uint8 = 0x05
	SystemPowerStateS4S5       uint8 = 0x06
	SystemPowerStateG3         uint8 = 0x07
	SystemPowerStateSleeping   uint8 = 0x08
	SystemPowerStateG1Sleeping uint8 = 0x09
	SystemPowerStateOverride   uint8 = 0x0a
	SystemPowerStateLegacyOn   uint8 = 0x20
	SystemPowerStateLegacyOff  uint8 = 0x21
	SystemPowerStateUnknown    uint8 = 0x2a
	SystemPowerStateNoChange   uint8 = 0x7f
)
View Source
const (
	DevicePowerStateD0       uint8 = 0x00
	DevicePowerStateD1       uint8 = 0x01
	DevicePowerStateD2       uint8 = 0x02
	DevicePowerStateD3       uint8 = 0x03
	DevicePowerStateUnknown  uint8 = 0x2a
	DevicePowerStateNoChange uint8 = 0x7f
)
View Source
const (
	RmcpVersion uint8 = 0x06

	IPMIVersion15 = 0x15
	IPMIVersion20 = 0x20

	RMCP_TYPE_MASK = 0x80
	RMCP_TYPE_NORM = 0x00
	RMCP_TYPE_ACK  = 0x01
)
View Source
const (
	MessageACKBit    uint8 = 0x80
	MessageNormalBit uint8 = 0x00
)
View Source
const (
	MessageClassASF  = 6
	MessageClassIPMI = 7
	MessageClassOEM  = 8
)
View Source
const (
	IPMB_LUN_BMC   LUN = 0x00 // BMC commands and Event Request Messages
	IPMB_LUN_OEM_1 LUN = 0x01 // OEM LUN 1
	IPMB_LUN_SMS   LUN = 0x10 // SMS Message LUN (Intended for messages to System Management Software)
	IPMB_LUN_OEM_2 LUN = 0x11 // OEM LUN 2

	// the least significat bit
	// 0b (ID is a slave address)
	// 1b (ID is a Software ID)
	BMC_SA             uint8 = 0x20 // BMC's responder address
	RemoteConsole_SWID uint8 = 0x81 // Remote Console Software ID
)

7.2 BMC IPMB LUNs

View Source
const (
	CipherSuiteID0        uint8 = 0
	CipherSuiteID1        uint8 = 1
	CipherSuiteID2        uint8 = 2
	CipherSuiteID3        uint8 = 3
	CipherSuiteID4        uint8 = 4
	CipherSuiteID5        uint8 = 5
	CipherSuiteID6        uint8 = 6
	CipherSuiteID7        uint8 = 7
	CipherSuiteID8        uint8 = 8
	CipherSuiteID9        uint8 = 9
	CipherSuiteID10       uint8 = 10
	CipherSuiteID11       uint8 = 11
	CipherSuiteID12       uint8 = 12
	CipherSuiteID13       uint8 = 13
	CipherSuiteID14       uint8 = 14
	CipherSuiteID15       uint8 = 15
	CipherSuiteID16       uint8 = 16
	CipherSuiteID17       uint8 = 17
	CipherSuiteID18       uint8 = 18
	CipherSuiteID19       uint8 = 19
	CipherSuiteIDReserved uint8 = 0xff
)
View Source
const (
	StandardCipherSuite uint8 = 0xc0
	OEMCipherSuite      uint8 = 0xc1

	CipherAlgMask       uint8 = 0x3f // [5:0]=111111b
	CipherAlgTagBitMask uint8 = 0xc0 // [7:6]=11b

	CipherAlgTagBitAuthMask       uint8 = 0x00 // [7:6]=00b
	CipherAlgTagBitInegrityMask   uint8 = 0x40 // [7:6]=01b
	CipherAlgTagBitEncryptionMask uint8 = 0x80 // [7:6]=10b

	LIST_ALGORITHMS_BY_CIPHER_SUITE uint8 = 0x80
)
View Source
const (
	EventDirDeassertion = true
	EventDirAssertion   = false
)
View Source
const (
	FRUFormatVersion     uint8 = 0x01
	FRUAreaFieldsEndMark uint8 = 0xc1
	FRUCommonHeaderSize  uint8 = 8
)
View Source
const (
	OEM_UNKNOWN                      = 0
	OEM_DEBUG                        = 0xFFFFFE /* Hoping IANA won't hit this soon */
	OEM_RESERVED                     = 0x0FFFFF /* As per IPMI 2.0 specification */
	OEM_IBM_2                        = 2        /* 2 for [IBM] */
	OEM_HP                           = 11
	OEM_SUN                          = 42
	OEM_NOKIA                        = 94
	OEM_BULL                         = 107
	OEM_HITACHI_116                  = 116
	OEM_NEC                          = 119
	OEM_TOSHIBA                      = 186
	OEM_ERICSSON                     = 193
	OEM_INTEL                        = 343
	OEM_TATUNG                       = 373
	OEM_HITACHI_399                  = 399
	OEM_DELL                         = 674
	OEM_HUAWEI                       = 2011
	OEM_LMC                          = 2168
	OEM_RADISYS                      = 4337
	OEM_BROADCOM                     = 4413
	OEM_IBM_4769                     = 4769 /* 4769 for [IBM Corporation] */
	OEM_MAGNUM                       = 5593
	OEM_TYAN                         = 6653
	OEM_QUANTA                       = 7244
	OEM_VIKING                       = 9237
	OEM_ADVANTECH                    = 10297
	OEM_FUJITSU_SIEMENS              = 10368
	OEM_AVOCENT                      = 10418
	OEM_PEPPERCON                    = 10437
	OEM_SUPERMICRO                   = 10876
	OEM_OSA                          = 11102
	OEM_GOOGLE                       = 11129
	OEM_PICMG                        = 12634
	OEM_RARITAN                      = 13742
	OEM_KONTRON                      = 15000
	OEM_PPS                          = 16394
	OEM_IBM_20301                    = 20301 /* 20301 for [IBM eServer X] */
	OEM_AMI                          = 20974
	OEM_FOXCONN                      = 22238
	OEM_ADLINK_24339                 = 24339 /* 24339 for [ADLINK TECHNOLOGY INC.] */
	OEM_H3C                          = 25506
	OEM_NOKIA_SOLUTIONS_AND_NETWORKS = 28458
	OEM_VITA                         = 33196
	OEM_INSPUR                       = 37945
	OEM_TENCENT                      = 41475
	OEM_BYTEDANCE                    = 46045
	OEM_SUPERMICRO_47488             = 47488
	OEM_YADRO                        = 49769
)
View Source
const (
	CryptAlg_None        CryptAlg = 0x00 // Mandatory
	CryptAlg_AES_CBC_128 CryptAlg = 0x01 // Mandatory
	CryptAlg_xRC4_128    CryptAlg = 0x02 // Optional
	CryptAlg_xRC4_40     CryptAlg = 0x03 // Optional

	Encryption_AES_CBS_128_BlockSize uint8 = 0x10
)
View Source
const (
	SensorThresholdStatus_OK  = "ok"
	SensorThresholdStatus_LNC = "lnc"
	SensorThresholdStatus_LCR = "lcr"
	SensorThresholdStatus_LNR = "lnr"
	SensorThresholdStatus_UNC = "unc"
	SensorThresholdStatus_UCR = "ucr"
	SensorThresholdStatus_UNR = "unr"
)
View Source
const (
	// SensorStatusOK means okay (the sensor is present and operating correctly)
	SensorStatusOK = "ok"

	// SensorStatusNoSensor means no sensor (corresponding reading will say disabled or Not Readable)
	SensorStatusNoSensor = "ns"

	// SensorStatusNonCritical means non-critical error (lower or upper)
	SensorStatusNonCritical = "nc"

	// SensorStatusCritical means critical error (lower or upper)
	SensorStatusCritical = "cr"

	// SensorStatusNonRecoverable means non-recoverable error (lower or upper)
	SensorStatusNonRecoverable = "nr"
)
View Source
const (
	SessionHeader20SizeMax int = 18
	SessionHeader20SizeMin int = 12

	SessionHeader15SizeMax int = 26
	SessionHeader15SizeMin int = 10
)
View Source
const (
	IPMIRequesterSequenceMax uint8 = 0x3f // RequesterSequence only occupy 6 bits
)
View Source
const IPMI_MAX_USER_NAME_LENGTH = 16
View Source
const IPMI_RAKP1_MESSAGE_SIZE = 44
View Source
const (
	MaxCipherSuiteListIndex uint8 = 0x3f
)
View Source
const SensorNumberReserved = 0xff

Variables

View Source
var (
	// a faked command for RAKP messages
	CommandNone = Command{}

	// IPM Device Global Commands
	CommandGetDeviceID                        = Command{ID: 0x01, NetFn: NetFnAppRequest, Name: "Get Device ID"}
	CommandColdReset                          = Command{ID: 0x02, NetFn: NetFnAppRequest, Name: "Cold Reset"}
	CommandWarmReset                          = Command{ID: 0x03, NetFn: NetFnAppRequest, Name: "Warm Reset"}
	CommandGetSelfTestResults                 = Command{ID: 0x04, NetFn: NetFnAppRequest, Name: "Get Self Test Results"}
	CommandManufacturingTestOn                = Command{ID: 0x05, NetFn: NetFnAppRequest, Name: "Manufacturing Test On"}
	CommandSetACPIPowerState                  = Command{ID: 0x06, NetFn: NetFnAppRequest, Name: "Set ACPI Power State"}
	CommandGetACPIPowerState                  = Command{ID: 0x07, NetFn: NetFnAppRequest, Name: "Get ACPI Power State"}
	CommandGetDeviceGUID                      = Command{ID: 0x08, NetFn: NetFnAppRequest, Name: "Get Device GUID"}
	CommandGetNetFnSupport                    = Command{ID: 0x09, NetFn: NetFnAppRequest, Name: "Get NetFn Support"}
	CommandGetCommandSupport                  = Command{ID: 0x0a, NetFn: NetFnAppRequest, Name: "Get Command Support"}
	CommandGetCommandSubfunctionSupport       = Command{ID: 0x0b, NetFn: NetFnAppRequest, Name: "Get Command Sub-function Support"}
	CommandGetConfigurableCommands            = Command{ID: 0x0c, NetFn: NetFnAppRequest, Name: "Get Configurable Commands"}
	CommandGetConfigurableCommandSubfunctions = Command{ID: 0x0d, NetFn: NetFnAppRequest, Name: "Get Configurable Command Sub-functions"} // 0Eh - 0Fh reserved
	CommandSetCommandEnables                  = Command{ID: 0x60, NetFn: NetFnAppRequest, Name: "Set Command Enables"}
	CommandGetCommandEnables                  = Command{ID: 0x61, NetFn: NetFnAppRequest, Name: "Get Command Enables"}
	CommandSetCommandSubfunctionsEnables      = Command{ID: 0x62, NetFn: NetFnAppRequest, Name: "Set Command Sub-function Enables"}
	CommandGetCommandSubfunctionsEnables      = Command{ID: 0x63, NetFn: NetFnAppRequest, Name: "Get Command Sub-function Enables"}
	CommandGetOEMNetFnIanaSupport             = Command{ID: 0x64, NetFn: NetFnAppRequest, Name: "Get OEM NetFn IANA Support"}

	// BMC Watchdog Timer Commands
	CommandResetWatchdogTimer = Command{ID: 0x22, NetFn: NetFnAppRequest, Name: "Reset Watchdog Timer"}
	CommandSetWatchdogTimer   = Command{ID: 0x24, NetFn: NetFnAppRequest, Name: "Set Watchdog Timer"}
	CommandGetWatchdogTimer   = Command{ID: 0x25, NetFn: NetFnAppRequest, Name: "Get Watchdog Timer"}

	// BMC Device and Messaging Commands
	CommandSetBMCGlobalEnables            = Command{ID: 0x2e, NetFn: NetFnAppRequest, Name: "Set BMC Global Enables"}
	CommandGetBMCGlobalEnables            = Command{ID: 0x2f, NetFn: NetFnAppRequest, Name: "Get BMC Global Enables"}
	CommandClearMessageFlags              = Command{ID: 0x30, NetFn: NetFnAppRequest, Name: "Clear Message Flags"}
	CommandGetMessageFlags                = Command{ID: 0x31, NetFn: NetFnAppRequest, Name: "Get Message Flags"}
	CommandEnableMessageChannelReceive    = Command{ID: 0x32, NetFn: NetFnAppRequest, Name: "Enable Message Channel Receive"}
	CommandGetMessage                     = Command{ID: 0x33, NetFn: NetFnAppRequest, Name: "Get Message"}
	CommandSendMessage                    = Command{ID: 0x34, NetFn: NetFnAppRequest, Name: "Send Message"}
	CommandReadEventMessageBuffer         = Command{ID: 0x35, NetFn: NetFnAppRequest, Name: "Read Event Message Buffer"}
	CommandGetBTInterfaceCapabilities     = Command{ID: 0x36, NetFn: NetFnAppRequest, Name: "Get BT Interface Capabilities"}
	CommandGetSystemGUID                  = Command{ID: 0x37, NetFn: NetFnAppRequest, Name: "Get System GUID"}
	CommandSetSystemInfoParameters        = Command{ID: 0x58, NetFn: NetFnAppRequest, Name: "Set System Info Parameters"}
	CommandGetSystemInfoParameters        = Command{ID: 0x59, NetFn: NetFnAppRequest, Name: "Get System Info Parameters"}
	CommandGetChannelAuthCapabilities     = Command{ID: 0x38, NetFn: NetFnAppRequest, Name: "Get Channel Authentication Capabilities"}
	CommandGetSessionChallenge            = Command{ID: 0x39, NetFn: NetFnAppRequest, Name: "Get Session Challenge"}
	CommandActivateSession                = Command{ID: 0x3a, NetFn: NetFnAppRequest, Name: "Activate Session"}
	CommandSetSessionPrivilegeLevel       = Command{ID: 0x3b, NetFn: NetFnAppRequest, Name: "Set Session Privilege Level"}
	CommandCloseSession                   = Command{ID: 0x3c, NetFn: NetFnAppRequest, Name: "Close Session"}
	CommandGetSessionInfo                 = Command{ID: 0x3d, NetFn: NetFnAppRequest, Name: "Get Session Info"} // 3e unassigned
	CommandGetAuthCode                    = Command{ID: 0x3f, NetFn: NetFnAppRequest, Name: "Get AuthCode"}
	CommandSetChannelAccess               = Command{ID: 0x40, NetFn: NetFnAppRequest, Name: "Set Channel Access"}
	CommandGetChannelAccess               = Command{ID: 0x41, NetFn: NetFnAppRequest, Name: "Get Channel Access"}
	CommandGetChannelInfo                 = Command{ID: 0x42, NetFn: NetFnAppRequest, Name: "Get Channel Info Command"}
	CommandSetUserAccess                  = Command{ID: 0x43, NetFn: NetFnAppRequest, Name: "Set User Access Command"}
	CommandGetUserAccess                  = Command{ID: 0x44, NetFn: NetFnAppRequest, Name: "Get User Access Command"}
	CommandSetUsername                    = Command{ID: 0x45, NetFn: NetFnAppRequest, Name: "Set User Name"}
	CommandGetUsername                    = Command{ID: 0x46, NetFn: NetFnAppRequest, Name: "Get User Name Command"}
	CommandSetUserPassword                = Command{ID: 0x47, NetFn: NetFnAppRequest, Name: "Set User Password Command"}
	CommandActivatePayload                = Command{ID: 0x48, NetFn: NetFnAppRequest, Name: "Activate Payload"}
	CommandDeactivatePayload              = Command{ID: 0x49, NetFn: NetFnAppRequest, Name: "Deactivate Payload"}
	CommandGetPayloadActivationStatus     = Command{ID: 0x4a, NetFn: NetFnAppRequest, Name: "Get Payload Activation Status"}
	CommandGetPayloadInstanceInfo         = Command{ID: 0x4b, NetFn: NetFnAppRequest, Name: "Get Payload Instance Info"}
	CommandSetUserPayloadAccess           = Command{ID: 0x4c, NetFn: NetFnAppRequest, Name: "Set User Payload Access"}
	CommandGetUserPayloadAccess           = Command{ID: 0x4d, NetFn: NetFnAppRequest, Name: "Get User Payload Access"}
	CommandGetChannelPayloadSupport       = Command{ID: 0x4e, NetFn: NetFnAppRequest, Name: "Get Channel Payload Support"}
	CommandGetChannelPayloadVersion       = Command{ID: 0x4f, NetFn: NetFnAppRequest, Name: "Get Channel Payload Version"}
	CommandGetChannelOEMPayloadInfo       = Command{ID: 0x50, NetFn: NetFnAppRequest, Name: "Get Channel OEM Payload Info"} // 51 unassigned
	CommandMasterWriteRead                = Command{ID: 0x52, NetFn: NetFnAppRequest, Name: "Master Write-Read"}            // 53 unassigned
	CommandGetChannelCipherSuites         = Command{ID: 0x54, NetFn: NetFnAppRequest, Name: "Get Channel Cipher Suites"}
	CommandSuspendOrResumeEncryption      = Command{ID: 0x55, NetFn: NetFnAppRequest, Name: "Suspend/Resume Payload Encryption"}
	CommandSetChannelCipherSuites         = Command{ID: 0x56, NetFn: NetFnAppRequest, Name: "Set Channel Security Keys"}
	CommandGetSystemInterfaceCapabilities = Command{ID: 0x57, NetFn: NetFnAppRequest, Name: "Get System Interface Capabilities"}

	// Chassis Device Commands
	CommandGetChassisCapabilities = Command{ID: 0x00, NetFn: NetFnChassisRequest, Name: "Get Chassis Capabilities"}
	CommandGetChassisStatus       = Command{ID: 0x01, NetFn: NetFnChassisRequest, Name: "Get Chassis Status"}
	CommandChassisControl         = Command{ID: 0x02, NetFn: NetFnChassisRequest, Name: "Chassis Control"}
	CommandChassisReset           = Command{ID: 0x03, NetFn: NetFnChassisRequest, Name: "Chassis Reset"}
	CommandChassisIdentify        = Command{ID: 0x04, NetFn: NetFnChassisRequest, Name: "Chassis Identify"}
	CommandSetChassisCapabilities = Command{ID: 0x05, NetFn: NetFnChassisRequest, Name: "Set Chassis Capabilities"}
	CommandSetPowerRestorePolicy  = Command{ID: 0x06, NetFn: NetFnChassisRequest, Name: "Set Power Restore Policy"}
	CommandGetSystemRestartCause  = Command{ID: 0x07, NetFn: NetFnChassisRequest, Name: "Get System Restart Cause"}
	CommandSetSystemBootOptions   = Command{ID: 0x08, NetFn: NetFnChassisRequest, Name: "Set System Boot Options"}
	CommandGetSystemBootOptions   = Command{ID: 0x09, NetFn: NetFnChassisRequest, Name: "Get System Boot Options"}
	CommandSetFrontPanelEnables   = Command{ID: 0x0a, NetFn: NetFnChassisRequest, Name: "Set Front Panel Button Enables"}
	CommandSetPowerCycleInterval  = Command{ID: 0x0b, NetFn: NetFnChassisRequest, Name: "Set Power Cycle Interval"} // 0ch -0eh unassigned
	CommandGetPOHCounter          = Command{ID: 0x0f, NetFn: NetFnChassisRequest, Name: "Get POH Counter"}

	// Event Commands
	CommandSetEventReceiver     = Command{ID: 0x00, NetFn: NetFnSensorEventRequest, Name: "Set Event Receiver"}
	CommandGetEventReceiver     = Command{ID: 0x01, NetFn: NetFnSensorEventRequest, Name: "Get Event Receiver"}
	CommandPlatformEventMessage = Command{ID: 0x02, NetFn: NetFnSensorEventRequest, Name: "Platform Event (Event Message)"} // 03h -0fh unassigned

	// PEF and Alerting Commands
	CommandGetPEFCapabilities      = Command{ID: 0x10, NetFn: NetFnSensorEventRequest, Name: "Get PEF Capabilities"}
	CommandArmPEFPostponeTimer     = Command{ID: 0x11, NetFn: NetFnSensorEventRequest, Name: "Arm PEF Postpone Timer"}
	CommandSetPEFConfigParameters  = Command{ID: 0x12, NetFn: NetFnSensorEventRequest, Name: "Set PEF Configuration Parameters"}
	CommandGetPEFConfigParameters  = Command{ID: 0x13, NetFn: NetFnSensorEventRequest, Name: "Get PEF Configuration Parameters"}
	CommandSetLastProcessedEventId = Command{ID: 0x14, NetFn: NetFnSensorEventRequest, Name: "Set Last Processed Event ID"}
	CommandGetLastProcessedEventId = Command{ID: 0x15, NetFn: NetFnSensorEventRequest, Name: "Get Last Processed Event ID"}
	CommandAlertImmediate          = Command{ID: 0x16, NetFn: NetFnSensorEventRequest, Name: "Alert Immediate"}
	CommandPEFAck                  = Command{ID: 0x17, NetFn: NetFnSensorEventRequest, Name: "PET Acknowledge"}

	// Sensor Device Commands
	CommandGetDeviceSDRInfo               = Command{ID: 0x20, NetFn: NetFnSensorEventRequest, Name: "Get Device SDR Info"}
	CommandGetDeviceSDR                   = Command{ID: 0x21, NetFn: NetFnSensorEventRequest, Name: "Get Device SDR"}
	CommandReserveDeviceSDRRepo           = Command{ID: 0x22, NetFn: NetFnSensorEventRequest, Name: "Reserve Device SDR Repository"}
	CommandGetSensorReadingFactors        = Command{ID: 0x23, NetFn: NetFnSensorEventRequest, Name: "Get Sensor Reading Factors"}
	CommandSetSensorHysteresis            = Command{ID: 0x24, NetFn: NetFnSensorEventRequest, Name: "Set Sensor Hysteresis"}
	CommandGetSensorHysteresis            = Command{ID: 0x25, NetFn: NetFnSensorEventRequest, Name: "Get Sensor Hysteresis"}
	CommandSetSensorThresholds            = Command{ID: 0x26, NetFn: NetFnSensorEventRequest, Name: "Set Sensor Threshold"}
	CommandGetSensorThresholds            = Command{ID: 0x27, NetFn: NetFnSensorEventRequest, Name: "Get Sensor Threshold"}
	CommandSetSensorEventEnable           = Command{ID: 0x28, NetFn: NetFnSensorEventRequest, Name: "Set Sensor Event Enable"}
	CommandGetSensorEventEnable           = Command{ID: 0x29, NetFn: NetFnSensorEventRequest, Name: "Get Sensor Event Enable"}
	CommandRearmSensorEvents              = Command{ID: 0x2a, NetFn: NetFnSensorEventRequest, Name: "Re-arm Sensor Events"}
	CommandGetSensorEventStatus           = Command{ID: 0x2b, NetFn: NetFnSensorEventRequest, Name: "Get Sensor Event Status"} // no 2c
	CommandGetSensorReading               = Command{ID: 0x2d, NetFn: NetFnSensorEventRequest, Name: "Get Sensor Reading"}
	CommandSetSensorType                  = Command{ID: 0x2e, NetFn: NetFnSensorEventRequest, Name: "Set Sensor Type"}
	CommandGetSensorType                  = Command{ID: 0x2f, NetFn: NetFnSensorEventRequest, Name: "Get Sensor Type"}
	CommandSetSensorReadingAndEventStatus = Command{ID: 0x30, NetFn: NetFnSensorEventRequest, Name: "Set Sensor Reading And Event Status"}

	// FRU Device Commands
	CommandGetFRUInventoryAreaInfo = Command{ID: 0x10, NetFn: NetFnStorageRequest, Name: "Get FRU Inventory Area Info"}
	CommandReadFRUData             = Command{ID: 0x11, NetFn: NetFnStorageRequest, Name: "Read FRU Data"}
	CommandWriteFRUData            = Command{ID: 0x12, NetFn: NetFnStorageRequest, Name: "Write FRU Data"}

	// SDR Device Commands
	CommandGetSDRRepoInfo         = Command{ID: 0x20, NetFn: NetFnStorageRequest, Name: "Get SDR Repository Info"}
	CommandGetSDRRepoAllocInfo    = Command{ID: 0x21, NetFn: NetFnStorageRequest, Name: "Get SDR Repository Allocation Info"}
	CommandReserveSDRRepo         = Command{ID: 0x22, NetFn: NetFnStorageRequest, Name: "Reserve SDR Repository"}
	CommandGetSDR                 = Command{ID: 0x23, NetFn: NetFnStorageRequest, Name: "Get SDR"}
	CommandAddSDR                 = Command{ID: 0x24, NetFn: NetFnStorageRequest, Name: "Add SDR"}
	CommandPartialAddSDR          = Command{ID: 0x25, NetFn: NetFnStorageRequest, Name: "Partial Add SDR"}
	CommandDeleteSDR              = Command{ID: 0x26, NetFn: NetFnStorageRequest, Name: "Delete SDR"}
	CommandClearSDRRepo           = Command{ID: 0x27, NetFn: NetFnStorageRequest, Name: "Clear SDR Repository"}
	CommandGetSDRRepoTime         = Command{ID: 0x28, NetFn: NetFnStorageRequest, Name: "Get SDR Repository Time"}
	CommandSetSDRRepoTime         = Command{ID: 0x29, NetFn: NetFnStorageRequest, Name: "Set SDR Repository Time"}
	CommandEnterSDRRepoUpateMode  = Command{ID: 0x2a, NetFn: NetFnStorageRequest, Name: "Enter SDR Repository Update Mode"}
	CommandExitSDRRepoUpdateMode  = Command{ID: 0x2b, NetFn: NetFnStorageRequest, Name: "Exit SDR Repository Update Mode"}
	CommandRunInitializationAgent = Command{ID: 0x2c, NetFn: NetFnStorageRequest, Name: "Run Initialization Agent"}

	// SEL Device Commands
	CommandGetSELInfo          = Command{ID: 0x40, NetFn: NetFnStorageRequest, Name: "Get SEL Info"}
	CommandGetSELAllocInfo     = Command{ID: 0x41, NetFn: NetFnStorageRequest, Name: "Get SEL Allocation Info"}
	CommandReserveSEL          = Command{ID: 0x42, NetFn: NetFnStorageRequest, Name: "Reserve SEL"}
	CommandGetSELEntry         = Command{ID: 0x43, NetFn: NetFnStorageRequest, Name: "Get SEL Entry"}
	CommandAddSELEntry         = Command{ID: 0x44, NetFn: NetFnStorageRequest, Name: "Add SEL Entry"}
	CommandPartialAddSELEntry  = Command{ID: 0x45, NetFn: NetFnStorageRequest, Name: "Partial Add SEL Entry"}
	CommandDeleteSELEntry      = Command{ID: 0x46, NetFn: NetFnStorageRequest, Name: "Delete SEL Entry"}
	CommandClearSEL            = Command{ID: 0x47, NetFn: NetFnStorageRequest, Name: "Clear SEL"}
	CommandGetSELTime          = Command{ID: 0x48, NetFn: NetFnStorageRequest, Name: "Get SEL Time"}
	CommandSetSELTime          = Command{ID: 0x49, NetFn: NetFnStorageRequest, Name: "Set SEL Time"}
	CommandGetAuxLogStatus     = Command{ID: 0x5a, NetFn: NetFnStorageRequest, Name: "Get Auxiliary Log Status"}
	CommandSetAuxLogStatus     = Command{ID: 0x5b, NetFn: NetFnStorageRequest, Name: "Set Auxiliary Log Status"}
	CommandGetSELTimeUTCOffset = Command{ID: 0x5c, NetFn: NetFnStorageRequest, Name: "Get SEL Time UTC Offset"}
	CommandSetSELTimeUTCOffset = Command{ID: 0x5d, NetFn: NetFnStorageRequest, Name: "Set SEL Time UTC Offset"}

	// LAN Device Commands
	CommandSetLanConfigParams = Command{ID: 0x01, NetFn: NetFnTransportRequest, Name: "Set LAN Configuration Parameters"}
	CommandGetLanConfigParams = Command{ID: 0x02, NetFn: NetFnTransportRequest, Name: "Get LAN Configuration Parameters"}
	CommandSuspendARPs        = Command{ID: 0x03, NetFn: NetFnTransportRequest, Name: "Suspend BMC ARPs"}
	CommandGetIpStatistics    = Command{ID: 0x04, NetFn: NetFnTransportRequest, Name: "Get IP/UDP/RMCP Statistics"}

	// Serial/Modem Device Commands
	CommandSetSerialConfig        = Command{ID: 0x10, NetFn: NetFnTransportRequest, Name: "Set Serial/Modem Configuration"}
	CommandGetSerialConfig        = Command{ID: 0x11, NetFn: NetFnTransportRequest, Name: "Get Serial/Modem Configuration"}
	CommandSetSerialMux           = Command{ID: 0x12, NetFn: NetFnTransportRequest, Name: "Set Serial/Modem Mux"}
	CommandGetTapResponseCodes    = Command{ID: 0x13, NetFn: NetFnTransportRequest, Name: "Get TAP Response Codes"}
	CommandSetPPPTransmitData     = Command{ID: 0x14, NetFn: NetFnTransportRequest, Name: "Set PPP UDP Proxy Transmit Data"}
	CommandGetPPPTransmitData     = Command{ID: 0x15, NetFn: NetFnTransportRequest, Name: "Get PPP UDP Proxy Transmit Data"}
	CommandSendPPPPacket          = Command{ID: 0x16, NetFn: NetFnTransportRequest, Name: "Send PPP UDP Proxy Packet"}
	CommandGetPPPReceiveData      = Command{ID: 0x17, NetFn: NetFnTransportRequest, Name: "Get PPP UDP Proxy Receive Data"}
	CommandSerialConnectionActive = Command{ID: 0x18, NetFn: NetFnTransportRequest, Name: "Serial/Modem Connection Active"}
	CommandCallback               = Command{ID: 0x19, NetFn: NetFnTransportRequest, Name: "Callback"}
	CommandSetUserCallbackOptions = Command{ID: 0x1a, NetFn: NetFnTransportRequest, Name: "Set User Callback Options"}
	CommandGetUserCallbackOptions = Command{ID: 0x1b, NetFn: NetFnTransportRequest, Name: "Get User Callback Options"}
	CommandSetSerialRoutingMux    = Command{ID: 0x1c, NetFn: NetFnTransportRequest, Name: "Set Serial Routing Mux"}
	CommandSOLActivating          = Command{ID: 0x20, NetFn: NetFnTransportRequest, Name: "SOL Activating"}
	CommandSetSOLConfigParams     = Command{ID: 0x21, NetFn: NetFnTransportRequest, Name: "Set SOL Configuration Parameters"}
	CommandGetSOLConfigParams     = Command{ID: 0x22, NetFn: NetFnTransportRequest, Name: "Get SOL Configuration Parameters"}

	// Command Forwarding Commands
	CommandFowarded        = Command{ID: 0x30, NetFn: NetFnTransportRequest, Name: "Forwarded Command"}
	CommandSetForwarded    = Command{ID: 0x31, NetFn: NetFnTransportRequest, Name: "Set Forwarded Commands"}
	CommandGetForwarded    = Command{ID: 0x32, NetFn: NetFnTransportRequest, Name: "Get Forwarded Commands"}
	CommandEnableForwarded = Command{ID: 0x33, NetFn: NetFnTransportRequest, Name: "Enable Forwarded Commands"}

	// Bridge Management Commands (ICMB)
	CommandGetBridgeState        = Command{ID: 0x00, NetFn: NetFnBridgeRequest, Name: "Get Bridge State"}
	CommandSetBridgeState        = Command{ID: 0x01, NetFn: NetFnBridgeRequest, Name: "Set Bridge State"}
	CommandGetICMBAddress        = Command{ID: 0x02, NetFn: NetFnBridgeRequest, Name: "Get ICMB Address"}
	CommandSetICMBAddress        = Command{ID: 0x03, NetFn: NetFnBridgeRequest, Name: "Set ICMB Address"}
	CommandSetBridgeProxyAddress = Command{ID: 0x04, NetFn: NetFnBridgeRequest, Name: "Set Bridge ProxyAddress"}
	CommandGetBridgeStatistics   = Command{ID: 0x05, NetFn: NetFnBridgeRequest, Name: "Get Bridge Statistics"}
	CommandGetICMBCapabilities   = Command{ID: 0x06, NetFn: NetFnBridgeRequest, Name: "Get ICMB Capabilities"}
	CommandClearBridgeStatistics = Command{ID: 0x08, NetFn: NetFnBridgeRequest, Name: "Clear Bridge Statistics"}
	CommandGetBridgeProxyAddress = Command{ID: 0x09, NetFn: NetFnBridgeRequest, Name: "Get Bridge Proxy Address"}
	CommandGetICMBConnectorInfo  = Command{ID: 0x0a, NetFn: NetFnBridgeRequest, Name: "Get ICMB Connector Info"}
	CommandGetICMBConnectionID   = Command{ID: 0x0b, NetFn: NetFnBridgeRequest, Name: "Get ICMB Connection ID"}
	CommandSendICMBConnectionID  = Command{ID: 0x0c, NetFn: NetFnBridgeRequest, Name: "Send ICMB Connection ID"}

	// Discovery Commands (ICMB)
	CommandPrepareForDiscovery = Command{ID: 0x10, NetFn: NetFnBridgeRequest, Name: "PrepareForDiscovery"}
	CommandGetAddresses        = Command{ID: 0x11, NetFn: NetFnBridgeRequest, Name: "GetAddresses"}
	CommandSetDiscovered       = Command{ID: 0x12, NetFn: NetFnBridgeRequest, Name: "SetDiscovered"}
	CommandGetChassisDeviceId  = Command{ID: 0x13, NetFn: NetFnBridgeRequest, Name: "GetChassisDeviceId"}
	CommandSetChassisDeviceId  = Command{ID: 0x14, NetFn: NetFnBridgeRequest, Name: "SetChassisDeviceId"}

	// Bridging Commands (ICMB)
	CommandBridgeRequest = Command{ID: 0x20, NetFn: NetFnBridgeRequest, Name: "BridgeRequest"}
	CommandBridgeMessage = Command{ID: 0x21, NetFn: NetFnBridgeRequest, Name: "BridgeMessage"}

	// Event Commands (ICMB)
	CommandGetEventCount          = Command{ID: 0x30, NetFn: NetFnBridgeRequest, Name: "GetEventCount"}
	CommandSetEventDestination    = Command{ID: 0x31, NetFn: NetFnBridgeRequest, Name: "SetEventDestination"}
	CommandSetEventReceptionState = Command{ID: 0x32, NetFn: NetFnBridgeRequest, Name: "SetEventReceptionState"}
	CommandSendICMBEventMessage   = Command{ID: 0x33, NetFn: NetFnBridgeRequest, Name: "SendICMBEventMessage"}
	CommandGetEventDestination    = Command{ID: 0x34, NetFn: NetFnBridgeRequest, Name: "GetEventDestination (optional)"}
	CommandGetEventReceptionState = Command{ID: 0x35, NetFn: NetFnBridgeRequest, Name: "GetEventReceptionState (optional)"}

	// Other Bridge Commands
	CommandErrorReport = Command{ID: 0xff, NetFn: NetFnBridgeRequest, Name: "Error Report (optional)"}

	// Vendor Specific Commands
	CommandGetSupermicroBiosVersion = Command{ID: 0xAC, NetFn: NetFnOEMSupermicroRequest, Name: "Get Supermicro BIOS Version"}
)

Appendix G - Command Assignments Command Number Assignments (Appendix G, table G-1)

View Source
var (
	SensorEvent_UNC_High_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNC,
		Assert:        true,
		High:          true,
	}

	SensorEvent_UNC_Low_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNC,
		Assert:        true,
		High:          false,
	}

	SensorEvent_LNR_High_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNR,
		Assert:        true,
		High:          true,
	}

	SensorEvent_LNR_Low_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNR,
		Assert:        true,
		High:          false,
	}

	SensorEvent_LCR_High_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LCR,
		Assert:        true,
		High:          true,
	}

	SensorEvent_LCR_Low_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LCR,
		Assert:        true,
		High:          false,
	}

	SensorEvent_LNC_High_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNC,
		Assert:        true,
		High:          true,
	}

	SensorEvent_LNC_Low_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNC,
		Assert:        true,
		High:          false,
	}

	SensorEvent_UNR_High_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNR,
		Assert:        true,
		High:          true,
	}

	SensorEvent_UNR_Low_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNR,
		Assert:        true,
		High:          false,
	}

	SensorEvent_UCR_High_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UCR,
		Assert:        true,
		High:          true,
	}

	SensorEvent_UCR_Low_Assert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UCR,
		Assert:        true,
		High:          false,
	}

	SensorEvent_State_14_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       14,
	}

	SensorEvent_State_13_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       13,
	}

	SensorEvent_State_12_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       12,
	}

	SensorEvent_State_11_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       11,
	}

	SensorEvent_State_10_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       10,
	}

	SensorEvent_State_9_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       9,
	}

	SensorEvent_State_8_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       8,
	}

	SensorEvent_State_7_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       7,
	}

	SensorEvent_State_6_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       6,
	}

	SensorEvent_State_5_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       5,
	}

	SensorEvent_State_4_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       4,
	}

	SensorEvent_State_3_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       3,
	}

	SensorEvent_State_2_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       2,
	}

	SensorEvent_State_1_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       1,
	}

	SensorEvent_State_0_Assert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      true,
		State:       0,
	}

	SensorEvent_UNC_High_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNC,
		Assert:        false,
		High:          true,
	}

	SensorEvent_UNC_Low_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNC,
		Assert:        false,
		High:          true,
	}

	SensorEvent_LNR_High_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNR,
		Assert:        false,
		High:          true,
	}

	SensorEvent_LNR_Low_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNR,
		Assert:        false,
		High:          false,
	}

	SensorEvent_LCR_High_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LCR,
		Assert:        false,
		High:          true,
	}

	SensorEvent_LCR_Low_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LCR,
		Assert:        false,
		High:          false,
	}

	SensorEvent_LNC_High_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNC,
		Assert:        false,
		High:          true,
	}

	SensorEvent_LNC_Low_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_LNC,
		Assert:        false,
		High:          false,
	}

	SensorEvent_UNR_High_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNR,
		Assert:        false,
		High:          true,
	}

	SensorEvent_UNR_Low_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UNR,
		Assert:        false,
		High:          false,
	}

	SensorEvent_UCR_High_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UCR,
		Assert:        false,
		High:          true,
	}

	SensorEvent_UCR_Low_Deassert = SensorEvent{
		SensorClass:   SensorClassThreshold,
		ThresholdType: SensorThresholdType_UCR,
		Assert:        false,
		High:          false,
	}

	SensorEvent_State_14_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       14,
	}

	SensorEvent_State_13_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       13,
	}

	SensorEvent_State_12_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       12,
	}

	SensorEvent_State_11_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       11,
	}

	SensorEvent_State_10_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       10,
	}

	SensorEvent_State_9_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       9,
	}

	SensorEvent_State_8_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       8,
	}

	SensorEvent_State_7_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       7,
	}

	SensorEvent_State_6_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       6,
	}

	SensorEvent_State_5_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       5,
	}

	SensorEvent_State_4_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       4,
	}

	SensorEvent_State_3_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       3,
	}

	SensorEvent_State_2_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       2,
	}

	SensorEvent_State_1_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       1,
	}

	SensorEvent_State_0_Deassert = SensorEvent{
		SensorClass: SensorClassDiscrete,
		Assert:      false,
		State:       0,
	}
)
View Source
var CC = map[uint8]string{
	0x00: "Command completed normally",
	0xc0: "Node busy",
	0xc1: "Invalid command",
	0xc2: "Invalid command on LUN",
	0xc3: "Timeout",
	0xc4: "Out of space",
	0xc5: "Reservation cancelled or invalid",
	0xc6: "Request data truncated",
	0xc7: "Request data length invalid",
	0xc8: "Request data field length limit exceeded",
	0xc9: "Parameter out of range",
	0xca: "Cannot return number of requested data bytes",
	0xcb: "Requested sensor, data, or record not found",
	0xcc: "Invalid data field in request",
	0xcd: "Command illegal for specified sensor or record type",
	0xce: "Command response could not be provided",
	0xcf: "Cannot execute duplicated request",
	0xd0: "SDR Repository in update mode",
	0xd1: "Device firmeware in update mode",
	0xd2: "BMC initialization in progress",
	0xd3: "Destination unavailable",
	0xd4: "Insufficient privilege level",
	0xd5: "Command not supported in present state",
	0xd6: "Cannot execute command, command disabled",
	0xff: "Unspecified error",
}
View Source
var (
	ErrUnpackedDataTooShort = errors.New("unpacked data is too short")
)
View Source
var GenericEvents = map[EventReadingType]map[uint8]Event{
	EventReadingTypeThreshold: {
		0x00: {
			EventName: "Lower Non-critical - going low",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "Lower Non-critical - going high",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x02: {
			EventName: "Lower Critical - going low",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x03: {
			EventName: "Lower Critical - going high",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x04: {
			EventName: "Lower Non-recoverable - going low",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x5: {
			EventName: "Lower Non-recoverable - going high",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x06: {
			EventName: "Upper Non-critical - going low",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x07: {
			EventName: "Upper Non-critical - going high",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x08: {
			EventName: "Upper Critical - going low",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x09: {
			EventName: "Upper Critical - going high",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x0a: {
			EventName: "Upper Non-recoverable - going low",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x0b: {
			EventName: "Upper Non-recoverable - going high",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
	},
	EventReadingTypeTransitionState: {
		0x00: {
			EventName: "Transition to Idle",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeSystemEvent: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeSystemEvent: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "Transition to Active",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeSystemEvent: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeSystemEvent: EventSeverityInfo,
			},
		},
		0x02: {
			EventName: "Transition to Busy",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeSystemEvent: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeSystemEvent: EventSeverityInfo,
			},
		},
	},
	EventReadingTypeState: {
		0x00: {
			EventName: "State Deasserted",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:               EventSeverityInfo,
				SensorTypeSystemEvent:            EventSeverityInfo,
				SensorTypeButtonSwitch:           EventSeverityInfo,
				SensorTypeModuleBoard:            EventSeverityInfo,
				SensorTypeBootError:              EventSeverityInfo,
				SensorTypeOSStopShutdown:         EventSeverityInfo,
				SensorTypePlatformAlert:          EventSeverityInfo,
				SensorTypeTemperature:            EventSeverityInfo,
				SensorTypeVoltage:                EventSeverityInfo,
				SensorTypeFan:                    EventSeverityInfo,
				SensorTypeProcessor:              EventSeverityInfo,
				SensorTypePowserSupply:           EventSeverityInfo,
				SensorTypePowerUnit:              EventSeverityInfo,
				SensorTypeMemory:                 EventSeverityInfo,
				SensorTypeDriveSlot:              EventSeverityWarning,
				SensorTypePostMemoryResize:       EventSeverityInfo,
				SensorTypeSystemFirmwareProgress: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:               EventSeverityInfo,
				SensorTypeSystemEvent:            EventSeverityInfo,
				SensorTypeButtonSwitch:           EventSeverityInfo,
				SensorTypeModuleBoard:            EventSeverityInfo,
				SensorTypeBootError:              EventSeverityInfo,
				SensorTypeOSStopShutdown:         EventSeverityInfo,
				SensorTypePlatformAlert:          EventSeverityInfo,
				SensorTypeTemperature:            EventSeverityInfo,
				SensorTypeVoltage:                EventSeverityInfo,
				SensorTypeFan:                    EventSeverityInfo,
				SensorTypeProcessor:              EventSeverityInfo,
				SensorTypePowserSupply:           EventSeverityInfo,
				SensorTypePowerUnit:              EventSeverityInfo,
				SensorTypeMemory:                 EventSeverityInfo,
				SensorTypeDriveSlot:              EventSeverityWarning,
				SensorTypePostMemoryResize:       EventSeverityInfo,
				SensorTypeSystemFirmwareProgress: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "State Asserted",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:               EventSeverityInfo,
				SensorTypeSystemEvent:            EventSeverityWarning,
				SensorTypeButtonSwitch:           EventSeverityInfo,
				SensorTypeModuleBoard:            EventSeverityCritical,
				SensorTypeBootError:              EventSeverityCritical,
				SensorTypeOSStopShutdown:         EventSeverityCritical,
				SensorTypePlatformAlert:          EventSeverityCritical,
				SensorTypeTemperature:            EventSeverityWarning,
				SensorTypeVoltage:                EventSeverityWarning,
				SensorTypeFan:                    EventSeverityWarning,
				SensorTypeProcessor:              EventSeverityCritical,
				SensorTypePowserSupply:           EventSeverityWarning,
				SensorTypePowerUnit:              EventSeverityWarning,
				SensorTypeMemory:                 EventSeverityCritical,
				SensorTypeDriveSlot:              EventSeverityInfo,
				SensorTypePostMemoryResize:       EventSeverityWarning,
				SensorTypeSystemFirmwareProgress: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:               EventSeverityInfo,
				SensorTypeSystemEvent:            EventSeverityWarning,
				SensorTypeButtonSwitch:           EventSeverityInfo,
				SensorTypeModuleBoard:            EventSeverityCritical,
				SensorTypeBootError:              EventSeverityCritical,
				SensorTypeOSStopShutdown:         EventSeverityCritical,
				SensorTypePlatformAlert:          EventSeverityCritical,
				SensorTypeTemperature:            EventSeverityWarning,
				SensorTypeVoltage:                EventSeverityWarning,
				SensorTypeFan:                    EventSeverityWarning,
				SensorTypeProcessor:              EventSeverityCritical,
				SensorTypePowserSupply:           EventSeverityWarning,
				SensorTypePowerUnit:              EventSeverityWarning,
				SensorTypeMemory:                 EventSeverityCritical,
				SensorTypeDriveSlot:              EventSeverityInfo,
				SensorTypePostMemoryResize:       EventSeverityWarning,
				SensorTypeSystemFirmwareProgress: EventSeverityWarning,
			},
		},
	},
	EventReadingTypePredicitiveFailure: {
		0x00: {
			EventName: "Predictive Failure deasserted",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:  EventSeverityInfo,
				SensorTypeDriveSlot: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:  EventSeverityInfo,
				SensorTypeDriveSlot: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "Predictive Failure asserted",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:  EventSeverityCritical,
				SensorTypeDriveSlot: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:  EventSeverityCritical,
				SensorTypeDriveSlot: EventSeverityCritical,
			},
		},
	},
	EventReadingTypeLimit: {
		0x00: {
			EventName: "Limit Not Exceeded",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeTemperature: EventSeverityInfo,
				SensorTypeVoltage:     EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityInfo,
				SensorTypeTemperature: EventSeverityInfo,
				SensorTypeVoltage:     EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "Limit Exceeded",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityCritical,
				SensorTypeTemperature: EventSeverityCritical,
				SensorTypeVoltage:     EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved:    EventSeverityCritical,
				SensorTypeTemperature: EventSeverityCritical,
				SensorTypeVoltage:     EventSeverityCritical,
			},
		},
	},
	EventReadingTypePeformance: {
		0x00: {
			EventName: "Performance Met",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
				SensorTypeVoltage:  EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
				SensorTypeVoltage:  EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "Performance Lags",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
				SensorTypeVoltage:  EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
				SensorTypeVoltage:  EventSeverityCritical,
			},
		},
	},
	EventReadingTypeTransitionSeverity: {
		0x00: {
			EventName: "transition to OK",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "transition to Non-Critical from OK",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x02: {
			EventName: "transition to Critical from less severe",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x03: {
			EventName: "transition to Non-recoverable from less severe",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x04: {
			EventName: "transition to Non-Critical from more severe",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x05: {
			EventName: "transition to Critical from Non-recoverable",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x06: {
			EventName: "transition to Non-recoverable",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x07: {
			EventName: "Monitor",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x08: {
			EventName: "Informational",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
	},
	EventReadingTypeDevicePresent: {
		0x00: {
			EventName: "Device Removed / Device Absent",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x01: {
			EventName: "Device Inserted / Device Present",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
	},
	EventReadingTypeDeviceEnabled: {
		0x00: {
			EventName: "Device Disabled",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x01: {
			EventName: "Device Enabled",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
	},
	EventReadingTypeTransitionAvailability: {
		0x00: {
			EventName: "transition to Running",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "transition to In Test",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x02: {
			EventName: "transition to Power Off",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x03: {
			EventName: "transition to On Line",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x04: {
			EventName: "transition to Off Line",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x05: {
			EventName: "transition to Off Duty",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x06: {
			EventName: "transition to Degraded",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
		0x07: {
			EventName: "transition to Power Save",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x08: {
			EventName: "Install Error",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
		},
	},
	EventReadingTypeRedundancy: {
		0x00: {
			EventName: "Fully Redundant",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "Redundancy Lost",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x02: {
			EventName: "Redundancy Degraded",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x03: {
			EventName: "Non-redundant (Sufficient Resources from Redundant)",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x04: {
			EventName: "Non-redundant (Sufficient Resources from Insufficient Resources)",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x05: {
			EventName: "Non-redundant (Insufficient Resources)",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityCritical,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x06: {
			EventName: "Redundancy Degraded from Fully Redundant",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
		0x07: {
			EventName: "Redundancy Degraded from Non-redundant",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityWarning,
			},
		},
	},
	EventReadingTypeACPIPowerState: {
		0x00: {
			EventName: "D0 Power State",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x01: {
			EventName: "D1 Power State",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x02: {
			EventName: "D2 Power State",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
		0x03: {
			EventName: "D3 Power State",
			AssertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
			DeassertionSeverityMap: map[SensorType]EventSeverity{
				SensorTypeReserved: EventSeverityInfo,
			},
		},
	},
}

Table 42-2, Generic Event/Reading Type Codes Including Genereic threshold-based events (0x01) and Generic discrete-based events (0x02 - 0x0c) EventReadingType, Offset

The severity is copied from freeipmi/libfreeipmi/interpret/ipmi-interpret-config-sel.c

View Source
var LanParams = []LanParam{
	{Selector: LanParam_SetInProgress, DataSize: 1, Name: "Set in Progress"},
	{Selector: LanParam_AuthTypeSupported, DataSize: 1, Name: "Auth Type Support"},
	{Selector: LanParam_AuthTypeEnables, DataSize: 5, Name: "Auth Type Enable"},
	{Selector: LanParam_IP, DataSize: 4, Name: "IP Address"},
	{Selector: LanParam_IPSource, DataSize: 1, Name: "IP Address Source"},
	{Selector: LanParam_MAC, DataSize: 6, Name: "MAC Address"},
	{Selector: LanParam_SubnetMask, DataSize: 4, Name: "Subnet Mask"},
	{Selector: LanParam_IPv4HeaderParams, DataSize: 3, Name: "IP Header"},
	{Selector: LanParam_PrimaryRMCPPort, DataSize: 2, Name: "Primary RMCP Port"},
	{Selector: LanParam_SecondaryRMCPPort, DataSize: 2, Name: "Secondary RMCP Port"},
	{Selector: LanParam_ARPControl, DataSize: 1, Name: "BMC ARP Control"},
	{Selector: LanParam_GratuituousARPInterval, DataSize: 1, Name: "Gratituous ARP Intrvl"},
	{Selector: LanParam_DefaultGatewayIP, DataSize: 4, Name: "Default Gateway IP"},
	{Selector: LanParam_DefaultGatewayMAC, DataSize: 6, Name: "Default Gateway MAC"},
	{Selector: LanParam_BackupGatewayIP, DataSize: 4, Name: "Backup Gateway IP"},
	{Selector: LanParam_BackupGatewayMAC, DataSize: 6, Name: "Backup Gateway MAC"},
	{Selector: LanParam_CommunityString, DataSize: 18, Name: "SNMP Community String"},
	{Selector: LanParam_AlertDestinationsNumber, DataSize: 1, Name: "Number of Destinations"},
	{Selector: LanParam_AlertDestinationType, DataSize: 4, Name: "Destination Type"},
	{Selector: LanParam_AlertDestinationAddress, DataSize: 18, Name: "Destination Addresses"},
	{Selector: LanParam_VLANID, DataSize: 2, Name: "802.1q VLAN ID"},
	{Selector: LanParam_VLANPriority, DataSize: 1, Name: "802.1q VLAN Priority"},
	{Selector: LanParam_CipherSuiteEntrySupport, DataSize: 1, Name: "RMCP+ Cipher Suite Count"},
	{Selector: LanParam_CipherSuiteEntries, DataSize: 17, Name: "RMCP+ Cipher Suites"},
	{Selector: LanParam_CihperSuitePrivilegeLevels, DataSize: 9, Name: "Cipher Suite Priv Max"},
	{Selector: LanParam_BadPassordThreshold, DataSize: 4, Name: "Bad Password Threshold"},
}
View Source
var SensorSpecificEvents = map[SensorType]map[uint8]Event{
	SensorTypeReserved:    {},
	SensorTypeTemperature: {},
	SensorTypeVoltage:     {},
	SensorTypeCurrent:     {},
	SensorTypeFan:         {},
	SensorTypePhysicalSecurity: {
		0x00: {
			EventName:           "General Chassis Intrusion",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Drive Bay intrusion",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "I/O Card area intrusion",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Processor area intrusion",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "LAN Leash Lost (system is unplugged from LAN)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "Unauthorized dock",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x06: {
			EventName:           "FAN area intrusion",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypePlatformSecurity: {
		0x00: {
			EventName:           "Secure Mode (Front Panel Lockout) Violation attempt",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Pre-boot Password Violation - user password",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "Pre-boot Password Violation attempt - setup password",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Pre-boot Password Violation - network boot password",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "Other pre-boot Password Violation",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "Out-of-band Access Password Violation",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeProcessor: {
		0x00: {
			EventName:           "IERR",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Thermal Trip",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "FRB1/BIST failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "FRB2/Hang in POST failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "FRB3/Processor Startup/Initialization failure (CPU didn't start)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "Configuration Error",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x06: {
			EventName:           "SM BIOS 'Uncorrectable CPU-complex Error'",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x07: {
			EventName:           "Processor Presence detected",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x08: {
			EventName:           "Processor disabled",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x09: {
			EventName:           "Terminator Presence Detected",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x0a: {
			EventName:           "Processor Automatically Throttled",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x0b: {
			EventName:           "Machine Check Exception (Uncorrectable)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x0c: {
			EventName:           "Correctable Machine Check Error",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
	},
	SensorTypePowserSupply: {
		0x00: {
			EventName:           "Presence detected",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Power Supply Failure detected",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "Predictive Failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Power Supply input lost (AC/DC)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x04: {
			EventName:           "Power Supply input lost or out-of-range",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x05: {
			EventName:           "Power Supply input out-of-range, but present",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x06: {
			EventName:           "Configuration error",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x07: {
			EventName:           "Power Supply Inactive (in standby state)",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
	},
	SensorTypePowerUnit: {
		0x00: {
			EventName:           "Power Off / Power Dow",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Power Cycle",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "240VA Power Down",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "Interlock Power Down",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x04: {
			EventName:           "AC lost / Power input lost ",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x05: {
			EventName:           "Soft Power Control Failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x06: {
			EventName:           "Power Unit Failure detected",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x07: {
			EventName:           "Predictive Failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeCollingDevice: {},

	SensorTypeOtherUnitsbased: {},
	SensorTypeMemory: {
		0x00: {
			EventName:           "Correctable ECC / other correctable memory error",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x01: {
			EventName:           "Uncorrectable ECC / other uncorrectable memory error",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "Parity",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Memory Scrub Failed (stuck bit)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "Memory Device Disabled",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "Correctable ECC / other correctable memory error logging limit reached",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x06: {
			EventName:           "Presence detected",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x07: {
			EventName:           "Configuration error",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x08: {
			EventName:           "Spare",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x09: {
			EventName:           "Memory Automatically Throttled",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x0a: {
			EventName:           "Critical Overtemperature",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeDriveSlot: {
		0x00: {
			EventName:           "Drive Presence",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Drive Fault",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "Predictive Failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Hot Spare",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x04: {
			EventName:           "Consistency Check / Parity Check in progress",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x05: {
			EventName:           "In Critical Array",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x06: {
			EventName:           "In Failed Array",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x07: {
			EventName:           "Rebuild/Remap in progress",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x08: {
			EventName:           "Rebuild/Remap Aborted (was not completed normally)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypePostMemoryResize: {},
	SensorTypeSystemFirmwareProgress: {
		0x00: {
			EventName:           "System Firmware Error (POST Error)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "System Firmware Hang",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "System Firmware Progress",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
	},
	SensorTypeEventLoggingDisabled: {
		0x00: {
			EventName:           "Correctable Memory Error Logging Disabled",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Event 'Type' Logging Disabled",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "Log Area Reset/Cleared",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "All Event Logging Disabled",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "SEL Full",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "SEL Almost Full",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x06: {
			EventName:           "Correctable Machine Check Error Logging Disabled",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeWatchdog1: {
		0x00: {
			EventName: "BIOS Watchdog Reset",
		},
		0x01: {
			EventName: "OS Watchdog Reset",
		},
		0x02: {
			EventName: "OS Watchdog Shut Down",
		},
		0x03: {
			EventName: "OS Watchdog Power Down",
		},
		0x04: {
			EventName: "OS Watchdog Power Cycle",
		},
		0x05: {
			EventName: "OS Watchdog NMI / Diagnostic Interrupt",
		},
		0x06: {
			EventName: "OS Watchdog Expired, status only",
		},
		0x07: {
			EventName: "OS Watchdog pre-timeout Interrupt, non-NMI",
		},
	},
	SensorTypeSystemEvent: {
		0x00: {
			EventName:           "System Reconfigured",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x01: {
			EventName:           "OEM System Boot Event",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "Undetermined system hardware failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Entry added to Auxiliary Log",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x04: {
			EventName:           "PEF Action",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x05: {
			EventName:           "Timestamp Clock Synch",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
	},
	SensorTypeCriticalInterrupt: {
		0x00: {
			EventName:           "Front Panel NMI / Diagnostic Interrupt",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Bus Timeout",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "I/O channel check NMI",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Software NMI",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x04: {
			EventName:           "PCI PERR",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "PCI SERR",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x06: {
			EventName:           "EISA Fail Safe Timeout",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x07: {
			EventName:           "Bus Correctable Error",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x08: {
			EventName:           "Bus Uncorrectable Error",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x09: {
			EventName:           "Fatal NMI",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x0a: {
			EventName:           "Bus Fatal Error",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x0b: {
			EventName:           "Bus Degraded",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
	},
	SensorTypeButtonSwitch: {
		0x00: {
			EventName:           "Power Button pressed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Sleep Button pressed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "Reset Button pressed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "FRU latch open",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x04: {
			EventName:           "FRU service request button",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
	},
	SensorTypeModuleBoard:                {},
	SensorTypeMicrocontrollerCoprocessor: {},
	SensorTypeAddinCard:                  {},
	SensorTypeChassis:                    {},
	SensorTypeChipSet: {
		0x00: {
			EventName:           "Soft Power Control Failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Thermal Trip",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeOtherFRU: {},
	SensorTypeCableInterconnect: {
		0x00: {
			EventName:           "Cable/Interconnect is connected",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Configuration Error - Incorrect cable connected / Incorrect interconnection",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeTerminator: {},
	SensorTypeSystemBootRestartInitiated: {
		0x00: {
			EventName:           "Initiated by power up",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Initiated by hard reset",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "Initiated by warm reset",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "User requested PXE boot",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x04: {
			EventName:           "Automatic boot to diagnostic",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x05: {
			EventName:           "OS / run-time software initiated hard reset",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x06: {
			EventName:           "OS / run-time software initiated warm reset",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x07: {
			EventName:           "System Restart",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
	},
	SensorTypeBootError: {
		0x00: {
			EventName:           "No bootable media",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Non-bootable diskette left in drive",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "PXE Server not found",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Invalid boot sector",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "Timeout waiting for user selection of boot source",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
	},
	SensorTypeBaseOSBootInstallationStatus: {
		0x00: {
			EventName:           "A: boot completed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "C: boot completed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "PXE boot completed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "Diagnostic boot completed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x04: {
			EventName:           "CD-ROM boot completed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x05: {
			EventName:           "ROM boot completed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x06: {
			EventName:           "boot completed - boot device not specified",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x07: {
			EventName:           "Base OS/Hypervisor Installation started",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x08: {
			EventName:           "Base OS/Hypervisor Installation completed",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x09: {
			EventName:           "Base OS/Hypervisor Installation aborted",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x0a: {
			EventName:           "Base OS/Hypervisor Installation failed",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeOSStopShutdown: {
		0x00: {
			EventName:           "Critical stop during OS load / initialization",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Run-time Critical Stop",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "OS Graceful Stop",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x03: {
			EventName:           "OS Graceful Shutdown",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x04: {
			EventName:           "Soft Shutdown initiated by PEF",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x05: {
			EventName:           "Agent Not Responding",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeSlotConnector: {
		0x00: {
			EventName:           "Fault Status asserted",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "Identify Status asserted",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x02: {
			EventName:           "Slot / Connector Device installed/attached",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "Slot / Connector Ready for Device Installation",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x04: {
			EventName:           "Slot/Connector Ready for Device Removal",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x05: {
			EventName:           "Slot Power is Off",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x06: {
			EventName:           "Slot / Connector Device Removal Request",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x07: {
			EventName:           "Interlock asserted",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x08: {
			EventName:           "Slot is Disabled",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x09: {
			EventName:           "Slot holds spare device",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
	},
	SensorTypeSystemACPIPowerState: {
		0x00: {
			EventName:           "S0 / G0 (working)",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "S1 (sleeping with system h/w & processor context maintained)",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "S2 (sleeping, processor context lost)",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "S3 (sleeping, processor & h/w context lost, memory retained)",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x04: {
			EventName:           "S4 (non-volatile sleep / suspend-to disk)",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x05: {
			EventName:           "S5 / G2 (soft-off)",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x06: {
			EventName:           "S4 / S5 soft-off, particular S4 / S5 state cannot be determined",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x07: {
			EventName:           "G3 / Mechanical Off",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x08: {
			EventName:           "Sleeping in an S1, S2, or S3 states",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x09: {
			EventName:           "G1 sleeping",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x0a: {
			EventName:           "S5 entered by override",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x0b: {
			EventName:           "Legacy ON state",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x0c: {
			EventName:           "Legacy OFF state",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x0e: {
			EventName:           "Unknown",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeWatchdog2: {
		0x00: {
			EventName:           "Timer expired, status only (no action, no interrupt)",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x01: {
			EventName:           "Hard Reset",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "Power Down",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Power Cycle",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x08: {
			EventName:           "Timer interrupt",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
	},
	SensorTypePlatformAlert: {
		0x00: {
			EventName:           "platform generated page",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "platform generated LAN alert",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "Platform Event Trap generated",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x03: {
			EventName:           "platform generated SNMP trap",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
	},
	SensorTypeEntityPresence: {
		0x00: {
			EventName:           "Entity Present",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Entity Absent",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "Entity Disable",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeMonitorASIC: {},
	SensorTypeLAN: {
		0x00: {
			EventName:           "LAN Heartbeat Lost",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x01: {
			EventName:           "LAN Heartbeat",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
	},
	SensorTypeManagementSubsystemHealth: {
		0x00: {
			EventName:           "sensor access degraded or unavailable",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "controller access degraded or unavailable",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "management controller off-line",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "management controller unavailable",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "Sensor failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "FRU failure",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeBattery: {
		0x00: {
			EventName:           "FRU failure",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x01: {
			EventName:           "battery failed",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "battery presence detected",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
	},
	SensorTypeSessionAudit: {
		0x00: {
			EventName:           "Session Activated",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x01: {
			EventName:           "Session Deactivated",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x02: {
			EventName:           "Invalid Username or Password",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x03: {
			EventName:           "Invalid password disable",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
	SensorTypeVersionChange: {
		0x00: {
			EventName:           "Hardware change detected with associated Entity",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x01: {
			EventName:           "Firmware or software change detected with associated Entity",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x02: {
			EventName:           "Hardware incompatibility detected with associated Entity",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x03: {
			EventName:           "Firmware or software incompatibility detected with associated Entity",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x04: {
			EventName:           "Entity is of an invalid or unsupported hardware version",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x05: {
			EventName:           "Entity contains an invalid or unsupported firmware or software version",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x06: {
			EventName:           "Hardware Change detected with associated Entity was successfu",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x07: {
			EventName:           "Software or F/W Change detected with associated Entity was successful",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
	},
	SensorTypeFRUState: {
		0x00: {
			EventName:           "FRU Not Installed",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x01: {
			EventName:           "FRU Inactive (in standby or 'hot spare' state)",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
		0x02: {
			EventName:           "FRU Activation Requested",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x03: {
			EventName:           "FRU Activation In Progress",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x04: {
			EventName:           "FRU Active",
			AssertionSeverity:   EventSeverityInfo,
			DeassertionSeverity: EventSeverityInfo,
		},
		0x05: {
			EventName:           "FRU Deactivation Requested",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x06: {
			EventName:           "FRU Deactivation In Progress",
			AssertionSeverity:   EventSeverityWarning,
			DeassertionSeverity: EventSeverityWarning,
		},
		0x07: {
			EventName:           "FRU Communication Lost",
			AssertionSeverity:   EventSeverityCritical,
			DeassertionSeverity: EventSeverityCritical,
		},
	},
}

42.2 Sensor Type Codes and Data Sensor Specific Events SensorType, Offset

View Source
var SupportedPowerRestorePolicies = []string{
	"always-off", "always-on", "previous",
}

Functions

func AllCC

func AllCC(response Response) map[uint8]string

AllCC returns all possible completion codes for the specified response.

func AnalogValue

func AnalogValue(raw uint8, format SensorAnalogUnitFormat) int32

The raw analog data is unpacked as an unsigned interger. But whether it is a positive number (>0) or negative number (<0) is determined by the "analog data format" field (SensorUnit.AnalogDataFormat)

func ConvertReading

func ConvertReading(raw uint8, analogDataFormat SensorAnalogUnitFormat, factors ReadingFactors, linearizationFunc LinearizationFunc) float64

ConvertReading converts raw sensor reading or raw sensor threshold value to real value in the desired units for the sensor.

see: 36.3 Sensor Reading Conversion Formula

INPUT: raw (unsigned)
  -- APPLY: analogDataFormat
    --> GOT: analog (signed)
      -- APPLY: factors/linearization
        --> GOT: converted (float64)

func ConvertSensorHysteresis

func ConvertSensorHysteresis(raw uint8, analogDataFormat SensorAnalogUnitFormat, factors ReadingFactors, linearizationFunc LinearizationFunc) float64

ConvertSensorHysteresis converts raw sensor hysterresis value to real value in the desired units for the sensor.

see: 36.3 Sensor Reading Conversion Formula

func ConvertSensorTolerance

func ConvertSensorTolerance(raw uint8, analogDataFormat SensorAnalogUnitFormat, factors ReadingFactors, linearizationFunc LinearizationFunc) float64

ConvertSensorTolerance converts raw sensor tolerance value to real value in the desired units for the sensor.

see: 36.4.1 Tolerance

func FormatSDRs

func FormatSDRs(records []*SDR) string

FormatSDRs returns a table formatted string for print.

func FormatSDRs_FRU

func FormatSDRs_FRU(records []*SDR) string

Format SDRs of FRU record type

func FormatSELs

func FormatSELs(records []*SEL, sdrMap SDRMapBySensorNumber) string

FormatSELs print sel records in table format. The second sdrMap is optional. If the sdrMap is not nil, it will also print sensor number, entity id and instance, and asserted discrete states. sdrMap can be get by client GetSDRsMap method.

func FormatSensors

func FormatSensors(extended bool, sensors ...*Sensor) string

func FormatUsers

func FormatUsers(users []*User) string

func ParseSOLParamData

func ParseSOLParamData(paramSelector SOLConfigParamSelector, paramData []byte, solConfigParam *SOLConfigParam) error

func SensorFilterOptionIsReadingValid

func SensorFilterOptionIsReadingValid(sensor *Sensor) bool

func SensorFilterOptionIsThreshold

func SensorFilterOptionIsThreshold(sensor *Sensor) bool

func StrCC

func StrCC(response Response, ccode uint8) string

StrCC return the description of ccode for the specified response. The available completion codes set consists of general completion codes (CC) for all commands response and specific completion codes for this response.

Types

type ARPControl

type ARPControl struct {
	ARPResponseEnabled   bool
	GratuitousARPEnabled bool
}

type ASF

type ASF struct {
	IANA        uint32 // 4542
	MessageType uint8

	// 0-FEh, generated by remote console. This is an RMCP version of a sequence number.
	// Values 0-254 (0-FEh) are used for RMCP request/response messages.
	// 255 indicates the message is unidirectional and not part of a request/response pair.
	MessageTag uint8

	DataLength uint8 // 00h

	Data []byte
}

func (*ASF) Pack

func (asf *ASF) Pack() []byte

func (*ASF) Unpack

func (asf *ASF) Unpack(msg []byte) error

type ActivateSessionRequest

type ActivateSessionRequest struct {
	// Authentication Type for Session.
	// The selected type will be used for Session activation and for all subsequent authenticated packets under the Session, unless "Per-message Authentication" or "User Level Authentication" are disabled.
	// (See 6.12.4, Per-Message and User Level Authentication Disables, for more information.)
	//
	// This value must match with the Authentication Type used in the Get Session Challenge request for the Session. In addition, for multi-Session channels this value must also match the authentication type used in the Session Header.
	AuthTypeForSession AuthType

	// Maximum privilege level requested. Indicates the highest privilege level that
	// may be requested for this Session. This privilege level must be less than
	// or equal to the privilege limit for the channel and the privilege limit for the
	// user in order for the Activate Session command to be successful
	// (completion code = 00h). Once the Activate Session command has been
	// successful, the requested privilege level becomes a 'Session limit' that
	// cannot be raised beyond the requested level, even if the user and/or
	// channel privilege level limits would allow it. I.e. it takes precedence over
	// the channel and user privilege level limits.
	//
	// [7:4] - reserved
	// [3:0] - Requested Maximum Privilege Level
	// 0h = reserved
	// 1h = Callback level
	// 2h = User level
	// 3h = Operator level
	// 4h = Administrator level
	// 5h = OEM Proprietary level
	// all other = reserved
	MaxPrivilegeLevel PrivilegeLevel

	// For multi-Session channels: (e.g. LAN channel):
	// Challenge String data from corresponding Get Session Challenge response.
	//
	// For single-Session channels that lack Session header (e.g. serial/modem in Basic Mode):
	// Clear text password or AuthCode. See 22.17.1, AuthCode Algorithms.
	Challenge [16]byte // uint16

	// Initial Outbound Sequence Number = Starting sequence number that remote console wants used for messages from the BMC. (LS byte first). Must be non-null in order to establish a Session. 0000_0000h = reserved. Can be any random value.
	//
	// The BMC must increment the outbound Session sequence number by one (1) for
	// each subsequent outbound message from the BMC (include ActivateSessionResponse)
	//
	// The BMC sets the incremented number to Sequence field of SessionHeader.
	InitialOutboundSequenceNumber uint32
}

22.17

func (*ActivateSessionRequest) Command

func (req *ActivateSessionRequest) Command() Command

func (*ActivateSessionRequest) Pack

func (req *ActivateSessionRequest) Pack() []byte

type ActivateSessionResponse

type ActivateSessionResponse struct {
	// Authentication Type for remainder of Session
	AuthType AuthType

	// use this for remainder of Session.
	// While atypical, the BMC is allowed to change the Session ID from the one that passed in the request.
	SessionID uint32

	// Initial inbound seq# = Sequence number that BMC wants remote console to use for subsequent messages in the Session. The BMC returns a non-null value for multi-Session connections and returns null (all 0s) for single-Session connections.
	//
	// The remote console must increment the inbound Session sequence number by one (1) for each subsequent message it sends to the BMC.
	InitialInboundSequenceNumber uint32

	// Maximum privilege level allowed for this Session
	//  [7:4] - reserved
	//  [3:0] - Maximum Privilege Level allowed
	//  0h = reserved
	//  1h = Callback level
	//  2h = User level
	//  3h = Operator level
	//  4h = Administrator level
	//  5h = OEM Proprietary level
	//  all other = reserved
	MaxPrivilegeLevel uint8
}

func (*ActivateSessionResponse) CompletionCodes

func (*ActivateSessionResponse) CompletionCodes() map[uint8]string

func (*ActivateSessionResponse) Format

func (res *ActivateSessionResponse) Format() string

func (*ActivateSessionResponse) Unpack

func (res *ActivateSessionResponse) Unpack(data []byte) error

type AddSELEntryRequest

type AddSELEntryRequest struct {
	SEL *SEL
}

31.6 Add SEL Entry Command

func (*AddSELEntryRequest) Command

func (req *AddSELEntryRequest) Command() Command

func (*AddSELEntryRequest) Pack

func (req *AddSELEntryRequest) Pack() []byte

type AddSELEntryResponse

type AddSELEntryResponse struct {
	RecordID uint16 // Record ID for added record, LS Byte first
}

func (*AddSELEntryResponse) CompletionCodes

func (res *AddSELEntryResponse) CompletionCodes() map[uint8]string

func (*AddSELEntryResponse) Format

func (res *AddSELEntryResponse) Format() string

func (*AddSELEntryResponse) Unpack

func (res *AddSELEntryResponse) Unpack(msg []byte) error

type AdditionalDeviceSupport

type AdditionalDeviceSupport struct {
	SupportChassis            bool
	SupportBridge             bool
	SupportIPMBEventGenerator bool
	SupportIPMBEventReceiver  bool
	SupportFRUInventory       bool
	SupportSEL                bool
	SupportSDRRepo            bool
	SupportSensor             bool
}

Additional Device Support (formerly called IPM Device Support). Lists the IPMI 'logical device' commands and functions that the controller supports that are in addition to the mandatory IPM and Application commands. [7] Chassis Device (device functions as chassis device per ICMB spec.) [6] Bridge (device responds to Bridge NetFn commands) [5] IPMB Event Generator (device generates event messages [platform event request messages] onto the IPMB) [4] IPMB Event Receiver (device accepts event messages [platform event request messages] from the IPMB) [3] FRU Inventory Device [2] SEL Device [1] SDR Repository Device [0] Sensor Device

type AlertDestinationAddress

type AlertDestinationAddress struct {
	SetSelector uint8

	// 0h = IPv4 IP Address followed by DIX Ethernet/802.3 MAC Address
	// 1h = IPv6 IP Address
	AddressFormat uint8

	IP4UseBackupGateway bool
	IP4IP               net.IP
	IP4MAC              net.HardwareAddr

	IP6IP net.IP
}

type AlertDestinationType

type AlertDestinationType struct {
	SetSelector uint8 // Destination selector.

	// 0b = Unacknowledged. Alert is assumed successful if transmission occurs
	// without error. This value is also used with Callback numbers.
	// 1b = Acknowledged. Alert is assumed successful only if acknowledged is
	// returned. Note, some alert types, such as Dial Page, do not support an
	// acknowledge
	AlertSupportAcknowledge bool

	// 000b = PET Trap destination
	// 001b - 101b = reserved
	// 110b = OEM 1
	// 111b = OEM 2
	DestinationType uint8

	// Alert Acknowledge Timeout / Retry Interval, in seconds, 0-based (i.e. minimum
	// timeout = 1 second)
	AlertAcknowledgeTimeout uint8

	// Number of times to retry alert to given destination.
	Retries uint8
}

type AlertDestinationVLAN

type AlertDestinationVLAN struct {
	SetSelector uint8

	// 0h = VLAN ID not used with this destination
	// 1h = 802.1q VLAN TAG
	AddressFormat uint8

	VLANID uint16
	// CFI (Canonical Format Indicator. Set to 0b)
	CFI      bool
	Priority uint8
}

type AuthAlg

type AuthAlg uint8

13.28

const (
	AuthAlgRAKP_None        AuthAlg = 0x00 // Mandatory
	AuthAlgRAKP_HMAC_SHA1   AuthAlg = 0x01 // Mandatory
	AuthAlgRAKP_HMAC_MD5    AuthAlg = 0x02 // Optional
	AuthAlgRAKP_HMAC_SHA256 AuthAlg = 0x03 // Optional
)

func (AuthAlg) String

func (authAlg AuthAlg) String() string

type AuthCodeMultiSessionInput

type AuthCodeMultiSessionInput struct {
	Password   string
	SessionID  uint32
	SessionSeq uint32
	IPMIData   []byte
}

22.17.1 AuthCode Algorithms Multi-Session AuthCode carried in Session header for all authenticated packets

func (*AuthCodeMultiSessionInput) AuthCode

func (i *AuthCodeMultiSessionInput) AuthCode(authType AuthType) []byte

type AuthCodeSingleSessionInput

type AuthCodeSingleSessionInput struct {
	Password  string
	SessionID uint32
	Challenge []byte
}

22.17.1 AuthCode Algorithms Single Session AuthCode carried in IPMI message data for Activate Session Command to fill ActiveSessionRequest.Challenge

func (AuthCodeSingleSessionInput) AuthCode

func (a AuthCodeSingleSessionInput) AuthCode(authType AuthType) []byte

type AuthType

type AuthType uint8
const (
	AuthTypeNone     AuthType = 0x00
	AuthTypeMD2      AuthType = 0x01
	AuthTypeMD5      AuthType = 0x02
	AuthTypePassword AuthType = 0x04
	AuthTypeOEM      AuthType = 0x05
	AuthTypeRMCPPlus AuthType = 0x06
)

type AuthTypeEnabled

type AuthTypeEnabled struct {
	OEM      bool
	Password bool
	MD5      bool
	MD2      bool
	None     bool
}

type AuthTypeEnables

type AuthTypeEnables struct {
	Callback AuthTypeEnabled
	User     AuthTypeEnabled
	Operator AuthTypeEnabled
	Admin    AuthTypeEnabled
	OEM      AuthTypeEnabled
}

type AuthTypeSupport

type AuthTypeSupport struct {
	OEM      bool
	Password bool
	MD5      bool
	MD2      bool
	None     bool
}

type AuthenticationPayload

type AuthenticationPayload struct {
	// 00h = authentication algorithm
	PayloadType   uint8
	PayloadLength uint8 // Payload Length in bytes (1-based). The total length in bytes of the payload including the header (= 08h for this specification).
	AuthAlg       uint8
}

func (*AuthenticationPayload) Pack

func (p *AuthenticationPayload) Pack() []byte

func (*AuthenticationPayload) Unpack

func (p *AuthenticationPayload) Unpack(msg []byte) error

type BIOSBootType

type BIOSBootType bool
const (
	BIOSBootTypeLegacy BIOSBootType = false // PC compatible boot (legacy)
	BIOSBootTypeEFI    BIOSBootType = true  // Extensible Firmware Interface Boot (EFI)
)

func (BIOSBootType) String

func (t BIOSBootType) String() string

type BIOSMuxControl

type BIOSMuxControl uint8

func (BIOSMuxControl) String

func (b BIOSMuxControl) String() string

type BIOSVerbosity

type BIOSVerbosity uint8 // only 2 bits, occupied 0-3
const (
	BIOSVerbosityDefault BIOSVerbosity = 0
	BIOSVerbosityQuiet   BIOSVerbosity = 1
	BIOSVerbosityVerbose BIOSVerbosity = 2
)

func (BIOSVerbosity) String

func (v BIOSVerbosity) String() string

type BOP_BMCBootFlagValidBitClear

type BOP_BMCBootFlagValidBitClear struct {
	DontClearOnResetPEFOrPowerCyclePEF      bool // corresponding to restart cause: 0x08, 0x09
	DontClearOnCommandReceivedTimeout       bool // corresponding to restart cause: 0x01
	DontClearOnWatchdogTimeout              bool // corresponding to restart cause: 0x04
	DontClearOnResetPushButtonOrSoftReset   bool // corresponding to restart cause: 0x02, 0x0a
	DontClearOnPowerUpPushButtonOrWakeEvent bool // corresponding to restart cause: 0x03, 0x0b
}

func (*BOP_BMCBootFlagValidBitClear) Format

func (*BOP_BMCBootFlagValidBitClear) Pack

func (p *BOP_BMCBootFlagValidBitClear) Pack() []byte

func (*BOP_BMCBootFlagValidBitClear) Unpack

func (p *BOP_BMCBootFlagValidBitClear) Unpack(parameterData []byte) error

type BOP_BootFlags

type BOP_BootFlags struct {
	// 1b = boot flags valid.
	// The bit should be set to indicate that valid flag data is present.
	// This bit may be automatically cleared based on the boot flag valid bit clearing parameter, above.
	BootFlagsValid bool
	// 0b = options apply to next boot only.
	// 1b = options requested to be persistent for all future boots (i.e. requests BIOS to change its boot settings)
	Persist bool
	// 0b = "PC compatible" boot (legacy)
	// 1b = Extensible Firmware Interface Boot (EFI)
	BIOSBootType BIOSBootType

	CMOSClear          bool
	LockKeyboard       bool
	BootDeviceSelector BootDeviceSelector // 4 bits
	ScreenBlank        bool
	LockoutResetButton bool

	LockoutPowerOff           bool
	BIOSVerbosity             BIOSVerbosity
	ForceProgressEventTraps   bool
	BypassUserPassword        bool
	LockoutSleepButton        bool
	ConsoleRedirectionControl ConsoleRedirectionControl // only 2 bits

	BIOSSharedModeOverride bool
	BIOSMuxControl         BIOSMuxControl // only 3 bits

	DeviceInstanceSelector uint8 // only 5 bits
}

func (*BOP_BootFlags) Format

func (p *BOP_BootFlags) Format() string

func (*BOP_BootFlags) OptionsHelp

func (bootFlags *BOP_BootFlags) OptionsHelp() string

func (*BOP_BootFlags) Pack

func (p *BOP_BootFlags) Pack() []byte

func (*BOP_BootFlags) ParseFromOptions

func (bootFlags *BOP_BootFlags) ParseFromOptions(options []string) error

func (*BOP_BootFlags) ParseFromOptionsStr

func (bootFlags *BOP_BootFlags) ParseFromOptionsStr(optionsStr string) error

func (*BOP_BootFlags) Unpack

func (p *BOP_BootFlags) Unpack(parameterData []byte) error

type BOP_BootInfoAcknowledge

type BOP_BootInfoAcknowledge struct {
	// The boot initiator should typically write FFh to this parameter prior to initiating the boot.
	// The boot initiator may write 0 s if it wants to intentionally direct a given party to ignore the
	// boot info.
	// This field is automatically initialized to 00h when the management controller if first powered up or reset.
	ByOEM                bool
	BySMS                bool
	ByOSServicePartition bool
	ByOSLoader           bool
	ByBIOSPOST           bool
}

func (*BOP_BootInfoAcknowledge) Format

func (p *BOP_BootInfoAcknowledge) Format() string

func (*BOP_BootInfoAcknowledge) Pack

func (p *BOP_BootInfoAcknowledge) Pack() []byte

func (*BOP_BootInfoAcknowledge) Unpack

func (p *BOP_BootInfoAcknowledge) Unpack(parameterData []byte) error

type BOP_BootInitiatorInfo

type BOP_BootInitiatorInfo struct {
	ChannelNumber     uint8
	SessionID         uint32
	BootInfoTimestamp time.Time
}

func (*BOP_BootInitiatorInfo) Format

func (p *BOP_BootInitiatorInfo) Format() string

func (*BOP_BootInitiatorInfo) Pack

func (p *BOP_BootInitiatorInfo) Pack() []byte

func (*BOP_BootInitiatorInfo) Unpack

func (p *BOP_BootInitiatorInfo) Unpack(parameterData []byte) error

type BOP_BootInitiatorMailbox

type BOP_BootInitiatorMailbox struct {
	SetSelector uint8
	BlockData   []byte
}

func (*BOP_BootInitiatorMailbox) Format

func (p *BOP_BootInitiatorMailbox) Format() string

func (*BOP_BootInitiatorMailbox) Pack

func (p *BOP_BootInitiatorMailbox) Pack() []byte

func (*BOP_BootInitiatorMailbox) Unpack

func (p *BOP_BootInitiatorMailbox) Unpack(parameterData []byte) error

type BOP_ServicePartitionScan

type BOP_ServicePartitionScan uint8

func (BOP_ServicePartitionScan) Format

func (p BOP_ServicePartitionScan) Format() string

func (*BOP_ServicePartitionScan) Pack

func (p *BOP_ServicePartitionScan) Pack() []byte

func (*BOP_ServicePartitionScan) Unpack

func (p *BOP_ServicePartitionScan) Unpack(paramData []byte) error

type BOP_ServicePartitionSelector

type BOP_ServicePartitionSelector uint8

This value is used to select which service partition BIOS should boot using.

func (BOP_ServicePartitionSelector) Format

func (*BOP_ServicePartitionSelector) Pack

func (p *BOP_ServicePartitionSelector) Pack() []byte

func (*BOP_ServicePartitionSelector) Unpack

func (p *BOP_ServicePartitionSelector) Unpack(paramData []byte) error

type BOP_SetInProgressState

type BOP_SetInProgressState uint8
const (
	SetInProgressState_SetComplete   BOP_SetInProgressState = 0
	SetInProgressState_SetInProgress BOP_SetInProgressState = 1
	SetInProgressState_CommitWrite   BOP_SetInProgressState = 2
	SetInProgressState_Reserved      BOP_SetInProgressState = 3
)

func (BOP_SetInProgressState) Format

func (p BOP_SetInProgressState) Format() string

func (*BOP_SetInProgressState) Pack

func (p *BOP_SetInProgressState) Pack() []byte

func (*BOP_SetInProgressState) Unpack

func (p *BOP_SetInProgressState) Unpack(paramData []byte) error

type BadPasswordThreshold

type BadPasswordThreshold struct {
	// generate a Session Audit sensor "Invalid password disable" event message.
	GenerateSessionAuditEvent bool

	// Bad Password Threshold number
	Threshold uint8

	// Attempt Count Reset Interval.
	// The raw data is 2 byte, and the unit is in tens of seconds, the program should convert to senconds.
	AttemptCountResetIntevalSec uint32

	// User Lockout Interval
	// The raw data is 2 byte, and the unit is in tens of seconds, the program should convert to senconds.
	UserLockoutIntervalSec uint32
}

type BoardType

type BoardType uint8

func (BoardType) String

func (boardType BoardType) String() string

type BootDeviceSelector

type BootDeviceSelector uint8 // only 4 bits occupied
const (
	BootDeviceSelectorNoOverride               BootDeviceSelector = 0x00
	BootDeviceSelectorForcePXE                 BootDeviceSelector = 0x01
	BootDeviceSelectorForceHardDrive           BootDeviceSelector = 0x02
	BootDeviceSelectorForceHardDriveSafe       BootDeviceSelector = 0x03
	BootDeviceSelectorForceDiagnosticPartition BootDeviceSelector = 0x04
	BootDeviceSelectorForceCDROM               BootDeviceSelector = 0x05
	BootDeviceSelectorForceBIOSSetup           BootDeviceSelector = 0x06
	BootDeviceSelectorForceRemoteFloppy        BootDeviceSelector = 0x07
	BootDeviceSelectorForceRemoteCDROM         BootDeviceSelector = 0x08
	BootDeviceSelectorForceRemoteMedia         BootDeviceSelector = 0x09
	BootDeviceSelectorForceRemoteHardDrive     BootDeviceSelector = 0x0b
	BootDeviceSelectorForceFloppy              BootDeviceSelector = 0x0f
)

func (BootDeviceSelector) String

func (s BootDeviceSelector) String() string

type BootInfoAcknowledgeBy

type BootInfoAcknowledgeBy uint8
const (
	BootInfoAcknowledgeByBIOSPOST           BootInfoAcknowledgeBy = 1 << 0
	BootInfoAcknowledgeByOSLoader           BootInfoAcknowledgeBy = 1 << 1
	BootInfoAcknowledgeByOSServicePartition BootInfoAcknowledgeBy = 1 << 2
	BootInfoAcknowledgeBySMS                BootInfoAcknowledgeBy = 1 << 3
	BootInfoAcknowledgeByOEM                BootInfoAcknowledgeBy = 1 << 4
)

type BootOptionParameter

type BootOptionParameter struct {
	SetInProgressState       *BOP_SetInProgressState
	ServicePartitionSelector *BOP_ServicePartitionSelector
	ServicePartitionScan     *BOP_ServicePartitionScan
	BMCBootFlagValidBitClear *BOP_BMCBootFlagValidBitClear
	BootInfoAcknowledge      *BOP_BootInfoAcknowledge
	BootFlags                *BOP_BootFlags
	BootInitiatorInfo        *BOP_BootInitiatorInfo
	BootInitiatorMailbox     *BOP_BootInitiatorMailbox
}

Table 28-14, Boot Option Parameters You should fill ONLY one field at one time.

func ParseBootOptionParameterData

func ParseBootOptionParameterData(paramSelector BootOptionParameterSelector, paramData []byte) (*BootOptionParameter, error)

func (*BootOptionParameter) Format

func (bop *BootOptionParameter) Format(paramSelecotr BootOptionParameterSelector) string

func (*BootOptionParameter) Pack

func (bop *BootOptionParameter) Pack(paramSelecotr BootOptionParameterSelector) []byte

type BootOptionParameterSelector

type BootOptionParameterSelector uint8 //  only 7 bits occupied, 0-127
const (
	BOPS_SetInProgressState       BootOptionParameterSelector = 0x00
	BOPS_ServicePartitionSelector BootOptionParameterSelector = 0x01
	BOPS_ServicePartitionScan     BootOptionParameterSelector = 0x02
	BOPS_BMCBootFlagValidBitClear BootOptionParameterSelector = 0x03
	BOPS_BootInfoAcknowledge      BootOptionParameterSelector = 0x04
	BOPS_BootFlags                BootOptionParameterSelector = 0x05
	BOPS_BootInitiatorInfo        BootOptionParameterSelector = 0x06
	BOPS_BootInitiatorMailbox     BootOptionParameterSelector = 0x07
)

type Channel

type Channel uint8

6.3 Channel Numbers Only the channel number assignments for the primary IPMB and the System Interface are fixed, the assignment of other channel numbers can vary on a per-platform basis

const (
	ChannelPrimaryIPMB Channel = 0x0
	ChannelSystem      Channel = 0xf
)

type ChannelAccessMode

type ChannelAccessMode uint8

6.6 Channel Access Modes

const (
	ChannelAccessMode_Disabled        ChannelAccessMode = 0
	ChannelAccessMode_PrebootOnly     ChannelAccessMode = 1
	ChannelAccessMode_AlwaysAvailable ChannelAccessMode = 2
	ChannelAccessMode_Shared          ChannelAccessMode = 3
)

func (ChannelAccessMode) String

func (mode ChannelAccessMode) String() string

type ChannelAccessOption

type ChannelAccessOption uint8
const (
	ChannelAccessOption_NoChange    ChannelAccessOption = 0
	ChannelAccessOption_NonVolatile ChannelAccessOption = 1
	ChannelAccessOption_Volatile    ChannelAccessOption = 2
)

type ChannelInfo

type ChannelInfo struct {
	TransmitSupported bool // false means  receive message queue access only
	MessageReceiveLUN uint8
	ChannelProtocol   uint8
}

type ChannelMedium

type ChannelMedium uint8

6.5 Channel Medium Type

const (
	ChannelMediumIPMB            ChannelMedium = 0x01
	ChannelMediumICMBv10         ChannelMedium = 0x02
	ChannelMediumICMBv09         ChannelMedium = 0x03
	ChannelMediumLAN             ChannelMedium = 0x04
	ChannelMediumSerial          ChannelMedium = 0x05
	ChannelMediumOtherLAN        ChannelMedium = 0x06
	ChannelMediumSMBus           ChannelMedium = 0x07
	ChannelMediumSMBusv10        ChannelMedium = 0x08
	ChannelMediumSMBusv20        ChannelMedium = 0x09
	ChannelMediumUSBv1           ChannelMedium = 0x0a
	ChannelMediumUSBv2           ChannelMedium = 0x0b
	ChannelMediumSystemInterface ChannelMedium = 0x0c
)

func (ChannelMedium) String

func (cp ChannelMedium) String() string

type ChannelPrivilegeOption

type ChannelPrivilegeOption uint8
const (
	ChanenlPrivilegeOption_NoChange    ChannelPrivilegeOption = 0
	ChannelPrivilegeOption_NonVolatile ChannelPrivilegeOption = 1
	ChannelPrivilegeOption_Volatile    ChannelPrivilegeOption = 2
)

type ChannelProtocol

type ChannelProtocol uint8

6.4 Channel Protocol Type

const (
	ChannelProtocolIPMB  ChannelProtocol = 0x01
	ChannelProtocolICMB  ChannelProtocol = 0x02 // 03 reserved
	ChannelProtocolSMBus ChannelProtocol = 0x04
	ChannelProtocolKCS   ChannelProtocol = 0x05
	ChannelProtocolSMIC  ChannelProtocol = 0x06
	ChannelProtocolBTv10 ChannelProtocol = 0x07
	ChannelProtocolBTv15 ChannelProtocol = 0x08
	ChannelProtocolTMode ChannelProtocol = 0x09
	ChannelProtocolOEM1  ChannelProtocol = 0x1c
	ChannelProtocolOEM2  ChannelProtocol = 0x1d
	ChannelProtocolOEM3  ChannelProtocol = 0x1e
	ChannelProtocolOEM4  ChannelProtocol = 0x1f
)

func (ChannelProtocol) String

func (cp ChannelProtocol) String() string

type ChassisControl

type ChassisControl uint8
const (
	ChassisControlPowerDown           ChassisControl = 0 // down, off
	ChassisControlPowerUp             ChassisControl = 1
	ChassisControlPowerCycle          ChassisControl = 2
	ChassisControlHardwareRest        ChassisControl = 3
	ChassisControlDiagnosticInterrupt ChassisControl = 4
	ChassisControlSoftShutdown        ChassisControl = 5
)

type ChassisControlRequest

type ChassisControlRequest struct {
	ChassisControl ChassisControl
}

28.3 Chassis Control Command

func (*ChassisControlRequest) Command

func (req *ChassisControlRequest) Command() Command

func (*ChassisControlRequest) Pack

func (req *ChassisControlRequest) Pack() []byte

type ChassisControlResponse

type ChassisControlResponse struct {
}

func (*ChassisControlResponse) CompletionCodes

func (res *ChassisControlResponse) CompletionCodes() map[uint8]string

func (*ChassisControlResponse) Format

func (res *ChassisControlResponse) Format() string

func (*ChassisControlResponse) Unpack

func (res *ChassisControlResponse) Unpack(msg []byte) error

type ChassisIdentifyRequest

type ChassisIdentifyRequest struct {
	IdentifyInterval uint8
	ForceIdentifyOn  bool
}

28.5 Chassis Identify Command 用来定位设备,机箱定位 (机箱定位灯默认亮 interval 秒)

func (*ChassisIdentifyRequest) Command

func (req *ChassisIdentifyRequest) Command() Command

func (*ChassisIdentifyRequest) Pack

func (req *ChassisIdentifyRequest) Pack() []byte

type ChassisIdentifyResponse

type ChassisIdentifyResponse struct {
}

func (*ChassisIdentifyResponse) CompletionCodes

func (res *ChassisIdentifyResponse) CompletionCodes() map[uint8]string

func (*ChassisIdentifyResponse) Format

func (res *ChassisIdentifyResponse) Format() string

func (*ChassisIdentifyResponse) Unpack

func (res *ChassisIdentifyResponse) Unpack(msg []byte) error

type ChassisIdentifyState

type ChassisIdentifyState uint8
const (
	ChassisIdentifyStateOff          ChassisIdentifyState = 0
	ChassisIdentifyStateTemporaryOn  ChassisIdentifyState = 1
	ChassisIdentifyStateIndefiniteOn ChassisIdentifyState = 2
)

func (ChassisIdentifyState) String

func (c ChassisIdentifyState) String() string

type ChassisResetRequest

type ChassisResetRequest struct {
}

28.4 Chassis Reset Command

func (*ChassisResetRequest) Command

func (req *ChassisResetRequest) Command() Command

func (*ChassisResetRequest) Pack

func (req *ChassisResetRequest) Pack() []byte

type ChassisResetResponse

type ChassisResetResponse struct {
}

func (*ChassisResetResponse) CompletionCodes

func (res *ChassisResetResponse) CompletionCodes() map[uint8]string

func (*ChassisResetResponse) Format

func (res *ChassisResetResponse) Format() string

func (*ChassisResetResponse) Unpack

func (res *ChassisResetResponse) Unpack(msg []byte) error

type ChassisSecurityStatus

type ChassisSecurityStatus uint8

func (ChassisSecurityStatus) String

func (chassisSecurityStatus ChassisSecurityStatus) String() string

type ChassisState

type ChassisState uint8

func (ChassisState) String

func (chassisState ChassisState) String() string

type ChassisType

type ChassisType uint8

func (ChassisType) String

func (chassisType ChassisType) String() string

type CipherSuiteID

type CipherSuiteID uint8

22.15.2 Cipher Suite IDs

type CipherSuiteRecord

type CipherSuiteRecord struct {
	// If StartOfRecord is C0h, indicating that the Start Of Record byte is followed by an Cipher Suite ID
	// If StartOfRecord is C1h, iddicating that the Start Of Record byte is followed  by a OEM Cipher Suite ID plus OEM IANA
	StartOfRecord uint8

	// a numeric way of identifying the Cipher Suite on the platform
	CipherSuitID uint8
	OEMIanaID    uint32 // Least significant byte first. 3-byte IANA for the OEM or body that defined the Cipher Suite.

	// an authentication algorithm number is required for all Cipher Suites.
	// It is possible that a given Cipher Suite may not specify use of an integrity or confidentiality algorithm.
	AuthAlg       uint8   // Tag bits: [7:6]=00b
	IntegrityAlgs []uint8 // Tag bits: [7:6]=01b
	CryptAlgs     []uint8 // Tag bits: [7:6]=10b
}

22.15.1 Cipher Suite Records The size of a CipherSuiteRecord is

type ClearMessageFlagsRequest

type ClearMessageFlagsRequest struct {
	ClearOEM2                            bool
	ClearOEM1                            bool
	ClearOEM0                            bool
	ClearWatchdogPreTimeoutInterruptFlag bool
	ClearEventMessageBuffer              bool
	ClearReceiveMessageQueue             bool
}

22.3 Clear Message Flags Command

func (*ClearMessageFlagsRequest) Command

func (req *ClearMessageFlagsRequest) Command() Command

func (*ClearMessageFlagsRequest) Pack

func (req *ClearMessageFlagsRequest) Pack() []byte

type ClearMessageFlagsResponse

type ClearMessageFlagsResponse struct {
}

func (*ClearMessageFlagsResponse) CompletionCodes

func (*ClearMessageFlagsResponse) CompletionCodes() map[uint8]string

func (*ClearMessageFlagsResponse) Format

func (res *ClearMessageFlagsResponse) Format() string

func (*ClearMessageFlagsResponse) Unpack

func (res *ClearMessageFlagsResponse) Unpack(msg []byte) error

type ClearSELRequest

type ClearSELRequest struct {
	ReservationID        uint16 // LS Byte first
	GetErasureStatusFlag bool
}

31.9 Clear SEL Command

func (*ClearSELRequest) Command

func (req *ClearSELRequest) Command() Command

func (*ClearSELRequest) Pack

func (req *ClearSELRequest) Pack() []byte

type ClearSELResponse

type ClearSELResponse struct {
	ErasureProgressStatus uint8
}

func (*ClearSELResponse) CompletionCodes

func (res *ClearSELResponse) CompletionCodes() map[uint8]string

func (*ClearSELResponse) Format

func (res *ClearSELResponse) Format() string

func (*ClearSELResponse) Unpack

func (res *ClearSELResponse) Unpack(msg []byte) error

type Client

type Client struct {
	Host      string
	Port      int
	Username  string // length must <= 16
	Password  string
	Interface Interface

	Session *session
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, port int, user string, pass string) (*Client, error)

func NewOpenClient

func NewOpenClient() (*Client, error)

func NewToolClient

func NewToolClient(path string) (*Client, error)

NewToolClient creates an IPMI client based ipmitool. You should pass the file path of ipmitool binary or path of a wrapper script that would be executed.

func (*Client) ActivateSession

func (c *Client) ActivateSession() (response *ActivateSessionResponse, err error)

ActivateSession is only used for IPMI v1.5

func (*Client) AddSELEntry

func (c *Client) AddSELEntry(sel *SEL) (response *AddSELEntryResponse, err error)

func (*Client) BuildIPMIRequest

func (c *Client) BuildIPMIRequest(reqCmd Request) (*IPMIRequest, error)

BuildIPMIRequest creates IPMIRequest for a Command Request. It also fills the Checksum1 and Checksum2 fields of IPMIRequest.

func (*Client) BuildRmcpRequest

func (c *Client) BuildRmcpRequest(reqCmd Request) (*Rmcp, error)

func (*Client) ChassisControl

func (c *Client) ChassisControl(control ChassisControl) (response *ChassisControlResponse, err error)

func (*Client) ChassisIdentify

func (c *Client) ChassisIdentify(interval uint8, force bool) (response *ChassisIdentifyResponse, err error)

This command causes the chassis to physically identify itself by a mechanism chosen by the system implementation; such as turning on blinking user-visible lights or emitting beeps via a speaker, LCD panel, etc.

func (*Client) ChassisReset

func (c *Client) ChassisReset() (response *ChassisResetResponse, err error)

This command was used with early versions of the ICMB. It has been superceded by the Chassis Control command For host systems, this corresponds to a system hard reset.

func (*Client) ClearMessageFlags

func (c *Client) ClearMessageFlags() (response *ClearMessageFlagsResponse, err error)

func (*Client) ClearSEL

func (c *Client) ClearSEL(reservationID uint16) (response *ClearSELResponse, err error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) CloseSession

func (c *Client) CloseSession(request *CloseSessionRequest) (response *CloseSessionResponse, err error)

func (*Client) ColdReset

func (c *Client) ColdReset() (err error)

func (*Client) Connect

func (c *Client) Connect() error

Connect connects to the bmc by specified Interface.

func (*Client) Connect15

func (c *Client) Connect15() error

Connect15 13.14 IPMI v1.5 LAN Session Activation 1. RmcpresencePing - PMCPPresencePong 2. Get Channel Authentication Capabilities 3. Get Session Challenge 4. Activate Session

func (*Client) Connect20

func (c *Client) Connect20() error

see 13.15 IPMI v2.0/RMCP+ Session Activation

func (*Client) ConnectAuto

func (c *Client) ConnectAuto() error

ConnectAuto detects the IPMI version supported by BMC by using GetChannelAuthenticaitonCapabilities commmand, then decide to use v1.5 or v2.0 for subsequent requests.

func (*Client) ConnectOpen

func (c *Client) ConnectOpen(devnum int32) error

ConnectOpen try to initialize the client by open the device of linux ipmi driver.

func (*Client) ConnectTool

func (c *Client) ConnectTool(devnum int32) error

ConnectTool try to initialize the client.

func (*Client) Debug

func (c *Client) Debug(header string, object interface{})

func (*Client) DebugBytes

func (c *Client) DebugBytes(header string, data []byte, width int)

DebugBytes print byte slices with a fixed width of bytes on each line.

func (*Client) Debugf

func (c *Client) Debugf(format string, object ...interface{})

func (*Client) DeleteSELEntry

func (c *Client) DeleteSELEntry(recordID uint16, reservationID uint16) (response *DeleteSELEntryResponse, err error)

func (*Client) DisableUser

func (c *Client) DisableUser(userID uint8) (err error)

func (*Client) EnableMessageChannelReceive

func (c *Client) EnableMessageChannelReceive() (response *EnableMessageChannelReceiveResponse, err error)

func (*Client) EnableUser

func (c *Client) EnableUser(userID uint8) (err error)

func (*Client) Exchange

func (c *Client) Exchange(request Request, response Response) error

func (*Client) GetACPIPowerState

func (c *Client) GetACPIPowerState() (response *GetACPIPowerStateResponse, err error)

This command is provided to allow system software to tell a controller the present ACPI power state of the system.

func (*Client) GetAllChannelCipherSuites

func (c *Client) GetAllChannelCipherSuites(channelNumber uint8) ([]CipherSuiteRecord, error)

GetAllChannelCipherSuites initiates 64 (MaxCipherSuiteListIndex) requests

func (*Client) GetBMCGlobalEnables

func (c *Client) GetBMCGlobalEnables() (response *GetBMCGlobalEnablesResponse, err error)

func (*Client) GetBTInterfaceCapabilities

func (c *Client) GetBTInterfaceCapabilities() (response *GetBTInterfaceCapabilitiesResponse, err error)

func (*Client) GetChannelAccess

func (c *Client) GetChannelAccess(channelNumber uint8, accessOption ChannelAccessOption) (response *GetChannelAccessResponse, err error)

func (*Client) GetChannelAuthenticationCapabilities

func (c *Client) GetChannelAuthenticationCapabilities(channelNumber uint8, privilegeLevel PrivilegeLevel) (response *GetChannelAuthenticationCapabilitiesResponse, err error)

GetChannelAuthenticationCapabilities is used to retrieve capability information about the channel that the message is delivered over, or for a particular channel. The command returns the authentication algorithm support for the given privilege level.

This command is sent in unauthenticated (clear) format.

When activating a Session, the privilege level passed in this command will normally be the same Requested Maximum Privilege level that will be used for a subsequent Activate Session command.

func (*Client) GetChannelCipherSuites

func (c *Client) GetChannelCipherSuites(channelNumber uint8, index uint8) (response *GetChannelCipherSuitesResponse, err error)

This command can be executed prior to establishing a Session with the BMC. The command is used to look up what authentication, integrity, and confidentiality algorithms are supported. The algorithms are used in combination as 'Cipher Suites'. This command only applies to implementations that support IPMI v2.0/RMCP+ sessions.

func (*Client) GetChannelInfo

func (c *Client) GetChannelInfo(channelNumber uint8) (response *GetChannelInfoResponse, err error)

func (*Client) GetChassisCapabilities

func (c *Client) GetChassisCapabilities() (response *GetChassisCapabilitiesResponse, err error)

func (*Client) GetChassisStatus

func (c *Client) GetChassisStatus() (response *GetChassisStatusResponse, err error)

func (*Client) GetCommandEnables

func (c *Client) GetCommandEnables(channelNumber uint8, commandRangeMask CommandRangeMask, netFn NetFn, lun uint8, code uint8, oemIANA uint32) (response *GetCommandEnablesResponse, err error)

func (*Client) GetCommandSubfunctionSupport

func (c *Client) GetCommandSubfunctionSupport(channelNumber uint8, netFn NetFn, lun uint8, code uint8, oemIANA uint32) (response *GetCommandSubfunctionSupportResponse, err error)

func (*Client) GetCommandSupport

func (c *Client) GetCommandSupport(channelNumber uint8, commandRangeMask CommandRangeMask, netFn NetFn, lun uint8, code uint8, oemIANA uint32) (response *GetCommandSupportResponse, err error)

func (*Client) GetConfigurableCommands

func (c *Client) GetConfigurableCommands(channelNumber uint8, commandRangeMask CommandRangeMask, netFn NetFn, lun uint8, code uint8, oemIANA uint32) (response *GetConfigurableCommandsResponse, err error)

func (*Client) GetCurrentSessionInfo

func (c *Client) GetCurrentSessionInfo() (response *GetSessionInfoResponse, err error)

func (*Client) GetDeviceGUID

func (c *Client) GetDeviceGUID() (response *GetDeviceGUIDResponse, err error)

func (*Client) GetDeviceID

func (c *Client) GetDeviceID() (response *GetDeviceIDResponse, err error)

func (*Client) GetDeviceSDR

func (c *Client) GetDeviceSDR(recordID uint16) (response *GetDeviceSDRResponse, err error)

This command returns general information about the collection of sensors in a Dynamic Sensor Device.

func (*Client) GetDeviceSDRBySensorID

func (c *Client) GetDeviceSDRBySensorID(sensorNumber uint8) (*SDR, error)

func (*Client) GetDeviceSDRInfo

func (c *Client) GetDeviceSDRInfo(getSDRCount bool) (response *GetDeviceSDRInfoResponse, err error)

This command returns general information about the collection of sensors in a Dynamic Sensor Device.

func (*Client) GetDeviceSDRs

func (c *Client) GetDeviceSDRs(recordTypes ...SDRRecordType) ([]*SDR, error)

func (*Client) GetEventReceiver

func (c *Client) GetEventReceiver() (response *GetEventReceiverResponse, err error)

func (*Client) GetFRU

func (c *Client) GetFRU(deviceID uint8, deviceName string) (*FRU, error)

GetFRU return FRU for the specified deviceID. The deviceName is not a must, pass empty string if not known.

func (*Client) GetFRUAreaBoard

func (c *Client) GetFRUAreaBoard(deviceID uint8, offset uint16) (*FRUBoardInfoArea, error)

func (*Client) GetFRUAreaChassis

func (c *Client) GetFRUAreaChassis(deviceID uint8, offset uint16) (*FRUChassisInfoArea, error)

func (*Client) GetFRUAreaMultiRecords

func (c *Client) GetFRUAreaMultiRecords(deviceID uint8, offset uint16) ([]*FRUMultiRecord, error)

func (*Client) GetFRUAreaProduct

func (c *Client) GetFRUAreaProduct(deviceID uint8, offset uint16) (*FRUProductInfoArea, error)

func (*Client) GetFRUData

func (c *Client) GetFRUData(deviceID uint8) ([]byte, error)

GetFRUData return all data bytes, the data size is firstly determined by GetFRUInventoryAreaInfoResponse.AreaSizeBytes

func (*Client) GetFRUInventoryAreaInfo

func (c *Client) GetFRUInventoryAreaInfo(fruDeviceID uint8) (response *GetFRUInventoryAreaInfoResponse, err error)

This command returns overall the size of the FRU Inventory Area in this device, in bytes.

func (*Client) GetFRUs

func (c *Client) GetFRUs() ([]*FRU, error)

func (*Client) GetIPStatistics

func (c *Client) GetIPStatistics(channelNubmer uint8, clearAllStatistics bool) (response *GetIPStatisticsResponse, err error)

func (*Client) GetLanConfig

func (c *Client) GetLanConfig(channelNumber uint8) (*LanConfig, error)

func (*Client) GetLanConfigParams

func (c *Client) GetLanConfigParams(channelNumber uint8, paramSelector LanParamSelector) (response *GetLanConfigParamsResponse, err error)

func (*Client) GetMessage

func (c *Client) GetMessage() (response *GetMessageResponse, err error)

func (*Client) GetMessageFlags

func (c *Client) GetMessageFlags() (response *GetMessageFlagsResponse, err error)

func (*Client) GetNetFnSupport

func (c *Client) GetNetFnSupport(channelNumber uint8) (response *GetNetFnSupportResponse, err error)

func (*Client) GetPEFCapabilities

func (c *Client) GetPEFCapabilities() (response *GetPEFCapabilitiesResponse, err error)

func (*Client) GetPOHCounter

func (c *Client) GetPOHCounter() (response *GetPOHCounterResponse, err error)

This command returns the present reading of the POH (Power-On Hours) counter, plus the number of counts per hour.

func (*Client) GetSDR

func (c *Client) GetSDR(recordID uint16) (response *GetSDRResponse, err error)

GetSDR returns raw SDR record.

func (*Client) GetSDRBySensorID

func (c *Client) GetSDRBySensorID(sensorNumber uint8) (*SDR, error)

func (*Client) GetSDRBySensorName

func (c *Client) GetSDRBySensorName(sensorName string) (*SDR, error)

func (*Client) GetSDRRepoAllocInfo

func (c *Client) GetSDRRepoAllocInfo() (response *GetSDRRepoAllocInfoResponse, err error)

func (*Client) GetSDRRepoInfo

func (c *Client) GetSDRRepoInfo() (response *GetSDRRepoInfoResponse, err error)

func (*Client) GetSDRs

func (c *Client) GetSDRs(recordTypes ...SDRRecordType) ([]*SDR, error)

GetSDRs fetches the SDR records with the specified RecordTypes. The parameter is a slice of SDRRecordType used as filter. Empty means to get all SDR records.

func (*Client) GetSDRsMap

func (c *Client) GetSDRsMap() (SDRMapBySensorNumber, error)

GetSDRsMap returns all Full/Compact SDRs grouped by GeneratorID and SensorNumber. The sensor name can only be got from SDR record. So use this method to construct a map from which you can get sensor name.

func (*Client) GetSELAllocInfo

func (c *Client) GetSELAllocInfo() (response *GetSELAllocInfoResponse, err error)

func (*Client) GetSELEntries

func (c *Client) GetSELEntries(startRecordID uint16) ([]*SEL, error)

GetSELEntries return all SEL records starting from the specified recordID. Pass 0 means retrieve all SEL entries starting from the first record.

func (*Client) GetSELEntry

func (c *Client) GetSELEntry(reservationID uint16, recordID uint16) (response *GetSELEntryResponse, err error)

The reservationID is only required for partial Get, use 0000h otherwise.

func (*Client) GetSELInfo

func (c *Client) GetSELInfo() (response *GetSELInfoResponse, err error)

func (*Client) GetSELTime

func (c *Client) GetSELTime() (response *GetSELTimeResponse, err error)

func (*Client) GetSELTimeUTCOffset

func (c *Client) GetSELTimeUTCOffset() (response *GetSELTimeUTCOffsetResponse, err error)

GetSELTimeUTCOffset is used to retrieve the SEL Time UTC Offset (timezone)

func (*Client) GetSOLConfigParams

func (c *Client) GetSOLConfigParams(channelNumber uint8, paramSelector SOLConfigParamSelector) (response *GetSOLConfigParamsResponse, err error)

func (*Client) GetSelfTestResults

func (c *Client) GetSelfTestResults() (response *GetSelfTestResultsResponse, err error)

func (*Client) GetSensorByID

func (c *Client) GetSensorByID(sensorNumber uint8) (*Sensor, error)

GetSensor returns the sensor with current reading and status by specified sensor number.

func (*Client) GetSensorByName

func (c *Client) GetSensorByName(sensorName string) (*Sensor, error)

GetSensor returns the sensor with current reading and status by specified sensor name.

func (*Client) GetSensorEventEnable

func (c *Client) GetSensorEventEnable(sensorNumber uint8) (response *GetSensorEventEnableResponse, err error)

func (*Client) GetSensorEventStatus

func (c *Client) GetSensorEventStatus(sensorNumber uint8) (response *GetSensorEventStatusResponse, err error)

func (*Client) GetSensorHysteresis

func (c *Client) GetSensorHysteresis(sensorNumber uint8) (response *GetSensorHysteresisResponse, err error)

This command retrieves the present hysteresis values for the specified sensor. If the sensor hysteresis values are "fixed", then the hysteresis values can be obtained from the SDR for the sensor.

func (*Client) GetSensorReading

func (c *Client) GetSensorReading(sensorNumber uint8) (response *GetSensorReadingResponse, err error)

func (*Client) GetSensorReadingFactors

func (c *Client) GetSensorReadingFactors(sensorNumber uint8, reading uint8) (response *GetSensorReadingFactorsResponse, err error)

This command returns the Sensor Reading Factors fields for the specified reading value on the specified sensor.

func (*Client) GetSensorThresholds

func (c *Client) GetSensorThresholds(sensorNumber uint8) (response *GetSensorThresholdsResponse, err error)

This command retrieves the threshold for the given sensor.

func (*Client) GetSensorType

func (c *Client) GetSensorType(sensorNumber uint8) (response *GetSensorTypeResponse, err error)

func (*Client) GetSensors

func (c *Client) GetSensors(filterOptions ...SensorFilterOption) ([]*Sensor, error)

GetSensors returns all sensors with their current readings and status. If there's no filter options, it returns all sensors. If there exists filter options, it only returns the sensors those passed ALL filter options (filter option function returns true)

func (*Client) GetSessionChallenge

func (c *Client) GetSessionChallenge() (response *GetSessionChallengeResponse, err error)

GetSessionChallenge The command selects which of the BMC-supported authentication types the Remote Console would like to use, and a username that selects which set of user information should be used for the Session

func (*Client) GetSessionInfo

func (c *Client) GetSessionInfo(request *GetSessionInfoRequest) (response *GetSessionInfoResponse, err error)

func (*Client) GetSupermicroBiosVersion

func (c *Client) GetSupermicroBiosVersion() (response *CommandGetSupermicroBiosVersionResponse, err error)

func (*Client) GetSystemBootOptions

func (c *Client) GetSystemBootOptions(parameterSelector BootOptionParameterSelector) (response *GetSystemBootOptionsResponse, err error)

This command is used to set parameters that direct the system boot following a system power up or reset. The boot flags only apply for one system restart. It is the responsibility of the system BIOS to read these settings from the BMC and then clear the boot flags

func (*Client) GetSystemGUID

func (c *Client) GetSystemGUID() (response *GetSystemGUIDResponse, err error)

func (*Client) GetSystemInterfaceCapabilities

func (c *Client) GetSystemInterfaceCapabilities(interfaceType SystemInterfaceType) (response *GetSystemInterfaceCapabilitiesResponse, err error)

func (*Client) GetSystemRestartCause

func (c *Client) GetSystemRestartCause() (response *GetSystemRestartCauseResponse, err error)

func (*Client) GetUserAccess

func (c *Client) GetUserAccess(channelNumber uint8, userID uint8) (response *GetUserAccessResponse, err error)

func (*Client) GetUsername

func (c *Client) GetUsername(userID uint8) (response *GetUsernameResponse, err error)

func (*Client) GetWatchdogTimer

func (c *Client) GetWatchdogTimer() (response *GetWatchdogTimerResponse, err error)

func (*Client) ListUser

func (c *Client) ListUser(channelNumber uint8) ([]*User, error)

func (*Client) ManufacturingTestOn

func (c *Client) ManufacturingTestOn() (response *ManufacturingTestOnResponse, err error)

If the device supports a "manufacturing test mode", this command is reserved to turn that mode on.

func (*Client) MasterWriteRead

func (c *Client) MasterWriteRead(request *MasterWriteReadRequest) (*MasterWriteReadResponse, error)

func (*Client) OpenSession

func (c *Client) OpenSession() (response *OpenSessionResponse, err error)

func (*Client) ParseRmcpResponse

func (c *Client) ParseRmcpResponse(msg []byte, response Response) error

ParseRmcpResponse parses msg bytes. The response param should be passed as a pointer of the struct which implements the Response interface.

func (*Client) PlatformEventMessage

func (c *Client) PlatformEventMessage(request *PlatformEventMessageRequest) (response *PlatformEventMessageResponse, err error)

func (*Client) RAKPMessage1

func (c *Client) RAKPMessage1() (response *RAKPMessage2, err error)

func (*Client) RAKPMessage3

func (c *Client) RAKPMessage3() (response *RAKPMessage4, err error)

authAlg is used to parse the returned RAKPMessage4 message

func (*Client) ReadEventMessageBuffer

func (c *Client) ReadEventMessageBuffer() (response *ReadEventMessageBufferResponse, err error)

func (*Client) ReadFRUData

func (c *Client) ReadFRUData(fruDeviceID uint8, readOffset uint16, readCount uint8) (response *ReadFRUDataResponse, err error)

The command returns the specified data from the FRU Inventory Info area.

func (*Client) ReserveDeviceSDRRepo

func (c *Client) ReserveDeviceSDRRepo() (response *ReserveDeviceSDRRepoResponse, err error)

This command is used to obtain a Reservation ID.

func (*Client) ReserveSEL

func (c *Client) ReserveSEL() (response *ReserveSELResponse, err error)

func (*Client) ResetWatchdogTimer

func (c *Client) ResetWatchdogTimer() (response *ResetWatchdogTimerResponse, err error)

func (*Client) RmcpPing

func (c *Client) RmcpPing() (response *RmcpPingResponse, err error)

func (*Client) SOLActivating

func (c *Client) SOLActivating() (response *SOLActivatingResponse, err error)

func (*Client) SOLInfo

func (c *Client) SOLInfo(channelNumber uint8) (*SOLConfigParam, error)

func (*Client) SendMessage

func (c *Client) SendMessage(channelNumber uint8, authenticated bool, encrypted bool, trackMask uint8, data []byte) (response *SendMessageResponse, err error)

func (*Client) SessionPrivilegeLevel

func (c *Client) SessionPrivilegeLevel() PrivilegeLevel

func (*Client) SetACPIPowerState

func (c *Client) SetACPIPowerState(request *SetACPIPowerStateRequest) (err error)

This command is provided to allow system software to tell a controller the present ACPI power state of the system.

func (*Client) SetBMCGlobalEnables

func (c *Client) SetBMCGlobalEnables(enableSystemEventLogging bool, enableEventMessageBuffer bool, enableEventMessageBufferFullInterrupt bool, enableReceiveMessageQueueInterrupt bool) (response *SetBMCGlobalEnablesResponse, err error)

func (*Client) SetBootDevice

func (c *Client) SetBootDevice(bootDeviceSelector BootDeviceSelector, bootType BIOSBootType, persist bool) error

SetBootDevice set the boot device for next boot. persist of false means it applies to next boot only. persist of true means this setting is persistent for all future boots.

func (*Client) SetBootParamBootFlags

func (c *Client) SetBootParamBootFlags(bootFlags *BOP_BootFlags) error

func (*Client) SetBootParamClearAck

func (c *Client) SetBootParamClearAck(by BootInfoAcknowledgeBy) error

func (*Client) SetBootParamSetInProgressState

func (c *Client) SetBootParamSetInProgressState(progressState BOP_SetInProgressState) error

func (*Client) SetChannelAccess

func (c *Client) SetChannelAccess(request *SetChannelAccessRequest) (response *SetChannelAccessResponse, err error)

func (*Client) SetChassisCapabilities

func (c *Client) SetChassisCapabilities(request *SetChassisCapabilitiesRequest) (response *SetChassisCapabilitiesResponse, err error)

func (*Client) SetEventReceiver

func (c *Client) SetEventReceiver(slaveAddress uint8, lun uint8) (response *SetEventReceiverResponse, err error)

func (*Client) SetFrontPanelEnables

func (c *Client) SetFrontPanelEnables(disableSleepButton bool, disableDiagnosticButton bool, disableResetButton bool, disablePoweroffButton bool) (response *SetFrontPanelEnablesResponse, err error)

The following command is used to enable or disable the buttons on the front panel of the chassis.

func (*Client) SetLanConfigParams

func (c *Client) SetLanConfigParams() (response *SetLanConfigParamsResponse, err error)

Todo

func (*Client) SetPowerCycleInterval

func (c *Client) SetPowerCycleInterval(intervalInSec uint8) (response *SetPowerCycleIntervalResponse, err error)

func (*Client) SetPowerRestorePolicy

func (c *Client) SetPowerRestorePolicy(policy PowerRestorePolicy) (response *SetPowerRestorePolicyResponse, err error)

func (*Client) SetSELTime

func (c *Client) SetSELTime(t time.Time) (response *SetSELTimeResponse, err error)

func (*Client) SetSELTimeUTCOffset

func (c *Client) SetSELTimeUTCOffset(minutesOffset int16) (response *SetSELTimeUTCOffsetResponse, err error)

SetSELTimeUTCOffset initializes and retrieve a UTC offset (timezone) that is associated with the SEL Time

func (*Client) SetSOLConfigurationParameters

func (c *Client) SetSOLConfigurationParameters(channelNumber uint8, paramSelector uint8, paramData []byte) (response *SetSOLConfigurationParametersResponse, err error)

func (*Client) SetSensorHysteresis

func (c *Client) SetSensorHysteresis(sensorNumber uint8, positiveHysteresis uint8, negativeHysteresis uint8) (response *SetSensorHysteresisResponse, err error)

This command provides a mechanism for setting the hysteresis values associated with the thresholds of a sensor that has threshold based event generation.

func (*Client) SetSensorReadingAndEventStatus

func (c *Client) SetSensorReadingAndEventStatus(request *SetSensorReadingAndEventStatusRequest) (response *SetSensorReadingAndEventStatusResponse, err error)

func (*Client) SetSensorThresholds

func (c *Client) SetSensorThresholds(request *SetSensorThresholdsRequest) (response *SetSensorThresholdsResponse, err error)

This command provides a mechanism for setting the hysteresis values associated with the thresholds of a sensor that has threshold based event generation.

func (*Client) SetSensorType

func (c *Client) SetSensorType(sensorNumber uint8, sensorType SensorType, eventReadingType EventReadingType) (response *SetSensorTypeResponse, err error)

func (*Client) SetSessionPrivilegeLevel

func (c *Client) SetSessionPrivilegeLevel(privilegeLevel PrivilegeLevel) (response *SetSessionPrivilegeLevelResponse, err error)

func (*Client) SetSystemBootOptions

func (c *Client) SetSystemBootOptions(request *SetSystemBootOptionsRequest) (response *SetSystemBootOptionsResponse, err error)

This command is used to set parameters that direct the system boot following a system power up or reset. The boot flags only apply for one system restart. It is the responsibility of the system BIOS to read these settings from the BMC and then clear the boot flags

func (*Client) SetUserAccess

func (c *Client) SetUserAccess(request *SetUserAccessRequest) (response *SetUserAccessResponse, err error)

func (*Client) SetUserPassword

func (c *Client) SetUserPassword(userID uint8, password string, stored20 bool) (response *SetUserPasswordResponse, err error)

func (*Client) SetUsername

func (c *Client) SetUsername(userID uint8, username string) (response *SetUsernameResponse, err error)

func (*Client) SetWatchdogTimer

func (c *Client) SetWatchdogTimer() (response *SetWatchdogTimerResponse, err error)

func (*Client) SuspendARPs

func (c *Client) SuspendARPs(channelNumber uint8, suspendARP bool, suspendGratuitousARP bool) (response *SuspendARPsResponse, err error)

func (*Client) TestUserPassword

func (c *Client) TestUserPassword(userID uint8, password string, stored20 bool) (response *SetUserPasswordResponse, err error)

func (*Client) ValidateRAKP2

func (c *Client) ValidateRAKP2(rakp2 *RAKPMessage2) (bool, error)

ValidateRAKP2 validates RAKPMessage2 returned by BMC.

func (*Client) ValidateRAKP4

func (c *Client) ValidateRAKP4(response *RAKPMessage4) (bool, error)

func (*Client) WarmReset

func (c *Client) WarmReset() (err error)

func (*Client) WithBufferSize

func (c *Client) WithBufferSize(bufferSize int) *Client

func (*Client) WithDebug

func (c *Client) WithDebug(debug bool) *Client

func (*Client) WithInterface

func (c *Client) WithInterface(intf Interface) *Client

func (*Client) WithTimeout

func (c *Client) WithTimeout(timeout time.Duration) *Client

func (*Client) WriteFRUData

func (c *Client) WriteFRUData(fruDeviceID uint8, writeOffset uint16, writeData []byte) (response *WriteFRUDataResponse, err error)

The command writes the specified byte or word to the FRU Inventory Info area. This is a low level direct interface to a non-volatile storage area. This means that the interface does not interpret or check any semantics or formatting for the data being written.

type CloseSessionRequest

type CloseSessionRequest struct {
	// For IPMI v2.0/RMCP+ this is the Managed System Session ID value that was generated by the BMC, not the ID from the remote console. If Session ID = 0000_0000h then an implementation can optionally enable this command to take an additional byte of parameter data that allows a Session handle to be used to close a Session.
	SessionID uint32

	// Session Handle. (only present if Session ID = 0000_0000h)
	SessionHandle uint8
}

22.19

func (*CloseSessionRequest) Command

func (req *CloseSessionRequest) Command() Command

func (*CloseSessionRequest) Pack

func (req *CloseSessionRequest) Pack() []byte

type CloseSessionResponse

type CloseSessionResponse struct {
}

func (*CloseSessionResponse) CompletionCodes

func (res *CloseSessionResponse) CompletionCodes() map[uint8]string

func (*CloseSessionResponse) Format

func (res *CloseSessionResponse) Format() string

func (*CloseSessionResponse) Unpack

func (res *CloseSessionResponse) Unpack(msg []byte) error

type ColdResetRequest

type ColdResetRequest struct {
}

20.2 Cold Reset Command

func (*ColdResetRequest) Command

func (req *ColdResetRequest) Command() Command

func (*ColdResetRequest) Pack

func (req *ColdResetRequest) Pack() []byte

type ColdResetResponse

type ColdResetResponse struct {
}

func (*ColdResetResponse) CompletionCodes

func (res *ColdResetResponse) CompletionCodes() map[uint8]string

func (*ColdResetResponse) Format

func (res *ColdResetResponse) Format() string

func (*ColdResetResponse) Unpack

func (res *ColdResetResponse) Unpack(msg []byte) error

type Command

type Command struct {
	ID    uint8
	NetFn NetFn
	Name  string
}

Command is the field in an IPMI message

type CommandGetSupermicroBiosVersionRequest

type CommandGetSupermicroBiosVersionRequest struct {
}

func (*CommandGetSupermicroBiosVersionRequest) Command

func (*CommandGetSupermicroBiosVersionRequest) Pack

type CommandGetSupermicroBiosVersionResponse

type CommandGetSupermicroBiosVersionResponse struct {
	Version string
}

func (*CommandGetSupermicroBiosVersionResponse) CompletionCodes

func (res *CommandGetSupermicroBiosVersionResponse) CompletionCodes() map[uint8]string

func (*CommandGetSupermicroBiosVersionResponse) Format

func (*CommandGetSupermicroBiosVersionResponse) Unpack

type CommandRangeMask

type CommandRangeMask uint8

type CommunityString

type CommunityString [18]byte

func NewCommunityString

func NewCommunityString(s string) CommunityString

func (CommunityString) String

func (c CommunityString) String() string

type CompletionCode

type CompletionCode uint8
const (
	// GENERIC COMPLETION CODES 00h, C0h-FFh
	CompletionCodeNormal                               CompletionCode = 0x00
	CompletionCodeNodeBusy                             CompletionCode = 0xC0
	CompletionCodeInvalidCommand                       CompletionCode = 0xC1
	CompletionCodeInvalidCommandForLUN                 CompletionCode = 0xC2
	CompletionCodeProcessTimeout                       CompletionCode = 0xC3
	CompletionCodeOutOfSpace                           CompletionCode = 0xC4
	CompletionCodeReservationCanceled                  CompletionCode = 0xC5
	CompletionCodeRequestDataTruncated                 CompletionCode = 0xC6
	CompletionCodeRequestDataLengthInvalid             CompletionCode = 0xC7
	CompletionCodeRequestDataLengthLimitExceeded       CompletionCode = 0xC8
	CompletionCodeParameterOutOfRange                  CompletionCode = 0xC9
	CompletionCodeCannotReturnRequestedDataBytes       CompletionCode = 0xCA
	CompletionCodeRequestedDataNotPresent              CompletionCode = 0xCB
	CompletionCodeRequestDataFieldInvalid              CompletionCode = 0xCC
	CompletionCodeIllegalCommand                       CompletionCode = 0xCD
	CompletionCodeCannotProvideResponse                CompletionCode = 0xCE
	CompletionCodeCannotExecuteDuplicatedRequest       CompletionCode = 0xCF
	CompletionCodeCannotProvideResponseSDRRInUpdate    CompletionCode = 0xD0
	CompletionCodeCannotProvideResponseFirmwareUpdate  CompletionCode = 0xD1
	CompletionCodeCannotProvideResponseBMCInitialize   CompletionCode = 0xD2
	CompletionCodeDestinationUnavailable               CompletionCode = 0xD3
	CompletionCodeCannotExecuteCommandSecurityRestrict CompletionCode = 0xD4
	CompletionCodeCannotExecuteCommandNotSupported     CompletionCode = 0xD5
	CompletionCodeCannotExecuteCommandSubFnDisabled    CompletionCode = 0xD6
	CompletionCodeUnspecifiedError                     CompletionCode = 0xFF
)

5.2 Table 5 for generic completion codes

func (CompletionCode) String

func (cc CompletionCode) String() string

String return description of global completion code. Please use StrCC function to get description for any completion code returned for specific command response.

type ConfidentialityPayload

type ConfidentialityPayload struct {
	// 02h = confidentiality algorithm
	PayloadType   uint8
	PayloadLength uint8
	CryptAlg      uint8
}

func (*ConfidentialityPayload) Pack

func (p *ConfidentialityPayload) Pack() []byte

func (*ConfidentialityPayload) Unpack

func (p *ConfidentialityPayload) Unpack(msg []byte) error

type ConsoleRedirectionControl

type ConsoleRedirectionControl uint8
const (
	ConsoleRedirectionControl_Default ConsoleRedirectionControl = 0
	ConsoleRedirectionControl_Skip    ConsoleRedirectionControl = 1
	ConsoleRedirectionControl_Enable  ConsoleRedirectionControl = 2
)

func (ConsoleRedirectionControl) String

func (c ConsoleRedirectionControl) String() string

type CryptAlg

type CryptAlg uint8

13.28.5 Confidentiality (Encryption) Algorithms AES is more secure than RC4 RC4 is cryptographically broken and should not be used for secure applications.

func (CryptAlg) String

func (cryptAlg CryptAlg) String() string

type DeleteSELEntryRequest

type DeleteSELEntryRequest struct {
	ReservationID uint16
	RecordID      uint16
}

31.8 Delete SEL Entry Command

func (*DeleteSELEntryRequest) Command

func (req *DeleteSELEntryRequest) Command() Command

func (*DeleteSELEntryRequest) Pack

func (req *DeleteSELEntryRequest) Pack() []byte

type DeleteSELEntryResponse

type DeleteSELEntryResponse struct {
	RecordID uint16
}

func (*DeleteSELEntryResponse) CompletionCodes

func (res *DeleteSELEntryResponse) CompletionCodes() map[uint8]string

func (*DeleteSELEntryResponse) Format

func (res *DeleteSELEntryResponse) Format() string

func (*DeleteSELEntryResponse) Unpack

func (res *DeleteSELEntryResponse) Unpack(msg []byte) error

type DevicePowerState

type DevicePowerState uint8

func (DevicePowerState) String

func (s DevicePowerState) String() string

type DeviceType

type DeviceType uint16

43.13 Device Type Codes DeviceType codes are used to identify different types of devices on an IPMB, PCI Management Bus, or Private Management Bus connection to an IPMI management controller

func (DeviceType) String

func (d DeviceType) String() string

type EnableMessageChannelReceiveRequest

type EnableMessageChannelReceiveRequest struct {
	ChannelNumber uint8

	// [7:2] - reserved
	// [1:0] - 00b = disable channel
	//         01b = enable channel
	//         10b = get channel enable/disable state
	//         11b = reserved
	ChannelState uint8
}

22.5 Enable Message Channel Receive Command

func (*EnableMessageChannelReceiveRequest) Command

func (*EnableMessageChannelReceiveRequest) Pack

type EnableMessageChannelReceiveResponse

type EnableMessageChannelReceiveResponse struct {
	ChannelNumber uint8

	ChannelEnabled bool
}

func (*EnableMessageChannelReceiveResponse) CompletionCodes

func (*EnableMessageChannelReceiveResponse) CompletionCodes() map[uint8]string

func (*EnableMessageChannelReceiveResponse) Format

func (*EnableMessageChannelReceiveResponse) Unpack

func (res *EnableMessageChannelReceiveResponse) Unpack(msg []byte) error

type EntityID

type EntityID uint8

43.14 Entity IDs 39. Using Entity IDs EntityID can be seen as Entity Type

1. An Entity ID is a standardized numeric code that is used in SDRs to identify the types of physical entities or FRUs in the system.

2. The Entity ID is associated with an Entity Instance value that is used to indicate the particular instance of an entity

3. The SDR for a sensor includes Entity ID and Entity Instance fields that identify the entity associated with the sensor.

func (EntityID) String

func (e EntityID) String() string

type EntityInstance

type EntityInstance uint8

see: 39.1 System- and Device-relative Entity Instance Values

Entity Instance values in the system-relative range are required to be unique for all entities with the same Entity ID in the system.

Device-relative Entity Instance values are only required to be unique among all entities that have the same Entity ID within a given device (management controller).

For example, management controller A and B could both have FAN entities that have an Entity Instance value of 60h.

EntityInstance only occupy 7 bits, range is 0x00 ~ 0x7f

func (EntityInstance) Type

func (e EntityInstance) Type() string

type Event

type Event struct {
	EventName string
	EventDesc string

	// for generic event, different sensor type may means different severity
	AssertionSeverityMap   map[SensorType]EventSeverity
	DeassertionSeverityMap map[SensorType]EventSeverity

	// for sensor specific event, severity is certain.
	AssertionSeverity   EventSeverity
	DeassertionSeverity EventSeverity

	ED2 map[uint8]string
	ED3 map[uint8]string
}

type EventData

type EventData struct {
	EventData1 uint8
	EventData2 uint8
	EventData3 uint8
}

29.7 Event Data Field Formats

func (*EventData) EventReadingOffset

func (ed *EventData) EventReadingOffset() uint8

29.7 Event Data Field Formats Event Data 1 [3:0] - for threshold sensors: Offset from Event/Reading Code for threshold event. for discrete sensors: Offset from Event/Reading Code for discrete event state (corresponding 15 possible discrete events)

func (*EventData) String

func (ed *EventData) String() string

type EventDir

type EventDir bool

func (EventDir) String

func (d EventDir) String() string

type EventReadingType

type EventReadingType uint8

41.2 Event/Reading Type Code 42.1 Event/Reading Type Codes

const (
	EventReadingTypeUnspecified            EventReadingType = 0x00
	EventReadingTypeThreshold              EventReadingType = 0x01
	EventReadingTypeTransitionState        EventReadingType = 0x02
	EventReadingTypeState                  EventReadingType = 0x03
	EventReadingTypePredicitiveFailure     EventReadingType = 0x04
	EventReadingTypeLimit                  EventReadingType = 0x05
	EventReadingTypePeformance             EventReadingType = 0x06
	EventReadingTypeTransitionSeverity     EventReadingType = 0x07
	EventReadingTypeDevicePresent          EventReadingType = 0x08
	EventReadingTypeDeviceEnabled          EventReadingType = 0x09
	EventReadingTypeTransitionAvailability EventReadingType = 0x0a
	EventReadingTypeRedundancy             EventReadingType = 0x0b
	EventReadingTypeACPIPowerState         EventReadingType = 0x0c
	EventReadingTypeSensorSpecific         EventReadingType = 0x6f
	EventReadingTypeOEMMin                 EventReadingType = 0x70
	EventReadingTypeOEMMax                 EventReadingType = 0x7f
)

func (EventReadingType) Event

func (typ EventReadingType) Event(sensorType SensorType, sensorNumber SensorNumber, eventData EventData) *Event

Event return the predefined Event description struct.

func (EventReadingType) EventSeverity

func (typ EventReadingType) EventSeverity(sensorType SensorType, sensorNumber SensorNumber, eventData EventData, eventDir EventDir) EventSeverity

EventSeverity return the severity for the event. Todo, refactor

func (EventReadingType) EventString

func (typ EventReadingType) EventString(sensorType SensorType, sensorNumber SensorNumber, eventData EventData) string

EventString returns description of the event

func (EventReadingType) IsThreshold

func (typ EventReadingType) IsThreshold() bool

func (EventReadingType) SensorClass

func (typ EventReadingType) SensorClass() SensorClass

func (EventReadingType) String

func (typ EventReadingType) String() string

type EventSeverity

type EventSeverity string
const (
	EventSeverityInfo     EventSeverity = "Info"
	EventSeverityOK       EventSeverity = "OK"
	EventSeverityWarning  EventSeverity = "Warning"
	EventSeverityCritical EventSeverity = "Critical"
	EventSeverityDegraded EventSeverity = "Degraded"
	EventSeverityNonFatal EventSeverity = "Non-fatal"
)

type FRU

type FRU struct {
	CommonHeader    *FRUCommonHeader
	InternalUseArea *FRUInternalUseArea
	ChassisInfoArea *FRUChassisInfoArea
	BoardInfoArea   *FRUBoardInfoArea
	ProductInfoArea *FRUProductInfoArea
	MultiRecords    []*FRUMultiRecord
	// contains filtered or unexported fields
}

func (*FRU) DeviceID

func (fru *FRU) DeviceID() uint8

func (*FRU) DeviceName

func (fru *FRU) DeviceName() string

func (*FRU) Present

func (fru *FRU) Present() bool

func (*FRU) String

func (fru *FRU) String() string

type FRUBoardInfoArea

type FRUBoardInfoArea struct {
	FormatVersion          uint8
	Length8B               uint8
	LanguageCode           uint8
	MfgDateTime            time.Time
	ManufacturerTypeLength TypeLength
	Manufacturer           []byte
	ProductNameTypeLength  TypeLength
	ProductName            []byte
	SerialNumberTypeLength TypeLength
	SerialNumber           []byte
	PartNumberTypeLength   TypeLength
	PartNumber             []byte
	FRUFileIDTypeLength    TypeLength
	FRUFileID              []byte
	Custom                 [][]byte
	Unused                 []byte
	Checksum               uint8
}

FRUBoardInfoArea provides Serial Number, Part Number, and other information about the board that the FRU Information Device is located on. The name 'Board Info Area' is somewhat a misnomer, because the usage is not restricted to just circuit boards. This area is also typically used to provide FRU information for any replaceable entities, boards, or sub-assemblies that are not sold as standalone products separate from other components. For example, individual boards from a board set, or a sub-chassis or backplane that's part of a larger chassis.1

see: FRU/11. Board Info Area Format

func (*FRUBoardInfoArea) Unpack

func (fruBoard *FRUBoardInfoArea) Unpack(msg []byte) error

type FRUChassisInfoArea

type FRUChassisInfoArea struct {
	FormatVersion          uint8
	Length8B               uint8
	ChassisType            ChassisType
	PartNumberTypeLength   TypeLength
	PartNumber             []byte
	SerialNumberTypeLength TypeLength
	SerialNumber           []byte
	Custom                 [][]byte
	Unused                 []byte
	Checksum               uint8
}

FRUChassisInfoArea is used to hold Serial Number, Part Number, and other information about the system chassis. A system can have multiple FRU Information Devices within a chassis, but only one device should provide the Chassis Info Area.

see: FRU/10. Chassis Info Area Format

func (*FRUChassisInfoArea) Unpack

func (fruChassis *FRUChassisInfoArea) Unpack(msg []byte) error

type FRUCommonHeader

type FRUCommonHeader struct {
	FormatVersion        uint8
	InternalOffset8B     uint8
	ChassisOffset8B      uint8
	BoardOffset8B        uint8
	ProductOffset8B      uint8
	MultiRecordsOffset8B uint8
	Checksum             uint8
}

FRUCommonHeader is mandatory for all FRU Information Device implementations. It holds version information for the overall information format specification and offsets to the other information areas.

The other areas may or may not be present based on the application of the device. The offset unit in wire is in multiples of 8 bytes, offset value 0x0 indicates that this area is not present.

ref: FRU/8. Common Header Format

func (*FRUCommonHeader) Pack

func (s *FRUCommonHeader) Pack() []byte

func (*FRUCommonHeader) String

func (s *FRUCommonHeader) String() string

func (*FRUCommonHeader) Unpack

func (s *FRUCommonHeader) Unpack(msg []byte) error

func (*FRUCommonHeader) Valid

func (s *FRUCommonHeader) Valid() bool

type FRUInternalUseArea

type FRUInternalUseArea struct {
	FormatVersion uint8
	Data          []byte
}

FRUInternalUseArea provides private, implementation-specific information storage for other devices that exist on the same FRU as the FRU Information Device.

The Internal Use Area is usually used to provide private non-volatile storage for a management controller.

see: FRU/9. Internal Use Area Format

type FRULocation

type FRULocation string

38. Accessing FRU Devices

FRU devices can located in three different types of location.

const (
	FRULocation_IPMB           FRULocation = "directly on IPMB"
	FRULocation_PrivateBus     FRULocation = "on private bus"
	FRULocation_MgmtController FRULocation = "on mangement controller"
)

type FRUMultiRecord

type FRUMultiRecord struct {
	RecordType FRURecordType // used to identify the information contained in the record

	EndOfList bool // indicates if this record is the last record in the MultiRecord area

	// Record Format version (=2h unless otherwise specified)
	// This field is used to identify the revision level of information stored in this area.
	// This number will start at zero for each new area. If changes need to be made to the record,
	// e.g. fields added/removed, the version number will be increased to reflect the change.
	FormatVersion uint8

	// RecordLength indicates the number of bytes of data in the record. This byte can also be used to find the
	// next area in the list. If the "End of List" bit is zero, the length can be added the starting offset of the current
	// Record Data to get the offset of the next Record Header. This field allows for 0 to 255 bytes of data for
	// each record.
	RecordLength uint8

	RecordChecksum uint8
	HeaderChecksum uint8

	RecordData []byte
}

The MultiRecord Info Area provides a region that holds one or more records where the type and format of the information is specified in the individual headers for the records.

see: FRU/16. MultiRecord Area

func (*FRUMultiRecord) Unpack

func (fruMultiRecord *FRUMultiRecord) Unpack(msg []byte) error

type FRUProductInfoArea

type FRUProductInfoArea struct {
	FormatVersion          uint8
	Length8B               uint8
	LanguageCode           uint8
	ManufacturerTypeLength TypeLength
	Manufacturer           []byte
	NameTypeLength         TypeLength
	Name                   []byte
	PartModelTypeLength    TypeLength
	PartModel              []byte
	VersionTypeLength      TypeLength
	Version                []byte
	SerialNumberTypeLength TypeLength
	SerialNumber           []byte
	AssetTagTypeLength     TypeLength
	AssetTag               []byte
	FRUFileIDTypeLength    TypeLength
	FRUFileID              []byte
	Custom                 [][]byte
	Unused                 []byte
	Checksum               uint8
}

The Product Info Area is present if the FRU itself is a separate product. This is typically seen when the FRU is an add-in card, sub-assembly, or a power supply from a separate vendor, etc. When this area is provided in the FRU Information Device that contains the Chassis Info Area, the product info is for the overall system, as initially manufactured.

see: FRU/12. Product Info Area Format

func (*FRUProductInfoArea) Unpack

func (fruProduct *FRUProductInfoArea) Unpack(msg []byte) error

type FRURecordType

type FRURecordType uint8

func (FRURecordType) String

func (t FRURecordType) String() string

type FRURecordTypeBaseCompatibility

type FRURecordTypeBaseCompatibility struct {
	ManufacturerID         uint32
	EntityID               EntityID
	CompatibilityBase      uint8
	CompatibilityCodeStart uint8
	CodeRangeMask          uint8
}

FRU: 18.5 Base Compatibility Record (Record Type 0x04)

func (*FRURecordTypeBaseCompatibility) Unpack

func (f *FRURecordTypeBaseCompatibility) Unpack(msg []byte) error

type FRURecordTypeDCLoad

type FRURecordTypeDCLoad struct {
	OutputNumber            uint8
	NominalVoltage10mV      int16
	MinTolerableVoltage10mV int16
	MaxTolerableVoltage10mV int16
	RippleNoise1mV          uint16
	MinCurrentLoad1mA       uint16
	MaxCurrentLoad1mA       uint16
}

FRU: 18.3 DC Load (Record Type 0x02)

func (*FRURecordTypeDCLoad) Unpack

func (output *FRURecordTypeDCLoad) Unpack(msg []byte) error

type FRURecordTypeDCOutput

type FRURecordTypeDCOutput struct {
	//  if the power supply provides this output even when the power supply is switched off.
	OutputWhenOff bool

	OutputNumber uint8

	// Expected voltage from the power supply. Value is a signed short given in 10 millivolt increments.
	// 额定电压 毫-伏特
	NominalVoltage10mV int16

	MaxNegativeVoltage10mV int16

	MaxPositiveVoltage10mV int16

	RippleNoise1mV uint16

	// 毫-安培
	MinCurrentDraw1mA uint16

	MaxCurrentDraw1mA uint16
}

FRU: 18.2 DC Output (Record Type 0x01)

func (*FRURecordTypeDCOutput) Unpack

func (output *FRURecordTypeDCOutput) Unpack(msg []byte) error

type FRURecordTypeExtendedCompatiblityRecord

type FRURecordTypeExtendedCompatiblityRecord struct {
	ManufacturerID         uint32
	EntityID               EntityID
	CompatibilityBase      uint8
	CompatibilityCodeStart uint8
	CodeRangeMask          uint8
}

FRU: 18.6 Extended Compatibility Record (Record Type 0x05)

func (*FRURecordTypeExtendedCompatiblityRecord) Unpack

type FRURecordTypeExtendedDCLoad

type FRURecordTypeExtendedDCLoad struct {
	IsCurrrentUnit100mA bool // current units: true = 100 mA , false = 10 mA
	OutputNumber        uint8
	NominalVoltage10mV  int16
	MinVoltage10mV      int16
	MaxVoltage10mV      int16
	RippleNoise1mV      int16
	MinCurrentLoad      uint16 // units is determined by IsCurrentUnit100mA field
	MaxCurrentLoad      uint16 // units is determined by IsCurrentUnit100mA field
}

FRU: 18.3a Extended DC Load (Record Type 0x0A)

func (*FRURecordTypeExtendedDCLoad) Unpack

func (f *FRURecordTypeExtendedDCLoad) Unpack(msg []byte) error

type FRURecordTypeExtenedDCOutput

type FRURecordTypeExtenedDCOutput struct {
	//  if the power supply provides this output even when the power supply is switched off.
	OutputWhenOff bool

	// This record can be used to support power supplies with outputs that exceed 65.535 Amps.
	// 0b = 10 mA
	// 1b = 100 mA
	CurrentUnits100 bool

	OutputNumber uint8

	// Expected voltage from the power supply. Value is a signed short given in 10 millivolt increments.
	// 毫-伏特
	NominalVoltage10mV int16

	MaxNegativeVoltage10mV int16

	MaxPositiveVoltage10mV int16

	RippleNoise uint16

	// The unit is determined by CurrentUnits100 field.
	MinCurrentDraw uint16
	MaxCurrentDraw uint16
}

FRU: 18.2a Extended DC Output (Record Type 0x09)

func (*FRURecordTypeExtenedDCOutput) Unpack

func (output *FRURecordTypeExtenedDCOutput) Unpack(msg []byte) error

type FRURecordTypeManagementAccess

type FRURecordTypeManagementAccess struct {
	SubRecordType ManagementAccessSubRecordType
	Data          []byte // the size is MultiRecord.TypeLength.Length() - 1
}

FRU: 18.4 Management Access Record (Record Type 0x03)

func (*FRURecordTypeManagementAccess) Unpack

func (f *FRURecordTypeManagementAccess) Unpack(msg []byte) error

type FRURecordTypeOEM

type FRURecordTypeOEM struct {
	ManufacturerID uint32
	Data           []byte
}

FRU: 18.7 OEM Record (Record Types 0xC0-0xFF)

func (*FRURecordTypeOEM) Unpack

func (f *FRURecordTypeOEM) Unpack(msg []byte) error

type FRURecordTypePowerSupply

type FRURecordTypePowerSupply struct {
	// This field allows for Power Supplies with capacities from 0 to 4095 watts.
	OverallCapacity uint16
	// The highest instantaneous VA value that this supply draws during operation (other than during Inrush). In integer units. FFFFh if not specified.
	PeakVA uint16
	// Maximum inrush of current, in Amps, into the power supply. FFh if not specified.
	InrushCurrent uint8 // 涌入电流
	// Number of milliseconds before power supply loading enters non-startup operating range. Set to 0 if no inrush current specified.
	InrushIntervalMilliSecond uint8
	// This specifies the low end of acceptable voltage into the power supply. The units are 10mV.
	LowEndInputVoltageRange1 uint16
	// This specifies the high end of acceptable voltage into the power supply. The units are 10mV.
	HighEndInputVoltageRange1 uint16
	// This specifies the low end of acceptable voltage into the power supply. This field would be used if the power supply did not support autoswitch. Range 1 would define the 110V range, while range 2 would be used for 220V. The units are 10mV.
	LowEndInputVoltageRange2 uint16
	// This specifies the high end of acceptable voltage into the power supply. This field would be used if the power supply did not support autoswitch. Range 1 would define the 110V range, while range 2 would be used for 220V. The units are 10mV.
	HighEndInputVoltageRange2 uint16
	// This specifies the low end of acceptable frequency range into the power supply. Use 00h if supply accepts a DC input.
	LowEndInputFrequencyRange uint8
	// This specifies the high end of acceptable frequency range into the power supply. Use 00h for both Low End and High End frequency range if supply only takes a DC input.
	HighEndInputFrequencyRange uint8
	// Minimum number of milliseconds the power supply can hold up POWERGOOD (and maintain valid DC output) after input power is lost.
	InputDropoutToleranceMilliSecond uint8

	HotSwapSuppot         bool
	Autoswitch            bool
	PowerFactorCorrection bool
	PredictiveFailSupport bool

	// the number of seconds peak wattage can be sustained (0-15 seconds)
	PeakWattageHoldupSecond uint8
	// the peak wattage the power supply can produce during this time period
	PeakCapacity uint16

	CombinedWattageVoltage1 uint8 // bit 7:4 - Voltage 1
	CombinedWattageVoltage2 uint8 // bit 3:0 - Voltage 2

	TotalCombinedWattage uint16

	// This field serves two purposes.
	// It clarifies what type of predictive fail the power supply supports
	// (pass/fail signal or the tachometer output of the power supply fan)
	// and indicates the predictive failing point for tach outputs.
	// This field should be written as zero and ignored if the
	// predictive failure pin of the power supply is not supported.
	//
	// 	0x00 Predictive fail pin indicates pass/fail
	//  0x01 - 0xFF Lower threshold to indicate predictive failure (Rotations per second)
	PredictiveFailTachometerLowerThreshold uint8 // RPS
}

fru: 18.1 Power Supply Information (Record Type 0x00)

type GeneratorID

type GeneratorID uint16

GeneratorID is 2 bytes. the LSB means: Slave Address (for IPMB) or Software ID (for system software); the MSB means: Channel Number / LUN (for IPMB) or always 0 (for system software)

In some scenario, the GeneratorID is used as 1 byte, because for IPMB, the Slave Address and LUN info are carried in IPMI Request/Response Messages; and for system software, the MSB is always 0, so only LSB is need. 32.1 SEL Event Records

Byte 1
[7:1] - 7-bit Slave Address, or 7-bit system software ID
[0] 0b = IPMB Slave Address, 1b = system software ID
Byte 2
[7:4] - Channel number. Channel that event message was received over. 0h if the
event message was received via the system interface, primary IPMB, or
internally generated by the BMC. (New for IPMI v1.5. These bits were reserved
in IPMI v1.0)
[3:2] - reserved. Write as 00b.
[1:0] - IPMB device LUN if byte 1 holds Slave Address. 00b otherwise
const (
	GeneratorBMC             GeneratorID = 0x0020
	GeneratorBIOSPOST        GeneratorID = 0x0001
	GeneratorBIOSSMIHandler  GeneratorID = 0x0033
	GeneratorIntelNMFirmware GeneratorID = 0x002c // Node Manager
	GeneratorIntelMEFirmware GeneratorID = 0x602c // Management Engine

	GeneratorMicrosoftOS GeneratorID = 0x0041

	// The **Open IPMI driver** supports the ability to put semi-custom and custom events in the system event log if a panic occurs.
	GeneratorLinuxKernelPanic GeneratorID = 0x0021
)

type GetACPIPowerStateRequest

type GetACPIPowerStateRequest struct {
}

20.7 Get ACPI Power State Command

func (*GetACPIPowerStateRequest) Command

func (req *GetACPIPowerStateRequest) Command() Command

func (*GetACPIPowerStateRequest) Pack

func (req *GetACPIPowerStateRequest) Pack() []byte

type GetACPIPowerStateResponse

type GetACPIPowerStateResponse struct {
	SystemPowerState SystemPowerState
	DevicePowerState DevicePowerState
}

func (*GetACPIPowerStateResponse) CompletionCodes

func (res *GetACPIPowerStateResponse) CompletionCodes() map[uint8]string

func (*GetACPIPowerStateResponse) Format

func (res *GetACPIPowerStateResponse) Format() string

func (*GetACPIPowerStateResponse) Unpack

func (res *GetACPIPowerStateResponse) Unpack(msg []byte) error

type GetAuthCodeReponse

type GetAuthCodeReponse struct {
	CompletionCode

	// For IPMI v1.5 AuthCode Number:
	AuthCode [16]byte

	// ForIPMI v2.0 Integrity Algorithum Number
	// Resultant hash, per selected Integrity algorithm. Up to 20 bytes. An
	// implementation can elect to return a variable length field based on the size of
	// the hash for the given integrity algorithm, or can return a fixed field where the
	// hash data is followed by 00h bytes as needed to pad the data to 20 bytes.
	Hash []byte
}

type GetAuthCodeRequest

type GetAuthCodeRequest struct {
	AuthType AuthType

	ChannelNumber uint8

	UserID uint8

	// data to hash (must be 16 bytes)
	Data [16]byte
}

GetAuthCodeRequest see 22.21

This command is used to send a block of data to the BMC, whereupon the BMC will return a hash of the data together concatenated with the internally stored password for the given channel and user

type GetBMCGlobalEnablesRequest

type GetBMCGlobalEnablesRequest struct {
}

22.2 Get BMC Global Enables Command

func (*GetBMCGlobalEnablesRequest) Command

func (req *GetBMCGlobalEnablesRequest) Command() Command

func (*GetBMCGlobalEnablesRequest) Pack

func (req *GetBMCGlobalEnablesRequest) Pack() []byte

type GetBMCGlobalEnablesResponse

type GetBMCGlobalEnablesResponse struct {
	OEM2Enabled bool
	OEM1Enabled bool
	OEM0Enabled bool

	SystemEventLoggingEnabled              bool
	EventMessageBufferEnabled              bool
	EventMessageBufferFullInterruptEnabled bool
	ReceiveMessageQueueInterruptEnabled    bool
}

func (*GetBMCGlobalEnablesResponse) CompletionCodes

func (*GetBMCGlobalEnablesResponse) CompletionCodes() map[uint8]string

func (*GetBMCGlobalEnablesResponse) Format

func (res *GetBMCGlobalEnablesResponse) Format() string

func (*GetBMCGlobalEnablesResponse) Unpack

func (res *GetBMCGlobalEnablesResponse) Unpack(msg []byte) error

type GetBTInterfaceCapabilitiesRequest

type GetBTInterfaceCapabilitiesRequest struct {
}

22.10 Get BT Interface Capabilities Command

func (*GetBTInterfaceCapabilitiesRequest) Command

func (*GetBTInterfaceCapabilitiesRequest) Pack

type GetBTInterfaceCapabilitiesResponse

type GetBTInterfaceCapabilitiesResponse struct {
	NumberOfOutstandingRequestsSupported uint8
	InputBufferMessageSizeBytes          uint8
	OutputBufferMessageSizeBytes         uint8
	BMCRequestToResponseTimeSec          uint8
	RecommendedRetries                   uint8
}

func (*GetBTInterfaceCapabilitiesResponse) CompletionCodes

func (*GetBTInterfaceCapabilitiesResponse) CompletionCodes() map[uint8]string

func (*GetBTInterfaceCapabilitiesResponse) Format

func (*GetBTInterfaceCapabilitiesResponse) Unpack

func (res *GetBTInterfaceCapabilitiesResponse) Unpack(msg []byte) error

type GetChannelAccessRequest

type GetChannelAccessRequest struct {
	ChannnelNumber uint8

	AccessOption ChannelAccessOption
}

22.23 Get Channel Access Command

func (*GetChannelAccessRequest) Command

func (req *GetChannelAccessRequest) Command() Command

func (*GetChannelAccessRequest) Pack

func (req *GetChannelAccessRequest) Pack() []byte

type GetChannelAccessResponse

type GetChannelAccessResponse struct {
	PEFAlertingDisabled   bool
	PerMsgAuthDisabled    bool
	UserLevelAuthDisabled bool
	AccessMode            ChannelAccessMode

	MaxPrivilegeLevel PrivilegeLevel
}

func (*GetChannelAccessResponse) CompletionCodes

func (res *GetChannelAccessResponse) CompletionCodes() map[uint8]string

func (*GetChannelAccessResponse) Format

func (res *GetChannelAccessResponse) Format() string

func (*GetChannelAccessResponse) Unpack

func (res *GetChannelAccessResponse) Unpack(msg []byte) error

type GetChannelAuthenticationCapabilitiesRequest

type GetChannelAuthenticationCapabilitiesRequest struct {
	// [7]
	// - 1b = get IPMI v2.0+ extended data.
	// If the given channel supports authentication but does not support RMCP+
	// (e.g. a serial channel), then the Response data should return with bit [5] of byte 4 = 0b, byte 5 should return 01h,
	//
	// - 0b = Backward compatible with IPMI v1.5. Response data only returns
	// bytes 1:9, bit [7] of byte 3 (Authentication Type Support) and bit [5] of byte 4 returns as 0b, bit [5] of byte byte 5 returns 00h.
	// [6:4] - reserved
	IPMIv20Extended bool
	// [3:0] - channel number.
	// 0h-Bh, Fh = channel numbers
	// Eh = retrieve information for channel this request was issued on
	ChannelNumber uint8

	// Requested Maximum Privilege Level
	MaximumPrivilegeLevel PrivilegeLevel
}

13.14 22.13

func (*GetChannelAuthenticationCapabilitiesRequest) Command

func (*GetChannelAuthenticationCapabilitiesRequest) Pack

type GetChannelAuthenticationCapabilitiesResponse

type GetChannelAuthenticationCapabilitiesResponse struct {
	// Channel number that the Authentication Capabilities is being returned for.
	// If the channel number in the request was set to Eh, this will return
	// the channel number for the channel that the request was received on
	ChannelNumber uint8

	// Returns the setting of the Authentication Type Enable field from the
	// configuration parameters for the given channel that corresponds to
	// the Requested Maximum Privilege Level.
	// [7] -
	// 1b = IPMI v2.0+ extended capabilities available. See Extended Capabilities field, below.
	// 0b = IPMI v1.5 support only.
	IPMIv20ExtendedAvailable bool
	// [5:0] - IPMI v1.5 Authentication type(s) enabled for given Requested Maximum Privilege Level
	AuthTypeNoneSupported           bool // bit 0
	AuthTypeMD2Supported            bool // bit 1
	AuthTypeMD5Supported            bool // bit 2
	AuthTypePasswordSupported       bool // bit 4
	AuthTypeOEMProprietarySupported bool // bit 5

	// [5] - Kg status (two-key login status).
	// Applies to v2.0/RMCP+ RAKP Authentication only. Otherwise, ignore as reserved.
	// 0b = Kg is set to default (all 0s).
	// 1b = Kg is set to non-zero value.
	KgStatus bool
	// [4] - Per-message Authentication status
	// 0b = Per-message Authentication is enabled.
	// 1b = Per-message Authentication is disabled.
	// Authentication Type "none" accepted for packets to the BMC after the Session has been activated.
	PerMessageAuthenticationDisabled bool
	// [3] - User Level Authentication status
	// 0b = User Level Authentication is enabled.
	// 1b = User Level Authentication is disabled.
	// Authentication Type "none" accepted for User Level commands to the BMC.
	UserLevelAuthenticationDisabled bool
	// [2:0] - Anonymous Login status
	// This parameter returns values that tells the remote console whether
	// there are users on the system that have "null" usernames.
	// This can be used to guide the way the remote console presents login options to the user.
	// (see IPMI v1.5 specification sections 6.9.1, "Anonymous Login" Convention and 6.9.2, Anonymous Login )
	// [2] - 1b = Non-null usernames enabled. (One or more users are enabled that have non-null usernames).
	// [1] - 1b = Null usernames enabled (One or more users that have a null username, but non-null password, are presently enabled)
	// [0] - 1b = Anonymous Login enabled (A user that has a null username and null password is presently enabled)
	NonNullUsernamesEnabled bool
	NullUsernamesEnabled    bool
	AnonymousLoginEnabled   bool

	// For IPMI v1.5: - reserved
	// For IPMI v2.0+: - Extended Capabilities
	// [7:2] - reserved
	// [1] - 1b = channel supports IPMI v2.0 connections.
	// [0] - 1b = channel supports IPMI v1.5 connections.
	SupportIPMIv15 bool
	SupportIPMIv20 bool

	// IANA Enterprise Number for OEM/Organization that specified the particular
	// OEM Authentication Type for RMCP. Least significant byte first.
	// ONLY 3 bytes occupied. Return 00h, 00h, 00h if no OEM authentication type available.
	OEMID uint32

	// Additional OEM-specific information for the OEM Authentication Type for RMCP.
	// Return 00h if no OEM authentication type available.
	OEMAuxilirayData uint8
}

func (*GetChannelAuthenticationCapabilitiesResponse) CompletionCodes

func (*GetChannelAuthenticationCapabilitiesResponse) Format

func (*GetChannelAuthenticationCapabilitiesResponse) Unpack

type GetChannelCipherSuitesRequest

type GetChannelCipherSuitesRequest struct {
	ChannelNumber uint8 // Eh = retrieve information for channel this request was issued on
	PayloadType   PayloadType
	ListIndex     uint8
}

22.15 Get Channel Cipher Suites Command

func (*GetChannelCipherSuitesRequest) Command

func (req *GetChannelCipherSuitesRequest) Command() Command

func (*GetChannelCipherSuitesRequest) Pack

func (req *GetChannelCipherSuitesRequest) Pack() []byte

type GetChannelCipherSuitesResponse

type GetChannelCipherSuitesResponse struct {
	ChannelNumber      uint8
	CipherSuiteRecords []byte
}

func (*GetChannelCipherSuitesResponse) CompletionCodes

func (*GetChannelCipherSuitesResponse) CompletionCodes() map[uint8]string

func (*GetChannelCipherSuitesResponse) Format

func (res *GetChannelCipherSuitesResponse) Format() string

func (*GetChannelCipherSuitesResponse) Unpack

func (res *GetChannelCipherSuitesResponse) Unpack(msg []byte) error

type GetChannelInfoRequest

type GetChannelInfoRequest struct {
	ChannnelNumber uint8
}

22.24 Get Channel Info Command

func (*GetChannelInfoRequest) Command

func (req *GetChannelInfoRequest) Command() Command

func (*GetChannelInfoRequest) Pack

func (req *GetChannelInfoRequest) Pack() []byte

type GetChannelInfoResponse

type GetChannelInfoResponse struct {
	ActualChannelNumber uint8
	ChannelMedium       ChannelMedium   // Channel Medium Type Numbers
	ChannelProtocol     ChannelProtocol // Channel Protocol Type Numbers
	SessionSupport      uint8
	ActiveSessionCount  uint8
	VendorID            uint32 // (IANA Enterprise Number) for OEM/Organization that specified the Channel Protocol.

	// Auxiliray Channel Info
	Auxiliray []byte // Auxiliray Channel Info Raw Data, 2 bytes

	// For Channel = Fh (System Interface)
	SMSInterruptType                InterruptType
	EventMessageBufferInterruptType InterruptType
}

func (*GetChannelInfoResponse) CompletionCodes

func (res *GetChannelInfoResponse) CompletionCodes() map[uint8]string

func (*GetChannelInfoResponse) Format

func (res *GetChannelInfoResponse) Format() string

func (*GetChannelInfoResponse) Unpack

func (res *GetChannelInfoResponse) Unpack(msg []byte) error

type GetChassisCapabilitiesRequest

type GetChassisCapabilitiesRequest struct {
}

28.1 Get Chassis Capabilities Command

func (*GetChassisCapabilitiesRequest) Command

func (req *GetChassisCapabilitiesRequest) Command() Command

func (*GetChassisCapabilitiesRequest) Pack

func (req *GetChassisCapabilitiesRequest) Pack() []byte

type GetChassisCapabilitiesResponse

type GetChassisCapabilitiesResponse struct {
	ProvidePowerInterlock      bool
	ProvideDiagnosticInterrupt bool
	ProvideFrontPanelLockout   bool
	ProvideIntrusionSensor     bool

	// Chassis FRU Device
	FRUDeviceAddress uint8

	SDRDeviceAddress uint8

	SELDeviceAddress uint8

	SystemManagementDeviceAddress uint8

	//  If this field is not provided, the address is assumed to be the BMC address (20h).
	BridgeDeviceAddress uint8
}

func (*GetChassisCapabilitiesResponse) CompletionCodes

func (res *GetChassisCapabilitiesResponse) CompletionCodes() map[uint8]string

func (*GetChassisCapabilitiesResponse) Format

func (res *GetChassisCapabilitiesResponse) Format() string

func (*GetChassisCapabilitiesResponse) Unpack

func (res *GetChassisCapabilitiesResponse) Unpack(msg []byte) error

type GetChassisStatusRequest

type GetChassisStatusRequest struct {
}

28.2 Get Chassis Status Command

func (*GetChassisStatusRequest) Command

func (req *GetChassisStatusRequest) Command() Command

func (*GetChassisStatusRequest) Pack

func (req *GetChassisStatusRequest) Pack() []byte

type GetChassisStatusResponse

type GetChassisStatusResponse struct {
	// Current Power State
	PowerRestorePolicy PowerRestorePolicy
	PowerControlFault  bool // Controller attempted to turn system power on or off, but system did not enter desired state.
	PowerFault         bool // fault detected in main power subsystem
	InterLock          bool // chassis is presently shut down because a chassis	panel interlock switch is active
	PowerOverload      bool // system shutdown because of power overload condition.
	PowerIsOn          bool // 系统电源:上电

	// Last Power Event
	LastPowerOnByCommand                   bool
	LastPowerDownByPowerFault              bool
	LastPowerDownByPowerInterlockActivated bool
	LastPowerDownByPowerOverload           bool
	ACFailed                               bool

	// Misc. Chassis State
	ChassisIdentifySupported bool
	ChassisIdentifyState     ChassisIdentifyState
	CollingFanFault          bool
	DriveFault               bool
	FrontPanelLockoutActive  bool // (power off and reset via chassis push-buttons disabled. 前面板锁定)
	ChassisIntrusionActive   bool // 机箱入侵:(机箱盖被打开)

	// Front Panel Button Capabilities and disable/enable status (Optional)
	SleepButtonDisableAllowed      bool
	DiagnosticButtonDisableAllowed bool
	ResetButtonDisableAllowed      bool
	PoweroffButtonDisableAllowed   bool
	SleepButtonDisabled            bool
	DiagnosticButtonDisabled       bool
	ResetButtonDisabled            bool
	PoweroffButtonDisabled         bool
}

func (*GetChassisStatusResponse) CompletionCodes

func (res *GetChassisStatusResponse) CompletionCodes() map[uint8]string

func (*GetChassisStatusResponse) Format

func (res *GetChassisStatusResponse) Format() string

func (*GetChassisStatusResponse) Unpack

func (res *GetChassisStatusResponse) Unpack(msg []byte) error

type GetCommandEnablesRequest

type GetCommandEnablesRequest struct {
	ChannelNumber uint8

	CommandRangeMask CommandRangeMask
	NetFn            NetFn
	LUN              uint8

	CodeForNetFn2C uint8
	OEM_IANA       uint32 // 3 bytes only
}

21.8 Get Command Enables Command

func (*GetCommandEnablesRequest) Command

func (req *GetCommandEnablesRequest) Command() Command

func (*GetCommandEnablesRequest) Pack

func (req *GetCommandEnablesRequest) Pack() []byte

type GetCommandEnablesResponse

type GetCommandEnablesResponse struct {
	// Todo
	CommandEnableMask []byte
}

func (*GetCommandEnablesResponse) CompletionCodes

func (*GetCommandEnablesResponse) CompletionCodes() map[uint8]string

func (*GetCommandEnablesResponse) Format

func (res *GetCommandEnablesResponse) Format() string

func (*GetCommandEnablesResponse) Unpack

func (res *GetCommandEnablesResponse) Unpack(msg []byte) error

type GetCommandSubfunctionSupportRequest

type GetCommandSubfunctionSupportRequest struct {
	ChannelNumber uint8

	NetFn NetFn
	LUN   uint8
	Cmd   uint8

	CodeForNetFn2C uint8
	OEM_IANA       uint32 // 3 bytes only
}

21.4 Get Command Sub-function Support Command

func (*GetCommandSubfunctionSupportRequest) Command

func (*GetCommandSubfunctionSupportRequest) Pack

type GetCommandSubfunctionSupportResponse

type GetCommandSubfunctionSupportResponse struct {
	SpecificationType uint8
	ErrataVersion     uint8
	OEMGroupBody      uint8

	SpecificationVersion  uint8
	SpecificationRevision uint8

	// Todo
	SupportMask []byte
}

func (*GetCommandSubfunctionSupportResponse) CompletionCodes

func (*GetCommandSubfunctionSupportResponse) CompletionCodes() map[uint8]string

func (*GetCommandSubfunctionSupportResponse) Format

func (*GetCommandSubfunctionSupportResponse) Unpack

func (res *GetCommandSubfunctionSupportResponse) Unpack(msg []byte) error

type GetCommandSupportRequest

type GetCommandSupportRequest struct {
	ChannelNumber uint8

	CommandRangeMask CommandRangeMask
	NetFn            NetFn
	LUN              uint8

	CodeForNetFn2C uint8
	OEM_IANA       uint32 // 3 bytes only
}

21.3 Get Command Support Command

func (*GetCommandSupportRequest) Command

func (req *GetCommandSupportRequest) Command() Command

func (*GetCommandSupportRequest) Pack

func (req *GetCommandSupportRequest) Pack() []byte

type GetCommandSupportResponse

type GetCommandSupportResponse struct {
	// Todo
	CommandSupportMask []byte
}

func (*GetCommandSupportResponse) CompletionCodes

func (*GetCommandSupportResponse) CompletionCodes() map[uint8]string

func (*GetCommandSupportResponse) Format

func (res *GetCommandSupportResponse) Format() string

func (*GetCommandSupportResponse) Unpack

func (res *GetCommandSupportResponse) Unpack(msg []byte) error

type GetConfigurableCommandsRequest

type GetConfigurableCommandsRequest struct {
	ChannelNumber uint8

	CommandRangeMask CommandRangeMask
	NetFn            NetFn
	LUN              uint8

	CodeForNetFn2C uint8
	OEM_IANA       uint32 // 3 bytes only
}

21.5 Get Configurable Commands Command

func (*GetConfigurableCommandsRequest) Command

func (req *GetConfigurableCommandsRequest) Command() Command

func (*GetConfigurableCommandsRequest) Pack

func (req *GetConfigurableCommandsRequest) Pack() []byte

type GetConfigurableCommandsResponse

type GetConfigurableCommandsResponse struct {
	// Todo
	CommandSupportMask []byte
}

func (*GetConfigurableCommandsResponse) CompletionCodes

func (*GetConfigurableCommandsResponse) CompletionCodes() map[uint8]string

func (*GetConfigurableCommandsResponse) Format

func (*GetConfigurableCommandsResponse) Unpack

func (res *GetConfigurableCommandsResponse) Unpack(msg []byte) error

type GetDeviceGUIDRequest

type GetDeviceGUIDRequest struct {
}

20.8 Get Device GUID Command

func (*GetDeviceGUIDRequest) Command

func (req *GetDeviceGUIDRequest) Command() Command

func (*GetDeviceGUIDRequest) Pack

func (req *GetDeviceGUIDRequest) Pack() []byte

type GetDeviceGUIDResponse

type GetDeviceGUIDResponse struct {
	GUID [16]byte
}

func (*GetDeviceGUIDResponse) CompletionCodes

func (res *GetDeviceGUIDResponse) CompletionCodes() map[uint8]string

func (*GetDeviceGUIDResponse) Format

func (res *GetDeviceGUIDResponse) Format() string

func (*GetDeviceGUIDResponse) Unpack

func (res *GetDeviceGUIDResponse) Unpack(msg []byte) error

type GetDeviceIDRequest

type GetDeviceIDRequest struct {
}

20.1 Get Device ID Command

func (*GetDeviceIDRequest) Command

func (req *GetDeviceIDRequest) Command() Command

func (*GetDeviceIDRequest) Pack

func (req *GetDeviceIDRequest) Pack() []byte

type GetDeviceIDResponse

type GetDeviceIDResponse struct {
	DeviceID uint8

	// [7] 1 = device provides Device SDRs
	// 0 = device does not provide Device SDRs
	// [6:4] reserved. Return as 0.
	ProvideDeviceSDRs bool
	// [3:0] Device Revision, binary encoded
	DeviceRevision uint8

	// [7] Device available: 0=normal operation, 1= device firmware, SDR
	// Repository update or self-initialization in progress. [Firmware / SDR
	// Repository updates can be differentiated by issuing a Get SDR
	// command and checking the completion code.]
	DeviceAvailable bool
	// [6:0] Major Firmware Revision, binary encoded
	MajorFirmwareRevision uint8

	// BCD encoded
	MinorFirmwareRevision uint8

	// Holds IPMI Command Specification Version. BCD encoded.
	// 00h = reserved.
	// Bits 7:4 hold the Least Significant digit of the revision, while
	// bits 3:0 hold the Most Significant bits.
	// E.g. a value of 51h indicates revision 1.5 functionality.
	// 02h for implementations that provide IPMI v2.0 capabilities
	// per this specification.
	MajorIPMIVersion uint8
	MinorIPMIVersion uint8

	AdditionalDeviceSupport

	// Manufacturer ID, LS Byte first. The manufacturer ID is a 20-bit value that is
	// derived from the IANA Private Enterprise ID (see below).
	// Most significant four bits = reserved (0000b).
	// 000000h = unspecified. 0FFFFFh = reserved. This value is binary encoded.
	// E.g. the ID for the IPMI forum is 7154 decimal, which is 1BF2h, which would
	// be stored in this record as F2h, 1Bh, 00h for bytes 8 through 10, respectively
	ManufacturerID uint32 // only 3 bytes used

	// Product ID, LS Byte first. This field can be used to provide a number that
	// identifies a particular system, module, add-in card, or board set. The number
	// is specified according to the manufacturer given by Manufacturer ID (see
	// below).
	// 0000h = unspecified. FFFFh = reserved.
	ProductID uint16

	// Auxiliary Firmware Revision Information. This field is optional. If present, it
	// holds additional information about the firmware revision, such as boot block or
	// internal data structure version numbers. The meanings of the numbers are
	// specific to the vendor identified by Manufacturer ID (see below). When the
	// vendor-specific definition is not known, generic utilities should display each
	// byte as 2-digit hexadecimal numbers, with byte 13 displayed first as the mostsignificant byte.
	AuxiliaryFirmwareRevision []byte // 4 bytes
}

func (*GetDeviceIDResponse) CompletionCodes

func (res *GetDeviceIDResponse) CompletionCodes() map[uint8]string

func (*GetDeviceIDResponse) FirmwareVersionStr

func (res *GetDeviceIDResponse) FirmwareVersionStr() string

func (*GetDeviceIDResponse) Format

func (res *GetDeviceIDResponse) Format() string

func (*GetDeviceIDResponse) Unpack

func (res *GetDeviceIDResponse) Unpack(msg []byte) error

type GetDeviceSDRInfoRequest

type GetDeviceSDRInfoRequest struct {
	// true: Get SDR count. This returns the total number of SDRs in the device.
	// false: Get Sensor count. This returns the number of sensors implemented on LUN this command was addressed to.
	GetSDRCount bool
}

35.2 Get Device SDR Info Command

func (*GetDeviceSDRInfoRequest) Command

func (req *GetDeviceSDRInfoRequest) Command() Command

func (*GetDeviceSDRInfoRequest) Pack

func (req *GetDeviceSDRInfoRequest) Pack() []byte

type GetDeviceSDRInfoResponse

type GetDeviceSDRInfoResponse struct {
	Count uint8

	// 0b = static sensor population. The number of sensors handled by this
	// device is fixed, and a query shall return records for all sensors.
	//
	// 1b = dynamic sensor population. This device may have its sensor
	// population vary during "run time" (defined as any time other that
	// when an install operation is in progress).
	DynamicSensorPopulation bool

	LUN3HasSensors bool
	LUN2HasSensors bool
	LUN1HasSensors bool
	LUN0HasSensors bool

	// Four byte timestamp, or counter. Updated or incremented each time the
	// sensor population changes. This field is not provided if the flags indicate a
	// static sensor population.
	SensorPopulationChangeIndicator uint32
	// contains filtered or unexported fields
}

func (*GetDeviceSDRInfoResponse) CompletionCodes

func (r *GetDeviceSDRInfoResponse) CompletionCodes() map[uint8]string

func (*GetDeviceSDRInfoResponse) Format

func (res *GetDeviceSDRInfoResponse) Format() string

func (*GetDeviceSDRInfoResponse) Unpack

func (res *GetDeviceSDRInfoResponse) Unpack(msg []byte) error

type GetDeviceSDRRequest

type GetDeviceSDRRequest struct {
	ReservationID uint16
	RecordID      uint16
	ReadOffset    uint8
	ReadBytes     uint8 // FFh means read entire record
}

35.3 Get Device SDR Command

func (*GetDeviceSDRRequest) Command

func (req *GetDeviceSDRRequest) Command() Command

func (*GetDeviceSDRRequest) Pack

func (req *GetDeviceSDRRequest) Pack() []byte

type GetDeviceSDRResponse

type GetDeviceSDRResponse struct {
	NextRecordID uint16
	RecordData   []byte
}

func (*GetDeviceSDRResponse) CompletionCodes

func (r *GetDeviceSDRResponse) CompletionCodes() map[uint8]string

func (*GetDeviceSDRResponse) Format

func (res *GetDeviceSDRResponse) Format() string

func (*GetDeviceSDRResponse) Unpack

func (res *GetDeviceSDRResponse) Unpack(msg []byte) error

type GetEventReceiverRequest

type GetEventReceiverRequest struct {
}

29.2 Get Event Receiver Command

func (*GetEventReceiverRequest) Command

func (req *GetEventReceiverRequest) Command() Command

func (*GetEventReceiverRequest) Pack

func (req *GetEventReceiverRequest) Pack() []byte

type GetEventReceiverResponse

type GetEventReceiverResponse struct {
	SlaveAddress uint8
	LUN          uint8
}

func (*GetEventReceiverResponse) CompletionCodes

func (res *GetEventReceiverResponse) CompletionCodes() map[uint8]string

func (*GetEventReceiverResponse) Format

func (res *GetEventReceiverResponse) Format() string

func (*GetEventReceiverResponse) Unpack

func (res *GetEventReceiverResponse) Unpack(msg []byte) error

type GetFRUInventoryAreaInfoRequest

type GetFRUInventoryAreaInfoRequest struct {
	FRUDeviceID uint8
}

34.1 Get FRU Inventory Area Info Command

func (*GetFRUInventoryAreaInfoRequest) Command

func (req *GetFRUInventoryAreaInfoRequest) Command() Command

func (*GetFRUInventoryAreaInfoRequest) Pack

func (req *GetFRUInventoryAreaInfoRequest) Pack() []byte

type GetFRUInventoryAreaInfoResponse

type GetFRUInventoryAreaInfoResponse struct {
	AreaSizeBytes         uint16
	DeviceAccessedByWords bool // false means Device is accessed by Bytes
}

func (*GetFRUInventoryAreaInfoResponse) CompletionCodes

func (r *GetFRUInventoryAreaInfoResponse) CompletionCodes() map[uint8]string

func (*GetFRUInventoryAreaInfoResponse) Format

func (*GetFRUInventoryAreaInfoResponse) Unpack

func (res *GetFRUInventoryAreaInfoResponse) Unpack(msg []byte) error

type GetIPStatisticsRequest

type GetIPStatisticsRequest struct {
	ChannelNumber      uint8
	ClearAllStatistics bool
}

23.4 Get IP/UDP/RMCP Statistics Command

func (*GetIPStatisticsRequest) Command

func (req *GetIPStatisticsRequest) Command() Command

func (*GetIPStatisticsRequest) Pack

func (req *GetIPStatisticsRequest) Pack() []byte

type GetIPStatisticsResponse

type GetIPStatisticsResponse struct {
	IPPacketsReceived           uint16
	IPHeaderErrorsReceived      uint16
	IPAddressErrorsReceived     uint16
	IPPacketsFragmentedReceived uint16
	IPPacketsTransmitted        uint16
	UDPPacketsReceived          uint16
	RMCPPacketsValidReceived    uint16
	UDPProxyPacketsReceived     uint16
	UDPProxyPacketsDropped      uint16
}

func (*GetIPStatisticsResponse) CompletionCodes

func (res *GetIPStatisticsResponse) CompletionCodes() map[uint8]string

func (*GetIPStatisticsResponse) Format

func (res *GetIPStatisticsResponse) Format() string

func (*GetIPStatisticsResponse) Unpack

func (res *GetIPStatisticsResponse) Unpack(msg []byte) error

type GetLanConfigParamsRequest

type GetLanConfigParamsRequest struct {
	ChannelNumber uint8
	ParamSelector LanParamSelector
	SetSelector   uint8
	BlockSelector uint8
}

23.2 Get LAN Configuration Parameters Command

func (*GetLanConfigParamsRequest) Command

func (req *GetLanConfigParamsRequest) Command() Command

func (*GetLanConfigParamsRequest) Pack

func (req *GetLanConfigParamsRequest) Pack() []byte

type GetLanConfigParamsResponse

type GetLanConfigParamsResponse struct {
	ParameterVersion uint8
	ConfigData       []byte
}

func (*GetLanConfigParamsResponse) CompletionCodes

func (res *GetLanConfigParamsResponse) CompletionCodes() map[uint8]string

func (*GetLanConfigParamsResponse) Format

func (res *GetLanConfigParamsResponse) Format() string

func (*GetLanConfigParamsResponse) Unpack

func (res *GetLanConfigParamsResponse) Unpack(msg []byte) error

type GetMessageFlagsRequest

type GetMessageFlagsRequest struct {
}

22.4 Get Message Flags Command

func (*GetMessageFlagsRequest) Command

func (req *GetMessageFlagsRequest) Command() Command

func (*GetMessageFlagsRequest) Pack

func (req *GetMessageFlagsRequest) Pack() []byte

type GetMessageFlagsResponse

type GetMessageFlagsResponse struct {
	OEM2Avaiable                        bool
	OEM1Avaiable                        bool
	OEM0Avaiable                        bool
	WatchdogPreTimeoutInterruptOccurred bool
	EventMessageBufferFull              bool
	ReceiveMessageQueueAvaiable         bool // One or more messages ready for reading from Receive Message Queue
}

func (*GetMessageFlagsResponse) CompletionCodes

func (*GetMessageFlagsResponse) CompletionCodes() map[uint8]string

func (*GetMessageFlagsResponse) Format

func (res *GetMessageFlagsResponse) Format() string

func (*GetMessageFlagsResponse) Unpack

func (res *GetMessageFlagsResponse) Unpack(msg []byte) error

type GetMessageRequest

type GetMessageRequest struct {
}

22.6 Get Message Command

func (*GetMessageRequest) Command

func (req *GetMessageRequest) Command() Command

func (*GetMessageRequest) Pack

func (req *GetMessageRequest) Pack() []byte

type GetMessageResponse

type GetMessageResponse struct {
	ChannelNumber uint8
	MessageData   []byte
}

func (*GetMessageResponse) CompletionCodes

func (res *GetMessageResponse) CompletionCodes() map[uint8]string

func (*GetMessageResponse) Format

func (res *GetMessageResponse) Format() string

func (*GetMessageResponse) Unpack

func (res *GetMessageResponse) Unpack(msg []byte) error

type GetNetFnSupportRequest

type GetNetFnSupportRequest struct {
	ChannelNumber uint8
}

21.2 Get NetFn Support Command

func (*GetNetFnSupportRequest) Command

func (req *GetNetFnSupportRequest) Command() Command

func (*GetNetFnSupportRequest) Pack

func (req *GetNetFnSupportRequest) Pack() []byte

type GetNetFnSupportResponse

type GetNetFnSupportResponse struct {
	LUN3Support LUNSupport
	LUN2Support LUNSupport
	LUN1Support LUNSupport
	LUN0Support LUNSupport

	// Todo
	NetFnPairsSupport []byte
}

func (*GetNetFnSupportResponse) CompletionCodes

func (*GetNetFnSupportResponse) CompletionCodes() map[uint8]string

func (*GetNetFnSupportResponse) Format

func (res *GetNetFnSupportResponse) Format() string

func (*GetNetFnSupportResponse) Unpack

func (res *GetNetFnSupportResponse) Unpack(msg []byte) error

type GetPEFCapabilitiesRequest

type GetPEFCapabilitiesRequest struct {
}

30.1 Get PEF Capabilities Command

func (*GetPEFCapabilitiesRequest) Command

func (req *GetPEFCapabilitiesRequest) Command() Command

func (*GetPEFCapabilitiesRequest) Pack

func (req *GetPEFCapabilitiesRequest) Pack() []byte

type GetPEFCapabilitiesResponse

type GetPEFCapabilitiesResponse struct {
	PEFVersion uint8

	SupportOEMEventRecordFilter bool
	SupportDiagnosticInterrupt  bool
	SupportOEMAction            bool
	SupportPowerCycle           bool
	SupportReset                bool
	SupportPowerDown            bool
	SupportAlert                bool

	EventFilterTableEntries uint8
}

func (*GetPEFCapabilitiesResponse) CompletionCodes

func (r *GetPEFCapabilitiesResponse) CompletionCodes() map[uint8]string

func (*GetPEFCapabilitiesResponse) Format

func (res *GetPEFCapabilitiesResponse) Format() string

func (*GetPEFCapabilitiesResponse) Unpack

func (res *GetPEFCapabilitiesResponse) Unpack(msg []byte) error

type GetPOHCounterRequest

type GetPOHCounterRequest struct {
}

28.14 Get POH Counter Command

func (*GetPOHCounterRequest) Command

func (req *GetPOHCounterRequest) Command() Command

func (*GetPOHCounterRequest) Pack

func (req *GetPOHCounterRequest) Pack() []byte

type GetPOHCounterResponse

type GetPOHCounterResponse struct {
	MinutesPerCount uint8
	CounterReading  uint32
}

func (*GetPOHCounterResponse) CompletionCodes

func (r *GetPOHCounterResponse) CompletionCodes() map[uint8]string

func (*GetPOHCounterResponse) Format

func (res *GetPOHCounterResponse) Format() string

func (*GetPOHCounterResponse) Minutes

func (res *GetPOHCounterResponse) Minutes() uint32

func (*GetPOHCounterResponse) Unpack

func (res *GetPOHCounterResponse) Unpack(msg []byte) error

type GetSDRRepoAllocInfoRequest

type GetSDRRepoAllocInfoRequest struct {
}

33.10 Get SDR Repository Allocation Info Command

func (*GetSDRRepoAllocInfoRequest) Command

func (req *GetSDRRepoAllocInfoRequest) Command() Command

func (*GetSDRRepoAllocInfoRequest) Pack

func (req *GetSDRRepoAllocInfoRequest) Pack() []byte

type GetSDRRepoAllocInfoResponse

type GetSDRRepoAllocInfoResponse struct {
	PossibleAllocUnits uint16
	AllocUnitsSize     uint16 // Allocation unit size in bytes. 0000h indicates unspecified.
	FreeAllocUnits     uint16
	LargestFreeBlock   uint16
	MaximumRecordSize  uint8
}

func (*GetSDRRepoAllocInfoResponse) CompletionCodes

func (res *GetSDRRepoAllocInfoResponse) CompletionCodes() map[uint8]string

func (*GetSDRRepoAllocInfoResponse) Format

func (res *GetSDRRepoAllocInfoResponse) Format() string

func (*GetSDRRepoAllocInfoResponse) Unpack

func (res *GetSDRRepoAllocInfoResponse) Unpack(msg []byte) error

type GetSDRRepoInfoRequest

type GetSDRRepoInfoRequest struct {
}

33.9 Get SDR Repository Info Command

func (*GetSDRRepoInfoRequest) Command

func (req *GetSDRRepoInfoRequest) Command() Command

func (*GetSDRRepoInfoRequest) Pack

func (req *GetSDRRepoInfoRequest) Pack() []byte

type GetSDRRepoInfoResponse

type GetSDRRepoInfoResponse struct {
	SDRVersion               uint8  // version number of the SDR command set for the SDR Device. 51h for this specification.
	RecordCount              uint16 // LS Byte first
	FreeSpeceBytes           uint16 // LS Byte first
	MostRecentAddititionTime time.Time
	MostRecentEraseTime      time.Time

	SDROperationSupport SDROperationSupport
}

func (*GetSDRRepoInfoResponse) CompletionCodes

func (res *GetSDRRepoInfoResponse) CompletionCodes() map[uint8]string

func (*GetSDRRepoInfoResponse) Format

func (res *GetSDRRepoInfoResponse) Format() string

func (*GetSDRRepoInfoResponse) Unpack

func (res *GetSDRRepoInfoResponse) Unpack(msg []byte) error

type GetSDRRequest

type GetSDRRequest struct {
	ReservationID uint16 // LS Byte first
	RecordID      uint16 // LS Byte first
	Offset        uint8  // Offset into record
	Read          uint8  // FFh means read entire record
}

33.12 Get SDR Command

func (*GetSDRRequest) Command

func (req *GetSDRRequest) Command() Command

func (*GetSDRRequest) Pack

func (req *GetSDRRequest) Pack() []byte

type GetSDRResponse

type GetSDRResponse struct {
	NextRecordID uint16
	RecordData   []byte
}

func (*GetSDRResponse) CompletionCodes

func (res *GetSDRResponse) CompletionCodes() map[uint8]string

func (*GetSDRResponse) Format

func (res *GetSDRResponse) Format() string

func (*GetSDRResponse) Unpack

func (res *GetSDRResponse) Unpack(msg []byte) error

type GetSELAllocInfoRequest

type GetSELAllocInfoRequest struct {
}

func (*GetSELAllocInfoRequest) Command

func (req *GetSELAllocInfoRequest) Command() Command

func (*GetSELAllocInfoRequest) Pack

func (req *GetSELAllocInfoRequest) Pack() []byte

type GetSELAllocInfoResponse

type GetSELAllocInfoResponse struct {
	PossibleAllocUnits uint16
	AllocUnitsSize     uint16 // Allocation unit size in bytes. 0000h indicates unspecified.
	FreeAllocUnits     uint16
	LargestFreeBlock   uint16
	MaximumRecordSize  uint8
}

func (*GetSELAllocInfoResponse) CompletionCodes

func (res *GetSELAllocInfoResponse) CompletionCodes() map[uint8]string

func (*GetSELAllocInfoResponse) Format

func (res *GetSELAllocInfoResponse) Format() string

func (*GetSELAllocInfoResponse) Unpack

func (res *GetSELAllocInfoResponse) Unpack(msg []byte) error

type GetSELEntryRequest

type GetSELEntryRequest struct {
	// LS Byte first. Only required for partial Get. Use 0000h otherwise.
	ReservationID uint16

	// SEL Record ID, LS Byte first.
	//  0000h = GET FIRST ENTRY
	//  FFFFh = GET LAST ENTRY
	RecordID uint16

	// Offset into record
	Offset uint8

	// FFh means read entire record.
	ReadBytes uint8
}

31.5 Get SEL Entry Command

func (*GetSELEntryRequest) Command

func (req *GetSELEntryRequest) Command() Command

func (*GetSELEntryRequest) Pack

func (req *GetSELEntryRequest) Pack() []byte

type GetSELEntryResponse

type GetSELEntryResponse struct {
	NextRecordID uint16
	Data         []byte // Record Data, 16 bytes for entire record, at least 1 byte
}

func (*GetSELEntryResponse) CompletionCodes

func (*GetSELEntryResponse) CompletionCodes() map[uint8]string

func (*GetSELEntryResponse) Format

func (res *GetSELEntryResponse) Format() string

func (*GetSELEntryResponse) Unpack

func (res *GetSELEntryResponse) Unpack(msg []byte) error

type GetSELInfoRequest

type GetSELInfoRequest struct {
}

GetSELInfoRequest (31.2) command returns the number of entries in the SEL.

func (*GetSELInfoRequest) Command

func (req *GetSELInfoRequest) Command() Command

func (*GetSELInfoRequest) Pack

func (req *GetSELInfoRequest) Pack() []byte

type GetSELInfoResponse

type GetSELInfoResponse struct {
	SELVersion         uint8
	Entries            uint16
	FreeBytes          uint16
	RecentAdditionTime time.Time
	RecentEraseTime    time.Time
	OperationSupport   SELOperationSupport
}

func (*GetSELInfoResponse) CompletionCodes

func (r *GetSELInfoResponse) CompletionCodes() map[uint8]string

func (*GetSELInfoResponse) Format

func (res *GetSELInfoResponse) Format() string

func (*GetSELInfoResponse) Unpack

func (res *GetSELInfoResponse) Unpack(msg []byte) error

type GetSELTimeRequest

type GetSELTimeRequest struct {
}

31.10 Get SEL Time Command

func (*GetSELTimeRequest) Command

func (req *GetSELTimeRequest) Command() Command

func (*GetSELTimeRequest) Pack

func (req *GetSELTimeRequest) Pack() []byte

type GetSELTimeResponse

type GetSELTimeResponse struct {
	// Present Timestamp clock reading
	Time time.Time
}

func (*GetSELTimeResponse) CompletionCodes

func (res *GetSELTimeResponse) CompletionCodes() map[uint8]string

func (*GetSELTimeResponse) Format

func (res *GetSELTimeResponse) Format() string

func (*GetSELTimeResponse) Unpack

func (res *GetSELTimeResponse) Unpack(msg []byte) error

type GetSELTimeUTCOffsetRequest

type GetSELTimeUTCOffsetRequest struct {
}

31.11a Get SEL Time UTC Offset

func (*GetSELTimeUTCOffsetRequest) Command

func (req *GetSELTimeUTCOffsetRequest) Command() Command

func (*GetSELTimeUTCOffsetRequest) Pack

func (req *GetSELTimeUTCOffsetRequest) Pack() []byte

type GetSELTimeUTCOffsetResponse

type GetSELTimeUTCOffsetResponse struct {
	// signed integer for the offset in minutes from UTC to SEL Time.
	MinutesOffset int16
}

func (*GetSELTimeUTCOffsetResponse) CompletionCodes

func (res *GetSELTimeUTCOffsetResponse) CompletionCodes() map[uint8]string

func (*GetSELTimeUTCOffsetResponse) Format

func (res *GetSELTimeUTCOffsetResponse) Format() string

func (*GetSELTimeUTCOffsetResponse) Unpack

func (res *GetSELTimeUTCOffsetResponse) Unpack(msg []byte) error

type GetSOLConfigParamsRequest

type GetSOLConfigParamsRequest struct {
	GetParameterRevisionOnly bool
	ChannelNumber            uint8
	ParameterSelector        SOLConfigParamSelector
	SetSelector              uint8
	BlockSelector            uint8
}

26.3 Get SOL Configuration Parameters Command

func (*GetSOLConfigParamsRequest) Command

func (req *GetSOLConfigParamsRequest) Command() Command

func (*GetSOLConfigParamsRequest) Pack

func (req *GetSOLConfigParamsRequest) Pack() []byte

type GetSOLConfigParamsResponse

type GetSOLConfigParamsResponse struct {
	ParameterRevision uint8
	ParameterData     []byte
}

func (*GetSOLConfigParamsResponse) CompletionCodes

func (res *GetSOLConfigParamsResponse) CompletionCodes() map[uint8]string

func (*GetSOLConfigParamsResponse) Format

func (res *GetSOLConfigParamsResponse) Format() string

func (*GetSOLConfigParamsResponse) Unpack

func (res *GetSOLConfigParamsResponse) Unpack(msg []byte) error

type GetSelfTestResultsRequest

type GetSelfTestResultsRequest struct {
}

20.4 Get Self Test Results Command

func (*GetSelfTestResultsRequest) Command

func (req *GetSelfTestResultsRequest) Command() Command

func (*GetSelfTestResultsRequest) Pack

func (req *GetSelfTestResultsRequest) Pack() []byte

type GetSelfTestResultsResponse

type GetSelfTestResultsResponse struct {
	Byte1 uint8
	Byte2 uint8
}

func (*GetSelfTestResultsResponse) CompletionCodes

func (res *GetSelfTestResultsResponse) CompletionCodes() map[uint8]string

func (*GetSelfTestResultsResponse) Format

func (res *GetSelfTestResultsResponse) Format() string

func (*GetSelfTestResultsResponse) Unpack

func (res *GetSelfTestResultsResponse) Unpack(msg []byte) error

type GetSensorEventEnableRequest

type GetSensorEventEnableRequest struct {
	SensorNumber uint8
}

35.11 Get Sensor Event Enable Command

func (*GetSensorEventEnableRequest) Command

func (req *GetSensorEventEnableRequest) Command() Command

func (*GetSensorEventEnableRequest) Pack

func (req *GetSensorEventEnableRequest) Pack() []byte

type GetSensorEventEnableResponse

type GetSensorEventEnableResponse struct {
	EventMessagesDisabled  bool
	SensorScanningDisabled bool

	SensorEventFlag
}

For event , true means the event has enabled.

func (*GetSensorEventEnableResponse) CompletionCodes

func (r *GetSensorEventEnableResponse) CompletionCodes() map[uint8]string

func (*GetSensorEventEnableResponse) Format

func (res *GetSensorEventEnableResponse) Format() string

func (*GetSensorEventEnableResponse) Unpack

func (res *GetSensorEventEnableResponse) Unpack(msg []byte) error

type GetSensorEventStatusRequest

type GetSensorEventStatusRequest struct {
	SensorNumber uint8
}

35.13 Get Sensor Event Status Command

func (*GetSensorEventStatusRequest) Command

func (req *GetSensorEventStatusRequest) Command() Command

func (*GetSensorEventStatusRequest) Pack

func (req *GetSensorEventStatusRequest) Pack() []byte

type GetSensorEventStatusResponse

type GetSensorEventStatusResponse struct {
	EventMessagesDisabled  bool
	SensorScanningDisabled bool
	ReadingUnavailable     bool

	SensorEventFlag
}

For event boolean value, true means the event has occurred.

func (*GetSensorEventStatusResponse) CompletionCodes

func (res *GetSensorEventStatusResponse) CompletionCodes() map[uint8]string

func (*GetSensorEventStatusResponse) Format

func (res *GetSensorEventStatusResponse) Format() string

func (*GetSensorEventStatusResponse) Unpack

func (res *GetSensorEventStatusResponse) Unpack(msg []byte) error

type GetSensorHysteresisRequest

type GetSensorHysteresisRequest struct {
	SensorNumber uint8
}

35.7 Get Sensor Hysteresis Command

func (*GetSensorHysteresisRequest) Command

func (req *GetSensorHysteresisRequest) Command() Command

func (*GetSensorHysteresisRequest) Pack

func (req *GetSensorHysteresisRequest) Pack() []byte

type GetSensorHysteresisResponse

type GetSensorHysteresisResponse struct {
	PositiveRaw uint8
	NegativeRaw uint8
}

func (*GetSensorHysteresisResponse) CompletionCodes

func (r *GetSensorHysteresisResponse) CompletionCodes() map[uint8]string

func (*GetSensorHysteresisResponse) Format

func (res *GetSensorHysteresisResponse) Format() string

func (*GetSensorHysteresisResponse) Unpack

func (res *GetSensorHysteresisResponse) Unpack(msg []byte) error

type GetSensorReadingFactorsRequest

type GetSensorReadingFactorsRequest struct {
	SensorNumber uint8
	Reading      uint8
}

35.5 Get Sensor Reading Factors Command

func (*GetSensorReadingFactorsRequest) Command

func (req *GetSensorReadingFactorsRequest) Command() Command

func (*GetSensorReadingFactorsRequest) Pack

func (req *GetSensorReadingFactorsRequest) Pack() []byte

type GetSensorReadingFactorsResponse

type GetSensorReadingFactorsResponse struct {
	NextReading uint8

	ReadingFactors
}

func (*GetSensorReadingFactorsResponse) CompletionCodes

func (r *GetSensorReadingFactorsResponse) CompletionCodes() map[uint8]string

func (*GetSensorReadingFactorsResponse) Format

func (*GetSensorReadingFactorsResponse) Unpack

func (res *GetSensorReadingFactorsResponse) Unpack(msg []byte) error

type GetSensorReadingRequest

type GetSensorReadingRequest struct {
	SensorNumber uint8
}

35.14 Get Sensor Reading Command

Retrieve a raw sensor reading (current reading) from ipmb

func (*GetSensorReadingRequest) Command

func (req *GetSensorReadingRequest) Command() Command

func (*GetSensorReadingRequest) Pack

func (req *GetSensorReadingRequest) Pack() []byte

type GetSensorReadingResponse

type GetSensorReadingResponse struct {
	AnalogReading uint8 // reading byte. Ignore on read if sensor does not return an numeric (analog) reading

	EventMessagesDisabled  bool
	SensorScanningDisabled bool
	ReadingUnavailable     bool // Software should use this bit to avoid getting an incorrect status while the first sensor update is in progress.

	Above_UNR bool // at or above UNR threshold
	Above_UCR bool // at or above UCR threshold
	Above_UNC bool // at or above UNC threshold
	Below_LNR bool // at or below LNR threshold
	Below_LCR bool // at or below LCR threshold
	Below_LNC bool // at or below LNC threhsold

	// see 42.1 It is possible for a discrete sensor to have more than one state active at a time
	ActiveStates Mask_DiscreteEvent
	// contains filtered or unexported fields
}

func (*GetSensorReadingResponse) CompletionCodes

func (r *GetSensorReadingResponse) CompletionCodes() map[uint8]string

func (*GetSensorReadingResponse) Format

func (res *GetSensorReadingResponse) Format() string

func (*GetSensorReadingResponse) ThresholdStatus

func (r *GetSensorReadingResponse) ThresholdStatus() SensorThresholdStatus

func (*GetSensorReadingResponse) Unpack

func (res *GetSensorReadingResponse) Unpack(msg []byte) error

type GetSensorThresholdsRequest

type GetSensorThresholdsRequest struct {
	SensorNumber uint8
}

35.9 Get Sensor Thresholds Command

func (*GetSensorThresholdsRequest) Command

func (req *GetSensorThresholdsRequest) Command() Command

func (*GetSensorThresholdsRequest) Pack

func (req *GetSensorThresholdsRequest) Pack() []byte

type GetSensorThresholdsResponse

type GetSensorThresholdsResponse struct {
	// Readable thresholds mask
	UNR_Readable bool
	UCR_Readable bool
	UNC_Readable bool
	LNR_Readable bool
	LCR_Readable bool
	LNC_Readable bool

	// Threshold value
	LNC_Raw uint8
	LCR_Raw uint8
	LNR_Raw uint8
	UNC_Raw uint8
	UCR_Raw uint8
	UNR_Raw uint8
}

func (*GetSensorThresholdsResponse) CompletionCodes

func (r *GetSensorThresholdsResponse) CompletionCodes() map[uint8]string

func (*GetSensorThresholdsResponse) Format

func (res *GetSensorThresholdsResponse) Format() string

func (*GetSensorThresholdsResponse) Unpack

func (res *GetSensorThresholdsResponse) Unpack(msg []byte) error

type GetSensorTypeRequest

type GetSensorTypeRequest struct {
	SensorNumber uint8
}

GetSensorTypeRequest (31.2)

func (*GetSensorTypeRequest) Command

func (req *GetSensorTypeRequest) Command() Command

func (*GetSensorTypeRequest) Pack

func (req *GetSensorTypeRequest) Pack() []byte

type GetSensorTypeResponse

type GetSensorTypeResponse struct {
	SensorType       SensorType
	EventReadingType EventReadingType
}

func (*GetSensorTypeResponse) CompletionCodes

func (r *GetSensorTypeResponse) CompletionCodes() map[uint8]string

func (*GetSensorTypeResponse) Format

func (res *GetSensorTypeResponse) Format() string

func (*GetSensorTypeResponse) Unpack

func (res *GetSensorTypeResponse) Unpack(msg []byte) error

type GetSessionChallengeRequest

type GetSessionChallengeRequest struct {
	// Authentication Type for Challenge
	// indicating what type of authentication type the console wants to use.
	AuthType AuthType

	// Sixteen-bytes. All 0s for null user name (User 1)
	Username [16]byte
}

22.16

func (*GetSessionChallengeRequest) Command

func (req *GetSessionChallengeRequest) Command() Command

func (*GetSessionChallengeRequest) Pack

func (req *GetSessionChallengeRequest) Pack() []byte

type GetSessionChallengeResponse

type GetSessionChallengeResponse struct {
	TemporarySessionID uint32 // LS byte first
	Challenge          [16]byte
}

func (*GetSessionChallengeResponse) CompletionCodes

func (*GetSessionChallengeResponse) CompletionCodes() map[uint8]string

func (*GetSessionChallengeResponse) Format

func (res *GetSessionChallengeResponse) Format() string

func (*GetSessionChallengeResponse) Unpack

func (res *GetSessionChallengeResponse) Unpack(msg []byte) error

type GetSessionInfoRequest

type GetSessionInfoRequest struct {
	// 00h = Return info for active Session associated with Session this command was received over.
	// N = get info for Nth active Session
	// FEh = Look up Session info according to Session Handle passed in this request.
	// FFh = Look up Session info according to Session ID passed in this request.
	SessionIndex uint8

	SessionHandle uint8

	SessionID uint32
}

22.20 Get Session Info Command

func (*GetSessionInfoRequest) Command

func (req *GetSessionInfoRequest) Command() Command

func (*GetSessionInfoRequest) Pack

func (req *GetSessionInfoRequest) Pack() []byte

type GetSessionInfoResponse

type GetSessionInfoResponse struct {
	SessionHandle          uint8 // Session Handle presently assigned to active Session.
	PossbileActiveSessions uint8 // This value reflects the number of possible entries (slots) in the sessions table.
	CurrentActiveSessions  uint8 // Number of currently active sessions on all channels on this controller

	UserID                  uint8
	OperatingPrivilegeLevel PrivilegeLevel

	// [7:4] - Session protocol auxiliary data
	// For Channel Type = 802.3 LAN:
	// 0h = IPMI v1.5
	// 1h = IPMI v2.0/RMCP+
	AuxiliaryData uint8 // 4bits
	ChannelNumber uint8 // 4bits

	// if Channel Type = 802.3 LAN:
	RemoteConsoleIPAddr  net.IP           // IP Address of remote console (MS-byte first).
	RemoteConsoleMacAddr net.HardwareAddr // 6 bytes, MAC Address (MS-byte first)
	RemoteConsolePort    uint16           // Port Number of remote console (LS-byte first)

	// if Channel Type = asynch. serial/modem
	SessionChannelActivityType uint8
	DestinationSelector        uint8
	RemoteConsoleIPAddr_PPP    uint32 // If PPP connection: IP address of remote console. (MS-byte first) 00h, 00h, 00h, 00h otherwise.

	// if Channel Type = asynch. serial/modem and connection is PPP:
	RemoteConsolePort_PPP uint16
}

func (*GetSessionInfoResponse) CompletionCodes

func (res *GetSessionInfoResponse) CompletionCodes() map[uint8]string

func (*GetSessionInfoResponse) Format

func (res *GetSessionInfoResponse) Format() string

func (*GetSessionInfoResponse) Unpack

func (res *GetSessionInfoResponse) Unpack(msg []byte) error

type GetSystemBootOptionsRequest

type GetSystemBootOptionsRequest struct {
	ParameterSelector BootOptionParameterSelector
	SetSelector       uint8
	BlockSelector     uint8
}

28.13 Get System Boot Options Command

func (*GetSystemBootOptionsRequest) Command

func (req *GetSystemBootOptionsRequest) Command() Command

func (*GetSystemBootOptionsRequest) Pack

func (req *GetSystemBootOptionsRequest) Pack() []byte

type GetSystemBootOptionsResponse

type GetSystemBootOptionsResponse struct {
	ParameterVersion uint8

	// [7] - 1b = mark parameter invalid / locked
	// 0b = mark parameter valid / unlocked
	ParameterInValid bool
	// [6:0] - boot option parameter selector
	ParameterSelector BootOptionParameterSelector

	// parameterData is automatically parsed to BootOptionParameter
	BootOptionParameter *BootOptionParameter
	// contains filtered or unexported fields
}

func (*GetSystemBootOptionsResponse) CompletionCodes

func (res *GetSystemBootOptionsResponse) CompletionCodes() map[uint8]string

func (*GetSystemBootOptionsResponse) Format

func (res *GetSystemBootOptionsResponse) Format() string

func (*GetSystemBootOptionsResponse) Unpack

func (res *GetSystemBootOptionsResponse) Unpack(msg []byte) error

type GetSystemGUIDRequest

type GetSystemGUIDRequest struct {
}

22.14 Get System GUID Command

func (*GetSystemGUIDRequest) Command

func (req *GetSystemGUIDRequest) Command() Command

func (*GetSystemGUIDRequest) Pack

func (req *GetSystemGUIDRequest) Pack() []byte

type GetSystemGUIDResponse

type GetSystemGUIDResponse struct {
	GUID [16]byte
}

func (*GetSystemGUIDResponse) CompletionCodes

func (*GetSystemGUIDResponse) CompletionCodes() map[uint8]string

func (*GetSystemGUIDResponse) Format

func (res *GetSystemGUIDResponse) Format() string

func (*GetSystemGUIDResponse) Unpack

func (res *GetSystemGUIDResponse) Unpack(msg []byte) error

type GetSystemInterfaceCapabilitiesRequest

type GetSystemInterfaceCapabilitiesRequest struct {
	SystemInterfaceType SystemInterfaceType
}

22.9 Get System Interface Capabilities Command

func (*GetSystemInterfaceCapabilitiesRequest) Command

func (*GetSystemInterfaceCapabilitiesRequest) Pack

type GetSystemInterfaceCapabilitiesResponse

type GetSystemInterfaceCapabilitiesResponse struct {
	// For System Interface Type = SSIF
	TranscationSupportMask uint8
	PECSupported           bool
	SSIFVersion            uint8
	InputMessageSizeBytes  uint8
	OutputMessageSizeBytes uint8

	// For System Interface Type = KCS or SMIC
	SystemInterfaceVersion       uint8
	InputMaximumMessageSizeBytes uint8
}

func (*GetSystemInterfaceCapabilitiesResponse) CompletionCodes

func (*GetSystemInterfaceCapabilitiesResponse) CompletionCodes() map[uint8]string

func (*GetSystemInterfaceCapabilitiesResponse) Format

func (*GetSystemInterfaceCapabilitiesResponse) Unpack

type GetSystemRestartCauseRequest

type GetSystemRestartCauseRequest struct {
}

28.11 Get System Restart Cause Command

func (*GetSystemRestartCauseRequest) Command

func (req *GetSystemRestartCauseRequest) Command() Command

func (*GetSystemRestartCauseRequest) Pack

func (req *GetSystemRestartCauseRequest) Pack() []byte

type GetSystemRestartCauseResponse

type GetSystemRestartCauseResponse struct {
	SystemRestartCause SystemRestartCause
	ChannelNumber      uint8
}

func (*GetSystemRestartCauseResponse) CompletionCodes

func (res *GetSystemRestartCauseResponse) CompletionCodes() map[uint8]string

func (*GetSystemRestartCauseResponse) Format

func (res *GetSystemRestartCauseResponse) Format() string

func (*GetSystemRestartCauseResponse) Unpack

func (res *GetSystemRestartCauseResponse) Unpack(msg []byte) error

type GetUserAccessRequest

type GetUserAccessRequest struct {
	ChannelNumber uint8
	UserID        uint8
}

22.27 Get User Access Command

func (*GetUserAccessRequest) Command

func (req *GetUserAccessRequest) Command() Command

func (*GetUserAccessRequest) Pack

func (req *GetUserAccessRequest) Pack() []byte

type GetUserAccessResponse

type GetUserAccessResponse struct {
	// Maximum number of User IDs. 1-based. Count includes User 1. A value of 1
	// indicates only User 1 is supported.
	MaxUsersIDCount uint8

	// [7:6] - User ID Enable status (for IPMI v2.0 errata 3 and later implementations).
	// 00b = User ID enable status unspecified. (For backward compatibility
	// with pre-errata 3 implementations. IPMI errata 3 and later
	// implementations should return the 01b and 10b responses.)
	// 01b = User ID enabled via Set User Password command.
	// 10b = User ID disabled via Set User Password command.
	// 11b = reserved
	EnableStatus uint8

	// [5:0] - count of currently enabled user IDs on this channel (Indicates how
	// many User ID slots are presently in use.)
	EnabledUserIDsCount uint8

	// Count of User IDs with fixed names, including User 1 (1-based). Fixed names
	// in addition to User 1 are required to be associated with sequential user IDs
	// starting from User ID 2.
	FixedNameUseIDsCount uint8

	// [6] - 0b = user access available during call-in or callback direct connection
	//       1b = user access available only during callback connection
	CallbackOnly bool

	// [5] - 0b = user disabled for link authentication
	//       1b = user enabled for link authentication
	LinkAuthEnabled bool

	// [4] - 0b = user disabled for IPMI Messaging
	//       1b = user enabled for IPMI Messaging
	IPMIMessagingEnabled bool

	// [3:0] - User Privilege Limit for given Channel
	MaxPrivLevel PrivilegeLevel
}

func (*GetUserAccessResponse) CompletionCodes

func (res *GetUserAccessResponse) CompletionCodes() map[uint8]string

func (*GetUserAccessResponse) Format

func (res *GetUserAccessResponse) Format() string

func (*GetUserAccessResponse) Unpack

func (res *GetUserAccessResponse) Unpack(msg []byte) error

type GetUsernameRequest

type GetUsernameRequest struct {
	// [5:0] - User ID. 000000b = reserved. (User ID 1 is permanently associated with User 1, the null user name).
	UserID uint8
}

22.29 Get User Name Command

func (*GetUsernameRequest) Command

func (req *GetUsernameRequest) Command() Command

func (*GetUsernameRequest) Pack

func (req *GetUsernameRequest) Pack() []byte

type GetUsernameResponse

type GetUsernameResponse struct {
	Username string
}

func (*GetUsernameResponse) CompletionCodes

func (res *GetUsernameResponse) CompletionCodes() map[uint8]string

func (*GetUsernameResponse) Format

func (res *GetUsernameResponse) Format() string

func (*GetUsernameResponse) Unpack

func (res *GetUsernameResponse) Unpack(msg []byte) error

type GetWatchdogTimerRequest

type GetWatchdogTimerRequest struct {
}

27.7 Get Watchdog Timer Command

func (*GetWatchdogTimerRequest) Command

func (req *GetWatchdogTimerRequest) Command() Command

func (*GetWatchdogTimerRequest) Pack

func (req *GetWatchdogTimerRequest) Pack() []byte

type GetWatchdogTimerResponse

type GetWatchdogTimerResponse struct {
	DontLog        bool
	TimerIsStarted bool
	TimerUse       TimerUse

	PreTimeoutInterrupt  PreTimeoutInterrupt
	TimeoutAction        TimeoutAction
	PreTimeoutIntevalSec uint8

	ExpirationFlags  uint8
	InitialCountdown uint16
	PresentCountdown uint16
}

func (*GetWatchdogTimerResponse) CompletionCodes

func (res *GetWatchdogTimerResponse) CompletionCodes() map[uint8]string

func (*GetWatchdogTimerResponse) Format

func (res *GetWatchdogTimerResponse) Format() string

func (*GetWatchdogTimerResponse) Unpack

func (res *GetWatchdogTimerResponse) Unpack(msg []byte) error

type IP6Support

type IP6Support struct {
	// Implementation supports IPv6 Destination Addresses for LAN Alerting.
	SupportIP6AlertDestination bool
	//  Implementation can be configured to use both IPv4 and IPv6 addresses simultaneously
	CanUseBothIP4AndIP6 bool
	// Implementation can be configured to use IPv6 addresses only.
	CanUseIP6Only bool
}

type IPAddressSource

type IPAddressSource uint8
const (
	IPAddressSourceUnspecified IPAddressSource = 0x00
	IPAddressSourceStatic      IPAddressSource = 0x01
	IPAddressSourceDHCP        IPAddressSource = 0x02
	IPAddressSourceBIOS        IPAddressSource = 0x03
	IPAddressSourceOther       IPAddressSource = 0x04
)

func (IPAddressSource) String

func (i IPAddressSource) String() string

type IPHeaderParams

type IPHeaderParams struct {
	TTL        uint8
	Flags      uint8
	Precedence uint8
	TOS        uint8
}

type IPMIRequest

type IPMIRequest struct {
	// SlaveAddress or SoftwareID
	// Responder's Slave Address. 1 byte. LS bit is 0 for Slave Addresses and 1 for Software IDs. Upper 7-bits hold Slave Address or Software ID, respectively. This byte is always 20h when the BMC is the responder.
	ResponderAddr uint8 // SlaveAddress or SoftwareID

	// The lower 2-bits of the netFn byte identify the logical unit number, which provides further sub-addressing within the target node.
	NetFn        NetFn // (even) / rsLUN
	ResponderLUN uint8 // lower 2 bits

	// Checksum1 is filled by calling ComputeChecksum method
	Checksum1 uint8

	// SlaveAddress or SoftwareID
	// Requester's Address. 1 byte. LS bit is 0 for Slave Addresses and 1 for Software IDs. Upper 7-bits hold Slave Address or Software ID, respectively. This byte is always 20h when the BMC is the requester.
	RequesterAddr uint8 // rqSA

	RequesterSequence uint8 // rqSeq, occupies the highest 6 bits, (so should left shit 2 bits)
	RequesterLUN      uint8 // rqLUN, occupies the lowest 2 bits

	Command uint8 // Command ID

	// Command Request Body Data defined by each command.
	CommandData []byte // optional, 0 or more

	// Checksum2 is filled by calling ComputeChecksum method
	Checksum2 uint8
}

13.8 IPMI LAN Message Format

func (*IPMIRequest) ComputeChecksum

func (req *IPMIRequest) ComputeChecksum()

func (*IPMIRequest) Pack

func (req *IPMIRequest) Pack() []byte

type IPMIResponse

type IPMIResponse struct {
	// Requester's Address. 1 byte. LS bit is 0 for Slave Addresses and 1 for Software IDs. Upper 7-bits hold Slave Address or Software ID, respectively. This byte is always 20h when the BMC is the requester.
	RequesterAddr uint8 // SlaveAddress or SoftwareID

	// Network Function code
	// The lower 2-bits of the netFn byte identify the logical unit number, which provides further sub-addressing within the target node.
	NetFn NetFn // (odd) higher 6 bits
	// Requester's LUN
	RequestLUN uint8 // lower 2 bits

	// 8-bit checksum algorithm: Initialize checksum to 0. For each byte, checksum = (checksum + byte) modulo 256. Then checksum = - checksum. When the checksum and the bytes are added together, modulo 256, the result should be 0.
	Checksum1 uint8

	// Responder's Slave Address. 1 byte. LS bit is 0 for Slave Addresses and 1 for Software IDs. Upper 7-bits hold Slave Address or Software ID, respectively. This byte is always 20h when the BMC is the responder.
	ResponderAddr uint8 // // SlaveAddress or SoftwareID

	// Sequence number. This field is used to verify that a response is for a particular instance of a request. Refer to [IPMB] for additional information on use and operation of the Seq field.
	RequesterSequence uint8 // higher 6 bits
	ResponderLUN      uint8 // lower 2 bits

	Command uint8

	// Completion code returned in the response to indicated success/failure status of the request.
	CompletionCode uint8

	// Response Data
	Data []byte // optional

	Checksum2 uint8
}

IPMIResponse repsent IPMI PayloadType msg response

func (*IPMIResponse) Unpack

func (res *IPMIResponse) Unpack(msg []byte) error

type IntegrityAlg

type IntegrityAlg uint8

13.28.4

const (
	IntegrityAlg_None            IntegrityAlg = 0x00 // Mandatory
	IntegrityAlg_HMAC_SHA1_96    IntegrityAlg = 0x01 // Mandatory
	IntegrityAlg_HMAC_MD5_128    IntegrityAlg = 0x02 // Optional
	IntegrityAlg_MD5_128         IntegrityAlg = 0x03 // Optional
	IntegrityAlg_HMAC_SHA256_128 IntegrityAlg = 0x04 // Optional
)

func (IntegrityAlg) String

func (integrityAlg IntegrityAlg) String() string

type IntegrityPayload

type IntegrityPayload struct {
	// 01h = integrity algorithm
	PayloadType   uint8
	PayloadLength uint8
	IntegrityAlg  uint8
}

func (*IntegrityPayload) Pack

func (p *IntegrityPayload) Pack() []byte

func (*IntegrityPayload) Unpack

func (p *IntegrityPayload) Unpack(msg []byte) error

type Interface

type Interface string

type InterruptType

type InterruptType uint8

func (InterruptType) String

func (typ InterruptType) String() string

type LUN

type LUN uint8

type LUNSupport

type LUNSupport uint8

func (LUNSupport) String

func (l LUNSupport) String() string

type LanConfig

type LanConfig struct {
	SetInProgress                 SetInProgress
	AuthTypeSupport               AuthTypeSupport
	AuthTypeEnables               AuthTypeEnables
	IP                            net.IP
	IPSource                      IPAddressSource
	MAC                           net.HardwareAddr
	SubnetMask                    net.IP
	IPHeaderParams                IPHeaderParams
	PrimaryRMCPPort               uint16
	SecondaryRMCPPort             uint16
	ARPControl                    ARPControl
	GratuitousARPIntervalMilliSec int32
	DefaultGatewayIP              net.IP
	DefaultGatewayMAC             net.HardwareAddr
	BackupGatewayIP               net.IP
	BackupGatewayMAC              net.HardwareAddr
	CommunityString               CommunityString
	AlertDestinationsNumber       uint8
	AlertDestinationType          AlertDestinationType
	AlertDestinationAddress       AlertDestinationAddress
	VLANEnabled                   bool
	VLANID                        uint16
	VLANPriority                  uint8
	RMCPCipherSuitesCount         uint8
	RMCPCipherSuiteEntries        []CipherSuiteID
	RMCPCipherSuitesMaxPrivLevel  []PrivilegeLevel
	AlertDestinationVLAN          AlertDestinationVLAN
	BadPasswordThreshold          BadPasswordThreshold

	IP6Support IP6Support
}

func (*LanConfig) Format

func (lanConfig *LanConfig) Format() string

type LanParam

type LanParam struct {
	Selector LanParamSelector
	DataSize uint8
	Name     string
}

type LanParamSelector

type LanParamSelector uint8

Table 23-4, LAN Configuration Parameters Parameter selector

const (
	LanParam_SetInProgress                    LanParamSelector = 0
	LanParam_AuthTypeSupported                LanParamSelector = 1
	LanParam_AuthTypeEnables                  LanParamSelector = 2
	LanParam_IP                               LanParamSelector = 3
	LanParam_IPSource                         LanParamSelector = 4
	LanParam_MAC                              LanParamSelector = 5 // read only
	LanParam_SubnetMask                       LanParamSelector = 6
	LanParam_IPv4HeaderParams                 LanParamSelector = 7
	LanParam_PrimaryRMCPPort                  LanParamSelector = 8
	LanParam_SecondaryRMCPPort                LanParamSelector = 9
	LanParam_ARPControl                       LanParamSelector = 10
	LanParam_GratuituousARPInterval           LanParamSelector = 11
	LanParam_DefaultGatewayIP                 LanParamSelector = 12
	LanParam_DefaultGatewayMAC                LanParamSelector = 13
	LanParam_BackupGatewayIP                  LanParamSelector = 14
	LanParam_BackupGatewayMAC                 LanParamSelector = 15
	LanParam_CommunityString                  LanParamSelector = 16
	LanParam_AlertDestinationsNumber          LanParamSelector = 17
	LanParam_AlertDestinationType             LanParamSelector = 18
	LanParam_AlertDestinationAddress          LanParamSelector = 19
	LanParam_VLANID                           LanParamSelector = 20
	LanParam_VLANPriority                     LanParamSelector = 21
	LanParam_CipherSuiteEntrySupport          LanParamSelector = 22
	LanParam_CipherSuiteEntries               LanParamSelector = 23
	LanParam_CihperSuitePrivilegeLevels       LanParamSelector = 24
	LanParam_AlertDestinationVLAN             LanParamSelector = 25 // read only
	LanParam_BadPassordThreshold              LanParamSelector = 26
	LanParam_IP6Support                       LanParamSelector = 50
	LanParam_IP6Enables                       LanParamSelector = 51
	LanParam_IP6StaticTrafficClass            LanParamSelector = 52
	LanParam_IP6StaticHopLimit                LanParamSelector = 53
	LanParam_IP6FlowLabel                     LanParamSelector = 54
	LanParam_IP6Status                        LanParamSelector = 55
	LanParam_IP6StaticAddr                    LanParamSelector = 56
	LanParam_IP6DHCP6StaticDUIDLength         LanParamSelector = 57
	LanParam_IP6DHCP6StaticDUIDs              LanParamSelector = 58
	LanParam_IP6DynamicAddr                   LanParamSelector = 59
	LanParam_IP6DHCP6DynamicDUIDLenth         LanParamSelector = 60
	LanParam_IP6DHCP6DyanmicDUIDs             LanParamSelector = 61
	LanParam_IP6DHCP6TimingConfigSupport      LanParamSelector = 62
	LanParam_IP6DHCP6TimingConfig             LanParamSelector = 63
	LanParam_IP6RouterAddressConfigControl    LanParamSelector = 64
	LanParam_IP6StaticRouter1IP               LanParamSelector = 65
	LanParam_IP6StaticRouter1MAC              LanParamSelector = 66
	LanParam_IP6StaticRouter1PrefixLength     LanParamSelector = 67
	LanParam_IP6StaticRouter1PrefixValue      LanParamSelector = 68
	LanParam_IP6StaticRouter2IP               LanParamSelector = 69
	LanParam_IP6StaticRouter2MAC              LanParamSelector = 70
	LanParam_IP6StaticRouter2PrefixLength     LanParamSelector = 71
	LanParam_IP6StaticRouter2PrefixValue      LanParamSelector = 72
	LanParam_IP6DynamicRouterSetsNumber       LanParamSelector = 73 // read only
	LanParam_IP6DynamicRouterIP               LanParamSelector = 74
	LanParam_IP6DynamicRouterMAC              LanParamSelector = 75
	LanParam_IP6DynamicRouterPrefixLength     LanParamSelector = 76
	LanParam_IP6DynamicRouterPrefixValue      LanParamSelector = 77
	LanParam_IP6DynamicRouterReceivedHopLimit LanParamSelector = 78 // read only
	LanParam_IP6NDSLAACTimingConfigSupport    LanParamSelector = 79 // read only
	LanParam_IP6NDSLAACTiming                 LanParamSelector = 80
)

func (LanParamSelector) String

func (lanParam LanParamSelector) String() string

type LinearizationFunc

type LinearizationFunc uint8

LinearizationFunc is linearization function used in "Sensor Reading Conversion Formula" 线性化函数

const (
	LinearizationFunc_Linear LinearizationFunc = 0x00
	LinearizationFunc_LN     LinearizationFunc = 0x01
	LinearizationFunc_LOG10  LinearizationFunc = 0x02
	LinearizationFunc_LOG2   LinearizationFunc = 0x03
	LinearizationFunc_E      LinearizationFunc = 0x04
	LinearizationFunc_EXP10  LinearizationFunc = 0x05
	LinearizationFunc_EXP2   LinearizationFunc = 0x06
	LinearizationFunc_1X     LinearizationFunc = 0x07
	LinearizationFunc_SQR    LinearizationFunc = 0x08
	LinearizationFunc_CUBE   LinearizationFunc = 0x09
	LinearizationFunc_SQRT   LinearizationFunc = 0x0a
	LinearizationFunc_CUBERT LinearizationFunc = 0x0b

	// 70h = non-linear.
	// 71h-7Fh = non-linear OEM
	LinearizationFunc_NonLinear LinearizationFunc = 0x70
)

func (LinearizationFunc) Apply

func (l LinearizationFunc) Apply(x float64) float64

Apply applies linearization func (itself) to the input value and returns the result.

func (LinearizationFunc) IsNonLinear

func (l LinearizationFunc) IsNonLinear() bool

func (LinearizationFunc) String

func (l LinearizationFunc) String() string

type ManagementAccessSubRecordType

type ManagementAccessSubRecordType uint8

func (ManagementAccessSubRecordType) String

type ManufacturingTestOnRequest

type ManufacturingTestOnRequest struct {
}

20.4 20.5 Manufacturing Test On Command

func (*ManufacturingTestOnRequest) Command

func (req *ManufacturingTestOnRequest) Command() Command

func (*ManufacturingTestOnRequest) Pack

func (req *ManufacturingTestOnRequest) Pack() []byte

type ManufacturingTestOnResponse

type ManufacturingTestOnResponse struct {
}

func (*ManufacturingTestOnResponse) CompletionCodes

func (res *ManufacturingTestOnResponse) CompletionCodes() map[uint8]string

func (*ManufacturingTestOnResponse) Format

func (res *ManufacturingTestOnResponse) Format() string

func (*ManufacturingTestOnResponse) Unpack

func (res *ManufacturingTestOnResponse) Unpack(msg []byte) error

type Mask

type Mask struct {
	Threshold Mask_Thresholds
	Discrete  Mask_Discrete
}

Mask holds

  • Assertion Event Mask / Lower Threshold Reading Mask
  • Deassertion Event Mask / Upper Threshold Reading Mask
  • Discrete Reading Mask / Settable Threshold Mask, Readable Threshold Mask

Used in Full and Compact SDR

func (*Mask) ParseAssertLower

func (mask *Mask) ParseAssertLower(b uint16)

func (*Mask) ParseDeassertUpper

func (mask *Mask) ParseDeassertUpper(b uint16)

func (*Mask) ParseReading

func (mask *Mask) ParseReading(b uint16)

func (*Mask) ReadableThresholds

func (mask *Mask) ReadableThresholds() SensorThresholdTypes

ReadableThresholds returns all readable thresholds for the sensor.

func (*Mask) SettableThresholds

func (mask *Mask) SettableThresholds() SensorThresholdTypes

func (*Mask) StatusReturnedThresholds

func (mask *Mask) StatusReturnedThresholds() SensorThresholdTypes

StatusReturnedThresholds returns all supported thresholds comparison status via the Get Sensor Reading command.

func (*Mask) SupportedThresholdEvents

func (mask *Mask) SupportedThresholdEvents() SensorEvents

type Mask_Discrete

type Mask_Discrete struct {
	// Assertion Event Mask for non-threshold based sensors, true means assertion event can be generated for this state
	Assert Mask_DiscreteEvent
	// Deassertion Event Mask for non-threshold based sensors, true means deassertion event can be generated for this state
	Deassert Mask_DiscreteEvent
	// Reading Mask for non-threshold based sensors, true means discrete state can be returned by this sensor
	Reading Mask_DiscreteEvent
}

type Mask_DiscreteEvent

type Mask_DiscreteEvent struct {
	State_0  bool
	State_1  bool
	State_2  bool
	State_3  bool
	State_4  bool
	State_5  bool
	State_6  bool
	State_7  bool
	State_8  bool
	State_9  bool
	State_10 bool
	State_11 bool
	State_12 bool
	State_13 bool
	State_14 bool
}

func (Mask_DiscreteEvent) TrueEvents

func (mask Mask_DiscreteEvent) TrueEvents() []int

type Mask_Threshold

type Mask_Threshold struct {
	StatusReturned bool // Indicates whether this threshold comparison status is returned via the Get Sensor Reading command.
	Settable       bool
	Readable       bool
	High_Assert    bool
	Low_Assert     bool
	High_Deassert  bool
	Low_Deassert   bool
}

Mask_Threshold holds masks for a specific threshold type.

type Mask_Thresholds

type Mask_Thresholds struct {
	LNR Mask_Threshold
	LCR Mask_Threshold
	LNC Mask_Threshold
	UNR Mask_Threshold
	UCR Mask_Threshold
	UNC Mask_Threshold
}

Mask_Thresholds holds masks for all threshold types.

func (*Mask_Thresholds) IsThresholdReadable

func (mask *Mask_Thresholds) IsThresholdReadable(thresholdType SensorThresholdType) bool

type MasterWriteReadRequest

type MasterWriteReadRequest struct {
	ChannelNumber    uint8
	BusID            uint8
	BusTypeIsPrivate bool

	SlaveAddress uint8
	ReadCount    uint8
	Data         []byte // Data to write. This command should support at least 35 bytes of write data
}

22.11 Master Write-Read Command

func (*MasterWriteReadRequest) Command

func (req *MasterWriteReadRequest) Command() Command

func (*MasterWriteReadRequest) Pack

func (req *MasterWriteReadRequest) Pack() []byte

type MasterWriteReadResponse

type MasterWriteReadResponse struct {
	// Bytes read from specified slave address. This field will be absent if the read count is 0. The controller terminates the I2C transaction with a STOP condition after reading the requested number of bytes.
	Data []byte
}

func (*MasterWriteReadResponse) CompletionCodes

func (*MasterWriteReadResponse) CompletionCodes() map[uint8]string

func (*MasterWriteReadResponse) Format

func (res *MasterWriteReadResponse) Format() string

func (*MasterWriteReadResponse) Unpack

func (res *MasterWriteReadResponse) Unpack(msg []byte) error

type MessageClass

type MessageClass uint8

func (MessageClass) NormalACKFlag

func (mc MessageClass) NormalACKFlag() bool

type MessageType

type MessageType uint8
const (
	MessageTypeUndefined MessageType = 0x00
	MessageTypePing      MessageType = 0x80
	MessageTypeRMCPACK   MessageType = (0x80 | 6)
	MessageTypeASF       MessageType = (0x00 | 6)
	MessageTypeIPMI      MessageType = (0x00 | 7)
	MessageTypeOEM       MessageType = (0x00 | 8)
)

type NetFn

type NetFn uint8

NetFn is Network Function

const (
	NetFnChassisRequest      NetFn = 0x00
	NetFnChassisResponse     NetFn = 0x01
	NetFnBridgeRequest       NetFn = 0x02
	NetFnBridgeResponse      NetFn = 0x03
	NetFnSensorEventRequest  NetFn = 0x04
	NetFnSensorEventResponse NetFn = 0x05
	NetFnAppRequest          NetFn = 0x06
	NetFnAppResponse         NetFn = 0x07
	NetFnFirmwareRequest     NetFn = 0x08
	NetFnFirmwareResponse    NetFn = 0x09
	NetFnStorageRequest      NetFn = 0x0a
	NetFnStorageResponse     NetFn = 0x0b
	NetFnTransportRequest    NetFn = 0x0c
	NetFnTransportResponse   NetFn = 0x0d

	NetFnGroupExtensionRequest  NetFn = 0x2c
	NetFnGroupExtensionResponse NetFn = 0x2d
	NetFnOEMGroupRequest        NetFn = 0x2e
	NetFnOEMGroupResponse       NetFn = 0x2f

	NetFnOEMSupermicroRequest NetFn = 0x30
)

Network Function Codes, section 5.1 Table 5 Even NetFn values are used for requests to the BMC, and odd NetFn values are returned in responses from the BMC.

six-bit field identifying the function, so total 64 NetFn (32 NetFn pairs)

type OEM

type OEM uint32

OEM represents Manufacturer ID, that is IANA Private Enterprise Number

func (OEM) String

func (oem OEM) String() string

type OpenSessionRequest

type OpenSessionRequest struct {
	MessageTag                     uint8
	RequestedMaximumPrivilegeLevel PrivilegeLevel
	RemoteConsoleSessionID         uint32
	AuthenticationPayload
	IntegrityPayload
	ConfidentialityPayload
}

13.17 RMCP+ Open Session Request

func (*OpenSessionRequest) Command

func (req *OpenSessionRequest) Command() Command

func (*OpenSessionRequest) Pack

func (req *OpenSessionRequest) Pack() []byte

type OpenSessionResponse

type OpenSessionResponse struct {
	MessageTag             uint8
	RmcpStatusCode         uint8
	MaximumPrivilegeLevel  uint8
	RemoteConsoleSessionID uint32
	ManagedSystemSessionID uint32
	AuthenticationPayload
	IntegrityPayload
	ConfidentialityPayload
}

13.18 RMCP+ Open Session Response

func (*OpenSessionResponse) CompletionCodes

func (*OpenSessionResponse) CompletionCodes() map[uint8]string

func (*OpenSessionResponse) Format

func (res *OpenSessionResponse) Format() string

func (*OpenSessionResponse) Unpack

func (res *OpenSessionResponse) Unpack(data []byte) error

type PasswordOperation

type PasswordOperation uint8
const (
	PasswordOperationDisableUser  PasswordOperation = 0x00
	PasswordOperationEnableUser   PasswordOperation = 0x01
	PasswordOperationSetPassword  PasswordOperation = 0x02
	PasswordOperationTestPassword PasswordOperation = 0x03
)

type PayloadType

type PayloadType uint8

13.27.3 The Get Channel Payload Support command returns which standard payload type numbers and OEM payload type handles are available on a given channel of a BMC.

const (
	PayloadTypeIPMI PayloadType = 0x00
	PayloadTypeSOL  PayloadType = 0x01
	PayloadTypeOEM  PayloadType = 0x02

	PayloadTypeRmcpOpenSessionRequest  PayloadType = 0x10
	PayloadTypeRmcpOpenSessionResponse PayloadType = 0x11
	PayloadTypeRAKPMessage1            PayloadType = 0x12
	PayloadTypeRAKPMessage2            PayloadType = 0x13
	PayloadTypeRAKPMessage3            PayloadType = 0x14
	PayloadTypeRAKPMessage4            PayloadType = 0x15

	PayloadTypeOEM0 PayloadType = 0x20
	PayloadTypeOEM1 PayloadType = 0x21
	PayloadTypeOEM2 PayloadType = 0x22
	PayloadTypeOEM3 PayloadType = 0x23
	PayloadTypeOEM4 PayloadType = 0x24
	PayloadTypeOEM5 PayloadType = 0x25
	PayloadTypeOEM6 PayloadType = 0x26
	PayloadTypeOEM7 PayloadType = 0x27
)

type PlatformEventMessageRequest

type PlatformEventMessageRequest struct {
	// The Generator ID field is a required element of an Event Request Message.
	// This field identifies the device that has generated the Event Message.
	// This is the 7-bit Requester's Slave Address (RqSA) and 2-bit Requester's LUN (RqLUN)
	// if the message was received from the IPMB, or the 7-bit System Software ID
	// if the message was received from system software.
	//
	// For IPMB messages, this field is equated to the Requester's Slave Address and LUN fields.
	// Thus, the Generator ID information is not carried in the data field of an IPMB request message.
	//
	// For 'system side' interfaces, it is not as useful or appropriate to 'overlay' the Generator ID field
	// with the message source address information, and so it is specified as being carried in the data field of the request.
	GeneratorID  uint8
	EvMRev       uint8
	SensorType   uint8
	SensorNumber uint8
	EventDir     EventDir
	EventType    EventReadingType
	EventData    EventData
}

29.3 Platform Event Message Command

func (*PlatformEventMessageRequest) Command

func (req *PlatformEventMessageRequest) Command() Command

func (*PlatformEventMessageRequest) Pack

func (req *PlatformEventMessageRequest) Pack() []byte

type PlatformEventMessageResponse

type PlatformEventMessageResponse struct {
}

func (*PlatformEventMessageResponse) CompletionCodes

func (res *PlatformEventMessageResponse) CompletionCodes() map[uint8]string

func (*PlatformEventMessageResponse) Format

func (res *PlatformEventMessageResponse) Format() string

func (*PlatformEventMessageResponse) Unpack

func (res *PlatformEventMessageResponse) Unpack(msg []byte) error

type PowerRestorePolicy

type PowerRestorePolicy uint8

PowerRestorePolicy 通电开机策略

const (
	PowerRestorePolicyAlwaysOff PowerRestorePolicy = 0 // 保持下电(关机)
	PowerRestorePolicyPrevious  PowerRestorePolicy = 1 // 与之前保持一致(恢复断电前状态)
	PowerRestorePolicyAlwaysOn  PowerRestorePolicy = 2 // 保持上电(开机)
)

func (PowerRestorePolicy) String

func (p PowerRestorePolicy) String() string

type PreTimeoutInterrupt

type PreTimeoutInterrupt uint8
const (
	PreTimeoutInterruptNone      PreTimeoutInterrupt = 0x00
	PreTimeoutInterruptSMI       PreTimeoutInterrupt = 0x01
	PreTimeoutInterruptNMI       PreTimeoutInterrupt = 0x02
	PreTimeoutInterruptMessaging PreTimeoutInterrupt = 0x03
)

func (PreTimeoutInterrupt) String

func (t PreTimeoutInterrupt) String() string

type PrivilegeLevel

type PrivilegeLevel uint8

6.8 Channel Privilege Levels

const (
	PrivilegeLevelUnspecified   PrivilegeLevel = 0x00
	PrivilegeLevelCallback      PrivilegeLevel = 0x01
	PrivilegeLevelUser          PrivilegeLevel = 0x02
	PrivilegeLevelOperator      PrivilegeLevel = 0x03
	PrivilegeLevelAdministrator PrivilegeLevel = 0x04
	PrivilegeLevelOEM           PrivilegeLevel = 0x05
)

func (PrivilegeLevel) Short

func (l PrivilegeLevel) Short() string

func (PrivilegeLevel) String

func (l PrivilegeLevel) String() string

type RAKPMessage1

type RAKPMessage1 struct {
	MessageTag uint8

	// The Managed System's Session ID for this Session, returned by the Managed System on the
	// previous RMCP+ Open Session Response message.
	ManagedSystemSessionID uint32

	// 16 bytes
	RemoteConsoleRandomNumber [16]byte

	// bit 4
	// 0b = Username/Privilege lookup.
	// 1b = Name-only lookup.
	NameOnlyLookup                 bool
	RequestedMaximumPrivilegeLevel PrivilegeLevel

	UsernameLength uint8
	Username       []byte
}

13.20 RAKP Message 1

func (*RAKPMessage1) Command

func (req *RAKPMessage1) Command() Command

func (*RAKPMessage1) Pack

func (r *RAKPMessage1) Pack() []byte

func (*RAKPMessage1) Role

func (r *RAKPMessage1) Role() uint8

the combination of RequestedMaximumPrivilegeLevel and NameOnlyLookup field The whole byte should be stored to client Session for computing auth code of rakp2

type RAKPMessage2

type RAKPMessage2 struct {
	MessageTag uint8

	RmcpStatusCode uint8

	// The Remote Console Session ID specified by the RMCP+ Open Session Request message associated with this response.
	RemoteConsoleSessionID uint32

	// Random number generated/selected by the managed system.
	ManagedSystemRandomNumber [16]byte

	// The Globally Unique ID (GUID) of the Managed System.
	// This value is typically specified by the client system's SMBIOS implementation. See
	// 22.14, Get System GUID Command, for additional information
	ManagedSystemGUID [16]byte

	// An integrity check value over the relevant items specified by the RAKP algorithm for RAKP Message 2.
	// The size of this field depends on the specific Authentication Algorithm
	// This field may be 0-bytes (absent) for some algorithms (e.g. RAKP-none).
	//
	// see 13.31 for how the managed system generate this HMAC
	KeyExchangeAuthenticationCode []byte
	// contains filtered or unexported fields
}

func (*RAKPMessage2) CompletionCodes

func (*RAKPMessage2) CompletionCodes() map[uint8]string

func (*RAKPMessage2) Format

func (res *RAKPMessage2) Format() string

func (*RAKPMessage2) Unpack

func (res *RAKPMessage2) Unpack(msg []byte) error

type RAKPMessage3

type RAKPMessage3 struct {
	// Selected by remote console. Used by remote console to help match
	// responses up with requests.
	MessageTag uint8

	// Identifies the status of the previous message.
	RmcpStatusCode uint8

	// The Managed System's Session ID for this Session, returned by the managed system on the previous RMCP+ Open Session Response message.
	ManagedSystemSessionID uint32

	// An integrity check value over the relevant items specified by the RAKP
	// authentication algorithm identified in RAKP Message 1.
	// The size of this field depends on the specific authentication algorithm.
	//
	// This field may be 0 bytes (absent) for some algorithms (e.g. RAKP-none).
	KeyExchangeAuthenticationCode []byte
}

13.22 RAKP Message 3

func (*RAKPMessage3) Command

func (req *RAKPMessage3) Command() Command

func (*RAKPMessage3) Pack

func (req *RAKPMessage3) Pack() []byte

type RAKPMessage4

type RAKPMessage4 struct {
	MessageTag uint8

	RmcpStatusCode uint8

	MgmtConsoleSessionID uint32

	// An integrity check value over the relevant items specified by
	// the RAKP authentication algorithm that was identified in RAKP Message 1.
	//
	// The size of this field depends on the specific authentication algorithm.
	//
	// For example, the RAKP-HMAC-SHA1 specifies that an HMACSHA1-96 algorithm be used for calculating this field.
	// See Section 13.28
	// Authentication, Integrity, and Confidentiality Algorithm Numbers for info on
	// the algorithm to be used for this field.
	//
	// This field may be 0 bytes (absent) for some authentication algorithms (e.g. RAKP-none)
	IntegrityCheckValue []byte
	// contains filtered or unexported fields
}

func (*RAKPMessage4) CompletionCodes

func (*RAKPMessage4) CompletionCodes() map[uint8]string

func (*RAKPMessage4) Format

func (res *RAKPMessage4) Format() string

func (*RAKPMessage4) Unpack

func (res *RAKPMessage4) Unpack(msg []byte) error

type RakpStatus

type RakpStatus uint8

13.24 RMCP+ and RAKP Message Status Codes

const (
	RakpStatusNoErrors                        RakpStatus = 0x00
	RakpStatusInsufficientResourcesForSession RakpStatus = 0x01
	RakpStatusInvalidSessionID                RakpStatus = 0x02
	RakpStatusInvalidPayloadType              RakpStatus = 0x03
	RakpStatusInvalidAuthAlgorithm            RakpStatus = 0x04
	RakpStatusInvalidIntegrityAlgorithm       RakpStatus = 0x05
	RakpStatusNoMatchingAuthenticationPayload RakpStatus = 0x06
	RakpStatusNoMatchingIntegrityPayload      RakpStatus = 0x07
	RakpStatusInactiveSessionID               RakpStatus = 0x08
	RakpStatusInvalidRole                     RakpStatus = 0x09
	RakpStatusUnauthorizedRoleForRequested    RakpStatus = 0x0a
	RakpStatusInsufficientResourcesForRole    RakpStatus = 0x0b
	RakpStatusInvalidNameLength               RakpStatus = 0x0c
	RakpStatusUnauthorizedName                RakpStatus = 0x0d
	RakpStatusUnauthorizedGUID                RakpStatus = 0x0e
	RakpStatusInvalidIntegrityCheckValue      RakpStatus = 0x0f
	RakpStatusInvalidConfidentialityAlgorithm RakpStatus = 0x10
	RakpStatusNoCipherSuiteMatch              RakpStatus = 0x11
	RakpStatusIllegalParameter                RakpStatus = 0x12
)

func (RakpStatus) String

func (r RakpStatus) String() string

type ReadEventMessageBufferRequest

type ReadEventMessageBufferRequest struct {
}

22.8 Read Event Message Buffer Command

func (ReadEventMessageBufferRequest) Command

func (req ReadEventMessageBufferRequest) Command() Command

func (*ReadEventMessageBufferRequest) Pack

func (req *ReadEventMessageBufferRequest) Pack() []byte

type ReadEventMessageBufferResponse

type ReadEventMessageBufferResponse struct {
	// 16 bytes of data in SEL Record format
	MessageData [16]byte
}

func (*ReadEventMessageBufferResponse) CompletionCodes

func (*ReadEventMessageBufferResponse) CompletionCodes() map[uint8]string

func (*ReadEventMessageBufferResponse) Format

func (res *ReadEventMessageBufferResponse) Format() string

func (*ReadEventMessageBufferResponse) Unpack

func (res *ReadEventMessageBufferResponse) Unpack(msg []byte) error

type ReadFRUDataRequest

type ReadFRUDataRequest struct {
	FRUDeviceID uint8
	ReadOffset  uint16
	ReadCount   uint8
}

34.2 Read FRU Data Command

func (*ReadFRUDataRequest) Command

func (req *ReadFRUDataRequest) Command() Command

func (*ReadFRUDataRequest) Pack

func (req *ReadFRUDataRequest) Pack() []byte

type ReadFRUDataResponse

type ReadFRUDataResponse struct {
	CountReturned uint8
	Data          []byte
}

func (*ReadFRUDataResponse) CompletionCodes

func (r *ReadFRUDataResponse) CompletionCodes() map[uint8]string

func (*ReadFRUDataResponse) Format

func (res *ReadFRUDataResponse) Format() string

func (*ReadFRUDataResponse) Unpack

func (res *ReadFRUDataResponse) Unpack(msg []byte) error

type ReadingFactors

type ReadingFactors struct {
	M int16 // 10 bits used

	// in +/- ½ raw counts
	Tolerance uint8 // 6 bits used

	B int16 // 10 bits used

	// Unsigned, 10-bit Basic Sensor Accuracy in 1/100 percent scaled up by unsigned Accuracy exponent.
	Accuracy uint16 // 10 bits, unsigned

	Accuracy_Exp uint8 // 2 bits, unsigned

	// [7:4] - R (result) exponent 4 bits, 2's complement, signed
	// [3:0] - B exponent 4 bits, 2's complement, signed
	R_Exp int8 // 4 bits, signed, also called K2
	B_Exp int8 // 4 bits, signed, also called K1
}

ReadingFactors is used in "Sensor Reading Conversion Formula" Only Full SDR defines reading factors. see: 36.3 Sensor Reading Conversion Formula

func (ReadingFactors) String

func (f ReadingFactors) String() string

type Request

type Request interface {
	// Pack encodes the object to data bytes
	Pack() []byte
	// Command return the IPMI command info (NetFn/Cmd).
	// All IPMI specification specified commands are already predefined in this file.
	Command() Command
}

type ReserveDeviceSDRRepoRequest

type ReserveDeviceSDRRepoRequest struct {
}

35.4 Reserve Device SDR Repository Command

func (*ReserveDeviceSDRRepoRequest) Command

func (req *ReserveDeviceSDRRepoRequest) Command() Command

func (*ReserveDeviceSDRRepoRequest) Pack

func (req *ReserveDeviceSDRRepoRequest) Pack() []byte

type ReserveDeviceSDRRepoResponse

type ReserveDeviceSDRRepoResponse struct {
	ReservationID uint16
}

func (*ReserveDeviceSDRRepoResponse) CompletionCodes

func (r *ReserveDeviceSDRRepoResponse) CompletionCodes() map[uint8]string

func (*ReserveDeviceSDRRepoResponse) Format

func (res *ReserveDeviceSDRRepoResponse) Format() string

func (*ReserveDeviceSDRRepoResponse) Unpack

func (res *ReserveDeviceSDRRepoResponse) Unpack(msg []byte) error

type ReserveSELRequest

type ReserveSELRequest struct {
}

31.4 Reserve SEL Command

func (*ReserveSELRequest) Command

func (req *ReserveSELRequest) Command() Command

func (*ReserveSELRequest) Pack

func (req *ReserveSELRequest) Pack() []byte

type ReserveSELResponse

type ReserveSELResponse struct {
	ReservationID uint16
}

func (*ReserveSELResponse) CompletionCodes

func (*ReserveSELResponse) CompletionCodes() map[uint8]string

func (*ReserveSELResponse) Format

func (res *ReserveSELResponse) Format() string

func (*ReserveSELResponse) Unpack

func (res *ReserveSELResponse) Unpack(msg []byte) error

type ResetWatchdogTimerRequest

type ResetWatchdogTimerRequest struct {
}

27.5 Reset Watchdog Timer Command

func (*ResetWatchdogTimerRequest) Command

func (req *ResetWatchdogTimerRequest) Command() Command

func (*ResetWatchdogTimerRequest) Pack

func (req *ResetWatchdogTimerRequest) Pack() []byte

type ResetWatchdogTimerResponse

type ResetWatchdogTimerResponse struct {
}

func (*ResetWatchdogTimerResponse) CompletionCodes

func (res *ResetWatchdogTimerResponse) CompletionCodes() map[uint8]string

func (*ResetWatchdogTimerResponse) Format

func (res *ResetWatchdogTimerResponse) Format() string

func (*ResetWatchdogTimerResponse) Unpack

func (res *ResetWatchdogTimerResponse) Unpack(msg []byte) error

type Response

type Response interface {
	// Unpack decodes the object from data bytes
	Unpack(data []byte) error
	// CompletionCodes returns a map of command-specific completion codes
	CompletionCodes() map[uint8]string
	// Format return a formatted human friendly string
	Format() string
}

type ResponseError

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

ResponseError encapsulate the CompletionCode of IPMI Response Msg alongside with error description.

func (*ResponseError) CompletionCode

func (e *ResponseError) CompletionCode() CompletionCode

func (*ResponseError) Error

func (e *ResponseError) Error() string

Error implements the error interface

type Rmcp

type Rmcp struct {
	// Multi-byte fields in RMCP/ASF fields are specified as being transmitted in "Network Byte Order" - meaning most-significant byte first.
	// RMCP and ASF-specified fields are therefore transferred **most-significant byte first**.
	RmcpHeader *RmcpHeader

	// Multi-byte fields in RMCP/ASF fields are specified as being transmitted in "Network Byte Order"
	ASF *ASF

	// The IPMI convention is to transfer multi-byte numeric fields least-significant Byte first. Therefore, unless otherwise specified:
	// Data in the IPMI Session Header and IPMI Message fields are transmitted **least-significant byte first**.
	Session15 *Session15
	Session20 *Session20
}

Rmcp holds the data that will be send over UDP

func (*Rmcp) Pack

func (r *Rmcp) Pack() []byte

func (*Rmcp) Unpack

func (r *Rmcp) Unpack(msg []byte) error

type RmcpAckMessage

type RmcpAckMessage struct {
	// Copied from received message
	Version uint8

	// Copied from received message
	SequenceNumber uint8

	// [7] - Set to 1 to indicate ACK packet
	// [6:0] - Copied from received message.
	ACKFlag      bool
	MessageClass MessageClass // Can be IPMI Messages, ASF, OEM
}

13.2.1 RMCP ACK Messages

type RmcpHeader

type RmcpHeader struct {
	// 06h = RMCP Version 1.0
	// IPMI-over-LAN uses version 1 of the RMCP protocol and packet format
	Version uint8

	// RMCP Messages with class=IPMI should be sent with an RMCP Sequence Number of FFh
	// to indicate that an RMCP ACK message should not be generated by the message receiver.
	SequenceNumber uint8

	// This field identifies the format of the messages that follow this header.
	// All messages of class ASF (6) conform to the formats defined in this
	// specification and can be extended via an OEM IANA.
	// Bit 7 RMCP ACK
	// 0 - Normal RMCP message
	// 1 - RMCP ACK message
	ACKFlag bool
	// Bit 6:5 Reserved
	// Bit 4:0 Message Class
	// 0-5 = Reserved
	// 6 = ASF
	// 7 = IPMI
	// 8 = OEM defined
	// all other = Reserved
	MessageClass MessageClass // Can be IPMI Messages, ASF, OEM
}

RmcpHeader represents RMCP Message Header 13.1.3

func NewRmcpHeader

func NewRmcpHeader() *RmcpHeader

func NewRmcpHeaderASF

func NewRmcpHeaderASF() *RmcpHeader

func (*RmcpHeader) MessageType

func (r *RmcpHeader) MessageType() MessageType

the ACK/Normal Bit and the Message Class combine to identify the type of message under RMCP see: Table 13-, Message Type Determination Under RMCP

func (*RmcpHeader) Pack

func (r *RmcpHeader) Pack() []byte

func (*RmcpHeader) Unpack

func (r *RmcpHeader) Unpack(msg []byte) error

type RmcpPingRequest

type RmcpPingRequest struct {
}

RmcpPingRequest 13.2.3 RMCP/ASF Presence Ping Message

func (*RmcpPingRequest) Command

func (req *RmcpPingRequest) Command() Command

func (*RmcpPingRequest) Pack

func (req *RmcpPingRequest) Pack() []byte

type RmcpPingResponse

type RmcpPingResponse struct {
	// If no OEM-specific capabilities exist, this field contains the ASF IANA (4542) and the OEM-defined field is set to all zeroes (00000000h). Otherwise, this field contains the OEM's IANA Enterprise Number and the OEM-defined field contains the OEM-specific capabilities.
	OEMIANA uint32

	// Not used for IPMI.
	// This field can contain OEM-defined values; the definition of these values is left to the manufacturer identified by the preceding IANA Enterprise number.
	OEMDefined uint32

	IPMISupported bool
	ASFVersion    uint8

	RMCPSecurityExtensionsSupported bool
	DMTFDashSupported               bool

	// Reserved for future definition by ASF specification,
	// set to 00 00 00 00 00 00h, six bytes
	Reserverd []byte
}

func (*RmcpPingResponse) CompletionCodes

func (r *RmcpPingResponse) CompletionCodes() map[uint8]string

func (*RmcpPingResponse) Format

func (res *RmcpPingResponse) Format() string

func (*RmcpPingResponse) Unpack

func (res *RmcpPingResponse) Unpack(msg []byte) error

type SDR

type SDR struct {
	// NextRecordID should be filled by ParseSDR.
	NextRecordID uint16

	RecordHeader *SDRHeader

	Full                        *SDRFull
	Compact                     *SDRCompact
	EventOnly                   *SDREventOnly
	EntityAssociation           *SDREntityAssociation
	DeviceRelative              *SDRDeviceRelative
	GenericDeviceLocator        *SDRGenericDeviceLocator
	FRUDeviceLocator            *SDRFRUDeviceLocator
	MgmtControllerDeviceLocator *SDRMgmtControllerDeviceLocator
	MgmtControllerConfirmation  *SDRMgmtControllerConfirmation
	BMCChannelInfo              *SDRBMCChannelInfo
	OEM                         *SDROEM
	Reserved                    *SDRReserved
}

43. Sensor Data Record Formats

func ParseSDR

func ParseSDR(data []byte, nextRecordID uint16) (*SDR, error)

ParseSDR parses raw SDR record data to SDR struct. This function is normally used after GetSDRResponse or GetDeviceSDRResponse to interpret the raw SDR record data in the response.

func (*SDR) HasAnalogReading

func (sdr *SDR) HasAnalogReading() bool

Determine if sensor has an analog reading Todo, logic is not clear.

func (*SDR) SensorName

func (sdr *SDR) SensorName() string

func (*SDR) SensorNumber

func (sdr *SDR) SensorNumber() SensorNumber

func (*SDR) String

func (sdr *SDR) String() string

type SDRBMCChannelInfo

type SDRBMCChannelInfo struct {
	Channel0 ChannelInfo
	Channel1 ChannelInfo
	Channel2 ChannelInfo
	Channel3 ChannelInfo
	Channel4 ChannelInfo
	Channel5 ChannelInfo
	Channel6 ChannelInfo
	Channel7 ChannelInfo

	MessagingInterruptType uint8

	EventMessageBufferInterruptType uint8
}

43.11 SDR Type 14h - BMC Message Channel Info Record

type SDRCompact

type SDRCompact struct {
	GeneratorID  GeneratorID
	SensorNumber SensorNumber

	SensorEntityID       EntityID
	SensorEntityInstance EntityInstance
	// 0b = treat entity as a physical entity per Entity ID table
	// 1b = treat entity as a logical container entity. For example, if this bit is set,
	// and the Entity ID is "Processor", the container entity would be considered
	// to represent a logical "Processor Group" rather than a physical processor.
	// This bit is typically used in conjunction with an Entity Association record.
	SensorEntityIsLogical bool

	SensorInitialization SensorInitialization

	SensorCapabilitites SensorCapabilitites

	SensorType             SensorType
	SensorEventReadingType EventReadingType

	Mask Mask

	SensorUnit SensorUnit

	// Sensor Direction. Indicates whether the sensor is monitoring an input or
	// output relative to the given Entity. E.g. if the sensor is monitoring a
	// current, this can be used to specify whether it is an input voltage or an
	// output voltage.
	// 00b = unspecified / not applicable
	// 01b = input
	// 10b = output
	// 11b = reserved
	SensorDirection uint8

	EntityInstanceSharing uint8

	// Positive hysteresis is defined as the unsigned number of counts that are
	// subtracted from the raw threshold values to create the "re-arm" point for all
	// positive-going thresholds on the sensor. 0 indicates that there is no hysteresis on
	// positive-going thresholds for this sensor. Hysteresis values are given as raw
	// counts. That is, to find the degree of hysteresis in units, the value must be
	// converted using the "y=Mx+B" formula.
	//
	// compact SDR can have pos/neg hysteresis, but they cannot be analog!
	PositiveHysteresisRaw uint8

	// Negative hysteresis is defined as the unsigned number of counts that are added
	// to the raw threshold value to create the "re-arm" point for all negative-going
	// thresholds on the sensor. 0 indicates that there is no hysteresis on negative-going
	// thresholds for this sensor.
	//
	// compact SDR can have pos/neg hysteresis, but they cannot be analog!
	NegativeHysteresisRaw uint8

	IDStringTypeLength TypeLength // Sensor ID String Type/Length Code
	IDStringBytes      []byte     // Sensor ID String bytes.
}

43.2 SDR Type 02h, Compact Sensor Record

func (*SDRCompact) NegativeHysteresis

func (record *SDRCompact) NegativeHysteresis() (raw uint8, valid bool)

func (*SDRCompact) PositiveHysteresis

func (record *SDRCompact) PositiveHysteresis() (raw uint8, valid bool)

func (*SDRCompact) String

func (compact *SDRCompact) String() string

type SDRDeviceRelative

type SDRDeviceRelative struct {
	ContainerEntityID            uint8
	ContainerEntityInstance      uint8
	ContainerEntityDeviceAddress uint8
	ContainerEntityDeviceChannel uint8

	// [7] - 0b = contained entities specified as list
	//       1b = contained entities specified as range
	ContainedEntitiesAsRange bool
	// [6] - Record Link
	//       0b = no linked Entity Association records
	//       1b = linked Entity Association records exist
	LinkedEntityAssiactionExist bool
	// [5] - 0b = Container entity and contained entities can be assumed absent
	//            if presence sensor for container entity cannot be accessed.
	//            This value is also used if the entity does not have a presence sensor.
	//       1b = Presence sensor should always be accessible. Software should consider
	//            it an error if the presence sensor associated with the container entity
	//            is not accessible. If a presence sensor is accessible, then the
	//            presence sensor can still report that the container entity is absent.
	PresenceSensorAlwaysAccessible bool

	ContaineredEntity1DeviceAddress uint8
	ContaineredEntity1DeviceChannel uint8
	ContaineredEntity1ID            uint8
	ContaineredEntity1Instance      uint8

	ContaineredEntity2DeviceAddress uint8
	ContaineredEntity2DeviceChannel uint8
	ContaineredEntity2ID            uint8
	ContaineredEntity2Instance      uint8

	ContaineredEntity3DeviceAddress uint8
	ContaineredEntity3DeviceChannel uint8
	ContaineredEntity3ID            uint8
	ContaineredEntity3Instance      uint8

	ContaineredEntity4DeviceAddress uint8
	ContaineredEntity4DeviceChannel uint8
	ContaineredEntity4ID            uint8
	ContaineredEntity4Instance      uint8
}

43.5 SDR Type 09h - Device-relative Entity Association Record

type SDREntityAssociation

type SDREntityAssociation struct {
	ContainerEntityID       uint8
	ContainerEntityInstance uint8

	// [7] - 0b = contained entities specified as list
	//       1b = contained entities specified as range
	ContainedEntitiesAsRange bool
	// [6] - Record Link
	//       0b = no linked Entity Association records
	//       1b = linked Entity Association records exist
	LinkedEntityAssiactionExist bool
	// [5] - 0b = Container entity and contained entities can be assumed absent
	//            if presence sensor for container entity cannot be accessed.
	//            This value is also used if the entity does not have a presence sensor.
	//       1b = Presence sensor should always be accessible. Software should consider
	//            it an error if the presence sensor associated with the container entity
	//            is not accessible. If a presence sensor is accessible, then the
	//            presence sensor can still report that the container entity is absent.
	PresenceSensorAlwaysAccessible bool

	ContaineredEntity1ID       uint8
	ContaineredEntity1Instance uint8

	ContaineredEntity2ID       uint8
	ContaineredEntity2Instance uint8
	ContaineredEntity3ID       uint8
	ContaineredEntity3Instance uint8
	ContaineredEntity4ID       uint8
	ContaineredEntity4Instance uint8
}

43.4 SDR Type 08h - Entity Association Record

type SDREventOnly

type SDREventOnly struct {
	GeneratorID  GeneratorID
	SensorNumber SensorNumber // Unique number identifying the sensor behind a given slave address and LUN. Code FFh reserved.

	SensorEntityID       EntityID
	SensorEntityInstance EntityInstance
	// 0b = treat entity as a physical entity per Entity ID table
	// 1b = treat entity as a logical container entity. For example, if this bit is set,
	// and the Entity ID is "Processor", the container entity would be considered
	// to represent a logical "Processor Group" rather than a physical processor.
	// This bit is typically used in conjunction with an Entity Association record.
	SensorEntityIsLogical bool

	SensorType             SensorType
	SensorEventReadingType EventReadingType

	SensorDirection uint8

	IDStringInstanceModifierType uint8

	// Share count (number of sensors sharing this record). Sensor numbers sharing this
	// record are sequential starting with the sensor number specified by the Sensor
	// Number field for this record. E.g. if the starting sensor number was 10, and the share
	// count was 3, then sensors 10, 11, and 12 would share this record.
	ShareCount uint8

	EntityInstanceSharing bool

	// Multiple Discrete sensors can share the same sensor data record. The ID String Instance
	// Modifier and Modifier Offset are used to modify the Sensor ID String as follows:
	// Suppose sensor ID is "Temp " for "Temperature Sensor", share count = 3, ID string
	// instance modifier = numeric, instance modifier offset = 5 - then the sensors could be
	// identified as:
	// Temp 5, Temp 6, Temp 7
	// If the modifier = alpha, and offset = 26, then the sensors could be identified as:
	// Temp AA, Temp AB, Temp AC
	// (alpha characters are considered to be base 26 for ASCII)
	IDStringInstanceModifierOffset uint8

	IDStringTypeLength TypeLength
	IDStringBytes      []byte
}

43.3 SDR Type 03h, Event-Only Record

func (*SDREventOnly) String

func (eventOnly *SDREventOnly) String() string

type SDRFRUDeviceLocator

type SDRFRUDeviceLocator struct {

	// [7:1] - Slave address of controller used to access device. 0000000b if device is directly on IPMB.
	// This field indicates whether the device is on a private bus or not.
	DeviceAccessAddress uint8

	// FRU Device ID / Device Slave Address
	//
	// For LOGICAL FRU DEVICE (accessed via FRU commands to mgmt. controller):
	// [7:0] - Number identifying FRU device within given IPM Controller. FFh = reserved.
	// The primary FRU device for a management controller is always device #0 at
	// LUN 00b. The primary FRU device is not reported via this FRU Device Locator
	// record - its presence is identified via the Device Capabilities field in the
	// Management Controller Device Locator record.
	//
	// For non-intelligent FRU device:
	// [7:1] - 7-bit I2C Slave Address[1] . This is relative to the bus the device is on. For
	// devices on the IPMB, this is the slave address of the device on the IPMB. For
	// devices on a private bus, this is the slave address of the device on the private
	// bus.
	// [0] - reserved
	FRUDeviceID_SlaveAddress uint8

	// [7] - logical/physical FRU device
	// 0b = device is not a logical FRU Device
	// 1b = device is logical FRU Device (accessed via FRU commands to mgmt. controller)
	IsLogicalFRUDevice bool

	// [4:3] - LUN for Master Write-Read command or FRU Command. 00b if device is nonintelligent device directly on IPMB.
	AccessLUN uint8

	// [2:0] - Private bus ID if bus = Private.
	// 000b if device directly on IPMB, or device is a logical FRU Device.
	PrivateBusID uint8

	// [7:4] - Channel number for management controller used to access device. 000b if
	// device directly on the primary IPMB, or if controller is on the primary IPMB. Msbit for channel number is kept in next byte. (For IPMI v1.5. This byte position
	// was reserved for IPMI v1.0.)
	// [3:0] - reserved
	ChannelNumber uint8

	DeviceType         DeviceType
	DeviceTypeModifier uint8
	FRUEntityID        uint8
	FRUEntityInstance  uint8

	DeviceIDTypeLength TypeLength
	DeviceIDBytes      []byte // Short ID string for the FRU Device
}

43.8 SDR Type 11h - FRU Device Locator Record 38. Accessing FRU Devices

func (*SDRFRUDeviceLocator) Location

func (sdrFRU *SDRFRUDeviceLocator) Location() FRULocation

Table 38-1, FRU Device Locator Field Usage

type SDRFull

type SDRFull struct {
	GeneratorID  GeneratorID
	SensorNumber SensorNumber

	// Indicates the physical entity that the sensor is monitoring or is otherwise
	// associated with the sensor.
	SensorEntityID       EntityID
	SensorEntityInstance EntityInstance
	// 0b = treat entity as a physical entity per Entity ID table
	// 1b = treat entity as a logical container entity. For example, if this bit is set,
	// and the Entity ID is "Processor", the container entity would be considered
	// to represent a logical "Processor Group" rather than a physical processor.
	// This bit is typically used in conjunction with an Entity Association full.
	SensorEntityIsLogical bool

	SensorInitialization SensorInitialization

	SensorCapabilitites SensorCapabilitites

	SensorType             SensorType
	SensorEventReadingType EventReadingType

	Mask Mask

	SensorUnit SensorUnit

	EntityInstanceSharing uint8

	// LinearizationFunc is the Lineraization func. (L of the Sensor Reading Convertion Formula)
	//
	// [6:0] - enum (linear, ln, log10, log2, e, exp10, exp2, 1/x, sqr(x), cube(x), sqrt(x),
	// cube-1 (x) )
	// - 70h = non-linear.
	// 71h-7Fh = non-linear, OEM defined.
	LinearizationFunc LinearizationFunc

	ReadingFactors

	// Sensor Direction. Indicates whether the sensor is monitoring an input or
	// output relative to the given Entity. E.g. if the sensor is monitoring a
	// current, this can be used to specify whether it is an input voltage or an
	// output voltage.
	// 00b = unspecified / not applicable
	// 01b = input
	// 10b = output
	// 11b = reserved
	SensorDirection uint8

	// Analog Flags
	NominalReadingSpecified bool
	NormalMaxSpecified      bool
	NormalMinSpecified      bool

	// 额定值,标称值
	// Given as a raw value. Must be converted to units-based value using the y=Mx+B
	// formula. 1's or 2's complement signed or unsigned per flag bits in Sensor Units 1
	//
	// Only meaningful when NominalReadingSpecified is true
	NominalReadingRaw uint8

	// 最大正常值
	// Only meaningful when NormalMaxSpecified is true
	NormalMaxRaw uint8

	// 最小正常值
	// Only meaningful when NormalMinSpecified is true
	NormalMinRaw uint8

	// Given as a raw value. Must be converted to units-based value based using the
	// y=Mx+B formula. Signed or unsigned per "signed" bit in sensor flags. Normally
	// "FFh" for an 8-bit unsigned sensor, but can be a lesser value if the sensor has a
	// restricted range. If max. reading cannot be pre-specified this value should be set
	// to max value, based on data format, (e.g. FFh for an unsigned sensor, 7Fh for 2"s
	// complement, etc.)
	SensorMaxReadingRaw uint8

	// Given as a raw value. Must be converted to units-based value using the "y=Mx+B"
	// formula. Signed or unsigned per "signed" bit in sensor flags. If min. reading
	// cannot be pre-specified this value should be set to min value, based on data
	// format, (e.g. 00h for an unsigned sensor, 80h for 2"s complement, etc.)
	SensorMinReadingRaw uint8

	// Given as raw value.
	UNR_Raw uint8
	UCR_Raw uint8
	UNC_Raw uint8

	LNR_Raw uint8
	LCR_Raw uint8
	LNC_Raw uint8

	// Positive hysteresis is defined as the unsigned number of counts that are
	// subtracted from the raw threshold values to create the "re-arm" point for all
	// positive-going thresholds on the sensor. 0 indicates that there is no hysteresis on
	// positive-going thresholds for this sensor. Hysteresis values are given as raw
	// counts. That is, to find the degree of hysteresis in units, the value must be
	// converted using the "y=Mx+B" formula.
	//
	// 正向迟滞量
	PositiveHysteresisRaw uint8

	// Negative hysteresis is defined as the unsigned number of counts that are added
	// to the raw threshold value to create the "re-arm" point for all negative-going
	// thresholds on the sensor. 0 indicates that there is no hysteresis on negative-going
	// thresholds for this sensor.
	//
	// 负向迟滞量
	NegativeHysteresisRaw uint8

	IDStringTypeLength TypeLength
	IDStringBytes      []byte
}

43.1 SDRFull Type 01h, Full Sensor Record

func (*SDRFull) ConvertReading

func (full *SDRFull) ConvertReading(raw uint8) float64

ConvertReading converts raw sensor reading or raw sensor threshold value to real value in the desired units for the sensor.

func (*SDRFull) ConvertSensorHysteresis

func (full *SDRFull) ConvertSensorHysteresis(raw uint8) float64

ConvertSensorHysteresis converts raw sensor hysteresis value to real value in the desired units for the sensor.

func (*SDRFull) ConvertSensorTolerance

func (full *SDRFull) ConvertSensorTolerance(raw uint8) float64

ConvertSensorTolerance converts raw sensor tolerance value to real value in the desired units for the sensor.

func (*SDRFull) HysteresisStr

func (full *SDRFull) HysteresisStr(raw uint8) string

func (*SDRFull) ReadingMaxStr

func (full *SDRFull) ReadingMaxStr() string

func (*SDRFull) ReadingMinStr

func (full *SDRFull) ReadingMinStr() string

func (*SDRFull) ReadingStr

func (full *SDRFull) ReadingStr(raw uint8, valid bool) string

func (*SDRFull) SensorThreshold

func (full *SDRFull) SensorThreshold(thresholdType SensorThresholdType) SensorThreshold

SensorThreshold return SensorThreshold for a specified threshold type.

func (*SDRFull) String

func (full *SDRFull) String() string

func (*SDRFull) ThresholdValueStr

func (full *SDRFull) ThresholdValueStr(thresholdType SensorThresholdType) string

ThresholdValueStr formats a threshold value for specified threshold type. If the threshold is not readable, return "not readable".

type SDRGenericDeviceLocator

type SDRGenericDeviceLocator struct {
	DeviceAccessAddress uint8 // Slave address of management controller used to access device. 0000000b if device is directly on IPMB
	DeviceSlaveAddress  uint8
	ChannelNumber       uint8 // Channel number for management controller used to access device
	AccessLUN           uint8 // LUN for Master Write-Read command. 00b if device is non-intelligent device directly on IPMB.
	PrivateBusID        uint8 // Private bus ID if bus = Private. 000b if device directly on IPMB

	AddressSpan        uint8
	DeviceType         uint8
	DeviceTypeModifier uint8
	EntityID           uint8
	EntityInstance     uint8

	DeviceIDTypeLength TypeLength
	DeviceIDString     []byte // Short ID string for the device
}

43.7 SDR Type 10h - Generic Device Locator Record This record is used to store the location and type information for devices on the IPMB or management controller private busses that are neither IPMI FRU devices nor IPMI management controllers.

These devices can either be common non-intelligent I2C devices, special management ASICs, or proprietary controllers.

IPMI FRU Devices and Management Controllers are located via the FRU Device Locator and Management Controller Device Locator records described in following sections.

type SDRHeader

type SDRHeader struct {
	RecordID     uint16
	SDRVersion   uint8         // The version number of the SDR specification.
	RecordType   SDRRecordType // A number representing the type of the record. E.g. 01h = 8-bit Sensor with Thresholds.
	RecordLength uint8         // Number of bytes of data following the Record Length field.
}

type SDRMapBySensorNumber

type SDRMapBySensorNumber map[GeneratorID]map[SensorNumber]*SDR

type SDRMgmtControllerConfirmation

type SDRMgmtControllerConfirmation struct {
	DeviceSlaveAddress uint8 // 7-bit I2C Slave Address[1] of device on IPMB.
	DeviceID           uint8
	ChannelNumber      uint8
	DeviceRevision     uint8

	FirmwareMajorRevision uint8 // [6:0] - Major Firmware Revision, binary encoded.
	FirmwareMinorRevision uint8 // Minor Firmware Revision. BCD encoded.

	// IPMI Version from Get Device ID command. Holds IPMI Command Specification
	// Version. BCD encoded. 00h = reserved. Bits 7:4 hold the Least Significant digit of the
	// revision, while bits 3:0 hold the Most Significant bits. E.g. a value of 01h indicates
	// revision 1.0
	MajorIPMIVersion uint8
	MinorIPMIVersion uint8

	ManufacturerID uint32 // 3 bytes only
	ProductID      uint16
	DeviceGUID     []byte // 16 bytes
}

43.10 SDR Type 13h - Management Controller Confirmation Record

type SDRMgmtControllerDeviceLocator

type SDRMgmtControllerDeviceLocator struct {
	DeviceSlaveAddress uint8 // 7-bit I2C Slave Address[1] of device on channel
	ChannelNumber      uint8

	ACPISystemPowerStateNotificationRequired bool
	ACPIDevicePowerStateNotificationRequired bool
	ControllerLogsInitializationAgentErrors  bool
	LogInitializationAgentErrors             bool

	DeviceCap_ChassisDevice      bool // device functions as chassis device
	DeviceCap_Bridge             bool // Controller responds to Bridge NetFn command
	DeviceCap_IPMBEventGenerator bool // device generates event messages on IPMB
	DeviceCap_IPMBEventReceiver  bool // device accepts event messages from IPMB
	DeviceCap_FRUInventoryDevice bool // accepts FRU commands to FRU Device #0 at LUN 00b
	DeviceCap_SELDevice          bool // provides interface to SEL
	DeviceCap_SDRRepoDevice      bool // For BMC, indicates BMC provides interface to	1b = SDR Repository. For other controller, indicates controller accepts Device SDR commands
	DeviceCap_SensorDevice       bool // device accepts sensor commands

	EntityID       uint8
	EntityInstance uint8

	DeviceIDTypeLength TypeLength
	DeviceIDBytes      []byte
}

43.9 SDR Type 12h - Management Controller Device Locator Record

type SDROEM

type SDROEM struct {
	ManufacturerID uint32 // 3 bytes only
	OEMData        []byte
}

43.12 SDR Type C0h - OEM Record

type SDROperationSupport

type SDROperationSupport struct {
	Overflow                     bool
	SupportModalSDRRepoUpdate    bool // A modal SDR Repository is only updated when the controller is in an SDR Repository update mode.
	SupportNonModalSDRRepoUpdate bool // A non-modal SDR Repository can be written to at any time
	SupportDeleteSDR             bool
	SupportParitialAddSDR        bool
	SupportReserveSDRRepo        bool
	SupportGetSDRRepoAllocInfo   bool
}

type SDRRecordType

type SDRRecordType uint8

43. Sensor Data Record Formats

const (
	SDRRecordTypeFullSensor                        SDRRecordType = 0x01
	SDRRecordTypeCompactSensor                     SDRRecordType = 0x02
	SDRRecordTypeEventOnly                         SDRRecordType = 0x03
	SDRRecordTypeEntityAssociation                 SDRRecordType = 0x08
	SDRRecordTypeDeviceRelativeEntityAssociation   SDRRecordType = 0x09
	SDRRecordTypeGenericLocator                    SDRRecordType = 0x10
	SDRRecordTypeFRUDeviceLocator                  SDRRecordType = 0x11
	SDRRecordTypeManagementControllerDeviceLocator SDRRecordType = 0x12
	SDRRecordTypeManagementControllerConfirmation  SDRRecordType = 0x13
	SDRRecordTypeBMCMessageChannelInfo             SDRRecordType = 0x14
	SDRRecordTypeOEM                               SDRRecordType = 0xc0
)

func (SDRRecordType) String

func (sdrRecordType SDRRecordType) String() string

type SDRReserved

type SDRReserved struct {
}

43.6 SDR Type 0Ah:0Fh - Reserved Records

type SEL

type SEL struct {
	// SEL Record IDs 0000h and FFFFh are reserved for functional use and are not legal ID values.
	// Record IDs are handles. They are not required to be sequential or consecutive.
	// Applications should not assume that SEL Record IDs will follow any particular numeric ordering.
	RecordID   uint16
	RecordType SELRecordType

	Standard          *SELStandard
	OEMTimestamped    *SELOEMTimestamped
	OEMNonTimestamped *SELOEMNonTimestamped
}

32. SEL Record Formats

func ParseSEL

func ParseSEL(msg []byte) (*SEL, error)

func (*SEL) Pack

func (sel *SEL) Pack() []byte

type SELOEMNonTimestamped

type SELOEMNonTimestamped struct {
	OEM [13]byte
}

func (*SELOEMNonTimestamped) Pack

func (oemNonTimestamped *SELOEMNonTimestamped) Pack() []byte

type SELOEMTimestamped

type SELOEMTimestamped struct {
	Timestamp      time.Time // Time when event was logged. uint32 LS byte first.
	ManufacturerID uint32    // only 3 bytes
	OEMDefined     [6]byte
}

32.2 OEM SEL Record - Type C0h-DFh

func (*SELOEMTimestamped) Pack

func (oemTimestamped *SELOEMTimestamped) Pack() []byte

type SELOperationSupport

type SELOperationSupport struct {
	Overflow        bool
	DeleteSEL       bool
	PartialAddSEL   bool
	ReserveSEL      bool
	GetSELAllocInfo bool
}

type SELRecordType

type SELRecordType uint8

31.6.1 SEL Record Type Ranges

func (SELRecordType) Range

func (typ SELRecordType) Range() SELRecordTypeRange

The SELRecordType can be categorized into 3 ranges according to the SELRecordType value.

  • 00h - BFh -> standard
  • C0h - DFh -> timestamped OEM
  • E0h - FFh -> none-timestamped OEM

func (SELRecordType) String

func (typ SELRecordType) String() string

type SELRecordTypeRange

type SELRecordTypeRange string
const (
	// Range reserved for standard SEL Record Types.
	// As of this writing, only type 02h is defined.
	// Records are automatically timestamped unless otherwise indicated
	// 00h - BFh
	SELRecordTypeRangeStandard SELRecordTypeRange = "standard"

	// 32.2 OEM SEL Record - Type C0h-DFh
	// Range reserved for timestamped OEM SEL records.
	// These records are automatically timestamped by the SEL Device
	// C0h - DFh
	SELRecordTypeRangeTimestampedOEM SELRecordTypeRange = "timestamped OEM"

	// 32.3 OEM SEL Record - Type E0h-FFh
	// Range reserved for non-timestamped OEM SEL records.
	// The SEL Device does not automatically timestamp these records.
	// The four bytes passed in the byte locations for the timestamp will be directly entered into the SEL.
	// E0h - FFh
	SELRecordTypeRangeNonTimestampedOEM SELRecordTypeRange = "non-timestamped OEM"
)

type SELStandard

type SELStandard struct {
	Timestamp    time.Time    // Time when event was logged. uint32 LS byte first.
	GeneratorID  GeneratorID  // RqSA & LUN if event was generated from IPMB. Software ID if event was generatedfrom system software.
	EvMRev       uint8        // Event Message Revision (format version)
	SensorType   SensorType   // Sensor Type Code for sensor that generated the event
	SensorNumber SensorNumber // Number of sensor that generated the event

	EventDir         EventDir         // Event Direction. [7] -0b = Assertion event. 1b = Deassertion event.
	EventReadingType EventReadingType // Type of trigger for the event. [6:0] - Event Type Code

	// 29.7 Event Data Field Formats
	//
	// The sensor class determines the corresponding Event Data format.
	// The sensor class can be extracted from EventReadingType.
	EventData EventData
}

32.1 SEL Standard Event Records

func (*SELStandard) EventSeverity

func (sel *SELStandard) EventSeverity() EventSeverity

func (*SELStandard) EventString

func (sel *SELStandard) EventString() string

EventString return string description of the event.

func (*SELStandard) Pack

func (standard *SELStandard) Pack() []byte

type SOLActivatingRequest

type SOLActivatingRequest struct {
	SessionState       uint8
	PayloadInstance    uint8
	FormatVersionMajor uint8
	FormatVersionMinor uint8
}

26.1 SOL Activating Command

func (*SOLActivatingRequest) Command

func (req *SOLActivatingRequest) Command() Command

func (*SOLActivatingRequest) Pack

func (req *SOLActivatingRequest) Pack() []byte

type SOLActivatingResponse

type SOLActivatingResponse struct {
}

func (*SOLActivatingResponse) CompletionCodes

func (res *SOLActivatingResponse) CompletionCodes() map[uint8]string

func (*SOLActivatingResponse) Format

func (res *SOLActivatingResponse) Format() string

func (*SOLActivatingResponse) Unpack

func (res *SOLActivatingResponse) Unpack(msg []byte) error

type SOLConfigParam

type SOLConfigParam struct {
	SetInProgress      *SOLConfigParam_SetInProgress
	SOLEnable          *SOLConfigParam_SOLEnable
	SOLAuthentication  *SOLConfigParam_SOLAuthentication
	Character          *SOLConfigParam_Character
	SOLRetry           *SOLConfigParam_SOLRetry
	NonVolatileBitRate *SOLConfigParam_NonVolatileBitRate
	VolatileBitRate    *SOLConfigParam_VolatileBitRate
	PayloadChannel     *SOLConfigParam_PayloadChannel
	PayloadPort        *SOLConfigParam_PayloadPort
}

func (*SOLConfigParam) Format

func (p *SOLConfigParam) Format() string

type SOLConfigParamSelector

type SOLConfigParamSelector uint8
const (
	SOLConfigParamSelector_SetInProgress      SOLConfigParamSelector = 0x00
	SOLConfigParamSelector_SOLEnable          SOLConfigParamSelector = 0x01
	SOLConfigParamSelector_SOLAuthentication  SOLConfigParamSelector = 0x02
	SOLConfigParamSelector_Character          SOLConfigParamSelector = 0x03
	SOLConfigParamSelector_SOLRetry           SOLConfigParamSelector = 0x04
	SOLConfigParamSelector_NonVolatileBitRate SOLConfigParamSelector = 0x05
	SOLConfigParamSelector_VolatileBitRate    SOLConfigParamSelector = 0x06
	SOLConfigParamSelector_PayloadChannel     SOLConfigParamSelector = 0x07
	SOLConfigParamSelector_PayloadPort        SOLConfigParamSelector = 0x08
)

type SOLConfigParam_Character

type SOLConfigParam_Character struct {
	AccumulateInterval5Millis uint8
	SendThreshold             uint8
}

func (*SOLConfigParam_Character) Format

func (p *SOLConfigParam_Character) Format() string

func (*SOLConfigParam_Character) Pack

func (p *SOLConfigParam_Character) Pack() []byte

func (*SOLConfigParam_Character) Unpack

func (p *SOLConfigParam_Character) Unpack(paramData []byte) error

type SOLConfigParam_NonVolatileBitRate

type SOLConfigParam_NonVolatileBitRate uint8

func (*SOLConfigParam_NonVolatileBitRate) Format

func (*SOLConfigParam_NonVolatileBitRate) KBPS

func (*SOLConfigParam_NonVolatileBitRate) Pack

func (*SOLConfigParam_NonVolatileBitRate) Unpack

func (p *SOLConfigParam_NonVolatileBitRate) Unpack(paramData []byte) error

type SOLConfigParam_PayloadChannel

type SOLConfigParam_PayloadChannel uint8

func (*SOLConfigParam_PayloadChannel) Format

func (*SOLConfigParam_PayloadChannel) Pack

func (p *SOLConfigParam_PayloadChannel) Pack() []byte

func (*SOLConfigParam_PayloadChannel) Unpack

func (p *SOLConfigParam_PayloadChannel) Unpack(paramData []byte) error

type SOLConfigParam_PayloadPort

type SOLConfigParam_PayloadPort uint16

func (*SOLConfigParam_PayloadPort) Format

func (p *SOLConfigParam_PayloadPort) Format() string

func (*SOLConfigParam_PayloadPort) Pack

func (p *SOLConfigParam_PayloadPort) Pack() []byte

func (*SOLConfigParam_PayloadPort) Unpack

func (p *SOLConfigParam_PayloadPort) Unpack(paramData []byte) error

type SOLConfigParam_SOLAuthentication

type SOLConfigParam_SOLAuthentication struct {
	ForceEncryption     bool
	ForceAuthentication bool
	PrivilegeLevel      uint8
}

func (*SOLConfigParam_SOLAuthentication) Format

func (*SOLConfigParam_SOLAuthentication) Pack

func (*SOLConfigParam_SOLAuthentication) Unpack

func (p *SOLConfigParam_SOLAuthentication) Unpack(paramData []byte) error

type SOLConfigParam_SOLEnable

type SOLConfigParam_SOLEnable bool

func (*SOLConfigParam_SOLEnable) Format

func (p *SOLConfigParam_SOLEnable) Format() string

func (*SOLConfigParam_SOLEnable) Pack

func (p *SOLConfigParam_SOLEnable) Pack() []byte

func (*SOLConfigParam_SOLEnable) Unpack

func (p *SOLConfigParam_SOLEnable) Unpack(paramData []byte) error

type SOLConfigParam_SOLRetry

type SOLConfigParam_SOLRetry struct {
	// 1-based. 0 = no retries after packet is transmitted. Packet will be
	// dropped if no ACK/NACK received by time retries expire.
	RetryCount uint8

	RetryInterval10Millis uint8
}

func (*SOLConfigParam_SOLRetry) Format

func (p *SOLConfigParam_SOLRetry) Format() string

func (*SOLConfigParam_SOLRetry) Pack

func (p *SOLConfigParam_SOLRetry) Pack() []byte

func (*SOLConfigParam_SOLRetry) Unpack

func (p *SOLConfigParam_SOLRetry) Unpack(paramData []byte) error

type SOLConfigParam_SetInProgress

type SOLConfigParam_SetInProgress uint8

func (*SOLConfigParam_SetInProgress) Format

func (*SOLConfigParam_SetInProgress) Pack

func (p *SOLConfigParam_SetInProgress) Pack() []byte

func (*SOLConfigParam_SetInProgress) Unpack

func (p *SOLConfigParam_SetInProgress) Unpack(paramData []byte) error

type SOLConfigParam_VolatileBitRate

type SOLConfigParam_VolatileBitRate uint8

func (*SOLConfigParam_VolatileBitRate) Format

func (*SOLConfigParam_VolatileBitRate) KBPS

func (*SOLConfigParam_VolatileBitRate) Pack

func (*SOLConfigParam_VolatileBitRate) Unpack

func (p *SOLConfigParam_VolatileBitRate) Unpack(paramData []byte) error

type SendMessageRequest

type SendMessageRequest struct {
	// [7:6] 00b = No tracking
	// 01b = Track Request.
	// 10b = Send Raw. (optional)
	// 11b = reserved
	TrackMask uint8

	Encrypted bool

	Authenticated bool

	ChannelNumber uint8

	// Todo
	MessageData []byte
}

22.7 Send Message Command

func (SendMessageRequest) Command

func (req SendMessageRequest) Command() Command

func (*SendMessageRequest) Pack

func (req *SendMessageRequest) Pack() []byte

type SendMessageResponse

type SendMessageResponse struct {
	// This data will only be present when using the Send Message command to
	// originate requests from IPMB or PCI Management Bus to other channels
	// such as LAN or serial/modem. It is not present in the response to a
	// Send Message command delivered via the System Interface.
	Data []byte
}

func (*SendMessageResponse) CompletionCodes

func (*SendMessageResponse) CompletionCodes() map[uint8]string

func (*SendMessageResponse) Format

func (res *SendMessageResponse) Format() string

func (*SendMessageResponse) Unpack

func (res *SendMessageResponse) Unpack(msg []byte) error

type Sensor

type Sensor struct {
	SDRRecordType SDRRecordType

	Number uint8
	Name   string

	SensorType           SensorType
	EventReadingType     EventReadingType
	SensorUnit           SensorUnit
	SensorInitialization SensorInitialization
	SensorCapabilitites  SensorCapabilitites

	HasAnalogReading bool

	// Raw reading value before conversion
	Raw uint8
	// reading value after conversion
	Value float64

	Threshold struct {
		Mask Mask_Thresholds

		// Threshold Status, udpate by GetSensorReadingResponse.ThresholdStatus()
		ThresholdStatus SensorThresholdStatus

		// Only Full SDR
		LinearizationFunc LinearizationFunc

		ReadingFactors

		LNC_Raw uint8
		LCR_Raw uint8
		LNR_Raw uint8
		UNC_Raw uint8
		UCR_Raw uint8
		UNR_Raw uint8

		LNC float64
		LCR float64
		LNR float64
		UNC float64
		UCR float64
		UNR float64

		PositiveHysteresisRaw uint8
		NegativeHysteresisRaw uint8

		PositiveHysteresis float64
		NegativeHysteresis float64
	}

	Discrete struct {
		Mask         Mask_Discrete
		ActiveStates Mask_DiscreteEvent
		// contains filtered or unexported fields
	}

	OccuredEvents []SensorEvent
	// contains filtered or unexported fields
}

Sensor holds all attribute of a sensor.

func (*Sensor) ConvertReading

func (sensor *Sensor) ConvertReading(raw uint8) float64

ConvertReading converts raw sensor reading or raw sensor threshold value to real value in the desired units for the sensor.

func (*Sensor) ConvertSensorHysteresis

func (sensor *Sensor) ConvertSensorHysteresis(raw uint8) float64

func (*Sensor) ConvertSensorTolerance

func (sensor *Sensor) ConvertSensorTolerance(raw uint8) float64

func (*Sensor) HysteresisStr

func (sensor *Sensor) HysteresisStr(raw uint8) string

func (*Sensor) IsReadingValid

func (sensor *Sensor) IsReadingValid() bool

func (*Sensor) IsThreshold

func (sensor *Sensor) IsThreshold() bool

IsThreshold returns whether the sensor is threshold sensor class or not.

func (*Sensor) IsThresholdAndReadingValid

func (sensor *Sensor) IsThresholdAndReadingValid() bool

func (*Sensor) IsThresholdReadable

func (sensor *Sensor) IsThresholdReadable(thresholdType SensorThresholdType) bool

func (*Sensor) ReadingStr

func (sensor *Sensor) ReadingStr() string

func (*Sensor) SensorThreshold

func (sensor *Sensor) SensorThreshold(thresholdType SensorThresholdType) SensorThreshold

SensorThreshold return SensorThreshold for a specified threshold type.

func (*Sensor) Status

func (sensor *Sensor) Status() string

func (*Sensor) ThresholdStr

func (sensor *Sensor) ThresholdStr(thresholdType SensorThresholdType) string

type SensorAnalogUnitFormat

type SensorAnalogUnitFormat uint8
const (
	SensorAnalogUnitFormat_Unsigned     SensorAnalogUnitFormat = 0 // unsigned
	SensorAnalogUnitFormat_1sComplement SensorAnalogUnitFormat = 1 // 1's complement (signed)
	SensorAnalogUnitFormat_2sComplement SensorAnalogUnitFormat = 2 // 2's complement (signed)
	SensorAnalogUnitFormat_NotAnalog    SensorAnalogUnitFormat = 3 // does not return analog (numeric) reading
)

func (SensorAnalogUnitFormat) String

func (format SensorAnalogUnitFormat) String() string

type SensorCapabilitites

type SensorCapabilitites struct {
	// [7] - 1b = IgnoreWithEntity sensor if Entity is not present or disabled. 0b = don't ignore sensor
	IgnoreWithEntity bool

	// Sensor Auto Re-arm Support
	// Indicates whether the sensor requires manual rearming, or automatically rearms
	// itself when the event clears. 'manual' implies that the get sensor event status and
	// rearm sensor events commands are supported
	// [6] - 0b = no (manual), 1b = yes (auto)
	AutoRearm bool

	HysteresisAccess SensorHysteresisAccess
	ThresholdAccess  SensorThresholdAccess

	EventMessageControl SensorEventMessageControl
}

SensorCapbilitites represent the capabilities of the sensor. SDRs of Full/Compact record type has this field.

type SensorClass

type SensorClass string

42.1 Sensors are classified according to the type of readings they provide and/or the type of events they generate.

Three sensor classes: threshold, discrete, oem (oem is a special case of discrete)

A sensor can return either an analog or discrete readings. Sensor events can be discrete or threshold-based.

const (
	SensorClassNotApplicable SensorClass = "N/A" // 不适用的

	SensorClassThreshold SensorClass = "threshold"

	// 离散 multiple states possible
	// Discrete sensors can contain up to 15 possible states.
	// It is possible for a discrete sensor to have more than one state active at a time
	SensorClassDiscrete SensorClass = "discrete"

	// Special case of discrete where the meaning of the states (offsets) are OEM defined.
	SensorClassOEM SensorClass = "oem"
)

type SensorEvent

type SensorEvent struct {
	SensorClass SensorClass

	ThresholdType SensorThresholdType
	Assert        bool // true -> assertion events; false -> deassertion events
	High          bool // true -> going high; false -> going low

	State uint8 // state 0-14 (total 15 possible states)
}

func (SensorEvent) String

func (e SensorEvent) String() string

type SensorEventFlag

type SensorEventFlag struct {
	SensorEvent_UNC_High_Assert bool
	SensorEvent_UNC_Low_Assert  bool
	SensorEvent_LNR_High_Assert bool
	SensorEvent_LNR_Low_Assert  bool
	SensorEvent_LCR_High_Assert bool
	SensorEvent_LCR_Low_Assert  bool
	SensorEvent_LNC_High_Assert bool
	SensorEvent_LNC_Low_Assert  bool
	SensorEvent_State_7_Assert  bool
	SensorEvent_State_6_Assert  bool
	SensorEvent_State_5_Assert  bool
	SensorEvent_State_4_Assert  bool
	SensorEvent_State_3_Assert  bool
	SensorEvent_State_2_Assert  bool
	SensorEvent_State_1_Assert  bool
	SensorEvent_State_0_Assert  bool

	SensorEvent_UNR_High_Assert bool
	SensorEvent_UNR_Low_Assert  bool
	SensorEvent_UCR_High_Assert bool
	SensorEvent_UCR_Low_Assert  bool
	SensorEvent_State_14_Assert bool
	SensorEvent_State_13_Assert bool
	SensorEvent_State_12_Assert bool
	SensorEvent_State_11_Assert bool
	SensorEvent_State_10_Assert bool
	SensorEvent_State_9_Assert  bool
	SensorEvent_State_8_Assert  bool

	SensorEvent_UNC_High_Deassert bool
	SensorEvent_UNC_Low_Deassert  bool
	SensorEvent_LNR_High_Deassert bool
	SensorEvent_LNR_Low_Deassert  bool
	SensorEvent_LCR_High_Deassert bool
	SensorEvent_LCR_Low_Deassert  bool
	SensorEvent_LNC_High_Deassert bool
	SensorEvent_LNC_Low_Deassert  bool
	SensorEvent_State_7_Deassert  bool
	SensorEvent_State_6_Deassert  bool
	SensorEvent_State_5_Deassert  bool
	SensorEvent_State_4_Deassert  bool
	SensorEvent_State_3_Deassert  bool
	SensorEvent_State_2_Deassert  bool
	SensorEvent_State_1_Deassert  bool
	SensorEvent_State_0_Deassert  bool

	SensorEvent_UNR_High_Deassert bool
	SensorEvent_UNR_Low_Deassert  bool
	SensorEvent_UCR_High_Deassert bool
	SensorEvent_UCR_Low_Deassert  bool
	SensorEvent_State_14_Deassert bool
	SensorEvent_State_13_Deassert bool
	SensorEvent_State_12_Deassert bool
	SensorEvent_State_11_Deassert bool
	SensorEvent_State_10_Deassert bool
	SensorEvent_State_9_Deassert  bool
	SensorEvent_State_8_Deassert  bool
}

SensorEventFlag holds a struct with fields indicating the specified sensor event is set or not. SensorEventFlag was embeded in Sensor related commands.

func (*SensorEventFlag) TrueEvents

func (flag *SensorEventFlag) TrueEvents() []SensorEvent

TrueEvents returns a slice of SensorEvent those are set to true in the SensorEventFlag.

type SensorEventMessageControl

type SensorEventMessageControl uint8

SensorEventMessageControl indicates whether this sensor generates Event Messages, and if so, what type of Event Message control is offered.

const (
	// per threshold/discrete-state event enable/disable control (implies
	// that entire sensor and global disable are also supported)
	SensorEventMessageControl_PerThresholdState SensorEventMessageControl = 0
	// entire sensor only (implies that global disable is also supported)
	SensorEventMessageControl_EntireSensorOnly SensorEventMessageControl = 1
	// global disable only
	SensorEventMessageControl_GlobalDisableOnly SensorEventMessageControl = 2
	// no events from sensor
	SensorEventMessageControl_NoEvents SensorEventMessageControl = 3
)

func (SensorEventMessageControl) String

func (a SensorEventMessageControl) String() string

type SensorEvents

type SensorEvents []SensorEvent

func (SensorEvents) FilterAssert

func (events SensorEvents) FilterAssert() SensorEvents

func (SensorEvents) FilterDeassert

func (events SensorEvents) FilterDeassert() SensorEvents

func (SensorEvents) FilterDiscrete

func (events SensorEvents) FilterDiscrete() SensorEvents

func (SensorEvents) FilterThreshold

func (events SensorEvents) FilterThreshold() SensorEvents

func (SensorEvents) Strings

func (events SensorEvents) Strings() []string

type SensorFilterOption

type SensorFilterOption func(sensor *Sensor) bool

type SensorHysteresisAccess

type SensorHysteresisAccess uint8

SensorHysteresisAccess represents the access mode for the hysteresis value of the sensor.

const (
	// No hysteresis, or hysteresis built-in but not specified
	SensorHysteresisAccess_No SensorHysteresisAccess = 0
	// hysteresis is readable.
	SensorHysteresisAccess_Readable SensorHysteresisAccess = 1
	// hysteresis is readable and settable.
	SensorHysteresisAccess_ReadableSettable SensorHysteresisAccess = 2
	// Fixed, unreadable, hysteresis. Hysteresis fields values implemented in the sensor.
	SensorHysteresisAccess_Fixed SensorHysteresisAccess = 3
)

func (SensorHysteresisAccess) String

func (a SensorHysteresisAccess) String() string

type SensorInitialization

type SensorInitialization struct {
	// 1b = Sensor is settable (Support the Set Sensor Reading And Event Status command)
	// 0b = Sensor is not settable
	//
	// using this bit to report settable sensors is optional. I.e. it is
	// ok to report a settable sensor as 'not settable' in the
	// SDR if it is desired to not report this capability to s/w
	Settable bool

	// 1b = enable scanning
	//
	// this bit=1 implies that the sensor
	// accepts the 'enable/disable scanning' bit in the Set
	// Sensor Event Enable command.
	InitScanning bool

	// 1b = enable events (per Sensor Event Message Control
	// Support bits in Sensor Capabilities field, and per
	// the Event Mask fields, below).
	InitEvents bool

	// 1b = initialize sensor thresholds (per settable threshold mask below).
	InitThresholds bool

	// 1b = initialize sensor hysteresis (per Sensor Hysteresis
	// Support bits in the Sensor Capabilities field, below).
	InitHysteresis bool

	// 1b = initialize Sensor Type and Event / Reading Type code
	InitSensorType bool

	// 0b = event generation disabled, 1b = event generation enabled
	EventGenerationEnabled bool
	// 0b = sensor scanning disabled, 1b = sensor scanning enabled
	SensorScanningEnabled bool
}

SDRs of Full/Compact record type has this field.

type SensorModifierRelation

type SensorModifierRelation uint8
const (
	SensorModifierRelation_None SensorModifierRelation = 0
	SensorModifierRelation_Div  SensorModifierRelation = 1 // Basic Unit / Modifier Unit
	SensorModifierRelation_Mul  SensorModifierRelation = 2 // Basic Unit * Mofifier Unit
)

func (SensorModifierRelation) String

func (unit SensorModifierRelation) String() string

type SensorNumber

type SensorNumber uint8

see: Intel System Event Log (SEL) Troubleshooting Guide Rev 3.4 September 2019 section 3.1

type SensorRateUnit

type SensorRateUnit uint8
const (
	SensorRateUnit_None        SensorRateUnit = 0
	SensorRateUnit_PerMicroSec SensorRateUnit = 1
	SensorRateUnit_PerMilliSec SensorRateUnit = 2
	SensorRateUnit_PerSec      SensorRateUnit = 3
	SensorRateUnit_PerMin      SensorRateUnit = 4
	SensorRateUnit_PerHour     SensorRateUnit = 5
	SensorRateUnit_PerDay      SensorRateUnit = 6
	SensorRateUnit_Reserved    SensorRateUnit = 7
)

func (SensorRateUnit) String

func (unit SensorRateUnit) String() string

type SensorStatus

type SensorStatus string

type SensorThreshold

type SensorThreshold struct {
	// type of threshold
	Type SensorThresholdType
	Mask Mask_Threshold
	// theshold raw reading value before conversion
	Raw uint8
}

SensorThreshold holds all values and attributes of a specified threshold type.

type SensorThresholdAccess

type SensorThresholdAccess uint8

SensorThresholdAccess represents the access mode for the threshold value of the sensor.

const (
	// no thresholds.
	SensorThresholdAccess_No SensorThresholdAccess = 0
	// thresholds are readable, per Reading Mask, below.
	SensorThresholdAccess_Readable SensorThresholdAccess = 1
	// thresholds are readable and settable per Reading Mask and Settable Threshold Mask, respectively.
	SensorThresholdAccess_ReadableSettable SensorThresholdAccess = 2
	//  Fixed, unreadable, thresholds. Which thresholds are supported is
	// reflected by the Reading Mask. The threshold value fields report
	// the values that are hard-coded in the sensor.
	SensorThresholdAccess_Fixed SensorThresholdAccess = 3
)

func (SensorThresholdAccess) String

func (a SensorThresholdAccess) String() string

type SensorThresholdStatus

type SensorThresholdStatus string

SensorThresholdStatus are enums for threshold status of sensor.

....UNR status (NonRecoverable) -----------------UNR threshold ....UCR status (Critical) -----------------UCR threshold ....UNC status (NonCritical) -----------------UNC threshold ....OK status (OK) -----------------LNC threshold ....LNC status (NonCritical) -----------------LCR threshold ....LCR status (Critical) -----------------LNR threshold ....LNR status (NonRecoverable)

type SensorThresholdType

type SensorThresholdType string

SensorThresholdType are enums for types of threshold

const (
	SensorThresholdType_LNC SensorThresholdType = "LowerNonCritical"
	SensorThresholdType_LCR SensorThresholdType = "LowerCritical"
	SensorThresholdType_LNR SensorThresholdType = "LowerNonRecoverable"
	SensorThresholdType_UNC SensorThresholdType = "UpperNonCritical"
	SensorThresholdType_UCR SensorThresholdType = "UpperCritical"
	SensorThresholdType_UNR SensorThresholdType = "UpperNonRecoverable"
)

func (SensorThresholdType) Abbr

func (sensorThresholdType SensorThresholdType) Abbr() string

type SensorThresholdTypes

type SensorThresholdTypes []SensorThresholdType

func (SensorThresholdTypes) Strings

func (types SensorThresholdTypes) Strings() []string

type SensorType

type SensorType uint8

41.1 Sensor Type Code 42.2 Sensor Type Codes and Data

const (
	SensorTypeReserved                     SensorType = 0x00
	SensorTypeTemperature                  SensorType = 0x01 // 温度传感器
	SensorTypeVoltage                      SensorType = 0x02 // 电压传感器
	SensorTypeCurrent                      SensorType = 0x03 // 电流传感器
	SensorTypeFan                          SensorType = 0x04 // 风扇传感器
	SensorTypePhysicalSecurity             SensorType = 0x05 // Chassis Intrusion
	SensorTypePlatformSecurity             SensorType = 0x06
	SensorTypeProcessor                    SensorType = 0x07
	SensorTypePowserSupply                 SensorType = 0x08
	SensorTypePowerUnit                    SensorType = 0x09
	SensorTypeCollingDevice                SensorType = 0x0a
	SensorTypeOtherUnitsbased              SensorType = 0x0b
	SensorTypeMemory                       SensorType = 0x0c
	SensorTypeDriveSlot                    SensorType = 0x0d
	SensorTypePostMemoryResize             SensorType = 0x0e
	SensorTypeSystemFirmwareProgress       SensorType = 0x0f
	SensorTypeEventLoggingDisabled         SensorType = 0x10
	SensorTypeWatchdog1                    SensorType = 0x11
	SensorTypeSystemEvent                  SensorType = 0x12
	SensorTypeCriticalInterrupt            SensorType = 0x13
	SensorTypeButtonSwitch                 SensorType = 0x14
	SensorTypeModuleBoard                  SensorType = 0x15
	SensorTypeMicrocontrollerCoprocessor   SensorType = 0x16
	SensorTypeAddinCard                    SensorType = 0x17
	SensorTypeChassis                      SensorType = 0x18
	SensorTypeChipSet                      SensorType = 0x19
	SensorTypeOtherFRU                     SensorType = 0x1a
	SensorTypeCableInterconnect            SensorType = 0x1b
	SensorTypeTerminator                   SensorType = 0x1c
	SensorTypeSystemBootRestartInitiated   SensorType = 0x1d
	SensorTypeBootError                    SensorType = 0x1e
	SensorTypeBaseOSBootInstallationStatus SensorType = 0x1f
	SensorTypeOSStopShutdown               SensorType = 0x20
	SensorTypeSlotConnector                SensorType = 0x21
	SensorTypeSystemACPIPowerState         SensorType = 0x22
	SensorTypeWatchdog2                    SensorType = 0x23
	SensorTypePlatformAlert                SensorType = 0x24
	SensorTypeEntityPresence               SensorType = 0x25
	SensorTypeMonitorASIC                  SensorType = 0x26
	SensorTypeLAN                          SensorType = 0x27
	SensorTypeManagementSubsystemHealth    SensorType = 0x28
	SensorTypeBattery                      SensorType = 0x29
	SensorTypeSessionAudit                 SensorType = 0x2a
	SensorTypeVersionChange                SensorType = 0x2b
	SensorTypeFRUState                     SensorType = 0x2c
)

func (SensorType) String

func (c SensorType) String() string

type SensorUnit

type SensorUnit struct {
	AnalogDataFormat SensorAnalogUnitFormat
	RateUnit         SensorRateUnit
	ModifierRelation SensorModifierRelation
	Percentage       bool // Percentage 0b = no, 1b = yes

	BaseUnit     SensorUnitType
	ModifierUnit SensorUnitType
}

func (SensorUnit) IsAnalog

func (unit SensorUnit) IsAnalog() bool

func (SensorUnit) String

func (unit SensorUnit) String() string

type SensorUnitType

type SensorUnitType uint8

43.17 Sensor Unit Type Codes

const (
	SensorUnitType_Unspecified        SensorUnitType = 0  // unspecified
	SensorUnitType_DegressC           SensorUnitType = 1  // degrees C, Celsius, 摄氏度 ℃
	SensorUnitType_DegreesF           SensorUnitType = 2  // degrees F, Fahrenheit, 华氏度
	SensorUnitType_DegreesK           SensorUnitType = 3  // degrees K, Kelvins, 开尔文
	SensorUnitType_Volts              SensorUnitType = 4  // Volts, 伏特(电压单位)
	SensorUnitType_Amps               SensorUnitType = 5  // Amps, 安培数
	SensorUnitType_Watts              SensorUnitType = 6  // Watts, 瓦特(功率单位)
	SensorUnitType_Joules             SensorUnitType = 7  // Joules, 焦耳
	SensorUnitType_Coulombs           SensorUnitType = 8  // Coulombs, 库伦
	SensorUnitType_VA                 SensorUnitType = 9  // VA, 伏安
	SensorUnitType_Nits               SensorUnitType = 10 // Nits, 尼特(光度单位)
	SensorUnitType_Lumen              SensorUnitType = 11 // lumen, 流明(光通量单位)
	SensorUnitType_Lux                SensorUnitType = 12 // lux, 勒克斯(照明单位)
	SensorUnitType_Candela            SensorUnitType = 13 // Candela, 坎, 坎德拉(发光强度单位)
	SensorUnitType_KPa                SensorUnitType = 14 // kPa kilopascal, 千帕, 千帕斯卡
	SensorUnitType_PSI                SensorUnitType = 15 // PSI
	SensorUnitType_Newton             SensorUnitType = 16 // Newton, 牛顿(力的单位)
	SensorUnitType_CFM                SensorUnitType = 17 // CFM, 风量, cubic feet per minute (cu ft/min)
	SensorUnitType_RPM                SensorUnitType = 18 // RPM, 每分钟转数, Revolutions per minute, is the number of turns in one minute
	SensorUnitType_Hz                 SensorUnitType = 19 // Hz, 赫兹
	SensorUnitType_MicroSecond        SensorUnitType = 20 // microsecond, 微秒
	SensorUnitType_MilliSecond        SensorUnitType = 21 // millisecond, 毫秒
	SensorUnitType_Second             SensorUnitType = 22 // second, 秒
	SensorUnitType_Minute             SensorUnitType = 23 // minute, 分
	SensorUnitType_Hour               SensorUnitType = 24 // hour, 时
	SensorUnitType_Day                SensorUnitType = 25 // day, 日
	SensorUnitType_Week               SensorUnitType = 26 // week, 周
	SensorUnitType_Mil                SensorUnitType = 27 // mil, 毫升;密耳(千分之一寸)
	SensorUnitType_Inches             SensorUnitType = 28 // inches, 英寸(inch的复数)
	SensorUnitType_Fleet              SensorUnitType = 29 // feet
	SensorUnitType_CuIn               SensorUnitType = 30 // cu in, 立方英寸(cubic inch)
	SensorUnitType_CuFleet            SensorUnitType = 31 // cu feet
	SensorUnitType_MM                 SensorUnitType = 32 // mm, 毫米(millimeter)
	SensorUnitType_CM                 SensorUnitType = 33 // cm, 厘米(centimeter)
	SensorUnitType_M                  SensorUnitType = 34 // m, 米
	SensorUnitType_CuCM               SensorUnitType = 35 // cu cm
	SensorUnitType_Cum                SensorUnitType = 36 // cum
	SensorUnitType_Liters             SensorUnitType = 37 // liters, 公升(容量单位)
	SensorUnitType_FluidOunce         SensorUnitType = 38 // fluid ounce, 液盎司(液体容量单位, 等于 fluidounce)
	SensorUnitType_Radians            SensorUnitType = 39 // radians, 弧度(radian的复数)
	SensorUnitType_vSteradians        SensorUnitType = 40 // steradians, 球面度, 立体弧度(立体角国际单位制, 等于 sterad)
	SensorUnitType_Revolutions        SensorUnitType = 41 // revolutions, 转数(revolution的复数形式)
	SensorUnitType_Cycles             SensorUnitType = 42 // cycles, 周期, 圈
	SensorUnitType_Gravities          SensorUnitType = 43 // gravities, 重力
	SensorUnitType_Ounce              SensorUnitType = 44 // ounce, 盎司
	SensorUnitType_Pound              SensorUnitType = 45 // pound, 英镑
	SensorUnitType_FootPound          SensorUnitType = 46 // ft-lb, 英尺-磅(foot pound)
	SensorUnitType_OzIn               SensorUnitType = 47 // oz-in, 扭力;盎司英寸
	SensorUnitType_Gauss              SensorUnitType = 48 // gauss, 高斯(磁感应或磁场的单位)
	SensorUnitType_Gilberts           SensorUnitType = 49 // gilberts, 吉伯(磁通量的单位)
	SensorUnitType_Henry              SensorUnitType = 50 // henry, 亨利(电感单位)
	SensorUnitType_MilliHenry         SensorUnitType = 51 // millihenry, 毫亨(利)(电感单位)
	SensorUnitType_Farad              SensorUnitType = 52 // farad, 法拉(电容单位)
	SensorUnitType_MicroFarad         SensorUnitType = 53 // microfarad, 微法拉(电容量的实用单位)
	SensorUnitType_Ohms               SensorUnitType = 54 // ohms, 欧姆(Ohm) :电阻的量度单位, 欧姆值越大, 电阻越大
	SensorUnitType_Siemens            SensorUnitType = 55 // siemens, 西门子, 电导单位
	SensorUnitType_Mole               SensorUnitType = 56 // mole, 摩尔 [化学] 克分子(等于mole)
	SensorUnitType_Becquerel          SensorUnitType = 57 // becquerel, 贝可(放射性活度单位)
	SensorUnitType_PPM                SensorUnitType = 58 // PPM (parts/million), 百万分率, 百万分之…(parts per million)
	SensorUnitType_Reserved           SensorUnitType = 59 // reserved
	SensorUnitType_Decibels           SensorUnitType = 60 // Decibels, 分贝(声音强度单位, decibel的复数)
	SensorUnitType_DbA                SensorUnitType = 61 // DbA, dBA is often used to specify the loudness of the fan used to cool the microprocessor and associated components. Typical dBA ratings are in the neighborhood of 25 dBA, representing 25 A-weighted decibels above the threshold of hearing. This is approximately the loudness of a person whispering in a quiet room.
	SensorUnitType_DbC                SensorUnitType = 62 // DbC
	SensorUnitType_Gray               SensorUnitType = 63 // gray, 核吸收剂量(Gy)
	SensorUnitType_Severt             SensorUnitType = 64 // sievert, 希沃特(辐射效果单位, 简称希)
	SensorUnitType_ColorTempDegK      SensorUnitType = 65 // color temp deg K, 色温
	SensorUnitType_Bit                SensorUnitType = 66 // bit, 比特(二进位制信息单位)
	SensorUnitType_Kilobit            SensorUnitType = 67 // kilobit, 千比特
	SensorUnitType_Megabit            SensorUnitType = 68 // megabit, 兆比特
	SensorUnitType_Gigabit            SensorUnitType = 69 // gigabit, 吉比特
	SensorUnitType_Byte               SensorUnitType = 70 // byte, 字节
	SensorUnitType_Kilobyte           SensorUnitType = 71 // kilobyte, 千字节
	SensorUnitType_Megabyte           SensorUnitType = 72 // megabyte, 兆字节
	SensorUnitType_Gigabyte           SensorUnitType = 73 // gigabyte, 吉字节
	SensorUnitType_Word               SensorUnitType = 74 // word (data), 字
	SensorUnitType_DWord              SensorUnitType = 75 // dword, 双字
	SensorUnitType_QWord              SensorUnitType = 76 // qword, 四字
	SensorUnitType_Line               SensorUnitType = 77 // line (re. mem. line)
	SensorUnitType_Hit                SensorUnitType = 78 // hit, 命中
	SensorUnitType_Miss               SensorUnitType = 79 // miss, 未击中, 未命中
	SensorUnitType_Retry              SensorUnitType = 80 // retry, 重试(次数)
	SensorUnitType_Reset              SensorUnitType = 81 // reset, 重置(次数)
	SensorUnitType_Overrun            SensorUnitType = 82 // overrun) / overflow 满载, 溢出(次数)
	SensorUnitType_Underrun           SensorUnitType = 83 // underrun 欠载
	SensorUnitType_Collision          SensorUnitType = 84 // collision, 冲突
	SensorUnitType_Packet             SensorUnitType = 85 // packets, 包, 数据包
	SensorUnitType_Message            SensorUnitType = 86 // messages, 消息
	SensorUnitType_Characters         SensorUnitType = 87 // characters, 字符
	SensorUnitType_Error              SensorUnitType = 88 // error, 错误
	SensorUnitType_CorrectableError   SensorUnitType = 89 // correctable error 可校正错误
	SensorUnitType_UncorrectableError SensorUnitType = 90 // uncorrectable error 不可校正错误
	SensorUnitType_FatalError         SensorUnitType = 91 // fatal error, 致命错误, 不可恢复的错误
	SensorUnitType_Grams              SensorUnitType = 92 // grams, 克(gram的复数形式)
)

func (SensorUnitType) String

func (u SensorUnitType) String() string

type Session15

type Session15 struct {
	SessionHeader15 *SessionHeader15

	Payload []byte

	// legacy PAD not needed for IPMI v2.0
	LegacyPAD byte
}

func (*Session15) Pack

func (s *Session15) Pack() []byte

func (*Session15) Unpack

func (s *Session15) Unpack(msg []byte) error

type Session20

type Session20 struct {
	SessionHeader20 *SessionHeader20

	// for encrypted packets, it should contain Confidentiality Header, Encrypted Payload, and Confidentiality Trailer.
	SessionPayload []byte

	// For IPMI v2.0 RMCP+ packets, the IPMI Session Trailer is absent whenever the Session ID is 0000_0000h, or whenever bit 6 in the payload type field indicates the packet is unauthenticated.
	SessionTrailer *SessionTrailer
}

func (*Session20) Pack

func (s *Session20) Pack() []byte

func (*Session20) Unpack

func (s *Session20) Unpack(msg []byte) error

type SessionHeader15

type SessionHeader15 struct {
	// For IPMI 1.5, it's value is 00h, 01h, 02h, 04h, 05h
	AuthType AuthType

	// For IPMI v2.0 RMCP+ there are separate sequence numbers tracked for authenticated and unauthenticated packets.
	// 0000_0000h is used for packets that are sent outside of a Session.
	Sequence uint32

	SessionID uint32

	// The Authentication Code field in the Session header may or may not be present based on the Authentication Type. The authentication code field is absent whenever the Authentication Type is NONE. Whether the authentication code field is present or not when the Authentication Type = OEM is dependent on the OEM identified in the Get Channel Authentication Capabilities command.
	//
	// 16 bytes, not present when Authentication Type set to none
	AuthCode []byte // IPMI 1.5

	// Payload length in bytes. 1-based.
	// IPMI 1.5 should be uint8
	// You should construct SessionHeader after the payload is created, thus you can fill the length here.
	PayloadLength uint8
}

SessionHeader15 for IPMI 1.5 see 22.12, Table 13.

Whether the Session header fields are present in a packet is based on whether the channel is specified as supporting multiple sessions or not. In addition, which Session fields are present is based on the authentication type. Single-Session connections and Session-less channels do not include Session header fields.

Session header fields are present on all packets where the channel and connection mode is specified as supporting multiple sessions, even if the particular implementation only supports one Session.

Note that the command tables do not show the Session header fields except for the Get Channel Authentication Capabilities, Get Session Challenge, and Activate Session commands. However, they are still required for all commands on a multi-Session connection.

func (*SessionHeader15) Pack

func (h *SessionHeader15) Pack() []byte

func (*SessionHeader15) Unpack

func (h *SessionHeader15) Unpack(msg []byte) error

type SessionHeader20

type SessionHeader20 struct {
	// For IPMI 2.0, it's value is always 06h
	AuthType AuthType

	PayloadEncrypted     bool
	PayloadAuthenticated bool
	PayloadType          PayloadType

	// The complete identification of an OEM Payload is given by the combination of a three-byte IANA ID for the OEM, a reserved byte, plus a twobyte OEM Payload ID that is assigned and defined by the given OEM
	OEMIANA      uint32
	OEMPayloadID uint16

	// Should be set to bmcSessionID (generated by bmc, cached by remote console)
	SessionID uint32

	// For IPMI v2.0 RMCP+ there are separate sequence numbers tracked for authenticated and unauthenticated packets.
	// 0000_0000h is used for packets that are sent outside of a Session.
	Sequence uint32

	// Payload length in bytes. 1-based.
	// You should construct SessionHeader after the payload is created, thus you can fill the length here.
	// IPMI 2.0 should be uint16
	PayloadLength uint16
}

SessionHeader20 for IPMI 2.0

func (*SessionHeader20) Pack

func (h *SessionHeader20) Pack() []byte

func (*SessionHeader20) Unpack

func (h *SessionHeader20) Unpack(msg []byte) error

type SessionState

type SessionState uint8
const (
	SessionStatePreSession          SessionState = 0x00
	SessionStateOpenSessionSent     SessionState = 0x01
	SessionStateOpenSessionReceived SessionState = 0x02
	SessionStateRakp1Sent           SessionState = 0x03
	SessionStateRakp2Received       SessionState = 0x04
	SessionStateRakp3Sent           SessionState = 0x05
	SessionStateActive              SessionState = 0x06
	SessionStateCloseSent           SessionState = 0x07
)

type SessionTrailer

type SessionTrailer struct {

	// Added as needed to cause the number of bytes in the data range covered by the AuthCode (Integrity Data) field to be a multiple of 4 bytes (DWORD). If present, each Integrity Pad byte is set to FFh.
	IntegrityPAD []byte

	// indicates how many pad bytes were added so that the amount of non-pad data can be determined.
	PadLength uint8

	// Reserved in IPMI v2.0. Set to 07h for RMCP+ packets defined in this specification.
	NextHeader uint8

	// For IPMI v2.0 (RMCP+) if this field is present, then it is calculated according to the Integrity Algorithm that was negotiated during the Session open process. See Table 13-, Integrity Algorithm Numbers.
	// This field is absent when the packet is unauthenticated.
	AuthCode []byte // Integrity Data
}

For IPMI v2.0 RMCP+ packets, the IPMI Session Trailer is absent whenever the Session ID is 0000_0000h, or whenever bit 6 in the payload type field indicates the packet is unauthenticated

func (*SessionTrailer) Pack

func (s *SessionTrailer) Pack() []byte

func (*SessionTrailer) Unpack

func (s *SessionTrailer) Unpack(msg []byte, off int, padSize int) (int, error)

type SetACPIPowerStateRequest

type SetACPIPowerStateRequest struct {
	SetSystemPowerState bool // false means don't change system power state
	SystemPowerState    SystemPowerState
	SetDevicePowerState bool // false means don't change device power state
	DevicePowerState    DevicePowerState
}

20.6 Set ACPI Power State Command

func (*SetACPIPowerStateRequest) Command

func (req *SetACPIPowerStateRequest) Command() Command

func (*SetACPIPowerStateRequest) Pack

func (req *SetACPIPowerStateRequest) Pack() []byte

type SetACPIPowerStateResponse

type SetACPIPowerStateResponse struct {
}

func (*SetACPIPowerStateResponse) CompletionCodes

func (res *SetACPIPowerStateResponse) CompletionCodes() map[uint8]string

func (*SetACPIPowerStateResponse) Format

func (res *SetACPIPowerStateResponse) Format() string

func (*SetACPIPowerStateResponse) Unpack

func (res *SetACPIPowerStateResponse) Unpack(msg []byte) error

type SetBMCGlobalEnablesRequest

type SetBMCGlobalEnablesRequest struct {
	// Generic system mgmt. software must do a "read-modifywrite" using the Get BMC Global Enables and Set BMC Global Enables to avoid altering EnableOEM_X field.
	EnableOEM2 bool
	EnableOEM1 bool
	EnableOEM0 bool

	EnableSystemEventLogging              bool
	EnableEventMessageBuffer              bool
	EnableEventMessageBufferFullInterrupt bool
	EnableReceiveMessageQueueInterrupt    bool
}

22.1 Set BMC Global Enables Command

func (*SetBMCGlobalEnablesRequest) Command

func (req *SetBMCGlobalEnablesRequest) Command() Command

func (*SetBMCGlobalEnablesRequest) Pack

func (req *SetBMCGlobalEnablesRequest) Pack() []byte

type SetBMCGlobalEnablesResponse

type SetBMCGlobalEnablesResponse struct {
}

func (*SetBMCGlobalEnablesResponse) CompletionCodes

func (*SetBMCGlobalEnablesResponse) CompletionCodes() map[uint8]string

func (*SetBMCGlobalEnablesResponse) Format

func (res *SetBMCGlobalEnablesResponse) Format() string

func (*SetBMCGlobalEnablesResponse) Unpack

func (res *SetBMCGlobalEnablesResponse) Unpack(msg []byte) error

type SetChannelAccessRequest

type SetChannelAccessRequest struct {
	ChannnelNumber uint8

	// [7:6] - 00b = don't set or change Channel Access
	//         01b = set non-volatile Channel Access according to bits [5:0]
	//         10b = set volatile (active) setting of Channel Access according to bit [5:0]
	//         11b = reserved
	AccessOption         uint8
	DisablePEFAlerting   bool
	DisablePerMsgAuth    bool
	DisableUserLevelAuth bool
	AccessMode           ChannelAccessMode

	PrivilegeOption   uint8
	MaxPrivilegeLevel uint8
}

22.22 Set Channel Access Command

func (*SetChannelAccessRequest) Command

func (req *SetChannelAccessRequest) Command() Command

func (*SetChannelAccessRequest) Pack

func (req *SetChannelAccessRequest) Pack() []byte

type SetChannelAccessResponse

type SetChannelAccessResponse struct {
}

func (*SetChannelAccessResponse) CompletionCodes

func (res *SetChannelAccessResponse) CompletionCodes() map[uint8]string

func (*SetChannelAccessResponse) Format

func (res *SetChannelAccessResponse) Format() string

func (*SetChannelAccessResponse) Unpack

func (res *SetChannelAccessResponse) Unpack(msg []byte) error

type SetChassisCapabilitiesRequest

type SetChassisCapabilitiesRequest struct {
	ProvideFrontPanelLockout bool
	ProvideIntrusionSensor   bool

	FRUDeviceAddress uint8

	SDRDeviceAddress uint8

	SELDeviceAddress uint8

	SystemManagementDeviceAddress uint8

	BridgeDeviceAddress uint8
}

28.7 Set Chassis Capabilities Command

func (*SetChassisCapabilitiesRequest) Command

func (req *SetChassisCapabilitiesRequest) Command() Command

func (*SetChassisCapabilitiesRequest) Pack

func (req *SetChassisCapabilitiesRequest) Pack() []byte

type SetChassisCapabilitiesResponse

type SetChassisCapabilitiesResponse struct {
}

func (*SetChassisCapabilitiesResponse) CompletionCodes

func (res *SetChassisCapabilitiesResponse) CompletionCodes() map[uint8]string

func (*SetChassisCapabilitiesResponse) Format

func (res *SetChassisCapabilitiesResponse) Format() string

func (*SetChassisCapabilitiesResponse) Unpack

func (res *SetChassisCapabilitiesResponse) Unpack(msg []byte) error

type SetEventReceiverRequest

type SetEventReceiverRequest struct {
	// Event Receiver Slave Address. 0FFh disables Event Message Generation, Otherwise:
	// [7:1] - IPMB (I2C) Slave Address
	// [0] - always 0b when [7:1] hold I2C slave address
	SlaveAddress uint8
	// [1:0] - Event Receiver LUN
	LUN uint8
}

29.1 Set Event Receiver Command

func (*SetEventReceiverRequest) Command

func (req *SetEventReceiverRequest) Command() Command

func (*SetEventReceiverRequest) Pack

func (req *SetEventReceiverRequest) Pack() []byte

type SetEventReceiverResponse

type SetEventReceiverResponse struct {
}

func (*SetEventReceiverResponse) CompletionCodes

func (res *SetEventReceiverResponse) CompletionCodes() map[uint8]string

func (*SetEventReceiverResponse) Format

func (res *SetEventReceiverResponse) Format() string

func (*SetEventReceiverResponse) Unpack

func (res *SetEventReceiverResponse) Unpack(msg []byte) error

type SetFrontPanelEnablesRequest

type SetFrontPanelEnablesRequest struct {
	DisableSleepButton      bool
	DisableDiagnosticButton bool
	DisableResetButton      bool
	DisablePoweroffButton   bool
}

28.6 Set Front Panel Enables 定位

func (*SetFrontPanelEnablesRequest) Command

func (req *SetFrontPanelEnablesRequest) Command() Command

func (*SetFrontPanelEnablesRequest) Pack

func (req *SetFrontPanelEnablesRequest) Pack() []byte

type SetFrontPanelEnablesResponse

type SetFrontPanelEnablesResponse struct {
}

func (*SetFrontPanelEnablesResponse) CompletionCodes

func (res *SetFrontPanelEnablesResponse) CompletionCodes() map[uint8]string

func (*SetFrontPanelEnablesResponse) Format

func (res *SetFrontPanelEnablesResponse) Format() string

func (*SetFrontPanelEnablesResponse) Unpack

func (res *SetFrontPanelEnablesResponse) Unpack(msg []byte) error

type SetInProgress

type SetInProgress uint8

func (SetInProgress) String

func (p SetInProgress) String() string

type SetLanConfigParamsRequest

type SetLanConfigParamsRequest struct {
	ChannelNumber int8
	ParamSelector LanParamSelector
	ConfigData    []byte
}

23.1 Set LAN Configuration Parameters Command

func (*SetLanConfigParamsRequest) Command

func (req *SetLanConfigParamsRequest) Command() Command

func (*SetLanConfigParamsRequest) Pack

func (req *SetLanConfigParamsRequest) Pack() []byte

type SetLanConfigParamsResponse

type SetLanConfigParamsResponse struct {
}

func (*SetLanConfigParamsResponse) CompletionCodes

func (res *SetLanConfigParamsResponse) CompletionCodes() map[uint8]string

func (*SetLanConfigParamsResponse) Format

func (res *SetLanConfigParamsResponse) Format() string

func (*SetLanConfigParamsResponse) Unpack

func (res *SetLanConfigParamsResponse) Unpack(msg []byte) error

type SetPowerCycleIntervalRequest

type SetPowerCycleIntervalRequest struct {
	IntervalInSec uint8
}

28.9 Set Power Cycle Interval

func (*SetPowerCycleIntervalRequest) Command

func (req *SetPowerCycleIntervalRequest) Command() Command

func (*SetPowerCycleIntervalRequest) Pack

func (req *SetPowerCycleIntervalRequest) Pack() []byte

type SetPowerCycleIntervalResponse

type SetPowerCycleIntervalResponse struct {
}

func (*SetPowerCycleIntervalResponse) CompletionCodes

func (res *SetPowerCycleIntervalResponse) CompletionCodes() map[uint8]string

func (*SetPowerCycleIntervalResponse) Format

func (res *SetPowerCycleIntervalResponse) Format() string

func (*SetPowerCycleIntervalResponse) Unpack

func (res *SetPowerCycleIntervalResponse) Unpack(msg []byte) error

type SetPowerRestorePolicyRequest

type SetPowerRestorePolicyRequest struct {
	PowerRestorePolicy
}

28.8 Set Power Restore Policy Command

func (*SetPowerRestorePolicyRequest) Command

func (req *SetPowerRestorePolicyRequest) Command() Command

func (*SetPowerRestorePolicyRequest) Pack

func (req *SetPowerRestorePolicyRequest) Pack() []byte

type SetPowerRestorePolicyResponse

type SetPowerRestorePolicyResponse struct {
	SupportPolicyAlwaysOn  bool // chassis supports always powering up after AC/mains returns
	SupportPolicyPrevious  bool // chassis supports restoring power to state that was in effect when AC/mains was lost
	SupportPolicyAlwaysOff bool // chassis supports staying powered off after AC/mains returns
}

func (*SetPowerRestorePolicyResponse) CompletionCodes

func (res *SetPowerRestorePolicyResponse) CompletionCodes() map[uint8]string

func (*SetPowerRestorePolicyResponse) Format

func (res *SetPowerRestorePolicyResponse) Format() string

func (*SetPowerRestorePolicyResponse) Unpack

func (res *SetPowerRestorePolicyResponse) Unpack(msg []byte) error

type SetSELTimeRequest

type SetSELTimeRequest struct {
	Time time.Time
}

31.11 Set SEL Time Command

func (*SetSELTimeRequest) Command

func (req *SetSELTimeRequest) Command() Command

func (*SetSELTimeRequest) Pack

func (req *SetSELTimeRequest) Pack() []byte

type SetSELTimeResponse

type SetSELTimeResponse struct {
}

func (*SetSELTimeResponse) CompletionCodes

func (res *SetSELTimeResponse) CompletionCodes() map[uint8]string

func (*SetSELTimeResponse) Format

func (res *SetSELTimeResponse) Format() string

func (*SetSELTimeResponse) Unpack

func (res *SetSELTimeResponse) Unpack(msg []byte) error

type SetSELTimeUTCOffsetRequest

type SetSELTimeUTCOffsetRequest struct {
	// signed integer for the offset in minutes from UTC to SEL Time. (ranges from -1440 to 1440)
	MinutesOffset int16
}

31.11a Set SEL Time UTC Offset

func (*SetSELTimeUTCOffsetRequest) Command

func (req *SetSELTimeUTCOffsetRequest) Command() Command

func (*SetSELTimeUTCOffsetRequest) Pack

func (req *SetSELTimeUTCOffsetRequest) Pack() []byte

type SetSELTimeUTCOffsetResponse

type SetSELTimeUTCOffsetResponse struct {
}

func (*SetSELTimeUTCOffsetResponse) CompletionCodes

func (res *SetSELTimeUTCOffsetResponse) CompletionCodes() map[uint8]string

func (*SetSELTimeUTCOffsetResponse) Format

func (res *SetSELTimeUTCOffsetResponse) Format() string

func (*SetSELTimeUTCOffsetResponse) Unpack

func (res *SetSELTimeUTCOffsetResponse) Unpack(msg []byte) error

type SetSOLConfigParamsRequest

type SetSOLConfigParamsRequest struct {
	ChannelNumber     uint8
	ParameterSelector uint8
	ParameterData     []byte
}

26.2 Set SOL Configuration Parameters Command

func (*SetSOLConfigParamsRequest) Command

func (req *SetSOLConfigParamsRequest) Command() Command

func (*SetSOLConfigParamsRequest) Pack

func (req *SetSOLConfigParamsRequest) Pack() []byte

type SetSOLConfigurationParametersResponse

type SetSOLConfigurationParametersResponse struct {
}

func (*SetSOLConfigurationParametersResponse) CompletionCodes

func (res *SetSOLConfigurationParametersResponse) CompletionCodes() map[uint8]string

func (*SetSOLConfigurationParametersResponse) Format

func (*SetSOLConfigurationParametersResponse) Unpack

type SetSensorHysteresisRequest

type SetSensorHysteresisRequest struct {
	SensorNumber       uint8
	PositiveHysteresis uint8
	NegativeHysteresis uint8
}

35.6 Set Sensor Hysteresis Command

func (*SetSensorHysteresisRequest) Command

func (req *SetSensorHysteresisRequest) Command() Command

func (*SetSensorHysteresisRequest) Pack

func (req *SetSensorHysteresisRequest) Pack() []byte

type SetSensorHysteresisResponse

type SetSensorHysteresisResponse struct {
}

func (*SetSensorHysteresisResponse) CompletionCodes

func (r *SetSensorHysteresisResponse) CompletionCodes() map[uint8]string

func (*SetSensorHysteresisResponse) Format

func (res *SetSensorHysteresisResponse) Format() string

func (*SetSensorHysteresisResponse) Unpack

func (res *SetSensorHysteresisResponse) Unpack(msg []byte) error

type SetSensorReadingAndEventStatusRequest

type SetSensorReadingAndEventStatusRequest struct {
	SensorNumber uint8

	EventDataBytesOperation  uint8
	AssertionBitsOperation   uint8
	DeassertionBitsOperation uint8
	SensorReadingOperation   uint8

	SensorReading uint8

	SensorEventFlag

	EventData1 uint8
	EventData2 uint8
	EventData3 uint8
}

35.17 Set Sensor Reading And Event Status Command

func (*SetSensorReadingAndEventStatusRequest) Command

func (*SetSensorReadingAndEventStatusRequest) Pack

type SetSensorReadingAndEventStatusResponse

type SetSensorReadingAndEventStatusResponse struct {
}

func (*SetSensorReadingAndEventStatusResponse) CompletionCodes

func (r *SetSensorReadingAndEventStatusResponse) CompletionCodes() map[uint8]string

func (*SetSensorReadingAndEventStatusResponse) Format

func (*SetSensorReadingAndEventStatusResponse) Unpack

type SetSensorThresholdsRequest

type SetSensorThresholdsRequest struct {
	SensorNumber uint8

	// Set Threshold flag
	SetUNR bool
	SetUCR bool
	SetUNC bool
	SetLNR bool
	SetLCR bool
	SetLNC bool

	// Threshold value
	LNC_Raw uint8
	LCR_Raw uint8
	LNR_Raw uint8
	UNC_Raw uint8
	UCR_Raw uint8
	UNR_Raw uint8
}

35.8 Set Sensor Thresholds Command

func (*SetSensorThresholdsRequest) Command

func (req *SetSensorThresholdsRequest) Command() Command

func (*SetSensorThresholdsRequest) Pack

func (req *SetSensorThresholdsRequest) Pack() []byte

type SetSensorThresholdsResponse

type SetSensorThresholdsResponse struct {
}

func (*SetSensorThresholdsResponse) CompletionCodes

func (r *SetSensorThresholdsResponse) CompletionCodes() map[uint8]string

func (*SetSensorThresholdsResponse) Format

func (res *SetSensorThresholdsResponse) Format() string

func (*SetSensorThresholdsResponse) Unpack

func (res *SetSensorThresholdsResponse) Unpack(msg []byte) error

type SetSensorTypeRequest

type SetSensorTypeRequest struct {
	SensorNumber     uint8
	SensorType       SensorType
	EventReadingType EventReadingType
}

35.15 Set Sensor Type Command

func (*SetSensorTypeRequest) Command

func (req *SetSensorTypeRequest) Command() Command

func (*SetSensorTypeRequest) Pack

func (req *SetSensorTypeRequest) Pack() []byte

type SetSensorTypeResponse

type SetSensorTypeResponse struct {
}

func (*SetSensorTypeResponse) CompletionCodes

func (r *SetSensorTypeResponse) CompletionCodes() map[uint8]string

func (*SetSensorTypeResponse) Format

func (res *SetSensorTypeResponse) Format() string

func (*SetSensorTypeResponse) Unpack

func (res *SetSensorTypeResponse) Unpack(msg []byte) error

type SetSessionPrivilegeLevelRequest

type SetSessionPrivilegeLevelRequest struct {
	PrivilegeLevel PrivilegeLevel
}

22.18 Set Session Privilege Level Command

func (*SetSessionPrivilegeLevelRequest) Command

func (*SetSessionPrivilegeLevelRequest) Pack

func (req *SetSessionPrivilegeLevelRequest) Pack() []byte

type SetSessionPrivilegeLevelResponse

type SetSessionPrivilegeLevelResponse struct {
	// New Privilege Level (or present level if 'return present privilege level' was selected.)
	PrivilegeLevel uint8
}

func (*SetSessionPrivilegeLevelResponse) CompletionCodes

func (*SetSessionPrivilegeLevelResponse) CompletionCodes() map[uint8]string

func (*SetSessionPrivilegeLevelResponse) Format

func (*SetSessionPrivilegeLevelResponse) Unpack

func (res *SetSessionPrivilegeLevelResponse) Unpack(msg []byte) error

type SetSystemBootOptionsRequest

type SetSystemBootOptionsRequest struct {
	// Thus, the BMC will automatically clear a 'boot flags valid bit' if
	// a system restart is not initiated by a Chassis Control command
	// within 60 seconds +/- 10% of the valid flag being set.
	//
	// The BMC will also clear the bit on any system resets or power-cycles that
	// are not triggered by a System Control command.
	//
	// This default behavior can be temporarily overridden using the 'BMC boot flag valid bit clearing' parameter.
	// [7] - 1b = mark parameter invalid / locked
	// 0b = mark parameter valid / unlocked
	MarkParameterInvalid bool
	// [6:0] - boot option parameter selector
	ParameterSelector BootOptionParameterSelector

	BootOptionParameter BootOptionParameter
}

28.12 Set System Boot Options Command

func (*SetSystemBootOptionsRequest) Command

func (req *SetSystemBootOptionsRequest) Command() Command

func (*SetSystemBootOptionsRequest) Pack

func (req *SetSystemBootOptionsRequest) Pack() []byte

type SetSystemBootOptionsResponse

type SetSystemBootOptionsResponse struct {
}

func (*SetSystemBootOptionsResponse) CompletionCodes

func (res *SetSystemBootOptionsResponse) CompletionCodes() map[uint8]string

func (*SetSystemBootOptionsResponse) Format

func (res *SetSystemBootOptionsResponse) Format() string

func (*SetSystemBootOptionsResponse) Unpack

func (res *SetSystemBootOptionsResponse) Unpack(msg []byte) error

type SetUserAccessRequest

type SetUserAccessRequest struct {
	EnableChanging bool

	RestrictedToCallback bool

	EnableLinkAuth bool

	EnableIPMIMessaging bool

	ChannelNumber uint8

	UserID uint8

	MaxPrivLevel uint8

	SessionLimit uint8
}

22.26 Set User Access Command

func (*SetUserAccessRequest) Command

func (req *SetUserAccessRequest) Command() Command

func (*SetUserAccessRequest) Pack

func (req *SetUserAccessRequest) Pack() []byte

type SetUserAccessResponse

type SetUserAccessResponse struct {
}

func (*SetUserAccessResponse) CompletionCodes

func (res *SetUserAccessResponse) CompletionCodes() map[uint8]string

func (*SetUserAccessResponse) Format

func (res *SetUserAccessResponse) Format() string

func (*SetUserAccessResponse) Unpack

func (res *SetUserAccessResponse) Unpack(msg []byte) error

type SetUserPasswordRequest

type SetUserPasswordRequest struct {
	// [5:0] - User ID. 000000b = reserved. (User ID 1 is permanently associated with User 1, the null user name).
	UserID uint8

	// The BMC shall maintain an internal tag that indicates whether
	// the password was set as a 16-byte or as a 20-byte password.
	Stored20 bool

	Operation PasswordOperation

	Password string
}

22.30 Set User Password Command

func (*SetUserPasswordRequest) Command

func (req *SetUserPasswordRequest) Command() Command

func (*SetUserPasswordRequest) Pack

func (req *SetUserPasswordRequest) Pack() []byte

type SetUserPasswordResponse

type SetUserPasswordResponse struct {
}

func (*SetUserPasswordResponse) CompletionCodes

func (res *SetUserPasswordResponse) CompletionCodes() map[uint8]string

func (*SetUserPasswordResponse) Format

func (res *SetUserPasswordResponse) Format() string

func (*SetUserPasswordResponse) Unpack

func (res *SetUserPasswordResponse) Unpack(msg []byte) error

type SetUsernameRequest

type SetUsernameRequest struct {
	// [5:0] - User ID. 000000b = reserved. (User ID 1 is permanently associated with User 1, the null user name).
	UserID uint8

	// User Name String in ASCII, 16 bytes, max. Strings with fewer than 16
	// characters are terminated with a null (00h) character and 00h padded to 16
	// bytes. When the string is read back using the Get User Name command,
	// those bytes shall be returned as 0s.
	// Here if string length is longer than 16, it would be auto truncated.
	Username string
}

22.28 Set User Name Command

func (*SetUsernameRequest) Command

func (req *SetUsernameRequest) Command() Command

func (*SetUsernameRequest) Pack

func (req *SetUsernameRequest) Pack() []byte

type SetUsernameResponse

type SetUsernameResponse struct {
	GUID [16]byte
}

func (*SetUsernameResponse) CompletionCodes

func (res *SetUsernameResponse) CompletionCodes() map[uint8]string

func (*SetUsernameResponse) Format

func (res *SetUsernameResponse) Format() string

func (*SetUsernameResponse) Unpack

func (res *SetUsernameResponse) Unpack(msg []byte) error

type SetWatchdogTimerRequest

type SetWatchdogTimerRequest struct {
	DontLog       bool
	DontStopTimer bool
	TimerUse      TimerUse

	PreTimeoutInterrupt  PreTimeoutInterrupt
	TimeoutAction        TimeoutAction
	PreTimeoutIntevalSec uint8

	ExpirationFlags  uint8
	InitialCountdown uint16
}

27.6 Set Watchdog Timer Command

func (*SetWatchdogTimerRequest) Command

func (req *SetWatchdogTimerRequest) Command() Command

func (*SetWatchdogTimerRequest) Pack

func (req *SetWatchdogTimerRequest) Pack() []byte

type SetWatchdogTimerResponse

type SetWatchdogTimerResponse struct {
}

func (*SetWatchdogTimerResponse) CompletionCodes

func (res *SetWatchdogTimerResponse) CompletionCodes() map[uint8]string

func (*SetWatchdogTimerResponse) Format

func (res *SetWatchdogTimerResponse) Format() string

func (*SetWatchdogTimerResponse) Unpack

func (res *SetWatchdogTimerResponse) Unpack(msg []byte) error

type SoftwareID

type SoftwareID uint8

5.4 Sensor Owner Identification the "owner" of the sensor. The combination of Sensor Owner ID and Sensor Number uniquely identify a sensor in the system. the Sensor Data Record and SEL information must contain information to identify the "owner" of the sensor.

For management controllers, a Slave Address and LUN identify the owner of a sensor on the IPMB.

For system software, a Software ID identifies the owner of a sensor.

These fields are used in Event Messages, where events from management controllers or the IPMB are identified by an eight-bit field where the upper 7-bits are the Slave Address or System Software ID.

The least significant bit is a 0 if the value represents a Slave Address and a 1 if the value represents a System Software ID. So all Software IDs are odd numbers (because the bit 0 is fixed to 1b), and all slave addresses are even numbers (because bit 0 is fixed to 0b)

5.5 Software IDs (SWIDs)

func (SoftwareID) Type

func (i SoftwareID) Type() SoftwareType

Software IDs can be cla

type SoftwareType

type SoftwareType string
const (
	SoftwareTypeBIOS        SoftwareType = "BIOS"
	SoftwareTypeSMIHandler  SoftwareType = "SMI Handler"
	SoftwareTypeSMS         SoftwareType = "System Management Software"
	SoftwareTypeOEM         SoftwareType = "OEM"
	SoftwareTypeRCS         SoftwareType = "Remote Console Software"
	SoftwareTypeTerminalRCS SoftwareType = "Terminal Mode Remote Console Softeware"
	SoftwareTypeReserved    SoftwareType = "Reserved"
)

type SuspendARPsRequest

type SuspendARPsRequest struct {
	ChannelNumber        uint8
	SuspendARP           bool
	SuspendGratuitousARP bool
}

23.3 Suspend BMC ARPs Command

func (*SuspendARPsRequest) Command

func (req *SuspendARPsRequest) Command() Command

func (*SuspendARPsRequest) Pack

func (req *SuspendARPsRequest) Pack() []byte

type SuspendARPsResponse

type SuspendARPsResponse struct {
	IsARPOccurring           bool
	IsGratuitousARPOccurring bool
}

func (*SuspendARPsResponse) CompletionCodes

func (res *SuspendARPsResponse) CompletionCodes() map[uint8]string

func (*SuspendARPsResponse) Format

func (res *SuspendARPsResponse) Format() string

func (*SuspendARPsResponse) Unpack

func (res *SuspendARPsResponse) Unpack(msg []byte) error

type SystemInterfaceType

type SystemInterfaceType uint8
const (
	SystemInterfaceTypeSSIF SystemInterfaceType = 0x00
	SystemInterfaceTypeKCS  SystemInterfaceType = 0x01
	SystemInterfaceTypeSMIC SystemInterfaceType = 0x02
)

type SystemRestartCause

type SystemRestartCause uint8

func (SystemRestartCause) String

func (c SystemRestartCause) String() string

type TimeoutAction

type TimeoutAction uint8
const (
	TimeoutActionNoAction   TimeoutAction = 0x00
	TimeoutActionHardReset  TimeoutAction = 0x01
	TimeoutActionPowerDown  TimeoutAction = 0x02
	TimeoutActionPowerCycle TimeoutAction = 0x03
)

func (TimeoutAction) String

func (t TimeoutAction) String() string

type TimerUse

type TimerUse uint8
const (
	TimerUseBIOSFRB2 TimerUse = 0x01
	TimerUseBIOSPOST TimerUse = 0x02
	TimerUseOSLoad   TimerUse = 0x03
	TimerUseSMSOS    TimerUse = 0x04
	TimerUseOEM      TimerUse = 0x05
)

func (TimerUse) String

func (t TimerUse) String() string

type TypeLength

type TypeLength uint8

43.15 Type/Length Byte Format

7:6 00 = Unicode
         00b define a Unicode string in the IPMI specification,
         whereas they specify a binary field in the Platform Management FRU specification.
    01 = BCD plus (see below)
    10 = 6-bit ASCII, packed
    11 = 8-bit ASCII + Latin 1.
        At least two bytes of data must be present when this type is used.
        Therefore, the length (number of data bytes) will be >1 if data is present,
        0 if data is not present. A length of 1 is reserved.
5 reserved.
   	the bit 5 is reserved in the IPMI specification type/length byte,
    where it is part of the length field in the Platform Management FRU specification
4:0 length of following data, in characters.
    00000b indicates 'none following'.
    11111b = reserved.

func (TypeLength) Chars

func (tl TypeLength) Chars(raw []byte) (chars []byte, err error)

Chars decodes the raw bytes to ASCII chars according to the encoding type code of TypeLength

func (TypeLength) Length

func (tl TypeLength) Length() uint8

Length returns the length of bytes occupied that packed the chars. But it is not the length of chars. For BCD plus type, one byte packs two chars.

func (TypeLength) Size

func (tl TypeLength) Size() uint8

Size returns the length of chars.

func (TypeLength) String

func (tl TypeLength) String() string

func (TypeLength) Type

func (tl TypeLength) Type() string

func (TypeLength) TypeCode

func (tl TypeLength) TypeCode() uint8

type UDPClient

type UDPClient struct {
	// Target Host
	Host string
	// Target Port
	Port int
	// contains filtered or unexported fields
}

UDPClient exposes some common methods for communicating with UDP target addr.

func NewUDPClient

func NewUDPClient(host string, port int) *UDPClient

func (*UDPClient) Close

func (c *UDPClient) Close() error

func (*UDPClient) Exchange

func (c *UDPClient) Exchange(ctx context.Context, reader io.Reader) ([]byte, error)

Exchange performs a synchronous UDP query. It sends the request, and waits for a reply. Exchange does not retry a failed query. The sent content is read from reader.

func (*UDPClient) LocalIPPort

func (c *UDPClient) LocalIPPort() (string, int)

func (*UDPClient) RemoteIP

func (c *UDPClient) RemoteIP() string

RemoteIP returns the parsed ip address of the target.

func (*UDPClient) SetBufferSize

func (c *UDPClient) SetBufferSize(bufferSize int) *UDPClient

func (*UDPClient) SetTimeout

func (c *UDPClient) SetTimeout(timeout time.Duration) *UDPClient

type User

type User struct {
	ID                   uint8
	Name                 string
	Callin               bool
	LinkAuthEnabled      bool
	IPMIMessagingEnabled bool
	MaxPrivLevel         PrivilegeLevel
}

type VLAN

type VLAN struct {
	Enabled  bool
	ID       uint16
	Priority uint8
}

type WarmResetRequest

type WarmResetRequest struct {
}

20.3 Warm Reset Command

func (*WarmResetRequest) Command

func (req *WarmResetRequest) Command() Command

func (*WarmResetRequest) Pack

func (req *WarmResetRequest) Pack() []byte

type WarmResetResponse

type WarmResetResponse struct {
}

func (*WarmResetResponse) CompletionCodes

func (res *WarmResetResponse) CompletionCodes() map[uint8]string

func (*WarmResetResponse) Format

func (res *WarmResetResponse) Format() string

func (*WarmResetResponse) Unpack

func (res *WarmResetResponse) Unpack(msg []byte) error

type WriteFRUDataRequest

type WriteFRUDataRequest struct {
	FRUDeviceID uint8
	WriteOffset uint16
	WriteData   []byte
}

34.3 Write FRU Data Command

func (*WriteFRUDataRequest) Command

func (req *WriteFRUDataRequest) Command() Command

func (*WriteFRUDataRequest) Pack

func (req *WriteFRUDataRequest) Pack() []byte

type WriteFRUDataResponse

type WriteFRUDataResponse struct {
	CountWritten uint8
}

func (*WriteFRUDataResponse) CompletionCodes

func (r *WriteFRUDataResponse) CompletionCodes() map[uint8]string

func (*WriteFRUDataResponse) Format

func (res *WriteFRUDataResponse) Format() string

func (*WriteFRUDataResponse) Unpack

func (res *WriteFRUDataResponse) Unpack(msg []byte) error

Source Files

Directories

Path Synopsis
utils
md2
Package md2 implements the MD2 hash algorithm as defined in RFC 1319.
Package md2 implements the MD2 hash algorithm as defined in RFC 1319.

Jump to

Keyboard shortcuts

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