Files
linux/include/uapi/linux
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
..
2017-08-31 17:32:38 -04:00
2017-11-24 16:22:58 -07:00
2018-04-24 22:26:58 +02:00
2018-04-23 11:32:01 +02:00
2018-02-23 14:29:59 +00:00
2018-01-25 19:32:55 -05:00
2018-04-17 13:53:13 -04:00
2017-11-08 11:20:49 +09:00
2017-11-28 16:54:00 +01:00
2018-04-11 10:28:37 -07:00
2018-03-05 10:43:37 -05:00
2018-01-14 23:06:30 -05:00
2018-01-16 16:47:29 +01:00
2018-02-06 22:53:56 +00:00
2018-03-20 03:17:41 +02:00
2017-11-24 10:18:41 +00:00
2017-11-16 10:49:00 +09:00
2018-04-11 10:28:37 -07:00
2018-04-11 10:28:37 -07:00
2018-04-19 13:05:16 -04:00
2018-04-19 13:05:16 -04:00
2018-03-31 22:19:52 -04:00
2018-03-23 12:25:54 -04:00
2017-11-27 16:19:52 -05:00
2018-02-06 18:32:44 -08:00
2018-03-26 13:22:58 -06:00