iptables

package
v0.0.0-...-a70aae6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: GPL-3.0 Imports: 11 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. for now we use both ipv4, ipv6 because we disable ipv6 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

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