utils

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 11 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultGatewayIface

func GetDefaultGatewayIface() (*net.Interface, error)

func GetDefaultInterface

func GetDefaultInterface() (*net.Interface, net.IP, error)

func GetIfaceByName

func GetIfaceByName(name string) (*net.Interface, net.IP, error)

func GetIfaceIP4Addr

func GetIfaceIP4Addr(iface *net.Interface) (net.IP, error)

func SetupAndEnsureIPTables

func SetupAndEnsureIPTables(rules []IPTablesRule, resyncPeriod int)

Types

type FDBRule

type FDBRule struct {
	Mac       string
	Device    string
	DST       string
	Vlan      string
	Master    string
	Self      bool
	Permanent bool
}

func BridgeFDBList

func BridgeFDBList() ([]FDBRule, error)

func BridgeFDBParse

func BridgeFDBParse(r string) FDBRule

type IPTables

type IPTables interface {
	AppendUnique(table string, chain string, rulespec ...string) error
	Delete(table string, chain string, rulespec ...string) error
	Exists(table string, chain string, rulespec ...string) (bool, error)
}

type IPTablesRule

type IPTablesRule struct {
	// contains filtered or unexported fields
}

func ForwardRules

func ForwardRules(rg string) []IPTablesRule

func MasqRules

func MasqRules(ip net.IP, subnet string) []IPTablesRule

Jump to

Keyboard shortcuts

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