1 // SPDX-License-Identifier: GPL-2.0 2 3 #include <linux/bpf.h> 4 #include <bpf/bpf_helpers.h> 5 6 struct { 7 __uint(type, BPF_MAP_TYPE_ARRAY); 8 __uint(max_entries, 1); 9 __type(key, __u32); 10 __type(value, __u64); 11 __uint(pinning, LIBBPF_PIN_BY_NAME); 12 } pinmap SEC(".maps"); 13 14 struct { 15 __uint(type, BPF_MAP_TYPE_HASH); 16 __uint(max_entries, 1); 17 __type(key, __u32); 18 __type(value, __u64); 19 } nopinmap SEC(".maps"); 20 21 struct { 22 __uint(type, BPF_MAP_TYPE_HASH); 23 __uint(max_entries, 1); 24 __type(key, __u32); 25 __type(value, __u64); 26 __uint(pinning, LIBBPF_PIN_NONE); 27 } nopinmap2 SEC(".maps"); 28 29 char _license[] SEC("license") = "GPL"; 30
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.