Versions in this module Expand all Collapse all v0 v0.22.0 Aug 3, 2026 Changes in this version + const ConnsPerSlot + const MinSlotID + var ErrNoSlots = errors.New("no available slots in network") + var ErrSlotExhausted = errors.New("connection slot exhausted") + func ConnPrefix(s Slot, i uint8) netip.Prefix + func EndpointPrefix(s Slot) netip.Prefix + func SlotPrefix(s Slot) netip.Prefix + func SlotPrefixOf(addr netip.Addr) netip.Prefix + type LocalSlotLeaser struct + func NewLocalSlotLeaser() *LocalSlotLeaser + func (l *LocalSlotLeaser) Lease(_ context.Context, network tunnet.NetworkID) (Slot, error) + func (l *LocalSlotLeaser) Release(_ context.Context, s Slot) error + func (l *LocalSlotLeaser) Renew(_ context.Context, _ Slot) error + type Slot struct + ID tunnet.EndpointID + Network tunnet.NetworkID + V4 netip.Prefix + func SlotOf(p netip.Prefix) (s Slot, conn uint8, ok bool) + type SlotLeaser interface + Lease func(ctx context.Context, network tunnet.NetworkID) (Slot, error) + Release func(ctx context.Context, s Slot) error + Renew func(ctx context.Context, s Slot) error + type V4SlicePool struct + func NewV4SlicePool() *V4SlicePool v0.21.0 Jul 30, 2026 Changes in this version + var ErrBlockExhausted = errors.New("connection block exhausted") + var ErrNoBlocks = errors.New("no available blocks in network") + type Block struct + Index uint8 + Network tunnet.NetworkID + Prefix netip.Prefix + type BlockLeaser interface + Lease func(ctx context.Context, network tunnet.NetworkID) (Block, error) + Release func(ctx context.Context, b Block) error + Renew func(ctx context.Context, b Block) error + type ConnAllocator struct + func NewConnAllocator(b Block) *ConnAllocator + func (a *ConnAllocator) Allocate() (v6 netip.Prefix, v4 netip.Prefix, err error) + func (a *ConnAllocator) Full() bool + func (a *ConnAllocator) Release(v6, v4 netip.Prefix) + type LocalBlockLeaser struct + func NewLocalBlockLeaser(ctx context.Context) *LocalBlockLeaser + func (l *LocalBlockLeaser) Lease(_ context.Context, network tunnet.NetworkID) (Block, error) + func (l *LocalBlockLeaser) Release(_ context.Context, b Block) error + func (l *LocalBlockLeaser) Renew(_ context.Context, _ Block) error