P4C
The P4 Compiler
Loading...
Searching...
No Matches
ebpf_map.h
1/*
2 * Copyright 2018 VMware, Inc.
3 * SPDX-FileCopyrightText: 2018 VMware, Inc.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8
11#ifndef BACKENDS_EBPF_RUNTIME_EBPF_MAP_H_
12#define BACKENDS_EBPF_RUNTIME_EBPF_MAP_H_
13
14#include "contrib/uthash.h" // exports string.h, stddef.h, and stdlib.h
15
16struct bpf_map {
17 void *key;
18 void *value;
19 UT_hash_handle hh; // makes this structure hashable
20};
21
28int bpf_map_update_elem(struct bpf_map **map, void *key, unsigned int key_size, void *value,unsigned int value_size, unsigned long long flags);
29
35void *bpf_map_lookup_elem(struct bpf_map *map, void *key, unsigned int key_size);
36
42int bpf_map_delete_elem(struct bpf_map *map, void *key, unsigned int key_size);
43
49int bpf_map_delete_map(struct bpf_map *map);
50
51
52#endif // BACKENDS_EBPF_RUNTIME_EBPF_MAP_H_
Definition uthash.h:1206
Definition ebpf_map.h:16