Documentation
¶
Index ¶
- Constants
- Variables
- func IsRuleNotFoundErr(err error) bool
- type Client
- func (c *Client) AppendIptableRule(version, tableName, chainName, match, target string) error
- func (c *Client) ChainExists(version, tableName, chainName string) bool
- func (c *Client) CreateChain(version, tableName, chainName string) error
- func (c *Client) DeleteIptableRule(version, tableName, chainName, match, target string) error
- func (c *Client) GetAppendIptableRuleCmd(version, tableName, chainName, match, target string) IPTableEntry
- func (c *Client) GetCreateChainCmd(version, tableName, chainName string) IPTableEntry
- func (c *Client) GetInsertIptableRuleCmd(version, tableName, chainName, match, target string) IPTableEntry
- func (c *Client) InsertIptableRule(version, tableName, chainName, match, target string) error
- func (c *Client) RuleExists(version, tableName, chainName, match, target string) bool
- func (c *Client) RunCmd(version, params string) error
- type IPTableEntry
Constants ¶
View Source
const ( CNIInputChain = "AZURECNIINPUT" CNIOutputChain = "AZURECNIOUTPUT" )
cni iptable chains
View Source
const ( Input = "INPUT" Output = "OUTPUT" Forward = "FORWARD" Prerouting = "PREROUTING" Postrouting = "POSTROUTING" Swift = "SWIFT" Snat = "SNAT" Return = "RETURN" )
standard iptable chains
View Source
const ( Filter = "filter" Nat = "nat" Mangle = "mangle" Raw = "raw" )
Standard Table names
View Source
const ( Accept = "ACCEPT" Drop = "DROP" Masquerade = "MASQUERADE" Notrack = "NOTRACK" )
target
View Source
const ( Insert = "I" Append = "A" Delete = "D" )
actions
View Source
const ( Established = "ESTABLISHED" Related = "RELATED" )
states
View Source
const ( V4 = "4" V6 = "6" )
View Source
const ( DNSPort = 53 HTTPPort = 80 )
known ports
View Source
const ( UDP = "udp" TCP = "tcp" )
known protocols
Variables ¶
View Source
var DisableIPTableLock bool
Functions ¶
func IsRuleNotFoundErr ¶ added in v1.8.13
IsRuleNotFoundErr reports whether err is iptables' "no matching rule exists" failure from a delete, as opposed to a real failure such as a permission error or xtables lock contention. Callers that treat a missing rule as success can use this to filter, while still propagating every other error.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AppendIptableRule ¶
Append iptable rule at end of iptable chain
func (*Client) ChainExists ¶
check if iptable chain alreay exists
func (*Client) CreateChain ¶
create new iptable chain under specified table name
func (*Client) DeleteIptableRule ¶
Delete matched iptable rule
func (*Client) GetAppendIptableRuleCmd ¶
func (c *Client) GetAppendIptableRuleCmd(version, tableName, chainName, match, target string) IPTableEntry
func (*Client) GetCreateChainCmd ¶
func (c *Client) GetCreateChainCmd(version, tableName, chainName string) IPTableEntry
func (*Client) GetInsertIptableRuleCmd ¶
func (c *Client) GetInsertIptableRuleCmd(version, tableName, chainName, match, target string) IPTableEntry
func (*Client) InsertIptableRule ¶
Insert iptable rule at beginning of iptable chain
func (*Client) RuleExists ¶
check if iptable rule alreay exists
type IPTableEntry ¶
Click to show internal directories.
Click to hide internal directories.