network

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultInterface = "eth0"

FIXME: Add support for more interfaces. See: https://github.com/nubificus/urunc/issues/13 FIXME: Discover the veth endpoint name instead of using default "eth0". See: https://github.com/nubificus/urunc/issues/14

View Source
const DefaultTap = "tap0_urunc"

Variables

View Source
var ErrEth0NotFound = errors.New("eth0 device not found")

Functions

func AddIngressQdisc

func AddIngressQdisc(link netlink.Link) error

func AddRedirectFilter

func AddRedirectFilter(sourceLink netlink.Link, targetLink netlink.Link) error

func CreateTap

func CreateTap(name string, mtu int, ownerUID, ownerGID int) (netlink.Link, error)
func GetLink(name string) (netlink.Link, error)

func GetVethDevice

func GetVethDevice() (string, error)

Find all interfaces available in our netns. We are expecting to find an eth0 interface and a lo interface. The eth0 is the interface we need to use. If there are more interfaces, log all interfaces.

func RootFilterHandle

func RootFilterHandle() uint32

Types

type InterfaceInfo

type InterfaceInfo struct {
	IP             string
	DefaultGateway string
	Mask           string
	Interface      string
}

type LinkNotFoundError

type LinkNotFoundError struct {
	// contains filtered or unexported fields
}

func (LinkNotFoundError) Error

func (e LinkNotFoundError) Error() string

type UnikernelNetworkInfo

type UnikernelNetworkInfo struct {
	TapDevice string
	EthDevice InterfaceInfo
}

func Setup

func Setup() (*UnikernelNetworkInfo, error)

Setup creates a tap device and sets tc rules between veth interface inside the namespace to the tap device.

Jump to

Keyboard shortcuts

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