Created
October 24, 2015 22:46
-
-
Save chantra/6f2d74e3bc38aadcdc1e 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 netlink | |
import ( | |
"encoding/hex" | |
"fmt" | |
"os/exec" | |
"github.com/vishvananda/netlink/nl" | |
) | |
func runCommand(cmd string, args ...string) { | |
command := exec.Command(cmd, args...) | |
out, err := command.CombinedOutput() | |
if err == nil { | |
fmt.Printf("%s\n", out) | |
} | |
} | |
func dumpRequest(req nl.NetlinkRequest) { | |
out := hex.Dump(req.Serialize()) | |
fmt.Printf("%s\n", out) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment