コード例 #1
0
ファイル: endpoint.go プロジェクト: cilium-team/cilium
func dumpCtProto(file string, ctType ctmap.CtType) {
	fd, err := bpf.ObjGet(file)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Unable to open %s: %s\n", file, err)
		os.Exit(1)
	}

	m := ctmap.CtMap{Fd: fd, Type: ctType}
	out, err := m.Dump()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error while dumping BPF Map: %s\n", err)
		os.Exit(1)
	}

	fmt.Println(out)
}