netlink

package
v0.1.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type CanAttributes

type CanAttributes struct {

	// State contains one of unix.CAN_STATE_* values.
	State uint32

	// CtrlMode may be used to access unix.CAN_CTRLMODE_* flags,
	// e.g. for activating FD mode or to configure termination.
	CtrlMode unix.CANCtrlMode

	RestartMs uint32
	Clock     uint32

	BusErrCounters *unix.CANBusErrorCounters

	// BitTiming defines the bit rate, or, alternatively,
	// bit timing parameters. When writing, either the
	// the bit rate or the timing parameters should be left blank.
	BitTiming      *unix.CANBitTiming
	BitTimingConst *unix.CANBitTimingConst

	DataBitTiming      *unix.CANBitTiming
	DataBitTimingConst *unix.CANBitTimingConst

	BitrateMax uint32

	UnknownTypes []uint16
}

CanAttributes contain the attributes read from a CAN network interface. Fields that are defined as pointers may be nil if they have not been included by the kernel.

See https://github.com/torvalds/linux/blob/master/drivers/net/can/dev/netlink.c for details.

This structure does not provide access to IFLA_CAN_CTRLMODE_EXT, which has not been ported to Linux v5.15 yet. Also, IFLA_CAN_TDC_* is not supported.

type Link struct {
	Attr *rtnetlink.LinkAttributes
	Can  *CanAttributes
}

func List

func List() ([]*Link, error)

func Lookup

func Lookup(name string) (*Link, error)

func (*Link) Bitrate

func (link *Link) Bitrate() (uint32, bool)

func (*Link) DriverName

func (link *Link) DriverName() string

func (*Link) Name

func (link *Link) Name() string

Jump to

Keyboard shortcuts

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