Documentation
¶
Overview ¶
The ethtool package aims to provide a library that provides easy access to the Linux SIOCETHTOOL ioctl operations. It can be used to retrieve information from a network device such as statistics, driver related information or even the peer of a VETH interface.
Package ethtool aims to provide a library giving a simple access to the Linux SIOCETHTOOL ioctl operations. It can be used to retrieve informations from a network device like statistics, driver related informations or even the peer of a VETH interface.
Package ethtool aims to provide a library giving a simple access to the Linux SIOCETHTOOL ioctl operations. It can be used to retrieve informations from a network device like statistics, driver related informations or even the peer of a VETH interface.
Index ¶
- Constants
- Variables
- func BusInfo(intf string) (string, error)
- func CmdGetMapped(intf string) (map[string]uint64, error)
- func DriverName(intf string) (string, error)
- func Identity(intf string, duration *time.Duration) error
- func MsglvlGet(intf string) (uint32, error)
- func MsglvlSet(intf string, valset uint32) (uint32, uint32, error)
- func PermAddr(intf string) (string, error)
- func Stats(intf string) (map[string]uint64, error)
- func SupportedLinkModes(mask uint64) []string
- func SupportedSpeed(mask uint64) uint64
- type Channels
- type Coalesce
- type DrvInfo
- type Ethtool
- func (e *Ethtool) BusInfo(intf string) (string, error)
- func (e *Ethtool) Change(intf string, config map[string]bool) error
- func (e *Ethtool) Close()
- func (e *Ethtool) CmdGet(ecmd *EthtoolCmd, intf string) (uint32, error)
- func (e *Ethtool) CmdGetMapped(intf string) (map[string]uint64, error)
- func (e *Ethtool) CmdSet(ecmd *EthtoolCmd, intf string) (uint32, error)
- func (e *Ethtool) DriverInfo(intf string) (DrvInfo, error)
- func (e *Ethtool) DriverName(intf string) (string, error)
- func (e *Ethtool) FeatureNames(intf string) (map[string]uint, error)
- func (e *Ethtool) Features(intf string) (map[string]bool, error)
- func (e *Ethtool) FeaturesWithState(intf string) (map[string]FeatureState, error)
- func (e *Ethtool) GetChannels(intf string) (Channels, error)
- func (e *Ethtool) GetCoalesce(intf string) (Coalesce, error)
- func (e *Ethtool) GetIndir(intf string) (Indir, error)
- func (e *Ethtool) GetLinkSettings(intf string) (*LinkSettings, error)
- func (e *Ethtool) GetPause(intf string) (Pause, error)
- func (e *Ethtool) GetRing(intf string) (Ring, error)
- func (e *Ethtool) GetTimestampingInformation(intf string) (TimestampingInformation, error)
- func (e *Ethtool) GetWakeOnLan(intf string) (WakeOnLan, error)
- func (e *Ethtool) Identity(intf string, duration *time.Duration) error
- func (e *Ethtool) LinkState(intf string) (uint32, error)
- func (e *Ethtool) ModuleEeprom(intf string) ([]byte, error)
- func (e *Ethtool) ModuleEepromHex(intf string) (string, error)
- func (e *Ethtool) MsglvlGet(intf string) (uint32, error)
- func (e *Ethtool) MsglvlSet(intf string, valset uint32) (uint32, uint32, error)
- func (e *Ethtool) PermAddr(intf string) (string, error)
- func (e *Ethtool) PrivFlags(intf string) (map[string]bool, error)
- func (e *Ethtool) PrivFlagsNames(intf string) (map[string]uint, error)
- func (e *Ethtool) SetChannels(intf string, channels Channels) (Channels, error)
- func (e *Ethtool) SetCoalesce(intf string, coalesce Coalesce) (Coalesce, error)
- func (e *Ethtool) SetIndir(intf string, setIndir SetIndir) (Indir, error)
- func (e *Ethtool) SetLinkSettings(intf string, settings *LinkSettings) error
- func (e *Ethtool) SetPause(intf string, pause Pause) (Pause, error)
- func (e *Ethtool) SetRing(intf string, ring Ring) (Ring, error)
- func (e *Ethtool) SetWakeOnLan(intf string, wol WakeOnLan) (WakeOnLan, error)
- func (e *Ethtool) Stats(intf string) (map[string]uint64, error)
- func (e *Ethtool) StatsWithBuffer(intf string, gstringsPtr *EthtoolGStrings, statsPtr *EthtoolStats) (map[string]uint64, error)
- func (e *Ethtool) UpdatePrivFlags(intf string, config map[string]bool) error
- type EthtoolCmd
- type EthtoolGStrings
- type EthtoolLinkSettingsFixed
- type EthtoolStats
- type FeatureState
- type IdentityConf
- type Indir
- type LinkSettingSource
- type LinkSettings
- type Pause
- type Ring
- type SetIndir
- type TimestampingInformation
- type WakeOnLan
Constants ¶
const ( ETH_GSTRING_LEN = 32 ETH_SS_STATS = 1 ETH_SS_PRIV_FLAGS = 2 ETH_SS_FEATURES = 4 // CMD supported ETHTOOL_GSET = 0x00000001 /* Get settings. */ ETHTOOL_SSET = 0x00000002 /* Set settings. */ ETHTOOL_GWOL = 0x00000005 /* Get wake-on-lan options. */ ETHTOOL_SWOL = 0x00000006 /* Set wake-on-lan options. */ ETHTOOL_GDRVINFO = 0x00000003 /* Get driver info. */ ETHTOOL_GMSGLVL = 0x00000007 /* Get driver message level */ ETHTOOL_SMSGLVL = 0x00000008 /* Set driver msg level. */ ETHTOOL_GLINKSETTINGS = unix.ETHTOOL_GLINKSETTINGS // 0x4c ETHTOOL_SLINKSETTINGS = unix.ETHTOOL_SLINKSETTINGS // 0x4d // Get link status for host, i.e. whether the interface *and* the // physical port (if there is one) are up (ethtool_value). ETHTOOL_GLINK = 0x0000000a ETHTOOL_GCOALESCE = 0x0000000e /* Get coalesce config */ ETHTOOL_SCOALESCE = 0x0000000f /* Set coalesce config */ ETHTOOL_GRINGPARAM = 0x00000010 /* Get ring parameters */ ETHTOOL_SRINGPARAM = 0x00000011 /* Set ring parameters. */ ETHTOOL_GPAUSEPARAM = 0x00000012 /* Get pause parameters */ ETHTOOL_SPAUSEPARAM = 0x00000013 /* Set pause parameters. */ ETHTOOL_GSTRINGS = 0x0000001b /* Get specified string set */ ETHTOOL_PHYS_ID = 0x0000001c /* Identify the NIC */ ETHTOOL_GSTATS = 0x0000001d /* Get NIC-specific statistics */ ETHTOOL_GPERMADDR = 0x00000020 /* Get permanent hardware address */ ETHTOOL_GFLAGS = 0x00000025 /* Get flags bitmap(ethtool_value) */ ETHTOOL_GPFLAGS = 0x00000027 /* Get driver-private flags bitmap */ ETHTOOL_SPFLAGS = 0x00000028 /* Set driver-private flags bitmap */ ETHTOOL_GSSET_INFO = 0x00000037 /* Get string set info */ ETHTOOL_GFEATURES = 0x0000003a /* Get device offload settings */ ETHTOOL_SFEATURES = 0x0000003b /* Change device offload settings */ ETHTOOL_GCHANNELS = 0x0000003c /* Get no of channels */ ETHTOOL_SCHANNELS = 0x0000003d /* Set no of channels */ ETHTOOL_GET_TS_INFO = 0x00000041 /* Get time stamping and PHC info */ ETHTOOL_GMODULEINFO = 0x00000042 /* Get plug-in module information */ ETHTOOL_GMODULEEEPROM = 0x00000043 /* Get plug-in module eeprom */ ETHTOOL_GRXFHINDIR = 0x00000038 /* Get RX flow hash indir'n table */ ETHTOOL_SRXFHINDIR = 0x00000039 /* Set RX flow hash indir'n table */ ETH_RXFH_INDIR_NO_CHANGE = 0xFFFFFFFF // Speed and Duplex unknowns/constants (Manually defined based on <linux/ethtool.h>) SPEED_UNKNOWN = 0xffffffff // ((__u32)-1) SPEED_UNKNOWN DUPLEX_HALF = 0x00 // DUPLEX_HALF DUPLEX_FULL = 0x01 // DUPLEX_FULL DUPLEX_UNKNOWN = 0xff // DUPLEX_UNKNOWN // Port types (Manually defined based on <linux/ethtool.h>) PORT_TP = 0x00 // PORT_TP PORT_AUI = 0x01 // PORT_AUI PORT_MII = 0x02 // PORT_MII PORT_FIBRE = 0x03 // PORT_FIBRE PORT_BNC = 0x04 // PORT_BNC PORT_DA = 0x05 // PORT_DA PORT_NONE = 0xef // PORT_NONE PORT_OTHER = 0xff // PORT_OTHER // Autoneg settings (Manually defined based on <linux/ethtool.h>) AUTONEG_DISABLE = 0x00 // AUTONEG_DISABLE AUTONEG_ENABLE = 0x01 // AUTONEG_ENABLE // MDIX states (Manually defined based on <linux/ethtool.h>) ETH_TP_MDI_INVALID = 0x00 // ETH_TP_MDI_INVALID ETH_TP_MDI = 0x01 // ETH_TP_MDI ETH_TP_MDI_X = 0x02 // ETH_TP_MDI_X ETH_TP_MDI_AUTO = 0x03 // Control value ETH_TP_MDI_AUTO // Link mode mask bits count (Manually defined based on ethtool.h) ETHTOOL_LINK_MODE_MASK_NBITS = 92 // __ETHTOOL_LINK_MODE_MASK_NBITS // Calculate max nwords based on NBITS using the manually defined constant MAX_LINK_MODE_MASK_NWORDS = (ETHTOOL_LINK_MODE_MASK_NBITS + 31) / 32 // = 3 )
ethtool stats related constants.
const ( MAX_GSTRINGS = 32768 MAX_FEATURE_BLOCKS = (MAX_GSTRINGS + 32 - 1) / 32 EEPROM_LEN = 640 PERMADDR_LEN = 32 )
MAX_GSTRINGS maximum number of stats entries that ethtool can retrieve currently.
const ( WAKE_PHY = 1 << 0 WAKE_UCAST = 1 << 1 WAKE_MCAST = 1 << 2 WAKE_BCAST = 1 << 3 WAKE_ARP = 1 << 4 WAKE_MAGIC = 1 << 5 WAKE_MAGICSECURE = 1 << 6 // only meaningful if WAKE_MAGIC )
WoL options
const ( SOF_TIMESTAMPING_TX_HARDWARE = (1 << 0) /* Request tx timestamps generated by the network adapter. */ SOF_TIMESTAMPING_TX_SOFTWARE = (1 << 1) /* Request tx timestamps when data leaves the kernel. */ SOF_TIMESTAMPING_RX_HARDWARE = (1 << 2) /* Request rx timestamps generated by the network adapter. */ SOF_TIMESTAMPING_RX_SOFTWARE = (1 << 3) /* Request rx timestamps when data enters the kernel. */ SOF_TIMESTAMPING_SOFTWARE = (1 << 4) /* Report any software timestamps when available. */ SOF_TIMESTAMPING_SYS_HARDWARE = (1 << 5) /* This option is deprecated and ignored. */ SOF_TIMESTAMPING_RAW_HARDWARE = (1 << 6) /* Report hardware timestamps. */ SOF_TIMESTAMPING_OPT_ID = (1 << 7) /* Generate a unique identifier along with each packet. */ SOF_TIMESTAMPING_TX_SCHED = (1 << 8) /* Request tx timestamps prior to entering the packet scheduler. */ SOF_TIMESTAMPING_TX_ACK = (1 << 9) /* Request tx timestamps when all data in the send buffer has been acknowledged. */ SOF_TIMESTAMPING_OPT_CMSG = (1 << 10) /* Support recv() cmsg for all timestamped packets. */ SOF_TIMESTAMPING_OPT_TSONLY = (1 << 11) /* Applies to transmit timestamps only. */ SOF_TIMESTAMPING_OPT_STATS = (1 << 12) /* Optional stats that are obtained along with the transmit timestamps. */ SOF_TIMESTAMPING_OPT_PKTINFO = (1 << 13) /* Enable the SCM_TIMESTAMPING_PKTINFO control message for incoming packets with hardware timestamps. */ SOF_TIMESTAMPING_OPT_TX_SWHW = (1 << 14) /* Request both hardware and software timestamps for outgoing packets when SOF_TIMESTAMPING_TX_HARDWARE and SOF_TIMESTAMPING_TX_SOFTWARE are enabled at the same time. */ SOF_TIMESTAMPING_BIND_PHC = (1 << 15) /* Bind the socket to a specific PTP Hardware Clock. */ )
Timestamping options see: https://www.kernel.org/doc/Documentation/networking/timestamping.txt
const ( /* * No outgoing packet will need hardware time stamping; * should a packet arrive which asks for it, no hardware * time stamping will be done. */ HWTSTAMP_TX_OFF = iota /* * Enables hardware time stamping for outgoing packets; * the sender of the packet decides which are to be * time stamped by setting %SOF_TIMESTAMPING_TX_SOFTWARE * before sending the packet. */ HWTSTAMP_TX_ON /* * Enables time stamping for outgoing packets just as * HWTSTAMP_TX_ON does, but also enables time stamp insertion * directly into Sync packets. In this case, transmitted Sync * packets will not received a time stamp via the socket error * queue. */ HWTSTAMP_TX_ONESTEP_SYNC /* * Same as HWTSTAMP_TX_ONESTEP_SYNC, but also enables time * stamp insertion directly into PDelay_Resp packets. In this * case, neither transmitted Sync nor PDelay_Resp packets will * receive a time stamp via the socket error queue. */ HWTSTAMP_TX_ONESTEP_P2P )
const ( HWTSTAMP_FILTER_NONE = iota /* time stamp no incoming packet at all */ HWTSTAMP_FILTER_ALL /* time stamp any incoming packet */ HWTSTAMP_FILTER_SOME /* return value: time stamp all packets requested plus some others */ HWTSTAMP_FILTER_PTP_V1_L4_EVENT /* PTP v1, UDP, any kind of event packet */ HWTSTAMP_FILTER_PTP_V1_L4_SYNC /* PTP v1, UDP, Sync packet */ HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ /* PTP v1, UDP, Delay_req packet */ HWTSTAMP_FILTER_PTP_V2_L4_EVENT /* PTP v2, UDP, any kind of event packet */ HWTSTAMP_FILTER_PTP_V2_L4_SYNC /* PTP v2, UDP, Sync packet */ HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ /* PTP v2, UDP, Delay_req packet */ HWTSTAMP_FILTER_PTP_V2_L2_EVENT /* 802.AS1, Ethernet, any kind of event packet */ HWTSTAMP_FILTER_PTP_V2_L2_SYNC /* 802.AS1, Ethernet, Sync packet */ HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ /* 802.AS1, Ethernet, Delay_req packet */ HWTSTAMP_FILTER_PTP_V2_EVENT /* PTP v2/802.AS1, any layer, any kind of event packet */ HWTSTAMP_FILTER_PTP_V2_SYNC /* PTP v2/802.AS1, any layer, Sync packet */ HWTSTAMP_FILTER_PTP_V2_DELAY_REQ /* PTP v2/802.AS1, any layer, Delay_req packet */ HWTSTAMP_FILTER_NTP_ALL /* NTP, UDP, all versions and packet modes */ )
const (
DEFAULT_BLINK_DURATION = 60 * time.Second
)
const (
IFNAMSIZ = 16
)
Maximum size of an interface name
const MAX_CORES = 32
const MAX_INDIR_SIZE = 256
max values for my setup dont know how to make this dynamic
const (
MAX_SSET_INFO = 64
)
ethtool sset_info related constants
const (
SIOCETHTOOL = 0x8946
)
ioctl ethtool request
Variables ¶
var WoLMap = map[uint32]string{ WAKE_PHY: "p", WAKE_UCAST: "u", WAKE_MCAST: "m", WAKE_BCAST: "b", WAKE_ARP: "a", WAKE_MAGIC: "g", WAKE_MAGICSECURE: "s", }
Functions ¶
func CmdGetMapped ¶
CmdGetMapped returns the interface settings in a map
func DriverName ¶
DriverName returns the driver name of the given interface name.
func SupportedLinkModes ¶ added in v0.4.0
SupportedLinkModes returns the names of the link modes supported by the interface.
func SupportedSpeed ¶ added in v0.4.0
SupportedSpeed returns the maximum capacity of this interface.
Types ¶
type Channels ¶
type Channels struct { Cmd uint32 MaxRx uint32 MaxTx uint32 MaxOther uint32 MaxCombined uint32 RxCount uint32 TxCount uint32 OtherCount uint32 CombinedCount uint32 }
Channels contains the number of channels for a given interface.
type Coalesce ¶
type Coalesce struct { Cmd uint32 RxCoalesceUsecs uint32 RxMaxCoalescedFrames uint32 RxCoalesceUsecsIrq uint32 RxMaxCoalescedFramesIrq uint32 TxCoalesceUsecs uint32 TxMaxCoalescedFrames uint32 TxCoalesceUsecsIrq uint32 TxMaxCoalescedFramesIrq uint32 StatsBlockCoalesceUsecs uint32 UseAdaptiveRxCoalesce uint32 UseAdaptiveTxCoalesce uint32 PktRateLow uint32 RxCoalesceUsecsLow uint32 RxMaxCoalescedFramesLow uint32 TxCoalesceUsecsLow uint32 TxMaxCoalescedFramesLow uint32 PktRateHigh uint32 RxCoalesceUsecsHigh uint32 RxMaxCoalescedFramesHigh uint32 TxCoalesceUsecsHigh uint32 TxMaxCoalescedFramesHigh uint32 RateSampleInterval uint32 }
Coalesce is a coalesce config for an interface
type DrvInfo ¶
type DrvInfo struct { Cmd uint32 Driver string Version string FwVersion string BusInfo string EromVersion string Reserved2 string NPrivFlags uint32 NStats uint32 TestInfoLen uint32 EedumpLen uint32 RegdumpLen uint32 }
DrvInfo contains driver information ethtool.h v3.5: struct ethtool_drvinfo
type Ethtool ¶
type Ethtool struct {
// contains filtered or unexported fields
}
Ethtool is a struct that contains the file descriptor for the ethtool
func (*Ethtool) CmdGet ¶
func (e *Ethtool) CmdGet(ecmd *EthtoolCmd, intf string) (uint32, error)
CmdGet returns the interface settings in the receiver struct and returns speed
func (*Ethtool) CmdGetMapped ¶
CmdGetMapped returns the interface settings in a map
func (*Ethtool) CmdSet ¶
func (e *Ethtool) CmdSet(ecmd *EthtoolCmd, intf string) (uint32, error)
CmdSet sets and returns the settings in the receiver struct and returns speed
func (*Ethtool) DriverInfo ¶
DriverInfo returns driver information of the given interface name.
func (*Ethtool) DriverName ¶
DriverName returns the driver name of the given interface name.
func (*Ethtool) FeatureNames ¶
FeatureNames shows supported features by their name.
func (*Ethtool) FeaturesWithState ¶ added in v0.4.0
func (e *Ethtool) FeaturesWithState(intf string) (map[string]FeatureState, error)
FeaturesWithState retrieves features of the given interface name, with extra flags to explain if they can be enabled
func (*Ethtool) GetChannels ¶
GetChannels returns the number of channels for the given interface name.
func (*Ethtool) GetCoalesce ¶
GetCoalesce returns the coalesce config for the given interface name.
func (*Ethtool) GetIndir ¶ added in v0.6.0
GetIndir retrieves the indirection table of the given interface name.
func (*Ethtool) GetLinkSettings ¶ added in v0.6.0
func (e *Ethtool) GetLinkSettings(intf string) (*LinkSettings, error)
GetLinkSettings retrieves link settings, preferring ETHTOOL_GLINKSETTINGS and falling back to ETHTOOL_GSET. Uses a single ioctl call with the maximum expected buffer size.
func (*Ethtool) GetPause ¶ added in v0.4.0
GetPause retrieves pause parameters of the given interface name.
func (*Ethtool) GetRing ¶ added in v0.4.0
GetRing retrieves ring parameters of the given interface name.
func (*Ethtool) GetTimestampingInformation ¶ added in v0.3.0
func (e *Ethtool) GetTimestampingInformation(intf string) (TimestampingInformation, error)
GetTimestampingInformation returns the PTP timestamping information for the given interface name.
func (*Ethtool) GetWakeOnLan ¶ added in v0.5.9
GetWakeOnLan returns the WoL config for the given interface name.
func (*Ethtool) Identity ¶ added in v0.6.0
Identity the nic with blink duration, if not specify blink for 60 seconds
func (*Ethtool) ModuleEeprom ¶
ModuleEeprom returns Eeprom information of the given interface name.
func (*Ethtool) ModuleEepromHex ¶
ModuleEepromHex returns Eeprom information as hexadecimal string
func (*Ethtool) MsglvlSet ¶
MsglvlSet returns the read-msglvl, post-set-msglvl of the given interface.
func (*Ethtool) PrivFlags ¶ added in v0.4.0
PrivFlags retrieves private flags of the given interface name.
func (*Ethtool) PrivFlagsNames ¶ added in v0.4.0
PrivFlagsNames shows supported private flags by their name.
func (*Ethtool) SetChannels ¶
SetChannels sets the number of channels for the given interface name and returns the new number of channels.
func (*Ethtool) SetCoalesce ¶ added in v0.4.0
SetCoalesce sets the coalesce config for the given interface name.
func (*Ethtool) SetIndir ¶ added in v0.6.0
SetIndir sets the indirection table of the given interface from the SetIndir struct
func (*Ethtool) SetLinkSettings ¶ added in v0.6.0
func (e *Ethtool) SetLinkSettings(intf string, settings *LinkSettings) error
SetLinkSettings applies link settings, determining whether to use ETHTOOL_SLINKSETTINGS or ETHTOOL_SSET.
func (*Ethtool) SetPause ¶ added in v0.4.0
SetPause sets pause parameters of the given interface name.
func (*Ethtool) SetWakeOnLan ¶ added in v0.5.9
SetWakeOnLan sets the WoL config for the given interface name and returns the new WoL config.
func (*Ethtool) Stats ¶
Stats retrieves stats of the given interface name. This maintains backward compatibility with existing code.
func (*Ethtool) StatsWithBuffer ¶ added in v0.6.1
func (e *Ethtool) StatsWithBuffer(intf string, gstringsPtr *EthtoolGStrings, statsPtr *EthtoolStats) (map[string]uint64, error)
StatsWithBuffer retrieves stats of the given interface name using pre-allocated buffers. This allows the caller to control where the large structures are allocated, which can be useful to avoid heap allocations in Go 1.24+.
type EthtoolCmd ¶
type EthtoolCmd struct { Cmd uint32 Supported uint32 Advertising uint32 Speed uint16 Duplex uint8 Port uint8 Phy_address uint8 Transceiver uint8 Autoneg uint8 Mdio_support uint8 Maxtxpkt uint32 Maxrxpkt uint32 Speed_hi uint16 Eth_tp_mdix uint8 Reserved2 uint8 Lp_advertising uint32 Reserved [2]uint32 }
EthtoolCmd is the Go version of the Linux kerne ethtool_cmd struct see ethtool.c
type EthtoolGStrings ¶ added in v0.6.1
type EthtoolGStrings struct {
// contains filtered or unexported fields
}
type EthtoolLinkSettingsFixed ¶ added in v0.6.0
type EthtoolLinkSettingsFixed struct { Cmd uint32 Speed uint32 Duplex uint8 Port uint8 PhyAddress uint8 Autoneg uint8 MdixSupport uint8 // Renamed from mdio_support EthTpMdix uint8 EthTpMdixCtrl uint8 LinkModeMasksNwords int8 Transceiver uint8 MasterSlaveCfg uint8 MasterSlaveState uint8 Reserved1 [1]byte Reserved [7]uint32 }
EthtoolLinkSettingsFixed corresponds to struct ethtool_link_settings fixed part
type EthtoolStats ¶ added in v0.6.1
type EthtoolStats struct {
// contains filtered or unexported fields
}
type FeatureState ¶ added in v0.4.0
FeatureState contains the state of a feature.
type IdentityConf ¶ added in v0.6.0
IdentityConf is an identity config for an interface
type Indir ¶ added in v0.6.0
type Indir struct { Cmd uint32 Size uint32 RingIndex [MAX_INDIR_SIZE]uint32 // statically definded otherwise crash }
type LinkSettingSource ¶ added in v0.6.0
type LinkSettingSource string
const ( SourceGLinkSettings LinkSettingSource = "GLINKSETTINGS" SourceGSet LinkSettingSource = "GSET" )
Constants defining the source of the LinkSettings data
type LinkSettings ¶ added in v0.6.0
type LinkSettings struct { Speed uint32 Duplex uint8 Port uint8 PhyAddress uint8 Autoneg uint8 MdixSupport uint8 EthTpMdix uint8 EthTpMdixCtrl uint8 Transceiver uint8 MasterSlaveCfg uint8 MasterSlaveState uint8 SupportedLinkModes []string AdvertisingLinkModes []string LpAdvertisingModes []string Source LinkSettingSource // "GSET" or "GLINKSETTINGS" }
LinkSettings is the user-friendly representation returned by GetLinkSettings
type Ring ¶ added in v0.4.0
type Ring struct { Cmd uint32 RxMaxPending uint32 RxMiniMaxPending uint32 RxJumboMaxPending uint32 TxMaxPending uint32 RxPending uint32 RxMiniPending uint32 RxJumboPending uint32 TxPending uint32 }
Ring is a ring config for an interface
type TimestampingInformation ¶ added in v0.3.0
type TimestampingInformation struct { Cmd uint32 SoTimestamping uint32 /* SOF_TIMESTAMPING_* bitmask */ PhcIndex int32 TxTypes uint32 /* HWTSTAMP_TX_* */ RxFilters uint32 /* HWTSTAMP_FILTER_ */ // contains filtered or unexported fields }
TimestampingInformation contains PTP timetstapming information