nftables

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package nftables provides nftables integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyNftRules

func ApplyNftRules(allowlist []string, httpsPortStr, httpPortStr, dnsPortStr string) error

ApplyNftRules applies nftables rules using a background context.

func ApplyNftRulesAuto

func ApplyNftRulesAuto(allowlist []string, httpsPortStr, httpPortStr string) error

ApplyNftRulesAuto applies nftables rules using port numbers from environment variables or defaults.

func ApplyNftRulesWithContext added in v0.3.0

func ApplyNftRulesWithContext(
	ctx context.Context,
	allowlist []string,
	httpsPortStr,
	httpPortStr,
	dnsPortStr string) error

ApplyNftRulesWithContext generates and applies the nftables ruleset using the provided context.

func GenerateNftRuleset

func GenerateNftRuleset(allowlist []string, httpsPort, httpPort, dnsPort int, mode string) string

GenerateNftRuleset generates a complete nftables ruleset for the specified mode, ports, and allowlist.

func StreamNfLog

func StreamNfLog() error

StreamNfLog starts streaming netfilter log events using the default logger.

func StreamNfLogWithLogger

func StreamNfLogWithLogger(ctx context.Context, lg *slog.Logger) error

StreamNfLogWithLogger streams netfilter log events from group 0 using the provided logger until context is done.

func Version added in v0.2.11

func Version(ctx context.Context) (string, error)

Version returns the nftables version string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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