Documentation
¶
Index ¶
- Variables
- func AddDestinationNatRule(conn *nftables.Conn, table, chain string, pm PortMapping) (uint64, error)
- func ChainExists(v, tableName, chainName string) (bool, error)
- func Check() error
- func CreateChain(v, tableName, chainName, chainType, chainHookType, chainPriority string) error
- func CreateTable(v, tableName string) error
- func DeleteRules(handles []uint64) error
- func EncodeInterfaceName(s string) []byte
- func GetRuleMatchingUserDataBytes(table, chain string, userdata []byte) (*nftables.Rule, error)
- func GetRules(table, chain string) ([]*nftables.Rule, error)
- func SetPortmap(iface, ip string, portmap []string) ([]uint64, error)
- func TableExists(v, tableName string) (bool, error)
- type PortMapping
- type Unmapper
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrRuleNotFound = errors.New("error: rule not found")
)
View Source
var Fix = Check
Functions ¶
func AddDestinationNatRule ¶
func AddDestinationNatRule(conn *nftables.Conn, table, chain string, pm PortMapping) (uint64, error)
AddDestinationNatRule creates a destination NAT rule
func ChainExists ¶
ChainExists checks whether a chain exists.
func CreateChain ¶
CreateChain creates NAT chain of a specific type.
func DeleteRules ¶
func EncodeInterfaceName ¶
EncodeInterfaceName returns null-terminated string for netlink communication.
func TableExists ¶
TableExists checks whether a table exists
Types ¶
type PortMapping ¶
type PortMapping struct { HostPort int `json:"hostPort"` ContainerHost string `json:"containerHost"` ContainerPort int `json:"containerPort"` Protocol string `json:"protocol"` }
PortMapping holds the port mapping configuration.
func (PortMapping) Bytes ¶
func (pm PortMapping) Bytes() []byte
Click to show internal directories.
Click to hide internal directories.