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下静态库嵌套使用
前提是你会在linux下调用静态库和动态库和Makfile编程(当然不会Makfile直接在终端命令也成)
本例是先由StringLen.h,StringLen.c生成librak.a
然后利用StringLen2.h,StringLen2.并调用librak.a生成librak2.a
最后利用StringLen3.h,StringLen3.c调用librak2.a 生成librak3.so
------------------ ......
切换到root用户下,
service iptables status 用于查看是否有开启防方墙.
service iptables stop 用于关闭防火墙.
service iptables start 用于打开防火墙.
防火墙的开启有时会限制外部访问服务器上的端口失败. ......
RHEL5搭建DNS服务器实现名称解析 三
(二)named.conf文件说明:
此文件需用户自己创建,可从/usr/share/doc/bind-9.3.3/sample/etc中复制到/var/named/chroot/etc/目录下
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
// See the BIND ......
RHEL5搭建DNS服务器实现名称解析 四
(1)设置正向解析区域
正向解析区域用于实现域名到IP地址之间的转换。下面是一个正向解析区域的配置内容举例:
zone “my.internal.com” {
type master;
&nbs ......
第一部分: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 ......