client

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

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

	// OpenBackend* are the supported values for Client.openBackendPref
	// (Windows only). They select which Microsoft_IPMI WMI transport the
	// Open Interface uses on Windows. Linux ignores the field.
	// They alias the backend names defined in pkg/open.
	OpenBackendAuto       string = open.BackendAuto
	OpenBackendCOM        string = open.BackendCOM
	OpenBackendPowerShell string = open.BackendPowerShell

	// OpenBackendPower is a deprecated alias of OpenBackendPowerShell.
	OpenBackendPower string = open.BackendPowerShell

	DefaultKeepAliveIntervalSec int = 30
	DefaultBufferSize           int = 4096

	// https://github.com/ipmitool/ipmitool/blob/IPMITOOL_1_8_19/src/plugins/lanplus/lanplus.h#L68
	// https://github.com/ipmitool/ipmitool/blob/IPMITOOL_1_8_19/src/plugins/lan/lan.c#L68
	// https://github.com/ipmitool/ipmitool/blob/IPMITOOL_1_8_19/src/plugins/open/open.c#L87
	DefaultLanTimeoutSec     int = 2
	DefaultLanRetries        int = 4
	DefaultLanplusTimeoutSec int = 1
	DefaultLanplusRetries    int = 4
	DefaultOpenTimeoutSec    int = 15
	DefaultOpenRetries       int = 0
)
View Source
const (
	IPMIVersion15 = 0x15
	IPMIVersion20 = 0x20
)

Variables

View Source
var ErrRAKPAuthentication = errors.New("RAKP authentication failed")

ErrRAKPAuthentication reports that a RAKP authentication code or integrity check did not match.

Functions

func RenderTable

func RenderTable(headers []string, rows []map[string]string) string

RenderTable formats a table from a slice of rows. The Headers is a slice of strings, the order of the headers is the order of the columns in the table. Each row is represented as a map, the keys of the map are the headers of the table.

func RenderTableStream

func RenderTableStream(headers []string, rowSeq iter.Seq[map[string]string]) error

func SensorFilterOptionIsReadingValid

func SensorFilterOptionIsReadingValid(sensor *types.Sensor) bool

func SensorFilterOptionIsSensorType

func SensorFilterOptionIsSensorType(sensorTypes ...types.SensorType) func(sensor *types.Sensor) bool

Sensor is matched if the sensor type of the sensor is one of the given sensor types.

func SensorFilterOptionIsThreshold

func SensorFilterOptionIsThreshold(sensor *types.Sensor) bool

func WithCommandContext

func WithCommandContext(ctx context.Context, commandContext *CommandContext) context.Context

WithCommandContext adds a CommandContext to the provided context.Context.

Types

type AuthCodeMultiSessionInput

type AuthCodeMultiSessionInput = crypto.MultiSessionInput

Re-export v1.5 AuthCode input types from the shared crypto package.

type AuthCodeSingleSessionInput

type AuthCodeSingleSessionInput = crypto.SingleSessionInput

Re-export v1.5 AuthCode input types from the shared crypto package.

type Client

