* dhcp: move HTTP handlers to dhcpd/

This commit is contained in:
Simon Zolin
2019-10-11 19:56:18 +03:00
parent 149fcc0f2d
commit 477a4bbf54
6 changed files with 480 additions and 442 deletions

View File

@@ -1,7 +1,6 @@
package home
import (
"bytes"
"context"
"errors"
"fmt"
@@ -338,21 +337,6 @@ func _Func() string {
return path.Base(f.Name())
}
// Parse input string and return IPv4 address
func parseIPv4(s string) net.IP {
ip := net.ParseIP(s)
if ip == nil {
return nil
}
v4InV6Prefix := []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff}
if !bytes.Equal(ip[0:12], v4InV6Prefix) {
return nil
}
return ip.To4()
}
// SplitNext - split string by a byte and return the first chunk
// Whitespace is trimmed
func SplitNext(str *string, splitBy byte) string {