.. | .. |
---|
30 | 30 | int (*orig_output)(struct net *net, struct sock *sk, struct sk_buff *skb); |
---|
31 | 31 | int (*orig_input)(struct sk_buff *); |
---|
32 | 32 | struct rcu_head rcu; |
---|
33 | | - __u8 data[0]; |
---|
| 33 | + __u8 data[]; |
---|
34 | 34 | }; |
---|
35 | 35 | |
---|
36 | 36 | struct lwtunnel_encap_ops { |
---|
37 | | - int (*build_state)(struct nlattr *encap, |
---|
| 37 | + int (*build_state)(struct net *net, struct nlattr *encap, |
---|
38 | 38 | unsigned int family, const void *cfg, |
---|
39 | 39 | struct lwtunnel_state **ts, |
---|
40 | 40 | struct netlink_ext_ack *extack); |
---|
.. | .. |
---|
113 | 113 | struct netlink_ext_ack *extack); |
---|
114 | 114 | int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int len, |
---|
115 | 115 | struct netlink_ext_ack *extack); |
---|
116 | | -int lwtunnel_build_state(u16 encap_type, |
---|
| 116 | +int lwtunnel_build_state(struct net *net, u16 encap_type, |
---|
117 | 117 | struct nlattr *encap, |
---|
118 | 118 | unsigned int family, const void *cfg, |
---|
119 | 119 | struct lwtunnel_state **lws, |
---|
120 | 120 | struct netlink_ext_ack *extack); |
---|
121 | | -int lwtunnel_fill_encap(struct sk_buff *skb, |
---|
122 | | - struct lwtunnel_state *lwtstate); |
---|
| 121 | +int lwtunnel_fill_encap(struct sk_buff *skb, struct lwtunnel_state *lwtstate, |
---|
| 122 | + int encap_attr, int encap_type_attr); |
---|
123 | 123 | int lwtunnel_get_encap_size(struct lwtunnel_state *lwtstate); |
---|
124 | 124 | struct lwtunnel_state *lwtunnel_state_alloc(int hdr_len); |
---|
125 | 125 | int lwtunnel_cmp_encap(struct lwtunnel_state *a, struct lwtunnel_state *b); |
---|
126 | 126 | int lwtunnel_output(struct net *net, struct sock *sk, struct sk_buff *skb); |
---|
127 | 127 | int lwtunnel_input(struct sk_buff *skb); |
---|
128 | 128 | int lwtunnel_xmit(struct sk_buff *skb); |
---|
| 129 | +int bpf_lwt_push_ip_encap(struct sk_buff *skb, void *hdr, u32 len, |
---|
| 130 | + bool ingress); |
---|
129 | 131 | |
---|
130 | 132 | static inline void lwtunnel_set_redirect(struct dst_entry *dst) |
---|
131 | 133 | { |
---|
.. | .. |
---|
207 | 209 | return 0; |
---|
208 | 210 | } |
---|
209 | 211 | |
---|
210 | | -static inline int lwtunnel_build_state(u16 encap_type, |
---|
| 212 | +static inline int lwtunnel_build_state(struct net *net, u16 encap_type, |
---|
211 | 213 | struct nlattr *encap, |
---|
212 | 214 | unsigned int family, const void *cfg, |
---|
213 | 215 | struct lwtunnel_state **lws, |
---|
.. | .. |
---|
217 | 219 | } |
---|
218 | 220 | |
---|
219 | 221 | static inline int lwtunnel_fill_encap(struct sk_buff *skb, |
---|
220 | | - struct lwtunnel_state *lwtstate) |
---|
| 222 | + struct lwtunnel_state *lwtstate, |
---|
| 223 | + int encap_attr, int encap_type_attr) |
---|
221 | 224 | { |
---|
222 | 225 | return 0; |
---|
223 | 226 | } |
---|