type Client struct {
	Host      string
	Port      int
	Username  string
	Password  string
	Interface Interface
	// 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) ActivateDCMIPowerLimit

func (c *Client) ActivateDCMIPowerLimit(ctx context.Context, activate bool) (response *dcmi.ActivateDCMIPowerLimitResponse, err error)

ActivateDCMIPowerLimit activate or deactivate the power limit set. Setting the param 'activate' to true means to activate the power limit, false means to deactivate the power limit

func (*Client) ActivatePayload

func (c *Client) ActivatePayload(ctx context.Context, request *transport.ActivatePayloadRequest) (response *transport.ActivatePayloadResponse, err error)

func (*Client) ActivateSession

func (c *Client) ActivateSession(ctx context.Context) (response *app.ActivateSessionResponse, err error)

ActivateSession is only used for IPMI v1.5

func (*Client) AddSELEntry

func (c *Client) AddSELEntry(ctx context.Context, sel *types.SEL) (response *storage.AddSELEntryResponse, err error)

func (*Client) AlertImmediate

func (c *Client) AlertImmediate(ctx context.Context, request *sensor.AlertImmediateRequest) (response *sensor.AlertImmediateResponse, err error)

func (*Client) ArmPEFPostponeTimer

func (c *Client) ArmPEFPostponeTimer(ctx context.Context, timeout uint8) (response *sensor.ArmPEFPostponeTimerResponse, err error)

func (*Client) BuildIPMIRequest

func (c *Client) BuildIPMIRequest(ctx context.Context, reqCmd types.Request) (*types.IPMIRequest, error)

BuildIPMIRequest creates an IPMIRequest for a Command Request, filling in checksum fields.

func (*Client) BuildRmcpRequest

func (c *Client) BuildRmcpRequest(ctx context.Context, reqCmd types.Request) (*types.Rmcp, error)

BuildRmcpRequest builds an RMCP packet for the given command request.

func (*Client) ChassisControl

func (c *Client) ChassisControl(ctx context.Context, control chassis.ChassisControl) (response *chassis.ChassisControlResponse, err error)

func (*Client) ChassisIdentify

func (c *Client) ChassisIdentify(ctx context.Context, interval uint8, force bool) (response *chassis.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(ctx context.Context) (response *chassis.ChassisResetResponse, err error)

ChassisReset sends the legacy Chassis Reset command.

func (*Client) ClearMessageFlags

func (c *Client) ClearMessageFlags(ctx context.Context, request *sensor.ClearMessageFlagsRequest) (response *sensor.ClearMessageFlagsResponse, err error)

func (*Client) ClearSEL

func (c *Client) ClearSEL(ctx context.Context, reservationID uint16) (response *storage.ClearSELResponse, err error)

func (*Client) Close

func (c *Client) Close(ctx context.Context) error

func (*Client) CloseSession

func (c *Client) CloseSession(ctx context.Context, request *app.CloseSessionRequest) (response *app.CloseSessionResponse, err error)

func (*Client) ColdReset

func (c *Client) ColdReset(ctx context.Context) (err error)

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

Connect connects to the bmc by specified Interface.

func (*Client) Connect15

func (c *Client) Connect15(ctx context.Context) error

13.14 IPMI v1.5 LAN Session Activation 1. RmcpPresencePing - RmcpPresencePong 2. Get Channel Authentication Capabilities 3. Get Session Challenge 4. Activate Session

func (*Client) Connect20

func (c *Client) Connect20(ctx context.Context) error

see 13.15 IPMI v2.0/RMCP+ Session Activation

func (*Client) ConnectAuto

func (c *Client) ConnectAuto(ctx context.Context) error

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

func (*Client) ConnectOpen

func (c *Client) ConnectOpen(ctx context.Context, devnum int32) error

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

func (*Client) ConnectTool

func (c *Client) ConnectTool(ctx context.Context, devnum int32) error

ConnectTool try to initialize the client.

func (*Client) DeactivatePayload

func (c *Client) DeactivatePayload(ctx context.Context, request *transport.DeactivatePayloadRequest) (response *transport.DeactivatePayloadResponse, err error)

func (*Client) Debug

func (c *Client) Debug(header string, object any)

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 ...any)

func (*Client) DebugfGreen

func (c *Client) DebugfGreen(format string, object ...any)

func (*Client) DebugfRed

func (c *Client) DebugfRed(format string, object ...any)

func (*Client) DebugfYellow

func (c *Client) DebugfYellow(format string, object ...any)

func (*Client) DeleteSELEntry

func (c *Client) DeleteSELEntry(ctx context.Context, recordID uint16, reservationID uint16) (response *storage.DeleteSELEntryResponse, err error)

func (*Client) DisableUser

func (c *Client) DisableUser(ctx context.Context, userID uint8) (err error)

func (*Client) EnableMessageChannelReceive

func (c *Client) EnableMessageChannelReceive(ctx context.Context, channelNumber uint8, channelState uint8) (response *app.EnableMessageChannelReceiveResponse, err error)

func (*Client) EnableUser

func (c *Client) EnableUser(ctx context.Context, userID uint8) (err error)

func (*Client) Exchange

func (c *Client) Exchange(ctx context.Context, request types.Request, response types.Response) error

func (*Client) GetACPIPowerState

func (c *Client) GetACPIPowerState(ctx context.Context) (response *chassis.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(ctx context.Context, channelNumber uint8) ([]types.CipherSuiteRecord, error)

func (*Client) GetBMCGlobalEnables

func (c *Client) GetBMCGlobalEnables(ctx context.Context) (response *sensor.GetBMCGlobalEnablesResponse, err error)

func (*Client) GetBTInterfaceCapabilities

func (c *Client) GetBTInterfaceCapabilities(ctx context.Context) (response *app.GetBTInterfaceCapabilitiesResponse, err error)

func (*Client) GetChannelAccess

func (c *Client) GetChannelAccess(ctx context.Context, channelNumber uint8, accessOption types.ChannelAccessOption) (response *app.GetChannelAccessResponse, err error)

func (*Client) GetChannelAuthenticationCapabilities

func (c *Client) GetChannelAuthenticationCapabilities(ctx context.Context, channelNumber uint8, privilegeLevel types.PrivilegeLevel) (response *app.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(ctx context.Context, channelNumber uint8, index uint8) (response *app.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(ctx context.Context, channelNumber uint8) (response *app.GetChannelInfoResponse, err error)

func (*Client) GetChannelOEMPayloadInfo

func (c *Client) GetChannelOEMPayloadInfo(ctx context.Context, request *transport.GetChannelOEMPayloadInfoRequest) (response *transport.GetChannelOEMPayloadInfoResponse, err error)

func (*Client) GetChannelPayloadSupport

func (c *Client) GetChannelPayloadSupport(ctx context.Context, channelNumber uint8) (response *transport.GetChannelPayloadSupportResponse, err error)

func (*Client) GetChannelPayloadVersion

func (c *Client) GetChannelPayloadVersion(ctx context.Context, channelNumber uint8, payloadType types.PayloadType) (response *transport.GetChannelPayloadVersionResponse, err error)

func (*Client) GetChassisCapabilities

func (c *Client) GetChassisCapabilities(ctx context.Context) (response *chassis.GetChassisCapabilitiesResponse, err error)

func (*Client) GetChassisStatus

func (c *Client) GetChassisStatus(ctx context.Context) (response *chassis.GetChassisStatusResponse, err error)

func (*Client) GetCommandEnables

func (c *Client) GetCommandEnables(ctx context.Context, channelNumber uint8, commandRangeMask app.CommandRangeMask, netFn types.NetFn, lun uint8, code uint8, oemIANA uint32) (response *app.GetCommandEnablesResponse, err error)

func (*Client) GetCommandSubfunctionEnables

func (c *Client) GetCommandSubfunctionEnables(ctx context.Context, request *app.GetCommandSubfunctionEnablesRequest) (response *app.GetCommandSubfunctionEnablesResponse, err error)

func (*Client) GetCommandSubfunctionSupport

func (c *Client) GetCommandSubfunctionSupport(ctx context.Context, channelNumber uint8, netFn types.NetFn, lun uint8, code uint8, oemIANA uint32) (response *app.GetCommandSubfunctionSupportResponse, err error)

func (*Client) GetCommandSupport

func (c *Client) GetCommandSupport(ctx context.Context, channelNumber uint8, commandRangeMask app.CommandRangeMask, netFn types.NetFn, lun uint8, code uint8, oemIANA uint32) (response *app.GetCommandSupportResponse, err error)

func (*Client) GetConfigurableCommandSubfunctions

func (c *Client) GetConfigurableCommandSubfunctions(ctx context.Context, request *app.GetConfigurableCommandSubfunctionsRequest) (response *app.GetConfigurableCommandSubfunctionsResponse, err error)

func (*Client) GetConfigurableCommands

func (c *Client) GetConfigurableCommands(ctx context.Context, channelNumber uint8, commandRangeMask app.CommandRangeMask, netFn types.NetFn, lun uint8, code uint8, oemIANA uint32) (response *app.GetConfigurableCommandsResponse, err error)

func (*Client) GetCurrentSessionInfo

func (c *Client) GetCurrentSessionInfo(ctx context.Context) (response *app.GetSessionInfoResponse, err error)

func (*Client) GetDCMIAssetTag

func (c *Client) GetDCMIAssetTag(ctx context.Context, offset uint8) (response *dcmi.GetDCMIAssetTagResponse, err error)

GetDCMIAssetTag sends a DCMI "Get Asset Tag" command.

func (*Client) GetDCMIAssetTagFull

func (c *Client) GetDCMIAssetTagFull(ctx context.Context) (assetTagRaw []byte, typeLength types.TypeLength, err error)

func (*Client) GetDCMICapParam

func (c *Client) GetDCMICapParam(ctx context.Context, paramSelector types.DCMICapParamSelector) (response *dcmi.GetDCMICapParamResponse, err error)

func (*Client) GetDCMICapParamFor

func (c *Client) GetDCMICapParamFor(ctx context.Context, param types.DCMICapParameter) error

func (*Client) GetDCMICapParams

func (c *Client) GetDCMICapParams(ctx context.Context) (*types.DCMICapParams, error)

func (*Client) GetDCMICapParamsFor

func (c *Client) GetDCMICapParamsFor(ctx context.Context, dcmiCapParams *types.DCMICapParams) error

func (*Client) GetDCMIConfigParam

func (c *Client) GetDCMIConfigParam(ctx context.Context, paramSelector types.DCMIConfigParamSelector, setSelector uint8) (response *dcmi.GetDCMIConfigParamResponse, err error)

func (*Client) GetDCMIConfigParamFor

func (c *Client) GetDCMIConfigParamFor(ctx context.Context, param types.DCMIConfigParameter) error

func (*Client) GetDCMIConfigParams

func (c *Client) GetDCMIConfigParams(ctx context.Context) (*types.DCMIConfigParams, error)

func (*Client) GetDCMIConfigParamsFor

func (c *Client) GetDCMIConfigParamsFor(ctx context.Context, dcmiConfigParams *types.DCMIConfigParams) error

func (*Client) GetDCMIMgmtControllerIdentifier

func (c *Client) GetDCMIMgmtControllerIdentifier(ctx context.Context, offset uint8) (response *dcmi.GetDCMIMgmtControllerIdentifierResponse, err error)

GetDCMIMgmtControllerIdentifier sends a DCMI "Get Management Controller Identifier" command.

func (*Client) GetDCMIMgmtControllerIdentifierFull

func (c *Client) GetDCMIMgmtControllerIdentifierFull(ctx context.Context) ([]byte, error)

func (*Client) GetDCMIPowerLimit

func (c *Client) GetDCMIPowerLimit(ctx context.Context) (response *dcmi.GetDCMIPowerLimitResponse, err error)

GetDCMIPowerLimit sends a DCMI "Get Power Limit" command.

func (*Client) GetDCMIPowerReading

func (c *Client) GetDCMIPowerReading(ctx context.Context) (response *dcmi.GetDCMIPowerReadingResponse, err error)

GetDCMIPowerReading sends a DCMI "Get Power Reading" command.

func (*Client) GetDCMISensorInfo

func (c *Client) GetDCMISensorInfo(ctx context.Context, request *dcmi.GetDCMISensorInfoRequest) (response *dcmi.GetDCMISensorInfoResponse, err error)

GetDCMISensorInfo sends a DCMI "Get Sensor Info" command.

func (*Client) GetDCMISensors

func (c *Client) GetDCMISensors(ctx context.Context, entityIDs ...types.EntityID) ([]*types.SDR, error)

func (*Client) GetDCMITemperatureReadings

func (c *Client) GetDCMITemperatureReadings(ctx context.Context, request *dcmi.GetDCMITemperatureReadingsRequest) (response *dcmi.GetDCMITemperatureReadingsResponse, err error)

func (*Client) GetDCMITemperatureReadingsForEntities

func (c *Client) GetDCMITemperatureReadingsForEntities(ctx context.Context, entityIDs ...types.EntityID) ([]dcmi.DCMITemperatureReading, error)

func (*Client) GetDCMIThermalLimit

func (c *Client) GetDCMIThermalLimit(ctx context.Context, entityID types.EntityID, entityInstance types.EntityInstance) (response *dcmi.GetDCMIThermalLimitResponse, err error)

func (*Client) GetDeviceGUID

func (c *Client) GetDeviceGUID(ctx context.Context) (response *app.GetDeviceGUIDResponse, err error)

func (*Client) GetDeviceID

func (c *Client) GetDeviceID(ctx context.Context) (response *app.GetDeviceIDResponse, err error)

func (*Client) GetDeviceSDR

func (c *Client) GetDeviceSDR(ctx context.Context, recordID uint16) (response *storage.GetDeviceSDRResponse, err error)

func (*Client) GetDeviceSDRBySensorID

func (c *Client) GetDeviceSDRBySensorID(ctx context.Context, sensorNumber uint8) (*types.SDR, error)

func (*Client) GetDeviceSDRInfo

func (c *Client) GetDeviceSDRInfo(ctx context.Context, getSDRCount bool) (response *storage.GetDeviceSDRInfoResponse, err error)

func (*Client) GetDeviceSDRs

func (c *Client) GetDeviceSDRs(ctx context.Context, recordTypes ...types.SDRRecordType) ([]*types.SDR, error)

func (*Client) GetEventReceiver

func (c *Client) GetEventReceiver(ctx context.Context) (response *sensor.GetEventReceiverResponse, err error)

func (*Client) GetFRU

func (c *Client) GetFRU(ctx context.Context, deviceID uint8, deviceName string) (*types.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(ctx context.Context, deviceID uint8, offset uint16) (*types.FRUBoardInfoArea, error)

func (*Client) GetFRUAreaChassis

func (c *Client) GetFRUAreaChassis(ctx context.Context, deviceID uint8, offset uint16) (*types.FRUChassisInfoArea, error)

func (*Client) GetFRUAreaMultiRecords

func (c *Client) GetFRUAreaMultiRecords(ctx context.Context, deviceID uint8, offset uint16) ([]*types.FRUMultiRecord, error)

func (*Client) GetFRUAreaProduct

func (c *Client) GetFRUAreaProduct(ctx context.Context, deviceID uint8, offset uint16) (*types.FRUProductInfoArea, error)

func (*Client) GetFRUData

func (c *Client) GetFRUData(ctx context.Context, 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(ctx context.Context, fruDeviceID uint8) (response *storage.GetFRUInventoryAreaInfoResponse, err error)

func (*Client) GetFRUs

func (c *Client) GetFRUs(ctx context.Context) ([]*types.FRU, error)

func (*Client) GetIPStatistics

func (c *Client) GetIPStatistics(ctx context.Context, channelNumber uint8, clearAllStatistics bool) (response *transport.GetIPStatisticsResponse, err error)

func (*Client) GetLanConfig

func (c *Client) GetLanConfig(ctx context.Context, channelNumber uint8) (*types.LanConfig, error)

func (*Client) GetLanConfigParam

func (c *Client) GetLanConfigParam(ctx context.Context, channelNumber uint8, paramSelector types.LanConfigParamSelector, setSelector uint8, blockSelector uint8) (response *transport.GetLanConfigParamResponse, err error)

func (*Client) GetLanConfigParamFor

func (c *Client) GetLanConfigParamFor(ctx context.Context, channelNumber uint8, param types.LanConfigParameter) error

GetLanConfigParamFor get the lan config for a specific parameter.

The param is a pointer to a struct that implements the LanConfigParameter interface.

func (*Client) GetLanConfigParams

func (c *Client) GetLanConfigParams(ctx context.Context, channelNumber uint8) (*types.LanConfigParams, error)

func (*Client) GetLanConfigParamsFor

func (c *Client) GetLanConfigParamsFor(ctx context.Context, channelNumber uint8, lanConfigParams *types.LanConfigParams) error

GetLanConfigParamsFor get the lan config params. You can initialize specific fields of LanConfigParams struct, which indicates to only get params for those fields.

func (*Client) GetLanConfigParamsFull

func (c *Client) GetLanConfigParamsFull(ctx context.Context, channelNumber uint8) (*types.LanConfigParams, error)

func (*Client) GetLastProcessedEventId

func (c *Client) GetLastProcessedEventId(ctx context.Context) (response *sensor.GetLastProcessedEventIdResponse, err error)

func (*Client) GetMessage

func (c *Client) GetMessage(ctx context.Context) (response *sensor.GetMessageResponse, err error)

func (*Client) GetMessageFlags

func (c *Client) GetMessageFlags(ctx context.Context) (response *sensor.GetMessageFlagsResponse, err error)

func (*Client) GetNetFnSupport

func (c *Client) GetNetFnSupport(ctx context.Context, channelNumber uint8) (response *app.GetNetFnSupportResponse, err error)

func (*Client) GetPEFCapabilities

func (c *Client) GetPEFCapabilities(ctx context.Context) (response *sensor.GetPEFCapabilitiesResponse, err error)

func (*Client) GetPEFConfigParam

func (c *Client) GetPEFConfigParam(ctx context.Context, getRevisionOnly bool, paramSelector types.PEFConfigParamSelector, setSelector uint8, blockSelector uint8) (response *sensor.GetPEFConfigParamResponse, err error)

func (*Client) GetPEFConfigParamFor

func (c *Client) GetPEFConfigParamFor(ctx context.Context, param types.PEFConfigParameter) error

func (*Client) GetPEFConfigParams

func (c *Client) GetPEFConfigParams(ctx context.Context) (pefConfigParams *types.PEFConfigParams, err error)

func (*Client) GetPEFConfigParamsFor

func (c *Client) GetPEFConfigParamsFor(ctx context.Context, pefConfigParams *types.PEFConfigParams) error

func (*Client) GetPOHCounter

func (c *Client) GetPOHCounter(ctx context.Context) (response *chassis.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) GetPayloadActivationStatus

func (c *Client) GetPayloadActivationStatus(ctx context.Context, payloadType types.PayloadType) (response *transport.GetPayloadActivationStatusResponse, err error)

func (*Client) GetPayloadInstanceInfo

func (c *Client) GetPayloadInstanceInfo(ctx context.Context, payloadType types.PayloadType, payloadInstance uint8) (response *transport.GetPayloadInstanceInfoResponse, err error)

func (*Client) GetSDR

func (c *Client) GetSDR(ctx context.Context, recordID uint16) (response *storage.GetSDRResponse, err error)

GetSDR returns raw SDR record.

func (*Client) GetSDRBySensorID

func (c *Client) GetSDRBySensorID(ctx context.Context, sensorNumber uint8) (*types.SDR, error)

func (*Client) GetSDRBySensorName

func (c *Client) GetSDRBySensorName(ctx context.Context, sensorName string) (*types.SDR, error)

func (*Client) GetSDREnhanced

func (c *Client) GetSDREnhanced(ctx context.Context, recordID uint16) (*types.SDR, error)

func (*Client) GetSDRHeader

func (c *Client) GetSDRHeader(ctx context.Context, recordID uint16) (*types.SDRHeader, uint16, error)

GetSDRHeader returns the 5-byte SDR record header and next record ID via a partial Get SDR (v2.0§33.12). Used to skip non-matching records without fetching the full body.

func (*Client) GetSDRParsed

func (c *Client) GetSDRParsed(ctx context.Context, recordID uint16) (*types.SDR, error)

GetSDRParsed fetches and parses a full SDR record without enhancing sensor readings.

func (*Client) GetSDRRepoAllocInfo

func (c *Client) GetSDRRepoAllocInfo(ctx context.Context) (response *storage.GetSDRRepoAllocInfoResponse, err error)

func (*Client) GetSDRRepoInfo

func (c *Client) GetSDRRepoInfo(ctx context.Context) (response *storage.GetSDRRepoInfoResponse, err error)

func (*Client) GetSDRs

func (c *Client) GetSDRs(ctx context.Context, recordTypes ...types.SDRRecordType) ([]*types.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.

Matching Full/Compact records are enhanced with live sensor readings. Prefer GetSDRsRaw when only record metadata is needed (e.g. FRU enumeration).

func (*Client) GetSDRsMap

func (c *Client) GetSDRsMap(ctx context.Context) (types.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) GetSDRsRaw

func (c *Client) GetSDRsRaw(ctx context.Context, recordTypes ...types.SDRRecordType) ([]*types.SDR, error)

GetSDRsRaw is like GetSDRs but does not enhance sensor readings. When recordTypes is non-empty, non-matching records are skipped with a header-only Get SDR peek (ipmitool fru print style), avoiding full-body fetches and Get Sensor Reading for unrelated sensors.

func (*Client) GetSDRsStream

func (c *Client) GetSDRsStream(ctx context.Context, recordTypes ...types.SDRRecordType) iter.Seq[*types.Result[types.SDR]]

func (*Client) GetSELAllocInfo

func (c *Client) GetSELAllocInfo(ctx context.Context) (response *storage.GetSELAllocInfoResponse, err error)

func (*Client) GetSELEntries

func (c *Client) GetSELEntries(ctx context.Context, startRecordID uint16) ([]*types.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) GetSELEntriesStream

func (c *Client) GetSELEntriesStream(ctx context.Context, startRecordID uint16) iter.Seq[*types.Result[types.SEL]]

func (*Client) GetSELEntry

func (c *Client) GetSELEntry(ctx context.Context, reservationID uint16, recordID uint16) (response *storage.GetSELEntryResponse, err error)

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

func (*Client) GetSELInfo

func (c *Client) GetSELInfo(ctx context.Context) (response *storage.GetSELInfoResponse, err error)

func (*Client) GetSELTime

func (c *Client) GetSELTime(ctx context.Context) (response *storage.GetSELTimeResponse, err error)

func (*Client) GetSELTimeUTCOffset

func (c *Client) GetSELTimeUTCOffset(ctx context.Context) (response *storage.GetSELTimeUTCOffsetResponse, err error)

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

func (*Client) GetSOLConfigParam

func (c *Client) GetSOLConfigParam(ctx context.Context, channelNumber uint8, paramSelector types.SOLConfigParamSelector, setSelector, blockSelector uint8) (response *transport.GetSOLConfigParamResponse, err error)

func (*Client) GetSOLConfigParamFor

func (c *Client) GetSOLConfigParamFor(ctx context.Context, channelNumber uint8, param types.SOLConfigParameter) error

func (*Client) GetSOLConfigParams

func (c *Client) GetSOLConfigParams(ctx context.Context, channelNumber uint8) (*types.SOLConfigParams, error)

func (*Client) GetSOLConfigParamsFor

func (c *Client) GetSOLConfigParamsFor(ctx context.Context, channelNumber uint8, solConfigParams *types.SOLConfigParams) error

func (*Client) GetSelfTestResults

func (c *Client) GetSelfTestResults(ctx context.Context) (response *app.GetSelfTestResultsResponse, err error)

func (*Client) GetSensorByID

func (c *Client) GetSensorByID(ctx context.Context, sensorNumber uint8) (*types.Sensor, error)

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

func (*Client) GetSensorByName

func (c *Client) GetSensorByName(ctx context.Context, sensorName string) (*types.Sensor, error)

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

func (*Client) GetSensorEventEnable

func (c *Client) GetSensorEventEnable(ctx context.Context, sensorNumber uint8) (response *sensor.GetSensorEventEnableResponse, err error)

func (*Client) GetSensorEventStatus

func (c *Client) GetSensorEventStatus(ctx context.Context, sensorNumber uint8) (response *sensor.GetSensorEventStatusResponse, err error)

func (*Client) GetSensorHysteresis

func (c *Client) GetSensorHysteresis(ctx context.Context, sensorNumber uint8) (response *sensor.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(ctx context.Context, sensorNumber uint8) (response *sensor.GetSensorReadingResponse, err error)

func (*Client) GetSensorReadingFactors

func (c *Client) GetSensorReadingFactors(ctx context.Context, sensorNumber uint8, reading uint8) (response *sensor.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(ctx context.Context, sensorNumber uint8) (response *sensor.GetSensorThresholdsResponse, err error)

This command retrieves the threshold for the given sensor.

func (*Client) GetSensorType

func (c *Client) GetSensorType(ctx context.Context, sensorNumber uint8) (response *sensor.GetSensorTypeResponse, err error)

func (*Client) GetSensors

func (c *Client) GetSensors(ctx context.Context, filterOptions ...SensorFilterOption) ([]*types.Sensor, error)

GetSensors retrieves all sensors with their current readings and status.

Filter behavior:

  • If no filter options are provided, returns all sensors
  • If filter options are provided, returns only sensors that pass ALL filters (logical AND)
  • For logical OR filtering, use GetSensorsAny instead

Example usage:

// Get all fan sensors
sensors, err := client.GetSensors(ctx, types.SensorFilterOptionIsSensorType(types.SensorTypeFan))

// Get all temperature sensors with valid readings
sensors, err := client.GetSensors(ctx,
    types.SensorFilterOptionIsSensorType(types.SensorTypeTemperature),
    types.SensorFilterOptionIsReadingValid)

func (*Client) GetSensorsAny

func (c *Client) GetSensorsAny(ctx context.Context, filterOptions ...SensorFilterOption) ([]*types.Sensor, error)

GetSensorsAny retrieves all sensors with their current readings and status.

Filter behavior:

  • If no filter options are provided, returns all sensors
  • If filter options are provided, returns sensors that pass ANY of the filters (logical OR)
  • For logical AND filtering, use GetSensors instead

Example usage:

// Get sensors that are either temperature or voltage sensors
sensors, err := client.GetSensorsAny(ctx,
    types.SensorFilterOptionIsSensorType(types.SensorTypeTemperature),
    types.SensorFilterOptionIsSensorType(types.SensorTypeVoltage))

func (*Client) GetSensorsAnyStream

func (c *Client) GetSensorsAnyStream(ctx context.Context, filterOptions ...SensorFilterOption) iter.Seq[*types.Result[types.Sensor]]

GetSensorsAnyStream behaves like GetSensorsAny, but returns an iterator of sensors instead of a slice.

func (*Client) GetSensorsStream

func (c *Client) GetSensorsStream(ctx context.Context, filterOptions ...SensorFilterOption) iter.Seq[*types.Result[types.Sensor]]

GetSensorsStream behaves like GetSensors, but returns an iterator of sensors instead of a slice.

func (*Client) GetSessionChallenge

func (c *Client) GetSessionChallenge(ctx context.Context) (response *app.GetSessionChallengeResponse, err error)

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(ctx context.Context, request *app.GetSessionInfoRequest) (response *app.GetSessionInfoResponse, err error)

func (*Client) GetSupermicroBiosVersion

func (c *Client) GetSupermicroBiosVersion(ctx context.Context) (response *oem.CommandGetSupermicroBiosVersionResponse, err error)

func (*Client) GetSystemBootOptionsParam

func (c *Client) GetSystemBootOptionsParam(ctx context.Context, paramSelector types.BootOptionParamSelector, setSelector uint8, blockSelector uint8) (response *chassis.GetSystemBootOptionsParamResponse, err error)

func (*Client) GetSystemBootOptionsParamFor

func (c *Client) GetSystemBootOptionsParamFor(ctx context.Context, param types.BootOptionParameter) error

func (*Client) GetSystemBootOptionsParams

func (c *Client) GetSystemBootOptionsParams(ctx context.Context) (*types.BootOptionsParams, error)

GetSystemBootOptionsParams get all parameters of boot options.

func (*Client) GetSystemBootOptionsParamsFor

func (c *Client) GetSystemBootOptionsParamsFor(ctx context.Context, bootOptionsParams *types.BootOptionsParams) error

func (*Client) GetSystemGUID

func (c *Client) GetSystemGUID(ctx context.Context) (response *app.GetSystemGUIDResponse, err error)

func (*Client) GetSystemInfo

func (c *Client) GetSystemInfo(ctx context.Context) (*types.SystemInfo, error)

func (*Client) GetSystemInfoParam

func (c *Client) GetSystemInfoParam(ctx context.Context, paramSelector types.SystemInfoParamSelector, setSelector uint8, blockSelector uint8) (response *app.GetSystemInfoParamResponse, err error)

func (*Client) GetSystemInfoParamFor

func (c *Client) GetSystemInfoParamFor(ctx context.Context, param types.SystemInfoParameter) error

func (*Client) GetSystemInfoParams

func (c *Client) GetSystemInfoParams(ctx context.Context) (*types.SystemInfoParams, error)

func (*Client) GetSystemInfoParamsFor

func (c *Client) GetSystemInfoParamsFor(ctx context.Context, params *types.SystemInfoParams) error

func (*Client) GetSystemInterfaceCapabilities

func (c *Client) GetSystemInterfaceCapabilities(ctx context.Context, interfaceType app.SystemInterfaceType) (response *app.GetSystemInterfaceCapabilitiesResponse, err error)

func (*Client) GetSystemRestartCause

func (c *Client) GetSystemRestartCause(ctx context.Context) (response *chassis.GetSystemRestartCauseResponse, err error)

func (*Client) GetUserAccess

func (c *Client) GetUserAccess(ctx context.Context, channelNumber uint8, userID uint8) (response *app.GetUserAccessResponse, err error)

func (*Client) GetUserPayloadAccess

func (c *Client) GetUserPayloadAccess(ctx context.Context, channelNumber uint8, userID uint8) (response *app.GetUserPayloadAccessResponse, err error)

func (*Client) GetUsername

func (c *Client) GetUsername(ctx context.Context, userID uint8) (response *app.GetUsernameResponse, err error)

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context, channelNumber uint8) ([]*app.User, error)

func (*Client) GetWatchdogTimer

func (c *Client) GetWatchdogTimer(ctx context.Context) (response *app.GetWatchdogTimerResponse, err error)

func (*Client) ManufacturingTestOn

func (c *Client) ManufacturingTestOn(ctx context.Context) (response *app.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(ctx context.Context, request *app.MasterWriteReadRequest) (*app.MasterWriteReadResponse, error)

func (*Client) OpenSession

func (c *Client) OpenSession(ctx context.Context) (response *rmcpplus.OpenSessionResponse, err error)

func (*Client) PETAcknowledge

func (c *Client) PETAcknowledge(ctx context.Context, request *sensor.PETAcknowledgeRequest) (response *sensor.PETAcknowledgeResponse, err error)

func (*Client) ParseRmcpResponse

func (c *Client) ParseRmcpResponse(ctx context.Context, msg []byte, cmd types.Command, response types.Response) error

ParseRmcpResponse parses a raw RMCP response message into the given Response. cmd identifies the request for command-specific completion-code naming.

func (*Client) PlatformEventMessage

func (c *Client) PlatformEventMessage(ctx context.Context, request *sensor.PlatformEventMessageRequest) (response *sensor.PlatformEventMessageResponse, err error)

func (*Client) RAKPMessage1

func (c *Client) RAKPMessage1(ctx context.Context) (response *rmcpplus.RAKPMessage2, err error)

func (*Client) RAKPMessage3

func (c *Client) RAKPMessage3(ctx context.Context) (response *rmcpplus.RAKPMessage4, err error)

RAKPMessage3 sends RAKP Message 3 and validates RAKP Message 4.

func (*Client) RawCommand

func (c *Client) RawCommand(ctx context.Context, netFn types.NetFn, cmd uint8, data []byte, name string) (response *CommandRawResponse, err error)

func (*Client) ReadEventMessageBuffer

func (c *Client) ReadEventMessageBuffer(ctx context.Context) (response *sensor.ReadEventMessageBufferResponse, err error)

func (*Client) ReadFRUData

func (c *Client) ReadFRUData(ctx context.Context, fruDeviceID uint8, readOffset uint16, readCount uint8) (response *storage.ReadFRUDataResponse, err error)

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

func (*Client) RearmSensorEvents

func (c *Client) RearmSensorEvents(ctx context.Context, request *sensor.RearmSensorEventsRequest) (response *sensor.RearmSensorEventsResponse, err error)

func (*Client) ReserveDeviceSDRRepo

func (c *Client) ReserveDeviceSDRRepo(ctx context.Context) (response *storage.ReserveDeviceSDRRepoResponse, err error)

func (*Client) ReserveSDRRepo

func (c *Client) ReserveSDRRepo(ctx context.Context) (response *storage.ReserveSDRRepoResponse, err error)

func (*Client) ReserveSEL

func (c *Client) ReserveSEL(ctx context.Context) (response *storage.ReserveSELResponse, err error)

func (*Client) ResetWatchdogTimer

func (c *Client) ResetWatchdogTimer(ctx context.Context) (response *app.ResetWatchdogTimerResponse, err error)

func (*Client) RmcpPing

func (c *Client) RmcpPing(ctx context.Context) (response *RmcpPingResponse, err error)

func (*Client) SOLActivate

func (c *Client) SOLActivate(ctx context.Context, in io.Reader, out io.Writer, opts *SOLActivateOptions) error

SOLActivate activates the SOL payload and runs an interactive session.

func (*Client) SOLActivating

func (c *Client) SOLActivating(ctx context.Context, request *transport.SOLActivatingRequest) (response *transport.SOLActivatingResponse, err error)

func (*Client) SOLPayload

func (c *Client) SOLPayload(ctx context.Context, request *types.SOLPayloadRequest) (response *types.SOLPayloadResponse, err error)

SOLPayload exchanges a single SOL payload packet over an active RMCP+ session.

func (*Client) SendMessage

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

func (*Client) SessionPrivilegeLevel

func (c *Client) SessionPrivilegeLevel() types.PrivilegeLevel

func (*Client) SetACPIPowerState

func (c *Client) SetACPIPowerState(ctx context.Context, request *chassis.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(ctx context.Context, enableSystemEventLogging bool, enableEventMessageBuffer bool, enableEventMessageBufferFullInterrupt bool, enableReceiveMessageQueueInterrupt bool) (response *sensor.SetBMCGlobalEnablesResponse, err error)

func (*Client) SetBootDevice

func (c *Client) SetBootDevice(ctx context.Context, bootDeviceSelector types.BootDeviceSelector, bootType types.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(ctx context.Context, bootFlags *types.BootOptionParam_BootFlags) error

func (*Client) SetBootParamClearAck

func (c *Client) SetBootParamClearAck(ctx context.Context, by types.BootInfoAcknowledgeBy) error

func (*Client) SetBootParamSetInProgress

func (c *Client) SetBootParamSetInProgress(ctx context.Context, setInProgress types.SetInProgressState) error

func (*Client) SetChannelAccess

func (c *Client) SetChannelAccess(ctx context.Context, request *app.SetChannelAccessRequest) (response *app.SetChannelAccessResponse, err error)

func (*Client) SetChannelSecurityKeys

func (c *Client) SetChannelSecurityKeys(ctx context.Context, request *transport.SetChannelSecurityKeysRequest) (response *transport.SetChannelSecurityKeysResponse, err error)

func (*Client) SetChassisCapabilities

func (c *Client) SetChassisCapabilities(ctx context.Context, request *chassis.SetChassisCapabilitiesRequest) (response *chassis.SetChassisCapabilitiesResponse, err error)

func (*Client) SetCommandEnables

func (c *Client) SetCommandEnables(ctx context.Context, request *app.SetCommandEnablesRequest) (response *app.SetCommandEnablesResponse, err error)

func (*Client) SetCommandSubfunctionEnables

func (c *Client) SetCommandSubfunctionEnables(ctx context.Context, request *app.SetCommandSubfunctionEnablesRequest) (response *app.SetCommandSubfunctionEnablesResponse, err error)

func (*Client) SetDCMIAssetTag

func (c *Client) SetDCMIAssetTag(ctx context.Context, offset uint8, writeBytes uint8, assetTag []byte) (response *dcmi.SetDCMIAssetTagResponse, err error)

func (*Client) SetDCMIAssetTagFull

func (c *Client) SetDCMIAssetTagFull(ctx context.Context, assetTag []byte) (err error)

func (*Client) SetDCMIConfigParam

func (c *Client) SetDCMIConfigParam(ctx context.Context, paramSelector types.DCMIConfigParamSelector, setSelector uint8, paramData []byte) (response *dcmi.SetDCMIConfigParamResponse, err error)

func (*Client) SetDCMIConfigParamFor

func (c *Client) SetDCMIConfigParamFor(ctx context.Context, param types.DCMIConfigParameter) (response *dcmi.SetDCMIConfigParamResponse, err error)

func (*Client) SetDCMIMgmtControllerIdentifier

func (c *Client) SetDCMIMgmtControllerIdentifier(ctx context.Context, offset uint8, writeBytes uint8, idStr []byte) (response *dcmi.SetDCMIMgmtControllerIdentifierResponse, err error)

func (*Client) SetDCMIMgmtControllerIdentifierFull

func (c *Client) SetDCMIMgmtControllerIdentifierFull(ctx context.Context, idStr []byte) (err error)

func (*Client) SetDCMIPowerLimit

func (c *Client) SetDCMIPowerLimit(ctx context.Context, request *dcmi.SetDCMIPowerLimitRequest) (response *dcmi.SetDCMIPowerLimitResponse, err error)

SetDCMIPowerLimit sends a DCMI "Set Power Limit" command.

func (*Client) SetDCMIThermalLimit

func (c *Client) SetDCMIThermalLimit(ctx context.Context, request *dcmi.SetDCMIThermalLimitRequest) (response *dcmi.SetDCMIThermalLimitResponse, err error)

func (*Client) SetEventReceiver

func (c *Client) SetEventReceiver(ctx context.Context, slaveAddress uint8, lun uint8) (response *sensor.SetEventReceiverResponse, err error)

func (*Client) SetEventReceiverDisable

func (c *Client) SetEventReceiverDisable(ctx context.Context, lun uint8) (response *sensor.SetEventReceiverResponse, err error)

func (*Client) SetFrontPanelEnables

func (c *Client) SetFrontPanelEnables(ctx context.Context, disableSleepButton bool, disableDiagnosticButton bool, disableResetButton bool, disablePoweroffButton bool) (response *chassis.SetFrontPanelEnablesResponse, err error)

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

func (*Client) SetLanConfigParam

func (c *Client) SetLanConfigParam(ctx context.Context, channelNumber uint8, paramSelector types.LanConfigParamSelector, configData []byte) (response *transport.SetLanConfigParamResponse, err error)

func (*Client) SetLanConfigParamFor

func (c *Client) SetLanConfigParamFor(ctx context.Context, channelNumber uint8, param types.LanConfigParameter) error

func (*Client) SetLastProcessedEventId

func (c *Client) SetLastProcessedEventId(ctx context.Context, recordID uint16, byBMC bool) (response *sensor.SetLastProcessedEventIdResponse, err error)

func (*Client) SetPEFConfigParam

func (c *Client) SetPEFConfigParam(ctx context.Context, paramSelector types.PEFConfigParamSelector, paramData []byte) (response *sensor.SetPEFConfigParamResponse, err error)

func (*Client) SetPowerCycleInterval

func (c *Client) SetPowerCycleInterval(ctx context.Context, intervalInSec uint8) (response *chassis.SetPowerCycleIntervalResponse, err error)

func (*Client) SetPowerRestorePolicy

func (c *Client) SetPowerRestorePolicy(ctx context.Context, policy chassis.PowerRestorePolicy) (response *chassis.SetPowerRestorePolicyResponse, err error)

func (*Client) SetSELTime

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

func (*Client) SetSELTimeUTCOffset

func (c *Client) SetSELTimeUTCOffset(ctx context.Context, minutesOffset int16) (response *storage.SetSELTimeUTCOffsetResponse, err error)

SetSELTimeUTCOffset sets the UTC offset (timezone) associated with SEL Time.

func (*Client) SetSOLConfigParam

func (c *Client) SetSOLConfigParam(ctx context.Context, channelNumber uint8, paramSelector types.SOLConfigParamSelector, paramData []byte) (response *transport.SetSOLConfigParamResponse, err error)

func (*Client) SetSOLConfigParamFor

func (c *Client) SetSOLConfigParamFor(ctx context.Context, channelNumber uint8, param types.SOLConfigParameter) error

func (*Client) SetSensorEventEnable

func (c *Client) SetSensorEventEnable(ctx context.Context, request *sensor.SetSensorEventEnableRequest) (response *sensor.SetSensorEventEnableResponse, err error)

func (*Client) SetSensorHysteresis

func (c *Client) SetSensorHysteresis(ctx context.Context, sensorNumber uint8, positiveHysteresis uint8, negativeHysteresis uint8) (response *sensor.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(ctx context.Context, request *sensor.SetSensorReadingAndEventStatusRequest) (response *sensor.SetSensorReadingAndEventStatusResponse, err error)

func (*Client) SetSensorThresholds

func (c *Client) SetSensorThresholds(ctx context.Context, request *sensor.SetSensorThresholdsRequest) (response *sensor.SetSensorThresholdsResponse, err error)

func (*Client) SetSensorType

func (c *Client) SetSensorType(ctx context.Context, sensorNumber uint8, sensorType types.SensorType, eventReadingType types.EventReadingType) (response *sensor.SetSensorTypeResponse, err error)

func (*Client) SetSessionPrivilegeLevel

func (c *Client) SetSessionPrivilegeLevel(ctx context.Context, privilegeLevel types.PrivilegeLevel) (response *app.SetSessionPrivilegeLevelResponse, err error)

func (*Client) SetSystemBootOptionsParam

func (c *Client) SetSystemBootOptionsParam(ctx context.Context, request *chassis.SetSystemBootOptionsParamRequest) (response *chassis.SetSystemBootOptionsParamResponse, 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) SetSystemBootOptionsParamFor

func (c *Client) SetSystemBootOptionsParamFor(ctx context.Context, param types.BootOptionParameter) error

func (*Client) SetSystemInfoParam

func (c *Client) SetSystemInfoParam(ctx context.Context, paramSelector types.SystemInfoParamSelector, paramData []byte) (response *app.SetSystemInfoParamResponse, err error)

func (*Client) SetSystemInfoParamFor

func (c *Client) SetSystemInfoParamFor(ctx context.Context, param types.SystemInfoParameter) error

func (*Client) SetUserAccess

func (c *Client) SetUserAccess(ctx context.Context, request *app.SetUserAccessRequest) (response *app.SetUserAccessResponse, err error)

func (*Client) SetUserPassword

func (c *Client) SetUserPassword(ctx context.Context, userID uint8, password string, stored20 bool) (response *app.SetUserPasswordResponse, err error)

func (*Client) SetUserPayloadAccess

func (c *Client) SetUserPayloadAccess(ctx context.Context, payloadType types.PayloadType, payloadInstance uint8) (response *app.SetUserPayloadAccessResponse, err error)

func (*Client) SetUsername

func (c *Client) SetUsername(ctx context.Context, userID uint8, username string) (response *app.SetUsernameResponse, err error)

func (*Client) SetWatchdogTimer

func (c *Client) SetWatchdogTimer(ctx context.Context) (response *app.SetWatchdogTimerResponse, err error)

func (*Client) SuspendARPs

func (c *Client) SuspendARPs(ctx context.Context, channelNumber uint8, suspendARP bool, suspendGratuitousARP bool) (response *transport.SuspendARPsResponse, err error)

func (*Client) SuspendResumePayloadEncryption

func (c *Client) SuspendResumePayloadEncryption(ctx context.Context, payloadType types.PayloadType, payloadInstance uint8, operation transport.PayloadEncryptionOperation) (response *transport.SuspendResumePayloadEncryptionResponse, err error)

func (*Client) TestUserPassword

func (c *Client) TestUserPassword(ctx context.Context, userID uint8, password string, stored20 bool) (response *app.SetUserPasswordResponse, err error)

func (*Client) ValidateRAKP2

func (c *Client) ValidateRAKP2(ctx context.Context, rakp2 *rmcpplus.RAKPMessage2) (bool, error)

ValidateRAKP2 validates RAKP Message 2 returned by BMC.

func (*Client) ValidateRAKP4

func (c *Client) ValidateRAKP4(ctx context.Context, response *rmcpplus.RAKPMessage4) (bool, error)

func (*Client) WarmReset

func (c *Client) WarmReset(ctx context.Context) (err error)

func (*Client) WithBufferSize

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

func (*Client) WithCipherSuiteID

func (c *Client) WithCipherSuiteID(cipherSuiteID ...types.CipherSuiteID) *Client

WithCipherSuiteID sets one or more custom cipher suite which is used during OpenSession command. It is only valid for client with IPMI lanplus interface. For the custom cipherSuiteID to take effect, you must call WithCipherSuiteID before calling Connect method.

func (*Client) WithDebug

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

func (*Client) WithInterface

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

func (*Client) WithMaxPrivilegeLevel

func (c *Client) WithMaxPrivilegeLevel(privilegeLevel types.PrivilegeLevel) *Client

WithMaxPrivilegeLevel sets a specified session privilege level to use.

func (*Client) WithOpenBackend

func (c *Client) WithOpenBackend(pref string) *Client

WithOpenBackend selects the Windows Open Interface transport. Accepted values: "" / OpenBackendAuto (default; native COM with PowerShell fallback), OpenBackendCOM, OpenBackendPowerShell. No-op on non-Windows platforms. Must be called before Connect.

func (*Client) WithRequesterAddr

func (c *Client) WithRequesterAddr(requesterAddr, requesterLUN uint8)

func (*Client) WithResponderAddr

func (c *Client) WithResponderAddr(responderAddr, responderLUN uint8)

func (*Client) WithRetry

func (c *Client) WithRetry(retryCount int) *Client

func (*Client) WithTimeout

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

func (*Client) WithUDPProxy

func (c *Client) WithUDPProxy(proxy proxy.Dialer) *Client

func (*Client) WriteFRUData

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

type CommandContext

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

CommandContext represents the specific context used for IPMI command exchanges. It stores addressing information needed for certain IPMI commands, particularly sensor-related operations.

The context contains: - responderAddr: The address of the responding device (e.g., BMC) - responderLUN: The Logical Unit Number of the responding device - requesterAddr: The address of the requesting device - requesterLUN: The Logical Unit Number of the requesting device

This context is essential for commands that require specific addressing information, such as GetSensorReading and other sensor-related operations.

func GetCommandContext

func GetCommandContext(ctx context.Context) *CommandContext

GetCommandContext retrieves the CommandContext from the provided context.Context.

func (*CommandContext) WithRequesterAddr

func (cmdCtx *CommandContext) WithRequesterAddr(requesterAddr uint8) *CommandContext

func (*CommandContext) WithRequesterLUN

func (cmdCtx *CommandContext) WithRequesterLUN(requesterLUN uint8) *CommandContext

func (*CommandContext) WithResponderAddr

func (cmdCtx *CommandContext) WithResponderAddr(responderAddr uint8) *CommandContext

func (*CommandContext) WithResponderLUN

func (cmdCtx *CommandContext) WithResponderLUN(responderLUN uint8) *CommandContext

type CommandRawRequest

type CommandRawRequest struct {
	NetFn types.NetFn
	Cmd   uint8
	Data  []byte
	Name  string
}

func (*CommandRawRequest) Command

func (req *CommandRawRequest) Command() types.Command

func (*CommandRawRequest) Pack

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

type CommandRawResponse

type CommandRawResponse struct {
	Response []byte
}

func (*CommandRawResponse) Format

func (res *CommandRawResponse) Format() string

func (*CommandRawResponse) Unpack

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

type Interface

type Interface string

type RmcpPingRequest

type RmcpPingRequest struct {
}

13.2.3 RMCP/ASF Presence Ping Message

func (*RmcpPingRequest) Command

func (req *RmcpPingRequest) Command() types.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
	Reserved []byte
}

func (*RmcpPingResponse) Format

func (res *RmcpPingResponse) Format() string

func (*RmcpPingResponse) Unpack

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

type SOLActivateOptions

type SOLActivateOptions struct {
	// PayloadInstance is the SOL payload instance (1–0x3f). Zero means use default 1.
	PayloadInstance uint8
	// PollInterval is how often to send an empty SOL packet to poll for inbound data.
	// Zero selects a default (100ms).
	PollInterval time.Duration
	// OnActivated is called once after Activate Payload (SOL) succeeds and before the session loop.
	OnActivated func(payloadInstance uint8, in io.Reader, out io.Writer, res *transport.ActivatePayloadResponse)
	// OnDeactivated is called once after the session loop ends.
	OnDeactivated func(payloadInstance uint8, in io.Reader, out io.Writer, res *transport.ActivatePayloadResponse)
}

SOLActivateOptions configures Client.SOLActivate.

type SensorFilterOption

type SensorFilterOption func(sensor *types.Sensor) bool

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) ExchangeUntilMatch

func (c *UDPClient) ExchangeUntilMatch(ctx context.Context, reader io.Reader, match func(recv []byte) (ok bool, err error)) ([]byte, error)

ExchangeUntilMatch sends the payload read from reader as a single UDP datagram, then reads repeatedly until match returns true for some received datagram, or until the overall deadline elapses (the same deadline rules as Exchange: min of context deadline and client timeout). Datagrams for which match returns (false, nil) are discarded and reading continues.

Unlike Exchange, which returns the first datagram unconditionally, ExchangeUntilMatch filters inbound traffic: stray packets, unrelated replies, or multiplexed traffic on the same socket can be skipped by returning (false, nil) from match. If the deadline passes with no matching datagram, the returned error indicates that no datagram satisfied match before the deadline.

If match returns a non-nil error, that error is returned immediately. When match returns (true, nil), the corresponding datagram's payload is returned.

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) SetProxy

func (c *UDPClient) SetProxy(proxy proxy.Dialer) *UDPClient

func (*UDPClient) SetTimeout

func (c *UDPClient) SetTimeout(timeout time.Duration) *UDPClient

Jump to

Keyboard shortcuts

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