inet-diag-example

Example application of how to passively monitor multiple sockets on Linux.

  • 所有者: kristrev/inet-diag-example
  • 平台:
  • 许可证:
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

inet-diag-example

If you want to see a more complete example of how to use INET_DIAG, check out tcp_closer

For a project I was working on lately, I needed to passively monitor a large
number of TCP sockets. One common way to do is to parse the output of /proc/tcp,
but my goal was to create a "clean" solution and avoid for example text-parsing.

After doing some digging, I discovered the convenient ss-utility (of the
iproute-suite), which does something similar to what I want. ss makes use of
NETLINK and the INET_DIAG-sockets for a nice way of extracting connection
information. ss has support for all protocols (sockets) supporting exporting
information, so the code is very generic and quite large.

Combined with a lack of INET_DIAG-documentation (the kernel source is your
friend), I decided to create a small, easy to follow example of how INET_DIAG
can be used to passively monitor sockets. A detailed description of the example
is available
here.

主要指标

概览
名称与所有者kristrev/inet-diag-example
主编程语言C
编程语言C (语言数: 1)
平台
许可证
所有者活动
创建于2013-07-26 11:46:42
推送于2018-01-22 15:18:31
最后一次提交2018-01-22 16:18:30
发布数0
用户参与
星数73
关注者数10
派生数17
提交数20
已启用问题?
问题数3
打开的问题数1
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?