aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 9ea2d22fa2cb..aa6f8571de13 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -269,9 +269,29 @@ enum bpf_func_id {
269 * Return: 0 on success 269 * Return: 0 on success
270 */ 270 */
271 BPF_FUNC_perf_event_output, 271 BPF_FUNC_perf_event_output,
272 BPF_FUNC_skb_load_bytes,
272 __BPF_FUNC_MAX_ID, 273 __BPF_FUNC_MAX_ID,
273}; 274};
274 275
276/* All flags used by eBPF helper functions, placed here. */
277
278/* BPF_FUNC_skb_store_bytes flags. */
279#define BPF_F_RECOMPUTE_CSUM (1ULL << 0)
280
281/* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags.
282 * First 4 bits are for passing the header field size.
283 */
284#define BPF_F_HDR_FIELD_MASK 0xfULL
285
286/* BPF_FUNC_l4_csum_replace flags. */
287#define BPF_F_PSEUDO_HDR (1ULL << 4)
288
289/* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
290#define BPF_F_INGRESS (1ULL << 0)
291
292/* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */
293#define BPF_F_TUNINFO_IPV6 (1ULL << 0)
294
275/* user accessible mirror of in-kernel sk_buff. 295/* user accessible mirror of in-kernel sk_buff.
276 * new fields can only be added to the end of this structure 296 * new fields can only be added to the end of this structure
277 */ 297 */
@@ -295,7 +315,12 @@ struct __sk_buff {
295 315
296struct bpf_tunnel_key { 316struct bpf_tunnel_key {
297 __u32 tunnel_id; 317 __u32 tunnel_id;
298 __u32 remote_ipv4; 318 union {
319 __u32 remote_ipv4;
320 __u32 remote_ipv6[4];
321 };
322 __u8 tunnel_tos;
323 __u8 tunnel_ttl;
299}; 324};
300 325
301#endif /* _UAPI__LINUX_BPF_H__ */ 326#endif /* _UAPI__LINUX_BPF_H__ */