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 | { |
| 23 | .ctl_name = NET_DCCP_DEFAULT_SEQ_WINDOW, |
| 24 | .procname = "seq_window", |
Gerrit Renker | afb0a34 | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 25 | .data = &sysctl_dccp_feat_sequence_window, |
| 26 | .maxlen = sizeof(sysctl_dccp_feat_sequence_window), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 27 | .mode = 0644, |
| 28 | .proc_handler = proc_dointvec, |
| 29 | }, |
| 30 | { |
| 31 | .ctl_name = NET_DCCP_DEFAULT_RX_CCID, |
| 32 | .procname = "rx_ccid", |
Gerrit Renker | afb0a34 | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 33 | .data = &sysctl_dccp_feat_rx_ccid, |
| 34 | .maxlen = sizeof(sysctl_dccp_feat_rx_ccid), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 35 | .mode = 0644, |
| 36 | .proc_handler = proc_dointvec, |
| 37 | }, |
| 38 | { |
| 39 | .ctl_name = NET_DCCP_DEFAULT_TX_CCID, |
| 40 | .procname = "tx_ccid", |
Gerrit Renker | afb0a34 | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 41 | .data = &sysctl_dccp_feat_tx_ccid, |
| 42 | .maxlen = sizeof(sysctl_dccp_feat_tx_ccid), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 43 | .mode = 0644, |
| 44 | .proc_handler = proc_dointvec, |
| 45 | }, |
| 46 | { |
| 47 | .ctl_name = NET_DCCP_DEFAULT_ACK_RATIO, |
| 48 | .procname = "ack_ratio", |
Gerrit Renker | afb0a34 | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 49 | .data = &sysctl_dccp_feat_ack_ratio, |
| 50 | .maxlen = sizeof(sysctl_dccp_feat_ack_ratio), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 51 | .mode = 0644, |
| 52 | .proc_handler = proc_dointvec, |
| 53 | }, |
| 54 | { |
| 55 | .ctl_name = NET_DCCP_DEFAULT_SEND_ACKVEC, |
| 56 | .procname = "send_ackvec", |
Gerrit Renker | afb0a34 | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 57 | .data = &sysctl_dccp_feat_send_ack_vector, |
| 58 | .maxlen = sizeof(sysctl_dccp_feat_send_ack_vector), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 59 | .mode = 0644, |
| 60 | .proc_handler = proc_dointvec, |
| 61 | }, |
| 62 | { |
| 63 | .ctl_name = NET_DCCP_DEFAULT_SEND_NDP, |
| 64 | .procname = "send_ndp", |
Gerrit Renker | afb0a34 | 2006-11-13 13:25:41 -0200 | [diff] [blame] | 65 | .data = &sysctl_dccp_feat_send_ndp_count, |
| 66 | .maxlen = sizeof(sysctl_dccp_feat_send_ndp_count), |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 67 | .mode = 0644, |
| 68 | .proc_handler = proc_dointvec, |
| 69 | }, |
Gerrit Renker | 2e2e9e9 | 2006-11-13 13:23:52 -0200 | [diff] [blame] | 70 | { |
| 71 | .ctl_name = NET_DCCP_DEFAULT_REQ_RETRIES, |
| 72 | .procname = "request_retries", |
| 73 | .data = &sysctl_dccp_request_retries, |
| 74 | .maxlen = sizeof(sysctl_dccp_request_retries), |
| 75 | .mode = 0644, |
| 76 | .proc_handler = proc_dointvec, |
| 77 | }, |
| 78 | { |
| 79 | .ctl_name = NET_DCCP_DEFAULT_RETRIES1, |
| 80 | .procname = "retries1", |
| 81 | .data = &sysctl_dccp_retries1, |
| 82 | .maxlen = sizeof(sysctl_dccp_retries1), |
| 83 | .mode = 0644, |
| 84 | .proc_handler = proc_dointvec, |
| 85 | }, |
| 86 | { |
| 87 | .ctl_name = NET_DCCP_DEFAULT_RETRIES2, |
| 88 | .procname = "retries2", |
| 89 | .data = &sysctl_dccp_retries2, |
| 90 | .maxlen = sizeof(sysctl_dccp_retries2), |
| 91 | .mode = 0644, |
| 92 | .proc_handler = proc_dointvec, |
| 93 | }, |
Ian McDonald | 82e3ab9 | 2006-11-20 19:19:32 -0200 | [diff] [blame^] | 94 | { |
| 95 | .ctl_name = NET_DCCP_DEFAULT_TX_QLEN, |
| 96 | .procname = "tx_qlen", |
| 97 | .data = &sysctl_dccp_tx_qlen, |
| 98 | .maxlen = sizeof(sysctl_dccp_tx_qlen), |
| 99 | .mode = 0644, |
| 100 | .proc_handler = proc_dointvec, |
| 101 | }, |
| 102 | |
Arnaldo Carvalho de Melo | e55d912 | 2006-03-20 19:25:02 -0800 | [diff] [blame] | 103 | { .ctl_name = 0, } |
| 104 | }; |
| 105 | |
| 106 | static struct ctl_table dccp_table[] = { |
| 107 | { |
| 108 | .ctl_name = NET_DCCP_DEFAULT, |
| 109 | .procname = "default", |
| 110 | .mode = 0555, |
| 111 | .child = dccp_default_table, |
| 112 | }, |
| 113 | { .ctl_name = 0, }, |
| 114 | }; |
| 115 | |
| 116 | static struct ctl_table dccp_dir_table[] = { |
| 117 | { |
| 118 | .ctl_name = NET_DCCP, |
| 119 | .procname = "dccp", |
| 120 | .mode = 0555, |
| 121 | .child = dccp_table, |
| 122 | }, |
| 123 | { .ctl_name = 0, }, |
| 124 | }; |
| 125 | |
| 126 | static struct ctl_table dccp_root_table[] = { |
| 127 | { |
| 128 | .ctl_name = CTL_NET, |
| 129 | .procname = "net", |
| 130 | .mode = 0555, |
| 131 | .child = dccp_dir_table, |
| 132 | }, |
| 133 | { .ctl_name = 0, }, |
| 134 | }; |
| 135 | |
| 136 | static struct ctl_table_header *dccp_table_header; |
| 137 | |
| 138 | int __init dccp_sysctl_init(void) |
| 139 | { |
| 140 | dccp_table_header = register_sysctl_table(dccp_root_table, 1); |
| 141 | |
| 142 | return dccp_table_header != NULL ? 0 : -ENOMEM; |
| 143 | } |
| 144 | |
| 145 | void dccp_sysctl_exit(void) |
| 146 | { |
| 147 | if (dccp_table_header != NULL) { |
| 148 | unregister_sysctl_table(dccp_table_header); |
| 149 | dccp_table_header = NULL; |
| 150 | } |
| 151 | } |