kernel

package
v0.0.0-...-7983b3b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arch

func Arch() string

Arch returns the kernel architecture value, often used within the kernel `include/arch` directory.

func GetMountPoint

func GetMountPoint(path string) (*mountinfo.Info, error)

GetMountPoint returns the mount point of the given path

func IsDebugFSMounted

func IsDebugFSMounted() (bool, error)

IsDebugFSMounted would test the existence of file /sys/kernel/debug/tracing/kprobe_events to determine if debugfs is mounted or not returns a boolean and a possible error message

func IsIPv6Enabled

func IsIPv6Enabled() bool

IsIPv6Enabled returns whether or not IPv6 has been enabled on the host

func MountInfoPidPath

func MountInfoPidPath(pid int32) string

MountInfoPidPath returns the path to the mountinfo file of a pid in /proc

func ParseMountInfoFile

func ParseMountInfoFile(pid int32) ([]*mountinfo.Info, error)

ParseMountInfoFile collects the mounts for a specific process ID.

Types

type HeaderFetchResult

type HeaderFetchResult int

HeaderFetchResult enumerates kernel header fetching success & failure modes

const (
	// NotAttempted represents the case where runtime compilation fails prior to attempting to
	// fetch kernel headers
	NotAttempted HeaderFetchResult = iota
)

func GetKernelHeaders

func GetKernelHeaders(headerDirs []string, headerDownloadDir, aptConfigDir, yumReposDir, zypperReposDir string) ([]string, HeaderFetchResult, error)

GetKernelHeaders attempts to find kernel headers on the host, and if they cannot be found it will attempt to download them to headerDownloadDir

type LockdownMode

type LockdownMode string

LockdownMode defines a lockdown type

const (
	// None mode
	None LockdownMode = "none"
	// Integrity mode
	Integrity LockdownMode = "integrity"
	// Confidentiality mode
	Confidentiality LockdownMode = "confidentiality"
	// Unknown mode
	Unknown LockdownMode = "unknown"
)

func GetLockdownMode

func GetLockdownMode() LockdownMode

GetLockdownMode returns the lockdown

type Version

type Version uint32

Version is a numerical representation of a kernel version

func HostVersion

func HostVersion() (Version, error)

HostVersion returns the running kernel version of the host

func ParseVersion

func ParseVersion(s string) Version

ParseVersion parses a string in the format of x.x.x to a Version

func VersionCode

func VersionCode(major, minor, patch byte) Version

VersionCode returns a Version computed from the individual parts of a x.x.x version

func (Version) String

func (v Version) String() string

String returns a string representing the version in x.x.x format

Jump to

Keyboard shortcuts

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