Commit 99f57973 authored by Andrey Ignatov's avatar Andrey Ignatov Committed by Alexei Starovoitov
Browse files

selftests/bpf: Add sysctl and strtoX helpers to bpf_helpers.h



Add bpf_sysctl_* and bpf_strtoX helpers to bpf_helpers.h.

Signed-off-by: default avatarAndrey Ignatov <rdna@fb.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent b457e553
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -192,6 +192,25 @@ static int (*bpf_skb_ecn_set_ce)(void *ctx) =
static int (*bpf_tcp_check_syncookie)(struct bpf_sock *sk,
	    void *ip, int ip_len, void *tcp, int tcp_len) =
	(void *) BPF_FUNC_tcp_check_syncookie;
static int (*bpf_sysctl_get_name)(void *ctx, char *buf,
				  unsigned long long buf_len,
				  unsigned long long flags) =
	(void *) BPF_FUNC_sysctl_get_name;
static int (*bpf_sysctl_get_current_value)(void *ctx, char *buf,
					   unsigned long long buf_len) =
	(void *) BPF_FUNC_sysctl_get_current_value;
static int (*bpf_sysctl_get_new_value)(void *ctx, char *buf,
				       unsigned long long buf_len) =
	(void *) BPF_FUNC_sysctl_get_new_value;
static int (*bpf_sysctl_set_new_value)(void *ctx, const char *buf,
				       unsigned long long buf_len) =
	(void *) BPF_FUNC_sysctl_set_new_value;
static int (*bpf_strtol)(const char *buf, unsigned long long buf_len,
			 unsigned long long flags, long *res) =
	(void *) BPF_FUNC_strtol;
static int (*bpf_strtoul)(const char *buf, unsigned long long buf_len,
			  unsigned long long flags, unsigned long *res) =
	(void *) BPF_FUNC_strtoul;

/* llvm builtin functions that eBPF C program may use to
 * emit BPF_LD_ABS and BPF_LD_IND instructions