test windows

This commit is contained in:
Pascal Fischer
2023-06-12 14:56:30 +02:00
parent 7dfbb71f7a
commit 75d541f967
3 changed files with 103 additions and 97 deletions

View File

@ -27,6 +27,7 @@ func existsInRouteTable(prefix netip.Prefix) (bool, error) {
}
for _, route := range routes {
fmt.Println(routes)
ip := net.ParseIP(route.Mask)
ip = ip.To4()
mask := net.IPv4Mask(ip[0], ip[1], ip[2], ip[3])
@ -34,6 +35,7 @@ func existsInRouteTable(prefix netip.Prefix) (bool, error) {
fmt.Println(route.Destination, "<=>", prefix.Addr().String())
fmt.Println(cidr, "<=>", prefix.Bits())
if route.Destination == prefix.Addr().String() && cidr == prefix.Bits() {
fmt.Println("Found route exists in table")
return true, nil
}
}