func inet_ntoa(ipnr int64) net.IP { |
bytes[0] = byte(ipnr & 0xFF) |
bytes[1] = byte((ipnr >> 8) & 0xFF) |
bytes[2] = byte((ipnr >> 16) & 0xFF) |
bytes[3] = byte((ipnr >> 24) & 0xFF) |
return net.IPv4(bytes[3],bytes[2],bytes[1],bytes[0]) |
func inet_aton(ipnr net.IP) int64 { |
bits := strings.Split(ipnr.String(), "." ) |
b0, _ := strconv.Atoi(bits[0]) |
b1, _ := strconv.Atoi(bits[1]) |
b2, _ := strconv.Atoi(bits[2]) |
b3, _ := strconv.Atoi(bits[3]) |
|