Support "insistent" queries in the mDNS client, used for obtaining all possible responses from mDNS servers.
Support for multiple responses from Lookup*() methods Support for multiple records when building packets with make*() methods Use a common "ZoneRecord" interface for structs that contain names and IPs
This commit is contained in:
1 parent
ec29c2c776
commit
58c8945b32
17 files changed
+504
-216
No files matched your search
@@ -14,7 +14,7 @@ func TestZone(t *testing.T) {
|
||||
testAddr1 = "10.2.2.1/24"
|
||||
)
|
||||
|
||||
var zone = new(ZoneDb)
|
||||
var zone = NewZoneDb(DefaultLocalDomain)
|
||||
|
||||
ip, _, _ := net.ParseCIDR(testAddr1)
|
||||
err := zone.AddRecord(containerID, successTestName, ip)
|
||||
@@ -30,7 +30,7 @@ func TestZone(t *testing.T) {
|
||||
foundIP, err := zone.LookupName(successTestName)
|
||||
wt.AssertNoErr(t, err)
|
||||
|
||||
if !foundIP.Equal(ip) {
|
||||
if !foundIP[0].IP().Equal(ip) {
|
||||
t.Fatal("Unexpected result for", successTestName, foundIP)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func TestZone(t *testing.T) {
|
||||
foundName, err := zone.LookupInaddr("1.2.2.10.in-addr.arpa.")
|
||||
wt.AssertNoErr(t, err)
|
||||
|
||||
if foundName != successTestName {
|
||||
if foundName[0].Name() != successTestName {
|
||||
t.Fatal("Unexpected result for", ip, foundName)
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ func TestDeleteFor(t *testing.T) {
|
||||
addr1 = "10.2.2.3/24"
|
||||
addr2 = "10.2.7.8/24"
|
||||
)
|
||||
zone := new(ZoneDb)
|
||||
zone := NewZoneDb(DefaultLocalDomain)
|
||||
for _, addr := range []string{addr1, addr2} {
|
||||
ip, _, _ := net.ParseCIDR(addr)
|
||||
err := zone.AddRecord(id, name, ip)
|
||||
|
||||
Reference in new issue
Block a user