eBPF for Windows
Data Structures | Macros | Typedefs | Enumerations
ebpf_extension.h File Reference
#include "ebpf_result.h"
#include "ebpf_structs.h"
#include "ebpf_windows.h"

Go to the source code of this file.

Data Structures

struct  _ebpf_extension_dispatch_table
 
struct  _ebpf_extension_program_dispatch_table
 
struct  _ebpf_extension_data
 
struct  _ebpf_attach_provider_data
 
struct  _ebpf_execution_context_state
 

Macros

#define EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_1   4
 
#define EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_CURRENT    EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_1
 Current number of functions in the dispatch table. More...
 
#define EBPF_CONTEXT_HEADER   uint64_t context_header[8]
 

Typedefs

typedef ebpf_result_t(* _ebpf_extension_dispatch_function) ()
 
typedef struct _ebpf_extension_dispatch_table ebpf_extension_dispatch_table_t
 
typedef ebpf_result_t(* ebpf_program_invoke_function_t) (const void *extension_client_binding_context, _Inout_ void *program_context, uint32_t *result)
 Invoke the eBPF program. More...
 
typedef ebpf_result_t(* ebpf_program_batch_begin_invoke_function_t) (size_t state_size, _Out_writes_(state_size) void *state)
 Prepare the eBPF program for batch invocation. More...
 
typedef ebpf_result_t(* ebpf_program_batch_invoke_function_t) (const void *extension_client_binding_context, _Inout_ void *program_context, uint32_t *result, const void *state)
 Invoke the eBPF program in batch mode. More...
 
typedef ebpf_result_t(* ebpf_program_batch_end_invoke_function_t) (_Inout_ void *state)
 Clean up the eBPF program after batch invocation. More...
 
typedef enum _ebpf_link_dispatch_table_version ebpf_link_dispatch_table_version_t
 
typedef struct _ebpf_extension_program_dispatch_table ebpf_extension_program_dispatch_table_t
 
typedef struct _ebpf_extension_data ebpf_extension_data_t
 
typedef struct _ebpf_attach_provider_data ebpf_attach_provider_data_t
 
typedef struct _ebpf_execution_context_state ebpf_execution_context_state_t
 

Enumerations

enum  _ebpf_link_dispatch_table_version { EBPF_LINK_DISPATCH_TABLE_VERSION_1 = 1 , EBPF_LINK_DISPATCH_TABLE_VERSION_CURRENT }
 

Macro Definition Documentation

◆ EBPF_CONTEXT_HEADER

#define EBPF_CONTEXT_HEADER   uint64_t context_header[8]

◆ EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_1

#define EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_1   4

◆ EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_CURRENT

#define EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_CURRENT    EBPF_LINK_DISPATCH_TABLE_FUNCTION_COUNT_1

Current number of functions in the dispatch table.

Typedef Documentation

◆ _ebpf_extension_dispatch_function

typedef ebpf_result_t(* _ebpf_extension_dispatch_function) ()

◆ ebpf_attach_provider_data_t

◆ ebpf_execution_context_state_t

◆ ebpf_extension_data_t

◆ ebpf_extension_dispatch_table_t

◆ ebpf_extension_program_dispatch_table_t

◆ ebpf_link_dispatch_table_version_t

◆ ebpf_program_batch_begin_invoke_function_t

typedef ebpf_result_t(* ebpf_program_batch_begin_invoke_function_t) (size_t state_size, _Out_writes_(state_size) void *state)

Prepare the eBPF program for batch invocation.

Parameters
[in]state_sizeThe size of the state to be allocated, which should be greater than or equal to sizeof(ebpf_execution_context_state_t).
[out]stateThe state to be used for batch invocation.
Return values
EBPF_SUCCESSThe operation was successful.
EBPF_NO_MEMORYThe operation failed due to lack of memory.
EBPF_EXTENSION_FAILED_TO_LOADThe required extension is not loaded.

◆ ebpf_program_batch_end_invoke_function_t

typedef ebpf_result_t(* ebpf_program_batch_end_invoke_function_t) (_Inout_ void *state)

Clean up the eBPF program after batch invocation.

Parameters
[in,out]stateThe state to be used for batch invocation.
Return values
EBPF_SUCCESSThe operation was successful.

◆ ebpf_program_batch_invoke_function_t

typedef ebpf_result_t(* ebpf_program_batch_invoke_function_t) (const void *extension_client_binding_context, _Inout_ void *program_context, uint32_t *result, const void *state)

Invoke the eBPF program in batch mode.

Parameters
[in]extension_client_binding_contextThe context provided by the extension client when the binding was created.
[in,out]program_contextThe context for this invocation of the eBPF program.
[out]resultThe result of the eBPF program.
[in]stateThe state to be used for batch invocation.
Return values
EBPF_SUCCESSThe operation was successful.

◆ ebpf_program_invoke_function_t

typedef ebpf_result_t(* ebpf_program_invoke_function_t) (const void *extension_client_binding_context, _Inout_ void *program_context, uint32_t *result)

Invoke the eBPF program.

Parameters
[in]extension_client_binding_contextThe context provided by the extension client when the binding was created.
[in,out]program_contextThe context for this invocation of the eBPF program.
[out]resultThe result of the eBPF program.
Return values
EBPF_SUCCESSThe operation was successful.
EBPF_NO_MEMORYThe operation failed due to lack of memory.
EBPF_EXTENSION_FAILED_TO_LOADThe required extension is not loaded.

Enumeration Type Documentation

◆ _ebpf_link_dispatch_table_version

Enumerator
EBPF_LINK_DISPATCH_TABLE_VERSION_1 

Initial version of the dispatch table.

EBPF_LINK_DISPATCH_TABLE_VERSION_CURRENT 

Current version of the dispatch table.