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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?