P4C
The P4 Compiler
Loading...
Searching...
No Matches
ebpf_map.h
1/*
2Copyright 2018 VMware, Inc.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
20#ifndef BACKENDS_EBPF_RUNTIME_EBPF_MAP_H_
21#define BACKENDS_EBPF_RUNTIME_EBPF_MAP_H_
22
23#include "contrib/uthash.h" // exports string.h, stddef.h, and stdlib.h
24
25struct bpf_map {
26 void *key;
27 void *value;
28 UT_hash_handle hh; // makes this structure hashable
29};
30
37int bpf_map_update_elem(struct bpf_map **map, void *key, unsigned int key_size, void *value,unsigned int value_size, unsigned long long flags);
38
44void *bpf_map_lookup_elem(struct bpf_map *map, void *key, unsigned int key_size);
45
51int bpf_map_delete_elem(struct bpf_map *map, void *key, unsigned int key_size);
52
58int bpf_map_delete_map(struct bpf_map *map);
59
60
61#endif // BACKENDS_EBPF_RUNTIME_EBPF_MAP_H_
Definition uthash.h:1206
Definition ebpf_map.h:25