network

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleConfig

func ExampleConfig() string

ExampleConfig will return a config output

Types

type Environment

type Environment struct {

	// Host configuration
	Interface string `json:"interface"`

	// Bridge configuration
	BridgeName    string `json:"bridgeName"`
	BridgeAddress string `json:"bridgeAddress"`

	// Used during runtime
	BridgeLink netlink.Link `json:"-"`

	// VM Nic configuration
	NicPrefix    string `json:"nicPrefix"`
	NicMacPrefix string `json:"nicMacPrefix"`
}

Environment defines the configuration of the shack environment

func OpenFile

func OpenFile(path string) (*Environment, error)

OpenFile will open an file and parse the contents

func (*Environment) AddBridgeAddress

func (e *Environment) AddBridgeAddress() error

AddBridgeAddress will add an address to an existing bridge

func (*Environment) BridgeUp

func (e *Environment) BridgeUp() error

BridgeUp sets the bridge to an enabled state

func (*Environment) CheckBridge

func (e *Environment) CheckBridge() error

CheckBridge will examine the bridge for its status

func (*Environment) CreateBridge

func (e *Environment) CreateBridge() error

CreateBridge will create a new Layer 2 bridge, and configure it

func (*Environment) CreateTap

func (e *Environment) CreateTap(tapName string) error

CreateTap will create a tap device for qemu

func (*Environment) DelBridgeAddress

func (e *Environment) DelBridgeAddress() error

DelBridgeAddress will delete an address on an existing bridge

func (*Environment) DeleteBridge

func (e *Environment) DeleteBridge() error

DeleteBridge will remove an existing bridge

func (*Environment) DeleteTap

func (e *Environment) DeleteTap(tapName string) error

DeleteTap will remove a tap device from qemu and the bridge

func (*Environment) EnableNat

func (e *Environment) EnableNat() error

EnableNat will configure the kernel to enable natting

Jump to

Keyboard shortcuts

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