ebtables

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

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

type Interface

type Interface interface {
	// GetVersion returns the "X.Y.Z" semver string for ebtables.
	GetVersion() (string, error)
	// EnsureRule checks if the specified rule is present and, if not, creates it.  If the rule existed, return true.
	// WARNING: ebtables does not provide check operation like iptables do. Hence we have to do a string match of args.
	// Input args must follow the format and sequence of ebtables list output. Otherwise, EnsureRule will always create
	// new rules and causing duplicates.
	EnsureRule(position RulePosition, table Table, chain Chain, args ...string) (bool, error)
	// EnsureChain checks if the specified chain is present and, if not, creates it.  If the rule existed, return true.
	EnsureChain(table Table, chain Chain) (bool, error)
	// DeleteChain deletes the specified chain.  If the chain did not exist, return error.
	DeleteChain(table Table, chain Chain) error
	// FlushChain flush the specified chain.  If the chain did not exist, return error.
	FlushChain(table Table, chain Chain) error
}

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

func New

func New(exec utilexec.Interface) Interface

New returns a new Interface which will exec ebtables.

type RulePosition

type RulePosition string
const (
	Prepend RulePosition = "-I"
	Append  RulePosition = "-A"
)

type Table

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

Jump to

Keyboard shortcuts

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