eeprom

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: GPL-2.0, GPL-2.0-or-later Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnieDataSz = 8
	LenOffset  = OnieDataSz + 1
	HeaderSz   = LenOffset + 2
)
View Source
const (
	ProductNameType         = Type(0x21)
	PartNumberType          = Type(0x22)
	SerialNumberType        = Type(0x23)
	BaseEthernetAddressType = Type(0x24)
	ManufactureDateType     = Type(0x25)
	DeviceVersionType       = Type(0x26)
	LabelRevisionType       = Type(0x27)
	PlatformNameType        = Type(0x28)
	OnieVersionType         = Type(0x29)
	NEthernetAddressType    = Type(0x2a)
	ManufacturerType        = Type(0x2b)
	CountryCodeType         = Type(0x2c)
	VendorType              = Type(0x2d)
	DiagVersionType         = Type(0x2e)
	ServiceTagType          = Type(0x2f)
	VendorExtensionType     = Type(0xfd)
	CrcType                 = Type(0xfe)
)
View Source
const WriteEnable = false

Enable with the "diag" build tag.

Variables

View Source
var Vendor struct {
	New       func() VendorExtension
	ReadBytes func() ([]byte, error)
	Write     func([]byte) (int, error)
}

Each machine main must assign the following Vendor parameters

Functions

This section is empty.

Types

type Byter

type Byter interface {
	Byte() byte
}

type Byteser

type Byteser interface {
	Bytes() []byte
}

type Command

type Command struct {
	Config func()
}

func (Command) Apropos

func (Command) Apropos() lang.Alt

func (Command) Complete

func (c Command) Complete(args ...string) []string

func (Command) Main

func (c Command) Main(args ...string) error

func (Command) Man

func (Command) Man() lang.Alt

func (Command) String

func (Command) String() string

func (Command) Usage

func (Command) Usage() string

type Dec16

type Dec16 uint16

func (*Dec16) Bytes

func (p *Dec16) Bytes() []byte

func (*Dec16) Scan

func (p *Dec16) Scan(s string) error

func (*Dec16) String

func (p *Dec16) String() string

func (*Dec16) Write

func (p *Dec16) Write(b []byte) (int, error)

type Deler

type Deler interface {
	Del(string)
}

type Eeprom

type Eeprom struct {
	Onie struct {
		Data    *OnieData
		Version *Hex8
	}
	Tlv TlvMap
}

func (*Eeprom) Bytes

func (p *Eeprom) Bytes() []byte

func (*Eeprom) Clone

func (p *Eeprom) Clone() (*Eeprom, error)

func (*Eeprom) Del

func (p *Eeprom) Del(name string)

func (*Eeprom) Equal

func (p *Eeprom) Equal(clone *Eeprom) error

func (*Eeprom) Set

func (p *Eeprom) Set(name, s string) (err error)

func (*Eeprom) String

func (p *Eeprom) String() string

func (*Eeprom) Write

func (p *Eeprom) Write(buf []byte) (n int, err error)

type EthernetAddress

type EthernetAddress net.HardwareAddr

func (EthernetAddress) Bytes

func (p EthernetAddress) Bytes() []byte

func (EthernetAddress) Scan

func (p EthernetAddress) Scan(s string) error

func (EthernetAddress) String

func (p EthernetAddress) String() string

func (EthernetAddress) Write

func (p EthernetAddress) Write(b []byte) (int, error)

type Hex32

type Hex32 uint32

func (*Hex32) Bytes

func (p *Hex32) Bytes() []byte

func (*Hex32) Scan

func (p *Hex32) Scan(s string) error

func (*Hex32) String

func (p *Hex32) String() string

func (*Hex32) Write

func (p *Hex32) Write(b []byte) (int, error)

type Hex8

type Hex8 uint8

func (*Hex8) Bytes

func (p *Hex8) Bytes() []byte

func (*Hex8) Scan

func (p *Hex8) Scan(s string) error

func (*Hex8) String

func (p *Hex8) String() string

func (*Hex8) Write

func (p *Hex8) Write(b []byte) (int, error)

type OnieData

type OnieData [OnieDataSz]byte

func (*OnieData) Bytes

func (p *OnieData) Bytes() []byte

func (*OnieData) Scan

func (p *OnieData) Scan(s string) error

func (*OnieData) String

func (p *OnieData) String() string

func (*OnieData) Write

func (p *OnieData) Write(b []byte) (int, error)

type Reseter

type Reseter interface {
	Reset()
}

type Scanner

type Scanner interface {
	Scan(string) error
}

type Setter

type Setter interface {
	Set(string, string) error
}

type TlvMap

type TlvMap map[Typer]interface{}

func (TlvMap) Add

func (m TlvMap) Add(t Type) (v interface{})

func (TlvMap) Bytes

func (m TlvMap) Bytes() []byte

func (TlvMap) Equal

func (m TlvMap) Equal(nm TlvMap) error

func (TlvMap) String

func (m TlvMap) String() string

func (TlvMap) Write

func (m TlvMap) Write(buf []byte) (n int, err error)

Write buf into TlvMap

type Type

type Type uint8

func (Type) Byte

func (t Type) Byte() byte

func (Type) String

func (t Type) String() string

type Typer

type Typer interface {
	Byter
	fmt.Stringer
}

type VendorExtension

type VendorExtension interface {
	Byteser
	Deler
	Setter
	fmt.Stringer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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