/
tool_bandwidth_server.go
40 lines (35 loc) · 1.05 KB
/
tool_bandwidth_server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package ros
import (
"strconv"
)
// only manage the default mac-server
func toolBandwidthServer() Command {
return Command{
Path: "/tool bandwidth-server",
Command: "print",
}
}
func (r *Ros) ToolBandwidthServer() (map[string]string, error) {
return r.Values(toolBandwidthServer())
}
func setToolBandwidthServer(key, value string) Command {
return Command{
Path: "/tool bandwidth-server",
Command: "set",
Params: map[string]string{
key: value,
},
}
}
func (r *Ros) SetToolBandwidthServerEnabled(enabled bool) error {
return r.Exec(setToolBandwidthServer("enabled", FormatBool(enabled)))
}
func (r *Ros) SetToolBandwidthServerAuthenticate(auth bool) error {
return r.Exec(setToolBandwidthServer("authenticate", FormatBool(auth)))
}
func (r *Ros) SetToolBandwidthServerAllocateUdpPortsFrom(port int) error {
return r.Exec(setToolBandwidthServer("allocate-udp-ports-from", strconv.Itoa(port)))
}
func (r *Ros) SetToolBandwidthServerMaxSessions(sessions int) error {
return r.Exec(setToolBandwidthServer("max-sessions", strconv.Itoa(sessions)))
}