kernel

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package kernel provides functions to interact with the kernel.

Index

Constants

View Source
const (
	// MaxMountAttempts is the default number of retries when remounting sysfs.
	MaxMountAttempts = 100
	// MountBackoffBase is the baseline duration between mount retry attempts.
	MountBackoffBase = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

func DisableRtFilter

func DisableRtFilter() error

DisableRtFilter disables the Reverse Path Filtering on the host.

func EnableIPForwarding

func EnableIPForwarding() error

EnableIPForwarding enables IP forwarding on the host. It writes 1 to /proc/sys/net/ipv4/ip_forward.

func EnableMultipathHashPolicy added in v1.2.0

func EnableMultipathHashPolicy() error

EnableMultipathHashPolicy enables 5-tuple hashing for multipath routing by writing 1 to /proc/sys/net/ipv4/fib_multipath_hash_policy.

func EnableWireguardThreadedMode added in v1.3.0

func EnableWireguardThreadedMode(ifaceName string) (bool, error)

EnableWireguardThreadedMode ensures that threaded NAPI is enabled for the given WireGuard interface. It writes 1 to /sys/class/net/<ifaceName>/threaded (only if the feature is not already enabled).

func IsThreadedNAPISupported added in v1.3.0

func IsThreadedNAPISupported(iface string) error

IsThreadedNAPISupported checks if the kernel supports threaded NAPI by probing the sysfs entry for the given interface.

func RemountSysfsRO added in v1.3.0

func RemountSysfsRO()

RemountSysfsRO remounts /sys as read-only for security, retrying indefinitely until successful.

func RemountSysfsRW added in v1.3.0

func RemountSysfsRW() error

RemountSysfsRW remounts /sys as read-write, retrying up to 100 times.

Types

This section is empty.

Directories

Path Synopsis
Package version provides functions to get kernel version and compare it with a given one.
Package version provides functions to get kernel version and compare it with a given one.

Jump to

Keyboard shortcuts

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