mirror of
				https://github.com/xdp-project/bpf-examples.git
				synced 2024-05-06 15:54:53 +00:00 
			
		
		
		
	
		
			
	
	
		
			21 lines
		
	
	
		
			705 B
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			21 lines
		
	
	
		
			705 B
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/* Common BPF/XDP functions used by userspace side programs */
							 | 
						||
| 
								 | 
							
								#ifndef __COMMON_USER_BPF_XDP_H
							 | 
						||
| 
								 | 
							
								#define __COMMON_USER_BPF_XDP_H
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								int xdp_link_attach(int ifindex, __u32 xdp_flags, int prog_fd);
							 | 
						||
| 
								 | 
							
								int xdp_link_detach(int ifindex, __u32 xdp_flags, __u32 expected_prog_id);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								struct bpf_object *load_bpf_object_file(const char *filename, int ifindex);
							 | 
						||
| 
								 | 
							
								struct bpf_object *load_bpf_and_xdp_attach(struct config *cfg);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								const char *action2str(__u32 action);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								int check_map_fd_info(const struct bpf_map_info *info,
							 | 
						||
| 
								 | 
							
								                      const struct bpf_map_info *exp);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								int open_bpf_map_file(const char *pin_dir,
							 | 
						||
| 
								 | 
							
										      const char *mapname,
							 | 
						||
| 
								 | 
							
										      struct bpf_map_info *info);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* __COMMON_USER_BPF_XDP_H */
							 |