Update tcpconnect to use "__u32 af" instead of "int af"
authormarselester <marselester@gmail.com>
Fri, 21 May 2021 00:36:49 +0000 (20:36 -0400)
committeryonghong-song <ys114321@gmail.com>
Fri, 21 May 2021 02:30:42 +0000 (19:30 -0700)
It helps to decode an address family in Go frontend
generated by bpf2go tool, here is an example
https://github.com/marselester/libbpf-tools/blob/master/cmd/tcpconnect/main.go

libbpf-tools/tcpconnect.h

index 65b768fd8f3d05eb76bdcd8f398d3eb5175494df..fffe70fa0fdc899848acfed7040409983d94f030 100644 (file)
@@ -34,7 +34,7 @@ struct event {
        };
        char task[TASK_COMM_LEN];
        __u64 ts_us;
-       int af; // AF_INET or AF_INET6
+       __u32 af; // AF_INET or AF_INET6
        __u32 pid;
        __u32 uid;
        __u16 dport;