From d707f8027b6c0959d59037ab7b999019b3b8dfc8 Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Sun, 28 Jun 2020 23:35:51 -0700 Subject: [PATCH] sync: auto-generate latest BPF helpers Latest changes to BPF helper definitions. --- src/bpf_helper_defs.h | 297 +++++++++++++++++++++++++----------------- 1 file changed, 178 insertions(+), 119 deletions(-) diff --git a/src/bpf_helper_defs.h b/src/bpf_helper_defs.h index bee8089..7528a31 100644 --- a/src/bpf_helper_defs.h +++ b/src/bpf_helper_defs.h @@ -19,6 +19,11 @@ struct sk_reuseport_md; struct sockaddr; struct tcphdr; struct seq_file; +struct tcp6_sock; +struct tcp_sock; +struct tcp_timewait_sock; +struct tcp_request_sock; +struct udp6_sock; struct __sk_buff; struct sk_msg_md; struct xdp_md; @@ -54,7 +59,7 @@ static void *(*bpf_map_lookup_elem)(void *map, const void *key) = (void *) 1; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_map_update_elem)(void *map, const void *key, const void *value, __u64 flags) = (void *) 2; +static long (*bpf_map_update_elem)(void *map, const void *key, const void *value, __u64 flags) = (void *) 2; /* * bpf_map_delete_elem @@ -64,7 +69,7 @@ static int (*bpf_map_update_elem)(void *map, const void *key, const void *value, * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_map_delete_elem)(void *map, const void *key) = (void *) 3; +static long (*bpf_map_delete_elem)(void *map, const void *key) = (void *) 3; /* * bpf_probe_read @@ -78,7 +83,7 @@ static int (*bpf_map_delete_elem)(void *map, const void *key) = (void *) 3; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_probe_read)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 4; +static long (*bpf_probe_read)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 4; /* * bpf_ktime_get_ns @@ -153,7 +158,7 @@ static __u64 (*bpf_ktime_get_ns)(void) = (void *) 5; * The number of bytes written to the buffer, or a negative error * in case of failure. */ -static int (*bpf_trace_printk)(const char *fmt, __u32 fmt_size, ...) = (void *) 6; +static long (*bpf_trace_printk)(const char *fmt, __u32 fmt_size, ...) = (void *) 6; /* * bpf_get_prandom_u32 @@ -203,7 +208,7 @@ static __u32 (*bpf_get_smp_processor_id)(void) = (void *) 8; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_store_bytes)(struct __sk_buff *skb, __u32 offset, const void *from, __u32 len, __u64 flags) = (void *) 9; +static long (*bpf_skb_store_bytes)(struct __sk_buff *skb, __u32 offset, const void *from, __u32 len, __u64 flags) = (void *) 9; /* * bpf_l3_csum_replace @@ -232,7 +237,7 @@ static int (*bpf_skb_store_bytes)(struct __sk_buff *skb, __u32 offset, const voi * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_l3_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 from, __u64 to, __u64 size) = (void *) 10; +static long (*bpf_l3_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 from, __u64 to, __u64 size) = (void *) 10; /* * bpf_l4_csum_replace @@ -268,7 +273,7 @@ static int (*bpf_l3_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 fro * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_l4_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 from, __u64 to, __u64 flags) = (void *) 11; +static long (*bpf_l4_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 from, __u64 to, __u64 flags) = (void *) 11; /* * bpf_tail_call @@ -303,7 +308,7 @@ static int (*bpf_l4_csum_replace)(struct __sk_buff *skb, __u32 offset, __u64 fro * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_tail_call)(void *ctx, void *prog_array_map, __u32 index) = (void *) 12; +static long (*bpf_tail_call)(void *ctx, void *prog_array_map, __u32 index) = (void *) 12; /* * bpf_clone_redirect @@ -331,7 +336,7 @@ static int (*bpf_tail_call)(void *ctx, void *prog_array_map, __u32 index) = (voi * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_clone_redirect)(struct __sk_buff *skb, __u32 ifindex, __u64 flags) = (void *) 13; +static long (*bpf_clone_redirect)(struct __sk_buff *skb, __u32 ifindex, __u64 flags) = (void *) 13; /* * bpf_get_current_pid_tgid @@ -368,7 +373,7 @@ static __u64 (*bpf_get_current_uid_gid)(void) = (void *) 15; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_get_current_comm)(void *buf, __u32 size_of_buf) = (void *) 16; +static long (*bpf_get_current_comm)(void *buf, __u32 size_of_buf) = (void *) 16; /* * bpf_get_cgroup_classid @@ -418,7 +423,7 @@ static __u32 (*bpf_get_cgroup_classid)(struct __sk_buff *skb) = (void *) 17; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_vlan_push)(struct __sk_buff *skb, __be16 vlan_proto, __u16 vlan_tci) = (void *) 18; +static long (*bpf_skb_vlan_push)(struct __sk_buff *skb, __be16 vlan_proto, __u16 vlan_tci) = (void *) 18; /* * bpf_skb_vlan_pop @@ -434,7 +439,7 @@ static int (*bpf_skb_vlan_push)(struct __sk_buff *skb, __be16 vlan_proto, __u16 * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_vlan_pop)(struct __sk_buff *skb) = (void *) 19; +static long (*bpf_skb_vlan_pop)(struct __sk_buff *skb) = (void *) 19; /* * bpf_skb_get_tunnel_key @@ -489,7 +494,7 @@ static int (*bpf_skb_vlan_pop)(struct __sk_buff *skb) = (void *) 19; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_get_tunnel_key)(struct __sk_buff *skb, struct bpf_tunnel_key *key, __u32 size, __u64 flags) = (void *) 20; +static long (*bpf_skb_get_tunnel_key)(struct __sk_buff *skb, struct bpf_tunnel_key *key, __u32 size, __u64 flags) = (void *) 20; /* * bpf_skb_set_tunnel_key @@ -530,7 +535,7 @@ static int (*bpf_skb_get_tunnel_key)(struct __sk_buff *skb, struct bpf_tunnel_ke * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_set_tunnel_key)(struct __sk_buff *skb, struct bpf_tunnel_key *key, __u32 size, __u64 flags) = (void *) 21; +static long (*bpf_skb_set_tunnel_key)(struct __sk_buff *skb, struct bpf_tunnel_key *key, __u32 size, __u64 flags) = (void *) 21; /* * bpf_perf_event_read @@ -590,7 +595,7 @@ static __u64 (*bpf_perf_event_read)(void *map, __u64 flags) = (void *) 22; * are **TC_ACT_REDIRECT** on success or **TC_ACT_SHOT** on * error. */ -static int (*bpf_redirect)(__u32 ifindex, __u64 flags) = (void *) 23; +static long (*bpf_redirect)(__u32 ifindex, __u64 flags) = (void *) 23; /* * bpf_get_route_realm @@ -667,7 +672,7 @@ static __u32 (*bpf_get_route_realm)(struct __sk_buff *skb) = (void *) 24; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_perf_event_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 25; +static long (*bpf_perf_event_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 25; /* * bpf_skb_load_bytes @@ -688,7 +693,7 @@ static int (*bpf_perf_event_output)(void *ctx, void *map, __u64 flags, void *dat * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_load_bytes)(const void *skb, __u32 offset, void *to, __u32 len) = (void *) 26; +static long (*bpf_skb_load_bytes)(const void *skb, __u32 offset, void *to, __u32 len) = (void *) 26; /* * bpf_get_stackid @@ -734,7 +739,7 @@ static int (*bpf_skb_load_bytes)(const void *skb, __u32 offset, void *to, __u32 * The positive or null stack id on success, or a negative error * in case of failure. */ -static int (*bpf_get_stackid)(void *ctx, void *map, __u64 flags) = (void *) 27; +static long (*bpf_get_stackid)(void *ctx, void *map, __u64 flags) = (void *) 27; /* * bpf_csum_diff @@ -787,7 +792,7 @@ static __s64 (*bpf_csum_diff)(__be32 *from, __u32 from_size, __be32 *to, __u32 t * Returns * The size of the option data retrieved. */ -static int (*bpf_skb_get_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 size) = (void *) 29; +static long (*bpf_skb_get_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 size) = (void *) 29; /* * bpf_skb_set_tunnel_opt @@ -801,7 +806,7 @@ static int (*bpf_skb_get_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 siz * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_set_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 size) = (void *) 30; +static long (*bpf_skb_set_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 size) = (void *) 30; /* * bpf_skb_change_proto @@ -832,7 +837,7 @@ static int (*bpf_skb_set_tunnel_opt)(struct __sk_buff *skb, void *opt, __u32 siz * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_change_proto)(struct __sk_buff *skb, __be16 proto, __u64 flags) = (void *) 31; +static long (*bpf_skb_change_proto)(struct __sk_buff *skb, __be16 proto, __u64 flags) = (void *) 31; /* * bpf_skb_change_type @@ -863,7 +868,7 @@ static int (*bpf_skb_change_proto)(struct __sk_buff *skb, __be16 proto, __u64 fl * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_change_type)(struct __sk_buff *skb, __u32 type) = (void *) 32; +static long (*bpf_skb_change_type)(struct __sk_buff *skb, __u32 type) = (void *) 32; /* * bpf_skb_under_cgroup @@ -878,7 +883,7 @@ static int (*bpf_skb_change_type)(struct __sk_buff *skb, __u32 type) = (void *) * * 1, if the *skb* succeeded the cgroup2 descendant test. * * A negative error code, if an error occurred. */ -static int (*bpf_skb_under_cgroup)(struct __sk_buff *skb, void *map, __u32 index) = (void *) 33; +static long (*bpf_skb_under_cgroup)(struct __sk_buff *skb, void *map, __u32 index) = (void *) 33; /* * bpf_get_hash_recalc @@ -930,7 +935,7 @@ static __u64 (*bpf_get_current_task)(void) = (void *) 35; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_probe_write_user)(void *dst, const void *src, __u32 len) = (void *) 36; +static long (*bpf_probe_write_user)(void *dst, const void *src, __u32 len) = (void *) 36; /* * bpf_current_task_under_cgroup @@ -946,7 +951,7 @@ static int (*bpf_probe_write_user)(void *dst, const void *src, __u32 len) = (voi * * 1, if the *skb* task does not belong to the cgroup2. * * A negative error code, if an error occurred. */ -static int (*bpf_current_task_under_cgroup)(void *map, __u32 index) = (void *) 37; +static long (*bpf_current_task_under_cgroup)(void *map, __u32 index) = (void *) 37; /* * bpf_skb_change_tail @@ -974,7 +979,7 @@ static int (*bpf_current_task_under_cgroup)(void *map, __u32 index) = (void *) 3 * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_change_tail)(struct __sk_buff *skb, __u32 len, __u64 flags) = (void *) 38; +static long (*bpf_skb_change_tail)(struct __sk_buff *skb, __u32 len, __u64 flags) = (void *) 38; /* * bpf_skb_pull_data @@ -1014,7 +1019,7 @@ static int (*bpf_skb_change_tail)(struct __sk_buff *skb, __u32 len, __u64 flags) * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_pull_data)(struct __sk_buff *skb, __u32 len) = (void *) 39; +static long (*bpf_skb_pull_data)(struct __sk_buff *skb, __u32 len) = (void *) 39; /* * bpf_csum_update @@ -1057,7 +1062,7 @@ static void (*bpf_set_hash_invalid)(struct __sk_buff *skb) = (void *) 41; * Returns * The id of current NUMA node. */ -static int (*bpf_get_numa_node_id)(void) = (void *) 42; +static long (*bpf_get_numa_node_id)(void) = (void *) 42; /* * bpf_skb_change_head @@ -1082,7 +1087,7 @@ static int (*bpf_get_numa_node_id)(void) = (void *) 42; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_change_head)(struct __sk_buff *skb, __u32 len, __u64 flags) = (void *) 43; +static long (*bpf_skb_change_head)(struct __sk_buff *skb, __u32 len, __u64 flags) = (void *) 43; /* * bpf_xdp_adjust_head @@ -1101,7 +1106,7 @@ static int (*bpf_skb_change_head)(struct __sk_buff *skb, __u32 len, __u64 flags) * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_xdp_adjust_head)(struct xdp_md *xdp_md, int delta) = (void *) 44; +static long (*bpf_xdp_adjust_head)(struct xdp_md *xdp_md, int delta) = (void *) 44; /* * bpf_probe_read_str @@ -1118,7 +1123,7 @@ static int (*bpf_xdp_adjust_head)(struct xdp_md *xdp_md, int delta) = (void *) 4 * including the trailing NUL character. On error, a negative * value. */ -static int (*bpf_probe_read_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 45; +static long (*bpf_probe_read_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 45; /* * bpf_get_socket_cookie @@ -1159,7 +1164,7 @@ static __u32 (*bpf_get_socket_uid)(struct __sk_buff *skb) = (void *) 47; * Returns * 0 */ -static __u32 (*bpf_set_hash)(struct __sk_buff *skb, __u32 hash) = (void *) 48; +static long (*bpf_set_hash)(struct __sk_buff *skb, __u32 hash) = (void *) 48; /* * bpf_setsockopt @@ -1181,17 +1186,20 @@ static __u32 (*bpf_set_hash)(struct __sk_buff *skb, __u32 hash) = (void *) 48; * * * **SOL_SOCKET**, which supports the following *optname*\ s: * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**, - * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**. + * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**, + * **SO_BINDTODEVICE**, **SO_KEEPALIVE**. * * **IPPROTO_TCP**, which supports the following *optname*\ s: * **TCP_CONGESTION**, **TCP_BPF_IW**, - * **TCP_BPF_SNDCWND_CLAMP**. + * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**, + * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**, + * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**. * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. * * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_setsockopt)(void *bpf_socket, int level, int optname, void *optval, int optlen) = (void *) 49; +static long (*bpf_setsockopt)(void *bpf_socket, int level, int optname, void *optval, int optlen) = (void *) 49; /* * bpf_skb_adjust_room @@ -1241,7 +1249,7 @@ static int (*bpf_setsockopt)(void *bpf_socket, int level, int optname, void *opt * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_adjust_room)(struct __sk_buff *skb, __s32 len_diff, __u32 mode, __u64 flags) = (void *) 50; +static long (*bpf_skb_adjust_room)(struct __sk_buff *skb, __s32 len_diff, __u32 mode, __u64 flags) = (void *) 50; /* * bpf_redirect_map @@ -1266,7 +1274,7 @@ static int (*bpf_skb_adjust_room)(struct __sk_buff *skb, __s32 len_diff, __u32 m * **XDP_REDIRECT** on success, or the value of the two lower bits * of the *flags* argument on error. */ -static int (*bpf_redirect_map)(void *map, __u32 key, __u64 flags) = (void *) 51; +static long (*bpf_redirect_map)(void *map, __u32 key, __u64 flags) = (void *) 51; /* * bpf_sk_redirect_map @@ -1281,7 +1289,7 @@ static int (*bpf_redirect_map)(void *map, __u32 key, __u64 flags) = (void *) 51; * Returns * **SK_PASS** on success, or **SK_DROP** on error. */ -static int (*bpf_sk_redirect_map)(struct __sk_buff *skb, void *map, __u32 key, __u64 flags) = (void *) 52; +static long (*bpf_sk_redirect_map)(struct __sk_buff *skb, void *map, __u32 key, __u64 flags) = (void *) 52; /* * bpf_sock_map_update @@ -1304,7 +1312,7 @@ static int (*bpf_sk_redirect_map)(struct __sk_buff *skb, void *map, __u32 key, _ * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_sock_map_update)(struct bpf_sock_ops *skops, void *map, void *key, __u64 flags) = (void *) 53; +static long (*bpf_sock_map_update)(struct bpf_sock_ops *skops, void *map, void *key, __u64 flags) = (void *) 53; /* * bpf_xdp_adjust_meta @@ -1337,7 +1345,7 @@ static int (*bpf_sock_map_update)(struct bpf_sock_ops *skops, void *map, void *k * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_xdp_adjust_meta)(struct xdp_md *xdp_md, int delta) = (void *) 54; +static long (*bpf_xdp_adjust_meta)(struct xdp_md *xdp_md, int delta) = (void *) 54; /* * bpf_perf_event_read_value @@ -1391,7 +1399,7 @@ static int (*bpf_xdp_adjust_meta)(struct xdp_md *xdp_md, int delta) = (void *) 5 * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_perf_event_read_value)(void *map, __u64 flags, struct bpf_perf_event_value *buf, __u32 buf_size) = (void *) 55; +static long (*bpf_perf_event_read_value)(void *map, __u64 flags, struct bpf_perf_event_value *buf, __u32 buf_size) = (void *) 55; /* * bpf_perf_prog_read_value @@ -1406,7 +1414,7 @@ static int (*bpf_perf_event_read_value)(void *map, __u64 flags, struct bpf_perf_ * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_perf_prog_read_value)(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, __u32 buf_size) = (void *) 56; +static long (*bpf_perf_prog_read_value)(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, __u32 buf_size) = (void *) 56; /* * bpf_getsockopt @@ -1435,7 +1443,7 @@ static int (*bpf_perf_prog_read_value)(struct bpf_perf_event_data *ctx, struct b * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_getsockopt)(void *bpf_socket, int level, int optname, void *optval, int optlen) = (void *) 57; +static long (*bpf_getsockopt)(void *bpf_socket, int level, int optname, void *optval, int optlen) = (void *) 57; /* * bpf_override_return @@ -1464,7 +1472,7 @@ static int (*bpf_getsockopt)(void *bpf_socket, int level, int optname, void *opt * Returns * 0 */ -static int (*bpf_override_return)(struct pt_regs *regs, __u64 rc) = (void *) 58; +static long (*bpf_override_return)(struct pt_regs *regs, __u64 rc) = (void *) 58; /* * bpf_sock_ops_cb_flags_set @@ -1512,7 +1520,7 @@ static int (*bpf_override_return)(struct pt_regs *regs, __u64 rc) = (void *) 58; * be set is returned (which comes down to 0 if all bits were set * as required). */ -static int (*bpf_sock_ops_cb_flags_set)(struct bpf_sock_ops *bpf_sock, int argval) = (void *) 59; +static long (*bpf_sock_ops_cb_flags_set)(struct bpf_sock_ops *bpf_sock, int argval) = (void *) 59; /* * bpf_msg_redirect_map @@ -1530,7 +1538,7 @@ static int (*bpf_sock_ops_cb_flags_set)(struct bpf_sock_ops *bpf_sock, int argva * Returns * **SK_PASS** on success, or **SK_DROP** on error. */ -static int (*bpf_msg_redirect_map)(struct sk_msg_md *msg, void *map, __u32 key, __u64 flags) = (void *) 60; +static long (*bpf_msg_redirect_map)(struct sk_msg_md *msg, void *map, __u32 key, __u64 flags) = (void *) 60; /* * bpf_msg_apply_bytes @@ -1568,7 +1576,7 @@ static int (*bpf_msg_redirect_map)(struct sk_msg_md *msg, void *map, __u32 key, * Returns * 0 */ -static int (*bpf_msg_apply_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) 61; +static long (*bpf_msg_apply_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) 61; /* * bpf_msg_cork_bytes @@ -1590,7 +1598,7 @@ static int (*bpf_msg_apply_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) * Returns * 0 */ -static int (*bpf_msg_cork_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) 62; +static long (*bpf_msg_cork_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) 62; /* * bpf_msg_pull_data @@ -1625,7 +1633,7 @@ static int (*bpf_msg_cork_bytes)(struct sk_msg_md *msg, __u32 bytes) = (void *) * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_msg_pull_data)(struct sk_msg_md *msg, __u32 start, __u32 end, __u64 flags) = (void *) 63; +static long (*bpf_msg_pull_data)(struct sk_msg_md *msg, __u32 start, __u32 end, __u64 flags) = (void *) 63; /* * bpf_bind @@ -1647,7 +1655,7 @@ static int (*bpf_msg_pull_data)(struct sk_msg_md *msg, __u32 start, __u32 end, _ * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_bind)(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len) = (void *) 64; +static long (*bpf_bind)(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len) = (void *) 64; /* * bpf_xdp_adjust_tail @@ -1665,7 +1673,7 @@ static int (*bpf_bind)(struct bpf_sock_addr *ctx, struct sockaddr *addr, int add * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_xdp_adjust_tail)(struct xdp_md *xdp_md, int delta) = (void *) 65; +static long (*bpf_xdp_adjust_tail)(struct xdp_md *xdp_md, int delta) = (void *) 65; /* * bpf_skb_get_xfrm_state @@ -1685,7 +1693,7 @@ static int (*bpf_xdp_adjust_tail)(struct xdp_md *xdp_md, int delta) = (void *) 6 * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_get_xfrm_state)(struct __sk_buff *skb, __u32 index, struct bpf_xfrm_state *xfrm_state, __u32 size, __u64 flags) = (void *) 66; +static long (*bpf_skb_get_xfrm_state)(struct __sk_buff *skb, __u32 index, struct bpf_xfrm_state *xfrm_state, __u32 size, __u64 flags) = (void *) 66; /* * bpf_get_stack @@ -1722,7 +1730,7 @@ static int (*bpf_skb_get_xfrm_state)(struct __sk_buff *skb, __u32 index, struct * A non-negative value equal to or less than *size* on success, * or a negative error in case of failure. */ -static int (*bpf_get_stack)(void *ctx, void *buf, __u32 size, __u64 flags) = (void *) 67; +static long (*bpf_get_stack)(void *ctx, void *buf, __u32 size, __u64 flags) = (void *) 67; /* * bpf_skb_load_bytes_relative @@ -1748,7 +1756,7 @@ static int (*bpf_get_stack)(void *ctx, void *buf, __u32 size, __u64 flags) = (vo * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_load_bytes_relative)(const void *skb, __u32 offset, void *to, __u32 len, __u32 start_header) = (void *) 68; +static long (*bpf_skb_load_bytes_relative)(const void *skb, __u32 offset, void *to, __u32 len, __u32 start_header) = (void *) 68; /* * bpf_fib_lookup @@ -1783,7 +1791,7 @@ static int (*bpf_skb_load_bytes_relative)(const void *skb, __u32 offset, void *t * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the * packet is not forwarded or needs assist from full stack */ -static int (*bpf_fib_lookup)(void *ctx, struct bpf_fib_lookup *params, int plen, __u32 flags) = (void *) 69; +static long (*bpf_fib_lookup)(void *ctx, struct bpf_fib_lookup *params, int plen, __u32 flags) = (void *) 69; /* * bpf_sock_hash_update @@ -1806,7 +1814,7 @@ static int (*bpf_fib_lookup)(void *ctx, struct bpf_fib_lookup *params, int plen, * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_sock_hash_update)(struct bpf_sock_ops *skops, void *map, void *key, __u64 flags) = (void *) 70; +static long (*bpf_sock_hash_update)(struct bpf_sock_ops *skops, void *map, void *key, __u64 flags) = (void *) 70; /* * bpf_msg_redirect_hash @@ -1824,7 +1832,7 @@ static int (*bpf_sock_hash_update)(struct bpf_sock_ops *skops, void *map, void * * Returns * **SK_PASS** on success, or **SK_DROP** on error. */ -static int (*bpf_msg_redirect_hash)(struct sk_msg_md *msg, void *map, void *key, __u64 flags) = (void *) 71; +static long (*bpf_msg_redirect_hash)(struct sk_msg_md *msg, void *map, void *key, __u64 flags) = (void *) 71; /* * bpf_sk_redirect_hash @@ -1842,7 +1850,7 @@ static int (*bpf_msg_redirect_hash)(struct sk_msg_md *msg, void *map, void *key, * Returns * **SK_PASS** on success, or **SK_DROP** on error. */ -static int (*bpf_sk_redirect_hash)(struct __sk_buff *skb, void *map, void *key, __u64 flags) = (void *) 72; +static long (*bpf_sk_redirect_hash)(struct __sk_buff *skb, void *map, void *key, __u64 flags) = (void *) 72; /* * bpf_lwt_push_encap @@ -1883,7 +1891,7 @@ static int (*bpf_sk_redirect_hash)(struct __sk_buff *skb, void *map, void *key, * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_lwt_push_encap)(struct __sk_buff *skb, __u32 type, void *hdr, __u32 len) = (void *) 73; +static long (*bpf_lwt_push_encap)(struct __sk_buff *skb, __u32 type, void *hdr, __u32 len) = (void *) 73; /* * bpf_lwt_seg6_store_bytes @@ -1902,7 +1910,7 @@ static int (*bpf_lwt_push_encap)(struct __sk_buff *skb, __u32 type, void *hdr, _ * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_lwt_seg6_store_bytes)(struct __sk_buff *skb, __u32 offset, const void *from, __u32 len) = (void *) 74; +static long (*bpf_lwt_seg6_store_bytes)(struct __sk_buff *skb, __u32 offset, const void *from, __u32 len) = (void *) 74; /* * bpf_lwt_seg6_adjust_srh @@ -1922,7 +1930,7 @@ static int (*bpf_lwt_seg6_store_bytes)(struct __sk_buff *skb, __u32 offset, cons * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_lwt_seg6_adjust_srh)(struct __sk_buff *skb, __u32 offset, __s32 delta) = (void *) 75; +static long (*bpf_lwt_seg6_adjust_srh)(struct __sk_buff *skb, __u32 offset, __s32 delta) = (void *) 75; /* * bpf_lwt_seg6_action @@ -1955,7 +1963,7 @@ static int (*bpf_lwt_seg6_adjust_srh)(struct __sk_buff *skb, __u32 offset, __s32 * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_lwt_seg6_action)(struct __sk_buff *skb, __u32 action, void *param, __u32 param_len) = (void *) 76; +static long (*bpf_lwt_seg6_action)(struct __sk_buff *skb, __u32 action, void *param, __u32 param_len) = (void *) 76; /* * bpf_rc_repeat @@ -1978,7 +1986,7 @@ static int (*bpf_lwt_seg6_action)(struct __sk_buff *skb, __u32 action, void *par * Returns * 0 */ -static int (*bpf_rc_repeat)(void *ctx) = (void *) 77; +static long (*bpf_rc_repeat)(void *ctx) = (void *) 77; /* * bpf_rc_keydown @@ -2008,7 +2016,7 @@ static int (*bpf_rc_repeat)(void *ctx) = (void *) 77; * Returns * 0 */ -static int (*bpf_rc_keydown)(void *ctx, __u32 protocol, __u64 scancode, __u32 toggle) = (void *) 78; +static long (*bpf_rc_keydown)(void *ctx, __u32 protocol, __u64 scancode, __u32 toggle) = (void *) 78; /* * bpf_skb_cgroup_id @@ -2073,7 +2081,7 @@ static void *(*bpf_get_local_storage)(void *map, __u64 flags) = (void *) 81; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_sk_select_reuseport)(struct sk_reuseport_md *reuse, void *map, void *key, __u64 flags) = (void *) 82; +static long (*bpf_sk_select_reuseport)(struct sk_reuseport_md *reuse, void *map, void *key, __u64 flags) = (void *) 82; /* * bpf_skb_ancestor_cgroup_id @@ -2189,7 +2197,7 @@ static struct bpf_sock *(*bpf_sk_lookup_udp)(void *ctx, struct bpf_sock_tuple *t * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_sk_release)(struct bpf_sock *sock) = (void *) 86; +static long (*bpf_sk_release)(struct bpf_sock *sock) = (void *) 86; /* * bpf_map_push_elem @@ -2203,7 +2211,7 @@ static int (*bpf_sk_release)(struct bpf_sock *sock) = (void *) 86; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_map_push_elem)(void *map, const void *value, __u64 flags) = (void *) 87; +static long (*bpf_map_push_elem)(void *map, const void *value, __u64 flags) = (void *) 87; /* * bpf_map_pop_elem @@ -2213,7 +2221,7 @@ static int (*bpf_map_push_elem)(void *map, const void *value, __u64 flags) = (vo * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_map_pop_elem)(void *map, void *value) = (void *) 88; +static long (*bpf_map_pop_elem)(void *map, void *value) = (void *) 88; /* * bpf_map_peek_elem @@ -2223,7 +2231,7 @@ static int (*bpf_map_pop_elem)(void *map, void *value) = (void *) 88; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_map_peek_elem)(void *map, void *value) = (void *) 89; +static long (*bpf_map_peek_elem)(void *map, void *value) = (void *) 89; /* * bpf_msg_push_data @@ -2243,7 +2251,7 @@ static int (*bpf_map_peek_elem)(void *map, void *value) = (void *) 89; * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_msg_push_data)(struct sk_msg_md *msg, __u32 start, __u32 len, __u64 flags) = (void *) 90; +static long (*bpf_msg_push_data)(struct sk_msg_md *msg, __u32 start, __u32 len, __u64 flags) = (void *) 90; /* * bpf_msg_pop_data @@ -2259,7 +2267,7 @@ static int (*bpf_msg_push_data)(struct sk_msg_md *msg, __u32 start, __u32 len, _ * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_msg_pop_data)(struct sk_msg_md *msg, __u32 start, __u32 len, __u64 flags) = (void *) 91; +static long (*bpf_msg_pop_data)(struct sk_msg_md *msg, __u32 start, __u32 len, __u64 flags) = (void *) 91; /* * bpf_rc_pointer_rel @@ -2277,7 +2285,7 @@ static int (*bpf_msg_pop_data)(struct sk_msg_md *msg, __u32 start, __u32 len, __ * Returns * 0 */ -static int (*bpf_rc_pointer_rel)(void *ctx, __s32 rel_x, __s32 rel_y) = (void *) 92; +static long (*bpf_rc_pointer_rel)(void *ctx, __s32 rel_x, __s32 rel_y) = (void *) 92; /* * bpf_spin_lock @@ -2329,7 +2337,7 @@ static int (*bpf_rc_pointer_rel)(void *ctx, __s32 rel_x, __s32 rel_y) = (void *) * Returns * 0 */ -static int (*bpf_spin_lock)(struct bpf_spin_lock *lock) = (void *) 93; +static long (*bpf_spin_lock)(struct bpf_spin_lock *lock) = (void *) 93; /* * bpf_spin_unlock @@ -2340,7 +2348,7 @@ static int (*bpf_spin_lock)(struct bpf_spin_lock *lock) = (void *) 93; * Returns * 0 */ -static int (*bpf_spin_unlock)(struct bpf_spin_lock *lock) = (void *) 94; +static long (*bpf_spin_unlock)(struct bpf_spin_lock *lock) = (void *) 94; /* * bpf_sk_fullsock @@ -2378,7 +2386,7 @@ static struct bpf_tcp_sock *(*bpf_tcp_sock)(struct bpf_sock *sk) = (void *) 96; * 1 if the **CE** flag is set (either by the current helper call * or because it was already present), 0 if it is not set. */ -static int (*bpf_skb_ecn_set_ce)(struct __sk_buff *skb) = (void *) 97; +static long (*bpf_skb_ecn_set_ce)(struct __sk_buff *skb) = (void *) 97; /* * bpf_get_listener_sock @@ -2432,7 +2440,7 @@ static struct bpf_sock *(*bpf_skc_lookup_tcp)(void *ctx, struct bpf_sock_tuple * * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative * error otherwise. */ -static int (*bpf_tcp_check_syncookie)(struct bpf_sock *sk, void *iph, __u32 iph_len, struct tcphdr *th, __u32 th_len) = (void *) 100; +static long (*bpf_tcp_check_syncookie)(struct bpf_sock *sk, void *iph, __u32 iph_len, struct tcphdr *th, __u32 th_len) = (void *) 100; /* * bpf_sysctl_get_name @@ -2452,7 +2460,7 @@ static int (*bpf_tcp_check_syncookie)(struct bpf_sock *sk, void *iph, __u32 iph_ * **-E2BIG** if the buffer wasn't big enough (*buf* will contain * truncated name in this case). */ -static int (*bpf_sysctl_get_name)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len, __u64 flags) = (void *) 101; +static long (*bpf_sysctl_get_name)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len, __u64 flags) = (void *) 101; /* * bpf_sysctl_get_current_value @@ -2475,7 +2483,7 @@ static int (*bpf_sysctl_get_name)(struct bpf_sysctl *ctx, char *buf, unsigned lo * **-EINVAL** if current value was unavailable, e.g. because * sysctl is uninitialized and read returns -EIO for it. */ -static int (*bpf_sysctl_get_current_value)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len) = (void *) 102; +static long (*bpf_sysctl_get_current_value)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len) = (void *) 102; /* * bpf_sysctl_get_new_value @@ -2496,7 +2504,7 @@ static int (*bpf_sysctl_get_current_value)(struct bpf_sysctl *ctx, char *buf, un * * **-EINVAL** if sysctl is being read. */ -static int (*bpf_sysctl_get_new_value)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len) = (void *) 103; +static long (*bpf_sysctl_get_new_value)(struct bpf_sysctl *ctx, char *buf, unsigned long buf_len) = (void *) 103; /* * bpf_sysctl_set_new_value @@ -2517,7 +2525,7 @@ static int (*bpf_sysctl_get_new_value)(struct bpf_sysctl *ctx, char *buf, unsign * * **-EINVAL** if sysctl is being read. */ -static int (*bpf_sysctl_set_new_value)(struct bpf_sysctl *ctx, const char *buf, unsigned long buf_len) = (void *) 104; +static long (*bpf_sysctl_set_new_value)(struct bpf_sysctl *ctx, const char *buf, unsigned long buf_len) = (void *) 104; /* * bpf_strtol @@ -2545,7 +2553,7 @@ static int (*bpf_sysctl_set_new_value)(struct bpf_sysctl *ctx, const char *buf, * * **-ERANGE** if resulting value was out of range. */ -static int (*bpf_strtol)(const char *buf, unsigned long buf_len, __u64 flags, long *res) = (void *) 105; +static long (*bpf_strtol)(const char *buf, unsigned long buf_len, __u64 flags, long *res) = (void *) 105; /* * bpf_strtoul @@ -2572,7 +2580,7 @@ static int (*bpf_strtol)(const char *buf, unsigned long buf_len, __u64 flags, lo * * **-ERANGE** if resulting value was out of range. */ -static int (*bpf_strtoul)(const char *buf, unsigned long buf_len, __u64 flags, unsigned long *res) = (void *) 106; +static long (*bpf_strtoul)(const char *buf, unsigned long buf_len, __u64 flags, unsigned long *res) = (void *) 106; /* * bpf_sk_storage_get @@ -2616,7 +2624,7 @@ static void *(*bpf_sk_storage_get)(void *map, struct bpf_sock *sk, void *value, * * **-ENOENT** if the bpf-local-storage cannot be found. */ -static int (*bpf_sk_storage_delete)(void *map, struct bpf_sock *sk) = (void *) 108; +static long (*bpf_sk_storage_delete)(void *map, struct bpf_sock *sk) = (void *) 108; /* * bpf_send_signal @@ -2635,7 +2643,7 @@ static int (*bpf_sk_storage_delete)(void *map, struct bpf_sock *sk) = (void *) 1 * * **-EAGAIN** if bpf program can try again. */ -static int (*bpf_send_signal)(__u32 sig) = (void *) 109; +static long (*bpf_send_signal)(__u32 sig) = (void *) 109; /* * bpf_tcp_gen_syncookie @@ -2693,7 +2701,7 @@ static __s64 (*bpf_tcp_gen_syncookie)(struct bpf_sock *sk, void *iph, __u32 iph_ * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_skb_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 111; +static long (*bpf_skb_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 111; /* * bpf_probe_read_user @@ -2704,7 +2712,7 @@ static int (*bpf_skb_output)(void *ctx, void *map, __u64 flags, void *data, __u6 * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_probe_read_user)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 112; +static long (*bpf_probe_read_user)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 112; /* * bpf_probe_read_kernel @@ -2715,7 +2723,7 @@ static int (*bpf_probe_read_user)(void *dst, __u32 size, const void *unsafe_ptr) * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_probe_read_kernel)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 113; +static long (*bpf_probe_read_kernel)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 113; /* * bpf_probe_read_user_str @@ -2763,7 +2771,7 @@ static int (*bpf_probe_read_kernel)(void *dst, __u32 size, const void *unsafe_pt * including the trailing NUL character. On error, a negative * value. */ -static int (*bpf_probe_read_user_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 114; +static long (*bpf_probe_read_user_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 114; /* * bpf_probe_read_kernel_str @@ -2775,7 +2783,7 @@ static int (*bpf_probe_read_user_str)(void *dst, __u32 size, const void *unsafe_ * On success, the strictly positive length of the string, including * the trailing NUL character. On error, a negative value. */ -static int (*bpf_probe_read_kernel_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 115; +static long (*bpf_probe_read_kernel_str)(void *dst, __u32 size, const void *unsafe_ptr) = (void *) 115; /* * bpf_tcp_send_ack @@ -2786,7 +2794,7 @@ static int (*bpf_probe_read_kernel_str)(void *dst, __u32 size, const void *unsaf * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_tcp_send_ack)(void *tp, __u32 rcv_nxt) = (void *) 116; +static long (*bpf_tcp_send_ack)(void *tp, __u32 rcv_nxt) = (void *) 116; /* * bpf_send_signal_thread @@ -2804,7 +2812,7 @@ static int (*bpf_tcp_send_ack)(void *tp, __u32 rcv_nxt) = (void *) 116; * * **-EAGAIN** if bpf program can try again. */ -static int (*bpf_send_signal_thread)(__u32 sig) = (void *) 117; +static long (*bpf_send_signal_thread)(__u32 sig) = (void *) 117; /* * bpf_jiffies64 @@ -2837,7 +2845,7 @@ static __u64 (*bpf_jiffies64)(void) = (void *) 118; * * **-ENOENT** if architecture does not support branch records. */ -static int (*bpf_read_branch_records)(struct bpf_perf_event_data *ctx, void *buf, __u32 size, __u64 flags) = (void *) 119; +static long (*bpf_read_branch_records)(struct bpf_perf_event_data *ctx, void *buf, __u32 size, __u64 flags) = (void *) 119; /* * bpf_get_ns_current_pid_tgid @@ -2853,7 +2861,7 @@ static int (*bpf_read_branch_records)(struct bpf_perf_event_data *ctx, void *buf * * **-ENOENT** if pidns does not exists for the current task. */ -static int (*bpf_get_ns_current_pid_tgid)(__u64 dev, __u64 ino, struct bpf_pidns_info *nsdata, __u32 size) = (void *) 120; +static long (*bpf_get_ns_current_pid_tgid)(__u64 dev, __u64 ino, struct bpf_pidns_info *nsdata, __u32 size) = (void *) 120; /* * bpf_xdp_output @@ -2881,7 +2889,7 @@ static int (*bpf_get_ns_current_pid_tgid)(__u64 dev, __u64 ino, struct bpf_pidns * Returns * 0 on success, or a negative error in case of failure. */ -static int (*bpf_xdp_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 121; +static long (*bpf_xdp_output)(void *ctx, void *map, __u64 flags, void *data, __u64 size) = (void *) 121; /* * bpf_get_netns_cookie @@ -2951,7 +2959,7 @@ static __u64 (*bpf_get_current_ancestor_cgroup_id)(int ancestor_level) = (void * * **-ESOCKTNOSUPPORT** if the socket type is not supported * (reuseport). */ -static int (*bpf_sk_assign)(struct __sk_buff *skb, struct bpf_sock *sk, __u64 flags) = (void *) 124; +static long (*bpf_sk_assign)(struct __sk_buff *skb, struct bpf_sock *sk, __u64 flags) = (void *) 124; /* * bpf_ktime_get_boot_ns @@ -2996,7 +3004,7 @@ static __u64 (*bpf_ktime_get_boot_ns)(void) = (void *) 125; * * **-EOVERFLOW** if an overflow happened: The same object will be tried again. */ -static int (*bpf_seq_printf)(struct seq_file *m, const char *fmt, __u32 fmt_size, const void *data, __u32 data_len) = (void *) 126; +static long (*bpf_seq_printf)(struct seq_file *m, const char *fmt, __u32 fmt_size, const void *data, __u32 data_len) = (void *) 126; /* * bpf_seq_write @@ -3010,7 +3018,7 @@ static int (*bpf_seq_printf)(struct seq_file *m, const char *fmt, __u32 fmt_size * * **-EOVERFLOW** if an overflow happened: The same object will be tried again. */ -static int (*bpf_seq_write)(struct seq_file *m, const void *data, __u32 len) = (void *) 127; +static long (*bpf_seq_write)(struct seq_file *m, const void *data, __u32 len) = (void *) 127; /* * bpf_sk_cgroup_id @@ -3056,16 +3064,15 @@ static __u64 (*bpf_sk_ancestor_cgroup_id)(struct bpf_sock *sk, int ancestor_leve * bpf_ringbuf_output * * Copy *size* bytes from *data* into a ring buffer *ringbuf*. - * If BPF_RB_NO_WAKEUP is specified in *flags*, no notification of - * new data availability is sent. - * IF BPF_RB_FORCE_WAKEUP is specified in *flags*, notification of - * new data availability is sent unconditionally. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. * * Returns - * 0, on success; - * < 0, on error. + * 0 on success, or a negative error in case of failure. */ -static int (*bpf_ringbuf_output)(void *ringbuf, void *data, __u64 size, __u64 flags) = (void *) 130; +static long (*bpf_ringbuf_output)(void *ringbuf, void *data, __u64 size, __u64 flags) = (void *) 130; /* * bpf_ringbuf_reserve @@ -3082,10 +3089,10 @@ static void *(*bpf_ringbuf_reserve)(void *ringbuf, __u64 size, __u64 flags) = (v * bpf_ringbuf_submit * * Submit reserved ring buffer sample, pointed to by *data*. - * If BPF_RB_NO_WAKEUP is specified in *flags*, no notification of - * new data availability is sent. - * IF BPF_RB_FORCE_WAKEUP is specified in *flags*, notification of - * new data availability is sent unconditionally. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. * * Returns * Nothing. Always succeeds. @@ -3096,10 +3103,10 @@ static void (*bpf_ringbuf_submit)(void *data, __u64 flags) = (void *) 132; * bpf_ringbuf_discard * * Discard reserved ring buffer sample, pointed to by *data*. - * If BPF_RB_NO_WAKEUP is specified in *flags*, no notification of - * new data availability is sent. - * IF BPF_RB_FORCE_WAKEUP is specified in *flags*, notification of - * new data availability is sent unconditionally. + * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification + * of new data availability is sent. + * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification + * of new data availability is sent unconditionally. * * Returns * Nothing. Always succeeds. @@ -3111,17 +3118,19 @@ static void (*bpf_ringbuf_discard)(void *data, __u64 flags) = (void *) 133; * * Query various characteristics of provided ring buffer. What * exactly is queries is determined by *flags*: - * - BPF_RB_AVAIL_DATA - amount of data not yet consumed; - * - BPF_RB_RING_SIZE - the size of ring buffer; - * - BPF_RB_CONS_POS - consumer position (can wrap around); - * - BPF_RB_PROD_POS - producer(s) position (can wrap around); - * Data returned is just a momentary snapshots of actual values + * + * * **BPF_RB_AVAIL_DATA**: Amount of data not yet consumed. + * * **BPF_RB_RING_SIZE**: The size of ring buffer. + * * **BPF_RB_CONS_POS**: Consumer position (can wrap around). + * * **BPF_RB_PROD_POS**: Producer(s) position (can wrap around). + * + * Data returned is just a momentary snapshot of actual values * and could be inaccurate, so this facility should be used to * power heuristics and for reporting, not to make 100% correct * calculation. * * Returns - * Requested value, or 0, if flags are not recognized. + * Requested value, or 0, if *flags* are not recognized. */ static __u64 (*bpf_ringbuf_query)(void *ringbuf, __u64 flags) = (void *) 134; @@ -3159,6 +3168,56 @@ static __u64 (*bpf_ringbuf_query)(void *ringbuf, __u64 flags) = (void *) 134; * is returned or the error code -EACCES in case the skb is not * subject to CHECKSUM_UNNECESSARY. */ -static int (*bpf_csum_level)(struct __sk_buff *skb, __u64 level) = (void *) 135; +static long (*bpf_csum_level)(struct __sk_buff *skb, __u64 level) = (void *) 135; + +/* + * bpf_skc_to_tcp6_sock + * + * Dynamically cast a *sk* pointer to a *tcp6_sock* pointer. + * + * Returns + * *sk* if casting is valid, or NULL otherwise. + */ +static struct tcp6_sock *(*bpf_skc_to_tcp6_sock)(void *sk) = (void *) 136; + +/* + * bpf_skc_to_tcp_sock + * + * Dynamically cast a *sk* pointer to a *tcp_sock* pointer. + * + * Returns + * *sk* if casting is valid, or NULL otherwise. + */ +static struct tcp_sock *(*bpf_skc_to_tcp_sock)(void *sk) = (void *) 137; + +/* + * bpf_skc_to_tcp_timewait_sock + * + * Dynamically cast a *sk* pointer to a *tcp_timewait_sock* pointer. + * + * Returns + * *sk* if casting is valid, or NULL otherwise. + */ +static struct tcp_timewait_sock *(*bpf_skc_to_tcp_timewait_sock)(void *sk) = (void *) 138; + +/* + * bpf_skc_to_tcp_request_sock + * + * Dynamically cast a *sk* pointer to a *tcp_request_sock* pointer. + * + * Returns + * *sk* if casting is valid, or NULL otherwise. + */ +static struct tcp_request_sock *(*bpf_skc_to_tcp_request_sock)(void *sk) = (void *) 139; + +/* + * bpf_skc_to_udp6_sock + * + * Dynamically cast a *sk* pointer to a *udp6_sock* pointer. + * + * Returns + * *sk* if casting is valid, or NULL otherwise. + */ +static struct udp6_sock *(*bpf_skc_to_udp6_sock)(void *sk) = (void *) 140;