loader

package
v1.16.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 65 Imported by: 17

Documentation

Overview

Package loader provides accessors to compilation and BPF load routines necessary for creating datapath objects and attaching them to links.

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"loader",
	"Loader",

	cell.Config(DefaultConfig),
	cell.Provide(NewLoader),
	cell.Provide(newCompilationLock),
)
View Source
var DefaultConfig = Config{

	DeriveMasqIPAddrFromDevice: "",
}

Functions

func DeviceHasSKBProgramLoaded

func DeviceHasSKBProgramLoaded(device string, checkEgress bool) (bool, error)

DeviceHasSKBProgramLoaded returns true if the given device has a tc(x) program attached.

If checkEgress is true, returns true if there's both an ingress and egress program attached.

func NewLoader

func NewLoader(p Params) loaderTypes.Loader

NewLoader returns a new loader.

func NewLoaderForTest

func NewLoaderForTest(tb testing.TB) *loader

Types

type Config

type Config struct {
	// DeriveMasqIPAddrFromDevice specifies which device's IP addr is used for BPF masquerade.
	// This is a hidden option and by default not set. Only needed in very specific setups
	// with ECMP and multiple devices.
	// See commit d204d789746b1389cc2ba02fdd55b81a2f55b76e for original context.
	// This can be removed once https://github.com/cilium/cilium/issues/17158 is resolved.
	DeriveMasqIPAddrFromDevice string
}

func (Config) Flags

func (def Config) Flags(flags *pflag.FlagSet)

type Params

type Params struct {
	cell.In

	Config          Config
	DB              *statedb.DB
	NodeAddrs       statedb.Table[tables.NodeAddress]
	Sysctl          sysctl.Sysctl
	Devices         statedb.Table[*tables.Device]
	Prefilter       datapath.PreFilter
	CompilationLock datapath.CompilationLock
	ConfigWriter    datapath.ConfigWriter
	LocalNodeConfig datapath.LocalNodeConfiguration
	NodeHandler     datapath.NodeHandler
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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