eBPF for Windows
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Functions
bpf2c.h File Reference
#include "ebpf_structs.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  _helper_function_entry
 Helper function entry. This structure defines a helper function entry in the metadata table. The address of the helper function is written into the entry during load time. The helper_id and name are used to identify the helper function to bind to when the program is loaded. More...
 
struct  _helper_function_data
 
struct  _map_entry
 Map entry. This structure contains the address of the map and the map definition. The address is written into the entry during load time. The map definition is used to initialize the map when the program is loaded. More...
 
struct  _map_data
 
struct  _map_initial_values
 Map initial values. This structure contains the initial values for a map. The values are used to initialize the map when the program is loaded. Values are specified as strings and are converted to the appropriate type based on the map definition. Only BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_PROG_ARRAY map types are supported. More...
 
struct  _global_variable_section_info
 
struct  _global_variable_section_data
 
struct  _program_runtime_context
 
struct  _program_entry
 Program entry. This structure contains the address of the program and additional information about the program. More...
 
struct  _bpf2c_version
 Version information for the bpf2c compiler. This structure contains the version information for the bpf2c compiler that generated the module. It can be used to determine if the module is compatible with the current version of the eBPF for Windows runtime. More...
 
struct  _metadata_table
 Metadata table for a module. This structure is returned by the module's metadata function, get_metadata_table and contains information about the module including the list of programs and maps. More...
 

Macros

#define UBPF_STACK_SIZE   512
 
#define IMMEDIATE(X)   (int32_t) X
 
#define OFFSET(X)   (int16_t) X
 
#define POINTER(X)   (uint64_t)(X)
 
#define htobe16(X)   swap16(X)
 
#define htobe32(X)   swap32(X)
 
#define htobe64(X)   swap64(X)
 
#define htole16(X)   (X)
 
#define htole32(X)   (X)
 
#define htole64(X)   (X)
 
#define UNREFERENCED_PARAMETER(P)   (P)
 
#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION   1
 
#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(helper_function_entry_t, name)
 
#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_TOTAL_SIZE   sizeof(helper_function_entry_t)
 
#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_HEADER
 
#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION   1
 
#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(helper_function_data_t, tail_call)
 
#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_TOTAL_SIZE   sizeof(helper_function_data_t)
 
#define EBPF_NATIVE_HELPER_FUNCTION_DATA_HEADER
 
#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION   1
 
#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(map_entry_t, name)
 
#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_TOTAL_SIZE   sizeof(map_entry_t)
 
#define EBPF_NATIVE_MAP_ENTRY_HEADER
 
#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION   1
 
#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(map_data_t, address)
 
#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_TOTAL_SIZE   sizeof(map_data_t)
 
#define EBPF_NATIVE_MAP_DATA_HEADER
 
#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION   1
 
#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(program_entry_t, program_info_hash_type)
 
#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_TOTAL_SIZE   sizeof(program_entry_t)
 
#define EBPF_NATIVE_PROGRAM_ENTRY_HEADER
 
#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION   1
 
#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(program_runtime_context_t, map_data)
 
#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_TOTAL_SIZE   sizeof(program_runtime_context_t)
 
#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_HEADER
 
#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION   1
 
#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(map_initial_values_t, values)
 
#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_TOTAL_SIZE   sizeof(map_initial_values_t)
 
#define EBPF_NATIVE_MAP_INITIAL_VALUES_HEADER
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION   1
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(global_variable_section_info_t, initial_data)
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_TOTAL_SIZE   sizeof(global_variable_section_info_t)
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_HEADER
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION   1
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(global_variable_section_data_t, address_of_map_value)
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_TOTAL_SIZE   sizeof(global_variable_section_data_t)
 
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_HEADER
 
#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION   1
 
#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(metadata_table_t, map_initial_values)
 
#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_TOTAL_SIZE   sizeof(metadata_table_t)
 
#define EBPF_NATIVE_METADATA_TABLE_HEADER
 

Typedefs

typedef uint64_t(* helper_function_t) (uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, void *)
 
typedef struct _helper_function_entry helper_function_entry_t
 Helper function entry. This structure defines a helper function entry in the metadata table. The address of the helper function is written into the entry during load time. The helper_id and name are used to identify the helper function to bind to when the program is loaded.
 
typedef struct _helper_function_data helper_function_data_t
 
typedef struct _map_entry map_entry_t
 Map entry. This structure contains the address of the map and the map definition. The address is written into the entry during load time. The map definition is used to initialize the map when the program is loaded.
 
typedef struct _map_data map_data_t
 
