• Home
  • Raw
  • Download

Lines Matching +full:ipv4 +full:- +full:single +full:- +full:target

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. */
93 BPF_CGROUP_ITER_SELF_ONLY, /* process only a single object. */
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
532 * target process identified by *pid* and *fd*.
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
1090 /* cgroup-bpf attach flags used in BPF_PROG_ATTACH command
1094 * BPF_F_ALLOW_OVERRIDE: If a sub-cgroup installs some bpf program,
1095 * the program in this cgroup yields to sub-cgroup program.
1097 * BPF_F_ALLOW_MULTI: If a sub-cgroup installs some bpf program,
1108 * The programs of sub-cgroup are executed first, then programs of
1118 * A cgroup with MULTI or OVERRIDE flag allows any attach flags in sub-cgroups.
1119 * A cgroup with NONE doesn't allow any programs in sub-cgroups.
1121 * cgrp1 (MULTI progs A, B) ->
1122 * cgrp2 (OVERRIDE prog C) ->
1123 * cgrp3 (MULTI prog D) ->
1124 * cgrp4 (OVERRIDE prog E) ->
1165 * Verifier does sub-register def/use analysis and identifies instructions whose
1166 * def only matters for low 32-bit, high 32-bit is never referenced later
1167 * through implicit zero extension. Therefore verifier notifies JIT back-ends
1168 * that it is safe to ignore clearing high 32-bit for these instructions. This
1169 * saves some back-ends a lot of code-gen. However such optimization is not
1170 * necessary on some arches, for example x86_64, arm64 etc, whose JIT back-ends
1176 * 32-bit for those instructions who has been identified as safe to ignore them.
1199 * program becomes device-bound but can access XDP metadata.
1270 /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative
1274 /* when bpf_call->src_reg == BPF_PSEUDO_KFUNC_CALL,
1275 * bpf_call->imm == btf_id of a BTF_KIND_FUNC in the running kernel
1284 BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */
1307 /* Zero-initialize hash function seed. This should only be used for testing. */
1317 /* Enable memory-mapping BPF map */
1393 __u32 btf_vmlinux_value_type_id;/* BTF type_id of a kernel-
1397 /* Any per-map-type extra fields
1399 * BPF_MAP_TYPE_BLOOM_FILTER - the lowest 4 bits indicate the
1457 __u32 attach_btf_id; /* in-kernel BTF type id to attach to */
1490 __u32 target_fd; /* target object to attach to or ... */
1491 __u32 target_ifindex; /* target ifindex */
1548 __u32 target_fd; /* target object to query or ... */
1549 __u32 target_ifindex; /* target ifindex */
1560 /* output: per-program attach_flags.
1609 __u32 target_fd; /* target object to attach to or ... */
1610 __u32 target_ifindex; /* target ifindex */
1615 __u32 target_btf_id; /* btf_id of target to attach to */
1621 /* black box user-provided value passed through
1637 /* black box user-provided value passed through
1723 * --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst
1724 * $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.7
1725 * $ man /tmp/bpf-helpers.7
1785 * This helper is a "printk()-like" facility for debugging. It
1803 * telnet-470 [001] .N.. 419421.045894: 0x00000001: <formatted msg>
1828 * helper will return **-EINVAL** (but print nothing) if it
1844 * Get a pseudo-random number.
1847 * pseudo-random internal state, and cannot be used to infer the
1852 * A random 32-bit unsigned value.
1869 * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\
1870 * **->swhash** and *skb*\ **->l4hash** to 0).
1893 * which does not update the checksum in-place, but offers more
1922 * the checksum is to be computed against a pseudo-header.
1925 * which does not update the checksum in-place, but offers more
1991 * error indicates a potential drop or congestion in the target
1998 * A 64-bit integer containing the current tgid and pid, and
2000 * *current_task*\ **->tgid << 32 \|**
2001 * *current_task*\ **->pid**.
2007 * A 64-bit integer containing the current GID and UID, and
2016 * helper makes sure that the *buf* is NUL-terminated. On failure,
2029 * based on a user-provided identifier for all traffic coming from
2032 * *Documentation/admin-guide/cgroup-v1/net_cls.rst*.
2038 * run on cgroups, which is a cgroup-v2-only feature (a socket can
2082 * IPv4.
2086 * single struct. This way, it can be used to easily make a
2089 * address of the remote end (IPv4 or IPv6, depending on the case)
2090 * in *key*\ **->remote_ipv4** or *key*\ **->remote_ipv6**. Also,
2091 * this struct exposes the *key*\ **->tunnel_id**, which is
2099 * remote ends with IPv4 address other than 10.0.0.1:
2118 * metadata" mode only requires a single device where the
2134 * instead of IPv4.
2136 * For IPv4 packets, add a flag to tunnel metadata
2211 * redirect target instead of providing it directly to the helper.
2222 * identifier retrieved is a user-provided tag, similar to the
2228 * (see also **tc-bpf(8)**), or alternatively on conventional
2296 * manipulated with *skb*\ **->data** and *skb*\ **->data_end**
2327 * generating a variety of graphs (such as flame graphs or off-cpu
2385 * and retrieving arbitrary TLVs (Type-Length-Value headers) from
2404 * supported are transition from IPv4 to IPv6, and from IPv6 to
2405 * IPv4. The helper takes care of the groundwork for the
2415 * The size for GSO target is adapted as well.
2431 * comes down to setting *skb*\ **->pkt_type** to *type*, except
2433 * **->pkt_type** beside this helper. Using a helper here allows
2468 * Retrieve the hash of the packet, *skb*\ **->hash**. If it is
2471 * directly with *skb*\ **->hash**.
2480 * The 32-bit hash.
2495 * security mechanism because of TOC-TOU attacks, but rather to
2496 * debug, divert, and manipulate execution of semi-cooperative
2545 * Pull in non-linear data in case the *skb* is non-linear and not
2555 * are within packet boundaries (test on *skb*\ **->data_end**) is
2557 * data is in non-linear parts of the *skb*. On failure the
2558 * program can just bail out, or in the case of a non-linear
2562 * to pull in once the non-linear parts, then retesting and
2582 * Add the checksum *csum* into *skb*\ **->csum** in case the
2594 * Invalidate the current *skb*\ **->hash**. It can be used after
2636 * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that
2672 * A 8-byte long unique number on success, or 0 if the socket
2680 * A 8-byte long unique number.
2687 * A 8-byte long unique number.
2695 * A 8-byte long unique number or 0 if *sk* is NULL.
2703 * time-wait or a request socket instead), **overflowuid** value
2709 * Set the full hash for *skb* (set the field *skb*\ **->hash**)
2864 * Adjust the address pointed by *xdp_md*\ **->data_meta** by
2866 * operation modifies the address stored in *xdp_md*\ **->data**,
2870 * The use of *xdp_md*\ **->data_meta** is optional and programs
2876 * this up for further post-processing. Since TC works with socket
2910 * **->enabled** and *buf*\ **->running**, respectively) are
3028 * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)**
3039 * Code **-EINVAL** if the socket is not a full TCP socket;
3065 * * A single **sendmsg**\ () or **sendfile**\ () system call
3079 * *bytes* will be sent and the eBPF program will be re-run with
3087 * a non-zero value, this is not a problem because data is not
3102 * 1-byte long message segments. Obviously, this is bad for
3112 * For socket policies, pull in non-linear data from user space
3113 * for *msg* and set pointers *msg*\ **->data** and *msg*\
3114 * **->data_end** to *start* and *end* bytes offsets into *msg*,
3147 * single IP address on a host that has multiple IP configured.
3149 * This helper works for IPv4 and IPv6, TCP and UDP sockets. The
3150 * domain (*addr*\ **->sa_family**) must be **AF_INET** (or
3152 * or **sin6_port**) which triggers IP_BIND_ADDRESS_NO_PORT-like
3154 * port as long as 4-tuple is unique. Passing non-zero port might
3161 * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is
3176 * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*.
3213 * adjusted by adding (sh_addr - sh_offset), where
3229 * The non-negative copied *buf* length equal to or less than
3248 * in socket filters where *skb*\ **->data** does not always point
3263 * is set to metric from route (IPv4/IPv6 only), and ifindex
3275 * Use the routing table ID present in *params*->tbid
3281 * Skip the neighbour table lookup. *params*->dmac
3282 * and *params*->smac will not be set as output. A common
3286 * Derive and set source IP addr in *params*->ipv{4,6}_src
3289 * case, *params*->dmac and *params*->smac are not set either.
3300 * was exceeded and output params->mtu_result contains the MTU.
3366 * must be IPv4 or IPv6, followed by zero or more
3425 * End.X action: Endpoint with Layer-3 cross-connect.
3499 * to the same 64-bit id.
3512 * A 64-bit integer containing the current cgroup id based
3564 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3572 * **sizeof**\ (*tuple*\ **->ipv4**)
3573 * Look for an IPv4 socket.
3574 * **sizeof**\ (*tuple*\ **->ipv6**)
3577 * If the *netns* is a negative signed 32-bit integer, then the
3581 * If *netns* is any other signed 32-bit value greater than or
3584 * range of 32-bit integers are reserved for future use.
3594 * result is from *reuse*\ **->socks**\ [] using the hash of the
3601 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3609 * **sizeof**\ (*tuple*\ **->ipv4**)
3610 * Look for an IPv4 socket.
3611 * **sizeof**\ (*tuple*\ **->ipv6**)
3614 * If the *netns* is a negative signed 32-bit integer, then the
3618 * If *netns* is any other signed 32-bit value greater than or
3621 * range of 32-bit integers are reserved for future use.
3631 * result is from *reuse*\ **->socks**\ [] using the hash of the
3637 * non-**NULL** pointer that was returned from
3727 * allowed inside a spinlock-ed region.
3750 * * **bpf_spin_lock** is not allowed in inner maps of map-in-map.
3782 * and IPv4.
3799 * and if non-**NULL**, released via **bpf_sk_release**\ ().
3811 * result is from *reuse*\ **->socks**\ [] using the hash of the
3819 * *iph* points to the start of the IPv4 or IPv6 header, while
3835 * The buffer is always NUL terminated, unless it's zero-sized.
3837 * If *flags* is zero, full name (e.g. "net/ipv4/tcp_mem") is
3843 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3855 * The buffer is always NUL terminated, unless it's zero-sized.
3859 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3862 * **-EINVAL** if current value was unavailable, e.g. because
3863 * sysctl is uninitialized and read returns -EIO for it.
3873 * The buffer is always NUL terminated, unless it's zero-sized.
3877 * **-E2BIG** if the buffer wasn't big enough (*buf* will contain
3880 * **-EINVAL** if sysctl is being read.
3895 * **-E2BIG** if the *buf_len* is too big.
3897 * **-EINVAL** if sysctl is being read.
3906 * (as determined by **isspace**\ (3)) followed by a single
3907 * optional '**-**' sign.
3918 * **-EINVAL** if no valid digits were found or unsupported base
3921 * **-ERANGE** if resulting value was out of range.
3941 * **-EINVAL** if no valid digits were found or unsupported base
3944 * **-ERANGE** if resulting value was out of range.
3948 * Get a bpf-local-storage from a *sk*.
3958 * the *map*. The *map* is used as the bpf-local-storage
3959 * "type". The bpf-local-storage "type" (i.e. the *map*) is
3960 * searched against all bpf-local-storages residing at *sk*.
3966 * used such that a new bpf-local-storage will be
3969 * the initial value of a bpf-local-storage. If *value* is
3970 * **NULL**, the new bpf-local-storage will be zero initialized.
3972 * A bpf-local-storage pointer is returned on success.
3975 * a new bpf-local-storage.
3979 * Delete a bpf-local-storage from a *sk*.
3983 * **-ENOENT** if the bpf-local-storage cannot be found.
3984 * **-EINVAL** if sk is not a fullsock (e.g. a request_sock).
3993 * **-EBUSY** if work queue under nmi is full.
3995 * **-EINVAL** if *sig* is invalid.
3997 * **-EPERM** if no permission to send the *sig*.
3999 * **-EAGAIN** if bpf program can try again.
4006 * *iph* points to the start of the IPv4 or IPv6 header, while
4020 * **-EINVAL** SYN cookie cannot be issued due to error
4022 * **-ENOENT** SYN cookie should not be issued (no SYN flood)
4024 * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies
4026 * **-EPROTONOSUPPORT** IP packet version is not 4 or 6
4045 * *ctx* is a pointer to in-kernel struct sk_buff.
4071 * *size*, the target is not padded with further NUL bytes. If the
4072 * string length is larger than *size*, just *size*-1 bytes are
4087 * ctx->di);
4102 * *current*\ **->mm->arg_start** and *current*\
4103 * **->mm->env_start**: using this helper and the return value,
4120 * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**.
4131 * **-EBUSY** if work queue under nmi is full.
4133 * **-EINVAL** if *sig* is invalid.
4135 * **-EPERM** if no permission to send the *sig*.
4137 * **-EAGAIN** if bpf program can try again.
4159 * **-EINVAL** if arguments invalid or **size** not a multiple
4162 * **-ENOENT** if architecture does not support branch records.
4171 * **-EINVAL** if dev and inum supplied don't match dev_t and inode number
4174 * **-ENOENT** if pidns does not exists for the current task.
4193 * *ctx* is a pointer to in-kernel struct xdp_buff.
4211 * A 8-byte long opaque number.
4250 * **-EINVAL** if specified *flags* are not supported.
4252 * **-ENOENT** if the socket is unavailable for assignment.
4254 * **-ENETUNREACH** if the socket is unreachable (wrong netns).
4256 * **-EOPNOTSUPP** if the operation is not supported, for example
4272 * that are not v6-only can be selected for IPv4 packets.
4285 * load-balancing within reuseport group for the socket
4288 * On success *ctx->sk* will point to the selected socket.
4293 * * **-EAFNOSUPPORT** if socket family (*sk->family*) is
4294 * not compatible with packet family (*ctx->family*).
4296 * * **-EEXIST** if socket has been already selected,
4300 * * **-EINVAL** if unsupported flags were specified.
4302 * * **-EPROTOTYPE** if socket L4 protocol
4303 * (*sk->protocol*) doesn't match packet protocol
4304 * (*ctx->protocol*).
4306 * * **-ESOCKTNOSUPPORT** if socket is not in allowed
4326 * The *data_len* is the size of *data* in bytes - must be a multiple of 8.
4337 * **-EBUSY** if per-CPU memory copy buffer is busy, can try again
4340 * **-EINVAL** if arguments are invalid, or if *fmt* is invalid/unsupported.
4342 * **-E2BIG** if *fmt* contains too many format specifiers.
4344 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4354 * **-EOVERFLOW** if an overflow happened: The same object will be tried again.
4360 * *sk* must be a non-**NULL** pointer to a socket, e.g. one
4398 * An adaptive notification is a notification sent whenever the user-space
4399 * process has caught up and consumed all available payloads. In case the user-space
4476 * * **BPF_CSUM_LEVEL_INC**: Increases skb->csum_level for skbs
4478 * * **BPF_CSUM_LEVEL_DEC**: Decreases skb->csum_level for skbs
4480 * * **BPF_CSUM_LEVEL_RESET**: Resets skb->csum_level to 0 and
4482 * * **BPF_CSUM_LEVEL_QUERY**: No-op, returns the current
4483 * skb->csum_level.
4486 * case of **BPF_CSUM_LEVEL_QUERY**, the current skb->csum_level
4487 * is returned or the error code -EACCES in case the skb is not
4524 * the current task; all other tasks will return -EOPNOTSUPP.
4552 * The non-negative copied *buf* length equal to or less than
4561 * *skops*\ **->skb_data**. The comment in **struct bpf_sock_ops**
4563 * *skops*\ **->op**.
4573 * the 2nd byte which is "kind-length" of a TCP
4574 * header option and the "kind-length" also
4575 * includes the first 2 bytes "kind" and "kind-length"
4584 * Note, kind-length must be 0 for regular option.
4586 * Searching for No-Op (0) and End-of-Option-List (1) are
4595 * saved_syn packet or the just-received syn packet.
4602 * **-EINVAL** if a parameter is invalid.
4604 * **-ENOMSG** if the option is not found.
4606 * **-ENOENT** if no syn packet is available when
4609 * **-ENOSPC** if there is not enough space. Only *len* number of
4612 * **-EFAULT** on failure to parse the header options in the
4615 * **-EPERM** if the helper cannot be used under the current
4616 * *skops*\ **->op**.
4624 * includes the kind, kind-length, and the actual
4625 * option data. The *len* must be at least kind-length
4626 * long. The kind-length does not have to be 4 byte
4628 * and setting the 4 bytes aligned value to th->doff.
4639 * **-EINVAL** If param is invalid.
4641 * **-ENOSPC** if there is not enough space in the header.
4644 * **-EEXIST** if the option already exists.
4646 * **-EFAULT** on failure to parse the existing header options.
4648 * **-EPERM** if the helper cannot be used under the current
4649 * *skops*\ **->op**.
4666 * **-EINVAL** if a parameter is invalid.
4668 * **-ENOSPC** if there is not enough space in the header.
4670 * **-EPERM** if the helper cannot be used under the current
4671 * *skops*\ **->op**.
4685 * the *map*. The *map* is used as the bpf-local-storage
4686 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4707 * **-ENOENT** if the bpf_local_storage cannot be found.
4730 * Use BTF to store a string representation of *ptr*->ptr in *str*,
4731 * using *ptr*->type_id. This value should specify the type
4732 * that *ptr*->ptr points to. LLVM __builtin_btf_type_id(type, 1)
4735 * stored in the first *str_size* - 1 bytes of *str*. Safe copy of
4756 * show zero-valued struct/union members; they
4767 * *ptr*->ptr, using *ptr*->type_id as per bpf_snprintf_btf().
4797 * for IPv4 and IPv6 protocols.
4859 * the *map*. The *map* is used as the bpf-local-storage
4860 * "type". The bpf-local-storage "type" (i.e. the *map*) is
4881 * **-ENOENT** if the bpf_local_storage cannot be found.
4899 * **-EINVAL** if invalid *flags* are passed, zero otherwise.
4903 * Return a coarse-grained version of the time elapsed since
4918 * **-EOPNOTSUP** if IMA is disabled or **-EINVAL** if
4953 * this value is L3 as this correlate to MTU and IP-header tot_len
4972 * possible for the skb packet to get re-segmented
4982 * MTU value in your BPF-code.
4999 * **map**, **callback_ctx** and other map-specific parameters.
5022 * The number of traversed map elements for success, **-EINVAL** for
5028 * based on a format string stored in a read-only map pointed by
5034 * array. The *data_len* is the size of *data* in bytes - must be
5049 * be zero-terminated except when **str_size** is 0.
5051 * Or **-EBUSY** if the per-CPU memory copy buffer is busy.
5081 * **-EBUSY** if *timer* is already initialized.
5082 * **-EINVAL** if invalid *flags* are passed.
5083 * **-EPERM** if *timer* is in a map that doesn't have any user references.
5093 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
5094 * **-EPERM** if *timer* is in a map that doesn't have any user references.
5110 * decremented. This is done to make sure that Ctrl-C of a user
5112 * bpffs the callback_fn can re-arm itself indefinitely.
5115 * The map can contain timers that invoke callback_fn-s from different
5130 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier
5139 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier.
5140 * **-EDEADLK** if callback_fn tried to call bpf_timer_cancel() on its
5163 * - kprobe/uprobe;
5164 * - tracepoint;
5165 * - perf_event.
5193 * **-EINVAL** if *flags* is not zero.
5195 * **-ENOENT** if architecture does not support branch records.
5220 * **-EINVAL** if *flags* is not zero.
5222 * **-EINVAL** if string *name* is not the same size as *name_sz*.
5224 * **-ENOENT** if symbol is not found.
5226 * **-EPERM** if caller does not have permission to obtain kernel address.
5243 * **-ENOENT** if *task->mm* is NULL, or no vma contains *addr*.
5244 * **-EBUSY** if failed to try lock mmap_lock.
5245 * **-EINVAL** for invalid **flags**.
5260 * is zero-indexed.
5268 * The number of loops performed, **-EINVAL** for invalid **flags**,
5269 * **-E2BIG** if **nr_loops** exceeds the maximum number of loops.
5274 * to be null-terminated and **s1_sz** is the maximum storage
5275 * size of **s1**. **s2** must be a read-only string.
5283 * Get **n**-th argument register (zero based) of the traced function (for tracing programs)
5288 * **-EINVAL** if n >= argument register count of traced function.
5297 * **-EOPNOTSUPP** for tracing programs other than BPF_TRACE_FEXIT or BPF_MODIFY_RETURN.
5326 * bpf_set_retval(-EPERM);
5329 * In this case, the BPF program's return value will use helper's -EPERM. This
5369 * Change the __sk_buff->tstamp_type to *tstamp_type*
5370 * and set *tstamp* to the __sk_buff->tstamp together.
5372 * If there is no need to change the __sk_buff->tstamp_type,
5373 * the tstamp value can be directly written to __sk_buff->tstamp
5384 * Only IPv4 and IPv6 skb->protocol are supported.
5387 * mono delivery time to __sk_buff->tstamp and then
5389 * changing the (rcv) timestamp in __sk_buff->tstamp at
5391 * to sch_fq@phy-dev.
5394 * **-EINVAL** for invalid input
5395 * **-EOPNOTSUPP** for unsupported protocol
5404 * **-EOPNOTSUP** if the hash calculation failed or **-EINVAL** if
5440 * 0 on success, -E2BIG if the size exceeds DYNPTR_MAX_SIZE,
5441 * -EINVAL if flags is not 0.
5457 * through the dynptr interface. This is a no-op if the dynptr is
5468 * interface. This is a no-op if the dynptr is invalid/null.
5481 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5482 * of *src*'s data, -EINVAL if *src* is an invalid dynptr or if
5490 * *flags* must be 0 except for skb-type dynptrs.
5492 * For skb-type dynptrs:
5501 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
5502 * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst*
5503 * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs,
5517 * read-only, if the dynptr is invalid, or if the offset and length
5523 * IPv4/TCP headers, *iph* and *th*, without depending on a
5526 * *iph* points to the IPv4 header.
5538 * **-EINVAL** if *th_len* is invalid.
5558 * **-EINVAL** if *th_len* is invalid.
5560 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5567 * *iph* points to the IPv4 header.
5575 * **-EACCES** if the SYN cookie is not valid.
5590 * **-EACCES** if the SYN cookie is not valid.
5592 * **-EPROTONOSUPPORT** if CONFIG_IPV6 is not builtin.
5596 * A nonsettable system-wide clock derived from wall-clock time but
5621 * buffer. If a user-space producer was epoll-waiting on this map,
5631 * **-EBUSY** if the ring buffer is contended, and another calling
5634 * **-EINVAL** if user-space is not properly tracking the ring
5639 * **-E2BIG** if user-space has tried to publish a sample which is
5654 * In reality, the local-storage value is embedded directly inside of the
5656 * **BPF_MAP_TYPE_CGRP_STORAGE** map. When the local-storage value is
5658 * O(n) iteration over all of the live local-storage values for that
5659 * *cgroup* object until the local-storage value for the *map* is found.
5679 * **-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 */
6286 } ipv4; member
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.
6361 __u32 qsize; /* queue size to remote target CPU */
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.
6609 __u32 user_family; /* Allows 4-byte read, but no write. */
6610 __u32 user_ip4; /* Allows 1,2,4-byte read and 4-byte write.
6613 __u32 user_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
6616 __u32 user_port; /* Allows 1,2,4-byte read and 4-byte write.
6619 __u32 family; /* Allows 4-byte read, but no write */
6620 __u32 type; /* Allows 4-byte read, but no write */
6621 __u32 protocol; /* Allows 4-byte read, but no write */
6622 __u32 msg_src_ip4; /* Allows 1,2,4-byte read and 4-byte write.
6625 __u32 msg_src_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write.
6721 * called under sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB
6729 * mode and required the active side to resend the bpf-written
6730 * options. The active side can keep writing the bpf-options until
6741 * sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB.
6751 * sock_ops->op == BPF_SOCK_OPS_HDR_OPT_LEN_CB. Then
6753 * under sock_ops->op == BPF_SOCK_OPS_WRITE_HDR_OPT_CB.
6772 BPF_SOCK_OPS_TIMEOUT_INIT, /* Should return SYN-RTO value to use or
6773 * -1 if default value should be used
6776 * window (in packets) or -1 if default
6826 * sock_ops->skb_data:
6840 * sock_ops->skb_data:
6844 * sock_ops->skb_tcp_flags:
6855 * sock_ops->skb_data:
6860 * earlier bpf-progs.
6862 * sock_ops->skb_tcp_flags:
6875 * earlier bpf-progs.
6879 /* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
6913 * 1. the just-received SYN packet (only available when writing the
6927 * If the bpf-prog does not need the IP[46] header, the
6928 * bpf-prog can avoid parsing the IP header by using
6929 * TCP_BPF_SYN. Otherwise, the bpf-prog can get both
6933 * -ENOSPC: Not enough space in optval. Only optlen number of
6935 * -ENOENT: The SYN skb is not available now and the earlier SYN pkt
7021 /* set if lookup is to consider L4 data - e.g., FIB rules */
7028 __u16 tot_len; /* L3 length from network hdr (iph->tot_len) */
7043 /* output: metric of fib result (IPv4/IPv6 only) */
7099 BPF_MTU_CHK_RET_SEGS_TOOBIG, /* GSO re-segmentation needed to fwd */
7191 * Allows 1,2,4-byte read, but no write.
7194 * Allows 1,2,4-byte read an 4-byte write.
7218 __u64 cookie; /* Non-zero if socket was selected in PROG_TEST_RUN */
7236 * via the bpf_snprintf_btf() helper described above. A flags field -
7238 * (rather than its mode of display) - is included for future use.
7239 * Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately.
7249 * - BTF_F_COMPACT: no formatting around type information
7250 * - BTF_F_NONAME: no struct/union member names/types
7251 * - BTF_F_PTR_RAW: show raw (unobfuscated) pointer values;
7253 * - BTF_F_ZERO: show zero-valued struct/union members; they
7270 BPF_CORE_FIELD_EXISTS = 2, /* field existence in target kernel */
7271 BPF_CORE_FIELD_SIGNED = 3, /* field signedness (0 - unsigned, 1 - signed) */
7272 BPF_CORE_FIELD_LSHIFT_U64 = 4, /* bitfield-specific left bitshift */
7273 BPF_CORE_FIELD_RSHIFT_U64 = 5, /* bitfield-specific right bitshift */
7275 BPF_CORE_TYPE_ID_TARGET = 7, /* type ID in target kernel */
7276 BPF_CORE_TYPE_EXISTS = 8, /* type existence in target kernel */
7278 BPF_CORE_ENUMVAL_EXISTS = 10, /* enum value existence in target kernel */
7280 BPF_CORE_TYPE_MATCHES = 12, /* type match in target kernel */
7287 * CO-RE relocation captures the following data:
7288 * - insn_off - instruction offset (in bytes) within a BPF program that needs
7289 * its insn->imm field to be relocated with actual field info;
7290 * - type_id - BTF type ID of the "root" (containing) entity of a relocatable
7292 * - access_str_off - offset into corresponding .BTF string section. String
7294 * - for field-based relocations, string encodes an accessed field using
7298 * - for type-based relocations, strings is expected to be just "0";
7299 * - for enum value-based relocations, string contains an index of enum
7301 * - kind - one of enum bpf_core_relo_kind;
7312 * int *x = &s->a; // encoded as "0:0" (a is field #0)
7313 * int *y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1,
7315 * int *z = &s[10]->b; // encoded as "10:1" (ptr is used as an array)
7321 * Clang built-in, passing expression that captures field address, e.g.:
7324 * __builtin_preserve_access_index(&src->a.b.c));
7329 * [0] https://llvm.org/docs/LangRef.html#getelementptr-instruction
7340 * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is
7342 * - BPF_F_TIMER_CPU_PIN: Timer will be pinned to the CPU of the caller.