-
Notifications
You must be signed in to change notification settings - Fork 1
/
structs.go
95 lines (84 loc) · 2.35 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Copyright (c) 2024 Johan Stenstam, johan.stenstam@internetstiftelsen.se
*/
package main
import (
"log"
"sync"
"time"
"github.com/dnstapir/tapir"
"github.com/miekg/dns"
)
type PopData struct {
mu sync.RWMutex
Lists map[string]map[string]*tapir.WBGlist
RpzRefreshCh chan RpzRefresh
RpzCommandCh chan RpzCmdData
TapirMqttEngineRunning bool
TapirMqttCmdCh chan tapir.MqttEngineCmd
// TapirMqttSubCh chan tapir.MqttPkg
TapirObservations chan tapir.MqttPkgIn
TapirMqttPubCh chan tapir.MqttPkgOut
ComponentStatusCh chan tapir.ComponentStatusUpdate
Logger *log.Logger
MqttLogger *log.Logger
BlacklistedNames map[string]bool
GreylistedNames map[string]*tapir.TapirName
Policy PopPolicy
Rpz RpzData
RpzSources map[string]*tapir.ZoneData
Downstreams map[string]RpzDownstream // map[ipaddr]RpzDownstream
DownstreamSerials map[string]uint32 // New map to track SOA serials by address
ReaperInterval time.Duration
MqttEngine *tapir.MqttEngine
Verbose bool
Debug bool
}
type RpzDownstream struct {
Address string
Port int
// Serial uint32 // The serial that the downstream says that it already has in the latest IXFR request
// Downstreams []string
}
type RpzData struct {
CurrentSerial uint32
ZoneName string
Axfr RpzAxfr
IxfrChain []RpzIxfr // NOTE: the IxfrChain is in reverse order, newest first!
// RpzZone *tapir.ZoneData
// RpzMap map[string]*tapir.RpzName
}
type RpzIxfr struct {
FromSerial uint32
ToSerial uint32
Removed []*tapir.RpzName
Added []*tapir.RpzName
}
type RpzAxfr struct {
Serial uint32
SOA dns.SOA
NSrrs []dns.RR
Data map[string]*tapir.RpzName
ZoneData *tapir.ZoneData
}
type PopPolicy struct {
Logger *log.Logger
WhitelistAction tapir.Action
BlacklistAction tapir.Action
Greylist GreylistPolicy
}
type GreylistPolicy struct {
NumSources int
NumSourcesAction tapir.Action
NumTapirTags int
NumTapirTagsAction tapir.Action
BlackTapirTags tapir.TagMask
BlackTapirAction tapir.Action
}
// type WBGC map[string]*tapir.WBGlist
type SrcFoo struct {
Src struct {
Style string `yaml:"style"`
} `yaml:"src"`
Sources map[string]SourceConf `yaml:"sources"`
}