1 /* Copyright (c) 2017 Facebook
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of version 2 of the GNU General Public
5 * License as published by the Free Software Foundation.
9 #include <linux/pkt_cls.h>
10 #include "bpf_helpers.h"
12 /* It is a dumb bpf program such that it must have no
13 * issue to be loaded since testing the verifier is
17 int _version
SEC("version") = 1;
19 struct bpf_map_def
SEC("maps") test_map_id
= {
20 .type
= BPF_MAP_TYPE_ARRAY
,
21 .key_size
= sizeof(__u32
),
22 .value_size
= sizeof(__u64
),
26 SEC("test_obj_id_dummy")
27 int test_obj_id(struct __sk_buff
*skb
)
32 value
= bpf_map_lookup_elem(&test_map_id
, &key
);