forward

package
v0.0.0-...-51d244e Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: Apache-2.0 Imports: 19 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 {
	// MemoryPath is the path to the shared-memory file that is used to
	// communicate with dataplane.
	MemoryPath string `yaml:"memory_path"`
	// MemoryRequirements is the amount of memory that is required for a single
	// transaction.
	MemoryRequirements datasize.ByteSize `yaml:"memory_requirements"`

	Endpoint        string `yaml:"endpoint"`
	GatewayEndpoint string `yaml:"gateway_endpoint"`
}

func DefaultConfig

func DefaultConfig() *Config

type ForwardConfig

type ForwardConfig struct {
	DeviceForwards []ForwardDeviceConfig `yaml:"devices"`
}

type ForwardDeviceConfig

type ForwardDeviceConfig struct {
	L2ForwardDeviceID ForwardDeviceID                  `yaml:"l2_forward_device_id"`
	Forwards          map[netip.Prefix]ForwardDeviceID `yaml:"forwards"`
}

type ForwardDeviceID

type ForwardDeviceID uint16

type ForwardModule

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

ForwardModule is a control-plane component of a module that is responsible for forwarding traffic between devices.

func NewForwardModule

func NewForwardModule(cfg *Config, log *zap.SugaredLogger) (*ForwardModule, error)

func (*ForwardModule) Close

func (m *ForwardModule) Close() error

Close closes the module.

func (*ForwardModule) Run

func (m *ForwardModule) Run(ctx context.Context) error

Run runs the module until the specified context is canceled.

type ForwardService

type ForwardService struct {
	forwardpb.UnimplementedForwardServiceServer
	// contains filtered or unexported fields
}

func NewForwardService

func NewForwardService(agents []*ffi.Agent, log *zap.SugaredLogger) *ForwardService

func (*ForwardService) AddDevice

func (*ForwardService) AddForward

func (*ForwardService) RemoveDevice

func (*ForwardService) RemoveForward

func (*ForwardService) ShowConfig

type ModuleConfig

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

func NewModuleConfig

func NewModuleConfig(agent *ffi.Agent, name string, deviceCount uint16) (*ModuleConfig, error)

func (*ModuleConfig) AsFFIModule

func (m *ModuleConfig) AsFFIModule() ffi.ModuleConfig

func (*ModuleConfig) DeviceEnable

func (m *ModuleConfig) DeviceEnable(srcDeviceID ForwardDeviceID, dstDeviceID ForwardDeviceID) error

DeviceEnable configures a device for L2 forwarding

func (*ModuleConfig) ForwardEnable

func (m *ModuleConfig) ForwardEnable(prefix netip.Prefix, srcDeviceID ForwardDeviceID, dstDeviceID ForwardDeviceID) error

ForwardEnable configures forwarding for a specified IP prefix from a source device to a target device. The prefix can be either IPv4 or IPv6.

Jump to

Keyboard shortcuts

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