iface

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeLoopback = "loopback"
	TypeDevice   = "device"
	TypeBond     = "bond"
)
View Source
const BondSuffix = "-bo"
View Source
const (
	BridgeSuffix = "-br"
)
View Source
const MaxDeviceNameLen = 15

Variables

This section is empty.

Functions

func DeleteRouteViaGateway added in v0.2.3

func DeleteRouteViaGateway(cidr string) error

func EnsureRouteViaGateway added in v0.2.3

func EnsureRouteViaGateway(cidr string) error

EnsureRouteViaGateway will add the route via gateway if not existing

func GenerateName added in v0.3.0

func GenerateName(prefix, suffix string) string

func Route2String

func Route2String(route netlink.Route) (string, error)

func String2Route

func String2Route(route string) (*netlink.Route, error)

Types

type Bond added in v0.3.0

type Bond struct {
	*netlink.Bond
	// contains filtered or unexported fields
}

func NewBond added in v0.3.0

func NewBond(bond *netlink.Bond, slaves []string) *Bond

func (*Bond) EnsureBond added in v0.3.0

func (b *Bond) EnsureBond() error

EnsureBond cares about the bond attributes excluding the master index and the slaves

type Bridge

type Bridge struct {
	*netlink.Bridge
}

func NewBridge

func NewBridge(name string) *Bridge

func (*Bridge) Ensure

func (br *Bridge) Ensure() error

Ensure bridge set promiscuous mod default

func (*Bridge) Fetch

func (br *Bridge) Fetch() error
type Link struct {
	netlink.Link
}
func ListLinks(typeSelector map[string]bool) ([]*Link, error)
func NewLink(l netlink.Link) *Link

func (*Link) AddBridgeVlan

func (l *Link) AddBridgeVlan(vid uint16) error

AddBridgeVlan adds a new vlan filter entry Equivalent to: `bridge vlan add dev DEV vid VID master`

func (*Link) DelBridgeVlan

func (l *Link) DelBridgeVlan(vid uint16) error

DelBridgeVlan adds a new vlan filter entry Equivalent to: `bridge vlan del dev DEV vid VID master`

func (*Link) DeleteIptForward added in v0.1.8

func (l *Link) DeleteIptForward() error

func (*Link) EnsureIptForward added in v0.1.8

func (l *Link) EnsureIptForward() error

func (*Link) Fetch

func (l *Link) Fetch() error

func (*Link) ListBridgeVlan added in v0.3.0

func (l *Link) ListBridgeVlan() ([]uint16, error)

func (*Link) Remove added in v0.3.0

func (l *Link) Remove() error

func (*Link) SetMaster

func (l *Link) SetMaster(br *Bridge) error

func (*Link) SetNoMaster

func (l *Link) SetNoMaster() error

Jump to

Keyboard shortcuts

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