smbios

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package smbios provides low-level SMBIOS information.

Index

Constants

View Source
const (
	// TypeDetailAttributeLRDIMM is a memory device type detail attribute.
	TypeDetailAttributeLRDIMM = iota
	// TypeDetailAttributeUnbuffered is a memory device type detail attribute.
	TypeDetailAttributeUnbuffered
	// TypeDetailAttributeRegistered is a memory device type detail attribute.
	TypeDetailAttributeRegistered
	// TypeDetailAttributeNonVolatile is a memory device type detail attribute.
	TypeDetailAttributeNonVolatile
	// TypeDetailAttributeCacheDRAM is a memory device type detail attribute.
	TypeDetailAttributeCacheDRAM
	// TypeDetailAttributeWindowDRAM is a memory device type detail attribute.
	TypeDetailAttributeWindowDRAM
	// TypeDetailAttributeEDO is a memory device type detail attribute.
	TypeDetailAttributeEDO
	// TypeDetailAttributeCMOS is a memory device type detail attribute.
	TypeDetailAttributeCMOS
	// TypeDetailAttributeSynchronous is a memory device type detail attribute.
	TypeDetailAttributeSynchronous
	// TypeDetailAttributeRAMBUS is a memory device type detail attribute.
	TypeDetailAttributeRAMBUS
	// TypeDetailAttributePseudoStatic is a memory device type detail attribute.
	TypeDetailAttributePseudoStatic
	// TypeDetailAttributeStaticColumn is a memory device type detail attribute.
	TypeDetailAttributeStaticColumn
	// TypeDetailAttributeFastPaged is a memory device type detail attribute.
	TypeDetailAttributeFastPaged
	// TypeDetailAttributeUnknown is a memory device type detail attribute.
	TypeDetailAttributeUnknown
	// TypeDetailAttributeOther is a memory device type detail attribute.
	TypeDetailAttributeOther
	// TypeDetailAttributeReserved is a memory device type detail attribute.
	TypeDetailAttributeReserved
)

Variables

This section is empty.

Functions

func GetByte added in v0.2.0

func GetByte(s *smbios.Structure, offset int) uint8

GetByte retrieves a 8-bit unsigned integer at the given offset.

func GetDWord added in v0.2.0

func GetDWord(s *smbios.Structure, offset int) uint32

GetDWord retrieves a 32-bit unsigned integer at the given offset.

func GetQWord added in v0.2.0

func GetQWord(s *smbios.Structure, offset int) uint64

GetQWord retrieves a 64-bit unsigned integer at the given offset.

func GetStringOrEmpty added in v0.2.0

func GetStringOrEmpty(s *smbios.Structure, offset int) string

GetStringOrEmpty retrieves a string at the given offset. Returns an empty string if no string was present.

func GetStrings added in v0.2.0

func GetStrings(s *smbios.Structure) []string

GetStrings retrieves all strings in the given structure.

func GetUUID added in v0.2.0

func GetUUID(v Version, s *smbios.Structure) (uid uuid.UUID, err error)

GetUUID returns the system Universal Unique ID number. Return middle endian only if SMBIOS version >= 2.6. Reference: http://dnaeon.github.io/convert-big-endian-uuid-to-middle-endian/

func GetWord added in v0.2.0

func GetWord(s *smbios.Structure, offset int) uint16

GetWord retrieves a 16-bit unsigned integer at the given offset.

func IsNthBitSet added in v0.2.0

func IsNthBitSet(b, n int) bool

IsNthBitSet returns true if the `n`th bit is 1 inside `b`.

Types

type BIOSInformation added in v0.2.0

type BIOSInformation struct {
	// Vendor returns the BIOS vendor.
	Vendor string
	// Version returns the BIOS version.
	Version string
	// ReleaseDate returns the BIOS release date.
	ReleaseDate string
}

BIOSInformation represents the BIOS information.

func NewBIOSInformation added in v0.2.0

func NewBIOSInformation(s *smbios.Structure) *BIOSInformation

NewBIOSInformation initializes and returns a new `BIOSInformation`.

type BIOSLanguageInformation added in v0.2.0

type BIOSLanguageInformation struct {
	// CurrentLanguage returns the current language.
	CurrentLanguage string
	// InstallableLanguages returns the installable languages.
	InstallableLanguages []string
}

BIOSLanguageInformation represents the SMBIOS BIOS language information.

func NewBIOSLanguageInformation added in v0.2.0

func NewBIOSLanguageInformation(s *smbios.Structure) *BIOSLanguageInformation

