没有合适的资源?快使用搜索试试~ 我知道了~
C语言实现获取网络带宽占用情况

温馨提示
采用C语言实现,获取服务器指定网卡的网络流量并计算单位时间的网速,从而计算相应网卡的带宽占用率。
资源推荐
资源详情
资源评论










格式:zip 资源大小:21.8KB


















// filename: getNet.c
// command sample: ./getNet eth0
// compile command: gcc -p -g getNet.c && gcc -o getNet getNet.c
#include <string.h>
#include <sys/ioctl.h>
#include <string.h>
#include <errno.h>
#include <linux/sockios.h>
#include <net/if.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifndef SIOCETHTOOL
#define SIOCETHTOOL 0x8946
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
/* CMDs currently supported */
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
#define ETHTOOL_SSET 0x00000002 /* Set settings. */
// command sample: ./getNet eth0
// compile command: gcc -p -g getNet.c && gcc -o getNet getNet.c
#include <string.h>
#include <sys/ioctl.h>
#include <string.h>
#include <errno.h>
#include <linux/sockios.h>
#include <net/if.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifndef SIOCETHTOOL
#define SIOCETHTOOL 0x8946
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
/* CMDs currently supported */
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
#define ETHTOOL_SSET 0x00000002 /* Set settings. */

yong87727
- 粉丝: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 第七节施工图预算书第八节计费程序表.ppt
- 高管股权激励管理规定.doc
- 大桥施工组织设计.doc
- 城市道路改建工程监理大纲.doc
- 基于单片机的锅炉防爆控制系统-设计论文-毕设论文.doc
- 网络机房消防服务方案范本.docx
- 【上海】上海中心大厦BIM技术精益化管理.ppt
- 五、企业利润及利润表分析.doc
- 桥式起重机电气控制系统课程课件.ppt
- 安徽造价员基本知识部分例题及解析.doc
- 上海软件著作权申请钦州北路.doc
- 《特别提款权(SDR)估值方法评估——初步考虑》摘要.docx
- 中国古代诗歌名句.doc
- 浅谈管井降水设计及施工.doc
- 安全隐患排除制度.doc
- 中南地产成本管理实施细则.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制

- 1
- 2
前往页