Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: bpf.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
[1] Fix | Delete
*
[2] Fix | Delete
* This program is free software; you can redistribute it and/or
[3] Fix | Delete
* modify it under the terms of version 2 of the GNU General Public
[4] Fix | Delete
* License as published by the Free Software Foundation.
[5] Fix | Delete
*/
[6] Fix | Delete
#ifndef __LINUX_BPF_H__
[7] Fix | Delete
#define __LINUX_BPF_H__
[8] Fix | Delete
[9] Fix | Delete
#include <linux/types.h>
[10] Fix | Delete
#include <linux/bpf_common.h>
[11] Fix | Delete
[12] Fix | Delete
/* Extended instruction set based on top of classic BPF */
[13] Fix | Delete
[14] Fix | Delete
/* instruction classes */
[15] Fix | Delete
#define BPF_JMP32 0x06 /* jmp mode in word width */
[16] Fix | Delete
#define BPF_ALU64 0x07 /* alu mode in double word width */
[17] Fix | Delete
[18] Fix | Delete
/* ld/ldx fields */
[19] Fix | Delete
#define BPF_DW 0x18 /* double word (64-bit) */
[20] Fix | Delete
#define BPF_ATOMIC 0xc0 /* atomic memory ops - op type in immediate */
[21] Fix | Delete
#define BPF_XADD 0xc0 /* exclusive add - legacy name */
[22] Fix | Delete
[23] Fix | Delete
/* alu/jmp fields */
[24] Fix | Delete
#define BPF_MOV 0xb0 /* mov reg to reg */
[25] Fix | Delete
#define BPF_ARSH 0xc0 /* sign extending arithmetic shift right */
[26] Fix | Delete
[27] Fix | Delete
/* change endianness of a register */
[28] Fix | Delete
#define BPF_END 0xd0 /* flags for endianness conversion: */
[29] Fix | Delete
#define BPF_TO_LE 0x00 /* convert to little-endian */
[30] Fix | Delete
#define BPF_TO_BE 0x08 /* convert to big-endian */
[31] Fix | Delete
#define BPF_FROM_LE BPF_TO_LE
[32] Fix | Delete
#define BPF_FROM_BE BPF_TO_BE
[33] Fix | Delete
[34] Fix | Delete
/* jmp encodings */
[35] Fix | Delete
#define BPF_JNE 0x50 /* jump != */
[36] Fix | Delete
#define BPF_JLT 0xa0 /* LT is unsigned, '<' */
[37] Fix | Delete
#define BPF_JLE 0xb0 /* LE is unsigned, '<=' */
[38] Fix | Delete
#define BPF_JSGT 0x60 /* SGT is signed '>', GT in x86 */
[39] Fix | Delete
#define BPF_JSGE 0x70 /* SGE is signed '>=', GE in x86 */
[40] Fix | Delete
#define BPF_JSLT 0xc0 /* SLT is signed, '<' */
[41] Fix | Delete
#define BPF_JSLE 0xd0 /* SLE is signed, '<=' */
[42] Fix | Delete
#define BPF_CALL 0x80 /* function call */
[43] Fix | Delete
#define BPF_EXIT 0x90 /* function return */
[44] Fix | Delete
[45] Fix | Delete
/* atomic op type fields (stored in immediate) */
[46] Fix | Delete
#define BPF_FETCH 0x01 /* not an opcode on its own, used to build others */
[47] Fix | Delete
#define BPF_XCHG (0xe0 | BPF_FETCH) /* atomic exchange */
[48] Fix | Delete
#define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
[49] Fix | Delete
[50] Fix | Delete
/* Register numbers */
[51] Fix | Delete
enum {
[52] Fix | Delete
BPF_REG_0 = 0,
[53] Fix | Delete
BPF_REG_1,
[54] Fix | Delete
BPF_REG_2,
[55] Fix | Delete
BPF_REG_3,
[56] Fix | Delete
BPF_REG_4,
[57] Fix | Delete
BPF_REG_5,
[58] Fix | Delete
BPF_REG_6,
[59] Fix | Delete
BPF_REG_7,
[60] Fix | Delete
BPF_REG_8,
[61] Fix | Delete
BPF_REG_9,
[62] Fix | Delete
BPF_REG_10,
[63] Fix | Delete
__MAX_BPF_REG,
[64] Fix | Delete
};
[65] Fix | Delete
[66] Fix | Delete
/* BPF has 10 general purpose 64-bit registers and stack frame. */
[67] Fix | Delete
#define MAX_BPF_REG __MAX_BPF_REG
[68] Fix | Delete
[69] Fix | Delete
struct bpf_insn {
[70] Fix | Delete
__u8 code; /* opcode */
[71] Fix | Delete
__u8 dst_reg:4; /* dest register */
[72] Fix | Delete
__u8 src_reg:4; /* source register */
[73] Fix | Delete
__s16 off; /* signed offset */
[74] Fix | Delete
__s32 imm; /* signed immediate constant */
[75] Fix | Delete
};
[76] Fix | Delete
[77] Fix | Delete
/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */
[78] Fix | Delete
struct bpf_lpm_trie_key {
[79] Fix | Delete
__u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */
[80] Fix | Delete
__u8 data[0]; /* Arbitrary size */
[81] Fix | Delete
};
[82] Fix | Delete
[83] Fix | Delete
struct bpf_cgroup_storage_key {
[84] Fix | Delete
__u64 cgroup_inode_id; /* cgroup inode id */
[85] Fix | Delete
__u32 attach_type; /* program attach type */
[86] Fix | Delete
};
[87] Fix | Delete
[88] Fix | Delete
union bpf_iter_link_info {
[89] Fix | Delete
struct {
[90] Fix | Delete
__u32 map_fd;
[91] Fix | Delete
} map;
[92] Fix | Delete
};
[93] Fix | Delete
[94] Fix | Delete
/* BPF syscall commands, see bpf(2) man-page for more details. */
[95] Fix | Delete
/**
[96] Fix | Delete
* DOC: eBPF Syscall Preamble
[97] Fix | Delete
*
[98] Fix | Delete
* The operation to be performed by the **bpf**\ () system call is determined
[99] Fix | Delete
* by the *cmd* argument. Each operation takes an accompanying argument,
[100] Fix | Delete
* provided via *attr*, which is a pointer to a union of type *bpf_attr* (see
[101] Fix | Delete
* below). The size argument is the size of the union pointed to by *attr*.
[102] Fix | Delete
*/
[103] Fix | Delete
/**
[104] Fix | Delete
* DOC: eBPF Syscall Commands
[105] Fix | Delete
*
[106] Fix | Delete
* BPF_MAP_CREATE
[107] Fix | Delete
* Description
[108] Fix | Delete
* Create a map and return a file descriptor that refers to the
[109] Fix | Delete
* map. The close-on-exec file descriptor flag (see **fcntl**\ (2))
[110] Fix | Delete
* is automatically enabled for the new file descriptor.
[111] Fix | Delete
*
[112] Fix | Delete
* Applying **close**\ (2) to the file descriptor returned by
[113] Fix | Delete
* **BPF_MAP_CREATE** will delete the map (but see NOTES).
[114] Fix | Delete
*
[115] Fix | Delete
* Return
[116] Fix | Delete
* A new file descriptor (a nonnegative integer), or -1 if an
[117] Fix | Delete
* error occurred (in which case, *errno* is set appropriately).
[118] Fix | Delete
*
[119] Fix | Delete
* BPF_MAP_LOOKUP_ELEM
[120] Fix | Delete
* Description
[121] Fix | Delete
* Look up an element with a given *key* in the map referred to
[122] Fix | Delete
* by the file descriptor *map_fd*.
[123] Fix | Delete
*
[124] Fix | Delete
* The *flags* argument may be specified as one of the
[125] Fix | Delete
* following:
[126] Fix | Delete
*
[127] Fix | Delete
* **BPF_F_LOCK**
[128] Fix | Delete
* Look up the value of a spin-locked map without
[129] Fix | Delete
* returning the lock. This must be specified if the
[130] Fix | Delete
* elements contain a spinlock.
[131] Fix | Delete
*
[132] Fix | Delete
* Return
[133] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[134] Fix | Delete
* is set appropriately.
[135] Fix | Delete
*
[136] Fix | Delete
* BPF_MAP_UPDATE_ELEM
[137] Fix | Delete
* Description
[138] Fix | Delete
* Create or update an element (key/value pair) in a specified map.
[139] Fix | Delete
*
[140] Fix | Delete
* The *flags* argument should be specified as one of the
[141] Fix | Delete
* following:
[142] Fix | Delete
*
[143] Fix | Delete
* **BPF_ANY**
[144] Fix | Delete
* Create a new element or update an existing element.
[145] Fix | Delete
* **BPF_NOEXIST**
[146] Fix | Delete
* Create a new element only if it did not exist.
[147] Fix | Delete
* **BPF_EXIST**
[148] Fix | Delete
* Update an existing element.
[149] Fix | Delete
* **BPF_F_LOCK**
[150] Fix | Delete
* Update a spin_lock-ed map element.
[151] Fix | Delete
*
[152] Fix | Delete
* Return
[153] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[154] Fix | Delete
* is set appropriately.
[155] Fix | Delete
*
[156] Fix | Delete
* May set *errno* to **EINVAL**, **EPERM**, **ENOMEM**,
[157] Fix | Delete
* **E2BIG**, **EEXIST**, or **ENOENT**.
[158] Fix | Delete
*
[159] Fix | Delete
* **E2BIG**
[160] Fix | Delete
* The number of elements in the map reached the
[161] Fix | Delete
* *max_entries* limit specified at map creation time.
[162] Fix | Delete
* **EEXIST**
[163] Fix | Delete
* If *flags* specifies **BPF_NOEXIST** and the element
[164] Fix | Delete
* with *key* already exists in the map.
[165] Fix | Delete
* **ENOENT**
[166] Fix | Delete
* If *flags* specifies **BPF_EXIST** and the element with
[167] Fix | Delete
* *key* does not exist in the map.
[168] Fix | Delete
*
[169] Fix | Delete
* BPF_MAP_DELETE_ELEM
[170] Fix | Delete
* Description
[171] Fix | Delete
* Look up and delete an element by key in a specified map.
[172] Fix | Delete
*
[173] Fix | Delete
* Return
[174] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[175] Fix | Delete
* is set appropriately.
[176] Fix | Delete
*
[177] Fix | Delete
* BPF_MAP_GET_NEXT_KEY
[178] Fix | Delete
* Description
[179] Fix | Delete
* Look up an element by key in a specified map and return the key
[180] Fix | Delete
* of the next element. Can be used to iterate over all elements
[181] Fix | Delete
* in the map.
[182] Fix | Delete
*
[183] Fix | Delete
* Return
[184] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[185] Fix | Delete
* is set appropriately.
[186] Fix | Delete
*
[187] Fix | Delete
* The following cases can be used to iterate over all elements of
[188] Fix | Delete
* the map:
[189] Fix | Delete
*
[190] Fix | Delete
* * If *key* is not found, the operation returns zero and sets
[191] Fix | Delete
* the *next_key* pointer to the key of the first element.
[192] Fix | Delete
* * If *key* is found, the operation returns zero and sets the
[193] Fix | Delete
* *next_key* pointer to the key of the next element.
[194] Fix | Delete
* * If *key* is the last element, returns -1 and *errno* is set
[195] Fix | Delete
* to **ENOENT**.
[196] Fix | Delete
*
[197] Fix | Delete
* May set *errno* to **ENOMEM**, **EFAULT**, **EPERM**, or
[198] Fix | Delete
* **EINVAL** on error.
[199] Fix | Delete
*
[200] Fix | Delete
* BPF_PROG_LOAD
[201] Fix | Delete
* Description
[202] Fix | Delete
* Verify and load an eBPF program, returning a new file
[203] Fix | Delete
* descriptor associated with the program.
[204] Fix | Delete
*
[205] Fix | Delete
* Applying **close**\ (2) to the file descriptor returned by
[206] Fix | Delete
* **BPF_PROG_LOAD** will unload the eBPF program (but see NOTES).
[207] Fix | Delete
*
[208] Fix | Delete
* The close-on-exec file descriptor flag (see **fcntl**\ (2)) is
[209] Fix | Delete
* automatically enabled for the new file descriptor.
[210] Fix | Delete
*
[211] Fix | Delete
* Return
[212] Fix | Delete
* A new file descriptor (a nonnegative integer), or -1 if an
[213] Fix | Delete
* error occurred (in which case, *errno* is set appropriately).
[214] Fix | Delete
*
[215] Fix | Delete
* BPF_OBJ_PIN
[216] Fix | Delete
* Description
[217] Fix | Delete
* Pin an eBPF program or map referred by the specified *bpf_fd*
[218] Fix | Delete
* to the provided *pathname* on the filesystem.
[219] Fix | Delete
*
[220] Fix | Delete
* The *pathname* argument must not contain a dot (".").
[221] Fix | Delete
*
[222] Fix | Delete
* On success, *pathname* retains a reference to the eBPF object,
[223] Fix | Delete
* preventing deallocation of the object when the original
[224] Fix | Delete
* *bpf_fd* is closed. This allow the eBPF object to live beyond
[225] Fix | Delete
* **close**\ (\ *bpf_fd*\ ), and hence the lifetime of the parent
[226] Fix | Delete
* process.
[227] Fix | Delete
*
[228] Fix | Delete
* Applying **unlink**\ (2) or similar calls to the *pathname*
[229] Fix | Delete
* unpins the object from the filesystem, removing the reference.
[230] Fix | Delete
* If no other file descriptors or filesystem nodes refer to the
[231] Fix | Delete
* same object, it will be deallocated (see NOTES).
[232] Fix | Delete
*
[233] Fix | Delete
* The filesystem type for the parent directory of *pathname* must
[234] Fix | Delete
* be **BPF_FS_MAGIC**.
[235] Fix | Delete
*
[236] Fix | Delete
* Return
[237] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[238] Fix | Delete
* is set appropriately.
[239] Fix | Delete
*
[240] Fix | Delete
* BPF_OBJ_GET
[241] Fix | Delete
* Description
[242] Fix | Delete
* Open a file descriptor for the eBPF object pinned to the
[243] Fix | Delete
* specified *pathname*.
[244] Fix | Delete
*
[245] Fix | Delete
* Return
[246] Fix | Delete
* A new file descriptor (a nonnegative integer), or -1 if an
[247] Fix | Delete
* error occurred (in which case, *errno* is set appropriately).
[248] Fix | Delete
*
[249] Fix | Delete
* BPF_PROG_ATTACH
[250] Fix | Delete
* Description
[251] Fix | Delete
* Attach an eBPF program to a *target_fd* at the specified
[252] Fix | Delete
* *attach_type* hook.
[253] Fix | Delete
*
[254] Fix | Delete
* The *attach_type* specifies the eBPF attachment point to
[255] Fix | Delete
* attach the program to, and must be one of *bpf_attach_type*
[256] Fix | Delete
* (see below).
[257] Fix | Delete
*
[258] Fix | Delete
* The *attach_bpf_fd* must be a valid file descriptor for a
[259] Fix | Delete
* loaded eBPF program of a cgroup, flow dissector, LIRC, sockmap
[260] Fix | Delete
* or sock_ops type corresponding to the specified *attach_type*.
[261] Fix | Delete
*
[262] Fix | Delete
* The *target_fd* must be a valid file descriptor for a kernel
[263] Fix | Delete
* object which depends on the attach type of *attach_bpf_fd*:
[264] Fix | Delete
*
[265] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_DEVICE**,
[266] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SKB**,
[267] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SOCK**,
[268] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SOCK_ADDR**,
[269] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SOCKOPT**,
[270] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SYSCTL**,
[271] Fix | Delete
* **BPF_PROG_TYPE_SOCK_OPS**
[272] Fix | Delete
*
[273] Fix | Delete
* Control Group v2 hierarchy with the eBPF controller
[274] Fix | Delete
* enabled. Requires the kernel to be compiled with
[275] Fix | Delete
* **CONFIG_CGROUP_BPF**.
[276] Fix | Delete
*
[277] Fix | Delete
* **BPF_PROG_TYPE_FLOW_DISSECTOR**
[278] Fix | Delete
*
[279] Fix | Delete
* Network namespace (eg /proc/self/ns/net).
[280] Fix | Delete
*
[281] Fix | Delete
* **BPF_PROG_TYPE_LIRC_MODE2**
[282] Fix | Delete
*
[283] Fix | Delete
* LIRC device path (eg /dev/lircN). Requires the kernel
[284] Fix | Delete
* to be compiled with **CONFIG_BPF_LIRC_MODE2**.
[285] Fix | Delete
*
[286] Fix | Delete
* **BPF_PROG_TYPE_SK_SKB**,
[287] Fix | Delete
* **BPF_PROG_TYPE_SK_MSG**
[288] Fix | Delete
*
[289] Fix | Delete
* eBPF map of socket type (eg **BPF_MAP_TYPE_SOCKHASH**).
[290] Fix | Delete
*
[291] Fix | Delete
* Return
[292] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[293] Fix | Delete
* is set appropriately.
[294] Fix | Delete
*
[295] Fix | Delete
* BPF_PROG_DETACH
[296] Fix | Delete
* Description
[297] Fix | Delete
* Detach the eBPF program associated with the *target_fd* at the
[298] Fix | Delete
* hook specified by *attach_type*. The program must have been
[299] Fix | Delete
* previously attached using **BPF_PROG_ATTACH**.
[300] Fix | Delete
*
[301] Fix | Delete
* Return
[302] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[303] Fix | Delete
* is set appropriately.
[304] Fix | Delete
*
[305] Fix | Delete
* BPF_PROG_TEST_RUN
[306] Fix | Delete
* Description
[307] Fix | Delete
* Run the eBPF program associated with the *prog_fd* a *repeat*
[308] Fix | Delete
* number of times against a provided program context *ctx_in* and
[309] Fix | Delete
* data *data_in*, and return the modified program context
[310] Fix | Delete
* *ctx_out*, *data_out* (for example, packet data), result of the
[311] Fix | Delete
* execution *retval*, and *duration* of the test run.
[312] Fix | Delete
*
[313] Fix | Delete
* The sizes of the buffers provided as input and output
[314] Fix | Delete
* parameters *ctx_in*, *ctx_out*, *data_in*, and *data_out* must
[315] Fix | Delete
* be provided in the corresponding variables *ctx_size_in*,
[316] Fix | Delete
* *ctx_size_out*, *data_size_in*, and/or *data_size_out*. If any
[317] Fix | Delete
* of these parameters are not provided (ie set to NULL), the
[318] Fix | Delete
* corresponding size field must be zero.
[319] Fix | Delete
*
[320] Fix | Delete
* Some program types have particular requirements:
[321] Fix | Delete
*
[322] Fix | Delete
* **BPF_PROG_TYPE_SK_LOOKUP**
[323] Fix | Delete
* *data_in* and *data_out* must be NULL.
[324] Fix | Delete
*
[325] Fix | Delete
* **BPF_PROG_TYPE_XDP**
[326] Fix | Delete
* *ctx_in* and *ctx_out* must be NULL.
[327] Fix | Delete
*
[328] Fix | Delete
* **BPF_PROG_TYPE_RAW_TRACEPOINT**,
[329] Fix | Delete
* **BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE**
[330] Fix | Delete
*
[331] Fix | Delete
* *ctx_out*, *data_in* and *data_out* must be NULL.
[332] Fix | Delete
* *repeat* must be zero.
[333] Fix | Delete
*
[334] Fix | Delete
* Return
[335] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[336] Fix | Delete
* is set appropriately.
[337] Fix | Delete
*
[338] Fix | Delete
* **ENOSPC**
[339] Fix | Delete
* Either *data_size_out* or *ctx_size_out* is too small.
[340] Fix | Delete
* **ENOTSUPP**
[341] Fix | Delete
* This command is not supported by the program type of
[342] Fix | Delete
* the program referred to by *prog_fd*.
[343] Fix | Delete
*
[344] Fix | Delete
* BPF_PROG_GET_NEXT_ID
[345] Fix | Delete
* Description
[346] Fix | Delete
* Fetch the next eBPF program currently loaded into the kernel.
[347] Fix | Delete
*
[348] Fix | Delete
* Looks for the eBPF program with an id greater than *start_id*
[349] Fix | Delete
* and updates *next_id* on success. If no other eBPF programs
[350] Fix | Delete
* remain with ids higher than *start_id*, returns -1 and sets
[351] Fix | Delete
* *errno* to **ENOENT**.
[352] Fix | Delete
*
[353] Fix | Delete
* Return
[354] Fix | Delete
* Returns zero on success. On error, or when no id remains, -1
[355] Fix | Delete
* is returned and *errno* is set appropriately.
[356] Fix | Delete
*
[357] Fix | Delete
* BPF_MAP_GET_NEXT_ID
[358] Fix | Delete
* Description
[359] Fix | Delete
* Fetch the next eBPF map currently loaded into the kernel.
[360] Fix | Delete
*
[361] Fix | Delete
* Looks for the eBPF map with an id greater than *start_id*
[362] Fix | Delete
* and updates *next_id* on success. If no other eBPF maps
[363] Fix | Delete
* remain with ids higher than *start_id*, returns -1 and sets
[364] Fix | Delete
* *errno* to **ENOENT**.
[365] Fix | Delete
*
[366] Fix | Delete
* Return
[367] Fix | Delete
* Returns zero on success. On error, or when no id remains, -1
[368] Fix | Delete
* is returned and *errno* is set appropriately.
[369] Fix | Delete
*
[370] Fix | Delete
* BPF_PROG_GET_FD_BY_ID
[371] Fix | Delete
* Description
[372] Fix | Delete
* Open a file descriptor for the eBPF program corresponding to
[373] Fix | Delete
* *prog_id*.
[374] Fix | Delete
*
[375] Fix | Delete
* Return
[376] Fix | Delete
* A new file descriptor (a nonnegative integer), or -1 if an
[377] Fix | Delete
* error occurred (in which case, *errno* is set appropriately).
[378] Fix | Delete
*
[379] Fix | Delete
* BPF_MAP_GET_FD_BY_ID
[380] Fix | Delete
* Description
[381] Fix | Delete
* Open a file descriptor for the eBPF map corresponding to
[382] Fix | Delete
* *map_id*.
[383] Fix | Delete
*
[384] Fix | Delete
* Return
[385] Fix | Delete
* A new file descriptor (a nonnegative integer), or -1 if an
[386] Fix | Delete
* error occurred (in which case, *errno* is set appropriately).
[387] Fix | Delete
*
[388] Fix | Delete
* BPF_OBJ_GET_INFO_BY_FD
[389] Fix | Delete
* Description
[390] Fix | Delete
* Obtain information about the eBPF object corresponding to
[391] Fix | Delete
* *bpf_fd*.
[392] Fix | Delete
*
[393] Fix | Delete
* Populates up to *info_len* bytes of *info*, which will be in
[394] Fix | Delete
* one of the following formats depending on the eBPF object type
[395] Fix | Delete
* of *bpf_fd*:
[396] Fix | Delete
*
[397] Fix | Delete
* * **struct bpf_prog_info**
[398] Fix | Delete
* * **struct bpf_map_info**
[399] Fix | Delete
* * **struct bpf_btf_info**
[400] Fix | Delete
* * **struct bpf_link_info**
[401] Fix | Delete
*
[402] Fix | Delete
* Return
[403] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[404] Fix | Delete
* is set appropriately.
[405] Fix | Delete
*
[406] Fix | Delete
* BPF_PROG_QUERY
[407] Fix | Delete
* Description
[408] Fix | Delete
* Obtain information about eBPF programs associated with the
[409] Fix | Delete
* specified *attach_type* hook.
[410] Fix | Delete
*
[411] Fix | Delete
* The *target_fd* must be a valid file descriptor for a kernel
[412] Fix | Delete
* object which depends on the attach type of *attach_bpf_fd*:
[413] Fix | Delete
*
[414] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_DEVICE**,
[415] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SKB**,
[416] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SOCK**,
[417] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SOCK_ADDR**,
[418] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SOCKOPT**,
[419] Fix | Delete
* **BPF_PROG_TYPE_CGROUP_SYSCTL**,
[420] Fix | Delete
* **BPF_PROG_TYPE_SOCK_OPS**
[421] Fix | Delete
*
[422] Fix | Delete
* Control Group v2 hierarchy with the eBPF controller
[423] Fix | Delete
* enabled. Requires the kernel to be compiled with
[424] Fix | Delete
* **CONFIG_CGROUP_BPF**.
[425] Fix | Delete
*
[426] Fix | Delete
* **BPF_PROG_TYPE_FLOW_DISSECTOR**
[427] Fix | Delete
*
[428] Fix | Delete
* Network namespace (eg /proc/self/ns/net).
[429] Fix | Delete
*
[430] Fix | Delete
* **BPF_PROG_TYPE_LIRC_MODE2**
[431] Fix | Delete
*
[432] Fix | Delete
* LIRC device path (eg /dev/lircN). Requires the kernel
[433] Fix | Delete
* to be compiled with **CONFIG_BPF_LIRC_MODE2**.
[434] Fix | Delete
*
[435] Fix | Delete
* **BPF_PROG_QUERY** always fetches the number of programs
[436] Fix | Delete
* attached and the *attach_flags* which were used to attach those
[437] Fix | Delete
* programs. Additionally, if *prog_ids* is nonzero and the number
[438] Fix | Delete
* of attached programs is less than *prog_cnt*, populates
[439] Fix | Delete
* *prog_ids* with the eBPF program ids of the programs attached
[440] Fix | Delete
* at *target_fd*.
[441] Fix | Delete
*
[442] Fix | Delete
* The following flags may alter the result:
[443] Fix | Delete
*
[444] Fix | Delete
* **BPF_F_QUERY_EFFECTIVE**
[445] Fix | Delete
* Only return information regarding programs which are
[446] Fix | Delete
* currently effective at the specified *target_fd*.
[447] Fix | Delete
*
[448] Fix | Delete
* Return
[449] Fix | Delete
* Returns zero on success. On error, -1 is returned and *errno*
[450] Fix | Delete
* is set appropriately.
[451] Fix | Delete
*
[452] Fix | Delete
* BPF_RAW_TRACEPOINT_OPEN
[453] Fix | Delete
* Description
[454] Fix | Delete
* Attach an eBPF program to a tracepoint *name* to access kernel
[455] Fix | Delete
* internal arguments of the tracepoint in their raw form.
[456] Fix | Delete
*
[457] Fix | Delete
* The *prog_fd* must be a valid file descriptor associated with
[458] Fix | Delete
* a loaded eBPF program of type **BPF_PROG_TYPE_RAW_TRACEPOINT**.
[459] Fix | Delete
*
[460] Fix | Delete
* No ABI guarantees are made about the content of tracepoint
[461] Fix | Delete
* arguments exposed to the corresponding eBPF program.
[462] Fix | Delete
*
[463] Fix | Delete
* Applying **close**\ (2) to the file descriptor returned by
[464] Fix | Delete
* **BPF_RAW_TRACEPOINT_OPEN** will delete the map (but see NOTES).
[465] Fix | Delete
*
[466] Fix | Delete
* Return
[467] Fix | Delete
* A new file descriptor (a nonnegative integer), or -1 if an
[468] Fix | Delete
* error occurred (in which case, *errno* is set appropriately).
[469] Fix | Delete
*
[470] Fix | Delete
* BPF_BTF_LOAD
[471] Fix | Delete
* Description
[472] Fix | Delete
* Verify and load BPF Type Format (BTF) metadata into the kernel,
[473] Fix | Delete
* returning a new file descriptor associated with the metadata.
[474] Fix | Delete
* BTF is described in more detail at
[475] Fix | Delete
* https://www.kernel.org/doc/html/latest/bpf/btf.html.
[476] Fix | Delete
*
[477] Fix | Delete
* The *btf* parameter must point to valid memory providing
[478] Fix | Delete
* *btf_size* bytes of BTF binary metadata.
[479] Fix | Delete
*
[480] Fix | Delete
* The returned file descriptor can be passed to other **bpf**\ ()
[481] Fix | Delete
* subcommands such as **BPF_PROG_LOAD** or **BPF_MAP_CREATE** to
[482] Fix | Delete
* associate the BTF with those objects.
[483] Fix | Delete
*
[484] Fix | Delete
* Similar to **BPF_PROG_LOAD**, **BPF_BTF_LOAD** has optional
[485] Fix | Delete
* parameters to specify a *btf_log_buf*, *btf_log_size* and
[486] Fix | Delete
* *btf_log_level* which allow the kernel to return freeform log
[487] Fix | Delete
* output regarding the BTF verification process.
[488] Fix | Delete
*
[489] Fix | Delete
* Return
[490] Fix | Delete
* A new file descriptor (a nonnegative integer), or -1 if an
[491] Fix | Delete
* error occurred (in which case, *errno* is set appropriately).
[492] Fix | Delete
*
[493] Fix | Delete
* BPF_BTF_GET_FD_BY_ID
[494] Fix | Delete
* Description
[495] Fix | Delete
* Open a file descriptor for the BPF Type Format (BTF)
[496] Fix | Delete
* corresponding to *btf_id*.
[497] Fix | Delete
*
[498] Fix | Delete
* Return
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function