Lines Matching +full:parameter +full:- +full:less

1 // SPDX-License-Identifier: GPL-2.0-only
14 /* bpf_xfrm_state_opts - Options for XFRM state lookup helpers
17 * @error - Out parameter, set for any errors encountered
19 * -EINVAL - netns_id is less than -1
20 * -EINVAL - opts__sz isn't BPF_XFRM_STATE_OPTS_SZ
21 * -ENONET - No network namespace found for netns_id
22 * -ENOENT - No xfrm_state found
23 * @netns_id - Specify the network namespace for lookup
25 * BPF_F_CURRENT_NETNS (-1)
29 * @mark - XFRM mark to match on
30 * @daddr - Destination address to match on
31 * @spi - Security parameter index to match on
32 * @proto - IP protocol to match on (eg. IPPROTO_ESP)
33 * @family - Protocol family to match on (AF_INET/AF_INET6)
51 /* bpf_xdp_get_xfrm_state - Get XFRM state
57 * @ctx - Pointer to ctx (xdp_md) in XDP program
59 * @opts - Options for lookup (documented above)
61 * @opts__sz - Length of the bpf_xfrm_state_opts structure
68 struct net *net = dev_net(xdp->rxq->dev); in bpf_xdp_get_xfrm_state()
71 if (!opts || opts__sz < sizeof(opts->error)) in bpf_xdp_get_xfrm_state()
75 opts->error = -EINVAL; in bpf_xdp_get_xfrm_state()
79 if (unlikely(opts->netns_id < BPF_F_CURRENT_NETNS)) { in bpf_xdp_get_xfrm_state()
80 opts->error = -EINVAL; in bpf_xdp_get_xfrm_state()
84 if (opts->netns_id >= 0) { in bpf_xdp_get_xfrm_state()
85 net = get_net_ns_by_id(net, opts->netns_id); in bpf_xdp_get_xfrm_state()
87 opts->error = -ENONET; in bpf_xdp_get_xfrm_state()
92 x = xfrm_state_lookup(net, opts->mark, &opts->daddr, opts->spi, in bpf_xdp_get_xfrm_state()
93 opts->proto, opts->family); in bpf_xdp_get_xfrm_state()
95 if (opts->netns_id >= 0) in bpf_xdp_get_xfrm_state()
98 opts->error = -ENOENT; in bpf_xdp_get_xfrm_state()
103 /* bpf_xdp_xfrm_state_release - Release acquired xfrm_state object
110 * @x - Pointer to referenced xfrm_state object, obtained using