smbios

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRecovery

func ParseRecovery(s *Structure, err *error)

ParseRecovery todo

func ReadStructures

func ReadStructures() (*EntryPoint, []*Structure, error)

ReadStructures 读取smbios结构数据

func U16

func U16(data []byte) uint16

U16 bytes to uint16

func U32

func U32(data []byte) uint32

U32 bytes to uint32

func U64

func U64(data []byte) uint64

U64 bytes to uint64

Types

type EntryPoint

type EntryPoint struct {
	Address  int `json:"address,omitempty"`
	Size     int `json:"size,omitempty"`
	Major    int `json:"major,omitempty"`
	Minor    int `json:"minor,omitempty"`
	Revision int `json:"revision,omitempty"`
}

EntryPoint EPS

func NewEntryPoint

func NewEntryPoint(major, minor, rev, addr, size int) *EntryPoint

NewEntryPoint todo

type Header struct {
	Type   uint8
	Length uint8
	Handle uint16
}

A Header is a Structure's header.

func (*Header) String

func (h *Header) String() string

type Structure

type Structure struct {
	Header    Header
	Formatted []byte
	Strings   []string
	// contains filtered or unexported fields
}

A Structure is an SMBIOS structure.

func (*Structure) DataLength

func (s *Structure) DataLength() int

DataLength data长度

func (*Structure) FormattedCount

func (s *Structure) FormattedCount() int

FormattedCount 格式化数据队列长度, 避免索引出界

func (*Structure) GetByte

func (s *Structure) GetByte(index int) byte

GetByte todo

func (*Structure) GetBytes

func (s *Structure) GetBytes(start, end int) []byte

GetBytes todo

func (*Structure) GetString

func (s *Structure) GetString(offset int) string

GetString todo

func (*Structure) IsOverFlow

func (s *Structure) IsOverFlow(index int) bool

IsOverFlow 判断是否越界

func (*Structure) String

func (s *Structure) String() string

func (*Structure) Type

func (s *Structure) Type() uint8

Type 协议Header

func (*Structure) U16

func (s *Structure) U16(start, end int) uint16

U16 todo

func (*Structure) U32

func (s *Structure) U32(start, end int) uint32

U32 todo

func (*Structure) U64

func (s *Structure) U64(start, end int) uint64

U64 todo

type StructureType

type StructureType byte

StructureType Structure definition type

const (
	BIOS StructureType = iota
	System
	BaseBoard
	Chassis
	Processor
	Controller
	Module
	Cache
	PortConnector
	SystemSlots
	OnBoardDevices
	OEMStrings
	SystemConfigurationOptions
	BIOSLanguage
	GroupAssociations
	SystemEventLog
	PhysicalMemoryArray
	MemoryDevice
	Bit32MemoryError
	MemoryArrayMappedAddress
	MemoryDeviceMappedAddress
	BuiltInPointingDevice
	PortableBattery
	SystemReset
	HardwareSecurity
	SystemPowerControls
	VoltageProbe
	CoolingDevice
	TemperatureProbe
	ElectricalCurrentProbe
	OutOfBandRemoteAccess
	BootIntegrityServices
	SystemBoot
	Bit64MemoryError
	ManagementDevice
	ManagementDeviceComponent
	ManagementDeviceThresholdData
	MemoryChannel
	IPMIDevice
	PowerSupply
	AdditionalInformation
	OnBoardDevicesExtendedInformation
	ManagementControllerHostInterface               /*42*/
	Inactive                          StructureType = 126
	EndOfTable                        StructureType = 127
)

func (StructureType) String

func (b StructureType) String() string

Jump to

Keyboard shortcuts

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