ASN database, part 2 (#67)

ASN lookup
This commit is contained in:
Niklas
2019-07-05 15:01:45 +02:00
committed by Martin Polden
parent 5a28ed6bf5
commit 7fbc2e1b9f
9 changed files with 86 additions and 11 deletions

View File

@ -16,6 +16,7 @@ func main() {
var opts struct {
CountryDBPath string `short:"f" long:"country-db" description:"Path to GeoIP country database" value-name:"FILE" default:""`
CityDBPath string `short:"c" long:"city-db" description:"Path to GeoIP city database" value-name:"FILE" default:""`
ASNDBPath string `short:"a" long:"asn-db" description:"Path to GeoIP ASN database" value-name:"FILE" default:""`
Listen string `short:"l" long:"listen" description:"Listening address" value-name:"ADDR" default:":8080"`
ReverseLookup bool `short:"r" long:"reverse-lookup" description:"Perform reverse hostname lookups"`
PortLookup bool `short:"p" long:"port-lookup" description:"Enable port lookup"`
@ -28,7 +29,7 @@ func main() {
}
log := log.New(os.Stderr, "echoip: ", 0)
r, err := geo.Open(opts.CountryDBPath, opts.CityDBPath)
r, err := geo.Open(opts.CountryDBPath, opts.CityDBPath, opts.ASNDBPath)
if err != nil {
log.Fatal(err)
}