eBPF for Windows
bpf_helpers.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation
2 // SPDX-License-Identifier: MIT
3 #pragma once
4 
5 // On Linux, including the bpf_helpers.h in libbpf must be done after including
6 // a platform-specific include file such as vmlinux.h or linux/types.h which makes
7 // it not quite platform-agnostic today. We hope this to change in the future
8 // once libbpf itself becomes cross-platform (issue #351). In the meantime,
9 // this version of bpf_helpers.h is already cross-platform.
10 
11 // Include platform-specific definitions.
12 #include "ebpf_structs.h"
13 #include "bpf_helpers_platform.h"
14 
15 // If we're compiling an actual eBPF program, then include
16 // libbpf's bpf_helpers.h for the rest of the platform-agnostic
17 // defines.
18 #ifndef _MSC_VER
19 #include "libbpf/src/bpf_helpers.h"
20 #define bpf_map_def _ebpf_map_definition_in_file
21 #include "ebpf_nethooks.h"
22 #endif
23 
24 #ifndef __doxygen
25 #define EBPF_HELPER(return_type, name, args) typedef return_type(*name##_t) args
26 #endif
27 
28 #include "bpf_helper_defs.h"
29 
30 #define MAX_TAIL_CALL_CNT 32
bpf_helpers_platform.h
bpf_helper_defs.h
ebpf_nethooks.h
ebpf_structs.h