linux上c语言 获得网络接口的统计值
这个东东,蛮好玩的。其实就是读取了/proc/net/dev 文件。
struct netdev_stats {
unsigned long long rx_packets_m; /* total packets received */
unsigned long long tx_packets_m; /* total packets transmitted */
unsigned long long rx_bytes_m; /* total bytes received */
unsigned long long tx_bytes_m; /* total bytes transmitted */
unsigned long rx_errors_m; /* bad packets received */
unsigned long tx_errors_m; /* packet transmit problems */
unsigned long rx_dropped_m; /* no space in linux buffers */
unsigned long tx_dropped_m; /* no space available in linux */
unsigned long rx_multicast_m; /* multicast packets received */
unsigned long rx_compressed_m;
unsigned long tx_compressed_m;
unsigned long collisions_m;
/* detailed rx_errors: */
unsigned long rx_length_errors_m;
unsigned long rx_over_errors_m; /* receiver ring buff overflow */
unsigned long rx_crc_errors_m; /* recved pkt with crc error */
unsigned long rx_frame_errors_m; /* recv'd frame alignment error */
unsigned long rx_fifo_errors_m; /* recv'r fifo overrun */
unsigned long rx_missed_errors_m;&nb
相关文档:
Linux下的进程通信手段基本上是从Unix平台上的进程通信手段继承而来的。而对Unix发展做出重大贡献的两大主力AT&T的贝尔实验室及BSD(加州大学伯克利分校的伯克利软件发布中心)在进程间通信方面的侧重点有所不同。前者对Unix早期的进程间通信手段进行了系统的改进和扩充,形成了“ ......
(七)DNS服务器配置实例
举例一:
使用view语句搭建具有内外视图功能的DNS服务器,并能够根椐不同的客户端地址实现不同的解析结果,假设局域网地址为192.168.255.0/24,局域网内各主机分别为rhel1:192.168.255.128; rhel2:192.168.255.12; rhel3:192.168.255.129; rhel4:192.168.255.120; rhel5:192.168.255.4为 ......
第一部分:Linux基础应用
1、《Linux从入门到精通》
http://www.gouhuo.com/study/linuxbook.zip
2、 Linux 系统安全与优化中文版
这本书的英文版“Get Acquainted with Linux Security and Optimization System”(简称LinuxSOS)是Linux文档计划(Linux Document Project)中比较新的一本指南。这本书不是L ......
Displaying the Routing Table:
netstat -nr
Displaying Interface Statistics:
netstat -i
Show the address resolution (ARP) tables:
netstat -p
Displaying Connections:
netstat -ta (linux)
netstat -a -f af:inet (opensolaris)
http://www.faqs.org/docs/linux_network/x-087-2-iface.netstat.html
http ......
Linux下的设备驱动程序被组织为一组完成不同任务的函数的集合,通过这些函数使得Windows的设备操作犹如文件一般。在应用程序看来,硬件设备只是一个设备文件,应用程序可以象操作普通文件一样对硬件设备进行操作,如open ()、close ()、read ()、write () 等。
Linux主要将设备分为二类:字符设备和块设备。字符设备是指设 ......