package kconfig

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

Package kconfig implements a parser for the format of Linux's .config file.

Index

Constants

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

Functions

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.18.0 (latest)
Published
Apr 2, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
1 week ago

Tools for package owners.