Lines Matching +full:five +full:- +full:cell

1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
21 #define BPF_DW 0x18 /* double word (64-bit) */
23 #define BPF_ATOMIC 0xc0 /* atomic memory ops - op type in immediate */
24 #define BPF_XADD 0xc0 /* exclusive add - legacy name */
32 #define BPF_TO_LE 0x00 /* convert to little-endian */
33 #define BPF_TO_BE 0x08 /* convert to big-endian */
51 #define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
69 /* BPF has 10 general purpose 64-bit registers and stack frame. */
94 BPF_CGROUP_ITER_DESCENDANTS_PRE, /* walk descendants in pre-order. */
95 BPF_CGROUP_ITER_DESCENDANTS_POST, /* walk descendants in post-order. */
106 /* At most one of cgroup_fd and cgroup_id can be non-zero. If
122 /* BPF syscall commands, see bpf(2) man-page for more details. */
137 * map. The close-on-exec file descriptor flag (see **fcntl**\ (2))
144 * A new file descriptor (a nonnegative integer), or -1 if an
156 * Look up the value of a spin-locked map without
161 * Returns zero on success. On error, -1 is returned and *errno*
178 * Update a spin_lock-ed map element.
181 * Returns zero on success. On error, -1 is returned and *errno*
202 * Returns zero on success. On error, -1 is returned and *errno*
212 * Returns zero on success. On error, -1 is returned and *errno*
222 * * If *key* is the last element, returns -1 and *errno* is set
236 * The close-on-exec file descriptor flag (see **fcntl**\ (2)) is
240 * A new file descriptor (a nonnegative integer), or -1 if an
265 * Returns zero on success. On error, -1 is returned and *errno*
274 * A new file descriptor (a nonnegative integer), or -1 if an
320 * Returns zero on success. On error, -1 is returned and *errno*
330 * Returns zero on success. On error, -1 is returned and *errno*
362 * Returns zero on success. On error, -1 is returned and *errno*
377 * remain with ids higher than *start_id*, returns -1 and sets
381 * Returns zero on success. On error, or when no id remains, -1
390 * remain with ids higher than *start_id*, returns -1 and sets
394 * Returns zero on success. On error, or when no id remains, -1
403 * A new file descriptor (a nonnegative integer), or -1 if an
412 * A new file descriptor (a nonnegative integer), or -1 if an
430 * Returns zero on success. On error, -1 is returned and *errno*
476 * Returns zero on success. On error, -1 is returned and *errno*
494 * A new file descriptor (a nonnegative integer), or -1 if an
517 * A new file descriptor (a nonnegative integer), or -1 if an
526 * A new file descriptor (a nonnegative integer), or -1 if an
547 * Returns zero on success. On error, -1 is returned and *errno*
560 * Look up and delete the value of a spin-locked map
579 * Returns zero on success. On error, -1 is returned and *errno*
594 * Returns zero on success. On error, -1 is returned and *errno*
604 * remain with ids higher than *start_id*, returns -1 and sets
608 * Returns zero on success. On error, or when no id remains, -1
632 * Look up the value of a spin-locked map without
644 * Returns zero on success. On error, -1 is returned and *errno*
649 * iteration of a hash-based map type.
666 * Returns zero on success. On error, -1 is returned and *errno*
693 * Update spin_lock-ed map elements. This must be
702 * Returns zero on success. On error, -1 is returned and *errno*
736 * Look up the value of a spin-locked map without
748 * Returns zero on success. On error, -1 is returned and *errno*
758 * A new file descriptor (a nonnegative integer), or -1 if an
767 * Returns zero on success. On error, -1 is returned and *errno*
776 * A new file descriptor (a nonnegative integer), or -1 if an
785 * remain with ids higher than *start_id*, returns -1 and sets
789 * Returns zero on success. On error, or when no id remains, -1
804 * disabled system-wide when all outstanding file descriptors
808 * A new file descriptor (a nonnegative integer), or -1 if an
823 * A new file descriptor (a nonnegative integer), or -1 if an
832 * Returns zero on success. On error, -1 is returned and *errno*
847 * Returns zero on success. On error, -1 is returned and *errno*
929 * both cgroup-attached and other progs and supports all functionality
1092 /* cgroup-bpf attach flags used in BPF_PROG_ATTACH command
1096 * BPF_F_ALLOW_OVERRIDE: If a sub-cgroup installs some bpf program,
1097 * the program in this cgroup yields to sub-cgroup program.
1099 * BPF_F_ALLOW_MULTI: If a sub-cgroup installs some bpf program,
1110 * The programs of sub-cgroup are executed first, then programs of
1120 * A cgroup with MULTI or OVERRIDE flag allows any attach flags in sub-cgroups.
1121 * A cgroup with NONE doesn't allow any programs in sub-cgroups.
1123 * cgrp1 (MULTI progs A, B) ->
1124 * cgrp2 (OVERRIDE prog C) ->
1125 * cgrp3 (MULTI prog D) ->
1126 * cgrp4 (OVERRIDE prog E) ->
1167 * Verifier does sub-register def/use analysis and identifies instructions whose
1168 * def only matters for low 32-bit, high 32-bit is never referenced later
1169 * through implicit zero extension. Therefore verifier notifies JIT back-ends
1170 * that it is safe to ignore clearing high 32-bit for these instructions. This
1171 * saves some back-ends a lot of code-gen. However such optimization is not
1172 * necessary on some arches, for example x86_64, arm64 etc, whose JIT back-ends
1178 * 32-bit for those instructions who has been identified as safe to ignore them.
1201 * program becomes device-bound but can access XDP metadata.
1272 /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
1276 /* when bpf_call->src_reg == BPF_PSEUDO_KFUNC_CALL,
1277 * bpf_call->imm == btf_id of a BTF_KIND_FUNC in the running kernel
1286 BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */
1309 /* Zero-initialize hash function seed. This should only be used for testing. */
1319 /* Enable memory-mapping BPF map */
1395 __u32 btf_vmlinux_value_type_id;/* BTF type_id of a kernel-
1399 /* Any per-map-type extra fields
1401 * BPF_MAP_TYPE_BLOOM_FILTER - the lowest 4 bits indicate the
1459 __u32 attach_btf_id; /* in-kernel BTF type id to attach to */
1562 /* output: per-program attach_flags.
1623 /* black box user-provided value passed through
1639 /* black box user-provided value passed through
1725 * --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst
1726 * $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.7
1727 * $ man /tmp/bpf-helpers.7
1787 * This helper is a "printk()-like" facility for debugging. It
1792 * limited to five).
1805 * telnet-470 [001] .N.. 419421.045894: 0x00000001: <formatted msg>
1830 * helper will return **-EINVAL** (but print nothing) if it
1846 * Get a pseudo-random number.
1849 * pseudo-random internal state, and cannot be used to infer the
1854 * A random 32-bit unsigned value.
1871 * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\
1872 * **->swhash** and *skb*\ **->l4hash** to 0).
1895 * which does not update the checksum in-place, but offers more
1924 * the checksum is to be computed against a pseudo-header.
1927 * which does not update the checksum in-place, but offers more
2000 * A 64-bit integer containing the current tgid and pid, and
2002 * *current_task*\ **->tgid << 32 \|**
2003 * *current_task*\ **->pid**.
2009 * A 64-bit integer containing the current GID and UID, and
2018 * helper makes sure that the *buf* is NUL-terminated. On failure,
2031 * based on a user-provided identifier for all traffic coming from
2034 * *Documentation/admin-guide/cgroup-v1/net_cls.rst*.
2040 * run on cgroups, which is a cgroup-v2-only feature (a socket can
2092 * in *key*\ **->remote_ipv4** or *key*\ **->remote_ipv6**. Also,
2093 * this struct exposes the *key*\ **->tunnel_id**, which is
2174 * is the number of available CPUs, and each cell contains a value
2224 * identifier retrieved is a user-provided tag, similar to the
2230 * (see also **tc-bpf(8)**), or alternatively on conventional
2298 * manipulated with *skb*\ **->data** and *skb*\ **->data_end**
2329 * generating a variety of graphs (such as flame graphs or off-cpu
2387 * and retrieving arbitrary TLVs (Type-Length-Value headers) from
2433 * comes down to setting *skb*\ **->pkt_type** to *type*, except
2435 * **->pkt_type** beside this helper. Using a helper here allows
2470 * Retrieve the hash of the packet, *skb*\ **->hash**. If it is
2473 * directly with *skb*\ **->hash**.
2482 * The 32-bit hash.
2497 * security mechanism because of TOC-TOU attacks, but rather to
2498 * debug, divert, and manipulate execution of semi-cooperative
2547 * Pull in non-linear data in case the *skb* is non-linear and not
2557 * are within packet boundaries (test on *skb*\ **->data_end**) is
2559 * data is in non-linear parts of the *skb*. On failure the
2560 * program can just bail out, or in the case of a non-linear
2564 * to pull in once the non-linear parts, then retesting and
2584 * Add the checksum *csum* into *skb*\ **->csum** in case the
2596 * Invalidate the current *skb*\ **->hash**. It can be used after
2638 * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that
2674 * A 8-byte long unique number on success, or 0 if the socket
2682 * A 8-byte long unique number.
2689 * A 8-byte long unique number.
2697 * A 8-byte long unique number or 0 if *sk* is NULL.
2705 * time-wait or a request socket instead), **overflowuid** value
2711 * Set the full hash for *skb* (set the field *skb*\ **->hash**)
2866 * Adjust the address pointed by *xdp_md*\ **->data_meta** by
2868 * operation modifies the address stored in *xdp_md*\ **->data**,
2872 * The use of *xdp_md*\ **->data_meta** is optional and programs
2878 * this up for further post-processing. Since TC works with socket
2900 * available CPUs, and each cell contains a value relative to one
2912 * **->enabled** and *buf*\ **->running**, respectively) are
3030 * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)**
3041 * Code **-EINVAL** if the socket is not a full TCP socket;
3081 * *bytes* will be sent and the eBPF program will be re-run with
3089 * a non-zero value, this is not a problem because data is not
3104 * 1-byte long message segments. Obviously, this is bad for
3114 * For socket policies, pull in non-linear data from user space
3115 * for *msg* and set pointers *msg*\ **->data** and *msg*\
3116 * **->data_end** to *start* and *end* bytes offsets into *msg*,
3152 * domain (*addr*\ **->sa_family**) must be **AF_INET** (or
3154 * or **sin6_port**) which triggers IP_BIND_ADDRESS_NO_PORT-like
3156 * port as long as 4-tuple is unique. Passing non-zero port might
3163 * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is
3178 * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*.
3215 * adjusted by adding (sh_addr - sh_offset), where
3231 * The non-negative copied *buf* length equal to or less than
3250 * in socket filters where *skb*\ **->data** does not always point
3277 * Use the routing table ID present in *params*->tbid
3283 * Skip the neighbour table lookup. *params*->dmac
3284 * and *params*->smac will not be set as output. A common
3288 * Derive and set source IP addr in *params*->ipv{4,6}_src
3291 * case, *params*->dmac and *params*->smac are not set either.
3302 * was exceeded and output params->mtu_result contains the MTU.
3427 * End.X action: Endpoint with Layer-3 cross-connect.
3501 * to the same 64-bit id.
3514 * A 64-bit integer containing the current cgroup id based
3566 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3574 * **sizeof**\ (*tuple*\ **->ipv4**)
3576 * **sizeof**\ (*tuple*\ **->ipv6**)
3579 * If the *netns* is a negative signed 32-bit integer, then the
3583 * If *netns* is any other signed 32-bit value greater than or
3586 * range of 32-bit integers are reserved for future use.
3596 * result is from *reuse*\ **->socks**\ [] using the hash of the
3603 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3611 * **sizeof**\ (*tuple*\ **->ipv4**)
3613 * **sizeof**\ (*tuple*\ **->ipv6**)
3616 * If the *netns* is a negative signed 32-bit integer, then the
3620 * If *netns* is any other signed 32-bit value greater than or
3623 * range of 32-bit integers are reserved for future use.
3633 * result is from *reuse*\ **->socks**\ [] using the hash of the
3639 * non-**NULL** pointer that was returned from
3729 * allowed inside a spinlock-ed region.
3752 * * **bpf_spin_lock** is not allowed in inner maps of map-in-map.
3801 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3813 * result is from *reuse*\ **->socks**\ [] using the hash of the
3837 * The buffer is always NUL terminated, unless it's zero-sized.
3845 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3857 * The buffer is always NUL terminated, unless it's zero-sized.
3861 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3864 * **-EINVAL** if current value was unavailable, e.g. because
3865 * sysctl is uninitialized and read returns -EIO for it.
3875 * The buffer is always NUL terminated, unless it's zero-sized.
3879 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3882 * **-EINVAL** if sysctl is being read.
3897 * **-E2BIG** if the *buf_len* is too big.
3899 * **-EINVAL** if sysctl is being read.
3909 * optional '**-**' sign.
3911 * Five least significant bits of *flags* encode base, other bits
3920 * **-EINVAL** if no valid digits were found or unsupported base
3923 * **-ERANGE** if resulting value was out of range.
3934 * Five least significant bits of *flags* encode base, other bits
3943 * **-EINVAL** if no valid digits were found or unsupported base
3946 * **-ERANGE** if resulting value was out of range.
3950 * Get a bpf-local-storage from a *sk*.
3960 * the *map*. The *map* is used as the bpf-local-storage
3961 * "type". The bpf-local-storage "type" (i.e. the *map*) is
3962 * searched against all bpf-local-storages residing at *sk*.
3968 * used such that a new bpf-local-storage will be
3971 * the initial value of a bpf-local-storage. If *value* is
3972 * **NULL**, the new bpf-local-storage will be zero initialized.
3974 * A bpf-local-storage pointer is returned on success.
3977 * a new bpf-local-storage.
3981 * Delete a bpf-local-storage from a *sk*.
3985 * **-ENOENT** if the bpf-local-storage cannot be found.
3986 * **-EINVAL** if sk is not a fullsock (e.g. a request_sock).
3995 * **-EBUSY** if work queue under nmi is full.
3997 * **-EINVAL** if *sig* is invalid.
3999 * **-EPERM** if no permission to send the *sig*.
4001 * **-EAGAIN** if bpf program can try again.
4022 * **-EINVAL** SYN cookie cannot be issued due to error
4024 * **-ENOENT** SYN cookie should not be issued (no SYN flood)
4026 * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies
4028 * **-EPROTONOSUPPORT** IP packet version is not 4 or 6
4047 * *ctx* is a pointer to in-kernel struct sk_buff.
4074 * string length is larger than *size*, just *size*-1 bytes are
4089 * ctx->di);
4104 * *current*\ **->mm->arg_start** and *current*\
4105 * **->mm->env_start**: using this helper and the return value,
4122 * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**.
4133 * **-EBUSY** if work queue under nmi is full.
4135 * **-EINVAL** if *sig* is invalid.
4137 * **-EPERM** if no permission to send the *sig*.
4139 * **-EAGAIN** if bpf program can try again.
4161 * **-EINVAL** if arguments invalid or **size** not a multiple
4164 * **-ENOENT** if architecture does not support branch records.
4173 * **-EINVAL** if dev and inum supplied don't match dev_t and inode number
4176 * **-ENOENT** if pidns does not exists for the current task.
4195 * *ctx* is a pointer to in-kernel struct xdp_buff.
4213 * A 8-byte long opaque number.
4252 * **-EINVAL** if specified *flags* are not supported.
4254 * **-ENOENT** if the socket is unavailable for assignment.
4256 * **-ENETUNREACH** if the socket is unreachable (wrong netns).
4258 * **-EOPNOTSUPP** if the operation is not supported, for example
4274 * that are not v6-only can be selected for IPv4 packets.
4287 * load-balancing within reuseport group for the socket
4290 * On success *ctx->sk* will point to the selected socket.
4295 * * **-EAFNOSUPPORT** if socket family (*sk->family*) is
4296 * not compatible with packet family (*ctx->family*).
4298 * * **-EEXIST** if socket has been already selected,
4302 * * **-EINVAL** if unsupported flags were specified.
4304 * * **-EPROTOTYPE** if socket L4 protocol
4305 * (*sk->protocol*) doesn't match packet protocol
4306 * (*ctx->protocol*).
4308 * * **-ESOCKTNOSUPPORT** if socket is not in allowed
4328 * The *data_len* is the size of *data* in bytes - must be a multiple of 8.
4339 * **-EBUSY** if per-CPU memory copy buffer is busy, can try again
4342 * **-EINVAL** if arguments are invalid, or if *fmt* is invalid/unsupported.
4344 * **-E2BIG** if *fmt* contains too many format specifiers.
4346 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4356 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4362 * *sk* must be a non-**NULL** pointer to a socket, e.g. one
4400 * An adaptive notification is a notification sent whenever the user-space
4401 * process has caught up and consumed all available payloads. In case the user-space
4478 * * **BPF_CSUM_LEVEL_INC**: Increases skb->csum_level for skbs
4480 * * **BPF_CSUM_LEVEL_DEC**: Decreases skb->csum_level for skbs
4482 * * **BPF_CSUM_LEVEL_RESET**: Resets skb->csum_level to 0 and
4484 * * **BPF_CSUM_LEVEL_QUERY**: No-op, returns the current
4485 * skb->csum_level.
4488 * case of **BPF_CSUM_LEVEL_QUERY**, the current skb->csum_level
4489 * is returned or the error code -EACCES in case the skb is not
4526 * the current task; all other tasks will return -EOPNOTSUPP.
4554 * The non-negative copied *buf* length equal to or less than
4563 * *skops*\ **->skb_data**. The comment in **struct bpf_sock_ops**
4565 * *skops*\ **->op**.
4575 * the 2nd byte which is "kind-length" of a TCP
4576 * header option and the "kind-length" also
4577 * includes the first 2 bytes "kind" and "kind-length"
4586 * Note, kind-length must be 0 for regular option.
4588 * Searching for No-Op (0) and End-of-Option-List (1) are
4597 * saved_syn packet or the just-received syn packet.
4604 * **-EINVAL** if a parameter is invalid.
4606 * **-ENOMSG** if the option is not found.
4608 * **-ENOENT** if no syn packet is available when
4611 * **-ENOSPC** if there is not enough space. Only *len* number of
4614 * **-EFAULT** on failure to parse the header options in the
4617 * **-EPERM** if the helper cannot be used under the current
4618 * *skops*\ **->op**.
4626 * includes the kind, kind-length, and the actual
4627 * option data. The *len* must be at least kind-length
4628 * long. The kind-length does not have to be 4 byte
4630 * and setting the 4 bytes aligned value to th->doff.
4641 * **-EINVAL** If param is invalid.
4643 * **-ENOSPC** if there is not enough space in the header.
4646 * **-EEXIST** if the option already exists.
4648 * **-EFAULT** on failure to parse the existing header options.
4650 * **-EPERM** if the helper cannot be used under the current
4651 * *skops*\ **->op**.
4668 * **-EINVAL** if a parameter is invalid.
4670 * **-ENOSPC** if there is not enough space in the header.
4672 * **-EPERM** if the helper cannot be used under the current
4673 * *skops*\ **->op**.
4687 * the *map*. The *map* is used as the bpf-local-storage
4688 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4709 * **-ENOENT** if the bpf_local_storage cannot be found.
4732 * Use BTF to store a string representation of *ptr*->ptr in *str*,
4733 * using *ptr*->type_id. This value should specify the type
4734 * that *ptr*->ptr points to. LLVM __builtin_btf_type_id(type, 1)
4737 * stored in the first *str_size* - 1 bytes of *str*. Safe copy of
4758 * show zero-valued struct/union members; they
4769 * *ptr*->ptr, using *ptr*->type_id as per bpf_snprintf_btf().
4861 * the *map*. The *map* is used as the bpf-local-storage
4862 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4883 * **-ENOENT** if the bpf_local_storage cannot be found.
4901 * **-EINVAL** if invalid *flags* are passed, zero otherwise.
4905 * Return a coarse-grained version of the time elapsed since
4920 * **-EOPNOTSUP** if IMA is disabled or **-EINVAL** if
4955 * this value is L3 as this correlate to MTU and IP-header tot_len
4974 * possible for the skb packet to get re-segmented
4984 * MTU value in your BPF-code.
5001 * **map**, **callback_ctx** and other map-specific parameters.
5024 * The number of traversed map elements for success, **-EINVAL** for
5030 * based on a format string stored in a read-only map pointed by
5036 * array. The *data_len* is the size of *data* in bytes - must be
5051 * be zero-terminated except when **str_size** is 0.
5053 * Or **-EBUSY** if the per-CPU memory copy buffer is busy.
5083 * **-EBUSY** if *timer* is already initialized.
5084 * **-EINVAL** if invalid *flags* are passed.
5085 * **-EPERM** if *timer* is in a map that doesn't have any user references.
5095 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
5096 * **-EPERM** if *timer* is in a map that doesn't have any user references.
5112 * decremented. This is done to make sure that Ctrl-C of a user
5114 * bpffs the callback_fn can re-arm itself indefinitely.
5117 * The map can contain timers that invoke callback_fn-s from different
5132 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier
5141 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
5142 * **-EDEADLK** if callback_fn tried to call bpf_timer_cancel() on its
5165 * - kprobe/uprobe;
5166 * - tracepoint;
5167 * - perf_event.
5195 * **-EINVAL** if *flags* is not zero.
5197 * **-ENOENT** if architecture does not support branch records.
5222 * **-EINVAL** if *flags* is not zero.
5224 * **-EINVAL** if string *name* is not the same size as *name_sz*.
5226 * **-ENOENT** if symbol is not found.
5228 * **-EPERM** if caller does not have permission to obtain kernel address.
5245 * **-ENOENT** if *task->mm* is NULL, or no vma contains *addr*.
5246 * **-EBUSY** if failed to try lock mmap_lock.
5247 * **-EINVAL** for invalid **flags**.
5262 * is zero-indexed.
5270 * The number of loops performed, **-EINVAL** for invalid **flags**,
5271 * **-E2BIG** if **nr_loops** exceeds the maximum number of loops.
5276 * to be null-terminated and **s1_sz** is the maximum storage
5277 * size of **s1**. **s2** must be a read-only string.
5285 * Get **n**-th argument register (zero based) of the traced function (for tracing programs)
5290 * **-EINVAL** if n >= argument register count of traced function.
5299 * **-EOPNOTSUPP** for tracing programs other than BPF_TRACE_FEXIT or BPF_MODIFY_RETURN.
5328 * bpf_set_retval(-EPERM);
5331 * In this case, the BPF program's return value will use helper's -EPERM. This
5371 * Change the __sk_buff->tstamp_type to *tstamp_type*
5372 * and set *tstamp* to the __sk_buff->tstamp together.
5374 * If there is no need to change the __sk_buff->tstamp_type,
5375 * the tstamp value can be directly written to __sk_buff->tstamp
5386 * Only IPv4 and IPv6 skb->protocol are supported.
5389 * mono delivery time to __sk_buff->tstamp and then
5391 * changing the (rcv) timestamp in __sk_buff->tstamp at
5393 * to sch_fq@phy-dev.
5396 * **-EINVAL** for invalid input
5397 * **-EOPNOTSUPP** for unsupported protocol
5406 * **-EOPNOTSUP** if the hash calculation failed or **-EINVAL** if
5442 * 0 on success, -E2BIG if the size exceeds DYNPTR_MAX_SIZE,
5443 * -EINVAL if flags is not 0.
5459 * through the dynptr interface. This is a no-op if the dynptr is
5470 * interface. This is a no-op if the dynptr is invalid/null.
5483 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5484 * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if
5492 * *flags* must be 0 except for skb-type dynptrs.
5494 * For skb-type dynptrs:
5503 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5504 * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst*
5505 * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs,
5519 * read-only, if the dynptr is invalid, or if the offset and length
5540 * **-EINVAL** if *th_len* is invalid.
5560 * **-EINVAL** if *th_len* is invalid.
5562 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5577 * **-EACCES** if the SYN cookie is not valid.
5592 * **-EACCES** if the SYN cookie is not valid.
5594 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5598 * A nonsettable system-wide clock derived from wall-clock time but
5623 * buffer. If a user-space producer was epoll-waiting on this map,
5633 * **-EBUSY** if the ring buffer is contended, and another calling
5636 * **-EINVAL** if user-space is not properly tracking the ring
5641 * **-E2BIG** if user-space has tried to publish a sample which is
5656 * In reality, the local-storage value is embedded directly inside of the
5658 * **BPF_MAP_TYPE_CGRP_STORAGE** map. When the local-storage value is
5660 * O(n) iteration over all of the live local-storage values for that
5661 * *cgroup* object until the local-storage value for the *map* is found.
5681 * **-ENOENT** if the bpf_local_storage cannot be found.
5898 /* backwards-compatibility macros for users of __BPF_FUNC_MAPPER that don't
5982 BPF_F_CURRENT_NETNS = (-1L),
6104 * and try to deduce it by ingress, egress or skb->sk->sk_clockid.
6108 /* user accessible mirror of in-kernel sk_buff.
6172 /* user accessible mirror of in-kernel xfrm_state.
6187 * The values are binary compatible with their TC_ACT_* counter-part to
6197 /* 3-6 reserved */
6299 * their TC_ACT_* counter-parts. For compatibility in behavior, unknown
6303 TCX_NEXT = -1,
6336 __u32 ingress_ifindex; /* rxq->dev->ifindex */
6337 __u32 rx_queue_index; /* rxq->queue_index */
6339 __u32 egress_ifindex; /* txq->dev->ifindex */
6342 /* DEVMAP map-value layout
6344 * The struct data-layout of map-value is a configuration interface.
6355 /* CPUMAP map-value layout
6357 * The struct data-layout of map-value is a configuration interface.
6402 * Note that the directly accessible bytes (data_end - data)
6415 /* When reuse->migrating_sk is NULL, it is selecting a sk for the
6417 * the received SYN in the TCP case). reuse->sk is one of the sk
6418 * in the reuseport group. The bpf prog can use reuse->sk to learn
6421 * When reuse->migrating_sk is not NULL, reuse->sk is closed and
6422 * reuse->migrating_sk is the socket that needs to be migrated
6424 * sk that is fully established or a reqsk that is in-the-middle
6425 * of 3-way handshake.
6619 __u32 user_family; /* Allows 4-byte read, but no write. */
6620 __u32 user_ip4; /* Allows 1,2,4-byte read and 4-byte write.
6623 __u32 user_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
6626 __u32 user_port; /* Allows 1,2,4-byte read and 4-byte write.
6629 __u32 family; /* Allows 4-byte read, but no write */
6630 __u32 type; /* Allows 4-byte read, but no write */
6631 __u32 protocol; /* Allows 4-byte read, but no write */
6632 __u32 msg_src_ip4; /* Allows 1,2,4-byte read and 4-byte write.
6635 __u32 msg_src_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
6731 * called under sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB
6739 * mode and required the active side to resend the bpf-written
6740 * options. The active side can keep writing the bpf-options until
6751 * sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB.
6761 * sock_ops->op == BPF_SOCK_OPS_HDR_OPT_LEN_CB. Then
6763 * under sock_ops->op == BPF_SOCK_OPS_WRITE_HDR_OPT_CB.
6782 BPF_SOCK_OPS_TIMEOUT_INIT, /* Should return SYN-RTO value to use or
6783 * -1 if default value should be used
6786 * window (in packets) or -1 if default
6836 * sock_ops->skb_data:
6850 * sock_ops->skb_data:
6854 * sock_ops->skb_tcp_flags:
6865 * sock_ops->skb_data:
6870 * earlier bpf-progs.
6872 * sock_ops->skb_tcp_flags:
6885 * earlier bpf-progs.
6923 * 1. the just-received SYN packet (only available when writing the
6937 * If the bpf-prog does not need the IP[46] header, the
6938 * bpf-prog can avoid parsing the IP header by using
6939 * TCP_BPF_SYN. Otherwise, the bpf-prog can get both
6943 * -ENOSPC: Not enough space in optval. Only optlen number of
6945 * -ENOENT: The SYN skb is not available now and the earlier SYN pkt
7031 /* set if lookup is to consider L4 data - e.g., FIB rules */
7038 __u16 tot_len; /* L3 length from network hdr (iph->tot_len) */
7109 BPF_MTU_CHK_RET_SEGS_TOOBIG, /* GSO re-segmentation needed to fwd */
7201 * Allows 1,2,4-byte read, but no write.
7204 * Allows 1,2,4-byte read an 4-byte write.
7228 __u64 cookie; /* Non-zero if socket was selected in PROG_TEST_RUN */
7246 * via the bpf_snprintf_btf() helper described above. A flags field -
7248 * (rather than its mode of display) - is included for future use.
7249 * Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately.
7259 * - BTF_F_COMPACT: no formatting around type information
7260 * - BTF_F_NONAME: no struct/union member names/types
7261 * - BTF_F_PTR_RAW: show raw (unobfuscated) pointer values;
7263 * - BTF_F_ZERO: show zero-valued struct/union members; they
7281 BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */
7282 BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */
7283 BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */
7297 * CO-RE relocation captures the following data:
7298 * - insn_off - instruction offset (in bytes) within a BPF program that needs
7299 * its insn->imm field to be relocated with actual field info;
7300 * - type_id - BTF type ID of the "root" (containing) entity of a relocatable
7302 * - access_str_off - offset into corresponding .BTF string section. String
7304 * - for field-based relocations, string encodes an accessed field using
7308 * - for type-based relocations, strings is expected to be just "0";
7309 * - for enum value-based relocations, string contains an index of enum
7311 * - kind - one of enum bpf_core_relo_kind;
7322 * int *x = &s->a; // encoded as "0:0" (a is field #0)
7323 * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1,
7325 * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array)
7331 * Clang built-in, passing expression that captures field address, e.g.:
7334 * __builtin_preserve_access_index(&src->a.b.c));
7339 * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction
7350 * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is
7352 * - BPF_F_TIMER_CPU_PIN: Timer will be pinned to the CPU of the caller.