NewBIOSLanguageInformation initializes and returns a new `BIOSLanguageInformation`.

type BaseboardInformation added in v0.2.0

type BaseboardInformation struct {
	// Manufacturer returns the baseboard manufacturer.
	Manufacturer string
	// Product returns the baseboard product.
	Product string
	// Version returns the baseboard version.
	Version string
	// SerialNumber returns the baseboard serial number.
	SerialNumber string
	// AssetTag returns the baseboard asset tag.
	AssetTag string
	// LocationInChassis returns the number of a null-terminated string that
	// describes this board's location within the chassis referenced by the
	// Chassis Handle (described below in this table)
	// NOTE: This field supports a CIM_Container class mapping where:
	// 	- LocationWithinContainer is this field.
	// 	- GroupComponent is the chassis referenced by Chassis Handle.
	// 	- PartComponent is this baseboard
	LocationInChassis string
	// BoardType identifies the type of board. See 7.3.2.
	BoardType BoardType
}

BaseboardInformation represents the SMBIOS baseboard information.

func NewBaseboardInformation added in v0.2.0

func NewBaseboardInformation(s *smbios.Structure) *BaseboardInformation

NewBaseboardInformation initializes and returns a new `BaseboardInformation`.

type BoardType added in v0.2.0

type BoardType int

BoardType defines the board type enum.

const (
	// BoardTypeUnknown is a board type.
	BoardTypeUnknown BoardType = iota
	// BoardTypeOther is a board type.
	BoardTypeOther
	// BoardTypeServerBlade is a board type.
	BoardTypeServerBlade
	// BoardTypeConnectivitySwitch is a board type.
	BoardTypeConnectivitySwitch
	// BoardTypeSystemManagementModule is a board type.
	BoardTypeSystemManagementModule
	// BoardTypeProcessorModule is a board type.
	BoardTypeProcessorModule
	// BoardTypeIOModule is a board type.
	BoardTypeIOModule
	// BoardTypeMemoryModule is a board type.
	BoardTypeMemoryModule
	// BoardTypeDaughterBoard is a board type.
	BoardTypeDaughterBoard
	// BoardTypeMotherboard is a board type.
	BoardTypeMotherboard
	// BoardTypeProcessorMemoryModule is a board type.
	BoardTypeProcessorMemoryModule
	// BoardTypeProcessorIOModule is a board type.
	BoardTypeProcessorIOModule
	// BoardTypeInterconnectBoard is a board type.
	BoardTypeInterconnectBoard
)

func (BoardType) String added in v0.2.0

func (w BoardType) String() string

type CacheInformation added in v0.2.0

type CacheInformation struct {
	// SocketDesignation returns the cache socket designation.
	SocketDesignation string
}

CacheInformation represents the SMBIOS cache information.

func NewCacheInformation added in v0.2.0

func NewCacheInformation(s *smbios.Structure) *CacheInformation

NewCacheInformation initializes and returns a new `CacheInformation`.

type ExtendedMaximumCapacity

type ExtendedMaximumCapacity uint64

ExtendedMaximumCapacity represents the physical memory array extended maximum capacity, in bytes. This field is only valid when the Maximum Capacity field contains 8000 0000h. When Maximum Capacity contains a value that is not 8000 0000h, Extended Maximum Capacity must contain zeros.

func (ExtendedMaximumCapacity) String

func (m ExtendedMaximumCapacity) String() string

type FormFactor

type FormFactor int

FormFactor represents the SMBIOS memory device form factor.

const (
	// FormFactorOther is a memory device form factor type.
	FormFactorOther FormFactor = iota
	// FormFactorUnknown is a memory device form factor type.
	FormFactorUnknown
	// FormFactorSIMM is a memory device form factor type.
	FormFactorSIMM
	// FormFactorSIP is a memory device form factor type.
	FormFactorSIP
	// FormFactorChip is a memory device form factor type.
	FormFactorChip
	// FormFactorDIP is a memory device form factor type.
	FormFactorDIP
	// FormFactorZIP is a memory device form factor type.
	FormFactorZIP
	// FormFactorProprietaryCard is a memory device form factor type.
	FormFactorProprietaryCard
	// FormFactorDIMM is a memory device form factor type.
	FormFactorDIMM
	// FormFactorTSOP is a memory device form factor type.
	FormFactorTSOP
	// FormFactorRowOfChips is a memory device form factor type.
	FormFactorRowOfChips
	// FormFactorRIMM is a memory device form factor type.
	FormFactorRIMM
	// FormFactorSODIMM is a memory device form factor type.
	FormFactorSODIMM
	// FormFactorSRIMM is a memory device form factor type.
	FormFactorSRIMM
	// FormFactorFBDIMM is a memory device form factor type.
	FormFactorFBDIMM
	// FormFactorFBDie is a memory device form factor type.
	FormFactorFBDie
)

