iface

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 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

func DeleteRouteViaGateway(cidr string) error

func DisableBridgeNF

func DisableBridgeNF() error

func EnsureRouteViaGateway

func EnsureRouteViaGateway(cidr string) error

EnsureRouteViaGateway will add the route via gateway if not existing

func GenerateName

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

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

func NewBond

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

func (*Bond) EnsureBond

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

func (l *Link) DeleteIptForward() error

func (*Link) EnsureIptForward

func (l *Link) EnsureIptForward() error

func (*Link) Fetch

func (l *Link) Fetch() error

func (*Link) ListBridgeVlan

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

func (*Link) Remove

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