smbios

package
v0.0.0-...-ab7c733 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package smbios provides detection and access to System Management BIOS (SMBIOS) and Desktop Management Interface (DMI) data and structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BIOSInfo

type BIOSInfo struct {
	Vendor      string
	Version     string
	BiosVersion string
	ReleaseDate string
}

type BIOSInfoRead

type BIOSInfoRead struct {
	Vendor      byte
	Version     byte
	StartAddSeg uint16
	ReleaseDate byte
}

type BaseboardInfo

type BaseboardInfo struct {
	Manufacturer string
	Product      string
	Version      string
	SerialNumber string
}

type Decoder

type Decoder struct {
	Version SMBIOSVersion
	// contains filtered or unexported fields
}

A Decoder decodes Structures from a stream.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder creates a Decoder which decodes Structures from the input stream.

func (*Decoder) Decode

func (d *Decoder) Decode() ([]*Structure, error)

Decode decodes Structures from the Decoder's stream until an End-of-table structure is found.

type EntryPoint

type EntryPoint interface {
	// Table returns the memory address and maximum size of the SMBIOS table.
	Table() (address, size int)

	// Version returns the system's SMBIOS version.
	Version() (major, minor, revision int)
}

An EntryPoint is an SMBIOS entry point. EntryPoints contain various properties about SMBIOS.

Use a type assertion to access detailed EntryPoint information.

func ParseEntryPoint

func ParseEntryPoint(r io.Reader) (EntryPoint, error)

ParseEntryPoint parses an EntryPoint from the input stream.

func Stream

func Stream() (io.ReadCloser, EntryPoint, error)

Stream locates and opens a stream of SMBIOS data and the SMBIOS entry point from an operating system-specific location. The stream must be closed after decoding to free its resources.

If no suitable location is found, an error is returned.

type EntryPoint32Bit

type EntryPoint32Bit struct {
	Anchor                string
	Checksum              uint8
	Length                uint8
	Major                 uint8
	Minor                 uint8
	MaxStructureSize      uint16
	EntryPointRevision    uint8
	FormattedArea         [5]byte
	IntermediateAnchor    string
	IntermediateChecksum  uint8
	StructureTableLength  uint16
	StructureTableAddress uint32
	NumberStructures      uint16
	BCDRevision           uint8
}

EntryPoint32Bit is the SMBIOS 32-bit Entry Point structure, used starting in SMBIOS 2.1.

func (*EntryPoint32Bit) Table

func (e *EntryPoint32Bit) Table() (address, size int)

Table implements EntryPoint.

func (*EntryPoint32Bit) Version

func (e *EntryPoint32Bit) Version() (major, minor, revision int)

Version implements EntryPoint.

type EntryPoint64Bit

type EntryPoint64Bit struct {
	Anchor                string
	Checksum              uint8
	Length                uint8
	Major                 uint8
	Minor                 uint8
	Revision              uint8
	EntryPointRevision    uint8
	Reserved              uint8
	StructureTableMaxSize uint32
	StructureTableAddress uint64
}

EntryPoint64Bit is the SMBIOS 64-bit Entry Point structure, used starting in SMBIOS 3.0.

func (*EntryPoint64Bit) Table

func (e *EntryPoint64Bit) Table() (address, size int)

Table implements EntryPoint.

func (*EntryPoint64Bit) Version

func (e *EntryPoint64Bit) Version() (major, minor, revision int)

Version implements EntryPoint.

type Extract

type Extract func([]string) error
type Header struct {
	Type   uint8
	Length uint8
	Handle uint16
}

A Header is a Structure's header.

type MemoryInfoRead

type MemoryInfoRead struct {
	MemArrayHandle          uint16
	MemErrorInfoHandle      uint16
	TotalWidth              uint16
	DataWidth               uint16
	Size                    uint16
	FormFactor              byte
	DeviceSet               byte
	DeviceLocator           byte
	BankLocator             byte
	MemType                 byte
	TypeDetail              uint16
	Speed                   uint16
	Manufacturer            byte
	SerialNumber            byte
	AssetTag                byte
	PartNumber              byte
	Attribute               byte
	ExtendedSize            uint32
	ConfiguredMemClockSpeed uint16
	MinVoltage              uint16
	MaxVoltage              uint16
	ConfiguredVoltage       uint16
}

type PhysicalMemory

type PhysicalMemory struct {
	Manufacturer, SerialNumber string
	SizeInBytes                uint64
	TotalWidth                 uint64
	DataWidth                  uint64
}

