dscp

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 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, applies mutations, and publishes it
	// to the dataplane.
	UpdateModule(name string, prefixes []netip.Prefix, flag uint8, mark uint8) (ModuleHandle, error)
	// DeleteModule removes a module config.
	DeleteModule(name string) error
}

Backend abstracts shared memory operations.

type Config

type Config struct {
	// InstanceID specifies which dataplane instance this module serves.
	//
	// Required: a listed module must set it explicitly, even to 0.
	InstanceID xcfg.Required[uint32] `yaml:"instance_id"`
	// MemoryPath is the path to the shared-memory file that is used to
	// communicate with dataplane.
	MemoryPath xcfg.NonEmptyString `yaml:"memory_path"`
	// MemoryRequirements is the amount of memory that is required for a single
	// transaction.
	MemoryRequirements xcfg.NonZero[datasize.ByteSize] `yaml:"memory_requirements"`

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

func DefaultConfig

func DefaultConfig() *Config

func (*Config) Default

func (m *Config) Default()

Default resets Config to DefaultConfig.

type DscpModule

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

DscpModule is a control-plane component of a module that is responsible for DSCP marking of packets.

func NewDSCPModule

func NewDSCPModule(cfg *Config, options ...Option) (*DscpModule, error)

func (*DscpModule) Close

func (m *DscpModule) Close() error

Close closes the module.

func (*DscpModule) Endpoint

func (m *DscpModule) Endpoint() string

func (*DscpModule) Name

func (m *DscpModule) Name() string

func (*DscpModule) RegisterService

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

func (*DscpModule) ServicesNames

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

type DscpService

type DscpService struct {
	dscppb.UnimplementedDscpServiceServer
	// contains filtered or unexported fields
}

func NewDscpService

func NewDscpService(backend Backend) *DscpService

func (*DscpService) AddPrefixes

func (m *DscpService) AddPrefixes(
	ctx context.Context,
	request *dscppb.AddPrefixesRequest,
) (*dscppb.AddPrefixesResponse, error)

func (*DscpService) DeleteConfig

func (m *DscpService) DeleteConfig(
	ctx context.Context,
	request *dscppb.DeleteConfigRequest,
) (*dscppb.DeleteConfigResponse, error)

DeleteConfig removes the named config if it is not referenced by any pipeline.

func (*DscpService) ListConfigs

func (m *DscpService) ListConfigs(
	ctx context.Context,
	request *dscppb.ListConfigsRequest,
) (*dscppb.ListConfigsResponse, error)

func (*DscpService) ReclaimDeferred

func (m *DscpService) ReclaimDeferred()

ReclaimDeferred retries every deferred handle, dropping the ones whose generations have drained and keeping the rest deferred. It is the reclamation handler for this module's superseded configs; the service itself runs it after each successful publish, and anything else may call it at any time.

func (*DscpService) RemovePrefixes

func (*DscpService) SetDscpMarking

func (*DscpService) ShowConfig

func (m *DscpService) ShowConfig(
	ctx context.Context,
	request *dscppb.ShowConfigRequest,
) (*dscppb.ShowConfigResponse, error)

type ModuleHandle

type ModuleHandle interface {
	Free() error
}

ModuleHandle is a handle to a module configuration.

type Option

type Option func(*moduleOptions)

Option configures the DscpModule constructor.

func WithLog

func WithLog(log *zap.Logger) Option

WithLog sets the logger for the dscp module.

Directories

Path Synopsis
dscppb
v1

Jump to

Keyboard shortcuts

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