iptables

package
v0.0.0-...-fdfcd1a Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package iptables implements iptables firewall agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterSupportedIPTables

func FilterSupportedIPTables(supportedIPTables []string) []string

FilterSupportedIPTables filter supported versions based on what exists in the system

Types

type IPTables

type IPTables struct {
	sync.Mutex
	// contains filtered or unexported fields
}

@TODO upgrade to netfilter library. IPTables handles all firewall changes with iptables

func New

func New(stateModule string, stateFlag string, chainPrefix string, supportedIPTables []string) *IPTables

New is a default constructor for IPTables firewall

func (*IPTables) Add

func (ipt *IPTables) Add(rule firewall.Rule) error

func (*IPTables) Delete

func (ipt *IPTables) Delete(rule firewall.Rule) error

func (*IPTables) Flush

func (ipt *IPTables) Flush() error

func (*IPTables) GetActiveRules

func (ipt *IPTables) GetActiveRules() ([]string, error)

type PortRange

type PortRange struct {
	Min int
	Max int
}

func PortsToPortRanges

func PortsToPortRanges(ports []int) []PortRange

PortsToPortRanges groups ports into ranges

Jump to

Keyboard shortcuts

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