For help. Statistics on network card traffic using c programming in linux

Source: Internet
Author: User
For help. Linux c programming statistics Nic traffic-Linux general technology-Linux programming and kernel information, the following is a detailed description. I know the following methods:
1/PROC/NET/DEV file read. This file is blank in the system and is not feasible.
2. this method is suitable for reading driver statistics, but you do not know if there are common system api functions. Check the source code of ethtool, but the test is not successful.
3 ifcofnig source code. the interface struct definition cannot be found. So it is not implemented.

Cannot be viewed using linux commands. you need to call the api provided by the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.