token-validator: ip, ping, ...
This commit is contained in:
parent
6d6af5f7f4
commit
081b22a64a
5 changed files with 118 additions and 28 deletions
|
|
@ -24,10 +24,13 @@ func showIPs(_ httprouter.Params, body []byte) (interface{}, error) {
|
|||
}
|
||||
|
||||
for _, std := range students {
|
||||
r[std.Login] = make(map[string]string)
|
||||
sid := fmt.Sprintf("%d", std.Id)
|
||||
|
||||
r[std.Login]["vlan0"] = fmt.Sprintf("172.23.0.%d", std.IPSuffix())
|
||||
r[std.Login]["vlan7"] = fmt.Sprintf("172.23.142.%d", std.IPSuffix())
|
||||
r[sid] = make(map[string]string)
|
||||
|
||||
r[sid]["mac"] = std.MAC
|
||||
r[sid]["vlan0"] = fmt.Sprintf("172.23.0.%d", std.IPSuffix())
|
||||
r[sid]["vlan7"] = fmt.Sprintf("172.23.142.%d", std.IPSuffix())
|
||||
}
|
||||
|
||||
return r, nil
|
||||
|
|
|
|||
Reference in a new issue