Add TableStorage class for wrapping bpf map tracking
Adds a TableStorage class for use by language frontends to store/access
references to loaded bpf maps. Includes support for shared and
namespaced maps, in a directory-like hierarchy.
Add a FileDesc helper class to automatically wrap open file descriptors.
The object prevents implicit copying of the fd (allows only
rvalue/move()), and takes care of the close() call.
Add a reference implementation of a TableStorageImpl that performs the
current default behavior expected by BPF_TABLE_PUBLIC, which is to share
maps between BPFModules in the same-process only. A stub implementation
for bpffs is started.
Update b/clang frontends to use this new class.
Also included is a framework for extracting the type information of maps
in an extensible way. Migrate BMapDeclVisitor to use this as the first
consumer.
Signed-off-by: Brenden Blanco <bblanco@gmail.com>
Showing
src/cc/bpffs_table.cc
0 → 100644
src/cc/table_storage.cc
0 → 100644
src/cc/table_storage.h
0 → 100644
src/cc/table_storage_impl.h
0 → 100644
Please register or sign in to comment