taps

package module
v0.0.0-...-ce9e244 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Subnet Number of bits in the subnet mask
	Subnet = "/10"
	// TapsPerBridge Number of taps per bridge
	TapsPerBridge = 1000
	// NumBridges is the number of bridges for the TapManager
	NumBridges = 2
)

Variables

This section is empty.

Functions

func ConfigIPtables

func ConfigIPtables(tapName, hostIface string) error

ConfigIPtables Configures IP tables for internet access inside VM

Types

type NetworkInterface

type NetworkInterface struct {
	BridgeName     string
	MacAddress     string
	HostDevName    string
	PrimaryAddress string
	Subnet         string
	GatewayAddress string
}

NetworkInterface Network interface type, NI names are generated based on expected tap names

type TapManager

type TapManager struct {
	sync.Mutex

	TapCountsPerBridge []int64
	// contains filtered or unexported fields
}

TapManager A Tap Manager

func NewTapManager

func NewTapManager() *TapManager

NewTapManager Creates a new tap manager

func (*TapManager) AddTap

func (tm *TapManager) AddTap(tapName, hostIface string) (*NetworkInterface, error)

AddTap Creates a new tap and returns the corresponding network interface

func (*TapManager) RemoveBridges

func (tm *TapManager) RemoveBridges()

RemoveBridges Removes the bridges created by the tap manager

func (*TapManager) RemoveTap

func (tm *TapManager) RemoveTap(tapName string) error

RemoveTap Removes the tap

Jump to

Keyboard shortcuts

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