TSG-14829 io_uring支持触发事件,适配mrzcpd的epoll_wait功能
This commit is contained in:
31
bpf/bpf_obj.h
Normal file
31
bpf/bpf_obj.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _BPF_OBJ_H_
|
||||
#define _BPF_OBJ_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct bpf_obj_ctx;
|
||||
|
||||
/*
|
||||
* queue_num : same as worker thread number
|
||||
* hash_mode : 2: hash with src/dst addr
|
||||
* 4: hash with src/dst addr and src/dst port
|
||||
* debug_log : 0 for disable(only use for debug, printf bpf debug log(cat /sys/kernel/debug/tracing/trace_pipe)
|
||||
*/
|
||||
struct bpf_obj_ctx *bpf_obj_load(const char *obj_file, uint32_t queue_num, uint32_t hash_mode, uint32_t debug_log);
|
||||
void bpf_obj_unload(struct bpf_obj_ctx *ctx);
|
||||
/*
|
||||
* return 0 : success
|
||||
* return -1 : error
|
||||
*/
|
||||
int bpf_obj_attach(struct bpf_obj_ctx *ctx, int fd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user