Documentation ¶
Index ¶
- func AddDestinationNatRewriteRules(opts map[string]interface{}) error
- func AddDestinationNatRules(opts map[string]interface{}) error
- func AddFilterForwardMappedPortRules(opts map[string]interface{}) error
- func AddFilterForwardRules(v, tableName, chainName string, addr *current.IPConfig, intfName string) error
- func AddPostRoutingRules(opts map[string]interface{}) error
- func CreateChain(v, tableName, chainName, chainType, chainHookType, chainPriority string) error
- func CreateFilterForwardChain(v, tableName, chainName string) error
- func CreateJumpRule(v, tableName, srcChainName, dstChainName string) error
- func CreateNatInputChain(v, tableName, chainName string) error
- func CreateNatOutputChain(v, tableName, chainName string) error
- func CreateNatPostRoutingChain(v, tableName, chainName string) error
- func CreateNatPreRoutingChain(v, tableName, chainName string) error
- func CreateRawPreRoutingChain(v, tableName, chainName string) error
- func CreateTable(v, tableName string) error
- func DeleteChain(v, tableName, chainName string) error
- func DeleteJumpRule(v, tableName, srcChainName, dstChainName string) error
- func EncodeInterfaceName(s string) []byte
- func GetChainName(prefix, containerID string) string
- func GetJumpRule(v, tableName, srcChainName, dstChainName string) (*nftables.Rule, error)
- func GetTestContainerID(s string) string
- func IsChainExists(v, tableName, chainName string) (bool, error)
- func IsTableExist(v, tableName string) (bool, error)
- func LoadDataFromFilePath(fp string) ([]byte, error)
- func RemoveFilterForwardMappedPortRules(opts map[string]interface{}) error
- type ChainInfo
- type MappingEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDestinationNatRewriteRules ¶
AddDestinationNatRewriteRules destination rewrite rule for the traffic arriving on a specific port.
func AddDestinationNatRules ¶
AddDestinationNatRules creates destination NAT rules
func AddFilterForwardMappedPortRules ¶
AddFilterForwardMappedPortRules adds a set of rules in forwarding chain of filter table.
func AddFilterForwardRules ¶
func AddFilterForwardRules(v, tableName, chainName string, addr *current.IPConfig, intfName string) error
AddFilterForwardRules adds a set of rules in forwarding chain of filter table.
func AddPostRoutingRules ¶
AddPostRoutingRules adds a set of rules in postrouting chain of nat table.
func CreateChain ¶
CreateChain creates NAT chain of a specific type.
func CreateFilterForwardChain ¶
CreateFilterForwardChain creates forward chain in filter table.
func CreateJumpRule ¶
CreateJumpRule create a jump rule from one chain to another.
func CreateNatInputChain ¶
CreateNatInputChain creates an input chain in nat table.
NF_INET_LOCAL_IN: all incoming packets addressed to the local computer pass this hook in the function ip_local_deliver().
func CreateNatOutputChain ¶
CreateNatOutputChain creates an output chain in nat table.
NF_INET_LOCAL_OUT: all outgoing packets created in the local computer pass this hook in the function ip_build_and_send_pkt().
func CreateNatPostRoutingChain ¶
CreateNatPostRoutingChain creates a postrouting chain in nat table.
NF_INET_POST_ROUTING: this hook in the ipfinishoutput() function before they leave the computer.
func CreateNatPreRoutingChain ¶
CreateNatPreRoutingChain creates a prerouting chain in nat table.
NF_INET_PRE_ROUTING: incoming packets pass this hook in the ip_rcv() (linux/net/ipv4/ip_input.c) function before they are processed by the routing code.
func CreateRawPreRoutingChain ¶
CreateRawPreRoutingChain creates a prerouting chain in raw table.
func DeleteChain ¶
DeleteChain deletes a particular chain.
func DeleteJumpRule ¶
DeleteJumpRule deletes the chain jumping rule.
func EncodeInterfaceName ¶
EncodeInterfaceName returns null-terminated string for netlink communication.
func GetChainName ¶
GetChainName returns nftables chain name based on the provided namespace and interface.
func GetJumpRule ¶
GetJumpRule return information about a specific jump rule.
func GetTestContainerID ¶
GetTestContainerID returns the name for a test container.
func IsChainExists ¶
IsChainExists checks whether a chain exists.
func IsTableExist ¶
IsTableExist checks whether a table exists
func LoadDataFromFilePath ¶
LoadDataFromFilePath returns the content of a file based on the provided file path.
func RemoveFilterForwardMappedPortRules ¶
RemoveFilterForwardMappedPortRules removes a set of rules in forwarding chain of filter table.
Types ¶
type ChainInfo ¶
ChainInfo holds the rules of a particular chain
func GetChainProps ¶
GetChainProps returns the rules and other properties of a particular chain.
Source Files ¶
- broadcast_rule.go
- chain_jump_rule.go
- chains.go
- conn.go
- dest_nat.go
- dest_nat_rewrite.go
- filter_forward_inbound_traffic_rule.go
- filter_forward_intra_interface_rule.go
- filter_forward_mapped_port_rules.go
- filter_forward_outbound_traffic_rule.go
- filter_forward_rules.go
- get_chain_props.go
- local_multicast_rule.go
- log_deny_rule.go
- nat_postrouting_rules.go
- portmap_entry.go
- source_nat.go
- tables.go
- utils.go