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: [PATCH net-next 3/7] sctp: export some functions for sctp_diag in inet_diag
Date: Tue,  5 Apr 2016 12:06:28 +0800	[thread overview]
Message-ID: <d16e3f12f689f28d8c3b62c7c2a15916177bd7c0.1459829123.git.lucien.xin@gmail.com> (raw)
In-Reply-To: <c99aafbc687328f783c0777e10df3e207004db10.1459829123.git.lucien.xin@gmail.com>
In-Reply-To: <cover.1459829123.git.lucien.xin@gmail.com>

inet_diag_msg_common_fill is used to fill the diag msg common info,
we need to use it in sctp_diag as well, so export it.

We also add inet_diag_get_handler() to access inet_diag_table in sctp
diag.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/ipv4/inet_diag.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index bd591eb..29121a6 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -66,7 +66,13 @@ static void inet_diag_unlock_handler(const struct inet_diag_handler *handler)
 	mutex_unlock(&inet_diag_table_mutex);
 }
 
-static void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
+struct inet_diag_handler *inet_diag_get_handler(int proto)
+{
+	return inet_diag_table[proto];
+}
+EXPORT_SYMBOL_GPL(inet_diag_get_handler);
+
+void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
 {
 	r->idiag_family = sk->sk_family;
 
@@ -89,6 +95,7 @@ static void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk)
 	r->id.idiag_dst[0] = sk->sk_daddr;
 	}
 }
+EXPORT_SYMBOL_GPL(inet_diag_msg_common_fill);
 
 static size_t inet_sk_attr_size(void)
 {
-- 
2.1.0

  reply	other threads:[~2016-04-05  4:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05  4:06 [PATCH net-next 0/7] sctp: support sctp_diag in kernel Xin Long
2016-04-05  4:06 ` [PATCH net-next 1/7] sctp: add sctp_info dump api for sctp_diag Xin Long
2016-04-05  4:06   ` [PATCH net-next 2/7] sctp: export some apis or variables " Xin Long
2016-04-05  4:06     ` Xin Long [this message]
2016-04-05  4:06       ` [PATCH net-next 4/7] sctp: add the sctp_diag.c file Xin Long
2016-04-05  4:06         ` [PATCH net-next 5/7] sctp: reuse the some transport traversal functions in proc Xin Long
2016-04-05  4:06           ` [PATCH net-next 6/7] sctp: merge the seq_start/next/exits in remaddrs and assocs Xin Long
2016-04-05  4:06             ` [PATCH net-next 7/7] sctp: fix some rhashtable functions using in sctp proc/diag Xin Long
2016-04-07 13:09           ` [PATCH net-next 5/7] sctp: reuse the some transport traversal functions in proc Neil Horman
2016-04-07 18:29             ` Marcelo Ricardo Leitner
2016-04-07 18:17       ` [PATCH net-next 3/7] sctp: export some functions for sctp_diag in inet_diag Marcelo Ricardo Leitner
2016-04-06 20:13 ` [PATCH net-next 0/7] sctp: support sctp_diag in kernel David Miller
2016-04-06 21:42   ` marcelo.leitner
2016-04-07 18:34 ` Marcelo Ricardo Leitner

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=d16e3f12f689f28d8c3b62c7c2a15916177bd7c0.1459829123.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).