ebpf-for-windows/include/ebpf_program_types.h

67 строки
1.6 KiB
C
Исходник Обычный вид История

/*
* Copyright (c) Microsoft Corporation
* SPDX-License-Identifier: MIT
*/
#pragma once
#ifdef __midl
#define MIDL(x) x
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#else
#define MIDL(x)
#include <guiddef.h>
#include <stdint.h>
#endif
#include "ebpf_base.h"
#define EBPF_MAX_PROGRAM_DESCRIPTOR_NAME_LENGTH 256
#define EBPF_MAX_HELPER_FUNCTION_NAME_LENGTH 256
typedef struct _ebpf_program_type_descriptor
{
MIDL([string])
const char* name;
ebpf_context_descriptor_t* context_descriptor;
GUID program_type;
Registry changes for program and section data. (#1192) * fix * backup * fix backup * msbuild compiling * fix release build * fixes * cmake build fix * fix cmake build * fix analyse build * fix Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com> * fix expected output * add pre step for tests * add pre step for tests * add -s option, revert this later * Revert "add -s option, revert this later" This reverts commit 1f42d100e45b296ede3cb9bc6712aca788b7acf6. * code cleanup Signed-off-by: Anurag Saxena <anusa@microsoft.com> * rename driver_registry_helper.h * delete bpf_structs.h * fix * hardcode HKLM * code cleanup * fix * backup * fix backup * msbuild compiling * fix release build * fixes * cmake build fix * fix cmake build * fix analyse build * fix Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com> * add pre step for tests * add pre step for tests * add -s option, revert this later * Revert "add -s option, revert this later" This reverts commit 1f42d100e45b296ede3cb9bc6712aca788b7acf6. * code cleanup Signed-off-by: Anurag Saxena <anusa@microsoft.com> * rename driver_registry_helper.h * delete bpf_structs.h * fix * hardcode HKLM * code cleanup * fix build break * fix build break, enable warning * fix bad merge * cleanup * fix * fix tests * add tests, make ebpf_store_helper platform agnostic * fixes, cleanup, common code for store APIs * fix cmake build, driver tests * cleanup * code cleanup * cr comments * code cleanup * cleanup * bugfix * Apply suggestions from code review Co-authored-by: Dave Thaler <dthaler@microsoft.com> * cr comments * fix build break * move UM read store APIs to a different file * cr comments * cr comments * cr comments Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-07-01 02:53:03 +03:00
uint32_t bpf_prog_type;
char is_privileged;
} ebpf_program_type_descriptor_t;
typedef struct _ebpf_helper_function_prototype
{
uint32_t helper_id;
MIDL([string])
const char* name;
ebpf_return_type_t return_type;
ebpf_argument_type_t arguments[5];
} ebpf_helper_function_prototype_t;
typedef struct _ebpf_program_info
{
ebpf_program_type_descriptor_t program_type_descriptor;
uint32_t count_of_helpers;
MIDL([size_is(count_of_helpers)]) ebpf_helper_function_prototype_t* helper_prototype;
} ebpf_program_info_t;
typedef struct _ebpf_helper_function_addresses
{
uint32_t helper_function_count;
MIDL([size_is(helper_function_count)]) uint64_t* helper_function_address;
} ebpf_helper_function_addresses_t;
typedef struct _ebpf_program_data
{
ebpf_program_info_t* program_info;
ebpf_helper_function_addresses_t* helper_function_addresses;
} ebpf_program_data_t;
Registry changes for program and section data. (#1192) * fix * backup * fix backup * msbuild compiling * fix release build * fixes * cmake build fix * fix cmake build * fix analyse build * fix Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com> * fix expected output * add pre step for tests * add pre step for tests * add -s option, revert this later * Revert "add -s option, revert this later" This reverts commit 1f42d100e45b296ede3cb9bc6712aca788b7acf6. * code cleanup Signed-off-by: Anurag Saxena <anusa@microsoft.com> * rename driver_registry_helper.h * delete bpf_structs.h * fix * hardcode HKLM * code cleanup * fix * backup * fix backup * msbuild compiling * fix release build * fixes * cmake build fix * fix cmake build * fix analyse build * fix Signed-off-by: Anurag Saxena <43585259+saxena-anurag@users.noreply.github.com> * add pre step for tests * add pre step for tests * add -s option, revert this later * Revert "add -s option, revert this later" This reverts commit 1f42d100e45b296ede3cb9bc6712aca788b7acf6. * code cleanup Signed-off-by: Anurag Saxena <anusa@microsoft.com> * rename driver_registry_helper.h * delete bpf_structs.h * fix * hardcode HKLM * code cleanup * fix build break * fix build break, enable warning * fix bad merge * cleanup * fix * fix tests * add tests, make ebpf_store_helper platform agnostic * fixes, cleanup, common code for store APIs * fix cmake build, driver tests * cleanup * code cleanup * cr comments * code cleanup * cleanup * bugfix * Apply suggestions from code review Co-authored-by: Dave Thaler <dthaler@microsoft.com> * cr comments * fix build break * move UM read store APIs to a different file * cr comments * cr comments * cr comments Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2022-07-01 02:53:03 +03:00
typedef struct _ebpf_program_section_info
{
const wchar_t* section_name;
GUID* program_type;
GUID* attach_type;
uint32_t bpf_program_type;
uint32_t bpf_attach_type;
} ebpf_program_section_info_t;