From ec711ae65c1ef13ec486bc4fa3acf5c398c3bc89 Mon Sep 17 00:00:00 2001 From: xhuacmer Date: Wed, 8 Mar 2023 14:59:51 +0800 Subject: [PATCH] add ebpf vm test header files --- ebpf_vm_test/CMakeLists.txt | 6 ++++++ ebpf_vm_test/mp_vm_test.h | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 ebpf_vm_test/CMakeLists.txt create mode 100644 ebpf_vm_test/mp_vm_test.h diff --git a/ebpf_vm_test/CMakeLists.txt b/ebpf_vm_test/CMakeLists.txt new file mode 100644 index 0000000..81fc747 --- /dev/null +++ b/ebpf_vm_test/CMakeLists.txt @@ -0,0 +1,6 @@ +#packet vm makefile + +add_executable(vm_test mp_vm_test.c test_monitor_address.c) + +include_directories(${CMAKE_SOURCE_DIR}/ebpf_vm_executor) +target_link_libraries(vm_test LINK_PUBLIC ebpf_vm_executor) \ No newline at end of file diff --git a/ebpf_vm_test/mp_vm_test.h b/ebpf_vm_test/mp_vm_test.h new file mode 100644 index 0000000..00617ab --- /dev/null +++ b/ebpf_vm_test/mp_vm_test.h @@ -0,0 +1,20 @@ +#ifndef _MP_VM_TEST_H_ +#define _MP_VM_TEST_H_ + +#include "ebpf_vm_simulator.h" + +enum { + MP_VM_TEST_GENERAL, + MP_VM_TEST_MONITOR_ADDR, + MP_VM_TEST_NUM +}; + +struct vm_test_case { + int index; + void *(*setup)(struct ebpf_vm_executor *executor, struct ebpf_vm *vm, int argc, char **argv); + void (*teardown)(void *ctx); +}; + +int register_test_case(struct vm_test_case *test); + +#endif \ No newline at end of file -- Gitee