History

tools: Sync {,tools/}include/uapi/linux/bpf.h

The tools version of this header is out of date; update it to the latest version from kernel header. Synchronize with the following commits: * b95a5c4db09b ("bpf: add a longest prefix match trie map implementation") * a5e8c07059d0 ("bpf: add bpf_probe_read_str helper") * d1b662adcdb8 ("bpf: allow option for setting bpf_l4_csum_replace from scratch")

Mickaël Salaün committed 9 years ago

Commit 9a738261 parent e40d5d71 file · +22 −1Browse files

Showing the changes to tools/include/uapi/linux (1 of 1 file). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+22−1
@@ -63,6 +63,12 @@ struct bpf_insn { · 62 unmodified lines
6363 __s32 imm; /* signed immediate constant */
6464 };
6565
66+/* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */
67+struct bpf_lpm_trie_key {
68+ __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */
69+ __u8 data[0]; /* Arbitrary size */
70+};
71+
6672 /* BPF syscall commands, see bpf(2) man-page for details. */
6773 enum bpf_cmd {
6874 BPF_MAP_CREATE,
@@ -89,6 +95,7 @@ enum bpf_map_type { · 20 unmodified lines
8995 BPF_MAP_TYPE_CGROUP_ARRAY,
9096 BPF_MAP_TYPE_LRU_HASH,
9197 BPF_MAP_TYPE_LRU_PERCPU_HASH,
98+ BPF_MAP_TYPE_LPM_TRIE,
9299 };
93100
94101 enum bpf_prog_type {
@@ -430,6 +437,18 @@ union bpf_attr { · 335 unmodified lines
430437 * @xdp_md: pointer to xdp_md
431438 * @delta: An positive/negative integer to be added to xdp_md.data
432439 * Return: 0 on success or negative on error
440+ *
441+ * int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
442+ * Copy a NUL terminated string from unsafe address. In case the string
443+ * length is smaller than size, the target is not padded with further NUL
444+ * bytes. In case the string length is larger than size, just count-1
445+ * bytes are copied and the last byte is set to NUL.
446+ * @dst: destination address
447+ * @size: maximum number of bytes to copy, including the trailing NUL
448+ * @unsafe_ptr: unsafe address
449+ * Return:
450+ * > 0 length of the string including the trailing NUL on success
451+ * < 0 error
433452 */
434453 #define __BPF_FUNC_MAPPER(FN) \
435454 FN(unspec), \
@@ -476,7 +495,8 @@ union bpf_attr { · 40 unmodified lines
476495 FN(set_hash_invalid), \
477496 FN(get_numa_node_id), \
478497 FN(skb_change_head), \
479− FN(xdp_adjust_head),
498+ FN(xdp_adjust_head), \
499+ FN(probe_read_str),
480500
481501 /* integer value in 'imm' field of BPF_CALL instruction selects which helper
482502 * function eBPF program intends to call
@@ -502,6 +522,7 @@ enum bpf_func_id { · 19 unmodified lines
502522 /* BPF_FUNC_l4_csum_replace flags. */
503523 #define BPF_F_PSEUDO_HDR (1ULL << 4)
504524 #define BPF_F_MARK_MANGLED_0 (1ULL << 5)
525+#define BPF_F_MARK_ENFORCE (1ULL << 6)
505526
506527 /* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */
507528 #define BPF_F_INGRESS (1ULL << 0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t