github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/networktracer/bpf/dispatcher.bpf.c (about) 1 // SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR Apache-2.0 2 /* Copyright (c) 2023 The Inspektor Gadget authors */ 3 4 #include <linux/bpf.h> 5 #include <bpf/bpf_helpers.h> 6 7 const volatile __u32 current_netns = 0; 8 9 // Keep in sync with dispatcherMapSpec in tracer.go 10 struct { 11 __uint(type, BPF_MAP_TYPE_PROG_ARRAY); 12 __type(key, __u32); 13 __type(value, __u32); 14 __uint(max_entries, 1); 15 } tail_call SEC(".maps"); 16 17 SEC("socket1") 18 int ig_net_disp(struct __sk_buff *skb) 19 { 20 skb->cb[0] = current_netns; 21 22 bpf_tail_call(skb, &tail_call, 0); 23 24 return 0; 25 } 26 27 char _license[] SEC("license") = "GPL";