瑞昌市环保局网站建设,网站建设方投资成本,哪些公司需要网站建设,公司注册网上核名官网一般来说#xff0c;研究 ifconfig.c 源代码就可以达到目的了。但是Linux已经提供了比较方便的获取网口信息的方式#xff1a;[philipcatonbj ~]$ cat /sys/class/net/em1/statistics/rx_bytes3911191274在/sys/class/net/INTERFACE/statistics/ 目录下有所有网口的状态…一般来说研究 ifconfig.c 源代码就可以达到目的了。但是Linux已经提供了比较方便的获取网口信息的方式[philipcatonbj ~]$ cat /sys/class/net/em1/statistics/rx_bytes3911191274在/sys/class/net/INTERFACE/statistics/ 目录下有所有网口的状态[philipcatonbj statistics]$ lscollisions rx_bytes rx_crc_errors rx_errors rx_frame_errors rx_missed_errors rx_packets tx_bytes tx_compressed tx_errors tx_heartbeat_errors tx_window_errorsmulticast rx_compressed rx_dropped rx_fifo_errors rx_length_errors rx_over_errors tx_aborted_errors tx_carrier_errors tx_dropped tx_fifo_errors tx_packets而它的上一级[philipcatonbj em1]$ lsaddr_assign_type address addr_len broadcast carrier device dev_id dormant duplex flags ifalias ifindex iflink link_mode mtu netdev_group operstate power queues speed statistics subsystem tx_queue_len type uevent也有较详细的描述。程序上或许获取接口比较难用何不直接调用 cat 句柄调用呢