github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/trace/tcpdrop/tracer/bpf/tcpdrop.h (about)

     1  // SPDX-License-Identifier: GPL-2.0
     2  
     3  #ifndef __TCPDROP_H
     4  #define __TCPDROP_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  struct event {
    18  	union {
    19  		__u8 saddr[16];
    20  		unsigned __int128 saddr_v6;
    21  		__u32 saddr_v4;
    22  	};
    23  	union {
    24  		__u8 daddr[16];
    25  		unsigned __int128 daddr_v6;
    26  		__u32 daddr_v4;
    27  	};
    28  	__u64 timestamp;
    29  	__u16 af; // AF_INET or AF_INET6
    30  	__u16 dport;
    31  	__u16 sport;
    32  	__u8 state;
    33  	__u8 tcpflags;
    34  	__u32 reason;
    35  	__u32 netns;
    36  
    37  	struct proc_ctx proc_current;
    38  	struct proc_ctx proc_socket;
    39  };
    40  
    41  #endif /* __TCPDROP_H */