Add examples/rtl8720dn/udpstation

This commit is contained in:
sago35
2021-07-22 13:25:41 +09:00
committed by Ron Evans
parent 2537c69b0f
commit 58106b5942
7 changed files with 472 additions and 2 deletions
+12
View File
@@ -342,6 +342,18 @@ func (a *TCPAddr) opAddr() Addr {
// ParseIP parses s as an IP address, returning the result.
func ParseIP(s string) IP {
b := strings.Split(s, ".")
if len(b) == 4 {
ip := make([]byte, 4)
for i := range ip {
x, _ := strconv.ParseUint(b[i], 10, 8)
ip[i] = byte(x)
}
return IP(ip)
}
return IP([]byte(s))
}