Skip to content

Commit

Permalink
Create network.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Azumi67 authored Sep 1, 2024
1 parent 7e0750b commit 4f9195c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 1.7/client/network.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package utils

import "net"

func IPv6(ip string) bool {
return net.ParseIP(ip) != nil && net.ParseIP(ip).To4() == nil
}

func DefaultSubnet(ip string) string {
if IPv6(ip) {
return "64"
}
return "24"
}

0 comments on commit 4f9195c

Please sign in to comment.