nat64

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(name string, config *NAT64Config) (ModuleHandle, error)
	// DeleteModule removes a module config.
	DeleteModule(name string) error
}

func NewBackend

func NewBackend(agent *ffi.Agent) Backend

type Config

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

	// Endpoint is the gRPC endpoint address
	Endpoint xcfg.NonEmptyString `yaml:"endpoint"`
}

Config represents NAT64 module configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default configuration

func (*Config) Default

func (m *Config) Default()

Default resets Config to DefaultConfig.

type MTUConfig

type MTUConfig struct {
	IPv4MTU uint32
	IPv6MTU uint32
}

MTUConfig represents MTU configuration

type Mapping

type Mapping struct {
	IPv4        netip.Addr
	IPv6        netip.Addr
	PrefixIndex uint32
}

Mapping represents an IPv4-IPv6 address mapping

type ModuleHandle

type ModuleHandle interface {
	Free() error
}

type NAT64Config

type NAT64Config struct {
	Prefixes           [][]byte
	Mappings           []Mapping
	MTU                MTUConfig
	DropUnknownPrefix  bool
	DropUnknownMapping bool
}

NAT64Config represents the configuration for a NAT64 instance

func (NAT64Config) Clone

func (m NAT64Config) Clone() NAT64Config

type NAT64Module

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

NAT64Module is a control-plane component responsible for NAT64 translation

func NewNAT64Module

func NewNAT64Module(cfg *Config, options ...Option) (*NAT64Module, error)

NewNAT64Module creates a new NAT64 module instance

func (*NAT64Module) Close

func (m *NAT64Module) Close() error

Close closes the module and releases all resources

func (*NAT64Module) Endpoint

func (m *NAT64Module) Endpoint() string

func (*NAT64Module) Name

func (m *NAT64Module) Name() string

func (*NAT64Module) RegisterService

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

func (*NAT64Module) ServicesNames

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

type NAT64Service

type NAT64Service struct {
	nat64pb.UnimplementedNAT64ServiceServer
	// contains filtered or unexported fields
}

NAT64Service implements the NAT64 gRPC service

func NewNAT64Service

func NewNAT64Service(backend Backend, options ...NAT64ServiceOption) *NAT64Service

func (*NAT64Service) AddMapping

func (*NAT64Service) AddPrefix

func (*NAT64Service) DeleteConfig

DeleteConfig removes the named config when it is no longer referenced by any pipeline.

func (*NAT64Service) ListConfigs

func (*NAT64Service) RemoveMapping

func (*NAT64Service) RemovePrefix

func (*NAT64Service) SetDropUnknown

func (*NAT64Service) SetMTU

func (*NAT64Service) ShowConfig

type NAT64ServiceOption

type NAT64ServiceOption func(*nat64ServiceOptions)

NAT64ServiceOption configures the NAT64Service constructor.

func WithNAT64ServiceLog

func WithNAT64ServiceLog(log *zap.Logger) NAT64ServiceOption

WithNAT64ServiceLog sets the logger for the NAT64Service.

type Option

type Option func(*moduleOptions)

Option configures the NAT64Module constructor.

func WithLog

func WithLog(log *zap.Logger) Option

WithLog sets the logger for the nat64 module.

Directories

Path Synopsis
nat64pb
v1

Jump to

Keyboard shortcuts

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