Feature: flush fakeip pool
This commit is contained in:
@@ -18,6 +18,7 @@ type store interface {
|
||||
DelByIP(ip net.IP)
|
||||
Exist(ip net.IP) bool
|
||||
CloneTo(store)
|
||||
FlushFakeIP() error
|
||||
}
|
||||
|
||||
// Pool is a implementation about fake ip generator without storage
|
||||
@@ -120,6 +121,10 @@ func (p *Pool) get(host string) net.IP {
|
||||
return ip
|
||||
}
|
||||
|
||||
func (p *Pool) FlushFakeIP() error {
|
||||
return p.store.FlushFakeIP()
|
||||
}
|
||||
|
||||
func ipToUint(ip net.IP) uint32 {
|
||||
v := uint32(ip[0]) << 24
|
||||
v += uint32(ip[1]) << 16
|
||||
|
||||
Reference in New Issue
Block a user