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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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