xref: /linux/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h (revision be239684b18e1cdcafcf8c7face4a2f562c745ad)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2020 Facebook */
3 #ifndef _BPF_TESTMOD_H
4 #define _BPF_TESTMOD_H
5 
6 #include <linux/types.h>
7 
8 struct bpf_testmod_test_read_ctx {
9 	char *buf;
10 	loff_t off;
11 	size_t len;
12 };
13 
14 struct bpf_testmod_test_write_ctx {
15 	char *buf;
16 	loff_t off;
17 	size_t len;
18 };
19 
20 struct bpf_testmod_test_writable_ctx {
21 	bool early_ret;
22 	int val;
23 };
24 
25 /* BPF iter that returns *value* *n* times in a row */
26 struct bpf_iter_testmod_seq {
27 	s64 value;
28 	int cnt;
29 };
30 
31 #endif /* _BPF_TESTMOD_H */
32