Documentation
¶
Index ¶
- func DeleteVDPADevice(vDPADevName string) error
- func ParseIPNet(addr string) (*net.IPNet, error)
- type Action
- type ActionPolice
- type Addr
- type Bridge
- type Class
- type ClassHTB
- type Dummy
- type Family
- type Filter
- type Gretap
- type Link
- func (l *Link) BridgeLinkSetHairpin(hairpin bool) error
- func (l *Link) BridgeLinkSetIsolated(isolated bool) error
- func (l *Link) BridgeVLANAdd(vid string, pvid bool, untagged bool, self bool) error
- func (l *Link) BridgeVLANDelete(vid string, self bool) error
- func (l *Link) Delete() error
- func (l *Link) GetVFInfo(vfID int) (VirtFuncInfo, error)
- func (l *Link) SetAddress(address net.HardwareAddr) error
- func (l *Link) SetAllMulticast(enabled bool) error
- func (l *Link) SetDown() error
- func (l *Link) SetMTU(mtu uint32) error
- func (l *Link) SetMaster(master string) error
- func (l *Link) SetName(newName string) error
- func (l *Link) SetNetns(netnsPid string) error
- func (l *Link) SetNoMaster() error
- func (l *Link) SetTXQueueLength(queueLength uint32) error
- func (l *Link) SetUp() error
- func (l *Link) SetVfAddress(vf string, address string) error
- func (l *Link) SetVfSpoofchk(vf string, on bool) error
- func (l *Link) SetVfVlan(vf string, vlan string) error
- type LinkInfo
- type Macvlan
- type Macvtap
- type Neigh
- type NeighProxy
- type NeighbourIPState
- type Qdisc
- type QdiscHTB
- type QdiscIngress
- type Route
- type Tuntap
- type U32Filter
- type VDPADev
- type Veth
- type VhostVDPA
- type VirtFuncInfo
- type Vlan
- type Vxlan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteVDPADevice ¶
DeleteVDPADevice deletes a vDPA management device.
func ParseIPNet ¶ added in v6.0.5
ParseIPNet parses a CIDR string and returns a *net.IPNet containing both the full address and the netmask, Unlike net.ParseCIDR which zeroes out the host part in the returned *net.IPNet and returns the full address separately.
Types ¶
type Action ¶
type Action interface {
// contains filtered or unexported methods
}
Action represents an action in filter.
type ActionPolice ¶
type ActionPolice struct {
Rate uint32 // in byte/s
Burst uint32 // in byte
Mtu uint32 // in byte
Drop bool
}
ActionPolice represents an action of 'police' type.
type Bridge ¶
type Bridge struct {
Link
}
Bridge represents arguments for link device of type bridge.
type Link ¶
type Link struct {
Name string
Kind string
MTU uint32
Parent string
Address net.HardwareAddr
TXQueueLength uint32
AllMulticast bool
Master string
Up bool
}
Link represents base arguments for link device.
func (*Link) BridgeLinkSetHairpin ¶
BridgeLinkSetHairpin sets bridge 'hairpin' attribute on a port.
func (*Link) BridgeLinkSetIsolated ¶
BridgeLinkSetIsolated sets bridge 'isolated' attribute on a port.
func (*Link) BridgeVLANAdd ¶
BridgeVLANAdd adds a new vlan filter entry.
func (*Link) BridgeVLANDelete ¶
BridgeVLANDelete removes an existing vlan filter entry.
func (*Link) GetVFInfo ¶
func (l *Link) GetVFInfo(vfID int) (VirtFuncInfo, error)
GetVFInfo returns info about virtual function.
func (*Link) SetAddress ¶
func (l *Link) SetAddress(address net.HardwareAddr) error
SetAddress sets the address of the link device.
func (*Link) SetAllMulticast ¶
SetAllMulticast when enabled instructs network driver to retrieve all multicast packets from the network to the kernel for further processing.
func (*Link) SetNoMaster ¶
SetNoMaster removes the master of the link device.
func (*Link) SetTXQueueLength ¶
SetTXQueueLength sets the txqueuelen of the link device.
func (*Link) SetVfAddress ¶
SetVfAddress changes the address for the specified vf.
func (*Link) SetVfSpoofchk ¶
SetVfSpoofchk turns packet spoof checking on or off for the specified VF.
type LinkInfo ¶
LinkInfo has additional information about a link.
func LinkByName ¶ added in v6.0.5
LinkByName returns a Link from a device name.
type Macvtap ¶
type Macvtap struct {
Macvlan
}
Macvtap represents arguments for link of type macvtap.
type Neigh ¶
type Neigh struct {
DevName string
Addr net.IP
MAC net.HardwareAddr
State NeighbourIPState
}
Neigh represents arguments for neighbour manipulation.
type NeighProxy ¶
NeighProxy represents arguments for neighbour proxy manipulation.
func (*NeighProxy) Show ¶
func (n *NeighProxy) Show() ([]NeighProxy, error)
Show list neighbour proxy entries.
type NeighbourIPState ¶
type NeighbourIPState int
NeighbourIPState can be { NeighbourIPStatePermanent | NeighbourIPStateNoARP | NeighbourIPStateReachable | NeighbourIPStateStale | NeighbourIPStateNone | NeighbourIPStateIncomplete | NeighbourIPStateDelay | NeighbourIPStateProbe | NeighbourIPStateFailed }.
const ( // NeighbourIPStatePermanent the neighbour entry is valid forever and can be only be removed administratively. NeighbourIPStatePermanent NeighbourIPState = unix.NUD_PERMANENT // NeighbourIPStateNoARP the neighbour entry is valid. No attempts to validate this entry will be made but it can // be removed when its lifetime expires. NeighbourIPStateNoARP NeighbourIPState = unix.NUD_NOARP // NeighbourIPStateReachable the neighbour entry is valid until the reachability timeout expires. NeighbourIPStateReachable NeighbourIPState = unix.NUD_REACHABLE // NeighbourIPStateStale the neighbour entry is valid but suspicious. NeighbourIPStateStale NeighbourIPState = unix.NUD_STALE // NeighbourIPStateNone this is a pseudo state used when initially creating a neighbour entry or after trying to // remove it before it becomes free to do so. NeighbourIPStateNone NeighbourIPState = unix.NUD_NONE // NeighbourIPStateIncomplete the neighbour entry has not (yet) been validated/resolved. NeighbourIPStateIncomplete NeighbourIPState = unix.NUD_INCOMPLETE // NeighbourIPStateDelay neighbor entry validation is currently delayed. NeighbourIPStateDelay NeighbourIPState = unix.NUD_DELAY // NeighbourIPStateProbe neighbor is being probed. NeighbourIPStateProbe NeighbourIPState = unix.NUD_PROBE // NeighbourIPStateFailed max number of probes exceeded without success, neighbor validation has ultimately failed. NeighbourIPStateFailed NeighbourIPState = unix.NUD_FAILED )
type QdiscIngress ¶ added in v6.0.5
type QdiscIngress struct {
Qdisc
}
QdiscIngress represents an ingress qdisc object.
func (*QdiscIngress) Add ¶ added in v6.0.5
func (q *QdiscIngress) Add() error
Add adds an ingress qdisc to a device.
func (*QdiscIngress) Delete ¶ added in v6.0.5
func (q *QdiscIngress) Delete() error
Delete deletes an ingress qdisc from a device.
type Route ¶
type Route struct {
DevName string
Route *net.IPNet
Table string
Src net.IP
Proto string
Family Family
Via net.IP
VRF string
Scope string
}
Route represents arguments for route manipulation.
type VDPADev ¶
type VDPADev struct {
// Name of the vDPA created device. e.g. "vdpa0" (note: the iproute2 associated command would look like `vdpa dev add mgmtdev pci/<PCI_SLOT_NAME> name vdpa0 max_vqp <MAX_VQP>`).
Name string
// Max VQs supported by the vDPA device.
MaxVQs uint32
// Associated vhost-vdpa device.
VhostVDPA *VhostVDPA
}
VDPADev represents the vDPA device information.
type VirtFuncInfo ¶
type VirtFuncInfo struct {
VF int
Address net.HardwareAddr
VLAN int
SpoofCheck bool
}
VirtFuncInfo holds information about vf.