Feature: add source ipcidr condition for all rules
This commit is contained in:
@ -15,7 +15,7 @@ type GEOIP struct {
|
||||
country string
|
||||
adapter string
|
||||
noResolveIP bool
|
||||
network C.NetWork
|
||||
ruleExtra *C.RuleExtra
|
||||
geoIPMatcher *router.GeoIPMatcher
|
||||
}
|
||||
|
||||
@ -43,11 +43,11 @@ func (g *GEOIP) ShouldResolveIP() bool {
|
||||
return !g.noResolveIP
|
||||
}
|
||||
|
||||
func (g *GEOIP) NetWork() C.NetWork {
|
||||
return g.network
|
||||
func (g *GEOIP) RuleExtra() *C.RuleExtra {
|
||||
return g.ruleExtra
|
||||
}
|
||||
|
||||
func NewGEOIP(country string, adapter string, noResolveIP bool, network C.NetWork) (*GEOIP, error) {
|
||||
func NewGEOIP(country string, adapter string, noResolveIP bool, ruleExtra *C.RuleExtra) (*GEOIP, error) {
|
||||
geoLoaderName := "standard"
|
||||
//geoLoaderName := "memconservative"
|
||||
geoLoader, err := geodata.GetGeoDataLoader(geoLoaderName)
|
||||
@ -78,7 +78,7 @@ func NewGEOIP(country string, adapter string, noResolveIP bool, network C.NetWor
|
||||
country: country,
|
||||
adapter: adapter,
|
||||
noResolveIP: noResolveIP,
|
||||
network: network,
|
||||
ruleExtra: ruleExtra,
|
||||
geoIPMatcher: geoIPMatcher,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user