func (FormFactor) String

func (f FormFactor) String() string

String returns the string representation of a form factor.

type GroupAssociations added in v0.2.0

type GroupAssociations struct {
	// GroupName returns the group name.
	GroupName string
}

GroupAssociations represents the SMBIOS group associations.

func NewGroupAssociations added in v0.2.0

func NewGroupAssociations(s *smbios.Structure) *GroupAssociations

NewGroupAssociations initializes and returns a new `GroupAssociations`.

type MaximumCapacity

type MaximumCapacity uint32

MaximumCapacity represents the physical memory array maximum memory capacity, in kilobytes. If the capacity is not represented in this field, then this field contains 8000 0000h and the Extended Maximum Capacity field should be used. Values 2 TB (8000 0000h) or greater must be represented in the Extended Maximum Capacity field.

func (MaximumCapacity) String

func (m MaximumCapacity) String() string

String returns the string representation of a `MaximumCapacity`.

type MemoryArrayLocation

type MemoryArrayLocation int

MemoryArrayLocation represents the memory array location.

const (
	// MemoryArrayLocationOther is a memory array location type.
	MemoryArrayLocationOther MemoryArrayLocation = iota
	// MemoryArrayLocationUnknown is a memory array location type.
	MemoryArrayLocationUnknown
	// MemoryArrayLocationSystemBoard is a memory array location type.
	MemoryArrayLocationSystemBoard
	// MemoryArrayLocationISAAddon is a memory array location type.
	MemoryArrayLocationISAAddon
	// MemoryArrayLocationEISAAddon is a memory array location type.
	MemoryArrayLocationEISAAddon
	// MemoryArrayLocationPCIAddon is a memory array location type.
	MemoryArrayLocationPCIAddon
	// MemoryArrayLocationMCAAddon is a memory array location type.
	MemoryArrayLocationMCAAddon
	// MemoryArrayLocationPCMCIAAddon is a memory array location type.
	MemoryArrayLocationPCMCIAAddon
	// MemoryArrayLocationProprietaryAddon is a memory array location type.
	MemoryArrayLocationProprietaryAddon
	// MemoryArrayLocationNuBus is a memory array location type.
	MemoryArrayLocationNuBus
	// MemoryArrayLocationPC98C20Addon is a memory array location type.
	MemoryArrayLocationPC98C20Addon
	// MemoryArrayLocationPC98C24Addon is a memory array location type.
	MemoryArrayLocationPC98C24Addon
	// MemoryArrayLocationPC98EAddon is a memory array location type.
	MemoryArrayLocationPC98EAddon
	// MemoryArrayLocationPC98LocalBusAddon is a memory array location type.
	MemoryArrayLocationPC98LocalBusAddon
)

func (MemoryArrayLocation) String

func (m MemoryArrayLocation) String() string

String returns the string representation of `MemoryArrayLocation`.

type MemoryArrayMemoryErrorCorrection

type MemoryArrayMemoryErrorCorrection int

MemoryArrayMemoryErrorCorrection represents memory array memory error correction.

const (
	// MemoryArrayMemoryErrorCorrectionOther a memory array error correction type.
	MemoryArrayMemoryErrorCorrectionOther MemoryArrayMemoryErrorCorrection = iota
	// MemoryArrayMemoryErrorCorrectionUnknown a memory array error correction type.
	MemoryArrayMemoryErrorCorrectionUnknown
	// MemoryArrayMemoryErrorCorrectionNone a memory array error correction type.
	MemoryArrayMemoryErrorCorrectionNone
	// MemoryArrayMemoryErrorCorrectionParity a memory array error correction type.
	MemoryArrayMemoryErrorCorrectionParity
	// MemoryArrayMemoryErrorCorrectionSingleBitECC a memory array error correction type.
	MemoryArrayMemoryErrorCorrectionSingleBitECC
	// MemoryArrayMemoryErrorCorrectionMultiBitECC a memory array error correction type.
	MemoryArrayMemoryErrorCorrectionMultiBitECC
	// MemoryArrayMemoryErrorCorrectionCRC a memory array error correction type.
	MemoryArrayMemoryErrorCorrectionCRC
)

func (MemoryArrayMemoryErrorCorrection) String

String returns the string representation of MemoryArrayMemoryErrorCorrection.

type MemoryArrayUse

