• Brenden Blanco's avatar
    Add TableStorage class for wrapping bpf map tracking · faea8c84
    Brenden Blanco authored
    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: default avatarBrenden Blanco <bblanco@gmail.com>
    faea8c84