【问题标题】:Fetch dropped packet count of an interface with netlink sockets使用 netlink 套接字获取接口的丢弃数据包计数
【发布时间】:2020-04-07 14:28:28
【问题描述】:

我熟悉不同的工具(如 netstat、tcpdump 等)和文件(如/sys/class/net/<dev>/statistics),我们可以使用它们来获取计数。

但是谁能告诉我是否有办法直接从内核获取这些信息,使用 netlink 套接字?

【问题讨论】:

    标签: c linux-kernel netlink


    【解决方案1】:

    当然,看看IFLA_STATS。您可能需要检查iproute2 包的ifstat.c 文件,它几乎是与netlink 交互的标准工具。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      相关资源
      最近更新 更多