type MemoryArrayUse int

MemoryArrayUse represents memory array use.

const (
	// MemoryArrayUseOther is a memory array use type.
	MemoryArrayUseOther MemoryArrayUse = iota
	// MemoryArrayUseUnknown is a memory array use type.
	MemoryArrayUseUnknown
	// MemoryArrayUseSystemMemory is a memory array use type.
	MemoryArrayUseSystemMemory
	// MemoryArrayUseVideoMemory is a memory array use type.
	MemoryArrayUseVideoMemory
	// MemoryArrayUseFlashMemory is a memory array use type.
	MemoryArrayUseFlashMemory
	// MemoryArrayUseNonVolatileRAM is a memory array use type.
	MemoryArrayUseNonVolatileRAM
	// MemoryArrayUseCacheMemory is a memory array use type.
	MemoryArrayUseCacheMemory
)

func (MemoryArrayUse) String

func (m MemoryArrayUse) String() string

String returns the string representation of `MemoryArrayUse`.

type MemoryDevice added in v0.2.0

type MemoryDevice struct {
	// PhysicalMemoryArrayHandle is the handle, or instance number, associated with
	// the Physical Memory Array to which this device belongs.
	PhysicalMemoryArrayHandle PhysicalMemoryArrayHandle
	// MemoryErrorInformationHandle is the handle, or instance number, associated with
	// any error that was previously detected for the
	// device. if the system does not provide the error
	// information structure, the field contains FFFEh;
	// otherwise, the field contains either FFFFh (if no
	// error was detected) or the handle of the error information structure.
	// See 7.18.4 and 7.34.
	MemoryErrorInformationHandle MemoryErrorInformationHandle
	// TotalWidth is the total width, in bits, of this memory device,
	// including any check or error-correction bits. If there
	// are no error-correction bits, this value should be
	// equal to Data Width. If the width is unknown, the
	// field is set to FFFFh.
	TotalWidth MemoryDeviceWidth
	// DataWidth is the data width, in bits, of this memory device. A
	// Data Width of 0 and a Total Width of 8 indicates that
	// the device is being used solely to provide 8 error correction bits.
	//  If the width is unknown, the field is set to FFFFh.
	DataWidth MemoryDeviceWidth
	// Size is the size of the memory device. If the value is 0, no
	// memory device is installed in the socket; if the size
	// is unknown, the field value is FFFFh. If the size is
	// 32 GB-1 MB or greater, the field value is 7FFFh and
	// the actual size is stored in the Extended Size field.
	// The granularity in which the value is specified
	// depends on the setting of the most-significant bit (bit
	// 15). If the bit is 0, the value is specified in megabyte
	// units; if the bit is 1, the value is specified in kilobyte
	// units. For example, the value 8100h identifies a
	// 256 KB memory device and 0100h identifies a
	// 256 MB memory device.
	Size MemoryDeviceSize
	// FormFactor is the implementation form factor for this memory
	// device. See 7.18.1 for definitions.
	FormFactor FormFactor
	// DeviceSet identifies when the Memory Device is one of a set
	// of Memory Devices that must be populated with all
	// devices of the same type and size, and the set to
	// which this device belongs. A value of 0 indicates
	// that the device is not part of a set; a value of FFh
	// indicates that the attribute is unknown.
	// NOTE: A Device Set number must be unique within the
	// context of the Memory Array containing this Memory
	// Device.
	DeviceSet string
	// DeviceLocator is the string number of the string that identifies the
	// physically-labeled socket or board position where
	// the memory device is located
	// EXAMPLE: “SIMM 3”.
	DeviceLocator string
	// BankLocator is the string number of the string that identifies the
	// physically labeled bank where the memory device is
	// located,
	// EXAMPLE: “Bank 0” or “A”.
	BankLocator string
	// MemoryType is the type of memory used in this device; see 7.18.2
	// for definitions.
	MemoryType MemoryType
	// TypeDetail is additional detail on the memory device type; see
	// 7.18.3 for definitions.
	TypeDetail TypeDetail
	// Speed identifies the maximum capable speed of the
	// device, in megatransfers per second (MT/s). See
	// 7.18.4 for details.
	// 0000h = the speed is unknown
	// FFFFh = the speed is 65,535 MT/s or greater,
	// and the actual speed is stored in the Extended
	// Speed field.
	Speed MemoryDeviceSpeed
	// Manufacturer is the string number for the manufacturer of this memory
	// device.
	Manufacturer string
	// SerialNumber is the string number for the serial number of this memory
	// device.
	// This value is set by the manufacturer and normally
	// is not changeable.
	SerialNumber string
	// AssetTag is the string number for the asset tag of this memory
	// device.
	AssetTag string
	// PartNumber is the string number for the part number of this memory
	// device.
	// This value is set by the manufacturer and normally
	// is not changeable.
	PartNumber string
	// Attributes returns the memory device attributes.
	Attributes uint8
	// ExtendedSize returns the memory device extended size.
	// The Extended Size field is intended to represent memory devices larger than 32,767 MB (32 GB - 1 MB),
	// which cannot be described using the Size field. This field is only meaningful if the value in the Size field
	// is 7FFFh. For compatibility with older SMBIOS parsers, memory devices smaller than (32 GB - 1 MB)
	// should be represented using their size in the Size field, leaving the Extended Size field set to 0.
	// Bit 31 is reserved for future use and must be set to 0.
	// Bits 30:0 represent the size of the memory device in megabytes.
	// Example: 0000_8000h indicates a 32 GB memory device (32,768 MB), 0002_0000h represent
	ExtendedSize MemoryDeviceExtendedSize
	// ConfiguredMemorySpeed identifies the configured speed of the memory
	// device, in megatransfers per second (MT/s). See
	// 7.18.4 for details.
	// 0000h = the speed is unknown
	// FFFFh = the speed is 65,535 MT/s or greater,
	// and the actual speed is stored in the Extended
	// Configured Memory Speed field.
	ConfiguredMemorySpeed MemoryDeviceSpeed
	// MinimumVoltage is the minimum operating voltage for this device, in millivolts
	// If the value is 0, the voltage is unknown.
	MinimumVoltage MemoryDeviceVoltage
	// MaximumVoltage is the maximum operating voltage for this device, in millivolts
	// If the value is 0, the voltage is unknown.
	MaximumVoltage MemoryDeviceVoltage
	// ConfiguredVoltage is the configured voltage for this device, in millivolts
	// If the value is 0, the voltage is unknown.
	ConfiguredVoltage MemoryDeviceVoltage
}

