1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright (c) 2020 Facebook */ 3 /* "undefine" structs in vmlinux.h, because we "override" them below */ 4 #define bpf_iter_meta bpf_iter_meta___not_used 5 #define bpf_iter__bpf_map bpf_iter__bpf_map___not_used 6 #define bpf_iter__ipv6_route bpf_iter__ipv6_route___not_used 7 #define bpf_iter__netlink bpf_iter__netlink___not_used 8 #define bpf_iter__task bpf_iter__task___not_used 9 #define bpf_iter__task_file bpf_iter__task_file___not_used 10 #define bpf_iter__tcp bpf_iter__tcp___not_used 11 #define tcp6_sock tcp6_sock___not_used 12 #define bpf_iter__udp bpf_iter__udp___not_used 13 #define udp6_sock udp6_sock___not_used 14 #define bpf_iter__bpf_map_elem bpf_iter__bpf_map_elem___not_used 15 #define bpf_iter__bpf_sk_storage_map bpf_iter__bpf_sk_storage_map___not_used 16 #include "vmlinux.h" 17 #undef bpf_iter_meta 18 #undef bpf_iter__bpf_map 19 #undef bpf_iter__ipv6_route 20 #undef bpf_iter__netlink 21 #undef bpf_iter__task 22 #undef bpf_iter__task_file 23 #undef bpf_iter__tcp 24 #undef tcp6_sock 25 #undef bpf_iter__udp 26 #undef udp6_sock 27 #undef bpf_iter__bpf_map_elem 28 #undef bpf_iter__bpf_sk_storage_map 29 30 struct bpf_iter_meta { 31 struct seq_file *seq; 32 __u64 session_id; 33 __u64 seq_num; 34 } __attribute__((preserve_access_index)); 35 36 struct bpf_iter__ipv6_route { 37 struct bpf_iter_meta *meta; 38 struct fib6_info *rt; 39 } __attribute__((preserve_access_index)); 40 41 struct bpf_iter__netlink { 42 struct bpf_iter_meta *meta; 43 struct netlink_sock *sk; 44 } __attribute__((preserve_access_index)); 45 46 struct bpf_iter__task { 47 struct bpf_iter_meta *meta; 48 struct task_struct *task; 49 } __attribute__((preserve_access_index)); 50 51 struct bpf_iter__task_file { 52 struct bpf_iter_meta *meta; 53 struct task_struct *task; 54 __u32 fd; 55 struct file *file; 56 } __attribute__((preserve_access_index)); 57 58 struct bpf_iter__bpf_map { 59 struct bpf_iter_meta *meta; 60 struct bpf_map *map; 61 } __attribute__((preserve_access_index)); 62 63 struct bpf_iter__tcp { 64 struct bpf_iter_meta *meta; 65 struct sock_common *sk_common; 66 uid_t uid; 67 } __attribute__((preserve_access_index)); 68 69 struct tcp6_sock { 70 struct tcp_sock tcp; 71 struct ipv6_pinfo inet6; 72 } __attribute__((preserve_access_index)); 73 74 struct bpf_iter__udp { 75 struct bpf_iter_meta *meta; 76 struct udp_sock *udp_sk; 77 uid_t uid __attribute__((aligned(8))); 78 int bucket __attribute__((aligned(8))); 79 } __attribute__((preserve_access_index)); 80 81 struct udp6_sock { 82 struct udp_sock udp; 83 struct ipv6_pinfo inet6; 84 } __attribute__((preserve_access_index)); 85 86 struct bpf_iter__bpf_map_elem { 87 struct bpf_iter_meta *meta; 88 struct bpf_map *map; 89 void *key; 90 void *value; 91 }; 92 93 struct bpf_iter__bpf_sk_storage_map { 94 struct bpf_iter_meta *meta; 95 struct bpf_map *map; 96 struct sock *sk; 97 void *value; 98 }; 99