8 typedef signed char int8_t;
11 typedef long long int64_t;
12 typedef unsigned char uint8_t;
13 typedef unsigned short uint16_t;
14 typedef unsigned int uint32_t;
15 typedef unsigned long long uint64_t;
19 #define UINT32_MAX ((uint32_t)0xFFFFFFFF)
33 #define UBPF_STACK_SIZE 512
35 #define IMMEDIATE(X) (int32_t) X
36 #define OFFSET(X) (int16_t) X
37 #define POINTER(X) (uint64_t)(X)
40 #define htobe16(X) swap16(X)
41 #define htobe32(X) swap32(X)
42 #define htobe64(X) swap64(X)
44 #define htole16(X) (X)
45 #define htole32(X) (X)
46 #define htole64(X) (X)
57 uint64_t (*
address)(uint64_t r1, uint64_t r2, uint64_t r3, uint64_t r4, uint64_t r5);
99 uint64_t (*
function)(
void*);
137 _Out_
size_t* count);
140 _Out_
size_t* count);
142 _Outptr_result_buffer_maybenull_(*
size)
const uint8_t**
hash,
147 _Out_
size_t* count);
159 return value << 8 | value >> 8;
171 return swap16(value >> 16) | ((uint32_t)
swap16(value & ((1 << 16) - 1))) << 16;
183 return swap32(value >> 32) | ((uint64_t)
swap32(value & ((1ull << 32ull) - 1))) << 32;
uint64_t swap64(uint64_t value)
Inline function used to implement the 64 bit EBPF_OP_LE/EBPF_OP_BE instruction.
Definition: bpf2c.h:181
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 init...
struct _map_entry map_entry_t
Map entry. This structure contains the address of the map and the map definition. The address is writ...
struct _helper_function_entry helper_function_entry_t
Helper function entry. This structure defines a helper function entry in the metadata table....
uint32_t swap32(uint32_t value)
Inline function used to implement the 32 bit EBPF_OP_LE/EBPF_OP_BE instruction.
Definition: bpf2c.h:169
uint16_t swap16(uint16_t value)
Inline function used to implement the 16 bit EBPF_OP_LE/EBPF_OP_BE instruction.
Definition: bpf2c.h:157
struct _program_entry program_entry_t
Program entry. This structure contains the address of the program and additional information about th...
struct _bpf2c_version bpf2c_version_t
Version information for the bpf2c compiler. This structure contains the version information for the b...
struct _metadata_table metadata_table_t
Metadata table for a module. This structure is returned by the module's metadata function,...
This file contains eBPF definitions common to eBPF programs, core execution engine as well as eBPF AP...
GUID ebpf_attach_type_t
Definition: ebpf_windows.h:44
GUID ebpf_program_type_t
Definition: ebpf_windows.h:43
Version information for the bpf2c compiler. This structure contains the version information for the b...
Definition: bpf2c.h:121
uint32_t major
Definition: bpf2c.h:122
uint32_t revision
Definition: bpf2c.h:124
uint32_t minor
Definition: bpf2c.h:123
eBPF Map Definition as it appears in the maps section of an ELF file.
Definition: ebpf_structs.h:125
Helper function entry. This structure defines a helper function entry in the metadata table....
Definition: bpf2c.h:56
bool tail_call
Definition: bpf2c.h:60
const char * name
Definition: bpf2c.h:59
uint64_t(* address)(uint64_t r1, uint64_t r2, uint64_t r3, uint64_t r4, uint64_t r5)
Definition: bpf2c.h:57
uint32_t helper_id
Definition: bpf2c.h:58
Map entry. This structure contains the address of the map and the map definition. The address is writ...
Definition: bpf2c.h:69
ebpf_map_definition_in_file_t definition
Definition: bpf2c.h:71
void * address
Definition: bpf2c.h:70
const char * name
Definition: bpf2c.h:72
Map initial values. This structure contains the initial values for a map. The values are used to init...
Definition: bpf2c.h:82
const char ** values
Definition: bpf2c.h:85
size_t count
Definition: bpf2c.h:84
const char * name
Definition: bpf2c.h:83
Program entry. This structure contains the address of the program and additional information about th...
Definition: bpf2c.h:93
uint16_t helper_count
Number of helper functions used by the program.
Definition: bpf2c.h:106
uint64_t zero
Definition: bpf2c.h:97
const char * program_info_hash_type
Type of the program info hash.
Definition: bpf2c.h:112
uint16_t referenced_map_count
Number of maps referenced by the program.
Definition: bpf2c.h:104
const char * program_name
Name of the program.
Definition: bpf2c.h:102
size_t bpf_instruction_count
Number of BPF instructions in the program.
Definition: bpf2c.h:107
size_t program_info_hash_length
Length of the program info hash.
Definition: bpf2c.h:111
uint16_t * referenced_map_indices
List of map indices referenced by the program.
Definition: bpf2c.h:103
ebpf_attach_type_t * expected_attach_type
Expected attach type of the program.
Definition: bpf2c.h:109
const char * pe_section_name
Name of the PE section containing the program.
Definition: bpf2c.h:100
const uint8_t * program_info_hash
Hash of the program info.
Definition: bpf2c.h:110
const char * section_name
Name of the section containing the program.
Definition: bpf2c.h:101
ebpf_program_type_t * program_type
Type of the program.
Definition: bpf2c.h:108
helper_function_entry_t * helpers
List of helper functions used by the program.
Definition: bpf2c.h:105