isNet before merge

nosocat
Jean-Louis Huynen 2019-01-15 10:30:04 +01:00
parent 17e5a53a00
commit 20ec7e97a6
1 changed files with 13 additions and 0 deletions

View File

@ -9,8 +9,10 @@ import (
"fmt"
"io"
"log"
"net"
"os"
"strconv"
"strings"
"time"
//BSD 3
@ -209,6 +211,17 @@ func d4checkConfig(d4 *d4S) bool {
return true
}
func isNet(d []byte) (bool, []string) {
ss := strings.Split(string(d), ":")
if len(ss) != 1 {
if net.ParseIP(ss[0]) != nil {
infof(fmt.Sprintf("Server IP: %s, Server Port: %s\n", ss[0], ss[1]))
return true, make([]string, 0)
}
}
return false, ss
}
func generateUUIDv4() []byte {
uuid, err := uuid.NewV4()
if err != nil {