smbios

package
v0.0.0-...-390a4f4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 8 Imported by: 59

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 Decoder

type Decoder struct {
	// 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 Header struct {
	Type   uint8
	Length uint8
	Handle uint16
}

A Header is a Structure's header.

type Structure

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

A Structure is an SMBIOS structure.

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