overlay

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMTU = 1300

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device interface {
	io.ReadWriteCloser
	Activate() error
	Networks() []netip.Prefix
	Name() string
	RoutesFor(netip.Addr) routing.Gateways
	NewMultiQueueReader() (io.ReadWriteCloser, error)
}

func NewDeviceFromConfig

func NewDeviceFromConfig(c *config.C, l *logrus.Logger, vpnNetworks []netip.Prefix, routines int) (Device, error)

func NewUserDevice

func NewUserDevice(vpnNetworks []netip.Prefix) (Device, error)

func NewUserDeviceFromConfig

func NewUserDeviceFromConfig(c *config.C, l *logrus.Logger, vpnNetworks []netip.Prefix, routines int) (Device, error)

type DeviceFactory

type DeviceFactory func(c *config.C, l *logrus.Logger, vpnNetworks []netip.Prefix, routines int) (Device, error)

TODO: We may be able to remove routines

func NewFdDeviceFromConfig

func NewFdDeviceFromConfig(fd *int) DeviceFactory

type Route

type Route struct {
	MTU     int
	Metric  int
	Cidr    netip.Prefix
	Via     routing.Gateways
	Install bool
}

func (Route) Equal

func (r Route) Equal(t Route) bool

Equal determines if a route that could be installed in the system route table is equal to another Via is ignored since that is only consumed within cmesh itself

func (Route) String

func (r Route) String() string

type UserDevice

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

func (*UserDevice) Activate

func (d *UserDevice) Activate() error

func (*UserDevice) Close

func (d *UserDevice) Close() error

func (*UserDevice) Name

func (d *UserDevice) Name() string

func (*UserDevice) Networks

func (d *UserDevice) Networks() []netip.Prefix

func (*UserDevice) NewMultiQueueReader

func (d *UserDevice) NewMultiQueueReader() (io.ReadWriteCloser, error)

func (*UserDevice) Pipe

func (d *UserDevice) Pipe() (*io.PipeReader, *io.PipeWriter)

func (*UserDevice) Read

func (d *UserDevice) Read(p []byte) (n int, err error)

func (*UserDevice) RoutesFor

func (d *UserDevice) RoutesFor(ip netip.Addr) routing.Gateways

func (*UserDevice) Write

func (d *UserDevice) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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