Documentation
¶
Index ¶
- type Backend
- type Config
- type DscpModule
- type DscpService
- func (m *DscpService) AddPrefixes(ctx context.Context, request *dscppb.AddPrefixesRequest) (*dscppb.AddPrefixesResponse, error)
- func (m *DscpService) DeleteConfig(ctx context.Context, request *dscppb.DeleteConfigRequest) (*dscppb.DeleteConfigResponse, error)
- func (m *DscpService) ListConfigs(ctx context.Context, request *dscppb.ListConfigsRequest) (*dscppb.ListConfigsResponse, error)
- func (m *DscpService) ReclaimDeferred()
- func (m *DscpService) RemovePrefixes(ctx context.Context, request *dscppb.RemovePrefixesRequest) (*dscppb.RemovePrefixesResponse, error)
- func (m *DscpService) SetDscpMarking(ctx context.Context, request *dscppb.SetDscpMarkingRequest) (*dscppb.SetDscpMarkingResponse, error)
- func (m *DscpService) ShowConfig(ctx context.Context, request *dscppb.ShowConfigRequest) (*dscppb.ShowConfigResponse, error)
- type ModuleHandle
- type Option
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
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) 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 (m *DscpService) RemovePrefixes( ctx context.Context, request *dscppb.RemovePrefixesRequest, ) (*dscppb.RemovePrefixesResponse, error)
func (*DscpService) SetDscpMarking ¶
func (m *DscpService) SetDscpMarking( ctx context.Context, request *dscppb.SetDscpMarkingRequest, ) (*dscppb.SetDscpMarkingResponse, error)
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.