|
|
@ -37,6 +37,7 @@ type configData struct { |
|
|
|
stats bool // stats cmdline option
|
|
|
|
stats bool // stats cmdline option
|
|
|
|
seeders map[string]*dnsseeder // holds a pointer to all the current seeders
|
|
|
|
seeders map[string]*dnsseeder // holds a pointer to all the current seeders
|
|
|
|
smtx sync.RWMutex // protect the seeders map
|
|
|
|
smtx sync.RWMutex // protect the seeders map
|
|
|
|
|
|
|
|
order []string // the order of loading the netfiles so we can display in this order
|
|
|
|
dns map[string][]dns.RR // holds details of all the currently served dns records
|
|
|
|
dns map[string][]dns.RR // holds details of all the currently served dns records
|
|
|
|
dnsmtx sync.RWMutex // protect the dns map
|
|
|
|
dnsmtx sync.RWMutex // protect the dns map
|
|
|
|
dnsUnknown uint64 // the number of dns requests for we are not configured to handle
|
|
|
|
dnsUnknown uint64 // the number of dns requests for we are not configured to handle
|
|
|
@ -77,6 +78,7 @@ func main() { |
|
|
|
|
|
|
|
|
|
|
|
config.seeders = make(map[string]*dnsseeder) |
|
|
|
config.seeders = make(map[string]*dnsseeder) |
|
|
|
config.dns = make(map[string][]dns.RR) |
|
|
|
config.dns = make(map[string][]dns.RR) |
|
|
|
|
|
|
|
config.order = []string{} |
|
|
|
|
|
|
|
|
|
|
|
for _, nwFile := range netwFiles { |
|
|
|
for _, nwFile := range netwFiles { |
|
|
|
nnw, err := loadNetwork(nwFile) |
|
|
|
nnw, err := loadNetwork(nwFile) |
|
|
@ -87,6 +89,7 @@ func main() { |
|
|
|
if nnw != nil { |
|
|
|
if nnw != nil { |
|
|
|
// FIXME - lock this
|
|
|
|
// FIXME - lock this
|
|
|
|
config.seeders[nnw.name] = nnw |
|
|
|
config.seeders[nnw.name] = nnw |
|
|
|
|
|
|
|
config.order = append(config.order, nnw.name) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -214,15 +217,6 @@ func updateDNSCounts(name, qtype string) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func getSeederByName(name string) *dnsseeder { |
|
|
|
|
|
|
|
for _, s := range config.seeders { |
|
|
|
|
|
|
|
if s.name == name { |
|
|
|
|
|
|
|
return s |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|