MemoryDevice represents a SMBIOS memory device.

func NewMemoryDevice added in v0.2.0

func NewMemoryDevice(s *smbios.Structure) *MemoryDevice

NewMemoryDevice initializes and returns a new `MemoryDevice`.

type MemoryDeviceExtendedSize added in v0.2.0

type MemoryDeviceExtendedSize uint16

MemoryDeviceExtendedSize represents the SMBIOS memory device extended size.

func (MemoryDeviceExtendedSize) String added in v0.2.0

func (m MemoryDeviceExtendedSize) String() string

String returns the string representation of the SMBIOS memory device extended size.

type MemoryDeviceSize

type MemoryDeviceSize uint16

MemoryDeviceSize represents the SMBIOS memory device size.

func (MemoryDeviceSize) Megabytes added in v0.2.0

func (m MemoryDeviceSize) Megabytes() int

Megabytes returns the size of the SMBIOS memory device converted to megabytes.

func (MemoryDeviceSize) String

func (m MemoryDeviceSize) String() string

String returns the string representation of the SMBIOS memory device size.

type MemoryDeviceSpeed

type MemoryDeviceSpeed uint16

MemoryDeviceSpeed represents the SMBIOS memory device speed.

func (MemoryDeviceSpeed) String

func (m MemoryDeviceSpeed) String() string

type MemoryDeviceVoltage

type MemoryDeviceVoltage uint16

MemoryDeviceVoltage represents the SMBIOS memory device voltage.

func (MemoryDeviceVoltage) String

func (m MemoryDeviceVoltage) String() string

type MemoryDeviceWidth

type MemoryDeviceWidth uint16

MemoryDeviceWidth represents the SMBIOS memory device width.

func (MemoryDeviceWidth) String

func (m MemoryDeviceWidth) String() string

String returns the string representation of the SMBIOS memory device width.

type MemoryErrorInformationHandle

type MemoryErrorInformationHandle uint16

MemoryErrorInformationHandle represents the SMBIOS memory error information handle.

func (MemoryErrorInformationHandle) String

String returns the string representation of the SMBIOS memory error information handle.

type MemoryType

type MemoryType int

MemoryType represents the SMBIOS memory device type.

