reuse

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package reuse implements a activator.Activator using BPF_PROG_TYPE_SK_REUSEPORT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreAddr

func IgnoreAddr(addrMap *ebpf.Map, ip string) error

Types

type Activator

type Activator struct {
	*Config
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, ns ns.NetNS, cgroupsPath string, opts ...Option) (*Activator, error)

func (*Activator) AttachExec

func (act *Activator) AttachExec() error

func (*Activator) DisableRedirects

func (act *Activator) DisableRedirects() error

func (*Activator) ForwardToTarget

func (act *Activator) ForwardToTarget(ctx context.Context, addr string) error

ForwardToTarget creates a TCP proxy and replaces the app listener with it to forward traffic to the target addr. TODO: the tracker does not detect this traffic for some reason.

func (*Activator) GetListeners

func (act *Activator) GetListeners(_ context.Context, _ int) []activator.Listener

func (*Activator) LastActivity

func (act *Activator) LastActivity(port uint16) (time.Time, error)

func (*Activator) LoadBPF

func (act *Activator) LoadBPF() error

func (*Activator) Reload

func (act *Activator) Reload(opts ...Option) error

func (*Activator) Reset

func (act *Activator) Reset() error

func (*Activator) SetConnectTimeout

func (act *Activator) SetConnectTimeout(d time.Duration)

func (*Activator) SetProxyTimeout

func (act *Activator) SetProxyTimeout(d time.Duration)

func (*Activator) Start

func (act *Activator) Start(ctx context.Context, pid int, listeners activator.Listeners, skipStart bool) error

func (*Activator) Started

func (act *Activator) Started() bool

func (*Activator) Stop

func (act *Activator) Stop(_ context.Context)

type Config

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

type Option

type Option func(cfg *Config)

func ConnectTimeout

func ConnectTimeout(timeout time.Duration) Option

ConnectTimeout of the forwarding proxy. Does not apply to wake traffic.

func ProbeAddr

func ProbeAddr(addr *netip.Addr) Option

ProbeAddr to direct probe traffic to and to ignore by the socket tracker. Usually set to the kublet address.

func RestoreHook

func RestoreHook(restoreHook activator.RestoreHook) Option

RestoreHook is called on wake.

func TrackerIgnoreLocalhost

func TrackerIgnoreLocalhost(ignore bool) Option

TrackerIgnoreLocalhost tells the tracker to not count traffic from localhost.

Jump to

Keyboard shortcuts

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