nadoo / ipset Goto Github PK
View Code? Open in Web Editor NEWnetlink ipset package for Go(Golang).
License: GNU General Public License v3.0
netlink ipset package for Go(Golang).
License: GNU General Public License v3.0
ipset/internal/netlink/netlink.go
Line 123 in 08468a7
if the setName has exist in the kernel before,
I don't know this line?
or check it 1st:
if exist
then destroy; Create...
else flush?
老哥,这个库咋用,是否有详细教程,能否增加http api 操作?
谢谢老哥,我是个小白,有时间的话,能否接个二开的单,也是golang操作ipset的
it is useful.
err := ipset.Init()
if err != nil {
panic(err)
}
err = ipset.Create("scanner-ip-set")
if err != nil {
panic(err)
}
$ ipset --version
ipset v7.15, protocol version: 7
$ uname -r
5.15.0-46-generic
$ go build -o test .
# not panic without capabilities
$ ./test
# create the set
$ sudo ipset create scanner-ip-set hash:ip
# create the set again via cli
$ sudo ipset create scanner-ip-set hash:ip
ipset v7.15: Set cannot be created: set with the same name already exists
# not panic
$ sudo ./test
Any idea about this?
Thank you!
For example, creating a newSet
with different timeout and then swapping the IPs from "oldSet" to "newSet"
Currently ,it's service for https://github.com/nadoo/glider ,lack of some IPSET_CMD necessary as a full featured golang ipset library
eg lack of:
IPSET_CMD_RENAME
IPSET_CMD_LIST
IPSET_CMD_TEST
IPSET_CMD_TYPE
....
and lack of IPv6 set support
lack of comment and ttl (timeout) support ,any plan to make the first full featured pure golang ipset library
Do there have any plan to add optional timeout parameter? I think it will be useful on dispatching by dns.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.