Skip to content

Helper function bpf_reserve_hdr_opt

v5.10

Definition

Copyright (c) 2015 The Libbpf Authors. All rights reserved.

Reserve len bytes for the bpf header option. The space will be used by bpf_store_hdr_opt() later in BPF_SOCK_OPS_WRITE_HDR_OPT_CB.

If bpf_reserve_hdr_opt() is called multiple times, the total number of bytes will be reserved.

This helper can only be called during BPF_SOCK_OPS_HDR_OPT_LEN_CB.

Returns

0 on success, or negative error in case of failure:

-EINVAL if a parameter is invalid.

-ENOSPC if there is not enough space in the header.

-EPERM if the helper cannot be used under the current skops->op.

static long (* const bpf_reserve_hdr_opt)(struct bpf_sock_ops *skops, __u32 len, __u64 flags) = (void *) 144;

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

This helper call can be used in the following program types:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome