forward

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// UpdateModule creates a module config, writes rules, and publishes
	// it to the dataplane.
	UpdateModule(name string, rules []cforward.ForwardRule) (ModuleHandle, error)
	// DeleteModule removes a module config.
	DeleteModule(name string) error
	// ModuleCounters returns selected dataplane counters collected for a module config.
	// If counterNames is nil or empty, it returns all counters for the module config.
	ModuleCounters(name string, counterNames []string) []CounterView
}

Backend abstracts shared memory operations.

func NewBackend

func NewBackend(agent *ffi.Agent) Backend

NewBackend creates a Backend that operates on real shared memory.

type Config

type Config struct {
	ffi.AttachConfig `yaml:",inline"`

	Endpoint xcfg.NonEmptyString `yaml:"endpoint"`
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Default

func (m *Config) Default()

Default resets Config to DefaultConfig.

type CounterView

type CounterView struct {
	Device   string
	Pipeline string
	Function string
	Chain    string
	Name     string
	Values   [][]uint64
}

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, options ...Option) (*ForwardModule, error)

func (*ForwardModule) Close

func (m *ForwardModule) Close() error

Close closes the module.

func (*ForwardModule) Endpoint

func (m *ForwardModule) Endpoint() string

func (*ForwardModule) Name

func (m *ForwardModule) Name() string

func (*ForwardModule) RegisterService

func (m *ForwardModule) RegisterService(server *grpc.Server)

func (*ForwardModule) ServicesNames

func (m *ForwardModule) ServicesNames() []string

type ForwardService

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

func NewForwardService

func NewForwardService(backend Backend) *ForwardService

func (*ForwardService) DeleteConfig

func (*ForwardService) ListConfigs

func (*ForwardService) Metrics

func (m *ForwardService) Metrics(tags ...*commonpb.MetricTag) ([]*commonpb.Metric, error)

Metrics returns Forward per-rule metrics matching tags, collected from the dataplane.

func (*ForwardService) ShowConfig

func (*ForwardService) UpdateConfig

UpdateConfig replaces the rule set for a named forward module config and publishes it to the dataplane.

A rule that leaves its counter empty is stored with "to_" plus its target, bounded to the counter-name limit, so ShowConfig never returns an empty name for a rule applied here. A non-empty counter is passed through verbatim.

type MetricsService

type MetricsService struct {
	forwardpb.UnimplementedMetricsServiceServer
	// contains filtered or unexported fields
}

MetricsService exposes Forward module per-rule metrics over its own gRPC service.

func NewMetricsService

func NewMetricsService(source metricsSource) *MetricsService

NewMetricsService creates a MetricsService backed by source.

func (*MetricsService) GetMetrics

GetMetrics returns a snapshot of Forward per-rule metrics matching the request's tags.

type ModuleHandle

type ModuleHandle interface {
	Free() error
}

ModuleHandle is a handle to a module configuration.

type Option

type Option func(*moduleOptions)

Option configures the ForwardModule constructor.

func WithLog

func WithLog(log *zap.Logger) Option

WithLog sets the logger for the forward module.

Directories

Path Synopsis
forwardpb
v1

Jump to

Keyboard shortcuts

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