ipset

package
v0.107.46 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package ipset provides ipset functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	Add(host string, ip4s, ip6s []net.IP) (n int, err error)
	Close() (err error)
}

Manager is the ipset manager interface.

TODO(a.garipov): Perhaps generalize this into some kind of a NetFilter type, since ipset is exclusive to Linux?

func NewManager

func NewManager(ipsetConf []string) (mgr Manager, err error)

NewManager returns a new ipset manager. IPv4 addresses are added to an ipset with an ipv4 family; IPv6 addresses, to an ipv6 ipset. ipset must exist.

The syntax of the ipsetConf is:

DOMAIN[,DOMAIN].../IPSET_NAME[,IPSET_NAME]...

If ipsetConf is empty, msg and err are nil. The error is of type *aghos.UnsupportedError if the OS is not supported.

Jump to

Keyboard shortcuts

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