types

package
v1.20.0-pre.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PropertyFakeEndpoint marks the endpoint as being "fake". By "fake" it
	// means that it doesn't have any datapath bpf programs regenerated.
	PropertyFakeEndpoint = "property-fake-endpoint"

	// PropertyAtHostNS is used for endpoints that are reached via the host networking
	// namespace, but have their own IP(s) from the node's pod CIDR range
	PropertyAtHostNS = "property-at-host-network-namespace"

	// PropertyWithouteBPFDatapath marks the endpoint that doesn't contain a
	// eBPF datapath program.
	PropertyWithouteBPFDatapath = "property-without-bpf-endpoint"

	// PropertySkipBPFPolicy will mark the endpoint to skip ebpf
	// policy regeneration.
	PropertySkipBPFPolicy = "property-skip-bpf-policy"

	// PropertySkipBPFRegeneration will mark the endpoint to skip ebpf
	// regeneration.
	PropertySkipBPFRegeneration = "property-skip-bpf-regeneration"

	// PropertyCEPOwner will be able to store the CEP owner for this endpoint.
	PropertyCEPOwner = "property-cep-owner"

	// PropertyCEPName contains the CEP name for this endpoint.
	PropertyCEPName = "property-cep-name"

	// PropertySkipMasqueradeV4 will mark the endpoint to skip IPv4 masquerade.
	PropertySkipMasqueradeV4 = "property-skip-masquerade-v4"
	// PropertySkipMasqueradeV6 will mark the endpoint to skip IPv6 masquerade.
	PropertySkipMasqueradeV6 = "property-skip-masquerade-v6"
	// Property RTInfo describes the endpoint's RTInfo encoding.
	PropertyRTInfo = "property-rt-info"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompileTimeConfig

type CompileTimeConfig interface {
	DeviceConfig

	// RequireEgressProg returns true if the endpoint requires an egress
	// program attached to the InterfaceName() invoking the section
	// "to-container"
	RequireEgressProg() bool

	// RequireRouting returns true if the endpoint requires BPF routing to
	// be enabled, when disabled, routing is delegated to Linux routing
	RequireRouting() bool

	// RequireEndpointRoute returns true if the endpoint wishes to have a
	// per endpoint route installed in the host's routing table to point to
	// the endpoint's interface
	RequireEndpointRoute() bool

	// IsHost returns true if the endpoint is the host endpoint.
	IsHost() bool
}

CompileTimeConfig provides datapath implementations a clean interface to access endpoint-specific configuration that can only be changed at compile time.

type Config

type Config interface {
	CompileTimeConfig
	LoadTimeConfig
}

Config provides datapath implementations a clean interface to access endpoint-specific configuration when configuring the datapath.

type DeviceConfig

type DeviceConfig interface {
	// GetOptions fetches the configurable datapath options from the owner.
	GetOptions() *option.IntOptions
}

DeviceConfig is an interface for injecting configuration of datapath options that affect lookups and logic applied at a per-device level, whether those are devices associated with the endpoint or associated with the host.

type Endpoint

type Endpoint interface {
	Config
	InterfaceName() string
	Logger(subsystem string) *slog.Logger
	StateDir() string
}

Endpoint provides access endpoint configuration information that is necessary to compile and load the datapath.

type LoadTimeConfig

type LoadTimeConfig interface {
	// GetID returns a locally-significant endpoint identification number.
	GetID() uint64
	// StringID returns the string-formatted version of the ID from GetID().
	StringID() string
	// GetIdentity returns a globally-significant numeric security identity.
	GetIdentity() identity.NumericIdentity

	IPv4Address() netip.Addr
	IPv6Address() netip.Addr
	GetNodeMAC() mac.MAC
	GetIfIndex() int
	GetEndpointNetNsCookie() uint64

	// GetPolicyVerdictLogFilter returns the PolicyVerdictLogFilter for the endpoint
	GetPolicyVerdictLogFilter() uint32

	// GetPropertyValue returns the endpoint property value for this key.
	GetPropertyValue(key string) any

	// GetRTInfo returns the routing domain info for the pod and its encoding.
	GetRTInfo() (uint32, RTInfoEncoding)

	// RequireARPPassthrough returns true if the datapath must implement
	// ARP passthrough for this endpoint
	RequireARPPassthrough() bool
}

LoadTimeConfig provides datapath implementations a clean interface to access endpoint-specific configuration that can be changed at load time.

type Orchestrator

type Orchestrator interface {
	Reinitialize(ctx context.Context) error

	DatapathInitialized() <-chan struct{}
	ReloadDatapath(ctx context.Context, ep Endpoint, stats *metrics.SpanStat) (string, error)
	EndpointHash(cfg Config) (string, error)
	WriteEndpointConfig(w io.Writer, cfg Config) error
	Unload(ep Endpoint)
}

type RTInfoEncoding

type RTInfoEncoding string

RTInfoEncoding describes a possible encoding of the RTInfo field of an endpoint.

const (
	RTInfoNone RTInfoEncoding = ""
	RTInfoFIB  RTInfoEncoding = "fib"
)

Jump to

Keyboard shortcuts

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