typedef struct _map_initial_values map_initial_values_t
 Map initial values. This structure contains the initial values for a map. The values are used to initialize the map when the program is loaded. Values are specified as strings and are converted to the appropriate type based on the map definition. Only BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_PROG_ARRAY map types are supported.
 
typedef struct _global_variable_section_info global_variable_section_info_t
 
typedef struct _global_variable_section_data global_variable_section_data_t
 
typedef struct _program_runtime_context program_runtime_context_t
 
typedef struct _program_entry program_entry_t
 Program entry. This structure contains the address of the program and additional information about the program.
 
typedef struct _bpf2c_version bpf2c_version_t
 Version information for the bpf2c compiler. This structure contains the version information for the bpf2c compiler that generated the module. It can be used to determine if the module is compatible with the current version of the eBPF for Windows runtime.
 
typedef struct _metadata_table metadata_table_t
 Metadata table for a module. This structure is returned by the module's metadata function, get_metadata_table and contains information about the module including the list of programs and maps.
 

Functions

uint16_t swap16 (uint16_t value)
 Inline function used to implement the 16 bit EBPF_OP_LE/EBPF_OP_BE instruction.
 
uint32_t swap32 (uint32_t value)
 Inline function used to implement the 32 bit EBPF_OP_LE/EBPF_OP_BE instruction.
 
uint64_t swap64 (uint64_t value)
 Inline function used to implement the 64 bit EBPF_OP_LE/EBPF_OP_BE instruction.
 

Macro Definition Documentation

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION   1

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(global_variable_section_data_t, address_of_map_value)

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_TOTAL_SIZE   sizeof(global_variable_section_data_t)

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_HEADER

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_HEADER
Value:
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:306
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION_SIZE
Definition bpf2c.h:304
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_DATA_CURRENT_VERSION
Definition bpf2c.h:303

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION   1

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(global_variable_section_info_t, initial_data)

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_TOTAL_SIZE   sizeof(global_variable_section_info_t)

◆ EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_HEADER

#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_HEADER
Value:
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_SIZE
Definition bpf2c.h:295
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION
Definition bpf2c.h:294
#define EBPF_NATIVE_GLOBAL_VARIABLE_SECTION_INFO_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:297

◆ EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION

#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION   1

◆ EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(helper_function_data_t, tail_call)

◆ EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_TOTAL_SIZE   sizeof(helper_function_data_t)

◆ EBPF_NATIVE_HELPER_FUNCTION_DATA_HEADER

#define EBPF_NATIVE_HELPER_FUNCTION_DATA_HEADER
Value:
#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:246
#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION_SIZE
Definition bpf2c.h:244
#define EBPF_NATIVE_HELPER_FUNCTION_DATA_CURRENT_VERSION
Definition bpf2c.h:243

◆ EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION

#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION   1

◆ EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(helper_function_entry_t, name)

◆ EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_TOTAL_SIZE   sizeof(helper_function_entry_t)

◆ EBPF_NATIVE_HELPER_FUNCTION_ENTRY_HEADER

#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_HEADER
Value:
#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION
Definition bpf2c.h:235
#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:237
#define EBPF_NATIVE_HELPER_FUNCTION_ENTRY_CURRENT_VERSION_SIZE
Definition bpf2c.h:236

◆ EBPF_NATIVE_MAP_DATA_CURRENT_VERSION

#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION   1

◆ EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(map_data_t, address)

◆ EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_TOTAL_SIZE   sizeof(map_data_t)

◆ EBPF_NATIVE_MAP_DATA_HEADER

#define EBPF_NATIVE_MAP_DATA_HEADER
Value:
#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION
Definition bpf2c.h:260
#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:262
#define EBPF_NATIVE_MAP_DATA_CURRENT_VERSION_SIZE
Definition bpf2c.h:261

◆ EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION

#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION   1

◆ EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(map_entry_t, name)

◆ EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_TOTAL_SIZE   sizeof(map_entry_t)

◆ EBPF_NATIVE_MAP_ENTRY_HEADER

#define EBPF_NATIVE_MAP_ENTRY_HEADER
Value:
#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:254
#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION
Definition bpf2c.h:252
#define EBPF_NATIVE_MAP_ENTRY_CURRENT_VERSION_SIZE
Definition bpf2c.h:253

◆ EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION

#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION   1

◆ EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(map_initial_values_t, values)

◆ EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_TOTAL_SIZE   sizeof(map_initial_values_t)

◆ EBPF_NATIVE_MAP_INITIAL_VALUES_HEADER

#define EBPF_NATIVE_MAP_INITIAL_VALUES_HEADER
Value:
#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_SIZE
Definition bpf2c.h:287
#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION
Definition bpf2c.h:286
#define EBPF_NATIVE_MAP_INITIAL_VALUES_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:288

