Documentation
¶
Index ¶
- Variables
- func Add(setName, entry string, opts ...Option) error
- func Create(setName string, opts ...Option) error
- func Del(setName, entry string) error
- func Destroy(setName string) error
- func Flush(setName string) error
- func Init() error
- type Family
- type IPSet
- func (s *IPSet) Add(setName, entry string, opts ...Option) error
- func (s *IPSet) AddAddr(setName string, ip netip.Addr, opts ...Option) error
- func (s *IPSet) AddPrefix(setName string, prefix netip.Prefix, opts ...Option) error
- func (s *IPSet) Close() error
- func (s *IPSet) Create(setName string, opts ...Option) error
- func (s *IPSet) Del(setName, entry string) error
- func (s *IPSet) DelAddr(setName string, ip netip.Addr) error
- func (s *IPSet) DelPrefix(setName string, prefix netip.Prefix) error
- func (s *IPSet) Destroy(setName string) error
- func (s *IPSet) Flush(setName string) error
- type NFTSet
- func (s *NFTSet) Add(entry string, opts ...Option) error
- func (s *NFTSet) AddAddr(ip netip.Addr, opts ...Option) error
- func (s *NFTSet) AddPrefix(prefix netip.Prefix, opts ...Option) error
- func (s *NFTSet) Close() error
- func (s *NFTSet) Create(opts ...Option) error
- func (s *NFTSet) Del(entry string) error
- func (s *NFTSet) DelAddr(ip netip.Addr) error
- func (s *NFTSet) DelPrefix(prefix netip.Prefix) error
- func (s *NFTSet) Destroy() error
- func (s *NFTSet) Flush() error
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupported is returned on platforms without netfilter netlink support. ErrUnsupported = netlink.ErrUnsupported // ErrNotInitialized is returned by package-level ipset helpers before Init. ErrNotInitialized = errors.New("netset: ipset client is not initialized") )
Functions ¶
Types ¶
type IPSet ¶
type IPSet struct {
// contains filtered or unexported fields
}
IPSet manages kernel ipset sets through netlink.
type NFTSet ¶
type NFTSet struct {
// contains filtered or unexported fields
}
NFTSet manages one nftables set in a table.
type Option ¶
type Option func(*Options)
Option configures ipset and nftables set operations.
func OptExcl ¶
func OptExcl() Option
OptExcl asks the kernel to fail if an added element already exists.
func OptInterval ¶
func OptInterval() Option
OptInterval creates an nftables interval set and allows CIDR/range elements.
func OptTimeout ¶
OptTimeout sets timeout in seconds where the backend supports it.
Click to show internal directories.
Click to hide internal directories.