AdGuardHome/internal/arpdb/arpdb_bsd_internal_test.go
Stanislav Chzhen 6fea7099a2 Pull request 1967: AG-24794-imp-arpdb
Squashed commit of the following:

commit 6f6f6cc5d9b9ae04e369e0b789aaab74f234e6a0
Merge: 9aa3ac58c 8fb76701f
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Thu Aug 24 13:29:47 2023 +0300

    Merge branch 'master' into AG-24794-imp-arpdb

commit 9aa3ac58c76fc4b2f950a988d63dfebd0652e507
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Aug 23 16:14:02 2023 +0300

    scripts: gocognit: add arpdb

commit e99b0534be1891de1c13f4010beeedb4459ccd7c
Merge: 84893bc2d 3722c2846
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Aug 23 16:08:25 2023 +0300

    Merge branch 'master' into AG-24794-imp-arpdb

commit 84893bc2d3018c9ee1e411578b33cdb6ba6d3d81
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Aug 23 16:07:43 2023 +0300

    arpdb: add todo

commit ad4b3689b51324521bf47c478c61b6008332b4f5
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Aug 23 14:02:07 2023 +0300

    arpdb: imp code

commit 9cdd17dadbb91ccc3f8e79ba7a21bc365647e089
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Fri Aug 18 19:05:10 2023 +0300

    all: imp arpdb
2023-08-24 13:42:17 +03:00

31 lines
945 B
Go

//go:build darwin || freebsd
package arpdb
import (
"net"
"net/netip"
)
const arpAOutput = `
invalid.mac (1.2.3.4) at 12:34:56:78:910 on el0 ifscope [ethernet]
invalid.ip (1.2.3.4.5) at ab:cd:ef:ab:cd:12 on ek0 ifscope [ethernet]
invalid.fmt 1 at 12:cd:ef:ab:cd:ef on er0 ifscope [ethernet]
hostname.one (192.168.1.2) at ab:cd:ef:ab:cd:ef on en0 ifscope [ethernet]
hostname.two (::ffff:ffff) at ef:cd:ab:ef:cd:ab on em0 expires in 1198 seconds [ethernet]
? (::1234) at aa:bb:cc:dd:ee:ff on ej0 expires in 1918 seconds [ethernet]
`
var wantNeighs = []Neighbor{{
Name: "hostname.one",
IP: netip.MustParseAddr("192.168.1.2"),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
Name: "hostname.two",
IP: netip.MustParseAddr("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}, {
Name: "",
IP: netip.MustParseAddr("::1234"),
MAC: net.HardwareAddr{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
}}