devicepath

package module
v0.0.0-...-c12efdd Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

README

device-path

Build Status

Go library to handle UEFI device paths

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownSubType  = errors.New("unknown device sub-type")
	ErrMalformedString = errors.New("malformed device string")
)
View Source
var ErrPathComplete = errors.New("device path already complete")

Functions

This section is empty.

Types

type DeviceNodeSubType

type DeviceNodeSubType uint8
const (
	SATAMessaging        DeviceNodeSubType = 18
	MacMessagingSubType  DeviceNodeSubType = 11
	IPv4MessagingSubType DeviceNodeSubType = 12
	IPv6MessagingSubType DeviceNodeSubType = 13
)
const (
	HardDriveSubType DeviceNodeSubType = 1
	FileSubType      DeviceNodeSubType = 4
)
const ACPISubType DeviceNodeSubType = 1
const EndOfEntireDevicePath DeviceNodeSubType = 0xFF
const (
	PCIHardware DeviceNodeSubType = 0x01
)

type DeviceNodeType

type DeviceNodeType uint8
const (
	HardwareDevicePath               DeviceNodeType = 0x01
	ACPIDevicePath                   DeviceNodeType = 0x02
	MessagingDevicePath              DeviceNodeType = 0x03
	MediaDevicePath                  DeviceNodeType = 0x04
	BIOSBootSpecificationsDevicePath DeviceNodeType = 0x05
	EndOfHardwareDevicePath          DeviceNodeType = 0x7F
)

type DevicePath

type DevicePath struct {
	Nodes []DevicePathNode
}

func ParseDevicePath

func ParseDevicePath(raw string) (*DevicePath, error)

func (*DevicePath) PushNode

func (dp *DevicePath) PushNode(node DevicePathNode) error

func (*DevicePath) String

func (dp *DevicePath) String() string

type DevicePathNode

type DevicePathNode interface {
	Type() DeviceNodeType
	SubType() DeviceNodeSubType
	ParseString(raw string) error
	String() string
	Bytes() []byte
}

func Parsenode

func Parsenode(raw string) (DevicePathNode, error)

type ErrInvalidArguments

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

func (*ErrInvalidArguments) Error

func (e *ErrInvalidArguments) Error() string

type ErrInvalidPath

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

func (*ErrInvalidPath) Error

func (e *ErrInvalidPath) Error() string

type FileDevicePath

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

func (*FileDevicePath) Bytes

func (fp *FileDevicePath) Bytes() []byte

func (*FileDevicePath) ParseString

func (fp *FileDevicePath) ParseString(raw string) error

func (*FileDevicePath) String

func (fp *FileDevicePath) String() string

func (*FileDevicePath) SubType

func (fp *FileDevicePath) SubType() DeviceNodeSubType

func (*FileDevicePath) Type

func (fp *FileDevicePath) Type() DeviceNodeType

type FinalDevicePath

type FinalDevicePath struct {
}

func (*FinalDevicePath) Bytes

func (fp *FinalDevicePath) Bytes() []byte

func (*FinalDevicePath) ParseString

func (fp *FinalDevicePath) ParseString(raw string) error

func (*FinalDevicePath) String

func (fp *FinalDevicePath) String() string

func (*FinalDevicePath) SubType

func (fp *FinalDevicePath) SubType() DeviceNodeSubType

func (*FinalDevicePath) Type

func (fp *FinalDevicePath) Type() DeviceNodeType

type HardDriveDevicePath

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

func (*HardDriveDevicePath) Bytes

func (hp *HardDriveDevicePath) Bytes() []byte

func (*HardDriveDevicePath) ParseString

func (hp *HardDriveDevicePath) ParseString(raw string) error

func (*HardDriveDevicePath) String

func (hp *HardDriveDevicePath) String() string

func (*HardDriveDevicePath) SubType

func (hp *HardDriveDevicePath) SubType() DeviceNodeSubType

func (*HardDriveDevicePath) Type

type Ipv4DevicePath

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

func (*Ipv4DevicePath) Bytes

func (ip *Ipv4DevicePath) Bytes() []byte

func (*Ipv4DevicePath) ParseString

func (ip *Ipv4DevicePath) ParseString(raw string) error

func (*Ipv4DevicePath) String

func (ip *Ipv4DevicePath) String() string

func (*Ipv4DevicePath) SubType

func (ip *Ipv4DevicePath) SubType() DeviceNodeSubType

func (*Ipv4DevicePath) Type

func (ip *Ipv4DevicePath) Type() DeviceNodeType

type Ipv6DevicePath

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

func (*Ipv6DevicePath) Bytes

func (ip *Ipv6DevicePath) Bytes() []byte

func (*Ipv6DevicePath) ParseString

func (ip *Ipv6DevicePath) ParseString(raw string) error

func (*Ipv6DevicePath) String

func (ip *Ipv6DevicePath) String() string

func (*Ipv6DevicePath) SubType

func (ip *Ipv6DevicePath) SubType() DeviceNodeSubType

func (*Ipv6DevicePath) Type

func (ip *Ipv6DevicePath) Type() DeviceNodeType

type MacDevicePath

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

func (*MacDevicePath) Bytes

func (mp *MacDevicePath) Bytes() []byte

func (*MacDevicePath) ParseString

func (mp *MacDevicePath) ParseString(raw string) error

func (*MacDevicePath) String

func (mp *MacDevicePath) String() string

func (*MacDevicePath) SubType

func (mp *MacDevicePath) SubType() DeviceNodeSubType

func (*MacDevicePath) Type

func (mp *MacDevicePath) Type() DeviceNodeType

type PCIDevicePath

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

func NewPCIDevicePath

func NewPCIDevicePath(function, device uint8) *PCIDevicePath

func (*PCIDevicePath) Bytes

func (pcp *PCIDevicePath) Bytes() []byte

func (*PCIDevicePath) ParseString

func (pcp *PCIDevicePath) ParseString(raw string) error

func (*PCIDevicePath) String

func (pcp *PCIDevicePath) String() string

func (*PCIDevicePath) SubType

func (pcp *PCIDevicePath) SubType() DeviceNodeSubType

func (*PCIDevicePath) Type

func (pcp *PCIDevicePath) Type() DeviceNodeType

type PCIRootDevicePath

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

func (*PCIRootDevicePath) Bytes

func (prp *PCIRootDevicePath) Bytes() []byte

func (*PCIRootDevicePath) ParseString

func (prp *PCIRootDevicePath) ParseString(raw string) error

func (*PCIRootDevicePath) String

func (prp *PCIRootDevicePath) String() string

func (*PCIRootDevicePath) SubType

func (prp *PCIRootDevicePath) SubType() DeviceNodeSubType

func (*PCIRootDevicePath) Type

func (prp *PCIRootDevicePath) Type() DeviceNodeType

type SataDevicePath

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

func NewSataFromPortNumber

func NewSataFromPortNumber(portNumber uint16) *SataDevicePath

func (*SataDevicePath) Bytes

func (sp *SataDevicePath) Bytes() []byte

func (*SataDevicePath) ParseString

func (sp *SataDevicePath) ParseString(raw string) error

func (*SataDevicePath) String

func (sp *SataDevicePath) String() string

func (*SataDevicePath) SubType

func (sp *SataDevicePath) SubType() DeviceNodeSubType

func (*SataDevicePath) Type

func (sp *SataDevicePath) Type() DeviceNodeType

Jump to

Keyboard shortcuts

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