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 |
|---|---|---|---|---|
'format': 'uint16' | <mask> 'format': 'int32'
<mask> 'example': 53
<mask> 'web_port':
<mask> 'type': 'integer'
<mask> 'format': 'int32'
<mask> 'example': 80
<mask> 'interfaces':
<mask> 'type': 'object'
<mask> 'description': >
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'additionalProperties':
'$ref': '#/components/schemas/ClientFindSubEntry'
'example':
'1.2.3.4': 'test' | <mask> 'items':
<mask> '$ref': '#/components/schemas/ClientsFindEntry'
<mask> 'ClientsFindEntry':
<mask> 'type': 'object'
<mask> 'properties':
<mask> '1.2.3.4':
<mask> 'items':
<mask> '$ref': '#/components/schemas/ClientFindSubEntry'
<mask>
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'CheckConfigRequestBeta':
'type': 'object'
'description': 'Configuration to be checked'
'properties':
'dns':
'$ref': '#/components/schemas/CheckConfigRequestInfoBeta'
'web':
'$ref': '#/components/schemas/CheckConfigRequestInfoBeta'
'set_static_ip':
... | <mask> 'items':
<mask> 'type': 'string'
<mask> 'CheckConfigRequest':
<mask> 'type': 'object'
<mask> 'description': 'Configuration to be checked'
<mask> 'properties':
<mask> 'dns':
<mask> '$ref': '#/components/schemas/CheckConfigRequestInfo'
</s> Pull reques... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'format': 'uint16' | <mask> 'type': 'string'
<mask> 'example': '127.0.0.1'
<mask> 'port':
<mask> 'type': 'integer'
<mask> 'format': 'int32'
<mask> 'example': 53
<mask> 'autofix':
<mask> 'type': 'boolean'
<mask> 'example': false
<mask> 'Check... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'required':
- 'dns'
- 'web'
- 'static_ip' | <mask> 'type': 'boolean'
<mask> 'example': false
<mask> 'CheckConfigResponse':
<mask> 'type': 'object'
<mask> 'properties':
<mask> 'dns':
<mask> '$ref': '#/components/schemas/CheckConfigResponseInfo'
<mask> 'web':
<mask> '$ref': '#/compone... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'required':
- 'status'
- 'can_autofix' | <mask> '$ref': '#/components/schemas/CheckConfigStaticIpInfo'
<mask> 'CheckConfigResponseInfo':
<mask> 'type': 'object'
<mask> 'properties':
<mask> 'status':
<mask> 'type': 'string'
<mask> 'default': ''
<mask> 'example': ''
<mask> 'can_aut... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'default': '' | <mask> 'status':
<mask> 'type': 'string'
<mask> 'example': ''
<mask> 'can_autofix':
<mask> 'type': 'boolean'
<mask> 'example': false
</s> Pull request: beta client squashed
Merge in DNS/adguard-home from beta-client-2 to master
Squashed commit of the foll... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'CheckConfigStaticIpInfoStatic':
'type': 'string'
'example': 'no'
'enum':
- 'yes'
- 'no'
- 'error'
'description': 'Can be: yes, no, error' | <mask> 'can_autofix':
<mask> 'type': 'boolean'
<mask> 'example': false
<mask> 'CheckConfigStaticIpInfo':
<mask> 'type': 'object'
<mask> 'properties':
<mask> 'static':
</s> Pull request: beta client squashed
Merge in DNS/adguard-home from beta-client-2 to mast... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'$ref': '#/components/schemas/CheckConfigStaticIpInfoStatic' | <mask> 'CheckConfigStaticIpInfo':
<mask> 'type': 'object'
<mask> 'properties':
<mask> 'static':
<mask> 'type': 'string'
<mask> 'example': 'no'
<mask> 'description': 'Can be: yes, no, error'
<mask> 'ip':
<mask> 'type': 'string'
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'default': '' | <mask> 'static':
<mask> '$ref': '#/components/schemas/CheckConfigStaticIpInfoStatic'
<mask> 'ip':
<mask> 'type': 'string'
<mask> 'example': '192.168.1.1'
<mask> 'description': 'Current dynamic IP address. Set if static=no'
<mask> 'error':
<mask> ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'default': '' | <mask> 'example': '192.168.1.1'
<mask> 'description': 'Current dynamic IP address. Set if static=no'
<mask> 'error':
<mask> 'type': 'string'
<mask> 'example': ''
<mask> 'description': 'Error text. Set if static=error'
<mask> 'InitialConfigurationBeta'... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
'required':
- 'dns'
- 'web'
- 'username'
- 'password' | <mask> 'InitialConfiguration':
<mask> 'type': 'object'
<mask> 'description': >
<mask> AdGuard Home initial configuration for the first-install wizard.
<mask> 'properties':
<mask> 'dns':
<mask> '$ref': '#/components/schemas/AddressInfo'
<mask> 'web':
</s> ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e20ac7ed5de861ea5c945d1775f75312d62b69f | openapi/openapi.yaml |
httpServer *http.Server | <mask> versionCheckLastTime time.Time
<mask>
<mask> httpsServer HTTPSServer
<mask>
<mask> BindHost string `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to
<mask> BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server
</s> * move "httpServer"... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e309a7b3a5d29323a6e08189ceb5c101fc38035 | home/config.go |
config.httpServer.Shutdown(context.TODO()) | <mask> // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block
<mask> // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely
<mask> if restartHTTP {
<mask> go func() {
<mask> httpServer.Shutdown(context.TODO())
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e309a7b3a5d29323a6e08189ceb5c101fc38035 | home/control_install.go |
<mask> "github.com/NYTimes/gziphandler"
<mask> "github.com/gobuffalo/packr"
<mask> )
<mask>
<mask> var httpServer *http.Server
<mask>
<mask> const (
<mask> // Used in config to indicate that syslog or eventlog (win) should be used for logger output
<mask> configSyslog = "syslog"
<mask> )
<mask>
</s> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e309a7b3a5d29323a6e08189ceb5c101fc38035 | home/home.go | |
config.httpServer = &http.Server{ | <mask> printHTTPAddresses("http")
<mask>
<mask> // we need to have new instance, because after Shutdown() the Server is not usable
<mask> address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.BindPort))
<mask> httpServer = &http.Server{
<mask> Addr: address,
<mask> }
<mask> err := htt... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e309a7b3a5d29323a6e08189ceb5c101fc38035 | home/home.go |
err := config.httpServer.ListenAndServe() | <mask> address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.BindPort))
<mask> httpServer = &http.Server{
<mask> Addr: address,
<mask> }
<mask> err := httpServer.ListenAndServe()
<mask> if err != http.ErrServerClosed {
<mask> cleanupAlways()
<mask> log.Fatal(err)
<mask> }
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e309a7b3a5d29323a6e08189ceb5c101fc38035 | home/home.go |
config.httpServer.Shutdown(context.TODO()) | <mask> config.httpsServer.shutdown = true
<mask> if config.httpsServer.server != nil {
<mask> config.httpsServer.server.Shutdown(context.TODO())
<mask> }
<mask> httpServer.Shutdown(context.TODO())
<mask> }
<mask>
<mask> // This function is called before application exits
<mask> func cleanupAlways() {
<... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e309a7b3a5d29323a6e08189ceb5c101fc38035 | home/home.go |
"bytes" | <mask> import (
<mask> "bufio"
<mask> "fmt"
<mask> "net"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/netutil"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashe... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
<mask>
<mask> import (
<mask> "bufio"
<mask> "fmt"
<mask> "io"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
S... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go | |
<mask> "bufio"
<mask> "fmt"
<mask> "io"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/netutil"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go | |
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/netutil"
<mask> )
<mask>
<mask> // ARPDB: The Network Neighborhood Database
</s> Pull request: 2846 cover a... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go | |
<mask> // ARP-related command. lenHint is a hint for the size of the allocated slice
<mask> // of Neighbors.
<mask> type parseNeighsFunc func(sc *bufio.Scanner, lenHint int) (ns []Neighbor)
<mask>
<mask> // runCmdFunc is the function that runs some command and returns its output
<mask> // wrapped to be a io.Rea... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go | |
parse parseNeighsFunc
ns *neighs
cmd string
args []string | <mask>
<mask> // cmdARPDB is the implementation of the ARPDB that uses command line to
<mask> // retrieve data.
<mask> type cmdARPDB struct {
<mask> parse parseNeighsFunc
<mask> runcmd runCmdFunc
<mask> ns *neighs
<mask> }
<mask>
<mask> // type check
<mask> var _ ARPDB = (*cmdARPDB)(nil)
<mask>
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
<mask>
<mask> // type check
<mask> var _ ARPDB = (*cmdARPDB)(nil)
<mask>
<mask> // runCmd runs the cmd with it's args and returns the result wrapped to be an
<mask> // io.Reader. The error is returned either if the exit code retured by command
<mask> // not equals 0 or the execution itself failed.
<mask> fun... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go | |
code, out, err := aghosRunCommand(arp.cmd, arp.args...) | <mask> // Refresh implements the ARPDB interface for *cmdARPDB.
<mask> func (arp *cmdARPDB) Refresh() (err error) {
<mask> defer func() { err = errors.Annotate(err, "cmd arpdb: %w") }()
<mask>
<mask> var r io.Reader
<mask> r, err = arp.runcmd()
<mask> if err != nil {
<mask> return fmt.Errorf("running com... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
} else if code != 0 {
return fmt.Errorf("running command: unexpected exit code %d", code) | <mask>
<mask> code, out, err := aghosRunCommand(arp.cmd, arp.args...)
<mask> if err != nil {
<mask> return fmt.Errorf("running command: %w", err)
<mask> }
<mask>
<mask> sc := bufio.NewScanner(bytes.NewReader(out))
<mask> ns := arp.parse(sc, arp.ns.len())
<mask> if err = sc.Err(); err != nil {
<mask>... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
sc := bufio.NewScanner(bytes.NewReader(out)) | <mask> if err != nil {
<mask> return fmt.Errorf("running command: %w", err)
<mask> }
<mask>
<mask> sc := bufio.NewScanner(r)
<mask> ns := arp.parse(sc, arp.ns.len())
<mask> if err = sc.Err(); err != nil {
<mask> return fmt.Errorf("scanning the output: %w", err)
<mask> }
<mask>
</s> Pull request: ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
// TODO(e.burkov): This error seems unreachable. Investigate. | <mask> ns := arp.parse(sc, arp.ns.len())
<mask> if err = sc.Err(); err != nil {
<mask> return fmt.Errorf("scanning the output: %w", err)
<mask> }
<mask>
<mask> arp.ns.reset(ns)
<mask>
<mask> return nil
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 t... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
neighs | <mask> // consequently switches between those.
<mask> type arpdbs struct {
<mask> // arps is the set of ARPDB implementations to range through.
<mask> arps []ARPDB
<mask> // last is the last succeeded ARPDB index.
<mask> last int
<mask> }
<mask>
<mask> // newARPDBs returns a properly initialized *arpdbs. ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
neighs: neighs{
mu: &sync.RWMutex{},
ns: make([]Neighbor, 0),
}, | <mask> // the first of arps.
<mask> func newARPDBs(arps ...ARPDB) (arp *arpdbs) {
<mask> return &arpdbs{
<mask> arps: arps,
<mask> last: 0,
<mask> }
<mask> }
<mask>
<mask> // type check
<mask> var _ ARPDB = (*arpdbs)(nil)
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
for _, a := range arp.arps {
err = a.Refresh()
if err != nil {
errs = append(errs, err)
continue | <mask>
<mask> // Refresh implements the ARPDB interface for *arpdbs.
<mask> func (arp *arpdbs) Refresh() (err error) {
<mask> var errs []error
<mask> l := len(arp.arps)
<mask> // Start from the last succeeded implementation.
<mask> for i := 0; i < l; i++ {
<mask> cur := (arp.last + i) % l
<mask> err =... | [
"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/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
arp.reset(a.Neighbors())
return nil | <mask>
<mask> return nil
<mask> }
<mask>
<mask> errs = append(errs, err)
<mask> }
<mask>
<mask> if len(errs) > 0 {
<mask> err = errors.List("each arpdb failed", errs...)
<mask> }
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updat... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
//
// TODO(e.burkov): Think of a way to avoid cloning the slice twice. | <mask>
<mask> // Neighbors implements the ARPDB interface for *arpdbs.
<mask> func (arp *arpdbs) Neighbors() (ns []Neighbor) {
<mask> return arp.clone()
<mask> }
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the f... | [
"keep",
"add",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
return arp.clone() | <mask> }
<mask>
<mask> // Neighbors implements the ARPDB interface for *arpdbs.
<mask> func (arp *arpdbs) Neighbors() (ns []Neighbor) {
<mask> if l := len(arp.arps); l > 0 && arp.last < l {
<mask> return arp.arps[arp.last].Neighbors()
<mask> }
<mask>
<mask> return nil
<mask> }
</s> Pull request: 2846 ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb.go |
parse: parseArpA, | <mask> )
<mask>
<mask> func newARPDB() *cmdARPDB {
<mask> return &cmdARPDB{
<mask> parse: parseArpA,
<mask> runcmd: rcArpA,
<mask> ns: &neighs{
<mask> mu: &sync.RWMutex{},
<mask> ns: make([]Neighbor, 0),
<mask> },
<mask> }
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-ho... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_bsd.go |
cmd: "arp",
args: []string{"-a"}, | <mask> ns: make([]Neighbor, 0),
<mask> },
<mask> }
<mask> }
<mask>
<mask> // parseArpA parses the output of the "arp -a" command on macOS and FreeBSD.
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the follow... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_bsd.go |
<mask>
<mask> import (
<mask> "bufio"
<mask> "fmt"
<mask> "io"
<mask> "io/fs"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the following:
commit cb2... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux.go | |
&fsysARPDB{
ns: ns,
fsys: rootDirFS,
filename: "proc/net/arp",
},
// Then, try "arp -a".
&cmdARPDB{
parse: parseF,
ns: ns,
cmd: "arp",
args: []string{"-a"},
},
// Finally, try "ip neigh".
&cmdARPDB{
parse: parseIPNeigh,
ns: ns,
cmd: "ip",
args: []stri... | <mask> }
<mask>
<mask> return newARPDBs(
<mask> // Try /proc/net/arp first.
<mask> &fsysARPDB{ns: ns, fsys: aghos.RootDirFS(), filename: "proc/net/arp"},
<mask> // Try "arp -a" then.
<mask> &cmdARPDB{parse: parseF, runcmd: rcArpA, ns: ns},
<mask> // Try "ip neigh" finally.
<mask> &cmdARPDB{parse... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux.go |
<mask>
<mask> return ns
<mask> }
<mask>
<mask> // rcIPNeigh runs "ip neigh".
<mask> func rcIPNeigh() (r io.Reader, err error) {
<mask> return runCmd("ip", "neigh")
<mask> }
<mask>
<mask> // parseIPNeigh parses the output of the "ip neigh" command on Linux. The
<mask> // expected input format:
<mask> /... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux.go | |
<mask>
<mask> package aghnet
<mask>
<mask> import (
<mask> "io"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "testing"
<mask>
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the following:
commit c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go | |
<mask>
<mask> import (
<mask> "io"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "testing"
<mask>
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go | |
"testing/fstest" | <mask> "net"
<mask> "sync"
<mask> "testing"
<mask>
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> const arpAOutputWrt = `
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Update... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
require.NoError(t, fstest.TestFS(testdata, "proc_net_arp"))
| <mask> }}
<mask>
<mask> func TestFSysARPDB(t *testing.T) {
<mask> a := &fsysARPDB{
<mask> ns: &neighs{
<mask> mu: &sync.RWMutex{},
<mask> ns: make([]Neighbor, 0),
<mask> },
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
func TestCmdARPDB_linux(t *testing.T) {
sh := mapShell{
"arp -a": {err: nil, out: arpAOutputWrt, code: 0},
"ip neigh": {err: nil, out: ipNeighOutput, code: 0}, | <mask> ns := a.Neighbors()
<mask> assert.Equal(t, wantNeighs, ns)
<mask> }
<mask>
<mask> func TestCmdARPDB_arpawrt(t *testing.T) {
<mask> a := &cmdARPDB{
<mask> parse: parseArpAWrt,
<mask> runcmd: func() (r io.Reader, err error) { return strings.NewReader(arpAOutputWrt), nil },
<mask> ns: &neighs{
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
substShell(t, sh.RunCmd) | <mask> "ip neigh": {err: nil, out: ipNeighOutput, code: 0},
<mask> }
<mask>
<mask> t.Run("wrt", func(t *testing.T) {
<mask> a := &cmdARPDB{
<mask> parse: parseArpAWrt,
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
t.Run("wrt", func(t *testing.T) {
a := &cmdARPDB{
parse: parseArpAWrt,
cmd: "arp",
args: []string{"-a"},
ns: &neighs{
mu: &sync.RWMutex{},
ns: make([]Neighbor, 0),
},
} | <mask> ns: make([]Neighbor, 0),
<mask> },
<mask> }
<mask>
<mask> err := a.Refresh()
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, wantNeighs, a.Neighbors())
<mask> }
<mask>
<mask> func TestCmdARPDB_ipneigh(t *testing.T) {
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/ad... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
err := a.Refresh()
require.NoError(t, err) | <mask>
<mask> err := a.Refresh()
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, wantNeighs, a.Neighbors())
<mask> }
<mask>
<mask> func TestCmdARPDB_ipneigh(t *testing.T) {
<mask> a := &cmdARPDB{
<mask> parse: parseIPNeigh,
<mask> runcmd: func() (r io.Reader, err error) { return stri... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
assert.Equal(t, wantNeighs, a.Neighbors())
})
t.Run("ip_neigh", func(t *testing.T) {
a := &cmdARPDB{
parse: parseIPNeigh,
cmd: "ip",
args: []string{"neigh"},
ns: &neighs{
mu: &sync.RWMutex{},
ns: make([]Neighbor, 0),
},
}
err := a.Refresh()
require.NoError(t, err) | <mask>
<mask> assert.Equal(t, wantNeighs, a.Neighbors())
<mask> }
<mask>
<mask> func TestCmdARPDB_ipneigh(t *testing.T) {
<mask> a := &cmdARPDB{
<mask> parse: parseIPNeigh,
<mask> runcmd: func() (r io.Reader, err error) { return strings.NewReader(ipNeighOutput), nil },
<mask> ns: &neighs{
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
assert.Equal(t, wantNeighs, a.Neighbors())
}) | <mask> }
<mask> err := a.Refresh()
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, wantNeighs, a.Neighbors())
<mask> }
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the following:
commit cb22987c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_linux_test.go |
parse: parseArpA, | <mask> )
<mask>
<mask> func newARPDB() *cmdARPDB {
<mask> return &cmdARPDB{
<mask> runcmd: rcArpA,
<mask> parse: parseArpA,
<mask> ns: &neighs{
<mask> mu: &sync.RWMutex{},
<mask> ns: make([]Neighbor, 0),
<mask> },
<mask> }
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-ho... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_openbsd.go |
cmd: "arp",
args: []string{"-a"}, | <mask> ns: make([]Neighbor, 0),
<mask> },
<mask> }
<mask> }
<mask>
<mask> // parseArpA parses the output of the "arp -a" command on OpenBSD. The expected
<mask> // input format:
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_openbsd.go |
<mask> package aghnet
<mask>
<mask> import (
<mask> "io"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "testing"
<mask> "testing/iotest"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the following:
... | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go | |
<mask>
<mask> import (
<mask> "io"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "testing"
<mask> "testing/iotest"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
S... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go | |
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> "testing"
<mask> "testing/iotest"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
</s> Pull request: 2846 ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go | |
require.NotPanics(t, func() { a = NewARPDB() }) | <mask> )
<mask>
<mask> func TestNewARPDB(t *testing.T) {
<mask> var a ARPDB
<mask> require.NotPanics(t, func() {
<mask> a = NewARPDB()
<mask> })
<mask>
<mask> assert.NotNil(t, a)
<mask> }
<mask>
<mask> // TestARPDB is the mock implementation of ARPDB to use in tests.
</s> Pull request: 2846 cover ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
// Unstable ARPDB should refresh successfully again. | <mask>
<mask> assert.Equal(t, 1, succRefrCount)
<mask> assert.NotEmpty(t, a.Neighbors())
<mask>
<mask> // Only the last succeeded ARPDB should be used.
<mask> err = a.Refresh()
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, 2, succRefrCount)
<mask> assert.NotEmpty(t, a.Neighbors... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
assert.Equal(t, 1, succRefrCount) | <mask> // Only the last succeeded ARPDB should be used.
<mask> err = a.Refresh()
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, 2, succRefrCount)
<mask> assert.NotEmpty(t, a.Neighbors())
<mask> })
<mask>
<mask> t.Run("empty", func(t *testing.T) {
<mask> a := newARPDBs()
</s> Pul... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
cmd: "cmd", | <mask>
<mask> func TestCmdARPDB_arpa(t *testing.T) {
<mask> a := &cmdARPDB{
<mask> parse: parseArpA,
<mask> ns: &neighs{
<mask> mu: &sync.RWMutex{},
<mask> ns: make([]Neighbor, 0),
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
sh := theOnlyCmd("cmd", 0, arpAOutput, nil)
substShell(t, sh.RunCmd) | <mask> },
<mask> }
<mask>
<mask> t.Run("arp_a", func(t *testing.T) {
<mask> a.runcmd = func() (r io.Reader, err error) { return strings.NewReader(arpAOutput), nil }
<mask>
<mask> err := a.Refresh()
<mask> require.NoError(t, err)
<mask>
<mask> assert.Equal(t, wantNeighs, a.Neighbors())
</s> Pul... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
sh := theOnlyCmd("cmd", 0, "", errors.Error("can't run"))
substShell(t, sh.RunCmd) | <mask> assert.Equal(t, wantNeighs, a.Neighbors())
<mask> })
<mask>
<mask> t.Run("runcmd_error", func(t *testing.T) {
<mask> a.runcmd = func() (r io.Reader, err error) { return nil, errors.Error("can't run") }
<mask>
<mask> err := a.Refresh()
<mask> testutil.AssertErrorMsg(t, "cmd arpdb: running comm... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
<mask>
<mask> err := a.Refresh()
<mask> testutil.AssertErrorMsg(t, "cmd arpdb: running command: can't run", err)
<mask> })
<mask> }
<mask>
<mask> func TestCmdARPDB_errors(t *testing.T) {
<mask> const errRead errors.Error = "can't read"
<mask>
<mask> badReaderRunCmd := runCmdFunc(func() (r io.Reader,... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go | |
t.Run("bad_code", func(t *testing.T) {
sh := theOnlyCmd("cmd", 1, "", nil)
substShell(t, sh.RunCmd) | <mask> testutil.AssertErrorMsg(t, "cmd arpdb: running command: can't run", err)
<mask> })
<mask> }
<mask>
<mask> func TestCmdARPDB_errors(t *testing.T) {
<mask> const errRead errors.Error = "can't read"
<mask>
<mask> badReaderRunCmd := runCmdFunc(func() (r io.Reader, err error) {
<mask> return iotest.... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
err := a.Refresh()
testutil.AssertErrorMsg(t, "cmd arpdb: running command: unexpected exit code 1", err) | <mask>
<mask> func TestCmdARPDB_errors(t *testing.T) {
<mask> const errRead errors.Error = "can't read"
<mask>
<mask> badReaderRunCmd := runCmdFunc(func() (r io.Reader, err error) {
<mask> return iotest.ErrReader(errRead), nil
<mask> })
<mask>
<mask> a := &cmdARPDB{
<mask> runcmd: badReaderRunCmd,
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go |
<mask>
<mask> badReaderRunCmd := runCmdFunc(func() (r io.Reader, err error) {
<mask> return iotest.ErrReader(errRead), nil
<mask> })
<mask>
<mask> a := &cmdARPDB{
<mask> runcmd: badReaderRunCmd,
<mask> parse: parseArpA,
<mask> ns: &neighs{
<mask> mu: &sync.RWMutex{},
<mask> ns: make([]Nei... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_test.go | |
<mask> package aghnet
<mask>
<mask> import (
<mask> "bufio"
<mask> "io"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> )
<mask>
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the following:
commit cb... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_windows.go | |
parse: parseArpA, | <mask> )
<mask>
<mask> func newARPDB() *cmdARPDB {
<mask> return &cmdARPDB{
<mask> runcmd: rcArpA,
<mask> ns: &neighs{
<mask> mu: &sync.RWMutex{},
<mask> ns: make([]Neighbor, 0),
<mask> },
<mask> parse: parseArpA,
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_windows.go |
cmd: "arp",
args: []string{"/a"}, | <mask> ns: &neighs{
<mask> mu: &sync.RWMutex{},
<mask> ns: make([]Neighbor, 0),
<mask> },
<mask> parse: parseArpA,
<mask> }
<mask> }
<mask>
<mask> // rcArpA runs "arp /a".
<mask> func rcArpA() (r io.Reader, err error) {
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_windows.go |
<mask> parse: parseArpA,
<mask> }
<mask> }
<mask>
<mask> // rcArpA runs "arp /a".
<mask> func rcArpA() (r io.Reader, err error) {
<mask> return runCmd("arp", "/a")
<mask> }
<mask>
<mask> // parseArpA parses the output of the "arp /a" command on Windows. The expected
<mask> // input format (the first l... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/arpdb_windows.go | |
require.NoError(t, fstest.TestFS(testdata, "etc_hosts"))
| <mask> OnClose: func() (err error) { panic("not implemented") },
<mask> }
<mask>
<mask> hc, err := NewHostsContainer(0, testdata, &stubWatcher, "etc_hosts")
<mask> require.NoError(t, err)
<mask> testutil.CleanupAndRequireSuccess(t, hc.Close)
<mask>
</s> Pull request: 2846 cover aghnet vol.3
Merge in D... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/hostscontainer_test.go |
require.NoError(t, fstest.TestFS(testdata, "etc_hosts"))
| <mask> func TestHostsContainer(t *testing.T) {
<mask> const listID = 1234
<mask>
<mask> testCases := []struct {
<mask> want []*rules.DNSRewrite
<mask> name string
<mask> req urlfilter.DNSRequest
<mask> }{{
<mask> want: []*rules.DNSRewrite{{
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/hostscontainer_test.go |
"bytes" | <mask> package aghnet
<mask>
<mask> import (
<mask> "encoding/json"
<mask> "fmt"
<mask> "io"
<mask> "net"
<mask> "syscall"
<mask>
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to master
Updates #2846.
Squashed commit of the following:
commit cb229... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
<mask> "encoding/json"
<mask> "fmt"
<mask> "io"
<mask> "net"
<mask> "os/exec"
<mask> "strings"
<mask> "syscall"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/golibs/netutil"
</s> Pull request: 2846 cover aghnet vol.3... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go | |
"github.com/AdguardTeam/AdGuardHome/internal/aghos" | <mask> "io"
<mask> "net"
<mask> "syscall"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/golibs/netutil"
<mask> )
<mask>
<mask> // aghosRunCommand is the function to run shell commands. It's an unexported
</s> Pull reque... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
// aghosRunCommand is the function to run shell commands. It's an unexported
// variable instead of a direct call to make it substitutable in tests.
var aghosRunCommand = aghos.RunCommand
// rootDirFS is the filesystem pointing to the root directory. It's an
// unexported variable instead to make it substitutable in... | <mask> "github.com/AdguardTeam/golibs/netutil"
<mask> )
<mask>
<mask> // ErrNoStaticIPInfo is returned by IfaceHasStaticIP when no information about
<mask> // the IP being static is available.
<mask> const ErrNoStaticIPInfo errors.Error = "no information about static ip"
<mask>
<mask> // IfaceHasStaticIP che... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
//
// TODO(e.burkov): Investigate if the gateway address may be fetched in another
// way since not every machine has the software installed.
func GatewayIP(ifaceName string) (ip net.IP) {
code, out, err := aghosRunCommand("ip", "route", "show", "dev", ifaceName)
if err != nil {
log.Debug("%s", err)
return nil
... | <mask> return ifaceSetStaticIP(ifaceName)
<mask> }
<mask>
<mask> // GatewayIP returns IP address of interface's gateway.
<mask> func GatewayIP(ifaceName string) net.IP {
<mask> cmd := exec.Command("ip", "route", "show", "dev", ifaceName)
<mask> log.Tracef("executing %s %v", cmd.Path, cmd.Args)
<mask> d, er... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
fields := bytes.Fields(out) | <mask> if err != nil || cmd.ProcessState.ExitCode() != 0 {
<mask> return nil
<mask> }
<mask>
<mask> fields := strings.Fields(string(d))
<mask> // The meaningful "ip route" command output should contain the word
<mask> // "default" at first field and default gateway IP address at third field.
<mask> if ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
if len(fields) < 3 || string(fields[0]) != "default" { | <mask>
<mask> fields := strings.Fields(string(d))
<mask> // The meaningful "ip route" command output should contain the word
<mask> // "default" at first field and default gateway IP address at third field.
<mask> if len(fields) < 3 || fields[0] != "default" {
<mask> return nil
<mask> }
<mask>
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
return net.ParseIP(string(fields[2])) | <mask> if len(fields) < 3 || fields[0] != "default" {
<mask> return nil
<mask> }
<mask>
<mask> return net.ParseIP(fields[2])
<mask> }
<mask>
<mask> // CanBindPort checks if we can bind to the given port.
<mask> func CanBindPort(port int) (can bool, err error) {
<mask> var addr *net.TCPAddr
</s> Pull ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
func GetValidNetInterfacesForWeb() (netInterfaces []*NetInterface, err error) { | <mask> }
<mask>
<mask> // GetValidNetInterfacesForWeb returns interfaces that are eligible for DNS and WEB only
<mask> // we do not return link-local addresses here
<mask> func GetValidNetInterfacesForWeb() ([]*NetInterface, error) {
<mask> ifaces, err := net.Interfaces()
<mask> if err != nil {
<mask> retu... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
<mask> } else if len(ifaces) == 0 {
<mask> return nil, errors.Error("couldn't find any legible interface")
<mask> }
<mask>
<mask> var netInterfaces []*NetInterface
<mask>
<mask> for _, iface := range ifaces {
<mask> var addrs []net.Addr
<mask> addrs, err = iface.Addrs()
<mask> if err != nil {
<... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go | |
return nil, fmt.Errorf("got %s that is not net.IPNet, it is %T", addr, addr) | <mask> for _, addr := range addrs {
<mask> ipNet, ok := addr.(*net.IPNet)
<mask> if !ok {
<mask> // Should be net.IPNet, this is weird.
<mask> return nil, fmt.Errorf("got iface.Addrs() element %s that is not net.IPNet, it is %T", addr, addr)
<mask> }
<mask> // Ignore link-local.
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net.go |
"bufio"
"bytes" | <mask> package aghnet
<mask>
<mask> import (
<mask> "fmt"
<mask> "io"
<mask> "regexp"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/errors"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 to mas... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
"io" | <mask> package aghnet
<mask>
<mask> import (
<mask> "fmt"
<mask> "os"
<mask> "regexp"
<mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/errors"
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
<mask> import (
<mask> "fmt"
<mask> "os"
<mask> "regexp"
<mask> "strings"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> )
<mask>
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 2846-cover-aghnet-vol.3 ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go | |
func ifaceHasStaticIP(ifaceName string) (ok bool, err error) { | <mask> func canBindPrivilegedPorts() (can bool, err error) {
<mask> return aghos.HaveAdminRights()
<mask> }
<mask>
<mask> func ifaceHasStaticIP(ifaceName string) (bool, error) {
<mask> portInfo, err := getCurrentHardwarePortInfo(ifaceName)
<mask> if err != nil {
<mask> return false, err
<mask> }
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
// getCurrentHardwarePortInfo gets information for the specified network
// interface. | <mask>
<mask> return portInfo.static, nil
<mask> }
<mask>
<mask> // getCurrentHardwarePortInfo gets information for the specified network interface.
<mask> func getCurrentHardwarePortInfo(ifaceName string) (hardwarePortInfo, error) {
<mask> // First of all we should find hardware port name
<mask> m := getN... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
// First of all we should find hardware port name. | <mask> }
<mask>
<mask> // getCurrentHardwarePortInfo gets information for the specified network interface.
<mask> func getCurrentHardwarePortInfo(ifaceName string) (hardwarePortInfo, error) {
<mask> // First of all we should find hardware port name
<mask> m := getNetworkSetupHardwareReports()
<mask> hardware... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
// hardwareReportsReg is the regular expression matching the lines of
// networksetup command output lines containing the interface information.
var hardwareReportsReg = regexp.MustCompile("Hardware Port: (.*?)\nDevice: (.*?)\n")
| <mask> }
<mask>
<mask> // getNetworkSetupHardwareReports parses the output of the `networksetup
<mask> // -listallhardwareports` command it returns a map where the key is the
<mask> // interface name, and the value is the "hardware port" returns nil if it fails
<mask> // to parse the output
</s> Pull request: 2... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
func getNetworkSetupHardwareReports() (reports map[string]string) {
_, out, err := aghosRunCommand("networksetup", "-listallhardwareports") | <mask> //
<mask> // TODO(e.burkov): There should be more proper approach than parsing the
<mask> // command output. For example, see
<mask> // https://developer.apple.com/documentation/systemconfiguration.
<mask> func getNetworkSetupHardwareReports() map[string]string {
<mask> _, out, err := aghos.RunCommand("... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
reports = make(map[string]string) | <mask> if err != nil {
<mask> return nil
<mask> }
<mask>
<mask> m := make(map[string]string)
<mask>
<mask> matches := re.FindAllStringSubmatch(out, -1)
<mask> for i := range matches {
<mask> port := matches[i][1]
<mask> device := matches[i][2]
</s> Pull request: 2846 cover aghnet vol.3
Merge in... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
matches := hardwareReportsReg.FindAllSubmatch(out, -1)
for _, m := range matches {
reports[string(m[2])] = string(m[1]) | <mask> }
<mask>
<mask> m := make(map[string]string)
<mask>
<mask> matches := re.FindAllStringSubmatch(out, -1)
<mask> for i := range matches {
<mask> port := matches[i][1]
<mask> device := matches[i][2]
<mask> m[device] = port
<mask> }
<mask>
<mask> return m
<mask> }
<mask>
</s> Pull requ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
return reports | <mask> device := matches[i][2]
<mask> m[device] = port
<mask> }
<mask>
<mask> return m
<mask> }
<mask>
<mask> func getHardwarePortInfo(hardwarePort string) (hardwarePortInfo, error) {
<mask> h := hardwarePortInfo{}
<mask>
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-home from 28... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
// hardwarePortReg is the regular expression matching the lines of networksetup
// command output lines containing the port information.
var hardwarePortReg = regexp.MustCompile("IP address: (.*?)\nSubnet mask: (.*?)\nRouter: (.*?)\n") | <mask>
<mask> return m
<mask> }
<mask>
<mask> func getHardwarePortInfo(hardwarePort string) (hardwarePortInfo, error) {
<mask> h := hardwarePortInfo{}
<mask>
<mask> _, out, err := aghos.RunCommand("networksetup", "-getinfo", hardwarePort)
<mask> if err != nil {
<mask> return h, err
<mask> }
</s> P... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
func getHardwarePortInfo(hardwarePort string) (h hardwarePortInfo, err error) {
_, out, err := aghosRunCommand("networksetup", "-getinfo", hardwarePort) | <mask>
<mask> func getHardwarePortInfo(hardwarePort string) (hardwarePortInfo, error) {
<mask> h := hardwarePortInfo{}
<mask>
<mask> _, out, err := aghos.RunCommand("networksetup", "-getinfo", hardwarePort)
<mask> if err != nil {
<mask> return h, err
<mask> }
<mask>
<mask> re := regexp.MustCompile("... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
match := hardwarePortReg.FindSubmatch(out)
if len(match) != 4 { | <mask> if err != nil {
<mask> return h, err
<mask> }
<mask>
<mask> re := regexp.MustCompile("IP address: (.*?)\nSubnet mask: (.*?)\nRouter: (.*?)\n")
<mask>
<mask> match := re.FindStringSubmatch(out)
<mask> if len(match) == 0 {
<mask> return h, errors.Error("could not find hardware port info")
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
return hardwarePortInfo{
name: hardwarePort,
ip: string(match[1]),
subnet: string(match[2]),
gatewayIP: string(match[3]),
static: bytes.Index(out, []byte("Manual Configuration")) == 0,
}, nil | <mask> if len(match) == 0 {
<mask> return h, errors.Error("could not find hardware port info")
<mask> }
<mask>
<mask> h.name = hardwarePort
<mask> h.ip = match[1]
<mask> h.subnet = match[2]
<mask> h.gatewayIP = match[3]
<mask>
<mask> if strings.Index(out, "Manual Configuration") == 0 {
<mask> h.... | [
"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/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
return errors.Error("ip address is already static") | <mask> return err
<mask> }
<mask>
<mask> if portInfo.static {
<mask> return errors.Error("IP address is already static")
<mask> }
<mask>
<mask> dnsAddrs, err := getEtcResolvConfServers()
<mask> if err != nil {
<mask> return err
</s> Pull request: 2846 cover aghnet vol.3
Merge in DNS/adguard-hom... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
args := append([]string{"-setdnsservers", portInfo.name}, dnsAddrs...) | <mask> if err != nil {
<mask> return err
<mask> }
<mask>
<mask> args := make([]string, 0)
<mask> args = append(args, "-setdnsservers", portInfo.name)
<mask> args = append(args, dnsAddrs...)
<mask>
<mask> // Setting DNS servers is necessary when configuring a static IP
<mask> code, _, err := aghos.R... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
code, _, err := aghosRunCommand("networksetup", args...) | <mask> args = append(args, "-setdnsservers", portInfo.name)
<mask> args = append(args, dnsAddrs...)
<mask>
<mask> // Setting DNS servers is necessary when configuring a static IP
<mask> code, _, err := aghos.RunCommand("networksetup", args...)
<mask> if err != nil {
<mask> return err
<mask> }
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/5e71f5df6a8cd12a65fecd2f1e28b2aa69609193 | internal/aghnet/net_darwin.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.