inet_diag: Introduce the inet socket dumping routine

The existing inet_csk_diag_fill dumps the inet connection sock info
into the netlink inet_diag_message. Prepare this routine to be able
to dump only the inet_sock part of a socket if the icsk part is missing.

This will be used by UDP diag module when dumping UDP sockets.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Pavel Emelyanov 2011-12-09 06:23:00 +00:00 committed by David S. Miller
parent 8d07d1518a
commit 3c4d05c805
2 changed files with 41 additions and 19 deletions

View file

@ -136,6 +136,8 @@ struct tcpvegas_info {
struct sock;
struct inet_hashinfo;
struct nlattr;
struct nlmsghdr;
struct sk_buff;
struct inet_diag_handler {
struct inet_hashinfo *idiag_hashinfo;
@ -145,6 +147,11 @@ struct inet_diag_handler {
__u16 idiag_type;
};
struct inet_connection_sock;
int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
struct sk_buff *skb, struct inet_diag_req *req,
u32 pid, u32 seq, u16 nlmsg_flags,
const struct nlmsghdr *unlh);
int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
int inet_diag_check_cookie(struct sock *sk, struct inet_diag_req *req);