brintos

brintos / linux-shallow public Read only

0
0
Text · 4.2 KiB · c41ee80 Raw
168 lines · c
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_used5#define bpf_iter__bpf_map bpf_iter__bpf_map___not_used6#define bpf_iter__ipv6_route bpf_iter__ipv6_route___not_used7#define bpf_iter__netlink bpf_iter__netlink___not_used8#define bpf_iter__task bpf_iter__task___not_used9#define bpf_iter__task_file bpf_iter__task_file___not_used10#define bpf_iter__task_vma bpf_iter__task_vma___not_used11#define bpf_iter__tcp bpf_iter__tcp___not_used12#define tcp6_sock tcp6_sock___not_used13#define bpf_iter__udp bpf_iter__udp___not_used14#define udp6_sock udp6_sock___not_used15#define bpf_iter__unix bpf_iter__unix___not_used16#define bpf_iter__bpf_map_elem bpf_iter__bpf_map_elem___not_used17#define bpf_iter__bpf_sk_storage_map bpf_iter__bpf_sk_storage_map___not_used18#define bpf_iter__sockmap bpf_iter__sockmap___not_used19#define bpf_iter__bpf_link bpf_iter__bpf_link___not_used20#define bpf_iter__cgroup bpf_iter__cgroup___not_used21#define btf_ptr btf_ptr___not_used22#define BTF_F_COMPACT BTF_F_COMPACT___not_used23#define BTF_F_NONAME BTF_F_NONAME___not_used24#define BTF_F_PTR_RAW BTF_F_PTR_RAW___not_used25#define BTF_F_ZERO BTF_F_ZERO___not_used26#define bpf_iter__ksym bpf_iter__ksym___not_used27#include "vmlinux.h"28#undef bpf_iter_meta29#undef bpf_iter__bpf_map30#undef bpf_iter__ipv6_route31#undef bpf_iter__netlink32#undef bpf_iter__task33#undef bpf_iter__task_file34#undef bpf_iter__task_vma35#undef bpf_iter__tcp36#undef tcp6_sock37#undef bpf_iter__udp38#undef udp6_sock39#undef bpf_iter__unix40#undef bpf_iter__bpf_map_elem41#undef bpf_iter__bpf_sk_storage_map42#undef bpf_iter__sockmap43#undef bpf_iter__bpf_link44#undef bpf_iter__cgroup45#undef btf_ptr46#undef BTF_F_COMPACT47#undef BTF_F_NONAME48#undef BTF_F_PTR_RAW49#undef BTF_F_ZERO50#undef bpf_iter__ksym51 52struct bpf_iter_meta {53	struct seq_file *seq;54	__u64 session_id;55	__u64 seq_num;56} __attribute__((preserve_access_index));57 58struct bpf_iter__ipv6_route {59	struct bpf_iter_meta *meta;60	struct fib6_info *rt;61} __attribute__((preserve_access_index));62 63struct bpf_iter__netlink {64	struct bpf_iter_meta *meta;65	struct netlink_sock *sk;66} __attribute__((preserve_access_index));67 68struct bpf_iter__task {69	struct bpf_iter_meta *meta;70	struct task_struct *task;71} __attribute__((preserve_access_index));72 73struct bpf_iter__task_file {74	struct bpf_iter_meta *meta;75	struct task_struct *task;76	__u32 fd;77	struct file *file;78} __attribute__((preserve_access_index));79 80struct bpf_iter__task_vma {81	struct bpf_iter_meta *meta;82	struct task_struct *task;83	struct vm_area_struct *vma;84} __attribute__((preserve_access_index));85 86struct bpf_iter__bpf_map {87	struct bpf_iter_meta *meta;88	struct bpf_map *map;89} __attribute__((preserve_access_index));90 91struct bpf_iter__tcp {92	struct bpf_iter_meta *meta;93	struct sock_common *sk_common;94	uid_t uid;95} __attribute__((preserve_access_index));96 97struct tcp6_sock {98	struct tcp_sock	tcp;99	struct ipv6_pinfo inet6;100} __attribute__((preserve_access_index));101 102struct bpf_iter__udp {103	struct bpf_iter_meta *meta;104	struct udp_sock *udp_sk;105	uid_t uid __attribute__((aligned(8)));106	int bucket __attribute__((aligned(8)));107} __attribute__((preserve_access_index));108 109struct udp6_sock {110	struct udp_sock	udp;111	struct ipv6_pinfo inet6;112} __attribute__((preserve_access_index));113 114struct bpf_iter__unix {115	struct bpf_iter_meta *meta;116	struct unix_sock *unix_sk;117	uid_t uid;118} __attribute__((preserve_access_index));119 120struct bpf_iter__bpf_map_elem {121	struct bpf_iter_meta *meta;122	struct bpf_map *map;123	void *key;124	void *value;125};126 127struct bpf_iter__bpf_sk_storage_map {128	struct bpf_iter_meta *meta;129	struct bpf_map *map;130	struct sock *sk;131	void *value;132};133 134struct bpf_iter__sockmap {135	struct bpf_iter_meta *meta;136	struct bpf_map *map;137	void *key;138	struct sock *sk;139};140 141struct bpf_iter__bpf_link {142	struct bpf_iter_meta *meta;143	struct bpf_link *link;144};145 146struct bpf_iter__cgroup {147	struct bpf_iter_meta *meta;148	struct cgroup *cgroup;149} __attribute__((preserve_access_index));150 151struct btf_ptr {152	void *ptr;153	__u32 type_id;154	__u32 flags;155};156 157enum {158	BTF_F_COMPACT	=	(1ULL << 0),159	BTF_F_NONAME	=	(1ULL << 1),160	BTF_F_PTR_RAW	=	(1ULL << 2),161	BTF_F_ZERO	=	(1ULL << 3),162};163 164struct bpf_iter__ksym {165	struct bpf_iter_meta *meta;166	struct kallsym_iter *ksym;167};168