kubernetes: github.com/igm/kubernetes/pkg/util/iptables Index | Files

package iptables

import "github.com/igm/kubernetes/pkg/util/iptables"

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

Index

Package Files

doc.go iptables.go

type Chain Uses

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

type Interface Uses

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
    // IsIpv6 returns true if this is managing ipv6 tables
    IsIpv6() bool
}

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

func New Uses

func New(exec utilexec.Interface, protocol Protocol) Interface

New returns a new Interface which will exec iptables.

type Protocol Uses

type Protocol byte
const (
    ProtocolIpv4 Protocol = iota + 1
    ProtocolIpv6
)

type Table Uses

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

Package iptables imports 8 packages (graph). Updated 2018-04-17. Refresh now. Tools for package owners.