ebpf-for-windows/netebpfext/net_ebpf_ext_program_info.h

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

// Copyright (c) Microsoft Corporation
// SPDX-License-Identifier: MIT
#pragma once
Make runtime binaries not depend on usersim (#2783) * build ebpfcore under usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Work around analysis warnings Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix installer project Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Temporarily use ubpf branch with memory fix Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Create project for files shared between ebpfapi and the ebpf runtime Move existing files from libs/platform either to: * libs/shared, if meant to be common between user-mode and ebpf runtime * libs/runtime, if meant to be used by the ebpf runtime only (whether in user or kernel mode) Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Move ebpf_tracelog.c to shared Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Create shared_user and shared_kernel projects Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Remove usersim from ebpfsvc Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update to cxplat branch of usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Use cxplat_utf8_string Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Cleanup Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix build errors Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix ebpf_allocate_with_tag Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fixes Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Bug fixes Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix use of ebpf_reallocate to not pass a null pointer Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix printf tests Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix memory leaks Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Temporary change to help debug double-free in test Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update to latest usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix analysis warnings Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update to latest usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update usersim to latest Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Change native module to use latest usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update nuget package Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Only call cxplat_cleanup if cxplat_initialize succeeds Signed-off-by: Alan Jowett <alan.jowett@microsoft.com> * Revert setup_build.vcxproj change Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update usersim to latest Signed-off-by: Dave Thaler <dthaler@microsoft.com> --------- Signed-off-by: Dave Thaler <dthaler@microsoft.com> Signed-off-by: Alan Jowett <alan.jowett@microsoft.com> Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2023-09-05 20:57:21 +03:00
#include "ebpf_extension.h"
#include "ebpf_nethooks.h"
#include "ebpf_program_types.h"
Make runtime binaries not depend on usersim (#2783) * build ebpfcore under usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Work around analysis warnings Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix installer project Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Temporarily use ubpf branch with memory fix Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Create project for files shared between ebpfapi and the ebpf runtime Move existing files from libs/platform either to: * libs/shared, if meant to be common between user-mode and ebpf runtime * libs/runtime, if meant to be used by the ebpf runtime only (whether in user or kernel mode) Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Move ebpf_tracelog.c to shared Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Create shared_user and shared_kernel projects Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * WIP Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Remove usersim from ebpfsvc Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update to cxplat branch of usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Use cxplat_utf8_string Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Cleanup Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix build errors Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix ebpf_allocate_with_tag Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fixes Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Bug fixes Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix use of ebpf_reallocate to not pass a null pointer Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix printf tests Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix memory leaks Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Temporary change to help debug double-free in test Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update to latest usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Fix analysis warnings Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update to latest usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update usersim to latest Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Change native module to use latest usersim Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update nuget package Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Only call cxplat_cleanup if cxplat_initialize succeeds Signed-off-by: Alan Jowett <alan.jowett@microsoft.com> * Revert setup_build.vcxproj change Signed-off-by: Dave Thaler <dthaler@microsoft.com> * Update usersim to latest Signed-off-by: Dave Thaler <dthaler@microsoft.com> --------- Signed-off-by: Dave Thaler <dthaler@microsoft.com> Signed-off-by: Alan Jowett <alan.jowett@microsoft.com> Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2023-09-05 20:57:21 +03:00
#include "ebpf_shared_framework.h"
#define XDP_EXT_HELPER_FUNCTION_START EBPF_MAX_GENERAL_HELPER_FUNCTION
Remove XDP hook support from netebpfext.sys (#3040) * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * build failures * update sample ext with context_allocate and destroy * update vm script to use xdp_test * switch api tests to use sample program * rename to xdp_Test * update sample ext * update incorrect SAL, update netsh tests * update sample, update tests to use sample where applicable * update tests * fix up tests * fix libbpf tets * revert unnecessary changes * remove extra prints * add back in bpftool tests * update to use xdp instead of xdp_test for bpftool test * update atomic_instructions_others.o * extra debug logs * updated expected, update bpftool tests * correct bpftool tests * more debug logs * add reg debug * clear program info * Attempt fix of buffer overrun * remove debug logs, minor cleanup, set XDP guids back to their original names * update docs with xdp_test * fix guid usage * CR: remove program, update comments, fix commented out tests, update bpf_program__attach_xdp * revert changes in libbpf, as they need to use the actual XDP guids * update comment * update some XDP tests to use sample ext, comment out some expected failing tests * update bpftool tests * fix up bpf prog test run expected output, move to #if instead of comments * fix up return code issue * fix bpftool testes * add some failed xdp tests, set some params to null for sample tests * update comment * tmp commit - move to xdp mock * update unit tests to use mock XDP where possible * made some samples back to XDP type * netebpfext unit tests should use xdp_test * CR
2023-12-06 20:12:17 +03:00
// XDP_TEST helper function prototype descriptors.
static const ebpf_helper_function_prototype_t _xdp_test_ebpf_extension_helper_function_prototype[] = {
{{EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION, EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION_SIZE},
XDP_EXT_HELPER_FUNCTION_START + 1,
"bpf_xdp_adjust_head",
EBPF_RETURN_TYPE_INTEGER,
{EBPF_ARGUMENT_TYPE_PTR_TO_CTX, EBPF_ARGUMENT_TYPE_ANYTHING}}};
Remove XDP hook support from netebpfext.sys (#3040) * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * build failures * update sample ext with context_allocate and destroy * update vm script to use xdp_test * switch api tests to use sample program * rename to xdp_Test * update sample ext * update incorrect SAL, update netsh tests * update sample, update tests to use sample where applicable * update tests * fix up tests * fix libbpf tets * revert unnecessary changes * remove extra prints * add back in bpftool tests * update to use xdp instead of xdp_test for bpftool test * update atomic_instructions_others.o * extra debug logs * updated expected, update bpftool tests * correct bpftool tests * more debug logs * add reg debug * clear program info * Attempt fix of buffer overrun * remove debug logs, minor cleanup, set XDP guids back to their original names * update docs with xdp_test * fix guid usage * CR: remove program, update comments, fix commented out tests, update bpf_program__attach_xdp * revert changes in libbpf, as they need to use the actual XDP guids * update comment * update some XDP tests to use sample ext, comment out some expected failing tests * update bpftool tests * fix up bpf prog test run expected output, move to #if instead of comments * fix up return code issue * fix bpftool testes * add some failed xdp tests, set some params to null for sample tests * update comment * tmp commit - move to xdp mock * update unit tests to use mock XDP where possible * made some samples back to XDP type * netebpfext unit tests should use xdp_test * CR
2023-12-06 20:12:17 +03:00
// XDP_TEST program information.
static const ebpf_context_descriptor_t _ebpf_xdp_test_context_descriptor = {
sizeof(xdp_md_t),
EBPF_OFFSET_OF(xdp_md_t, data),
EBPF_OFFSET_OF(xdp_md_t, data_end),
EBPF_OFFSET_OF(xdp_md_t, data_meta)};
static const ebpf_program_type_descriptor_t _ebpf_xdp_test_program_type_descriptor = {
{EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION, EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION_SIZE},
"xdp_test",
&_ebpf_xdp_test_context_descriptor,
EBPF_PROGRAM_TYPE_XDP_TEST_GUID,
BPF_PROG_TYPE_XDP_TEST,
0};
Remove XDP hook support from netebpfext.sys (#3040) * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * build failures * update sample ext with context_allocate and destroy * update vm script to use xdp_test * switch api tests to use sample program * rename to xdp_Test * update sample ext * update incorrect SAL, update netsh tests * update sample, update tests to use sample where applicable * update tests * fix up tests * fix libbpf tets * revert unnecessary changes * remove extra prints * add back in bpftool tests * update to use xdp instead of xdp_test for bpftool test * update atomic_instructions_others.o * extra debug logs * updated expected, update bpftool tests * correct bpftool tests * more debug logs * add reg debug * clear program info * Attempt fix of buffer overrun * remove debug logs, minor cleanup, set XDP guids back to their original names * update docs with xdp_test * fix guid usage * CR: remove program, update comments, fix commented out tests, update bpf_program__attach_xdp * revert changes in libbpf, as they need to use the actual XDP guids * update comment * update some XDP tests to use sample ext, comment out some expected failing tests * update bpftool tests * fix up bpf prog test run expected output, move to #if instead of comments * fix up return code issue * fix bpftool testes * add some failed xdp tests, set some params to null for sample tests * update comment * tmp commit - move to xdp mock * update unit tests to use mock XDP where possible * made some samples back to XDP type * netebpfext unit tests should use xdp_test * CR
2023-12-06 20:12:17 +03:00
static const ebpf_program_info_t _ebpf_xdp_test_program_info = {
{EBPF_PROGRAM_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_INFORMATION_CURRENT_VERSION_SIZE},
&_ebpf_xdp_test_program_type_descriptor,
Remove XDP hook support from netebpfext.sys (#3040) * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * build failures * update sample ext with context_allocate and destroy * update vm script to use xdp_test * switch api tests to use sample program * rename to xdp_Test * update sample ext * update incorrect SAL, update netsh tests * update sample, update tests to use sample where applicable * update tests * fix up tests * fix libbpf tets * revert unnecessary changes * remove extra prints * add back in bpftool tests * update to use xdp instead of xdp_test for bpftool test * update atomic_instructions_others.o * extra debug logs * updated expected, update bpftool tests * correct bpftool tests * more debug logs * add reg debug * clear program info * Attempt fix of buffer overrun * remove debug logs, minor cleanup, set XDP guids back to their original names * update docs with xdp_test * fix guid usage * CR: remove program, update comments, fix commented out tests, update bpf_program__attach_xdp * revert changes in libbpf, as they need to use the actual XDP guids * update comment * update some XDP tests to use sample ext, comment out some expected failing tests * update bpftool tests * fix up bpf prog test run expected output, move to #if instead of comments * fix up return code issue * fix bpftool testes * add some failed xdp tests, set some params to null for sample tests * update comment * tmp commit - move to xdp mock * update unit tests to use mock XDP where possible * made some samples back to XDP type * netebpfext unit tests should use xdp_test * CR
2023-12-06 20:12:17 +03:00
EBPF_COUNT_OF(_xdp_test_ebpf_extension_helper_function_prototype),
_xdp_test_ebpf_extension_helper_function_prototype};
static const ebpf_program_section_info_t _ebpf_xdp_test_section_info[] = {
{{EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE},
L"xdp_test",
Remove XDP hook support from netebpfext.sys (#3040) * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * replace XDP guids with XDP_TEST guids * updated missde instance * update bpf2c * leave xdp_hook as is * remove extra files * update with new XDP_TEST guid, update other tests to use sample_ext * update some tests, update test_helper * update fuzzer * temporarily remove bpftool tests * update execution context test * build failures * update sample ext with context_allocate and destroy * update vm script to use xdp_test * switch api tests to use sample program * rename to xdp_Test * update sample ext * update incorrect SAL, update netsh tests * update sample, update tests to use sample where applicable * update tests * fix up tests * fix libbpf tets * revert unnecessary changes * remove extra prints * add back in bpftool tests * update to use xdp instead of xdp_test for bpftool test * update atomic_instructions_others.o * extra debug logs * updated expected, update bpftool tests * correct bpftool tests * more debug logs * add reg debug * clear program info * Attempt fix of buffer overrun * remove debug logs, minor cleanup, set XDP guids back to their original names * update docs with xdp_test * fix guid usage * CR: remove program, update comments, fix commented out tests, update bpf_program__attach_xdp * revert changes in libbpf, as they need to use the actual XDP guids * update comment * update some XDP tests to use sample ext, comment out some expected failing tests * update bpftool tests * fix up bpf prog test run expected output, move to #if instead of comments * fix up return code issue * fix bpftool testes * add some failed xdp tests, set some params to null for sample tests * update comment * tmp commit - move to xdp mock * update unit tests to use mock XDP where possible * made some samples back to XDP type * netebpfext unit tests should use xdp_test * CR
2023-12-06 20:12:17 +03:00
&EBPF_PROGRAM_TYPE_XDP_TEST,
&EBPF_ATTACH_TYPE_XDP_TEST,
BPF_PROG_TYPE_XDP_TEST,
BPF_XDP_TEST}};
// Bind program information.
static const ebpf_context_descriptor_t _ebpf_bind_context_descriptor = {
sizeof(bind_md_t), EBPF_OFFSET_OF(bind_md_t, app_id_start), EBPF_OFFSET_OF(bind_md_t, app_id_end), -1};
static const ebpf_program_type_descriptor_t _ebpf_bind_program_type_descriptor = {
{EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION, EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION_SIZE},
"bind",
&_ebpf_bind_context_descriptor,
EBPF_PROGRAM_TYPE_BIND_GUID,
BPF_PROG_TYPE_BIND,
0};
static const ebpf_program_info_t _ebpf_bind_program_info = {
{EBPF_PROGRAM_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_INFORMATION_CURRENT_VERSION_SIZE},
&_ebpf_bind_program_type_descriptor,
0,
NULL,
0,
NULL};
static const ebpf_program_section_info_t _ebpf_bind_section_info[] = {
{{EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE},
L"bind",
&EBPF_PROGRAM_TYPE_BIND,
&EBPF_ATTACH_TYPE_BIND,
BPF_PROG_TYPE_BIND,
BPF_ATTACH_TYPE_BIND}};
// CGROUP_SOCK_ADDR extension specific helper function prototypes.
static const ebpf_helper_function_prototype_t _sock_addr_ebpf_extension_helper_function_prototype[] = {
{{EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION, EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION_SIZE},
BPF_FUNC_sock_addr_get_current_pid_tgid,
"bpf_sock_addr_get_current_pid_tgid",
EBPF_RETURN_TYPE_INTEGER,
{EBPF_ARGUMENT_TYPE_PTR_TO_CTX}},
{{EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION, EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION_SIZE},
BPF_FUNC_sock_addr_set_redirect_context,
"bpf_sock_addr_set_redirect_context",
EBPF_RETURN_TYPE_INTEGER,
{EBPF_ARGUMENT_TYPE_PTR_TO_CTX, EBPF_ARGUMENT_TYPE_PTR_TO_READABLE_MEM, EBPF_ARGUMENT_TYPE_CONST_SIZE}}};
// CGROUP_SOCK_ADDR global helper function prototypes.
static const ebpf_helper_function_prototype_t _ebpf_sock_addr_global_helper_function_prototype[] = {
{{EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION, EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION_SIZE},
BPF_FUNC_get_current_logon_id,
"bpf_get_current_logon_id",
EBPF_RETURN_TYPE_INTEGER,
{EBPF_ARGUMENT_TYPE_PTR_TO_CTX}},
{{EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION, EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION_SIZE},
BPF_FUNC_is_current_admin,
"bpf_is_current_admin",
EBPF_RETURN_TYPE_INTEGER,
{EBPF_ARGUMENT_TYPE_PTR_TO_CTX}}};
// CGROUP_SOCK_ADDR program information.
static const ebpf_context_descriptor_t _ebpf_sock_addr_context_descriptor = {
sizeof(bpf_sock_addr_t),
-1, // Offset into ctx struct for pointer to data, or -1 if none.
-1, // Offset into ctx struct for pointer to data, or -1 if none.
-1, // Offset into ctx struct for pointer to metadata, or -1 if none.
};
static const ebpf_program_type_descriptor_t _ebpf_sock_addr_program_type_desciptor = {
{EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION, EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION_SIZE},
"sock_addr",
&_ebpf_sock_addr_context_descriptor,
EBPF_PROGRAM_TYPE_CGROUP_SOCK_ADDR_GUID,
BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
0};
static const ebpf_program_info_t _ebpf_sock_addr_program_info = {
{EBPF_PROGRAM_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_INFORMATION_CURRENT_VERSION_SIZE},
&_ebpf_sock_addr_program_type_desciptor,
EBPF_COUNT_OF(_sock_addr_ebpf_extension_helper_function_prototype),
_sock_addr_ebpf_extension_helper_function_prototype,
EBPF_COUNT_OF(_ebpf_sock_addr_global_helper_function_prototype),
_ebpf_sock_addr_global_helper_function_prototype};
static const ebpf_program_section_info_t _ebpf_sock_addr_section_info[] = {
{{EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE},
L"cgroup/connect4",
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
&EBPF_PROGRAM_TYPE_CGROUP_SOCK_ADDR,
&EBPF_ATTACH_TYPE_CGROUP_INET4_CONNECT,
BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
BPF_CGROUP_INET4_CONNECT},
{{EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE},
L"cgroup/connect6",
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
&EBPF_PROGRAM_TYPE_CGROUP_SOCK_ADDR,
&EBPF_ATTACH_TYPE_CGROUP_INET6_CONNECT,
BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
BPF_CGROUP_INET6_CONNECT},
{{EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE},
L"cgroup/recv_accept4",
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
&EBPF_PROGRAM_TYPE_CGROUP_SOCK_ADDR,
&EBPF_ATTACH_TYPE_CGROUP_INET4_RECV_ACCEPT,
BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
BPF_CGROUP_INET4_RECV_ACCEPT},
{{EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE},
L"cgroup/recv_accept6",
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
&EBPF_PROGRAM_TYPE_CGROUP_SOCK_ADDR,
&EBPF_ATTACH_TYPE_CGROUP_INET6_RECV_ACCEPT,
BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
BPF_CGROUP_INET6_RECV_ACCEPT}};
// SOCK_OPS program information.
static const ebpf_context_descriptor_t _ebpf_sock_ops_context_descriptor = {
sizeof(bpf_sock_ops_t),
-1, // Offset into ctx struct for pointer to data, or -1 if none.
-1, // Offset into ctx struct for pointer to data, or -1 if none.
-1, // Offset into ctx struct for pointer to metadata, or -1 if none.
};
static const ebpf_program_type_descriptor_t _ebpf_sock_ops_program_type_descriptor = {
{EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION, EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION_SIZE},
"sockops",
&_ebpf_sock_ops_context_descriptor,
EBPF_PROGRAM_TYPE_SOCK_OPS_GUID,
BPF_PROG_TYPE_SOCK_OPS,
0};
static const ebpf_program_info_t _ebpf_sock_ops_program_info = {
{EBPF_PROGRAM_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_INFORMATION_CURRENT_VERSION_SIZE},
&_ebpf_sock_ops_program_type_descriptor,
0,
NULL,
0,
NULL};
static const ebpf_program_section_info_t _ebpf_sock_ops_section_info[] = {
{{EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE},
L"sockops",
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
&EBPF_PROGRAM_TYPE_SOCK_OPS,
&EBPF_ATTACH_TYPE_CGROUP_SOCK_OPS,
BPF_PROG_TYPE_SOCK_OPS,
BPF_CGROUP_SOCK_OPS}};