2019-05-31 08:09:47 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2006-03-21 03:25:02 +00:00
|
|
|
/*
|
|
|
|
* net/dccp/sysctl.c
|
|
|
|
*
|
|
|
|
* An implementation of the DCCP protocol
|
|
|
|
* Arnaldo Carvalho de Melo <acme@mandriva.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/sysctl.h>
|
2006-11-13 15:23:52 +00:00
|
|
|
#include "dccp.h"
|
2006-08-27 02:15:35 +00:00
|
|
|
#include "feat.h"
|
2006-03-21 03:25:02 +00:00
|
|
|
|
|
|
|
#ifndef CONFIG_SYSCTL
|
|
|
|
#error This file should not be compiled without CONFIG_SYSCTL defined
|
|
|
|
#endif
|
|
|
|
|
2009-01-16 23:36:32 +00:00
|
|
|
/* Boundary values */
|
|
|
|
static int zero = 0,
|
2014-05-13 02:57:58 +00:00
|
|
|
one = 1,
|
2009-01-16 23:36:32 +00:00
|
|
|
u8_max = 0xFF;
|
2011-01-02 17:15:58 +00:00
|
|
|
static unsigned long seqw_min = DCCPF_SEQ_WMIN,
|
|
|
|
seqw_max = 0xFFFFFFFF; /* maximum on 32 bit */
|
2009-01-16 23:36:32 +00:00
|
|
|
|
2006-03-21 03:25:02 +00:00
|
|
|
static struct ctl_table dccp_default_table[] = {
|
|
|
|
{
|
|
|
|
.procname = "seq_window",
|
2009-01-16 23:36:32 +00:00
|
|
|
.data = &sysctl_dccp_sequence_window,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_sequence_window),
|
2006-03-21 03:25:02 +00:00
|
|
|
.mode = 0644,
|
2009-01-16 23:36:32 +00:00
|
|
|
.proc_handler = proc_doulongvec_minmax,
|
|
|
|
.extra1 = &seqw_min, /* RFC 4340, 7.5.2 */
|
2011-01-02 17:15:58 +00:00
|
|
|
.extra2 = &seqw_max,
|
2006-03-21 03:25:02 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.procname = "rx_ccid",
|
2009-01-16 23:36:32 +00:00
|
|
|
.data = &sysctl_dccp_rx_ccid,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_rx_ccid),
|
2006-03-21 03:25:02 +00:00
|
|
|
.mode = 0644,
|
2009-01-16 23:36:32 +00:00
|
|
|
.proc_handler = proc_dointvec_minmax,
|
|
|
|
.extra1 = &zero,
|
|
|
|
.extra2 = &u8_max, /* RFC 4340, 10. */
|
2006-03-21 03:25:02 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.procname = "tx_ccid",
|
2009-01-16 23:36:32 +00:00
|
|
|
.data = &sysctl_dccp_tx_ccid,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_tx_ccid),
|
2006-03-21 03:25:02 +00:00
|
|
|
.mode = 0644,
|
2009-01-16 23:36:32 +00:00
|
|
|
.proc_handler = proc_dointvec_minmax,
|
|
|
|
.extra1 = &zero,
|
|
|
|
.extra2 = &u8_max, /* RFC 4340, 10. */
|
2006-03-21 03:25:02 +00:00
|
|
|
},
|
2006-11-13 15:23:52 +00:00
|
|
|
{
|
|
|
|
.procname = "request_retries",
|
|
|
|
.data = &sysctl_dccp_request_retries,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_request_retries),
|
|
|
|
.mode = 0644,
|
2009-01-16 23:36:32 +00:00
|
|
|
.proc_handler = proc_dointvec_minmax,
|
2014-05-13 02:57:58 +00:00
|
|
|
.extra1 = &one,
|
2009-01-16 23:36:32 +00:00
|
|
|
.extra2 = &u8_max,
|
2006-11-13 15:23:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.procname = "retries1",
|
|
|
|
.data = &sysctl_dccp_retries1,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_retries1),
|
|
|
|
.mode = 0644,
|
2009-01-16 23:36:32 +00:00
|
|
|
.proc_handler = proc_dointvec_minmax,
|
|
|
|
.extra1 = &zero,
|
|
|
|
.extra2 = &u8_max,
|
2006-11-13 15:23:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
.procname = "retries2",
|
|
|
|
.data = &sysctl_dccp_retries2,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_retries2),
|
|
|
|
.mode = 0644,
|
2009-01-16 23:36:32 +00:00
|
|
|
.proc_handler = proc_dointvec_minmax,
|
|
|
|
.extra1 = &zero,
|
|
|
|
.extra2 = &u8_max,
|
2006-11-13 15:23:52 +00:00
|
|
|
},
|
2006-11-20 21:19:32 +00:00
|
|
|
{
|
|
|
|
.procname = "tx_qlen",
|
|
|
|
.data = &sysctl_dccp_tx_qlen,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_tx_qlen),
|
|
|
|
.mode = 0644,
|
2009-01-16 23:36:32 +00:00
|
|
|
.proc_handler = proc_dointvec_minmax,
|
|
|
|
.extra1 = &zero,
|
2006-11-20 21:19:32 +00:00
|
|
|
},
|
2007-09-26 14:31:49 +00:00
|
|
|
{
|
|
|
|
.procname = "sync_ratelimit",
|
|
|
|
.data = &sysctl_dccp_sync_ratelimit,
|
|
|
|
.maxlen = sizeof(sysctl_dccp_sync_ratelimit),
|
|
|
|
.mode = 0644,
|
|
|
|
.proc_handler = proc_dointvec_ms_jiffies,
|
|
|
|
},
|
2006-11-20 21:19:32 +00:00
|
|
|
|
2009-11-05 21:32:03 +00:00
|
|
|
{ }
|
2006-03-21 03:25:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct ctl_table_header *dccp_table_header;
|
|
|
|
|
|
|
|
int __init dccp_sysctl_init(void)
|
|
|
|
{
|
2012-04-19 13:44:49 +00:00
|
|
|
dccp_table_header = register_net_sysctl(&init_net, "net/dccp/default",
|
2008-01-09 08:30:05 +00:00
|
|
|
dccp_default_table);
|
2006-03-21 03:25:02 +00:00
|
|
|
|
|
|
|
return dccp_table_header != NULL ? 0 : -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
void dccp_sysctl_exit(void)
|
|
|
|
{
|
|
|
|
if (dccp_table_header != NULL) {
|
2012-04-19 13:24:33 +00:00
|
|
|
unregister_net_sysctl_table(dccp_table_header);
|
2006-03-21 03:25:02 +00:00
|
|
|
dccp_table_header = NULL;
|
|
|
|
}
|
|
|
|
}
|