Jiri Pirko | d23b8ad | 2015-01-15 09:52:39 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 Jiri Pirko <jiri@resnulli.us> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | */ |
| 9 | |
| 10 | #ifndef __NET_TC_BPF_H |
| 11 | #define __NET_TC_BPF_H |
| 12 | |
| 13 | #include <linux/filter.h> |
| 14 | #include <net/act_api.h> |
| 15 | |
| 16 | struct tcf_bpf { |
| 17 | struct tcf_common common; |
Alexei Starovoitov | cff8245 | 2015-08-25 20:06:35 -0700 | [diff] [blame] | 18 | struct bpf_prog __rcu *filter; |
Daniel Borkmann | a8cb5f5 | 2015-03-20 15:11:12 +0100 | [diff] [blame] | 19 | union { |
| 20 | u32 bpf_fd; |
| 21 | u16 bpf_num_ops; |
| 22 | }; |
Jiri Pirko | d23b8ad | 2015-01-15 09:52:39 +0100 | [diff] [blame] | 23 | struct sock_filter *bpf_ops; |
Daniel Borkmann | a8cb5f5 | 2015-03-20 15:11:12 +0100 | [diff] [blame] | 24 | const char *bpf_name; |
Jiri Pirko | d23b8ad | 2015-01-15 09:52:39 +0100 | [diff] [blame] | 25 | }; |
| 26 | #define to_bpf(a) \ |
| 27 | container_of(a->priv, struct tcf_bpf, common) |
| 28 | |
| 29 | #endif /* __NET_TC_BPF_H */ |