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 <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Lorenzo Colitti
2013-05-31 15:05:49 +00:00
committed by David S. Miller
parent 17ef66afc0
commit 8cc785f6f4
2 changed files with 55 additions and 26 deletions

View File

@@ -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