Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 
0003 #include <linux/bpf.h>
0004 #include <bpf/bpf_helpers.h>
0005 
0006 struct {
0007     __uint(type, BPF_MAP_TYPE_ARRAY);
0008     __uint(max_entries, 1);
0009     __type(key, __u32);
0010     __type(value, __u64);
0011     __uint(pinning, LIBBPF_PIN_BY_NAME);
0012 } pinmap SEC(".maps");
0013 
0014 struct {
0015     __uint(type, BPF_MAP_TYPE_HASH);
0016     __uint(max_entries, 1);
0017     __type(key, __u32);
0018     __type(value, __u64);
0019 } nopinmap SEC(".maps");
0020 
0021 struct {
0022     __uint(type, BPF_MAP_TYPE_HASH);
0023     __uint(max_entries, 1);
0024     __type(key, __u32);
0025     __type(value, __u64);
0026     __uint(pinning, LIBBPF_PIN_NONE);
0027 } nopinmap2 SEC(".maps");
0028 
0029 char _license[] SEC("license") = "GPL";