github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/trace/tcpretrans/tracer/bpf/tcpretrans.h (about) 1 // SPDX-License-Identifier: GPL-2.0 2 3 #ifndef __TCPRETRAMS_H 4 #define __TCPRETRAMS_H 5 6 #define TASK_COMM_LEN 16 7 8 struct proc_ctx { 9 __u64 mount_ns_id; 10 __u32 pid; 11 __u32 tid; 12 __u32 uid; 13 __u32 gid; 14 __u8 task[TASK_COMM_LEN]; 15 }; 16 17 enum type { 18 RETRANS, 19 LOSS, 20 }; 21 22 struct event { 23 union { 24 __u8 saddr[16]; 25 unsigned __int128 saddr_v6; 26 __u32 saddr_v4; 27 }; 28 union { 29 __u8 daddr[16]; 30 unsigned __int128 daddr_v6; 31 __u32 daddr_v4; 32 }; 33 __u64 timestamp; 34 __u16 af; // AF_INET or AF_INET6 35 __u16 dport; 36 __u16 sport; 37 __u8 state; 38 __u8 tcpflags; 39 __u32 reason; 40 __u32 netns; 41 enum type type; 42 43 struct proc_ctx proc_current; 44 struct proc_ctx proc_socket; 45 }; 46 47 #endif /* __TCPRETRAMS_H */