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

     1  #ifndef GADGET_DNS_COMMON_H
     2  #define GADGET_DNS_COMMON_H
     3  
     4  #define TASK_COMM_LEN 16
     5  
     6  struct event_t {
     7  	// Keep netns at the top: networktracer depends on it
     8  	__u32 netns;
     9  
    10  	__u64 timestamp;
    11  	__u64 mount_ns_id;
    12  	__u32 pid;
    13  	__u32 tid;
    14  	__u32 uid;
    15  	__u32 gid;
    16  	__u8 task[TASK_COMM_LEN];
    17  
    18  	union {
    19  		__u8 saddr_v6[16];
    20  		__u32 saddr_v4;
    21  	};
    22  	union {
    23  		__u8 daddr_v6[16];
    24  		__u32 daddr_v4;
    25  	};
    26  	__u16 af; // AF_INET or AF_INET6
    27  
    28  	// Internet protocol and port numbers.
    29  	__u16 sport;
    30  	__u16 dport;
    31  	__u16 dns_off; // DNS offset in the packet
    32  	__u8 proto;
    33  
    34  	unsigned char pkt_type;
    35  	__u64 latency_ns; // Set only if the packet is a response and pkt_type is 0 (Host).
    36  };
    37  
    38  #endif