const (
	// MemoryTypeOther is memory device type.
	MemoryTypeOther MemoryType = iota
	// MemoryTypeUnknown is memory device type.
	MemoryTypeUnknown
	// MemoryTypeDRAM is memory device type.
	MemoryTypeDRAM
	// MemoryTypeEDRAM is memory device type.
	MemoryTypeEDRAM
	// MemoryTypeVRAM is memory device type.
	MemoryTypeVRAM
	// MemoryTypeSRAM is memory device type.
	MemoryTypeSRAM
	// MemoryTypeRAM is memory device type.
	MemoryTypeRAM
	// MemoryTypeROM is memory device type.
	MemoryTypeROM
	// MemoryTypeFLASH is memory device type.
	MemoryTypeFLASH
	// MemoryTypeEEPROM is memory device type.
	MemoryTypeEEPROM
	// MemoryTypeFEPROM is memory device type.
	MemoryTypeFEPROM
	// MemoryTypeEPROM is memory device type.
	MemoryTypeEPROM
	// MemoryTypeCDRAM is memory device type.
	MemoryTypeCDRAM
	// MemoryType3DRAM is memory device type.
	MemoryType3DRAM
	// MemoryTypeSDRAM is memory device type.
	MemoryTypeSDRAM
	// MemoryTypeSGRAM is memory device type.
	MemoryTypeSGRAM
	// MemoryTypeRDRAM is memory device type.
	MemoryTypeRDRAM
	// MemoryTypeDDR is memory device type.
	MemoryTypeDDR
	// MemoryTypeDDR2 is memory device type.
	MemoryTypeDDR2
	// MemoryTypeDDR2FBDIMM is memory device type.
	MemoryTypeDDR2FBDIMM
	// MemoryTypeReserved is memory device type.
	MemoryTypeReserved
	// MemoryTypeDDR3 is memory device type.
	MemoryTypeDDR3
	// MemoryTypeFBD2 is memory device type.
	MemoryTypeFBD2
	// MemoryTypeDDR4 is memory device type.
	MemoryTypeDDR4
	// MemoryTypeLPDDR is memory device type.
	MemoryTypeLPDDR
	// MemoryTypeLPDDR2 is memory device type.
	MemoryTypeLPDDR2
	// MemoryTypeLPDDR3 is memory device type.
	MemoryTypeLPDDR3
	// MemoryTypeLPDDR4 is memory device type.
	MemoryTypeLPDDR4
	// MemoryTypeLogicalNonVolatileDevice is memory device type.
	MemoryTypeLogicalNonVolatileDevice
	// MemoryTypeHBM is memory device type.
	MemoryTypeHBM
	// MemoryTypeHBM2 is memory device type.
	MemoryTypeHBM2
	// MemoryTypeDDR5 is memory device type.
	MemoryTypeDDR5
	// MemoryTypeLPDDR5 is memory device type.
	MemoryTypeLPDDR5
)

func (MemoryType) String

func (m MemoryType) String() string

String returns the string representation of this `MemoryType` enum constant. nolint: gocyclo, cyclop

type OEMStrings added in v0.2.0

type OEMStrings struct {
	// Strings returns the actual strings.
	Strings []string
	// Count return the number of strings
	Count uint8
}

OEMStrings represents the SMBIOS OEM strings.

func NewOEMStrings added in v0.2.0

func NewOEMStrings(s *smbios.Structure) *OEMStrings

NewOEMStrings initializes and returns a new `OEMStrings`.

type PhysicalMemoryArray added in v0.2.0

type PhysicalMemoryArray struct {
	// Location returns the physical location of the Memory Array,
	// whether on the system board or an add-in board.
	// See 7.17.1 for definitions.
	Location MemoryArrayLocation
	// Use returns the function for which the array is used. See
	// 7.17.2 for definitions.
	Use MemoryArrayUse
	// MemoryErrorCorrection returns the primary hardware error correction or
	// detection method supported by this memory array.
	// See 7.17.3 for definitions.
	MemoryErrorCorrection MemoryArrayMemoryErrorCorrection
	// MaximumCapacity returns the maximum memory capacity, in kilobytes, for
	// this array. If the capacity is not represented in this
	// field, then this field contains 8000 0000h and the
	// Extended Maximum Capacity field should be
	// used. Values 2 TB (8000 0000h) or greater must
	// be represented in the Extended Maximum
	// Capacity field.
	MaximumCapacity MaximumCapacity
	// MemoryErrorInformationHandle returns the handle, or instance number, associated with
	// any error that was previously detected for the
	// array. If the system does not provide the error
	// information structure, the field contains FFFEh;
	// otherwise, the field contains either FFFFh (if no
	// error was detected) or the handle of the error-information structure.
	// See 7.18.4 and 7.34.
	MemoryErrorInformationHandle MemoryErrorInformationHandle
	// NumberOfMemoryDevices returns the number of slots or sockets available for
	// Memory Devices in this array. This value
	// represents the number of Memory Device
	// structures that comprise this Memory Array. Each
	// Memory Device has a reference to the “owning”
	// Memory Array.
	NumberOfMemoryDevices uint16
	// ExtendedMaximumCapacity returns the maximum memory capacity, in bytes, for this
	// array. This field is only valid when the Maximum
	// Capacity field contains 8000 0000h. When
	// Maximum Capacity contains a value that is not
	// 8000 0000h, Extended Maximum Capacity must
	// contain zeros.
	ExtendedMaximumCapacity ExtendedMaximumCapacity
}

