ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / net / appletalk / sysctl_net_atalk.c
1 /*
2  * sysctl_net_atalk.c: sysctl interface to net AppleTalk subsystem.
3  *
4  * Begun April 1, 1996, Mike Shaver.
5  * Added /proc/sys/net/atalk directory entry (empty =) ). [MS]
6  * Dynamic registration, added aarp entries. (5/30/97 Chris Horn)
7  */
8
9 #include <linux/config.h>
10
11 #ifdef CONFIG_SYSCTL
12 #include <linux/sysctl.h>
13 extern int sysctl_aarp_expiry_time;
14 extern int sysctl_aarp_tick_time;
15 extern int sysctl_aarp_retransmit_limit;
16 extern int sysctl_aarp_resolve_time;
17
18 static struct ctl_table atalk_table[] = {
19         {
20                 .ctl_name       = NET_ATALK_AARP_EXPIRY_TIME,
21                 .procname       = "aarp-expiry-time",
22                 .data           = &sysctl_aarp_expiry_time,
23                 .maxlen         = sizeof(int),
24                 .mode           = 0644,
25                 .proc_handler   = &proc_dointvec_jiffies,
26                 .strategy       = &sysctl_jiffies,
27         },
28         {
29                 .ctl_name       = NET_ATALK_AARP_TICK_TIME,
30                 .procname       = "aarp-tick-time",
31                 .data           = &sysctl_aarp_tick_time,
32                 .maxlen         = sizeof(int),
33                 .mode           = 0644,
34                 .proc_handler   = &proc_dointvec_jiffies,
35                 .strategy       = &sysctl_jiffies,
36         },
37         {
38                 .ctl_name       = NET_ATALK_AARP_RETRANSMIT_LIMIT,
39                 .procname       = "aarp-retransmit-limit",
40                 .data           = &sysctl_aarp_retransmit_limit,
41                 .maxlen         = sizeof(int),
42                 .mode           = 0644,
43                 .proc_handler   = &proc_dointvec,
44         },
45         {
46                 .ctl_name       = NET_ATALK_AARP_RESOLVE_TIME,
47                 .procname       = "aarp-resolve-time",
48                 .data           = &sysctl_aarp_resolve_time,
49                 .maxlen         = sizeof(int),
50                 .mode           = 0644,
51                 .proc_handler   = &proc_dointvec_jiffies,
52                 .strategy       = &sysctl_jiffies,
53         },
54         { 0 },
55 };
56
57 static struct ctl_table atalk_dir_table[] = {
58         {
59                 .ctl_name       = NET_ATALK,
60                 .procname       = "appletalk",
61                 .mode           = 0555,
62                 .child          = atalk_table,
63         },
64         { 0 },
65 };
66
67 static struct ctl_table atalk_root_table[] = {
68         {
69                 .ctl_name       = CTL_NET,
70                 .procname       = "net",
71                 .mode           = 0555,
72                 .child          = atalk_dir_table,
73         },
74         { 0 },
75 };
76
77 static struct ctl_table_header *atalk_table_header;
78
79 void atalk_register_sysctl(void)
80 {
81         atalk_table_header = register_sysctl_table(atalk_root_table, 1);
82 }
83
84 void atalk_unregister_sysctl(void)
85 {
86         unregister_sysctl_table(atalk_table_header);
87 }
88
89 #else /* CONFIG_PROC_FS */
90 void atalk_register_sysctl(void)
91 {
92 }
93
94 void atalk_unregister_sysctl(void)
95 {
96 }
97 #endif /* CONFIG_PROC_FS */