func (p *Plugin) Check(conf *Config, result *current.Result) error {
	if err := p.execCheck(conf, result); err != nil {
		return fmt.Errorf("%s.Check() error: %s", p.name, err)
	}
	return nil
}
Check checks whether appropriate firewall rules exist.
package firewall
import (
	"fmt"
	current "github.com/containernetworking/cni/pkg/types/040"
	"github.com/greenpau/cni-plugins/pkg/utils"
)
type Interface struct {
	addrs []*current.IPConfig
}
type Plugin struct {
	name                    string
	cniVersion              string
	supportedVersions       []string
	filterTableName         string
	forwardFilterChainName  string
	natTableName            string
	postRoutingNatChainName string
	interfaceChain          []string
	targetInterfaces        map[string]*Interface
	targetIPVersions        map[string]bool
}
func NewPlugin(conf *Config) *Plugin {
	return &Plugin{
		name:                    "cni-nftables-firewall",
		cniVersion:              "0.4.0",
		supportedVersions:       supportedVersions,
		filterTableName:         conf.FilterTableName,
		forwardFilterChainName:  conf.ForwardFilterChainName,
		natTableName:            conf.NatTableName,
		postRoutingNatChainName: conf.PostRoutingNatChainName,
		targetIPVersions:        make(map[string]bool),
		interfaceChain:          []string{},
	}
}
func (p *Plugin) Add(conf *Config, result *current.Result) error {
	if err := p.execAdd(conf, result); err != nil {
		return fmt.Errorf("%s.Add() error: %s", p.name, err)
	}
	return nil
}