ebpf-for-windows/ebpfsvc/rpc_interface.idl

74 строки
2.5 KiB
Plaintext

/*
* Copyright (c) Microsoft Corporation
* SPDX-License-Identifier: MIT
*/
import "ebpf_execution_context.h";
import "ebpf_result.h";
import "stdint.h";
import "wtypes.idl";
//
// Interface Attributes
//
[uuid(6bef171d-7205-4b63-a1e5-d00f01e6a0c1), version(1.0), pointer_default(unique)]
interface ebpf_service_interface {
// TODO: (Issue #208): This is a duplicate of EbpfMapDescriptor
// structure defined in spec_type_descriptor.hpp. See if that
// file can be included so that we do not have to redefine this.
typedef struct _ebpf_map_descriptor
{
int original_fd;
uint32_t type; // Platform-specific type value in ELF file.
unsigned int key_size;
unsigned int value_size;
unsigned int max_entries;
unsigned int inner_map_fd;
} ebpf_map_descriptor;
typedef[system_handle(sh_file)] HANDLE file_handle_t;
typedef struct _fd_handle_map
{
uint32_t file_descriptor;
file_handle_t handle;
} fd_handle_map;
typedef struct _ebpf_program_load_info
{
// Optional file name with full path.
[string] char* file_name;
// Optional program name.
[string] char* program_name;
GUID program_type;
file_handle_t program_handle;
ebpf_execution_context_t execution_context;
uint32_t map_count;
[size_is(map_count)] fd_handle_map* handle_map;
uint32_t byte_code_size;
[ size_is(byte_code_size), ref ] uint8_t* byte_code;
} ebpf_program_load_info;
typedef struct _ebpf_program_verify_info
{
GUID program_type;
ebpf_execution_context_t execution_context;
uint32_t map_descriptors_count;
[size_is(map_descriptors_count)] ebpf_map_descriptor* map_descriptors;
uint32_t byte_code_size;
[ size_is(byte_code_size), ref ] uint8_t* byte_code;
} ebpf_program_verify_info;
ebpf_result_t ebpf_verify_and_jit_program(
[ in, ref ] ebpf_program_load_info * info,
[ out, ref ] uint32_t * logs_size,
[ out, size_is(, *logs_size), ref ] const char** logs);
ebpf_result_t ebpf_verify_program(
[ in, ref ] ebpf_program_verify_info * info,
[out] uint32_t * logs_size,
[ out, size_is(, *logs_size), ref ] const char** logs);
}