1 Star 0 Fork 2

Lv Ying / A-Tune-BPF-Collection

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
common_helper.h 798 Bytes
一键复制 编辑 原始数据 按行查看 历史
#ifndef _COMMON_HELPER_H
#define _COMMON_HELPER_H
#include <syslog.h>
#define SHASH 11
#define SYSLOG (1 << 0)
#define TERM (1 << 1)
#define ALL (SYSLOG | TERM)
#define log(where, level, fmt, args...) do { \
if (where & SYSLOG) \
syslog(level, fmt, ##args); \
if (where & TERM) { \
fprintf(stderr, fmt, ##args); \
fflush(stderr); \
} \
} while (0)
struct opt {
struct opt *next;
char *name;
char *val;
};
struct opt **parse_init(unsigned int size);
void parse_fini(struct opt **opts, unsigned int size);
int parse_config_file(unsigned int where, const char *conf_fn, struct opt **opts, unsigned int size);
char* config_opt(struct opt **opts, unsigned int size, const char *name);
void bump_memlock_rlimit(unsigned int where);
#endif
1
https://gitee.com/lvying6/A-Tune-BPF-Collection.git
git@gitee.com:lvying6/A-Tune-BPF-Collection.git
lvying6
A-Tune-BPF-Collection
A-Tune-BPF-Collection
master

搜索帮助