device

package
v1.6.2-rc Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(link netlink.Link, conf *Conf) error

Setup interfaces for container netns.

Types

type Conf

type Conf struct {
	IfName string
	MTU    int

	Addresses []*netlink.Addr
	Routes    []*netlink.Route
	Rules     []*netlink.Rule
	Neighs    []*netlink.Neigh
	SysCtl    [][]string
}

Conf indicates network devices configures.

type IPVlanConf

type IPVlanConf struct {
	MasterName string
	IfName     string
	MTU        int
}

IPVlanConf is interface config for IPVlan slaves.

func (*IPVlanConf) Setup

func (c *IPVlanConf) Setup(netNS ns.NetNS) error

Setup IPVlan slave interface for netns.

type VethConf

type VethConf struct {
	IfName   string
	PeerName string
	MTU      int
}

VethConf is interface config for veth pair.

func (*VethConf) Setup

func (vethConf *VethConf) Setup(netNS ns.NetNS) error

Setup veth pair interface for netns.

type VlanConfig

type VlanConfig struct {
	MasterName   string
	IfName       string
	Vid          int
	MTU          int
	HardwareAddr net.HardwareAddr
}

VlanConfig is interface config of vlan slave.

func (*VlanConfig) Setup

func (vlanConfig *VlanConfig) Setup(netNS ns.NetNS) error

Setup vlan slave for netns.

Jump to

Keyboard shortcuts

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