Documentation ¶
Index ¶
- Variables
- type IptEntry
- type IptablesManager
- func (iptMgr *IptablesManager) Add(entry *IptEntry) error
- func (iptMgr *IptablesManager) AddAllChains() error
- func (iptMgr *IptablesManager) AddAllRulesToChains() error
- func (iptMgr *IptablesManager) AddChain(chain string) error
- func (iptMgr *IptablesManager) CheckAndAddForwardChain() error
- func (iptMgr *IptablesManager) Delete(entry *IptEntry) error
- func (iptMgr *IptablesManager) DeleteChain(chain string) error
- func (iptMgr *IptablesManager) Exists(entry *IptEntry) (bool, error)
- func (iptMgr *IptablesManager) GetChainLineNumber(chain string, parentChain string) (int, error)
- func (iptMgr *IptablesManager) InitNpmChains() error
- func (iptMgr *IptablesManager) Restore(configFile string) error
- func (iptMgr *IptablesManager) Run(entry *IptEntry) (int, error)
- func (iptMgr *IptablesManager) Save(configFile string) error
- func (iptMgr *IptablesManager) UninitNpmChains() error
Constants ¶
This section is empty.
Variables ¶
var ( // IptablesAzureChainList contains list of all NPM chains IptablesAzureChainList = []string{ util.IptablesAzureChain, util.IptablesAzureAcceptChain, util.IptablesAzureIngressChain, util.IptablesAzureEgressChain, util.IptablesAzureIngressPortChain, util.IptablesAzureIngressFromChain, util.IptablesAzureEgressPortChain, util.IptablesAzureEgressToChain, util.IptablesAzureIngressDropsChain, util.IptablesAzureEgressDropsChain, } )
Functions ¶
This section is empty.
Types ¶
type IptEntry ¶
type IptEntry struct { Command string Name string Chain string Flag string LockWaitTimeInSeconds string IsJumpEntry bool 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) AddAllChains ¶ added in v1.2.6
func (iptMgr *IptablesManager) AddAllChains() error
AddAllChains adds all NPM chains
func (*IptablesManager) AddAllRulesToChains ¶ added in v1.2.6
func (iptMgr *IptablesManager) AddAllRulesToChains() error
AddAllRulesToChains Checks and adds all the rules in NPM chains
func (*IptablesManager) AddChain ¶ added in v1.0.9
func (iptMgr *IptablesManager) AddChain(chain string) error
AddChain adds a chain to iptables.
func (*IptablesManager) CheckAndAddForwardChain ¶ added in v1.2.5
func (iptMgr *IptablesManager) CheckAndAddForwardChain() error
CheckAndAddForwardChain initializes and reconciles Azure-NPM chain in right order
func (*IptablesManager) Delete ¶
func (iptMgr *IptablesManager) Delete(entry *IptEntry) error
Delete removes a rule in iptables.
func (*IptablesManager) DeleteChain ¶ added in v1.0.9
func (iptMgr *IptablesManager) DeleteChain(chain string) error
DeleteChain deletes a chain from iptables.
func (*IptablesManager) Exists ¶ added in v1.0.9
func (iptMgr *IptablesManager) Exists(entry *IptEntry) (bool, error)
Exists checks if a rule exists in iptables.
func (*IptablesManager) GetChainLineNumber ¶ added in v1.2.5
func (iptMgr *IptablesManager) GetChainLineNumber(chain string, parentChain string) (int, error)
GetChainLineNumber given a Chain and its parent chain returns line number
func (*IptablesManager) InitNpmChains ¶
func (iptMgr *IptablesManager) InitNpmChains() error
InitNpmChains initializes Azure NPM chains in iptables.
func (*IptablesManager) Restore ¶ added in v1.0.9
func (iptMgr *IptablesManager) Restore(configFile string) error
Restore restores iptables configuration from /var/log/iptables.conf
func (*IptablesManager) Run ¶ added in v1.0.9
func (iptMgr *IptablesManager) Run(entry *IptEntry) (int, error)
Run execute an iptables command to update iptables.
func (*IptablesManager) Save ¶ added in v1.0.9
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.