Help us shape the future of Go! Take the 2026 Go Developer Survey

ipmasq

package
v1.20.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const (
	MapNameIPv4    = "cilium_ipmasq_v4"
	MaxEntriesIPv4 = 16384
	MapNameIPv6    = "cilium_ipmasq_v6"
	MaxEntriesIPv6 = 16384
)

Variables

View Source
var Cell = cell.Module(
	"ip-masq-maps",
	"BPF ip-masq-agent maps",

	cell.Provide(newIPMasqMaps),
)

Functions

func IPMasq4Map

func IPMasq4Map(registry *metrics.Registry) *bpf.Map

func IPMasq6Map

func IPMasq6Map(registry *metrics.Registry) *bpf.Map

Types

type IPMasqBPFMap

type IPMasqBPFMap struct {
	MetricsRegistry *metrics.Registry
}

func (*IPMasqBPFMap) Delete

func (m *IPMasqBPFMap) Delete(cidr netip.Prefix) error

func (*IPMasqBPFMap) Dump

func (*IPMasqBPFMap) Dump() ([]netip.Prefix, error)

Dump dumps the contents of the ip-masq-agent maps for IPv4 and/or IPv6, as required based on configuration options.

func (*IPMasqBPFMap) DumpForProtocols

func (*IPMasqBPFMap) DumpForProtocols(ipv4Needed, ipv6Needed bool) ([]netip.Prefix, error)

DumpForProtocols dumps the contents of the ip-masq-agent maps for IPv4 and/or IPv6, as requested by the caller. Given that the package does not expose the maps directly, it's necessary to specify which protocol we need when ipMasq4Map/ipMasq6Map, or config options, have not been set, as is the case when calling from the CLI, for example.

func (*IPMasqBPFMap) Update

func (m *IPMasqBPFMap) Update(cidr netip.Prefix) error

type Key4

type Key4 struct {
	PrefixLen uint32
	Address   types.IPv4
}

func (*Key4) New

func (k *Key4) New() bpf.MapKey

func (*Key4) String

func (k *Key4) String() string

type Key6

type Key6 struct {
	PrefixLen uint32
	Address   types.IPv6
}

func (*Key6) New

func (k *Key6) New() bpf.MapKey

func (*Key6) String

func (k *Key6) String() string

type Value

type Value struct {
	Pad uint8 // not used
}

func (*Value) New

func (v *Value) New() bpf.MapValue

func (*Value) String

func (v *Value) String() string

Jump to

Keyboard shortcuts

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