Commit 73c1f4a0 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[TCPDIAG]: Just rename everything to inet_diag

Next changeset will rename tcp_diag.[ch] to inet_diag.[ch].

I'm taking this longer route so as to easy review, making clear the changes
made all along the way.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f5736c4
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#define NETLINK_W1 1 /* 1-wire subsystem */ #define NETLINK_W1 1 /* 1-wire subsystem */
#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
#define NETLINK_FIREWALL 3 /* Firewalling hook */ #define NETLINK_FIREWALL 3 /* Firewalling hook */
#define NETLINK_TCPDIAG 4 /* TCP socket monitoring */ #define NETLINK_INET_DIAG 4 /* INET socket monitoring */
#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
#define NETLINK_XFRM 6 /* ipsec */ #define NETLINK_XFRM 6 /* ipsec */
#define NETLINK_SELINUX 7 /* SELinux event notifications */ #define NETLINK_SELINUX 7 /* SELinux event notifications */
......
#ifndef _TCP_DIAG_H_ #ifndef _INET_DIAG_H_
#define _TCP_DIAG_H_ 1 #define _INET_DIAG_H_ 1
/* Just some random number */ /* Just some random number */
#define TCPDIAG_GETSOCK 18 #define TCPDIAG_GETSOCK 18
...@@ -8,39 +8,36 @@ ...@@ -8,39 +8,36 @@
#define INET_DIAG_GETSOCK_MAX 24 #define INET_DIAG_GETSOCK_MAX 24
/* Socket identity */ /* Socket identity */
struct tcpdiag_sockid struct inet_diag_sockid {
{ __u16 idiag_sport;
__u16 tcpdiag_sport; __u16 idiag_dport;
__u16 tcpdiag_dport; __u32 idiag_src[4];
__u32 tcpdiag_src[4]; __u32 idiag_dst[4];
__u32 tcpdiag_dst[4]; __u32 idiag_if;
__u32 tcpdiag_if; __u32 idiag_cookie[2];
__u32 tcpdiag_cookie[2]; #define INET_DIAG_NOCOOKIE (~0U)
#define TCPDIAG_NOCOOKIE (~0U)
}; };
/* Request structure */ /* Request structure */
struct tcpdiagreq struct inet_diag_req {
{ __u8 idiag_family; /* Family of addresses. */
__u8 tcpdiag_family; /* Family of addresses. */ __u8 idiag_src_len;
__u8 tcpdiag_src_len; __u8 idiag_dst_len;
__u8 tcpdiag_dst_len; __u8 idiag_ext; /* Query extended information */
__u8 tcpdiag_ext; /* Query extended information */
struct tcpdiag_sockid id; struct inet_diag_sockid id;
__u32 tcpdiag_states; /* States to dump */ __u32 idiag_states; /* States to dump */
__u32 tcpdiag_dbs; /* Tables to dump (NI) */ __u32 idiag_dbs; /* Tables to dump (NI) */
}; };
enum enum {
{ INET_DIAG_REQ_NONE,
TCPDIAG_REQ_NONE, INET_DIAG_REQ_BYTECODE,
TCPDIAG_REQ_BYTECODE,
}; };
#define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE #define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE
/* Bytecode is sequence of 4 byte commands followed by variable arguments. /* Bytecode is sequence of 4 byte commands followed by variable arguments.
* All the commands identified by "code" are conditional jumps forward: * All the commands identified by "code" are conditional jumps forward:
...@@ -48,28 +45,25 @@ enum ...@@ -48,28 +45,25 @@ enum
* length of the command and its arguments. * length of the command and its arguments.
*/ */
struct tcpdiag_bc_op struct inet_diag_bc_op {
{
unsigned char code; unsigned char code;
unsigned char yes; unsigned char yes;
unsigned short no; unsigned short no;
}; };
enum enum {
{ INET_DIAG_BC_NOP,
TCPDIAG_BC_NOP, INET_DIAG_BC_JMP,
TCPDIAG_BC_JMP, INET_DIAG_BC_S_GE,
TCPDIAG_BC_S_GE, INET_DIAG_BC_S_LE,
TCPDIAG_BC_S_LE, INET_DIAG_BC_D_GE,
TCPDIAG_BC_D_GE, INET_DIAG_BC_D_LE,
TCPDIAG_BC_D_LE, INET_DIAG_BC_AUTO,
TCPDIAG_BC_AUTO, INET_DIAG_BC_S_COND,
TCPDIAG_BC_S_COND, INET_DIAG_BC_D_COND,
TCPDIAG_BC_D_COND,
}; };
struct tcpdiag_hostcond struct inet_diag_hostcond {
{
__u8 family; __u8 family;
__u8 prefix_len; __u8 prefix_len;
int port; int port;
...@@ -78,47 +72,44 @@ struct tcpdiag_hostcond ...@@ -78,47 +72,44 @@ struct tcpdiag_hostcond
/* Base info structure. It contains socket identity (addrs/ports/cookie) /* Base info structure. It contains socket identity (addrs/ports/cookie)
* and, alas, the information shown by netstat. */ * and, alas, the information shown by netstat. */
struct tcpdiagmsg struct inet_diag_msg {
{ __u8 idiag_family;
__u8 tcpdiag_family; __u8 idiag_state;
__u8 tcpdiag_state; __u8 idiag_timer;
__u8 tcpdiag_timer; __u8 idiag_retrans;
__u8 tcpdiag_retrans;
struct inet_diag_sockid id;
struct tcpdiag_sockid id;
__u32 idiag_expires;
__u32 tcpdiag_expires; __u32 idiag_rqueue;
__u32 tcpdiag_rqueue; __u32 idiag_wqueue;
__u32 tcpdiag_wqueue; __u32 idiag_uid;
__u32 tcpdiag_uid; __u32 idiag_inode;
__u32 tcpdiag_inode;
}; };
/* Extensions */ /* Extensions */
enum enum {
{ INET_DIAG_NONE,
TCPDIAG_NONE, INET_DIAG_MEMINFO,
TCPDIAG_MEMINFO, INET_DIAG_INFO,
TCPDIAG_INFO, INET_DIAG_VEGASINFO,
TCPDIAG_VEGASINFO, INET_DIAG_CONG,
TCPDIAG_CONG,
}; };
#define TCPDIAG_MAX TCPDIAG_CONG #define INET_DIAG_MAX INET_DIAG_CONG
/* TCPDIAG_MEM */ /* INET_DIAG_MEM */
struct tcpdiag_meminfo struct inet_diag_meminfo {
{ __u32 idiag_rmem;
__u32 tcpdiag_rmem; __u32 idiag_wmem;
__u32 tcpdiag_wmem; __u32 idiag_fmem;
__u32 tcpdiag_fmem; __u32 idiag_tmem;
__u32 tcpdiag_tmem;
}; };
/* TCPDIAG_VEGASINFO */ /* INET_DIAG_VEGASINFO */
struct tcpvegas_info { struct tcpvegas_info {
__u32 tcpv_enabled; __u32 tcpv_enabled;
...@@ -134,7 +125,7 @@ struct inet_hashinfo; ...@@ -134,7 +125,7 @@ struct inet_hashinfo;
struct inet_diag_handler { struct inet_diag_handler {
struct inet_hashinfo *idiag_hashinfo; struct inet_hashinfo *idiag_hashinfo;
void (*idiag_get_info)(struct sock *sk, void (*idiag_get_info)(struct sock *sk,
struct tcpdiagmsg *r, struct inet_diag_msg *r,
void *info); void *info);
__u16 idiag_info_size; __u16 idiag_info_size;
__u16 idiag_type; __u16 idiag_type;
...@@ -144,4 +135,4 @@ extern int inet_diag_register(const struct inet_diag_handler *handler); ...@@ -144,4 +135,4 @@ extern int inet_diag_register(const struct inet_diag_handler *handler);
extern void inet_diag_unregister(const struct inet_diag_handler *handler); extern void inet_diag_unregister(const struct inet_diag_handler *handler);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _TCP_DIAG_H_ */ #endif /* _INET_DIAG_H_ */
...@@ -690,7 +690,7 @@ struct tcp_congestion_ops { ...@@ -690,7 +690,7 @@ struct tcp_congestion_ops {
u32 (*undo_cwnd)(struct sock *sk); u32 (*undo_cwnd)(struct sock *sk);
/* hook for packet ack accounting (optional) */ /* hook for packet ack accounting (optional) */
void (*pkts_acked)(struct sock *sk, u32 num_acked); void (*pkts_acked)(struct sock *sk, u32 num_acked);
/* get info for tcp_diag (optional) */ /* get info for inet_diag (optional) */
void (*get_info)(struct sock *sk, u32 ext, struct sk_buff *skb); void (*get_info)(struct sock *sk, u32 ext, struct sk_buff *skb);
char name[TCP_CA_NAME_MAX]; char name[TCP_CA_NAME_MAX];
......
...@@ -20,8 +20,8 @@ config IP_DCCP ...@@ -20,8 +20,8 @@ config IP_DCCP
If in doubt, say N. If in doubt, say N.
config IP_DCCP_DIAG config IP_DCCP_DIAG
depends on IP_DCCP && IP_TCPDIAG depends on IP_DCCP && IP_INET_DIAG
def_tristate y if (IP_DCCP = y && IP_TCPDIAG = y) def_tristate y if (IP_DCCP = y && IP_INET_DIAG = y)
def_tristate m def_tristate m
source "net/dccp/ccids/Kconfig" source "net/dccp/ccids/Kconfig"
......
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
#include "dccp.h" #include "dccp.h"
static void dccp_diag_get_info(struct sock *sk, struct tcpdiagmsg *r, static void dccp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
void *_info) void *_info)
{ {
r->tcpdiag_rqueue = r->tcpdiag_wqueue = 0; r->idiag_rqueue = r->idiag_wqueue = 0;
} }
static struct inet_diag_handler dccp_diag_handler = { static struct inet_diag_handler dccp_diag_handler = {
......
...@@ -413,13 +413,13 @@ config INET_TUNNEL ...@@ -413,13 +413,13 @@ config INET_TUNNEL
If unsure, say Y. If unsure, say Y.
config IP_TCPDIAG config IP_INET_DIAG
tristate "IP: TCP socket monitoring interface" tristate "IP: INET socket monitoring interface"
default y default y
---help--- ---help---
Support for TCP socket monitoring interface used by native Linux Support for INET (TCP, DCCP, etc) socket monitoring interface used by
tools such as ss. ss is included in iproute2, currently downloadable native Linux tools such as ss. ss is included in iproute2, currently
at <http://developer.osdl.org/dev/iproute2>. downloadable at <http://developer.osdl.org/dev/iproute2>.
If unsure, say Y. If unsure, say Y.
......
...@@ -30,7 +30,7 @@ obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o ...@@ -30,7 +30,7 @@ obj-$(CONFIG_IP_ROUTE_MULTIPATH_WRANDOM) += multipath_wrandom.o
obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o obj-$(CONFIG_IP_ROUTE_MULTIPATH_DRR) += multipath_drr.o
obj-$(CONFIG_NETFILTER) += netfilter/ obj-$(CONFIG_NETFILTER) += netfilter/
obj-$(CONFIG_IP_VS) += ipvs/ obj-$(CONFIG_IP_VS) += ipvs/
obj-$(CONFIG_IP_TCPDIAG) += tcp_diag.o obj-$(CONFIG_IP_INET_DIAG) += tcp_diag.o
obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o obj-$(CONFIG_IP_ROUTE_MULTIPATH_CACHED) += multipath.o
obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o obj-$(CONFIG_TCP_CONG_BIC) += tcp_bic.o
obj-$(CONFIG_TCP_CONG_WESTWOOD) += tcp_westwood.o obj-$(CONFIG_TCP_CONG_WESTWOOD) += tcp_westwood.o
......
This diff is collapsed.
...@@ -365,10 +365,10 @@ static void tcp_vegas_get_info(struct sock *sk, u32 ext, ...@@ -365,10 +365,10 @@ static void tcp_vegas_get_info(struct sock *sk, u32 ext,
struct sk_buff *skb) struct sk_buff *skb)
{ {
const struct vegas *ca = inet_csk_ca(sk); const struct vegas *ca = inet_csk_ca(sk);
if (ext & (1<<(TCPDIAG_VEGASINFO-1))) { if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
struct tcpvegas_info *info; struct tcpvegas_info *info;
info = RTA_DATA(__RTA_PUT(skb, TCPDIAG_VEGASINFO, info = RTA_DATA(__RTA_PUT(skb, INET_DIAG_VEGASINFO,
sizeof(*info))); sizeof(*info)));
info->tcpv_enabled = ca->doing_vegas_now; info->tcpv_enabled = ca->doing_vegas_now;
......
...@@ -216,11 +216,11 @@ static void tcp_westwood_info(struct sock *sk, u32 ext, ...@@ -216,11 +216,11 @@ static void tcp_westwood_info(struct sock *sk, u32 ext,
struct sk_buff *skb) struct sk_buff *skb)
{ {
const struct westwood *ca = inet_csk_ca(sk); const struct westwood *ca = inet_csk_ca(sk);
if (ext & (1<<(TCPDIAG_VEGASINFO-1))) { if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
struct rtattr *rta; struct rtattr *rta;
struct tcpvegas_info *info; struct tcpvegas_info *info;
rta = __RTA_PUT(skb, TCPDIAG_VEGASINFO, sizeof(*info)); rta = __RTA_PUT(skb, INET_DIAG_VEGASINFO, sizeof(*info));
info = RTA_DATA(rta); info = RTA_DATA(rta);
info->tcpv_enabled = 1; info->tcpv_enabled = 1;
info->tcpv_rttcnt = 0; info->tcpv_rttcnt = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment