done 2020
This commit is contained in:
parent
7682cae26c
commit
1d2199aaef
6 changed files with 90 additions and 64 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
|
@ -49,7 +50,7 @@ type TunnelInfo struct {
|
|||
Status string `json:"status"`
|
||||
SrvPubKey []byte `json:"srv_pubkey"`
|
||||
SrvPort uint16 `json:"srv_port"`
|
||||
CltIPv6 string `json:"clt_ipv6"`
|
||||
CltIPv6 net.IP `json:"clt_ipv6"`
|
||||
CltRange uint8 `json:"clt_range"`
|
||||
SrvGW6 string `json:"srv_gw6"`
|
||||
}
|
||||
|
|
@ -241,8 +242,8 @@ func GetStudentsTunnels() (ts []TunnelToken, err error) {
|
|||
}
|
||||
}
|
||||
|
||||
func studentIP(idstd int64) string {
|
||||
return fmt.Sprintf("2a01:e0a:2b:2252:%x::", idstd)
|
||||
func studentIP(idstd int64) net.IP {
|
||||
return net.ParseIP(fmt.Sprintf("2a01:e0a:2b:2252:%x::", idstd))
|
||||
}
|
||||
|
||||
func GenWGConfig(w io.Writer) (error) {
|
||||
|
|
|
|||
Reference in a new issue