Documentation
¶
Index ¶
- type Config
- type ForwardConfig
- type ForwardDeviceConfig
- type ForwardDeviceID
- type ForwardModule
- type ForwardService
- func (m *ForwardService) AddDevice(ctx context.Context, req *forwardpb.AddDeviceRequest) (*forwardpb.AddDeviceResponse, error)
- func (m *ForwardService) AddForward(ctx context.Context, req *forwardpb.AddForwardRequest) (*forwardpb.AddForwardResponse, error)
- func (m *ForwardService) RemoveDevice(ctx context.Context, req *forwardpb.RemoveDeviceRequest) (*forwardpb.RemoveDeviceResponse, error)
- func (m *ForwardService) RemoveForward(ctx context.Context, req *forwardpb.RemoveForwardRequest) (*forwardpb.RemoveForwardResponse, error)
- func (m *ForwardService) ShowConfig(ctx context.Context, req *forwardpb.ShowConfigRequest) (*forwardpb.ShowConfigResponse, error)
- type ModuleConfig
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)
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 (m *ForwardService) AddDevice(ctx context.Context, req *forwardpb.AddDeviceRequest) (*forwardpb.AddDeviceResponse, error)
func (*ForwardService) AddForward ¶
func (m *ForwardService) AddForward(ctx context.Context, req *forwardpb.AddForwardRequest) (*forwardpb.AddForwardResponse, error)
func (*ForwardService) RemoveDevice ¶
func (m *ForwardService) RemoveDevice(ctx context.Context, req *forwardpb.RemoveDeviceRequest) (*forwardpb.RemoveDeviceResponse, error)
func (*ForwardService) RemoveForward ¶
func (m *ForwardService) RemoveForward(ctx context.Context, req *forwardpb.RemoveForwardRequest) (*forwardpb.RemoveForwardResponse, error)
func (*ForwardService) ShowConfig ¶
func (m *ForwardService) ShowConfig(ctx context.Context, req *forwardpb.ShowConfigRequest) (*forwardpb.ShowConfigResponse, error)
type ModuleConfig ¶
type ModuleConfig struct {
// contains filtered or unexported fields
}
func NewModuleConfig ¶
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.
Click to show internal directories.
Click to hide internal directories.