|
@@ -35,6 +35,7 @@
|
|
#include <linux/proc_fs.h>
|
|
#include <linux/proc_fs.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
|
|
+#include <linux/sysctl.h>
|
|
#include <net/arp.h>
|
|
#include <net/arp.h>
|
|
#include <net/net_namespace.h>
|
|
#include <net/net_namespace.h>
|
|
|
|
|
|
@@ -634,6 +635,26 @@ struct net_device *alloc_trdev(int sizeof_priv)
|
|
return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
|
|
return alloc_netdev(sizeof_priv, "tr%d", tr_setup);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+#ifdef CONFIG_SYSCTL
|
|
|
|
+static struct ctl_table tr_table[] = {
|
|
|
|
+ {
|
|
|
|
+ .ctl_name = NET_TR_RIF_TIMEOUT,
|
|
|
|
+ .procname = "rif_timeout",
|
|
|
|
+ .data = &sysctl_tr_rif_timeout,
|
|
|
|
+ .maxlen = sizeof(int),
|
|
|
|
+ .mode = 0644,
|
|
|
|
+ .proc_handler = &proc_dointvec
|
|
|
|
+ },
|
|
|
|
+ { 0 },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+static __initdata struct ctl_path tr_path[] = {
|
|
|
|
+ { .procname = "net", .ctl_name = CTL_NET, },
|
|
|
|
+ { .procname = "token-ring", .ctl_name = NET_TR, },
|
|
|
|
+ { }
|
|
|
|
+};
|
|
|
|
+#endif
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Called during bootup. We don't actually have to initialise
|
|
* Called during bootup. We don't actually have to initialise
|
|
* too much for this.
|
|
* too much for this.
|
|
@@ -644,7 +665,9 @@ static int __init rif_init(void)
|
|
rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
|
|
rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
|
|
setup_timer(&rif_timer, rif_check_expire, 0);
|
|
setup_timer(&rif_timer, rif_check_expire, 0);
|
|
add_timer(&rif_timer);
|
|
add_timer(&rif_timer);
|
|
-
|
|
|
|
|
|
+#ifdef CONFIG_SYSCTL
|
|
|
|
+ register_sysctl_paths(tr_path, tr_table);
|
|
|
|
+#endif
|
|
proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
|
|
proc_net_fops_create(&init_net, "tr_rif", S_IRUGO, &rif_seq_fops);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|