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

config

package
v1.18.16 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: 47 Imported by: 2

Documentation

Index

Constants

View Source
const NodePortMaxNAT = 65535

Variables

View Source
var Cell = cell.Module(
	"datapath-linux-config",
	"Generate and write the configuration for datapath program types",

	cell.Provide(NewHeaderfileWriter),
)

Functions

func FmtDefineAddress

func FmtDefineAddress(name string, addr []byte) string

FmtDefineAddress returns the a define string from the given name and addr. Example: fmt.Print(FmtDefineAddress("foo", []byte{1, 2, 3})) // "#define foo { .addr = { 0x1, 0x2, 0x3 } }\n"

func NewHeaderfileWriter

func NewHeaderfileWriter(p WriterParams) (datapath.ConfigWriter, error)

Types

type HeaderfileWriter

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

HeaderfileWriter is a wrapper type which implements datapath.ConfigWriter. It manages writing of configuration of datapath program headerfiles.

func (*HeaderfileWriter) WriteEndpointConfig

WriteEndpointConfig writes the BPF configuration for the endpoint to a writer.

func (*HeaderfileWriter) WriteNetdevConfig

func (h *HeaderfileWriter) WriteNetdevConfig(w io.Writer, opts *option.IntOptions) error

WriteNetdevConfig writes the BPF configuration for the endpoint to a writer.

func (*HeaderfileWriter) WriteNodeConfig deprecated

func (h *HeaderfileWriter) WriteNodeConfig(w io.Writer, cfg *datapath.LocalNodeConfiguration) error

WriteNodeConfig writes the local node configuration to the specified writer.

Deprecated: Future additions to this function will be rejected. The docs at https://docs.cilium.io/en/latest/contributing/development/datapath_config will guide you through adding new configuration.

func (*HeaderfileWriter) WriteTemplateConfig

WriteTemplateConfig writes the BPF configuration for the template to a writer.

type WriterParams added in v1.15.0

type WriterParams struct {
	cell.In

	Log                *slog.Logger
	LBConfig           loadbalancer.Config
	NodeMap            nodemap.MapV2
	NodeAddressing     datapath.NodeAddressing
	NodeExtraDefines   []dpdef.Map `group:"header-node-defines"`
	NodeExtraDefineFns []dpdef.Fn  `group:"header-node-define-fns"`
	Sysctl             sysctl.Sysctl
	KPRConfig          kpr.KPRConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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