veth

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package veth contains utility functions for establishing virtual Ethernet pairs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pair

type Pair struct {
	Iface     *net.Interface
	PeerIface *net.Interface
}

Pair represents a Linux pair of virtual Ethernet (veth) devices. Veth devices come in pairs, a primary and a peer, representing two sides of a virtual link.

func NewPair

func NewPair(ctx context.Context, iface, peerIface string) (*Pair, error)

NewPair sets up a new Pair object, with interface iface and peer interface peerIface. It removes any existing links of the same name.

func (*Pair) Delete

func (v *Pair) Delete(ctx context.Context) error

Delete deletes the virtual link.

Jump to

Keyboard shortcuts

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