eBPF for Windows
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
bpf_legacy.h
Go to the documentation of this file.
1// Copyright (c) eBPF for Windows contributors
2// SPDX-License-Identifier: MIT
3#pragma once
4
5#include "libbpf.h"
6
7#pragma warning(push)
8#pragma warning(disable : 4201) // nonstandard extension used: nameless struct/union
9
34
53__declspec(deprecated("Use bpf_map_create() instead.")) int
54bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, int max_entries, __u32 map_flags);
55
76__declspec(deprecated("Use bpf_map_create() instead.")) int
78 enum bpf_map_type map_type, const char* name, int key_size, int inner_map_fd, int max_entries, __u32 map_flags);
79
94__declspec(deprecated("Use bpf_map_create() instead.")) int
95bpf_create_map_xattr(const struct bpf_create_map_attr* create_attr);
96
132
157__declspec(deprecated("Use bpf_prog_load() instead.")) int
159 enum bpf_prog_type type,
160 const struct bpf_insn* insns,
161 size_t insns_cnt,
162 const char* license,
163 __u32 kern_version,
164 char* log_buf,
165 size_t log_buf_sz);
166
187__declspec(deprecated("Use bpf_prog_load() instead.")) int
188bpf_load_program_xattr(const struct bpf_load_program_attr* load_attr, char* log_buf, size_t log_buf_sz);
189
192#pragma warning(pop)
int bpf_map_create(enum bpf_map_type map_type, const char *map_name, __u32 key_size, __u32 value_size, __u32 max_entries, const struct bpf_map_create_opts *opts)
Create a new map.
int bpf_prog_load(enum bpf_prog_type prog_type, const char *prog_name, const char *license, const struct bpf_insn *insns, size_t insn_cnt, const struct bpf_prog_load_opts *opts)
Load (but do not attach) an eBPF programs.
int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size, int max_entries, __u32 map_flags)
Create a new map.
int bpf_create_map_xattr(const struct bpf_create_map_attr *create_attr)
Create a new map.
int bpf_create_map_in_map(enum bpf_map_type map_type, const char *name, int key_size, int inner_map_fd, int max_entries, __u32 map_flags)
Create a new map-in-map.
int bpf_load_program(enum bpf_prog_type type, const struct bpf_insn *insns, size_t insns_cnt, const char *license, __u32 kern_version, char *log_buf, size_t log_buf_sz)
Load (but do not attach) an eBPF program from eBPF instructions supplied by the caller.
int bpf_load_program_xattr(const struct bpf_load_program_attr *load_attr, char *log_buf, size_t log_buf_sz)
Load (but do not attach) an eBPF program from eBPF instructions supplied by the caller.
bpf_prog_type
Definition ebpf_structs.h:178
bpf_attach_type
Definition ebpf_structs.h:292
bpf_map_type
Definition ebpf_structs.h:18
Definition bpf_legacy.h:16
__u32 inner_map_fd
Definition bpf_legacy.h:30
__u32 btf_key_type_id
Definition bpf_legacy.h:25
__u32 map_ifindex
Definition bpf_legacy.h:27
const char * name
Definition bpf_legacy.h:17
__u32 map_flags
Definition bpf_legacy.h:19
__u32 max_entries
Definition bpf_legacy.h:22
__u32 value_size
Definition bpf_legacy.h:21
__u32 btf_vmlinux_value_type_id
Definition bpf_legacy.h:31
__u32 btf_fd
Definition bpf_legacy.h:24
__u32 btf_value_type_id
Definition bpf_legacy.h:26
enum bpf_map_type map_type
Definition bpf_legacy.h:18
__u32 key_size
Definition bpf_legacy.h:20
__u32 numa_node
Definition bpf_legacy.h:23
Definition bpf_legacy.h:105
__u32 prog_ifindex
Definition bpf_legacy.h:119
const void * func_info
Definition bpf_legacy.h:124
size_t insns_cnt
Definition bpf_legacy.h:110
__u32 line_info_rec_size
Definition bpf_legacy.h:126
const char * license
Definition bpf_legacy.h:111
enum bpf_attach_type expected_attach_type
Definition bpf_legacy.h:107
const struct bpf_insn * insns
Definition bpf_legacy.h:109
__u32 func_info_rec_size
Definition bpf_legacy.h:123
__u32 prog_flags
Definition bpf_legacy.h:130
__u32 func_info_cnt
Definition bpf_legacy.h:125
__u32 prog_btf_fd
Definition bpf_legacy.h:122
const char * name
Definition bpf_legacy.h:108
__u32 kern_version
Definition bpf_legacy.h:114
__u32 attach_prog_fd
Definition bpf_legacy.h:115
const void * line_info
Definition bpf_legacy.h:127
__u32 log_level
Definition bpf_legacy.h:129
enum bpf_prog_type prog_type
Definition bpf_legacy.h:106
__u32 line_info_cnt
Definition bpf_legacy.h:128
__u32 attach_btf_id
Definition bpf_legacy.h:120
uint32_t __u32
Definition types.h:6