iptm

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Part of this file is modified from iptables package from Kuberenetes. https://github.com/kubernetes/kubernetes/blob/master/pkg/util/iptables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IptEntry

type IptEntry struct {
	Command               string
	Name                  string
	HashedName            string
	Chain                 string
	Flag                  string
	LockWaitTimeInSeconds string
	Specs                 []string
}

IptEntry represents an iptables rule.

type IptablesManager

type IptablesManager struct {
	OperationFlag string
}

IptablesManager stores iptables entries.

func NewIptablesManager

func NewIptablesManager() *IptablesManager

NewIptablesManager creates a new instance for IptablesManager object.

func (*IptablesManager) Add

func (iptMgr *IptablesManager) Add(entry *IptEntry) error

Add adds a rule in iptables.

func (*IptablesManager) AddChain

func (iptMgr *IptablesManager) AddChain(chain string) error

AddChain adds a chain to iptables.

func (*IptablesManager) Delete

func (iptMgr *IptablesManager) Delete(entry *IptEntry) error

Delete removes a rule in iptables.

func (*IptablesManager) DeleteChain

func (iptMgr *IptablesManager) DeleteChain(chain string) error

DeleteChain deletes a chain from iptables.

func (*IptablesManager) Exists

func (iptMgr *IptablesManager) Exists(entry *IptEntry) (bool, error)

Exists checks if a rule exists in iptables.

func (*IptablesManager) InitNpmChains

func (iptMgr *IptablesManager) InitNpmChains() error

InitNpmChains initializes Azure NPM chains in iptables.

func (*IptablesManager) Restore

func (iptMgr *IptablesManager) Restore(configFile string) error

Restore restores iptables configuration from /var/log/iptables.conf

func (*IptablesManager) Run

func (iptMgr *IptablesManager) Run(entry *IptEntry) (int, error)

Run execute an iptables command to update iptables.

func (*IptablesManager) Save

func (iptMgr *IptablesManager) Save(configFile string) error

Save saves current iptables configuration to /var/log/iptables.conf

func (*IptablesManager) UninitNpmChains

func (iptMgr *IptablesManager) UninitNpmChains() error

UninitNpmChains uninitializes Azure NPM chains in iptables.

Jump to

Keyboard shortcuts

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