◆ EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION

#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION   1

◆ EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_SIZE   EBPF_SIZE_INCLUDING_FIELD(metadata_table_t, map_initial_values)

◆ EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_TOTAL_SIZE   sizeof(metadata_table_t)

◆ EBPF_NATIVE_METADATA_TABLE_HEADER

#define EBPF_NATIVE_METADATA_TABLE_HEADER
Value:
#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_SIZE
Definition bpf2c.h:313
#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION
Definition bpf2c.h:312
#define EBPF_NATIVE_METADATA_TABLE_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:314

◆ EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION

#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION   1

◆ EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(program_entry_t, program_info_hash_type)

◆ EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_TOTAL_SIZE   sizeof(program_entry_t)

◆ EBPF_NATIVE_PROGRAM_ENTRY_HEADER

#define EBPF_NATIVE_PROGRAM_ENTRY_HEADER
Value:
#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_SIZE
Definition bpf2c.h:269
#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:271
#define EBPF_NATIVE_PROGRAM_ENTRY_CURRENT_VERSION
Definition bpf2c.h:268

◆ EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION

#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION   1

◆ EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_SIZE

#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_SIZE    EBPF_SIZE_INCLUDING_FIELD(program_runtime_context_t, map_data)

◆ EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_TOTAL_SIZE

#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_TOTAL_SIZE   sizeof(program_runtime_context_t)

◆ EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_HEADER

#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_HEADER
Value:
#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION
Definition bpf2c.h:277
#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_SIZE
Definition bpf2c.h:278
#define EBPF_NATIVE_PROGRAM_RUNTIME_CONTEXT_CURRENT_VERSION_TOTAL_SIZE
Definition bpf2c.h:280

◆ htobe16

#define htobe16 (   X)    swap16(X)

◆ htobe32

#define htobe32 (   X)    swap32(X)

◆ htobe64

#define htobe64 (   X)    swap64(X)

◆ htole16

#define htole16 (   X)    (X)

◆ htole32

#define htole32 (   X)    (X)

◆ htole64

#define htole64 (   X)    (X)

◆ IMMEDIATE

#define IMMEDIATE (   X)    (int32_t) X

◆ OFFSET

#define OFFSET (   X)    (int16_t) X

◆ POINTER

#define POINTER (   X)    (uint64_t)(X)

◆ UBPF_STACK_SIZE

#define UBPF_STACK_SIZE   512

◆ UNREFERENCED_PARAMETER

#define UNREFERENCED_PARAMETER (   P)    (P)

Typedef Documentation

◆ bpf2c_version_t

Version information for the bpf2c compiler. This structure contains the version information for the bpf2c compiler that generated the module. It can be used to determine if the module is compatible with the current version of the eBPF for Windows runtime.

◆ global_variable_section_data_t

◆ global_variable_section_info_t

◆ helper_function_data_t

◆ helper_function_entry_t

Helper function entry. This structure defines a helper function entry in the metadata table. The address of the helper function is written into the entry during load time. The helper_id and name are used to identify the helper function to bind to when the program is loaded.

◆ helper_function_t

typedef uint64_t(* helper_function_t) (uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, void *)

◆ map_data_t

typedef struct _map_data map_data_t

◆ map_entry_t

typedef struct _map_entry map_entry_t

Map entry. This structure contains the address of the map and the map definition. The address is written into the entry during load time. The map definition is used to initialize the map when the program is loaded.

◆ map_initial_values_t

Map initial values. This structure contains the initial values for a map. The values are used to initialize the map when the program is loaded. Values are specified as strings and are converted to the appropriate type based on the map definition. Only BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_PROG_ARRAY map types are supported.

◆ metadata_table_t

Metadata table for a module. This structure is returned by the module's metadata function, get_metadata_table and contains information about the module including the list of programs and maps.

◆ program_entry_t

Program entry. This structure contains the address of the program and additional information about the program.

◆ program_runtime_context_t

Function Documentation

◆ swap16()

uint16_t swap16 ( uint16_t  value)
inline

Inline function used to implement the 16 bit EBPF_OP_LE/EBPF_OP_BE instruction.

Parameters
[in]valueThe value to swap.
Returns
The swapped value.

◆ swap32()

uint32_t swap32 ( uint32_t  value)
inline

Inline function used to implement the 32 bit EBPF_OP_LE/EBPF_OP_BE instruction.

Parameters
[in]valueThe value to swap.
Returns
The swapped value.

◆ swap64()

uint64_t swap64 ( uint64_t  value)
inline

Inline function used to implement the 64 bit EBPF_OP_LE/EBPF_OP_BE instruction.

Parameters
[in]valueThe value to swap.
Returns
The swapped value.