MCPcopy
hub / github.com/nextdns/nextdns / Get

Function Get

ndp/ndp_windows.go:11–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9)
10
11func Get() (Table, error) {
12 data, err := exec.Command("netsh", "interface", "ipv6", "show", "neighbors").Output()
13 if err != nil {
14 return nil, err
15 }
16
17 var t Table
18 for _, line := range strings.Split(string(data), "\n") {
19 fields := strings.Fields(line)
20 if len(fields) < 3 {
21 continue
22 }
23
24 if mac := parseMAC(strings.ReplaceAll(fields[1], "-", ":")); mac != nil {
25 t = append(t, Entry{
26 IP: net.ParseIP(fields[0]),
27 MAC: mac,
28 })
29 }
30 }
31
32 return t, nil
33}

Callers

nothing calls this directly

Calls 2

CommandMethod · 0.80
parseMACFunction · 0.70

Tested by

no test coverage detected