eBPF for Windows
ebpf_program_types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Microsoft Corporation
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #pragma once
7 
8 #ifdef __midl
9 #define MIDL(x) x
10 typedef unsigned int uint32_t;
11 typedef unsigned long long uint64_t;
12 #else
13 #define MIDL(x)
14 #include <guiddef.h>
15 #include <stdint.h>
16 #endif
17 #include "ebpf_base.h"
18 
19 #define EBPF_MAX_PROGRAM_DESCRIPTOR_NAME_LENGTH 256
20 #define EBPF_MAX_HELPER_FUNCTION_NAME_LENGTH 256
21 
23 {
24  MIDL([string])
25  const char* name;
26  ebpf_context_descriptor_t* context_descriptor;
28  uint32_t bpf_prog_type;
31 
33 {
34  uint32_t helper_id;
35  MIDL([string])
36  const char* name;
37  ebpf_return_type_t return_type;
38  ebpf_argument_type_t arguments[5];
40 
41 typedef struct _ebpf_program_info
42 {
44  uint32_t count_of_helpers;
45  MIDL([size_is(count_of_helpers)]) ebpf_helper_function_prototype_t* helper_prototype;
47 
49 {
51  MIDL([size_is(helper_function_count)]) uint64_t* helper_function_address;
53 
54 typedef struct _ebpf_program_data
55 {
59 
61 {
62  const wchar_t* section_name;
65  uint32_t bpf_program_type;
66  uint32_t bpf_attach_type;
ebpf_helper_function_addresses_t
struct _ebpf_helper_function_addresses ebpf_helper_function_addresses_t
_ebpf_program_type_descriptor
Definition: ebpf_program_types.h:22
_ebpf_program_info
Definition: ebpf_program_types.h:41
_ebpf_program_info::program_type_descriptor
ebpf_program_type_descriptor_t program_type_descriptor
Definition: ebpf_program_types.h:43
_ebpf_program_section_info::bpf_attach_type
uint32_t bpf_attach_type
Definition: ebpf_program_types.h:66
bpf_prog_type
bpf_prog_type
Definition: ebpf_structs.h:160
GUID
uint8_t GUID[16]
Definition: ebpf_windows.h:8
_ebpf_program_info::count_of_helpers
uint32_t count_of_helpers
Definition: ebpf_program_types.h:44
_ebpf_program_type_descriptor::is_privileged
char is_privileged
Definition: ebpf_program_types.h:29
_ebpf_program_section_info
Definition: ebpf_program_types.h:60
_ebpf_program_data::program_info
ebpf_program_info_t * program_info
Definition: ebpf_program_types.h:56
_ebpf_program_section_info::program_type
GUID * program_type
Definition: ebpf_program_types.h:63
_ebpf_program_section_info::section_name
const wchar_t * section_name
Definition: ebpf_program_types.h:62
_ebpf_program_type_descriptor::program_type
GUID program_type
Definition: ebpf_program_types.h:27
_ebpf_program_data::helper_function_addresses
ebpf_helper_function_addresses_t * helper_function_addresses
Definition: ebpf_program_types.h:57
ebpf_program_data_t
struct _ebpf_program_data ebpf_program_data_t
_ebpf_helper_function_addresses::helper_function_count
uint32_t helper_function_count
Definition: ebpf_program_types.h:50
_ebpf_program_type_descriptor::name
const char * name
Definition: ebpf_program_types.h:25
ebpf_program_info_t
struct _ebpf_program_info ebpf_program_info_t
_ebpf_program_type_descriptor::context_descriptor
ebpf_context_descriptor_t * context_descriptor
Definition: ebpf_program_types.h:26
_ebpf_helper_function_prototype::helper_id
uint32_t helper_id
Definition: ebpf_program_types.h:34
_ebpf_helper_function_prototype
Definition: ebpf_program_types.h:32
MIDL
#define MIDL(x)
Definition: ebpf_program_types.h:13
_ebpf_program_section_info::attach_type
GUID * attach_type
Definition: ebpf_program_types.h:64
_ebpf_helper_function_addresses
Definition: ebpf_program_types.h:48
ebpf_program_section_info_t
struct _ebpf_program_section_info ebpf_program_section_info_t
_ebpf_program_section_info::bpf_program_type
uint32_t bpf_program_type
Definition: ebpf_program_types.h:65
_ebpf_program_data
Definition: ebpf_program_types.h:54