iptables

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Simple iptables controller based on Docker's

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIptablesNotFound  = errors.New("iptables not found")
	ErrConntrackNotFound = errors.New("conntrack not found")
)

Functions

func RunConntrackCommand

func RunConntrackCommand(args ...string) ([]byte, error)

func RunIptablesCommand

func RunIptablesCommand(args ...string) ([]byte, error)

Types

type Action

type Action string
const (
	Add    Action = "-A"
	Delete Action = "-D"
)

type Address

type Address struct {
	IP   string
	Port int
}

func NewAddress

func NewAddress(ip string, port int) *Address

type Chain

type Chain struct {
	Name string
}

func NewChain

func NewChain(name string) *Chain

func (*Chain) Forward

func (c *Chain) Forward(action Action, proto string, dest, fwdto *Address) error

func (*Chain) Inject

func (c *Chain) Inject() error

func (*Chain) Prerouting

func (c *Chain) Prerouting(action Action, args ...string) error

func (*Chain) Remove

func (c *Chain) Remove() error

Jump to

Keyboard shortcuts

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