package kconfig

import "github.com/cilium/ebpf/internal/kconfig"

Index

Constants

const (
	TriNo     triState = 0
	TriYes    triState = 1
	TriModule triState = 2
)

Functions

func Find

func Find() (*os.File, error)

Find find a kconfig file on the host. It first reads from /boot/config- of the current running kernel and tries /proc/config.gz if nothing was found in /boot. If none of the file provide a kconfig, it returns an error.

func Parse

func Parse(source io.ReaderAt, filter map[string]struct{}) (map[string]string, error)

Parse parses the kconfig file for which a reader is given. All the CONFIG_* which are in filter and which are set set will be put in the returned map as key with their corresponding value as map value. If filter is nil, no filtering will occur. If the kconfig file is not valid, error will be returned.

func PutInteger

func PutInteger(data []byte, integer *btf.Int, n uint64) error

PutInteger writes n into data.

integer determines how much is written into data and what the valid values are.

func PutValue

func PutValue(data []byte, typ btf.Type, value string) error

PutValue translates the value given as parameter depending on the BTF type, the translated value is then written to the byte array.

Source Files

kconfig.go

Version
v0.15.0
Published
Apr 22, 2024
Platform
darwin/amd64
Imports
11 packages
Last checked
5 minutes ago

Tools for package owners.