Documentation ¶
Index ¶
- Variables
- func Add(setname string, entry *GoIPSetEntry) error
- func Create(setname, typename string, options GoIpsetCreateOptions) error
- func Del(setname string, entry *GoIPSetEntry) error
- func Destroy(setname string) error
- func Flush(setname string) error
- func Protocol() (uint8, error)
- type GoIPSetEntry
- type GoIPSetResult
- type GoIpset
- func (g *GoIpset) Add(setname string, entry *GoIPSetEntry) error
- func (g *GoIpset) Create(setname, typename string, options GoIpsetCreateOptions) error
- func (g *GoIpset) Del(setname string, entry *GoIPSetEntry) error
- func (g *GoIpset) Destroy(setname string) error
- func (g *GoIpset) Flush(setname string) error
- func (g *GoIpset) List(name string) (GoIPSetResult, error)
- func (g *GoIpset) ListAll() ([]GoIPSetResult, error)
- func (g *GoIpset) Protocol() (uint8, error)
- type GoIpsetCreateOptions
- type Set
- type SetIP
- type SetIPPort
- type SetMac
- type SetNet
- type SetNetPort
- type SetResult
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
Debug set debug mod. print msg of netlink connection.
Functions ¶
func Add ¶
func Add(setname string, entry *GoIPSetEntry) error
Add adds an entry to an existing ipset.
func Create ¶
func Create(setname, typename string, options GoIpsetCreateOptions) error
Create creates a new ipset
func Del ¶
func Del(setname string, entry *GoIPSetEntry) error
Del deletes an entry from an existing ipset.
Types ¶
type GoIPSetEntry ¶
type GoIPSetEntry struct { Comment string Set Timeout uint32 Packets uint64 Bytes uint64 Replace bool // replace existing entry }
GoIPSetEntry is used for adding, updating, retreiving and deleting entries
type GoIPSetResult ¶
type GoIPSetResult struct { Nfgenmsg *nl.Nfgenmsg Protocol uint8 Revision uint8 Family uint8 Flags uint8 ProtoMin uint8 SetName string TypeName string HashSize uint32 NumEntries uint32 MaxElements uint32 References uint32 SizeInMemory uint32 CadtFlags uint32 Timeout uint32 Entries []GoIPSetEntry }
GoIPSetResult is the result of a dump request for a set
type GoIpset ¶
type GoIpset struct {
// contains filtered or unexported fields
}
GoIpset using save sockets...
func NewGoIpset ¶
func NewGoIpset() *GoIpset
func (*GoIpset) Add ¶
func (g *GoIpset) Add(setname string, entry *GoIPSetEntry) error
Add adds an entry to an existing ipset.
func (*GoIpset) Create ¶
func (g *GoIpset) Create(setname, typename string, options GoIpsetCreateOptions) error
func (*GoIpset) Del ¶
func (g *GoIpset) Del(setname string, entry *GoIPSetEntry) error
Del deletes an entry from an existing ipset.
func (*GoIpset) ListAll ¶
func (g *GoIpset) ListAll() ([]GoIPSetResult, error)
type GoIpsetCreateOptions ¶
type GoIpsetCreateOptions struct { Replace bool // replace existing ipset Timeout uint32 Counters bool Comments bool Skbinfo bool Family int }
GoIpsetCreateOptions is the options struct for creating a new ipset
type SetIPPort ¶
SetIPPort support ip,port format ip,port:
entry type: ip,<proto:>port ip type:x.x.x.x or x.x.x.x-x.x.x.x or ipv6 port type: xx or xx-xx proto type: udp or tcp or null
ip type not support ipv6 range
Click to show internal directories.
Click to hide internal directories.