Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * BPF programs attached to network namespace
0004  */
0005 
0006 #ifndef __NETNS_BPF_H__
0007 #define __NETNS_BPF_H__
0008 
0009 #include <linux/list.h>
0010 
0011 struct bpf_prog;
0012 struct bpf_prog_array;
0013 
0014 enum netns_bpf_attach_type {
0015     NETNS_BPF_INVALID = -1,
0016     NETNS_BPF_FLOW_DISSECTOR = 0,
0017     NETNS_BPF_SK_LOOKUP,
0018     MAX_NETNS_BPF_ATTACH_TYPE
0019 };
0020 
0021 struct netns_bpf {
0022     /* Array of programs to run compiled from progs or links */
0023     struct bpf_prog_array __rcu *run_array[MAX_NETNS_BPF_ATTACH_TYPE];
0024     struct bpf_prog *progs[MAX_NETNS_BPF_ATTACH_TYPE];
0025     struct list_head links[MAX_NETNS_BPF_ATTACH_TYPE];
0026 };
0027 
0028 #endif /* __NETNS_BPF_H__ */