inet-diag-example

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

  • Owner: kristrev/inet-diag-example
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownerkristrev/inet-diag-example
Primary LanguageC
Program languageC (Language Count: 1)
Platform
License:
所有者活动
Created At2013-07-26 11:46:42
Pushed At2018-01-22 15:18:31
Last Commit At2018-01-22 16:18:30
Release Count0
用户参与
Stargazers Count73
Watchers Count10
Fork Count17
Commits Count20
Has Issues Enabled
Issues Count3
Issue Open Count1
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private