linuxfw

package
v1.44.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: BSD-3-Clause Imports: 18 Imported by: 5

Documentation

Overview

Package linuxfw returns the kind of firewall being used by the kernel.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("unsupported")

ErrUnsupported is the error returned from all functions on non-Linux platforms.

Functions

func DebugIptables

func DebugIptables(logf logger.Logf) error

DebugNetfilter prints debug information about iptables rules to the provided log function.

func DebugNetfilter

func DebugNetfilter(logf logger.Logf) error

DebugNetfilter prints debug information about netfilter rules to the provided log function.

func DetectIptables

func DetectIptables() (int, error)

DetectIptables returns the number of iptables rules that are present in the system, ignoring the default "ACCEPT" rule present in the standard iptables chains.

It only returns an error when the kernel returns an error (i.e. when a syscall fails); when there are no iptables rules, it is valid for this function to return 0, nil.

func DetectNetfilter

func DetectNetfilter() (int, error)

DetectNetfilter returns the number of nftables rules present in the system.

Types

This section is empty.

Directories

Path Synopsis
Package linuxfwtest contains tests for the linuxfw package.
Package linuxfwtest contains tests for the linuxfw package.

Jump to

Keyboard shortcuts

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