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:

committed by
David S. Miller

parent
17ef66afc0
commit
8cc785f6f4
@@ -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
|
||||
|
Reference in New Issue
Block a user