github.com/igoogolx/clash@v1.19.8/component/ipset/ipset_linux.go (about) 1 //go:build linux 2 3 package ipset 4 5 import ( 6 "net" 7 8 "github.com/vishvananda/netlink" 9 ) 10 11 // Test whether the ip is in the set or not 12 func Test(setName string, ip net.IP) (bool, error) { 13 return netlink.IpsetTest(setName, &netlink.IPSetEntry{ 14 IP: ip, 15 }) 16 } 17 18 // Verify dumps a specific ipset to check if we can use the set normally 19 func Verify(setName string) error { 20 _, err := netlink.IpsetList(setName) 21 return err 22 }