policyconf

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetModeInBPFMap

func SetModeInBPFMap(fname string, mode Mode) error

func SetPolicyMode

func SetPolicyMode(tp tracingpolicy.TracingPolicy, m Mode) error

Types

type Mode

type Mode uint8
const (
	InvalidMode Mode = Mode(^uint8(0))
	// NB: values below should match the ones in bpf/lib/policy_conf.h
	EnforceMode     Mode = 0
	MonitorMode     Mode = 1
	MonitorOnlyMode Mode = 2 // monitor and cannot be updated to enforce

	PolicyConfMapName = "policy_conf"
)

func ModeFromBPFMap

func ModeFromBPFMap(fname string) (Mode, error)

func ParseMode

func ParseMode(s string) (Mode, error)

func PolicyMode

func PolicyMode(tp tracingpolicy.TracingPolicy) (Mode, error)

type PolicyConf

type PolicyConf struct {
	Mode Mode
}

NB: if we add more fields here, we would need to modify SetModeInBPFMap to do a read-modify operation to set the mode.

Jump to

Keyboard shortcuts

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