forked from tylertreat/comcast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomcast.go
More file actions
28 lines (24 loc) · 757 Bytes
/
comcast.go
File metadata and controls
28 lines (24 loc) · 757 Bytes
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
package main
import (
"flag"
"github.com/tylertreat/comcast/throttler"
)
func main() {
// TODO: add support for specific host/port.
// Also support for other options like packet reordering, duplication, etc.
var (
device = flag.String("device", "eth0", "interface (device) to use")
mode = flag.String("mode", throttler.Start, "start or stop packet controls")
latency = flag.Int("latency", -1, "latency to add in ms")
bandwidth = flag.Int("bandwidth", -1, "bandwidth limit in kb/s")
packetLoss = flag.Float64("packet-loss", 0, "packet-loss rate")
)
flag.Parse()
throttler.Run(&throttler.Config{
Device: *device,
Mode: *mode,
Latency: *latency,
Bandwidth: *bandwidth,
PacketLoss: *packetLoss,
})
}