docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
func TestInterfaceByIP(t *testing.T) {
<mask> }) <mask> } <mask> } <mask> <mask> func TestGetInterfaceByIP(t *testing.T) { <mask> ifaces, err := GetValidNetInterfacesForWeb() <mask> require.NoError(t, err) <mask> require.NotEmpty(t, ifaces) <mask> <mask> for _, iface := range ifaces { </s> Pull request: upd-websvc Merge in DNS/adguard-h...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/aghnet/net_test.go
ifaceName := InterfaceByIP(ip)
<mask> t.Run(iface.Name, func(t *testing.T) { <mask> require.NotEmpty(t, iface.Addresses) <mask> <mask> for _, ip := range iface.Addresses { <mask> ifaceName := GetInterfaceByIP(ip) <mask> require.Equal(t, iface.Name, ifaceName) <mask> } <mask> }) <mask> } <mask> } </s> Pull request: u...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/aghnet/net_test.go
interfaceName := aghnet.InterfaceByIP(ip)
<mask> // Or if set=true, it tries to set it <mask> func handleStaticIP(ip net.IP, set bool) staticIPJSON { <mask> resp := staticIPJSON{} <mask> <mask> interfaceName := aghnet.GetInterfaceByIP(ip) <mask> resp.Static = "no" <mask> <mask> if len(interfaceName) == 0 { <mask> resp.Static = "error" <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/home/controlinstall.go
"net/netip"
<mask> import ( <mask> "context" <mask> "io/fs" <mask> "math/rand" <mask> "net" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/v1/websvc" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" </s> Pull request: upd-websvc Merge in DNS/ad...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/cmd/cmd.go
<mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/v1/websvc" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> ) <mask> <mask> // Main is the entry point of application. <mask> func Main(clientBuildFS fs.FS) { <mask> // # Initial Con...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/cmd/cmd.go
Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:3001")}, Start: start, Timeout: 60 * time.Second,
<mask> _ = clientBuildFS <mask> <mask> // TODO(a.garipov): Make configurable. <mask> web := websvc.New(&websvc.Config{ <mask> Addresses: []*netutil.IPPort{{ <mask> IP: net.IP{127, 0, 0, 1}, <mask> Port: 3001, <mask> }}, <mask> Start: start, <mask> Timeout: 60 * time.Second, <mask> }) ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/cmd/cmd.go
"net/netip"
<mask> "net" <mask> "net/http" <mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/v1/agh" <mask> "github.com/AdguardTeam/golibs/errors" </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2d...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc.go
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/v1/agh" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> httptreemux "github.com/dimfeld/httptreemux/v5" <mask> ) <mask> <mask> // Config is the AdGuar...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc.go
Addresses []netip.AddrPort
<mask> // SecureAddresses must not be empty. <mask> TLS *tls.Config <mask> <mask> // Addresses are the addresses on which to serve the plain HTTP API. <mask> Addresses []*netutil.IPPort <mask> <mask> // SecureAddresses are the addresses on which to serve the HTTPS API. If <mask> // SecureAddresses is n...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc.go
SecureAddresses []netip.AddrPort
<mask> Addresses []*netutil.IPPort <mask> <mask> // SecureAddresses are the addresses on which to serve the HTTPS API. If <mask> // SecureAddresses is not empty, TLS must not be nil. <mask> SecureAddresses []*netutil.IPPort <mask> <mask> // Start is the time of start of AdGuard Home. <mask> Start time....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc.go
<mask> <mask> import ( <mask> "context" <mask> "io" <mask> "net" <mask> "net/http" <mask> "net/url" <mask> "testing" <mask> "time" <mask> </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37badd...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc_test.go
"net/netip"
<mask> "io" <mask> "net/http" <mask> "net/url" <mask> "testing" <mask> "time" <mask> </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: T...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc_test.go
<mask> "testing" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/v1/websvc" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/AdguardTeam/golibs/testutil" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc_test.go
TLS: nil, Addresses: []netip.AddrPort{netip.MustParseAddrPort("127.0.0.1:0")},
<mask> func newTestServer(t testing.TB) (svc *websvc.Service, addr string) { <mask> t.Helper() <mask> <mask> c := &websvc.Config{ <mask> TLS: nil, <mask> Addresses: []*netutil.IPPort{{ <mask> IP: net.IP{127, 0, 0, 1}, <mask> Port: 0, <mask> }}, <mask> SecureAddresses: nil, <mask> Timeout...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
internal/v1/websvc/websvc_test.go
'responses': '200': 'description': > An OK response. 'content': 'text/plain': 'example': 'OK'
<mask> '/health-check': <mask> 'get': <mask> 'operationId': 'HealthCheck' <mask> 'servers': <mask> - 'url': '/' <mask> 'summary': 'Check if the server is up.' <mask> 'tags': </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'PatchV1SettingsHttpReq': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpReq' 'required': true
<mask> '$ref': '#/components/schemas/PatchV1SettingsDnsReq' <mask> 'required': true <mask> <mask> 'PatchV1SettingsLogReq': <mask> 'content': <mask> 'application/json': <mask> 'schema': <mask> '$ref': '#/components/schemas/PatchV1SettingsLogReq' <mask> ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'PatchV1SettingsHttpResp': 'content': 'application/json': 'schema': '$ref': '#/components/schemas/PatchV1SettingsHttpResp' 'description': > A successful response to a `PATCH /api/v1/settings/http` request.
<mask> '$ref': '#/components/schemas/PatchV1SettingsDnsResp' <mask> 'description': > <mask> A successful response to a `PATCH /api/v1/settings/dns` request. <mask> <mask> 'PatchV1SettingsLogResp': <mask> 'content': <mask> 'application/json': <mask> 'schema'...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'addresses': - '127.0.0.1:53' - '192.168.1.1:53'
<mask> - '$ref': '#/components/schemas/DnsSettingsPatch' <mask> - 'description': > <mask> DNS server settings. <mask> 'example': <mask> 'blocking_mode': 'default' <mask> 'bootstrap_servers': <mask> - '9.9.9.10' <mask> - '149.112.112.10' </s>...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'upstream_timeout': '1s'
<mask> 'upstream_mode': 'load_balancing' <mask> 'upstream_servers': <mask> - '1.1.1.1' <mask> - '8.8.8.8' <mask> 'required': <mask> - 'addresses' <mask> - 'blocking_mode' <mask> - 'bootstrap_servers' <mask> - 'cache_size' </s> Pul...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
- 'addresses'
<mask> - '8.8.8.8' <mask> 'upstream_timeout': '1s' <mask> 'required': <mask> - 'blocking_mode' <mask> - 'bootstrap_servers' <mask> - 'cache_size' <mask> - 'cache_ttl_max' </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to maste...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
- 'upstream_timeout'
<mask> - 'ipv6' <mask> - 'rate_limit' <mask> - 'upstream_mode' <mask> - 'upstream_servers' <mask> <mask> 'DnsSettingsPatch': <mask> 'description': > <mask> DNS server settings update object. <mask> 'example': <mask> 'cache_size': 4194304 </s> P...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'addresses': 'description': > Addresses on which to serve plain DNS, in ip:port format. Empty array disables plain DNS. 'items': 'type': 'string' 'type': 'array'
<mask> 'cache_size': 4194304 <mask> 'upstream_servers': <mask> - '1.1.1.1' <mask> 'properties': <mask> 'blocking_ipv4': <mask> 'description': > <mask> IPv4 address to respond with when `blocking_mode` is `custom_ip`. <mask> See the document...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'upstream_timeout': 'description': > Upstream request timeout, as a human readable duration. 'type': 'string'
<mask> 'items': <mask> '$ref': '#/components/schemas/UpstreamServerAddr' <mask> 'type': 'array' <mask> 'type': 'object' <mask> <mask> 'DnsType': <mask> 'description': > </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed c...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'http': '$ref': '#/components/schemas/HttpSettings'
<mask> 'dhcp': <mask> '$ref': '#/components/schemas/DhcpSettings' <mask> 'dns': <mask> '$ref': '#/components/schemas/DnsSettings' <mask> 'log': <mask> '$ref': '#/components/schemas/LogSettings' <mask> 'protection': <mask> '$ref': '#/compone...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
- 'http'
<mask> - 'dhcp' <mask> - 'dns' <mask> - 'log' <mask> - 'protection' <mask> - 'stats' <mask> - 'tls' </s> Pull request: upd-websvc Merge in DNS/adguard-home from upd-websvc to master Squashed commit of the following: commit 30d6a2dc5083efd91479bcbe20f03c37baddbf94 Author: Ai...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
'PatchV1SettingsHttpReq': '$ref': '#/components/schemas/HttpSettingsPatch' 'PatchV1SettingsHttpResp': '$ref': '#/components/schemas/HttpSettings'
<mask> <mask> 'PatchV1SettingsDnsResp': <mask> '$ref': '#/components/schemas/DnsSettings' <mask> <mask> 'PatchV1SettingsLogReq': <mask> '$ref': '#/components/schemas/LogSettingsPatch' <mask> <mask> 'PatchV1SettingsLogResp': <mask> '$ref': '#/components/schemas/LogSettings' </s...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
<mask> TLS and encryption settings. <mask> 'example': <mask> 'certificate_path': '/etc/ssl/example.com.cert' <mask> 'enabled': true <mask> 'force_https': true <mask> 'port_dns_over_quic': 784 <mask> 'port_dns_over_tls': 853 <mask> 'po...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
<mask> 'private_key_path': '/etc/ssl/example.com.key' <mask> 'server_name': 'dns.example.com' <mask> 'required': <mask> - 'enabled' <mask> - 'force_https' <mask> - 'port_dns_over_quic' <mask> - 'port_dns_over_tls' <mask> - 'port_https' <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
<mask> If `true`, AdGuard Home the administration interface will be served <mask> over HTTPS, and the DNS server will listen requests over <mask> DNS-over-TLS and other protocols. <mask> 'type': 'boolean' <mask> 'force_https': <mask> 'description': ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/50565bed3b5bcd934781940d398571a4ecb9b593
openapi/v1.yaml
// BroadcastFromIPNet calculates the broadcast IP address for n. func BroadcastFromIPNet(n *net.IPNet) (dc net.IP) { dc = netutil.CloneIP(n.IP) mask := n.Mask if mask == nil { mask = dc.DefaultMask() } for i, b := range mask { dc[i] |= ^b } return dc }
<mask> } <mask> <mask> return addrs, nil <mask> } </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e7ea691824c7ebc8cafd8c9e206679346cbc8592 Author: Eugene Burkov <e.burkov@adguard.com> Date: Thu Aug...
[ "keep", "keep", "keep", "add" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net.go
// getNetworkSetupHardwareReports parses the output of the `networksetup // -listallhardwareports` command it returns a map where the key is the // interface name, and the value is the "hardware port" returns nil if it fails // to parse the output // // TODO(e.burkov): There should be more proper approach than parsing...
<mask> <mask> return getHardwarePortInfo(hardwarePort) <mask> } <mask> <mask> // getNetworkSetupHardwareReports parses the output of the `networksetup -listallhardwareports` command <mask> // it returns a map where the key is the interface name, and the value is the "hardware port" <mask> // returns nil if it...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_darwin.go
//go:build !(linux || darwin || freebsd || openbsd) // +build !linux,!darwin,!freebsd,!openbsd
<mask> //go:build !(linux || darwin || freebsd) <mask> // +build !linux,!darwin,!freebsd <mask> <mask> package aghnet <mask> <mask> import ( <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Close...
[ "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_others.go
"net"
<mask> <mask> import ( <mask> "testing" <mask> <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following: commit e...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_test.go
"github.com/stretchr/testify/assert"
<mask> import ( <mask> "net" <mask> "testing" <mask> <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestGetValidNetInterfacesForWeb(t *testing.T) { <mask> ifaces, err := GetValidNetInterfacesForWeb() </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/aghnet/net_test.go
<mask> "github.com/AdguardTeam/golibs/netutil" <mask> ) <mask> <mask> const ( <mask> defaultDiscoverTime = time.Second * 3 <mask> // leaseExpireStatic is used to define the Expiry field for static <mask> // leases. <mask> // <mask> // TODO(e.burkov): Remove it when static leases determining mechanism <...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/dhcpd.go
<mask> "fmt" <mask> "net" <mask> ) <mask> <mask> func isTimeout(err error) bool { <mask> operr, ok := err.(*net.OpError) <mask> if !ok { <mask> return false <mask> } <mask> return operr.Timeout() <mask> } <mask> <mask> func tryTo4(ip net.IP) (ip4 net.IP, err error) { <mask> if ip == nil { <mas...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/helpers.go
ifaceName := strings.TrimSpace(string(body)) if ifaceName == "" {
<mask> http.Error(w, msg, http.StatusBadRequest) <mask> return <mask> } <mask> <mask> interfaceName := strings.TrimSpace(string(body)) <mask> if interfaceName == "" { <mask> msg := "empty interface name specified" <mask> log.Error(msg) <mask> http.Error(w, msg, http.StatusBadRequest) <mask> re...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
OtherServer: dhcpSearchOtherResult{ Found: "no", },
<mask> } <mask> <mask> result := dhcpSearchResult{ <mask> V4: dhcpSearchV4Result{ <mask> OtherServer: dhcpSearchOtherResult{}, <mask> StaticIP: dhcpStaticIPStatus{ <mask> Static: "yes", <mask> }, <mask> }, <mask> V6: dhcpSearchV6Result{ </s> Pull request: 3225 bsd dhcp Merge in DNS/adg...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
OtherServer: dhcpSearchOtherResult{ Found: "no", },
<mask> Static: "yes", <mask> }, <mask> }, <mask> V6: dhcpSearchV6Result{ <mask> OtherServer: dhcpSearchOtherResult{}, <mask> }, <mask> } <mask> <mask> found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) <mask> </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 32...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
if isStaticIP, serr := aghnet.IfaceHasStaticIP(ifaceName); serr != nil {
<mask> OtherServer: dhcpSearchOtherResult{}, <mask> }, <mask> } <mask> <mask> found4, err4 := CheckIfOtherDHCPServersPresentV4(interfaceName) <mask> <mask> isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) <mask> if err != nil { <mask> result.V4.StaticIP.Static = "error" <mask> result.V...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
result.V4.StaticIP.Error = serr.Error()
<mask> <mask> isStaticIP, err := aghnet.IfaceHasStaticIP(interfaceName) <mask> if err != nil { <mask> result.V4.StaticIP.Static = "error" <mask> result.V4.StaticIP.Error = err.Error() <mask> } else if !isStaticIP { <mask> result.V4.StaticIP.Static = "no" <mask> result.V4.StaticIP.IP = aghnet.GetSubn...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
// TODO(e.burkov): The returned IP should only be of version 4. result.V4.StaticIP.IP = aghnet.GetSubnet(ifaceName).String()
<mask> result.V4.StaticIP.Static = "error" <mask> result.V4.StaticIP.Error = err.Error() <mask> } else if !isStaticIP { <mask> result.V4.StaticIP.Static = "no" <mask> result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() <mask> } <mask> <mask> if found4 { <mask> result.V4.OtherServer.F...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
found4, found6, err4, err6 := aghnet.CheckOtherDHCP(ifaceName) if err4 != nil {
<mask> result.V4.StaticIP.Static = "no" <mask> result.V4.StaticIP.IP = aghnet.GetSubnet(interfaceName).String() <mask> } <mask> <mask> if found4 { <mask> result.V4.OtherServer.Found = "yes" <mask> } else if err4 != nil { <mask> result.V4.OtherServer.Found = "error" <mask> result.V4.OtherServer.Er...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
} else if found4 { result.V4.OtherServer.Found = "yes"
<mask> result.V4.OtherServer.Found = "error" <mask> result.V4.OtherServer.Error = err4.Error() <mask> } <mask> if err6 != nil { <mask> result.V6.OtherServer.Found = "error" <mask> result.V6.OtherServer.Error = err6.Error() </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp t...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
if err6 != nil {
<mask> } else if err4 != nil { <mask> result.V4.OtherServer.Found = "error" <mask> result.V4.OtherServer.Error = err4.Error() <mask> } <mask> <mask> found6, err6 := CheckIfOtherDHCPServersPresentV6(interfaceName) <mask> <mask> if found6 { <mask> result.V6.OtherServer.Found = "yes" <mask> } else i...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
} else if found6 { result.V6.OtherServer.Found = "yes"
<mask> if err6 != nil { <mask> result.V6.OtherServer.Found = "error" <mask> result.V6.OtherServer.Error = err6.Error() <mask> } <mask> <mask> w.Header().Set("Content-Type", "application/json") <mask> err = json.NewEncoder(w).Encode(result) <mask> if err != nil { <mask> httpError(r, w, http.StatusIn...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/http.go
dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion4, defaultMaxAttempts, defaultBackoff, )
<mask> } <mask> <mask> log.Debug("dhcpv4: starting...") <mask> <mask> dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion4, defaultMaxAttempts, defaultBackoff) <mask> if err != nil { <mask> return fmt.Errorf("interface %s: %w", ifaceName, err) <mask> } <mask> <mask> if len(dnsIPAddrs) == 0 { </s> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v4.go
s.conf.broadcastIP = aghnet.BroadcastFromIPNet(s.conf.subnet)
<mask> s.conf.subnet = &net.IPNet{ <mask> IP: routerIP, <mask> Mask: subnetMask, <mask> } <mask> <mask> bcastIP := netutil.CloneIP(routerIP) <mask> for i, b := range subnetMask { <mask> bcastIP[i] |= ^b <mask> } <mask> s.conf.broadcastIP = bcastIP <mask> <mask> s.conf.ipRange, err = newIPRa...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v4.go
<mask> package dhcpd <mask> <mask> import ( <mask> "fmt" <mask> "net" <mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> </s> Pull request: 3225 bsd dhcp Merge in DNS/adguard-home from 3225-bsd-dhcp to master Closes #3225. Closes #3417. Squashed commit of the following:...
[ "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v46.go
<mask> import ( <mask> "fmt" <mask> "net" <mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // ipVersion is a documentational alias for int. Use it when the integer means <mask> // IP version. <mask> type ipVersion = int <mask> <mask> // IP version constants. <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v46.go
<mask> ipVersion4 ipVersion = 4 <mask> ipVersion6 ipVersion = 6 <mask> ) <mask> <mask> // netIface is the interface for network interface methods. <mask> type netIface interface { <mask> Addrs() ([]net.Addr, error) <mask> } <mask> <mask> // ifaceIPAddrs returns the interface's IP addresses. <mask> func ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v46.go
<mask> defaultMaxAttempts int = 10 <mask> <mask> defaultBackoff time.Duration = 500 * time.Millisecond <mask> ) <mask> <mask> // ifaceDNSIPAddrs returns IP addresses of the interface suitable to send to <mask> // clients as DNS addresses. If err is nil, addrs contains either no addresses <mask> // or at le...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v46.go
"github.com/AdguardTeam/AdGuardHome/internal/aghnet"
<mask> "time" <mask> <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/insomniacslk/dhcp/dhcpv6" <mask> "github.com/insomniacslk/dhcp/dhcpv6/server6" </s> Pull request: 3225 bsd dhcp Merge in DNS/adg...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v6.go
dnsIPAddrs, err := aghnet.IfaceDNSIPAddrs( iface, aghnet.IPVersion6, defaultMaxAttempts, defaultBackoff, )
<mask> } <mask> <mask> log.Debug("dhcpv6: starting...") <mask> <mask> dnsIPAddrs, err := ifaceDNSIPAddrs(iface, ipVersion6, defaultMaxAttempts, defaultBackoff) <mask> if err != nil { <mask> return fmt.Errorf("interface %s: %w", ifaceName, err) <mask> } <mask> <mask> if len(dnsIPAddrs) == 0 { </s> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/506b459842d47e1536548fb10441aef1e534bf14
internal/dhcpd/v6.go
"dhcp_reset_leases": "Reset all leases", "dhcp_reset_leases_confirm": "Are you sure you want to reset all leases?", "dhcp_reset_leases_success": "DHCP leases successfully reset",
<mask> "dhcp_new_static_lease": "New static lease", <mask> "dhcp_static_leases_not_found": "No DHCP static leases found", <mask> "dhcp_add_static_lease": "Add static lease", <mask> "dhcp_reset": "Are you sure you want to reset the DHCP configuration?", <mask> "country": "Country", <mask> "...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/__locales/en.json
export const resetDhcpLeasesRequest = createAction('RESET_DHCP_LEASES_REQUEST'); export const resetDhcpLeasesSuccess = createAction('RESET_DHCP_LEASES_SUCCESS'); export const resetDhcpLeasesFailure = createAction('RESET_DHCP_LEASES_FAILURE'); export const resetDhcpLeases = () => async (dispatch) => { dispatch(rese...
<mask> dispatch(resetDhcpFailure()); <mask> } <mask> }; <mask> <mask> export const toggleLeaseModal = createAction('TOGGLE_LEASE_MODAL'); <mask> <mask> export const addStaticLeaseRequest = createAction('ADD_STATIC_LEASE_REQUEST'); <mask> export const addStaticLeaseFailure = createAction('ADD_STATI...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/actions/index.js
DHCP_LEASES_RESET = { path: 'dhcp/reset_leases', method: 'POST' };
<mask> <mask> DHCP_RESET = { path: 'dhcp/reset', method: 'POST' }; <mask> <mask> getDhcpStatus() { <mask> const { path, method } = this.DHCP_STATUS; <mask> return this.makeRequest(path, method); <mask> } <mask> </s> Pull request: client: add reset leases btn Updates #1691. Squa...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/api/Api.js
resetDhcpLeases() { const { path, method } = this.DHCP_LEASES_RESET; return this.makeRequest(path, method); }
<mask> } <mask> <mask> // Installation <mask> INSTALL_GET_ADDRESSES = { path: 'install/get_addresses', method: 'GET' }; <mask> <mask> INSTALL_CONFIGURE = { path: 'install/configure', method: 'POST' }; <mask> <mask> INSTALL_CHECK_CONFIG = { path: 'install/check_config', method: 'POST' }; ...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/api/Api.js
resetDhcpLeases,
<mask> getDhcpStatus, <mask> resetDhcp, <mask> setDhcpConfig, <mask> toggleDhcp, <mask> toggleLeaseModal, <mask> } from '../../../actions'; <mask> import FormDHCPv4 from './FormDHCPv4'; </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
const handleReset = () => { if (window.confirm(t('dhcp_reset_leases_confirm'))) { dispatch(resetDhcpLeases()); } };
<mask> }; <mask> <mask> const enteredSomeV4Value = Object.values(v4) <mask> .some(Boolean); <mask> const enteredSomeV6Value = Object.values(v6) <mask> .some(Boolean); </s> Pull request: client: add reset leases btn Updates #1691. Squashed commit of the following: commit 2c48fb956a...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
type="button" className={statusButtonClass} onClick={onClick} disabled={enabled || !interface_name || processingConfig}
<mask> return <> <mask> <PageTitle title={t('dhcp_settings')} subtitle={t('dhcp_description')} containerClass="page-title--dhcp"> <mask> {toggleDhcpButton} <mask> <button <mask> type="button" <mask> className={statusButtonClass} <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
type="button" className='btn btn-sm btn-outline-secondary' disabled={!enteredSomeValue || processingConfig} onClick={clear}
<mask> > <mask> <Trans>check_dhcp_servers</Trans> <mask> </button> <mask> <button <mask> type="button" <mask> className='btn btn-sm btn-outline-secondary' <mask> disabled={!enteredSomeValue || processi...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
<div className="btn-list mt-2"> <button type="button" className="btn btn-success btn-standard mt-3" onClick={toggleModal} disabled={disabled...
<mask> processingAdding={processingAdding} <mask> processingDeleting={processingDeleting} <mask> cidr={cidr} <mask> /> <mask> </div> <mask> <div className="col-12"> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/components/Settings/Dhcp/index.js
[actions.resetDhcpLeasesSuccess]: (state) => ({ ...state, leases: [], staticLeases: [], }),
<mask> v6: {}, <mask> interface_name: '', <mask> }), <mask> <mask> [actions.toggleLeaseModal]: (state) => { <mask> const newState = { <mask> ...state, <mask> isModalOpen: !state.isModalOpen, <mask> }; </s> Pull re...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5104b79cf6c183c7e40e9a9f9fb9de6d8b68ac13
client/src/reducers/dhcp.js
github.com/digineo/go-ipset/v2 v2.2.1
<mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/ameshkov/dnscrypt/v2 v2.0.1 <mask> github.com/fsnotify/fsnotify v1.4.9 <mask> github.com/go-ping/ping v0.0.0-20201115131931-3300c582a663 <mask> github.com/gobuffalo/envy v1.9.0 // indirect <mask> github.com/gobuffalo/packr v1.30.1 <mask> githu...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.mod
github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be
<mask> github.com/kardianos/service v1.2.0 <mask> github.com/karrick/godirwalk v1.16.1 // indirect <mask> github.com/lucas-clemente/quic-go v0.19.3 <mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 <mask> github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 <mask> github.com/miekg...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.mod
github.com/ti-mo/netfilter v0.4.0
<mask> github.com/sirupsen/logrus v1.7.0 // indirect <mask> github.com/spf13/cobra v1.1.1 // indirect <mask> github.com/stretchr/testify v1.6.1 <mask> github.com/u-root/u-root v7.0.0+incompatible <mask> go.etcd.io/bbolt v1.3.5 <mask> golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 <mask> golang.org...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.mod
github.com/digineo/go-ipset/v2 v2.2.1 h1:k6skY+0fMqeUjjeWO/m5OuWPSZUAn7AucHMnQ1MX77g= github.com/digineo/go-ipset/v2 v2.2.1/go.mod h1:wBsNzJlZlABHUITkesrggFnZQtgW5wkqw1uo8Qxe0VU=
<mask> github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= <mask> github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= <mask> github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
github.com/jsimonetti/rtnetlink v0.0.0-20201110080708-d2c240429e6c h1:7cpGGTQO6+OuYQWkueqeXuErSjs1NZtpALpv1x7Mq4g=
<mask> github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ= <mask> github.com/jsimonetti/rtnetlink v0.0.0-20201009170750-9c6f07d100c1/go.mod h1:hqoO/u39cqLeBLebZ8fWdE96O7FxrAsRYhnVOdgHxok= <mask> github.com/jsimonetti/rtnetlink v0.0.0-2020111008070...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA=
<mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 h1:lez6TS6aAau+8wXUP3G9I3TGlmPFEq2CTxBaRqY6AGE= <mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7/go.mod h1:U6ZQobyTjI/tJyq2HG+i/dfSoFUt8/aZCM+GKtmFk/Y= <mask> github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8=
<mask> github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= <mask> github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M= <mask> github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be h1:7JeFwhE5SIdgKRd0qnqjOYJxY8AML8x/j+/qvFZ8R+c= github.com/mdlayher/netlink v1.1.2-0.20201013204415-ded538f7f4be/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o=
<mask> github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY= <mask> github.com/mdlayher/netlink v1.1.1 h1:VqG+Voq9V4uZ+04vjIrcSCWDpf91B1xxbP4QBUmUJE8= <mask> github.com/mdlayher/netlink v1.1.1/go.mod h1:WTYpFb/WTvlRJAyKhZL5/uy69TDDpHHu2VZmb2XgV7o= <mask> github.com/mdlayher/raw v...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
github.com/ti-mo/netfilter v0.2.0/go.mod h1:8GbBGsY/8fxtyIdfwy29JiluNcPK4K7wIT+x42ipqUU= github.com/ti-mo/netfilter v0.4.0 h1:rTN1nBYULDmMfDeBHZpKuNKX/bWEXQUhe02a/10orzg= github.com/ti-mo/netfilter v0.4.0/go.mod h1:V54q75mUx8CNA2JnFl+wv9iZ5+JP9nCcRlaFS5OZSRM=
<mask> github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= <mask> github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= <mask> github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= <mask> github.com/tarm/serial v0....
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
golang.org/x/net v0.0.0-20201016165138-7b1cca2348c0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
<mask> golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= <mask> golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= <mask> golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTt...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpK...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
golang.org/x/sys v0.0.0-20201017003518-b09fb700fbb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpK...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
go.sum
err := s.ipset.Close() if err != nil { log.Error("closing ipset: %s", err) }
<mask> s.stats = nil <mask> s.queryLog = nil <mask> s.dnsProxy = nil <mask> s.Unlock() <mask> } <mask> <mask> // WriteDiskConfig - write configuration <mask> func (s *Server) WriteDiskConfig(c *FilteringConfig) { </s> Pull request: 2179 ipset subdomains Merge in DNS/adguard-home from 2179-ipset-subdomain...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
internal/dnsforward/dnsforward.go
err := s.ipset.init(s.conf.IPSETList) if err != nil { return err }
<mask> s.initDefaultSettings() <mask> <mask> // Initialize IPSET configuration <mask> // -- <mask> s.ipset.init(s.conf.IPSETList) <mask> <mask> // Prepare DNS servers settings <mask> // -- <mask> err := s.prepareUpstreamSettings() <mask> if err != nil { </s> Pull request: 2179 ipset subdomains Mer...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
internal/dnsforward/dnsforward.go
err = s.prepareUpstreamSettings()
<mask> s.ipset.init(s.conf.IPSETList) <mask> <mask> // Prepare DNS servers settings <mask> // -- <mask> err := s.prepareUpstreamSettings() <mask> if err != nil { <mask> return err <mask> } <mask> <mask> // Create DNS proxy configuration </s> Pull request: 2179 ipset subdomains Merge in DNS/adguar...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/510573a904e0fd184d6a2ccedf9ebe7b7ed81465
internal/dnsforward/dnsforward.go
// ipRange is an inclusive range of IP addresses. A nil range is a range that // doesn't contain any IP addresses.
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr" <mask> ) <mask> <mask> // ipRange is an inclusive range of IP addresses. <mask> // <mask> // It is safe for concurrent use. <mask> // <mask> // TODO(a.garipov): Perhaps create an optimised version with uint32 for <mask> // IPv4 ranges? Or ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
if r == nil { return false }
<mask> <mask> // contains returns true if r contains ip. <mask> func (r *ipRange) contains(ip net.IP) (ok bool) { <mask> ipInt := (&big.Int{}).SetBytes(ip.To16()) <mask> <mask> return r.containsInt(ipInt) <mask> } <mask> <mask> // containsInt returns true if r contains ipInt. For internal use only. </s>...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
// containsInt returns true if r contains ipInt. For internal use only.
<mask> <mask> return r.containsInt(ipInt) <mask> } <mask> <mask> // containsInt returns true if r contains ipInt. <mask> func (r *ipRange) containsInt(ipInt *big.Int) (ok bool) { <mask> return ipInt.Cmp(r.start) >= 0 && ipInt.Cmp(r.end) <= 0 <mask> } <mask> <mask> // ipPredicate is a function that is cal...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
if r == nil { return nil }
<mask> // 16-byte form. <mask> func (r *ipRange) find(p ipPredicate) (ip net.IP) { <mask> ip = make(net.IP, net.IPv6len) <mask> _1 := big.NewInt(1) <mask> for i := (&big.Int{}).Set(r.start); i.Cmp(r.end) <= 0; i.Add(i, _1) { <mask> i.FillBytes(ip) </s> Pull request: dhcpd: fix static leases Updates #2541. ...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
if r == nil { return 0, false }
<mask> <mask> // offset returns the offset of ip from the beginning of r. It returns 0 and <mask> // false if ip is not in r. <mask> func (r *ipRange) offset(ip net.IP) (offset uint, ok bool) { <mask> ip = ip.To16() <mask> ipInt := (&big.Int{}).SetBytes(ip) <mask> if !r.containsInt(ipInt) { <mask> return...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/iprange.go
// defaultHwAddrLen is the default length of a hardware (MAC) address. const defaultHwAddrLen = 6
<mask> } <mask> <mask> // Add the specified IP to the black list for a time period <mask> func (s *v4Server) blocklistLease(l *Lease) { <mask> l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) <mask> l.Hostname = "" <mask> l.Expiry = time.Now().Add(s.conf.leaseTime) <mask> } </s> Pull request: dhcpd: fix...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
func (s *v4Server) blocklistLease(l *Lease) { l.HWAddr = make(net.HardwareAddr, defaultHwAddrLen) l.Hostname = "" l.Expiry = time.Now().Add(s.conf.leaseTime)
<mask> return nil <mask> } <mask> <mask> // Add the specified IP to the black list for a time period <mask> func (s *v4Server) blacklistLease(lease *Lease) { <mask> hw := make(net.HardwareAddr, 6) <mask> lease.HWAddr = hw <mask> lease.Hostname = "" <mask> lease.Expiry = time.Now().Add(s.conf.leaseTime) ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
n := len(s.leases) if i >= n { // TODO(a.garipov): Better error handling. log.Debug("dhcpv4: can't remove lease at index %d: no such lease", i) return }
<mask> <mask> // rmLeaseByIndex removes a lease by its index in the leases slice. <mask> func (s *v4Server) rmLeaseByIndex(i int) { <mask> l := s.leases[i] <mask> s.leases = append(s.leases[:i], s.leases[i+1:]...) <mask> <mask> n = len(s.leases) <mask> if n > 0 { </s> Pull request: dhcpd: fix static leas...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
n = len(s.leases) if n > 0 { s.leases = s.leases[:n-1] }
<mask> l := s.leases[i] <mask> s.leases = append(s.leases[:i], s.leases[i+1:]...) <mask> <mask> r := s.conf.ipRange <mask> offset, ok := r.offset(l.IP) <mask> if ok { <mask> s.leasedOffsets.Clear(offset) <mask> } <mask> </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squa...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
s.leasedOffsets.Set(offset)
<mask> return <mask> } <mask> <mask> s.leases = append(s.leases, l) <mask> s.leasedOffsets.Set(uint(offset)) <mask> <mask> log.Debug("dhcpv4: added lease %s (%s)", l.IP, l.HWAddr) <mask> } <mask> <mask> // Remove a lease with the same properties </s> Pull request: dhcpd: fix static leases Updates #...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
return !s.leasedOffsets.Test(offset)
<mask> // Shouldn't happen. <mask> return false <mask> } <mask> <mask> return !s.leasedOffsets.Test(uint(offset)) <mask> }) <mask> <mask> return ip.To4() <mask> } <mask> </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d15801...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
HWAddr: make([]byte, len(mac)),
<mask> // reserveLease reserves a lease for a client by its MAC-address. It returns <mask> // nil if it couldn't allocate a new lease. <mask> func (s *v4Server) reserveLease(mac net.HardwareAddr) (l *Lease) { <mask> l = &Lease{ <mask> HWAddr: make([]byte, 6), <mask> } <mask> <mask> copy(l.HWAddr, mac) <...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
s.blocklistLease(lease)
<mask> <mask> toStore = true <mask> <mask> if !s.addrAvailable(lease.IP) { <mask> s.blacklistLease(lease) <mask> lease = nil <mask> continue <mask> } <mask> break <mask> } </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following:...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
// TODO(a.garipov): Don't use a disabled server in other places or just // use an interface.
<mask> s.conf = conf <mask> <mask> if !conf.Enabled { <mask> return s, nil <mask> } <mask> <mask> s.conf.routerIP, err = tryTo4(s.conf.GatewayIP) <mask> if err != nil { </s> Pull request: dhcpd: fix static leases Updates #2541. Updates #2834. Squashed commit of the following: commit d1580182db3b586...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/5243399d9d72121a7df9ca6d542043661cbbefaa
internal/dhcpd/v4.go
func (*dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) {
<mask> } <mask> <mask> // wrapErrs is a helper to wrap the errors from two independent underlying <mask> // connections. <mask> func (c *dhcpConn) wrapErrs(action string, udpConnErr, rawConnErr error) (err error) { <mask> switch { <mask> case udpConnErr != nil && rawConnErr != nil: <mask> return errors.Lis...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
return 0, fmt.Errorf("addr has an unexpected type %T", addr)
<mask> // Unicast the message to the client's IP address. Use the UDP <mask> // connection. <mask> return c.udpConn.WriteTo(p, addr) <mask> default: <mask> return 0, fmt.Errorf("peer is of unexpected type %T", addr) <mask> } <mask> } <mask> <mask> // ReadFrom implements net.PacketConn for *dhcpConn...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
// ipv4DefaultTTL is the default Time to Live value in seconds as recommended by // RFC-1700. // // See https://datatracker.ietf.org/doc/html/rfc1700.
<mask> c.rawConn.SetWriteDeadline(t), <mask> ) <mask> } <mask> <mask> // ipv4DefaultTTL is the default Time to Live value as recommended by <mask> // RFC-1700 (https://datatracker.ietf.org/doc/html/rfc1700) in seconds. <mask> const ipv4DefaultTTL = 64 <mask> <mask> // errInvalidPktDHCP is returned when th...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
// buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. // Validation of the payload is a caller's responsibility.
<mask> // ipv4DefaultTTL is the default Time to Live value as recommended by <mask> // RFC-1700 (https://datatracker.ietf.org/doc/html/rfc1700) in seconds. <mask> const ipv4DefaultTTL = 64 <mask> <mask> // errInvalidPktDHCP is returned when the provided payload is not a valid DHCP <mask> // packet. <mask> const...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
<mask> <mask> // buildEtherPkt wraps the payload with IPv4, UDP and Ethernet frames. The <mask> // payload is expected to be an encoded DHCP packet. <mask> func (c *dhcpConn) buildEtherPkt(payload []byte, peer *dhcpUnicastAddr) (pkt []byte, err error) { <mask> dhcpLayer := gopacket.NewPacket(payload, layers.Lay...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
setts := gopacket.SerializeOptions{
<mask> EthernetType: layers.EthernetTypeIPv4, <mask> } <mask> <mask> buf := gopacket.NewSerializeBuffer() <mask> err = gopacket.SerializeLayers(buf, gopacket.SerializeOptions{ <mask> FixLengths: true, <mask> ComputeChecksums: true, <mask> }, ethLayer, ipv4Layer, udpLayer, dhcpLayer.(gopacket.Se...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go
} err = gopacket.SerializeLayers( buf, setts, ethLayer, ipv4Layer, udpLayer, gopacket.Payload(payload), )
<mask> buf := gopacket.NewSerializeBuffer() <mask> err = gopacket.SerializeLayers(buf, gopacket.SerializeOptions{ <mask> FixLengths: true, <mask> ComputeChecksums: true, <mask> }, ethLayer, ipv4Layer, udpLayer, dhcpLayer.(gopacket.SerializableLayer)) <mask> if err != nil { <mask> return nil, fmt....
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/53209bc42c2401e017e5b727fb74272953a8cd0e
internal/dhcpd/conn_unix.go