Commit aacef040 authored by 4ast's avatar 4ast

Merge pull request #91 from iovisor/bcc_export

Include bcc headers in /usr/include
parents 8a9747c9 62af2db2
...@@ -44,3 +44,4 @@ target_link_libraries(bpfprog ${clang_libs} ${llvm_libs} LLVMBPFCodeGen) ...@@ -44,3 +44,4 @@ target_link_libraries(bpfprog ${clang_libs} ${llvm_libs} LLVMBPFCodeGen)
install(TARGETS bpfprog LIBRARY DESTINATION lib${LIBSUFFIX}) install(TARGETS bpfprog LIBRARY DESTINATION lib${LIBSUFFIX})
install(DIRECTORY export/ DESTINATION share/bcc/include/bcc install(DIRECTORY export/ DESTINATION share/bcc/include/bcc
FILES_MATCHING PATTERN "*.h") FILES_MATCHING PATTERN "*.h")
install(FILES bpf_common.h ../libbpf.h DESTINATION include/bcc)
...@@ -13,15 +13,19 @@ ...@@ -13,15 +13,19 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#pragma once
#ifndef BPF_COMMON_H
#define BPF_COMMON_H
#include <stdint.h> #include <stdint.h>
#include <stdlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void * bpf_module_create(const char *filename, const char *proto_filename, unsigned flags); void * bpf_module_create(const char *filename, const char *proto_filename, unsigned flags);
void * bpf_module_create_from_string(const char *text, unsigned flags);
void bpf_module_destroy(void *program); void bpf_module_destroy(void *program);
char * bpf_module_license(void *program); char * bpf_module_license(void *program);
unsigned bpf_module_kern_version(void *program); unsigned bpf_module_kern_version(void *program);
...@@ -34,3 +38,5 @@ const char * bpf_table_leaf_desc(void *program, const char *table_name); ...@@ -34,3 +38,5 @@ const char * bpf_table_leaf_desc(void *program, const char *table_name);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
...@@ -15,7 +15,10 @@ ...@@ -15,7 +15,10 @@
*/ */
/* eBPF mini library */ /* eBPF mini library */
#pragma once #ifndef LIBBPF_H
#define LIBBPF_H
#include <linux/bpf.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -210,3 +213,5 @@ extern char bpf_log_buf[LOG_BUF_SIZE]; ...@@ -210,3 +213,5 @@ extern char bpf_log_buf[LOG_BUF_SIZE];
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment