vni

package
v0.0.0-...-0721423 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger    *zap.Logger
	Mode      Mode          // The mode that this network interface should operate under
	LinkLayer io.ReadWriter // The linkLayer where packets are read/written
	MTU       uint32        // Maximum transmission unit
}

type Interface

type Interface struct {
	Stack *stack.Stack // Userspace networking Stack
	// contains filtered or unexported fields
}

Interface acts as a network interface that can be accessed remotely

func New

func New(config Config) (*Interface, error)

func (*Interface) ExposeRoutes

func (v *Interface) ExposeRoutes(routes []string) error

ExposeRoutes allows the caller to expose routes to the remote network interface. This should only be called on Exit interfaces, entrance interfaces will automatically expose all routes.

func (*Interface) Stop

func (v *Interface) Stop()

Stop stops the Interface and prevents it from forwarding any more packets to/from the linkLayer

type Mode

type Mode uint

Mode determines how the Interface operates. In Entrance mode, the routes determine whether packets are forwarded to the Exit interface. In Exit mode, the routes determine what packets are allowed to be forwarded. We always route from entrance -> exit, not the other way around.

const (
	Entrance Mode = iota
	Exit
)

func (Mode) String

func (m Mode) String() string

Jump to

Keyboard shortcuts

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