2020-12-03 12:46:26 -08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/* Copyright (c) 2020 Facebook */
|
|
|
|
#ifndef _BPF_TESTMOD_H
|
|
|
|
#define _BPF_TESTMOD_H
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
|
2024-02-08 18:37:50 -08:00
|
|
|
struct task_struct;
|
|
|
|
|
2020-12-03 12:46:26 -08:00
|
|
|
struct bpf_testmod_test_read_ctx {
|
|
|
|
char *buf;
|
|
|
|
loff_t off;
|
|
|
|
size_t len;
|
|
|
|
};
|
|
|
|
|
2021-01-19 12:22:37 +00:00
|
|
|
struct bpf_testmod_test_write_ctx {
|
|
|
|
char *buf;
|
|
|
|
loff_t off;
|
|
|
|
size_t len;
|
|
|
|
};
|
|
|
|
|
2021-10-04 17:48:57 +08:00
|
|
|
struct bpf_testmod_test_writable_ctx {
|
|
|
|
bool early_ret;
|
|
|
|
int val;
|
|
|
|
};
|
|
|
|
|
2023-03-08 10:41:21 -08:00
|
|
|
/* BPF iter that returns *value* *n* times in a row */
|
|
|
|
struct bpf_iter_testmod_seq {
|
|
|
|
s64 value;
|
|
|
|
int cnt;
|
|
|
|
};
|
|
|
|
|
2024-01-19 14:50:05 -08:00
|
|
|
struct bpf_testmod_ops {
|
|
|
|
int (*test_1)(void);
|
2024-02-03 22:12:04 -08:00
|
|
|
void (*test_2)(int a, int b);
|
2024-02-08 18:37:50 -08:00
|
|
|
/* Used to test nullable arguments. */
|
|
|
|
int (*test_maybe_null)(int dummy, struct task_struct *task);
|
2024-01-19 14:50:05 -08:00
|
|
|
};
|
|
|
|
|
2020-12-03 12:46:26 -08:00
|
|
|
#endif /* _BPF_TESTMOD_H */
|