Capitalize

This commit is contained in:
Frank Denis 2020-06-19 11:37:53 +02:00
parent c8d099735b
commit 03746b76bf
3 changed files with 16 additions and 16 deletions

View File

@ -16,22 +16,22 @@ var (
rfc7050WKA2 = net.IPv4(192, 0, 0, 171)
)
type PluginDns64 struct {
type PluginDNS64 struct {
pref64Mutex *sync.RWMutex
pref64 []*net.IPNet
dns64Resolvers []string
ipv4Resolver string
}
func (plugin *PluginDns64) Name() string {
func (plugin *PluginDNS64) Name() string {
return "dns64"
}
func (plugin *PluginDns64) Description() string {
func (plugin *PluginDNS64) Description() string {
return "Synth DNS64 AAAA responses"
}
func (plugin *PluginDns64) Init(proxy *Proxy) error {
func (plugin *PluginDNS64) Init(proxy *Proxy) error {
plugin.ipv4Resolver = proxy.listenAddresses[0] //recursively to ourselves
plugin.pref64Mutex = new(sync.RWMutex)
@ -56,15 +56,15 @@ func (plugin *PluginDns64) Init(proxy *Proxy) error {
return nil
}
func (plugin *PluginDns64) Drop() error {
func (plugin *PluginDNS64) Drop() error {
return nil
}
func (plugin *PluginDns64) Reload() error {
func (plugin *PluginDNS64) Reload() error {
return nil
}
func (plugin *PluginDns64) Eval(pluginsState *PluginsState, msg *dns.Msg) error {
func (plugin *PluginDNS64) Eval(pluginsState *PluginsState, msg *dns.Msg) error {
if !hasAAAAQuestion(msg) || hasAAAAAnswer(msg) {
return nil
}
@ -166,7 +166,7 @@ func translateToIPv6(ipv4 net.IP, prefix *net.IPNet) net.IP {
return ipv6
}
func (plugin *PluginDns64) fetchPref64(resolver string) error {
func (plugin *PluginDNS64) fetchPref64(resolver string) error {
msg := new(dns.Msg)
msg.SetQuestion(rfc7050WKN, dns.TypeAAAA)
@ -227,7 +227,7 @@ func (plugin *PluginDns64) fetchPref64(resolver string) error {
return nil
}
func (plugin *PluginDns64) refreshPref64() error {
func (plugin *PluginDNS64) refreshPref64() error {
for _, resolver := range plugin.dns64Resolvers {
if err := plugin.fetchPref64(resolver); err == nil {
break

View File

@ -136,7 +136,7 @@ func (proxy *Proxy) InitPluginsGlobals() error {
*responsePlugins = append(*responsePlugins, Plugin(new(PluginBlockIP)))
}
if len(proxy.dns64Resolvers) != 0 || len(proxy.dns64Prefixes) != 0 {
*responsePlugins = append(*responsePlugins, Plugin(new(PluginDns64)))
*responsePlugins = append(*responsePlugins, Plugin(new(PluginDNS64)))
}
if proxy.cache {
*responsePlugins = append(*responsePlugins, Plugin(new(PluginCacheResponse)))

View File

@ -87,11 +87,11 @@ type Proxy struct {
dns64Resolvers []string
}
func (proxy *Proxy) registerUdpListener(conn *net.UDPConn) {
func (proxy *Proxy) registerUDPListener(conn *net.UDPConn) {
proxy.udpListeners = append(proxy.udpListeners, conn)
}
func (proxy *Proxy) registerTcpListener(listener *net.TCPListener) {
func (proxy *Proxy) registerTCPListener(listener *net.TCPListener) {
proxy.tcpListeners = append(proxy.tcpListeners, listener)
}
@ -161,10 +161,10 @@ func (proxy *Proxy) addDNSListener(listenAddrStr string) {
FileDescriptorNum++
dlog.Noticef("Now listening to %v [UDP]", listenUDPAddr)
proxy.registerUdpListener(listenerUDP.(*net.UDPConn))
proxy.registerUDPListener(listenerUDP.(*net.UDPConn))
dlog.Noticef("Now listening to %v [TCP]", listenAddrStr)
proxy.registerTcpListener(listenerTCP.(*net.TCPListener))
proxy.registerTCPListener(listenerTCP.(*net.TCPListener))
}
func (proxy *Proxy) addLocalDoHListener(listenAddrStr string) {
@ -287,7 +287,7 @@ func (proxy *Proxy) udpListenerFromAddr(listenAddr *net.UDPAddr) error {
if err != nil {
return err
}
proxy.registerUdpListener(clientPc)
proxy.registerUDPListener(clientPc)
dlog.Noticef("Now listening to %v [UDP]", listenAddr)
return nil
}
@ -325,7 +325,7 @@ func (proxy *Proxy) tcpListenerFromAddr(listenAddr *net.TCPAddr) error {
if err != nil {
return err
}
proxy.registerTcpListener(acceptPc)
proxy.registerTCPListener(acceptPc)
dlog.Noticef("Now listening to %v [TCP]", listenAddr)
return nil
}