1 /* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
3 #include "bpf_helpers.h"
5 struct bpf_map_def
SEC("maps") htab
= {
6 .type
= BPF_MAP_TYPE_HASH
,
7 .key_size
= sizeof(__u32
),
8 .value_size
= sizeof(long),
12 struct bpf_map_def
SEC("maps") array
= {
13 .type
= BPF_MAP_TYPE_ARRAY
,
14 .key_size
= sizeof(__u32
),
15 .value_size
= sizeof(long),
19 /* Sample program which should always load for testing control paths. */
20 SEC(".text") int func()
26 value
= bpf_map_lookup_elem(&htab
, &key
);
29 value
= bpf_map_lookup_elem(&array
, &key64
);