linux/include/uapi
Eyal Birger 12bed760a7 bpf: add helper for getting xfrm states
This commit introduces a helper which allows fetching xfrm state
parameters by eBPF programs attached to TC.

Prototype:
bpf_skb_get_xfrm_state(skb, index, xfrm_state, size, flags)

skb: pointer to skb
index: the index in the skb xfrm_state secpath array
xfrm_state: pointer to 'struct bpf_xfrm_state'
size: size of 'struct bpf_xfrm_state'
flags: reserved for future extensions

The helper returns 0 on success. Non zero if no xfrm state at the index
is found - or non exists at all.

struct bpf_xfrm_state currently includes the SPI, peer IPv4/IPv6
address and the reqid; it can be further extended by adding elements to
its end - indicating the populated fields by the 'size' argument -
keeping backwards compatibility.

Typical usage:

struct bpf_xfrm_state x = {};
bpf_skb_get_xfrm_state(skb, 0, &x, sizeof(x), 0);
...

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-04-24 22:26:58 +02:00
..
asm-generic Merge branch 'parisc-4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2018-04-12 17:07:04 -07:00
drm Linux 4.16-rc7 2018-03-28 14:30:41 +10:00
linux bpf: add helper for getting xfrm states 2018-04-24 22:26:58 +02:00
misc ocxl: Add get_metadata IOCTL to share OCXL information to userspace 2018-03-02 13:02:14 +11:00
mtd License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
rdma IB/mlx5: Device memory support in mlx5_ib 2018-04-05 13:04:49 -06:00
scsi License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
sound ASoC: soc-generic-dmaengine-pcm: Fix sparse warnings 2018-02-26 11:05:12 +00:00
video License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00
xen License cleanup: add SPDX license identifier to uapi header files with a license 2017-11-02 11:20:11 +01:00