Documentation ¶
Index ¶
- type Config
- type ConfigChange
- type ConfigDiff
- type ConfigValue
- type Symbol
- type SymbolTable
- type SymbolType
- func (styp SymbolType) Absolute() bool
- func (styp SymbolType) BSS() bool
- func (styp SymbolType) Data() bool
- func (styp SymbolType) Global() bool
- func (styp SymbolType) Readonly() bool
- func (styp SymbolType) Text() bool
- func (styp SymbolType) WeakObject() bool
- func (styp SymbolType) WeakSymbol() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config represents a parsed Linux kernel configuration file.
Given a value cfg of type Config:
* for CONFIG_X=something, cfg["X"] == "bar"
* for CONFIG_Y="", cfg["Y"] == "".
* for # CONFIG_Z is not set, cfg["Z"] == "n".
func ParseConfig ¶
ParseConfig parses a Config from r. It reads from r until EOF. ParseConfig assumes that its input is a well-formed kernel configuration file: its behavior is undefined otherwise.
func (Config) ApplyDiff ¶
func (cfg Config) ApplyDiff(diff ConfigDiff) (Config, error)
ApplyDiff applies the specified diff to cfg and returns a new config, such that, schematically, if x.ApplyDiff(d) == y, then DiffConfig(x, y) == d.
func (Config) Equal ¶
Equal returns a boolean indicating whether cfg and the specified config are equal, i.e. the two configurations contain the exact same set of keys, and all the corresponding values are equal.
Comparing configuration files from different kernel versions may or may not be meaningful.
type ConfigChange ¶
type ConfigChange struct {
Opt, OldVal, NewVal string
}
ConfigChange specifies a change in a configuration value.
func (ConfigChange) String ¶
func (cc ConfigChange) String() string
String formats cc as, for example: "INET6_ESP_OFFLOAD n -> m".
type ConfigDiff ¶
type ConfigDiff struct { InOld []ConfigValue Changes []ConfigChange InNew []ConfigValue }
ConfigDiff contains differences between two kernel configurations. The slices are sorted by the option name.
func DiffConfig ¶
func DiffConfig(old, new Config) ConfigDiff
DiffConfig returns the differences between the old and new config.
type ConfigValue ¶
type ConfigValue struct {
Opt, Val string
}
ConfigValue contains an option, value pair.
func (ConfigValue) String ¶
func (cv ConfigValue) String() string
String formats vs as, for example: "PKCS8_PRIVATE_KEY_PARSER n".
type Symbol ¶
type Symbol struct { Addr uintptr Type SymbolType Name string Module string }
Symbol represents a kernel symbol.
type SymbolTable ¶
type SymbolTable map[Symbol]struct{}
SymbolTable is a Linux kernel symbol table.
func ParseSymbols ¶
func ParseSymbols(path string) (SymbolTable, error)
ParseSymbols reads kernel symbols from the specified path. The path should indicate /proc/kallsyms or the equivalent file if procfs is mounted elsewhere.
func (SymbolTable) Find ¶
func (symtab SymbolTable) Find(name string) []Symbol
Find finds symbols with the specified name.
type SymbolType ¶
type SymbolType rune
SymbolType is the type of a symbol, as reported by nm and /proc/kallsyms.
func (SymbolType) Absolute ¶
func (styp SymbolType) Absolute() bool
Absolute returns a boolean indicating whether the symbol's value is absolute, and will not be changed by further linking ('A' or 'a').
func (SymbolType) BSS ¶
func (styp SymbolType) BSS() bool
BSS returns a boolean indicating whether the symbol is in the BSS data section ('B' or 'b').
func (SymbolType) Data ¶
func (styp SymbolType) Data() bool
Data returns a boolean indicating whether the symbol is in the initialized data section ('D' or 'd').
func (SymbolType) Global ¶
func (styp SymbolType) Global() bool
Global returns a boolean indicating whether the symbol is global (external).
func (SymbolType) Readonly ¶
func (styp SymbolType) Readonly() bool
Readonly returns a boolean indicating whether the symbol is in a read only data section ('R' or 'r').
func (SymbolType) Text ¶
func (styp SymbolType) Text() bool
Text returns a boolean indicating whether the symbol is in a text section ('T' or 't').
func (SymbolType) WeakObject ¶
func (styp SymbolType) WeakObject() bool
WeakObject returns a boolean indicating whether the symbol is a weak object ('V' or 'v').
func (SymbolType) WeakSymbol ¶
func (styp SymbolType) WeakSymbol() bool
WeakSymbol returns a boolean indicating whether the symbol is a weak symbol ('W' or 'w').