Last active
April 8, 2018 00:50
-
-
Save fbegyn/7f0bd779fc0bf0eca4c780a1b6f552e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/vishvananda/netlink" | |
) | |
func main() { | |
links, _ := netlink.LinkList() | |
link := links[2] | |
fmt.Printf("Selected link: %v \n\n", link) | |
qdiscs, _ := netlink.QdiscList(link) | |
fmt.Printf("QdiscList return: %v \n\n", qdiscs) | |
qdisc := qdiscs[0] | |
fmt.Printf("The type of %v is %s \n", qdisc, qdisc.Type()) | |
fmt.Printf("Qdisc attrs: %v\n\n", qdisc.Attrs()) | |
net := qdisc.(*netlink.Netem) | |
fmt.Println(net.Latency) | |
fmt.Println(net.Jitter) | |
net.Jitter = 156250 | |
fmt.Println(net.Latency) | |
fmt.Println(net.Jitter) | |
err := netlink.QdiscChange(net) | |
if err != nil { | |
fmt.Println(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment