Commit | Line | Data |
---|---|---|
e55d912f ACM |
1 | /* |
2 | * net/dccp/sysctl.c | |
3 | * | |
4 | * An implementation of the DCCP protocol | |
5 | * Arnaldo Carvalho de Melo <acme@mandriva.com> | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU General Public License v2 | |
9 | * as published by the Free Software Foundation. | |
10 | */ | |
11 | ||
e55d912f ACM |
12 | #include <linux/mm.h> |
13 | #include <linux/sysctl.h> | |
2e2e9e92 | 14 | #include "dccp.h" |
2a0109a7 | 15 | #include "feat.h" |
e55d912f ACM |
16 | |
17 | #ifndef CONFIG_SYSCTL | |
18 | #error This file should not be compiled without CONFIG_SYSCTL defined | |
19 | #endif | |
20 | ||
e55d912f ACM |
21 | static struct ctl_table dccp_default_table[] = { |
22 | { | |
e55d912f | 23 | .procname = "seq_window", |
afb0a34d GR |
24 | .data = &sysctl_dccp_feat_sequence_window, |
25 | .maxlen = sizeof(sysctl_dccp_feat_sequence_window), | |
e55d912f ACM |
26 | .mode = 0644, |
27 | .proc_handler = proc_dointvec, | |
28 | }, | |
29 | { | |
e55d912f | 30 | .procname = "rx_ccid", |
afb0a34d GR |
31 | .data = &sysctl_dccp_feat_rx_ccid, |
32 | .maxlen = sizeof(sysctl_dccp_feat_rx_ccid), | |
e55d912f ACM |
33 | .mode = 0644, |
34 | .proc_handler = proc_dointvec, | |
35 | }, | |
36 | { | |
e55d912f | 37 | .procname = "tx_ccid", |
afb0a34d GR |
38 | .data = &sysctl_dccp_feat_tx_ccid, |
39 | .maxlen = sizeof(sysctl_dccp_feat_tx_ccid), | |
e55d912f ACM |
40 | .mode = 0644, |
41 | .proc_handler = proc_dointvec, | |
42 | }, | |
e55d912f | 43 | { |
e55d912f | 44 | .procname = "send_ackvec", |
afb0a34d GR |
45 | .data = &sysctl_dccp_feat_send_ack_vector, |
46 | .maxlen = sizeof(sysctl_dccp_feat_send_ack_vector), | |
e55d912f ACM |
47 | .mode = 0644, |
48 | .proc_handler = proc_dointvec, | |
49 | }, | |
50 | { | |
e55d912f | 51 | .procname = "send_ndp", |
afb0a34d GR |
52 | .data = &sysctl_dccp_feat_send_ndp_count, |
53 | .maxlen = sizeof(sysctl_dccp_feat_send_ndp_count), | |
e55d912f ACM |
54 | .mode = 0644, |
55 | .proc_handler = proc_dointvec, | |
56 | }, | |
2e2e9e92 | 57 | { |
2e2e9e92 GR |
58 | .procname = "request_retries", |
59 | .data = &sysctl_dccp_request_retries, | |
60 | .maxlen = sizeof(sysctl_dccp_request_retries), | |
61 | .mode = 0644, | |
62 | .proc_handler = proc_dointvec, | |
63 | }, | |
64 | { | |
2e2e9e92 GR |
65 | .procname = "retries1", |
66 | .data = &sysctl_dccp_retries1, | |
67 | .maxlen = sizeof(sysctl_dccp_retries1), | |
68 | .mode = 0644, | |
69 | .proc_handler = proc_dointvec, | |
70 | }, | |
71 | { | |
2e2e9e92 GR |
72 | .procname = "retries2", |
73 | .data = &sysctl_dccp_retries2, | |
74 | .maxlen = sizeof(sysctl_dccp_retries2), | |
75 | .mode = 0644, | |
76 | .proc_handler = proc_dointvec, | |
77 | }, | |
82e3ab9d | 78 | { |
82e3ab9d IM |
79 | .procname = "tx_qlen", |
80 | .data = &sysctl_dccp_tx_qlen, | |
81 | .maxlen = sizeof(sysctl_dccp_tx_qlen), | |
82 | .mode = 0644, | |
83 | .proc_handler = proc_dointvec, | |
84 | }, | |
a94f0f97 GR |
85 | { |
86 | .procname = "sync_ratelimit", | |
87 | .data = &sysctl_dccp_sync_ratelimit, | |
88 | .maxlen = sizeof(sysctl_dccp_sync_ratelimit), | |
89 | .mode = 0644, | |
90 | .proc_handler = proc_dointvec_ms_jiffies, | |
91 | }, | |
82e3ab9d | 92 | |
e55d912f ACM |
93 | { .ctl_name = 0, } |
94 | }; | |
95 | ||
b5ccd792 PE |
96 | static struct ctl_path dccp_path[] = { |
97 | { .procname = "net", .ctl_name = CTL_NET, }, | |
98 | { .procname = "dccp", .ctl_name = NET_DCCP, }, | |
99 | { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, }, | |
100 | { } | |
e55d912f ACM |
101 | }; |
102 | ||
103 | static struct ctl_table_header *dccp_table_header; | |
104 | ||
105 | int __init dccp_sysctl_init(void) | |
106 | { | |
b5ccd792 PE |
107 | dccp_table_header = register_sysctl_paths(dccp_path, |
108 | dccp_default_table); | |
e55d912f ACM |
109 | |
110 | return dccp_table_header != NULL ? 0 : -ENOMEM; | |
111 | } | |
112 | ||
113 | void dccp_sysctl_exit(void) | |
114 | { | |
115 | if (dccp_table_header != NULL) { | |
116 | unregister_sysctl_table(dccp_table_header); | |
117 | dccp_table_header = NULL; | |
118 | } | |
119 | } |