simplify libbpf_android.h
Test: TreeHugger Flag: EXEMPT trivial Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I39f73afef65b22b1d275742758aff7745991d9e7
This commit is contained in:
parent
5781bd4a22
commit
8b3ea0a274
2 changed files with 9 additions and 33 deletions
|
|
@ -817,6 +817,13 @@ static int loadCodeSections(const char* elfPath, vector<codeSection>& cs, const
|
|||
return 0;
|
||||
}
|
||||
|
||||
struct Location {
|
||||
const char* const dir = "";
|
||||
const char* const prefix = "";
|
||||
const bpf_prog_type* allowedProgTypes = nullptr;
|
||||
size_t allowedProgTypesLength = 0;
|
||||
};
|
||||
|
||||
int loadProg(const char* elfPath, bool* isCritical, const Location& location) {
|
||||
vector<char> license;
|
||||
vector<char> critical;
|
||||
|
|
|
|||
|
|
@ -17,39 +17,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <linux/bpf.h>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
namespace android {
|
||||
namespace bpf {
|
||||
|
||||
struct Location {
|
||||
const char* const dir = "";
|
||||
const char* const prefix = "";
|
||||
const bpf_prog_type* allowedProgTypes = nullptr;
|
||||
size_t allowedProgTypesLength = 0;
|
||||
};
|
||||
|
||||
// BPF loader implementation. Loads an eBPF ELF object
|
||||
int loadProg(const char* elfPath, bool* isCritical, const Location &location = {});
|
||||
|
||||
// Exposed for testing
|
||||
unsigned int readSectionUint(const char* name, std::ifstream& elfFile, unsigned int defVal);
|
||||
|
||||
} // namespace bpf
|
||||
} // namespace android
|
||||
|
||||
extern "C" {
|
||||
#else // __cplusplus
|
||||
#define __noreturn
|
||||
#endif // __cplusplus
|
||||
|
||||
// The C++ portion of the BpfLoader is exposed as a terminal function.
|
||||
__noreturn void vendorBpfLoader();
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern C
|
||||
extern "C" __noreturn
|
||||
#endif
|
||||
void vendorBpfLoader();
|
||||
|
|
|
|||
Loading…
Reference in a new issue