netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: network dev <netdev@vger.kernel.org>, linux-sctp@vger.kernel.org
Cc: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	daniel@iogearbox.net, davem@davemloft.net
Subject: [PATCHv2 net-next 0/6] sctp: support sctp_diag in kernel
Date: Sat,  9 Apr 2016 12:53:08 +0800	[thread overview]
Message-ID: <cover.1460177331.git.lucien.xin@gmail.com> (raw)

This patchset will add sctp_diag module to implement diag interface on
sctp in kernel.

For a listening sctp endpoint, we will just dump it's ep info.
For a sctp connection, we will the assoc info and it's ep info.

The ss dump will looks like:

[iproute2]# ./misc/ss --sctp  -n -l
State      Recv-Q Send-Q   Local Address:Port       Peer Address:Port
LISTEN     0      128      172.16.254.254:8888      *:*
LISTEN     0      5        127.0.0.1:1234           *:*
LISTEN     0      5        127.0.0.1:1234           *:*
  - ESTAB  0      0        127.0.0.1%lo:1234        127.0.0.1:4321
LISTEN     0      128      172.16.254.254:8888      *:*
  - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.253.253:8888
  - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.1.1:8888
  - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.1.2:8888
  - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.2.1:8888
  - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.2.2:8888
  - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.3.1:8888
  - ESTAB  0      0        172.16.254.254%eth1:8888 172.16.3.2:8888
LISTEN     0      0        127.0.0.1:4321           *:*
  - ESTAB  0      0        127.0.0.1%lo:4321        127.0.0.1:1234

The entries with '- ESTAB' are the assocs, some of them may belong to
the same endpoint. So we will dump the parent endpoint first, like the
entry with 'LISTEN'. then dump the assocs. ep and assocs entries will
be dumped in right order so that ss can show them in tree format easily.

Besides, this patchset also simplifies sctp proc codes, cause it has
some similar codes with sctp diag in sctp transport traversal.

v1->v2:
  1. inet_diag_get_handler needs to return it as const.
  2. merge 5/7 into 2/7 of v1.

Xin Long (6):
  sctp: add sctp_info dump api for sctp_diag
  sctp: export some apis or variables for sctp_diag and reuse some for
    proc
  sctp: export some functions for sctp_diag in inet_diag
  sctp: add the sctp_diag.c file
  sctp: merge the seq_start/next/exits in remaddrs and assocs
  sctp: fix some rhashtable functions using in sctp proc/diag

 include/linux/sctp.h           |  65 +++++
 include/net/sctp/sctp.h        |  16 ++
 include/uapi/linux/inet_diag.h |   2 +
 net/ipv4/inet_diag.c           |   9 +-
 net/sctp/Kconfig               |   4 +
 net/sctp/Makefile              |   1 +
 net/sctp/proc.c                | 104 ++------
 net/sctp/sctp_diag.c           | 581 +++++++++++++++++++++++++++++++++++++++++
 net/sctp/socket.c              | 215 +++++++++++++++
 9 files changed, 911 insertions(+), 86 deletions(-)
 create mode 100644 net/sctp/sctp_diag.c

-- 
2.1.0

             reply	other threads:[~2016-04-09  4:53 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-09  4:53 Xin Long [this message]
2016-04-09  4:53 ` [PATCHv2 net-next 1/6] sctp: add sctp_info dump api for sctp_diag Xin Long
2016-04-09  4:53   ` [PATCHv2 net-next 2/6] sctp: export some apis or variables for sctp_diag and reuse some for proc Xin Long
2016-04-09  4:53     ` [PATCHv2 net-next 3/6] sctp: export some functions for sctp_diag in inet_diag Xin Long
2016-04-09  4:53       ` [PATCHv2 net-next 4/6] sctp: add the sctp_diag.c file Xin Long
2016-04-09  4:53         ` [PATCHv2 net-next 5/6] sctp: merge the seq_start/next/exits in remaddrs and assocs Xin Long
2016-04-09  4:53           ` [PATCHv2 net-next 6/6] sctp: fix some rhashtable functions using in sctp proc/diag Xin Long
2016-04-09  5:51         ` [PATCHv2 net-next 4/6] sctp: add the sctp_diag.c file Eric Dumazet
2016-04-09 15:40           ` Xin Long
2016-04-09 17:23             ` Eric Dumazet
2016-04-11 21:21           ` Marcelo Ricardo Leitner
2016-04-09  5:16   ` [PATCHv2 net-next 1/6] sctp: add sctp_info dump api for sctp_diag Eric Dumazet
2016-04-09 15:19     ` Jamal Hadi Salim
2016-04-09 17:21       ` Eric Dumazet
2016-04-10 13:02         ` Jamal Hadi Salim
2016-04-09 15:45     ` Xin Long
2016-04-09  5:19   ` Eric Dumazet
2016-04-09 16:10     ` Xin Long
2016-04-09 17:29       ` Eric Dumazet
2016-04-09 17:31       ` Eric Dumazet
2016-04-09 15:16   ` Jamal Hadi Salim
2016-04-10  6:42     ` Xin Long

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1460177331.git.lucien.xin@gmail.com \
    --to=lucien.xin@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).