type Processor

type Processor struct {
	ID              string
	Family          int
	Product         string
	CoreCount       int
	ClockSpeedInMHz int
}

type SMBIOSBaseboardInfo

type SMBIOSBaseboardInfo struct {
	Manufacturer       byte
	Product            byte
	Version            byte
	SerialNumber       byte
	AssetTag           byte
	FeatureFlags       byte
	LocationInChassis  byte
	ChassisHandle      uint16
	BoardType          byte
	ObjectHandlesCount byte
	ObjectHandles      uintptr
}

type SMBIOSMemoryInfo

type SMBIOSMemoryInfo struct {
	MemArrayHandle          uint16
	MemErrorInfoHandle      uint16
	TotalWidth              uint16
	DataWidth               uint16
	Size                    uint16
	FormFactor              byte
	DeviceSet               byte
	DeviceLocator           byte
	BankLocator             byte
	MemType                 byte
	TypeDetail              uint16
	Speed                   uint16
	SerialNumber            byte
	Manufacturer            byte
	AssetTag                byte
	PartNumber              byte
	Attribute               byte
	ExtendedSize            uint32
	ConfiguredMemClockSpeed uint16
	MinVoltage              uint16
	MaxVoltage              uint16
	ConfiguredVoltage       uint16
}

FIXME and use review

type SMBIOSProcessorInfo

type SMBIOSProcessorInfo struct {
	SocketDesignation     byte
	ProcessorType         byte
	ProcessorFamily       byte
	ProcessorManufacturer byte
	ProcessorID           [8]byte
	ProcessorVersion      byte
}

type SMBIOSProcessorType

type SMBIOSProcessorType struct {
	SocketDesignation        byte
	ProcessorType            byte
	ProcessorFamily          byte
	ProcessorManufacturer    byte
	ProcessorID              [4]uint16
	ProcessorVersion         byte
	Voltage                  byte
	ExternalClock            uint16
	MaxSpeed                 uint16
	CurrentSpeed             uint16
	Status                   byte
	ProcessorUpgrade         byte
	L1CacheHandle            uint16
	L2CacheHandle            uint16
	L3CacheHandle            uint16
	SerialNumber             byte
	AssetTag                 byte
	PartNumber               byte
	CoreCount                byte
	CoreEnabled              byte
	ThreadCount              byte
	ProcessorCharacteristics uint16
	ProcessorFamily2         uint16
	CoreCount2               uint16
	COreEnabled2             uint16
	ThreadCount2             uint16
}

type SMBIOSSystemInfo

type SMBIOSSystemInfo struct {
	Manufacturer byte
	ProductName  byte
	Version      byte
	SN           byte
	UUID         [16]byte
	WakeUpType   byte
	SKUNumber    byte
	Family       byte
}

type SMBIOSVersion

type SMBIOSVersion struct {
	Major, Minor, Revision int
}

type Structure

type Structure struct {
	Header     Header
	Formatted  []byte
	Strings    []string
	SystemInfo SystemInfo
}

A Structure is an SMBIOS structure.

type SystemEnclosure

type SystemEnclosure struct {
	Manufacturer byte

	Type byte
}

type SystemInfo

type SystemInfo struct {
	SystemManufacturerRef, SystemProductName, BiosSerial, VirtualMachineUUID,
	MotherboardAdapter, Memory, ProcessorType, ProcessorID string
	BiosInfo        *BIOSInfo
	BaseboardInfo   *BaseboardInfo
	Processors      []*Processor
	PhyMemory       []*PhysicalMemory
	SystemEnclosure *SystemEnclosure
}

type SystemInfoRead

type SystemInfoRead struct {
	Manufacturer string
	ProductName  string
	Version      string
	SerialNumber string
}

type WindowsEntryPoint

type WindowsEntryPoint struct {
	Size         uint32
	MajorVersion byte
	MinorVersion byte
	Revision     byte
}

WindowsEntryPoint contains SMBIOS Table entry point data returned from GetSystemFirmwareTable. As raw access to the underlying memory is not given, the full breadth of information is not available.

func (*WindowsEntryPoint) Table

func (e *WindowsEntryPoint) Table() (address, size int)

Table implements EntryPoint. The returned address will always be 0, as it is not returned by GetSystemFirmwareTable.

func (*WindowsEntryPoint) Version

func (e *WindowsEntryPoint) Version() (major, minor, revision int)

Version implements EntryPoint.

Jump to

Keyboard shortcuts

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