kubernetesk8s.io/kubernetes/pkg/util/iptables Index | Files

package iptables

import "k8s.io/kubernetes/pkg/util/iptables"

Package iptables provides an interface and implementations for running iptables commands.

Index

Types

type Chain

type Chain string
const (
	ChainPrerouting Chain = "PREROUTING"
	ChainOutput     Chain = "OUTPUT"
)

type Interface

type Interface interface {
	// EnsureChain checks if the specified chain exists and, if not, creates it.  If the chain existed, return true.
	EnsureChain(table Table, chain Chain) (bool, error)
	// FlushChain clears the specified chain.
	FlushChain(table Table, chain Chain) error
	// EnsureRule checks if the specified rule is present and, if not, creates it.  If the rule existed, return true.
	EnsureRule(table Table, chain Chain, args ...string) (bool, error)
	// DeleteRule checks if the specified rule is present and, if so, deletes it.
	DeleteRule(table Table, chain Chain, args ...string) error
}

An injectable interface for running iptables commands. Implementations must be goroutine-safe.

func New

func New(exec utilexec.Interface) Interface

New returns a new Interface which will exec iptables.

type Table

type Table string
const (
	TableNAT Table = "nat"
)

Source Files

doc.go iptables.go

Version
v0.4.3
Published
Oct 30, 2014
Platform
js/wasm
Imports
4 packages
Last checked
18 seconds ago

Tools for package owners.