From 8cc785f6f429c2a3fb81745dc142cbd72a462c4a Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Fri, 31 May 2013 15:05:49 +0000 Subject: net: ipv4: make the ping /proc code AF-independent Introduce a ping_seq_afinfo structure (similar to its UDP equivalent) and use it to make some of the ping /proc functions address-family independent. Rename the remaining ping /proc functions from ping_* to ping_v4_*. Compiles and displays reasonable results with CONFIG_IPV6={n,m,y} Signed-off-by: Lorenzo Colitti Signed-off-by: David S. Miller --- include/net/ping.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/net/ping.h') diff --git a/include/net/ping.h b/include/net/ping.h index 9242fa090d3d..b9282f019804 100644 --- a/include/net/ping.h +++ b/include/net/ping.h @@ -49,6 +49,7 @@ struct ping_table { struct ping_iter_state { struct seq_net_private p; int bucket; + sa_family_t family; }; extern struct proto ping_prot; @@ -87,6 +88,13 @@ int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); void ping_rcv(struct sk_buff *skb); #ifdef CONFIG_PROC_FS +struct ping_seq_afinfo { + char *name; + sa_family_t family; + const struct file_operations *seq_fops; + const struct seq_operations seq_ops; +}; + extern int __init ping_proc_init(void); extern void ping_proc_exit(void); #endif -- cgit v1.2.3