PhysicalMemoryArray represents the SMBIOS physical memory array.

func NewPhysicalMemoryArray added in v0.2.0

func NewPhysicalMemoryArray(s *smbios.Structure) *PhysicalMemoryArray

NewPhysicalMemoryArray initializes and returns a new `PhysicalMemoryArray`.

type PhysicalMemoryArrayHandle

type PhysicalMemoryArrayHandle uint16

PhysicalMemoryArrayHandle represents the SMBIOS physical memory array handle.

func (PhysicalMemoryArrayHandle) String

func (p PhysicalMemoryArrayHandle) String() string

type PortConnectorInformation added in v0.2.0

type PortConnectorInformation struct {
	// InternalReferenceDesignator returns the port connector internal reference designator.
	InternalReferenceDesignator string
	// ExternalReferenceDesignator returns the port connector external reference designator.
	ExternalReferenceDesignator string
}

PortConnectorInformation represents the port connector information.

func NewPortConnectorInformation added in v0.2.0

func NewPortConnectorInformation(s *smbios.Structure) *PortConnectorInformation

NewPortConnectorInformation initializes and returns a new `PortConnectorInformation`.

type ProcessorInformation added in v0.2.0

type ProcessorInformation struct {
	// SocketDesignation returns the processor socket designation.
	SocketDesignation string
	// ProcessorManufacturer returns the processor manufacturer.
	ProcessorManufacturer string
	// ProcessorVersion returns the processor version.
	ProcessorVersion string
	// MaxSpeed returns the maximum speed of the processor,
	// in MHz, supported by the system for this processor socket.
	// If the value is unknown, the field is set to 0.
	// NOTE: This field identifies a capability for the system,
	// not the processor itself.
	MaxSpeed uint16
	// CurrentSpeed returns the current speed of the processor.
	// in MHz, supported by the system for this processor socket.
	// NOTE: This field identifies the processor's speed at
	// system boot, and the Processor ID field implies the
	// processor's additional speed characteristics (that is,
	// single speed or multiple speed).
	CurrentSpeed uint16
	// ProcessorStatus returns the processor status.
	Status ProcessorStatus
	// SerialNumber returns the processor serial number.
	SerialNumber string
	// AssetTag returns the processor asset tag.
	AssetTag string
	// PartNumber returns the processor part number.
	PartNumber string
	// CoreCount returns the processor's number of cores.
	CoreCount uint8
	// CoreEnabled returns the processor's number of enabled cores.
	CoreEnabled uint8
	// ThreadCount returns the processor's number of threads.
	ThreadCount uint8
}

ProcessorInformation represents the SMBIOS process information.

func NewProcessorInformation added in v0.2.0

func NewProcessorInformation(s *smbios.Structure) *ProcessorInformation

NewProcessorInformation initializes and returns a new `ProcessorInformation`.

type ProcessorStatus added in v0.2.0

type ProcessorStatus int

ProcessorStatus represents the processor status.

func (ProcessorStatus) SocketPopulated added in v0.2.0

func (s ProcessorStatus) SocketPopulated() bool

SocketPopulated returns true if the SMBIOS processor socket is populated.

type SMBIOS

type SMBIOS struct {
	Version    Version
	Structures []*smbios.Structure `json:"-"`

	BIOSInformation            BIOSInformation
	SystemInformation          SystemInformation
	BaseboardInformation       BaseboardInformation
	SystemEnclosure            SystemEnclosure
	ProcessorInformation       []ProcessorInformation
	CacheInformation           []CacheInformation
	PortConnectorInformation   []PortConnectorInformation
	SystemSlots                []SystemSlot
	OEMStrings                 OEMStrings
	SystemConfigurationOptions SystemConfigurationOptions
	BIOSLanguageInformation    BIOSLanguageInformation
	GroupAssociations          GroupAssociations
	PhysicalMemoryArray        PhysicalMemoryArray
	MemoryDevices              []MemoryDevice
}

SMBIOS represents the System Management BIOS.

func Decode added in v0.2.0

func Decode(rc io.Reader, version Version) (*SMBIOS, error)

Decode decodes the stream of the provided `Reader` and returns a new `SMBIOS`.

func New

func New() (*SMBIOS, error)

New initializes and returns a new `SMBIOS`.

type SystemConfigurationOptions added in v0.2.0

type SystemConfigurationOptions struct {
	// Strings returns the actual strings.
	Strings []string
	// Count return the number of strings
	Count uint8
}

SystemConfigurationOptions represents the SMBIOS system configuration options.

func NewSystemConfigurationOptions added in v0.2.0

func NewSystemConfigurationOptions(s *smbios.Structure) *SystemConfigurationOptions

NewSystemConfigurationOptions initializes and returns a new `SystemConfigurationOptions`.

type SystemEnclosure added in v0.2.0

type SystemEnclosure struct {
	// Manufacturer returns the system enclosure manufacturer.
	Manufacturer string
	// Version returns the system enclosure version.
	Version string
	// SerialNumber returns the system enclosure serial number.
	SerialNumber string
	// AssetTagNumber returns the system enclosure asset tag number.
	AssetTagNumber string
	// SKUNumber returns the system enclosure SKU number.
	SKUNumber string
}

SystemEnclosure represents the system enclosure.

func NewSystemEnclosure added in v0.2.0

func NewSystemEnclosure(s *smbios.Structure) *SystemEnclosure

NewSystemEnclosure initializes and returns a new `SystemEnclosure`.

type SystemInformation added in v0.2.0

type SystemInformation struct {
	// Manufacturer returns the system manufacturer.
	Manufacturer string
	// ProductName returns the system product name.
	ProductName string
	// Version returns the system version.
	Version string
	// SerialNumber returns the system serial number.
	SerialNumber string
	// UUID returns the system UUID.
	UUID string
	// WakeUpType identifies the event that caused the system to
	// power up. See 7.2.2.
	WakeUpType WakeUpType
	// SKUNumber returns the system SKU number.
	SKUNumber string
	// Family returns the system family.
	Family string
}

SystemInformation represents the SMBIOS system information.

func NewSystemInformation added in v0.2.0

func NewSystemInformation(s *smbios.Structure, v Version) *SystemInformation

NewSystemInformation initializes and returns a new `SystemInformation`.

type SystemSlot added in v0.2.0

type SystemSlot struct {
	// SlotDesignation returns the slot designation.
	SlotDesignation string
}

SystemSlot represents a SMBIOS system slot.

func NewSystemSlot added in v0.2.0

func NewSystemSlot(s *smbios.Structure) *SystemSlot

NewSystemSlot initializes and returns a new `SystemSlot`.

type TypeDetail

type TypeDetail uint16

TypeDetail represents the SMBIOS memory device detail.

func (TypeDetail) Attributes

func (t TypeDetail) Attributes() []TypeDetailAttribute

Attributes returns the SMBIOS memory device detail attribute.

func (TypeDetail) String

func (t TypeDetail) String() string

type TypeDetailAttribute

type TypeDetailAttribute int

TypeDetailAttribute represents the SMBIOS memory device detail attribute.

func (TypeDetailAttribute) String

func (t TypeDetailAttribute) String() string

type Version added in v0.2.0

type Version struct {
	Major    int
	Minor    int
	Revision int
}

Version represents the System Management BIOS version.

type WakeUpType added in v0.2.0

type WakeUpType int

WakeUpType defines the Wake-up type enum.

const (
	// WakeUpTypeReserved is a wakeup type.
	WakeUpTypeReserved WakeUpType = iota
	// WakeUpTypeOther is a wakeup type.
	WakeUpTypeOther
	// WakeUpTypeUnknown is a wakeup type.
	WakeUpTypeUnknown
	// WakeUpTypeAPMTimer is a wakeup type.
	WakeUpTypeAPMTimer
	// WakeUpTypeModemRing is a wakeup type.
	WakeUpTypeModemRing
	// WakeUpTypeLANRemote is a wakeup type.
	WakeUpTypeLANRemote
	// WakeUpTypePowerSwitch is a wakeup type.
	WakeUpTypePowerSwitch
	// WakeUpTypePCIPME is a wakeup type.
	WakeUpTypePCIPME
	// WakeUpTypeACPowerRestored is a wakeup type.
	WakeUpTypeACPowerRestored
)

func (WakeUpType) String added in v0.2.0

func (w WakeUpType) String() string

Jump to

Keyboard shortcuts

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