Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 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 | |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 12 | #include <linux/mm.h> |
| 13 | #include <linux/sysctl.h> |
Gerrit Renker | 2e2e9e9 | 2006-11-13 13:23:52 -0200 | [diff] [blame] | 14 | #include "dccp.h" |
Ian McDonald | 2a0109a | 2006-08-26 19:15:35 -0700 | [diff] [blame] | 15 | #include "feat.h" |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 16 | |
| 17 | #ifndef CONFIG_SYSCTL |
| 18 | #error This file should not be compiled without CONFIG_SYSCTL defined |
| 19 | #endif |
| 20 | |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 21 | static struct ctl_table dccp_default_table[] = { |
| 22 | { |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 23 | .procname = "seq_window", |
Gerrit Renker | afb0a34d | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 24 | .data = &sysctl_dccp_feat_sequence_window, |
| 25 | .maxlen = sizeof(sysctl_dccp_feat_sequence_window), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 26 | .mode = 0644, |
| 27 | .proc_handler = proc_dointvec, |
| 28 | }, |
| 29 | { |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 30 | .procname = "rx_ccid", |
Gerrit Renker | afb0a34d | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 31 | .data = &sysctl_dccp_feat_rx_ccid, |
| 32 | .maxlen = sizeof(sysctl_dccp_feat_rx_ccid), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 33 | .mode = 0644, |
| 34 | .proc_handler = proc_dointvec, |
| 35 | }, |
| 36 | { |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 37 | .procname = "tx_ccid", |
Gerrit Renker | afb0a34d | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 38 | .data = &sysctl_dccp_feat_tx_ccid, |
| 39 | .maxlen = sizeof(sysctl_dccp_feat_tx_ccid), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 40 | .mode = 0644, |
| 41 | .proc_handler = proc_dointvec, |
| 42 | }, |
| 43 | { |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 44 | .procname = "ack_ratio", |
Gerrit Renker | afb0a34d | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 45 | .data = &sysctl_dccp_feat_ack_ratio, |
| 46 | .maxlen = sizeof(sysctl_dccp_feat_ack_ratio), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 47 | .mode = 0644, |
| 48 | .proc_handler = proc_dointvec, |
| 49 | }, |
| 50 | { |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 51 | .procname = "send_ackvec", |
Gerrit Renker | afb0a34d | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 52 | .data = &sysctl_dccp_feat_send_ack_vector, |
| 53 | .maxlen = sizeof(sysctl_dccp_feat_send_ack_vector), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 54 | .mode = 0644, |
| 55 | .proc_handler = proc_dointvec, |
| 56 | }, |
| 57 | { |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 58 | .procname = "send_ndp", |
Gerrit Renker | afb0a34d | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 59 | .data = &sysctl_dccp_feat_send_ndp_count, |
| 60 | .maxlen = sizeof(sysctl_dccp_feat_send_ndp_count), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 61 | .mode = 0644, |
| 62 | .proc_handler = proc_dointvec, |
| 63 | }, |
Gerrit Renker | 2e2e9e9 | 2006-11-13 13:23:52 -0200 | [diff] [blame] | 64 | { |
Gerrit Renker | 2e2e9e9 | 2006-11-13 13:23:52 -0200 | [diff] [blame] | 65 | .procname = "request_retries", |
| 66 | .data = &sysctl_dccp_request_retries, |
| 67 | .maxlen = sizeof(sysctl_dccp_request_retries), |
| 68 | .mode = 0644, |
| 69 | .proc_handler = proc_dointvec, |
| 70 | }, |
| 71 | { |
Gerrit Renker | 2e2e9e9 | 2006-11-13 13:23:52 -0200 | [diff] [blame] | 72 | .procname = "retries1", |
| 73 | .data = &sysctl_dccp_retries1, |
| 74 | .maxlen = sizeof(sysctl_dccp_retries1), |
| 75 | .mode = 0644, |
| 76 | .proc_handler = proc_dointvec, |
| 77 | }, |
| 78 | { |
Gerrit Renker | 2e2e9e9 | 2006-11-13 13:23:52 -0200 | [diff] [blame] | 79 | .procname = "retries2", |
| 80 | .data = &sysctl_dccp_retries2, |
| 81 | .maxlen = sizeof(sysctl_dccp_retries2), |
| 82 | .mode = 0644, |
| 83 | .proc_handler = proc_dointvec, |
| 84 | }, |
Ian McDonald | 82e3ab9 | 2006-11-20 19:19:32 -0200 | [diff] [blame] | 85 | { |
Ian McDonald | 82e3ab9 | 2006-11-20 19:19:32 -0200 | [diff] [blame] | 86 | .procname = "tx_qlen", |
| 87 | .data = &sysctl_dccp_tx_qlen, |
| 88 | .maxlen = sizeof(sysctl_dccp_tx_qlen), |
| 89 | .mode = 0644, |
| 90 | .proc_handler = proc_dointvec, |
| 91 | }, |
Gerrit Renker | a94f0f9 | 2007-09-26 11:31:49 -0300 | [diff] [blame] | 92 | { |
| 93 | .procname = "sync_ratelimit", |
| 94 | .data = &sysctl_dccp_sync_ratelimit, |
| 95 | .maxlen = sizeof(sysctl_dccp_sync_ratelimit), |
| 96 | .mode = 0644, |
| 97 | .proc_handler = proc_dointvec_ms_jiffies, |
| 98 | }, |
Ian McDonald | 82e3ab9 | 2006-11-20 19:19:32 -0200 | [diff] [blame] | 99 | |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 100 | { .ctl_name = 0, } |
| 101 | }; |
| 102 | |
| 103 | static struct ctl_table dccp_table[] = { |
| 104 | { |
| 105 | .ctl_name = NET_DCCP_DEFAULT, |
| 106 | .procname = "default", |
| 107 | .mode = 0555, |
| 108 | .child = dccp_default_table, |
| 109 | }, |
| 110 | { .ctl_name = 0, }, |
| 111 | }; |
| 112 | |
| 113 | static struct ctl_table dccp_dir_table[] = { |
| 114 | { |
| 115 | .ctl_name = NET_DCCP, |
| 116 | .procname = "dccp", |
| 117 | .mode = 0555, |
| 118 | .child = dccp_table, |
| 119 | }, |
| 120 | { .ctl_name = 0, }, |
| 121 | }; |
| 122 | |
| 123 | static struct ctl_table dccp_root_table[] = { |
| 124 | { |
| 125 | .ctl_name = CTL_NET, |
| 126 | .procname = "net", |
| 127 | .mode = 0555, |
| 128 | .child = dccp_dir_table, |
| 129 | }, |
| 130 | { .ctl_name = 0, }, |
| 131 | }; |
| 132 | |
| 133 | static struct ctl_table_header *dccp_table_header; |
| 134 | |
| 135 | int __init dccp_sysctl_init(void) |
| 136 | { |
Eric W. Biederman | 0b4d414 | 2007-02-14 00:34:09 -0800 | [diff] [blame] | 137 | dccp_table_header = register_sysctl_table(dccp_root_table); |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 138 | |
| 139 | return dccp_table_header != NULL ? 0 : -ENOMEM; |
| 140 | } |
| 141 | |
| 142 | void dccp_sysctl_exit(void) |
| 143 | { |
| 144 | if (dccp_table_header != NULL) { |
| 145 | unregister_sysctl_table(dccp_table_header); |
| 146 | dccp_table_header = NULL; |
| 147 | } |
| 148 | } |