Skip to content

Commit

Permalink
Spelling (microsoft#1601)
Browse files Browse the repository at this point in the history
* Fix spelling in docs

Signed-off-by: Alan Jowett <[email protected]>

* Fix spelling in ebpfsvc

Signed-off-by: Alan Jowett <[email protected]>

* Fix include

Signed-off-by: Alan Jowett <[email protected]>

* Fix libs part 1

Signed-off-by: Alan Jowett <[email protected]>

* Fix libs part 2

Signed-off-by: Alan Jowett <[email protected]>

* Fix tests

Signed-off-by: Alan Jowett <[email protected]>

* Fix tools

Signed-off-by: Alan Jowett <[email protected]>

* Fix build

Signed-off-by: Alan Jowett <[email protected]>

* PR feedback

Signed-off-by: Alan Jowett <[email protected]>

* Fix generated files

Signed-off-by: Alan Jowett <[email protected]>

* PR feedback

Signed-off-by: Alan Jowett <[email protected]>

Signed-off-by: Alan Jowett <[email protected]>
Co-authored-by: Anurag Saxena <[email protected]>
  • Loading branch information
Alan-Jowett and saxena-anurag authored Nov 16, 2022
1 parent 69574e0 commit 58cdfdc
Show file tree
Hide file tree
Showing 89 changed files with 134 additions and 246 deletions.
6 changes: 3 additions & 3 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Alternative install steps:
2. Run:
```
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-WebRequest 'https://raw.githubusercontent.com/microsoft/ebpf-for-windows/main/scripts/Setup-DevEnv.ps1' -OutFile $env:TEMP\Setup-DeveEnv.ps1
if ((get-filehash $env:TEMP\Setup-DeveEnv.ps1).Hash -eq '4000D4B2478A5CE9A779140DEDAEF99E422D9A8706B4ECE596CF0F69DB667055') { &"$env:TEMP\Setup-DeveEnv.ps1" }
Invoke-WebRequest 'https://raw.githubusercontent.com/microsoft/ebpf-for-windows/main/scripts/Setup-DevEnv.ps1' -OutFile $env:TEMP\Setup-DevEnv.ps1
if ((get-filehash $env:TEMP\Setup-DevEnv.ps1).Hash -eq '4000D4B2478A5CE9A779140DEDAEF99E422D9A8706B4ECE596CF0F69DB667055') { &"$env:TEMP\Setup-DevEnv.ps1" }
```
3. Launch Visual Studio Installer and select "MSVC v142 - VS 2019 C++ x64/x86 Spectre-mitigated libs (latest)"

Expand Down Expand Up @@ -152,7 +152,7 @@ Windows requires that one of the following criteria be met prior to loading a dr
2. The OS is booted with a kernel debugger attached.
3. The OS is running in [test-signing mode](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/the-testsigning-boot-configuration-option), the [driver is test signed](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/test-signing-a-driver-through-an-embedded-signature) and the [test certificate is installed](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/installing-test-certificates).

Since the eBPF for Wndows binaries are not yet signed by Microsoft, they will only work on a machine with
Since the eBPF for Windows binaries are not yet signed by Microsoft, they will only work on a machine with
a kernel debugger (KD) attached and running, or test signing is enabled. (It is expected that official
releases of eBPF for Windows will eventually be production signed at some point in the future after
security hardening is completed.)
Expand Down
2 changes: 1 addition & 1 deletion docs/InstallEbpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Start an admin Powershell on the Windows Host and run the following command and

- Copy `images\*` and `ebpf-for-windows-c-temp.zip` from the Windows Host to a directory on the Linux machine (e.g. `$HOME/ebpf-for-windows-image`).

- Run the following command and provide parameters for `repositry`, `tag` and `OSVersion`:
- Run the following command and provide parameters for `repository`, `tag` and `OSVersion`:
```bash
$HOME/ebpf-for-windows-image/build-images.sh
````
Expand Down
6 changes: 3 additions & 3 deletions docs/SelfHostedRunnerSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

The CI/CD tests for `eBPF for Windows` requires installing kernel drivers, that are not supported in Github-hosted runners.
That is why self-host runners are needed to run those tests. The `driver` job in the `CI/CD` Github workflow (`cicd.yml`) runs on self-host runners that use Hyper-V VMs to deploy the eBPF components and run the CI/CD tests on. Using Hyper-V VMs enable the Github workflow to start from a clean state every time the test runs by restoring the VMs to a "baseline" snapshot.
This document discusses the steps to set up such a selfhosted actions-runner that can run the workflow for CI/CD tests on a fork of the eBPF for Windows repo.
This document discusses the steps to set up such a self-hosted actions-runner that can run the workflow for CI/CD tests on a fork of the eBPF for Windows repo.

1) Install Windows Server 2019 - build 17763.
1) [Windows Server 2019 Azure VM](https://portal.azure.com/#create/Microsoft.WindowsServer2019Datacenter-ARM)
2) [Download and install action runner](https://github.com/actions/runner/releases) following the instructions for Windows x64.
3) Create a new selfhosted runner for the fork. This requires administrator permissions in the project. Go to the settings menu in Github UI, select `Actions`->`Runners` and click on the `New selfhosted-runner` button. This will generate a token for the selfhosted runner.
3) Create a new self-hosted runner for the fork. This requires administrator permissions in the project. Go to the settings menu in Github UI, select `Actions`->`Runners` and click on the `New self-hosted-runner` button. This will generate a token for the self-hosted runner.
4) Configure action runner as follows:
```./config.cmd --url <fork URL> --labels 'ebpf_cicd_tests' --token <action runner token> --runasservice --windowslogonaccount <account> --windowslogonpassword <password> ```
For the `--url` parameter provide the URL to the fork for which seflhosted runner is being configured.<br/>
For the `--url` parameter provide the URL to the fork for which self-hosted runner is being configured.<br/>
For the `--token` parameter provide the token obtained in step 3.<br/>
The value for `--labels` parameter (`ebpf_cicd_tests`) must be the same as the `environment` field in the job named `driver` in `cicd.yml`.<br/>
The `--runasservice` parameter makes the action runner run as a Windows service. The runner service runs as
Expand Down
4 changes: 2 additions & 2 deletions docs/vm-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

To debug kernel-mode issues in the VM, see [Setting up a Connection to a Virtual Machine in Visual Studio](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/setting-up-a-connection-to-a-virtual-machine-in-visual-studio).

To use Windbg or KD as the debugger instead of Visual Studio, see [Setting Up Kernel-Mode Debugging of a Virtual Machine Manually using a Virtual COM Port](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/attaching-to-a-virtual-machine--kernel-mode-)
To use WinDbg or KD as the debugger instead of Visual Studio, see [Setting Up Kernel-Mode Debugging of a Virtual Machine Manually using a Virtual COM Port](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/attaching-to-a-virtual-machine--kernel-mode-)

Both of the links above contain the statement:
"In the virtual machine, configure the COM port to map to a named pipe. The debugger will connect through this pipe.
Expand All @@ -39,7 +39,7 @@ For more information about how to create this pipe, see your virtual machine's d
That step can be done from the *Host* as follows:

1. Start an admin powershell.
2. Do ' set-vmcomport "Windows 10 dev environment" 2 \\.\pipe\DebugVM -DebuggerMode On'
2. Do ' Set-VMComPort "Windows 10 dev environment" 2 \\.\pipe\DebugVM -DebuggerMode On'

After this point, use "\\.\pipe\DebugVM" in the rest of the instructions as the pipe name.

Expand Down
6 changes: 3 additions & 3 deletions ebpfcore/ebpf_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Abstract:
WDF based driver that does the following:
1. Initializes the eBPF execution context.
2. Opens an IOCTL surface that forwards commands to ebfp_core.
2. Opens an IOCTL surface that forwards commands to ebpf_core.
Environment:
Expand Down Expand Up @@ -42,7 +42,7 @@ static BOOLEAN _ebpf_driver_unloading_flag = FALSE;
#define EBPF_IOCTL_TYPE FILE_DEVICE_NETWORK

// Function codes from 0x800 to 0xFFF are for customer use.
#define IOCTL_EBPFCTL_METHOD_BUFFERED CTL_CODE(EBPF_IOCTL_TYPE, 0x900, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EBPF_CTL_METHOD_BUFFERED CTL_CODE(EBPF_IOCTL_TYPE, 0x900, METHOD_BUFFERED, FILE_ANY_ACCESS)

//
// Pre-Declarations
Expand Down Expand Up @@ -256,7 +256,7 @@ _ebpf_driver_io_device_control(
device = WdfIoQueueGetDevice(queue);

switch (io_control_code) {
case IOCTL_EBPFCTL_METHOD_BUFFERED:
case IOCTL_EBPF_CTL_METHOD_BUFFERED:
// Verify that length of the input buffer supplied to the request object
// is not zero
if (input_buffer_length != 0) {
Expand Down
12 changes: 6 additions & 6 deletions ebpfsvc/svcmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int __cdecl wmain(ULONG argc, PWSTR* argv)
int
service_install()
{
SC_HANDLE scmanager = nullptr;
SC_HANDLE service_control_manager = nullptr;
SC_HANDLE service = nullptr;
TCHAR path[MAX_PATH];
SERVICE_SID_INFO sid_info = {0};
Expand All @@ -69,20 +69,20 @@ service_install()

// Get a handle to the SCM database.

scmanager = OpenSCManager(
service_control_manager = OpenSCManager(
nullptr, // local computer
nullptr, // ServicesActive database
SC_MANAGER_ALL_ACCESS); // full access rights

if (nullptr == scmanager) {
if (nullptr == service_control_manager) {
result = GetLastError();
goto Exit;
}

// Create the service as LocalService.

service = CreateService(
scmanager, // SCM database
service_control_manager, // SCM database
SERVICE_NAME, // name of service
SERVICE_NAME, // service name to display
SERVICE_ALL_ACCESS, // desired access
Expand Down Expand Up @@ -112,8 +112,8 @@ service_install()
if (service != nullptr) {
CloseServiceHandle(service);
}
if (scmanager != nullptr) {
CloseServiceHandle(scmanager);
if (service_control_manager != nullptr) {
CloseServiceHandle(service_control_manager);
}

return result;
Expand Down
4 changes: 2 additions & 2 deletions include/bpf/libbpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ bpf_object__prev_program(const struct bpf_object* obj, struct bpf_program* prog)
*
* @exception EINVAL An invalid argument was provided.
*
* @sa bpf_map__upnin
* @sa bpf_map__unpin
* @sa bpf_object__pin_maps
* @sa bpf_object__unpin
*/
Expand All @@ -471,7 +471,7 @@ bpf_object__unpin_maps(struct bpf_object* obj, const char* path);
* @exception EINVAL An invalid argument was provided.
*
* @sa bpf_program__unpin
* @sa bpf_object__pin_mprograms
* @sa bpf_object__pin_programs
* @sa bpf_object__unpin
*/
int
Expand Down
2 changes: 1 addition & 1 deletion include/ebpf_store_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ ebpf_store_update_program_information(

// Save "is_privileged".
status = write_registry_value_dword(
program_key, EBPF_PROGRAM_DATA_PRIVELEGED, program_info[i].program_type_descriptor.is_privileged);
program_key, EBPF_PROGRAM_DATA_PRIVILEGED, program_info[i].program_type_descriptor.is_privileged);
if (!IS_SUCCESS(status)) {
close_registry_key(program_key);
goto Exit;
Expand Down
2 changes: 1 addition & 1 deletion include/ebpf_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef uint8_t GUID[16];
#define EBPF_PROGRAM_DATA_NAME L"Name"
#define EBPF_PROGRAM_DATA_CONTEXT_DESCRIPTOR L"ContextDescriptor"
#define EBPF_PROGRAM_DATA_PLATFORM_SPECIFIC_DATA L"PlatformSpecificData"
#define EBPF_PROGRAM_DATA_PRIVELEGED L"IsPrivileged"
#define EBPF_PROGRAM_DATA_PRIVILEGED L"IsPrivileged"
#define EBPF_PROGRAM_DATA_HELPER_COUNT L"HelperCount"

#define EBPF_HELPER_DATA_PROTOTYPE L"Prototype"
Expand Down
10 changes: 5 additions & 5 deletions libs/api/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ _get_program_and_map_names(
_Must_inspect_result_ ebpf_result_t
load_byte_code(
_In_z_ const char* filename,
_In_opt_z_ const char* sectionname,
_In_opt_z_ const char* section_name,
_In_ ebpf_verifier_options_t* verifier_options,
_In_z_ const char* pin_root_path,
_Inout_ std::vector<ebpf_program_t*>& programs,
Expand All @@ -178,12 +178,12 @@ load_byte_code(
try {
const ebpf_platform_t* platform = &g_ebpf_platform_windows;
std::string file_name(filename);
std::string section_name;
if (sectionname != nullptr) {
section_name = std::string(sectionname);
std::string section_name_string;
if (section_name != nullptr) {
section_name_string = std::string(section_name);
}

auto raw_programs = read_elf(file_name, section_name, verifier_options, platform);
auto raw_programs = read_elf(file_name, section_name_string, verifier_options, platform);
if (raw_programs.size() == 0) {
result = EBPF_ELF_PARSING_FAILED;
goto Exit;
Expand Down
2 changes: 1 addition & 1 deletion libs/api/Verifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef int (*map_create_fp)(
_Must_inspect_result_ ebpf_result_t
load_byte_code(
_In_z_ const char* filename,
_In_opt_z_ const char* sectionname,
_In_opt_z_ const char* section_name,
_In_ ebpf_verifier_options_t* verifier_options,
_In_z_ const char* pin_root_path,
_Inout_ std::vector<ebpf_program_t*>& programs,
Expand Down
2 changes: 1 addition & 1 deletion libs/api/api_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ ebpf_map_unpin(_In_ struct bpf_map* map, _In_opt_z_ const char* path) noexcept;
* @param[in] map Pointer to eBPF map.
* @param[in] path Pin path for the map.
*
* @retval EBPF_SUCCESS The API suceeded.
* @retval EBPF_SUCCESS The API succeeded.
* @retval EBPF_NO_MEMORY Out of memory.
* @retval EBPF_INVALID_ARGUMENT One or more parameters are wrong.
*/
Expand Down
10 changes: 5 additions & 5 deletions libs/api/ebpf_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2848,7 +2848,7 @@ _ebpf_program_load_native(
SC_HANDLE service_handle = nullptr;
SERVICE_STATUS status = {0};
std::wstring service_path(SERVICE_PATH_PREFIX);
std::wstring paramaters_path(PARAMETERS_PATH_PREFIX);
std::wstring parameters_path(PARAMETERS_PATH_PREFIX);
ebpf_protocol_buffer_t request_buffer;
size_t count_of_maps = 0;
size_t count_of_programs = 0;
Expand Down Expand Up @@ -2886,15 +2886,15 @@ _ebpf_program_load_native(
}

// Create registry path and update module ID in the service path.
paramaters_path = paramaters_path + service_name.c_str() + L"\\" + SERVICE_PARAMETERS;
error = _ebpf_create_registry_key(HKEY_LOCAL_MACHINE, paramaters_path.c_str());
parameters_path = parameters_path + service_name.c_str() + L"\\" + SERVICE_PARAMETERS;
error = _ebpf_create_registry_key(HKEY_LOCAL_MACHINE, parameters_path.c_str());
if (error != ERROR_SUCCESS) {
result = win32_error_code_to_ebpf_result(error);
EBPF_LOG_WIN32_STRING_API_FAILURE(EBPF_TRACELOG_KEYWORD_API, file_name, _ebpf_create_registry_key);
goto Done;
}
error = _ebpf_update_registry_value(
HKEY_LOCAL_MACHINE, paramaters_path.c_str(), REG_BINARY, NPI_MODULE_ID, &provider_module_id, sizeof(GUID));
HKEY_LOCAL_MACHINE, parameters_path.c_str(), REG_BINARY, NPI_MODULE_ID, &provider_module_id, sizeof(GUID));
if (error != ERROR_SUCCESS) {
result = win32_error_code_to_ebpf_result(error);
EBPF_LOG_WIN32_STRING_API_FAILURE(EBPF_TRACELOG_KEYWORD_API, file_name, _ebpf_update_registry_value);
Expand Down Expand Up @@ -3592,7 +3592,7 @@ ebpf_ring_buffer_map_unsubscribe(_Inout_ _Post_invalid_ ring_buffer_subscription
// Set the unsubscribed flag, so that if a completion callback is ongoing, it does not issue another async
// IOCTL.
subscription->unsubscribed = true;
// Check if an earlier async opeeration has failed. In that case a new async operation will not be queued. This
// Check if an earlier async operation has failed. In that case a new async operation will not be queued. This
// is the only case in which the subscription object can be freed in this function.
if (subscription->async_ioctl_failed)
free_subscription = true;
Expand Down
6 changes: 3 additions & 3 deletions libs/api_common/device_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#define EBPF_IOCTL_TYPE FILE_DEVICE_NETWORK

// Function codes from 0x800 to 0xFFF are for customer use.
#define IOCTL_EBPFCTL_METHOD_BUFFERED CTL_CODE(EBPF_IOCTL_TYPE, 0x900, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EBPF_CTL_METHOD_BUFFERED CTL_CODE(EBPF_IOCTL_TYPE, 0x900, METHOD_BUFFERED, FILE_ANY_ACCESS)

// Maxiumum attempts to invoke an IOCTL.
// Maximum attempts to invoke an IOCTL.
#define IOCTL_MAX_ATTEMPTS 16

typedef std::vector<uint8_t> ebpf_protocol_buffer_t;
Expand Down Expand Up @@ -98,7 +98,7 @@ invoke_ioctl(request_t& request, reply_t& reply = _empty_reply, _Inout_opt_ OVER

auto success = Platform::DeviceIoControl(
get_device_handle(),
IOCTL_EBPFCTL_METHOD_BUFFERED,
IOCTL_EBPF_CTL_METHOD_BUFFERED,
request_ptr,
request_size,
reply_ptr,
Expand Down
2 changes: 1 addition & 1 deletion libs/api_common/store_helper_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ _load_program_data_information(
}

// Read "is_privileged".
status = read_registry_value_dword(program_info_key, EBPF_PROGRAM_DATA_PRIVELEGED, &is_privileged);
status = read_registry_value_dword(program_info_key, EBPF_PROGRAM_DATA_PRIVILEGED, &is_privileged);
if (result != EBPF_SUCCESS) {
goto Exit;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/execution_context/ebpf_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ ebpf_core_terminate()
// Terminate native module. This is a blocking call and will return only when
// all the native drivers have been detached and unloaded. Hence this needs
// to be called after ebpf_epoch_terminate() to ensure all the program epoch
// cleanup workitems have been executed by this time.
// cleanup work items have been executed by this time.
ebpf_native_terminate();

// Verify that all ebpf_core_object_t objects have been freed.
Expand Down
2 changes: 1 addition & 1 deletion libs/execution_context/ebpf_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ extern "C"
*
* @param[in] operation_id Identifier of the operation to execute.
* @param[in] input_buffer Encoded buffer containing parameters for this
* operaton.
* operation.
* @param[out] output_buffer Pointer to memory that will contain the
* encoded result parameters for this operation.
* @param[in] output_buffer_length Length of the output buffer.
Expand Down
6 changes: 3 additions & 3 deletions libs/platform/ebpf_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ extern "C"
_Post_writable_byte_size_(size) void* ebpf_allocate(size_t size);

/**
* @brief Rellocate memory.
* @brief Reallocate memory.
* @param[in] memory Allocation to be reallocated.
* @param[in] old_size Old size of memory to reallocate.
* @param[in] new_size New size of memory to reallocate.
Expand Down Expand Up @@ -365,7 +365,7 @@ extern "C"
/**
* @brief Query the platform to determine if the current execution can
* be preempted by other execution.
* @retrval True if this execution can be preempted.
* @retval True if this execution can be preempted.
*/
bool
ebpf_is_preemptible();
Expand Down Expand Up @@ -476,7 +476,7 @@ extern "C"
_In_opt_ void* work_item_context);

/**
* @brief Schedule a work item to be executed after elaped_microseconds.
* @brief Schedule a work item to be executed after elapsed_microseconds.
*
* @param[in] timer Pointer to timer to schedule.
* @param[in] elapsed_microseconds Microseconds to delay before executing
Expand Down
2 changes: 1 addition & 1 deletion libs/platform/ebpf_serialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ ebpf_serialize_program_info(

*serialized_data_length = 0;

// Peform sanity check on input program info.
// Perform sanity check on input program info.
program_type_descriptor = &program_info->program_type_descriptor;

if (program_type_descriptor->name == NULL) {
Expand Down
14 changes: 7 additions & 7 deletions libs/platform/unit/platform_unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class _test_helper
REQUIRE(ebpf_platform_initiate() == EBPF_SUCCESS);
platform_initiated = true;
REQUIRE(ebpf_epoch_initiate() == EBPF_SUCCESS);
epoch_initated = true;
epoch_initiated = true;
REQUIRE(ebpf_async_initiate() == EBPF_SUCCESS);
async_initiated = true;
}
~_test_helper()
{
if (async_initiated)
ebpf_async_terminate();
if (epoch_initated)
if (epoch_initiated)
ebpf_epoch_terminate();
if (platform_initiated)
ebpf_platform_terminate();
Expand All @@ -54,7 +54,7 @@ class _test_helper

private:
bool platform_initiated = false;
bool epoch_initated = false;
bool epoch_initiated = false;
bool async_initiated = false;
};

Expand Down Expand Up @@ -353,7 +353,7 @@ class _signal
/**
* @brief Verify that the stale item worker runs.
* Epoch free can leave items on a CPU's free list until the next epoch exit.
* To avoid holding onto freed items indefinetely, epoch schedules a work item
* To avoid holding onto freed items indefinitely, epoch schedules a work item
* to call epoch_enter/epoch_exit on a CPU to releasing the free list.
*/
TEST_CASE("epoch_test_stale_items", "[platform]")
Expand Down Expand Up @@ -754,15 +754,15 @@ TEST_CASE("state_test", "[state]")
{
uint32_t some_value;
} foo;
uintptr_t retreived_value = 0;
uintptr_t retrieved_value = 0;
REQUIRE(ebpf_platform_initiate() == EBPF_SUCCESS);
REQUIRE(ebpf_state_initiate() == EBPF_SUCCESS);
REQUIRE(ebpf_state_allocate_index(&allocated_index_1) == EBPF_SUCCESS);
REQUIRE(ebpf_state_allocate_index(&allocated_index_2) == EBPF_SUCCESS);
REQUIRE(allocated_index_2 != allocated_index_1);
REQUIRE(ebpf_state_store(allocated_index_1, reinterpret_cast<uintptr_t>(&foo)) == EBPF_SUCCESS);
REQUIRE(ebpf_state_load(allocated_index_1, &retreived_value) == EBPF_SUCCESS);
REQUIRE(retreived_value == reinterpret_cast<uintptr_t>(&foo));
REQUIRE(ebpf_state_load(allocated_index_1, &retrieved_value) == EBPF_SUCCESS);
REQUIRE(retrieved_value == reinterpret_cast<uintptr_t>(&foo));
ebpf_state_terminate();
ebpf_platform_terminate();
}
Expand Down
Loading

0 comments on commit 58cdfdc

Please sign in to comment.