1 Star 0 Fork 7

orientlu/oncn-bwm

forked from openEuler/oncn-bwm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bwmcli.h 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
derekwin 提交于 2023-09-23 15:08 . add ingress Qos ability
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
* Description: Network bandwidth management tool
*/
#ifndef __BWMCLI_H__
#define __BWMCLI_H__
#define EXIT_OK 0
#define EXIT_FAIL 1
#define EXIT_FAIL_OPTION 2
#define EXIT_FAIL_BPF 3
#define EXIT_FAIL_MEM 4
#define PRIO_LEN 32
#define IP_LEN 16 // ipv4
#define ARG_LEN 16
#define BPF_PROG_PATH "/usr/share/bwmcli/"
#define CGRP_PRIO_PROG BPF_PROG_PATH"bwm_prio_kern.o"
#define TC_PROG BPF_PROG_PATH"bwm_tc.o"
#define TC_PROG_I BPF_PROG_PATH"bwm_tc_i.o"
#define MAX_PROG_CNT 10
#define MAX_CMD_LEN (256 + NAME_MAX)
#define DECIMAL 10
#define BWM_VERSION "1.0"
#define MINUM_ARGS 2
#define PRIO_GET 0
#define PRIO_SET 1
#define UNIT_LEN 2
#define GB (1024 * 1024 * 1024)
#define MB (1024 * 1024)
#define KB (1024)
enum {
BYTE_UNIT = 1,
KB_UNIT = KB,
MB_UNIT = MB,
GB_UNIT = GB,
};
typedef int NetdevCallback(const char *ethdev, const void *arg, int isIngress);
struct CfgOperations {
int (*setCfg)(void *, void *, int);
int (*getCfg)(void *, int);
};
struct CfgOption {
const char *name;
struct CfgOperations op;
};
struct TcCmd {
const char *cmdStr;
bool verifyRet;
};
#define BWM_LOG_DEBUG(fmt, args...) syslog(LOG_DEBUG, "[BWM_DEBUG]: " fmt, ## args)
#define BWM_LOG_ERR(fmt, args...) syslog(LOG_ERR, "[BWM]: " fmt, ## args)
#define BWM_LOG_INFO(fmt, args...) ((void)printf(fmt, ## args))
#endif /* __BWMCLI_H__ */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/orientlu2/oncn-bwm.git
git@gitee.com:orientlu2/oncn-bwm.git
orientlu2
oncn-bwm
oncn-bwm
master

搜索帮助