firewall

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(args *skel.CmdArgs) error

Add initializes an instance of Plugin and adds necessary firewall rules.

func Check

func Check(args *skel.CmdArgs) error

Check initializes an instance of Plugin and performs necessary checks.

func Delete

func Delete(args *skel.CmdArgs) error

Delete initializes an instance of Plugin and removes firewall rules, if any.

func GetSupportedVersions

func GetSupportedVersions() version.PluginInfo

GetSupportedVersions returns supported CNI spec versions.

Types

type Config

type Config struct {
	types.NetConf
	ContainerID             string `json:"-"`
	FilterTableName         string `json:"filter_table_name"`
	ForwardFilterChainName  string `json:"forward_chain_name"`
	NatTableName            string `json:"nat_table_name"`
	PostRoutingNatChainName string `json:"postrouting_nat_chain_name"`
}

Config holds the configuration for the Plugin.

type Interface

type Interface struct {
	// contains filtered or unexported fields
}

Interface represents a collection of addresses associated with a network interface.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin represents the nftables firewall/filter CNI plugin.

func NewPlugin

func NewPlugin(conf *Config) *Plugin

NewPlugin returns an instance of Plugin.

func (*Plugin) Add

func (p *Plugin) Add(conf *Config, result *current.Result) error

Add adds firewall rules.

func (*Plugin) Check

func (p *Plugin) Check(conf *Config, result *current.Result) error

Check checks whether appropriate firewall rules exist.

func (*Plugin) Delete

func (p *Plugin) Delete(conf *Config, result *current.Result) error

Delete deletes appropriate firewall rules, if any.

Jump to

Keyboard shortcuts

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