1 // SPDX-License-Identifier: GPL-2.0-only
5 * An implementation of the DCCP protocol
6 * Arnaldo Carvalho de Melo <acme@mandriva.com>
10 #include <linux/sysctl.h>
15 #error This file should not be compiled without CONFIG_SYSCTL defined
19 static int u8_max
= 0xFF;
20 static unsigned long seqw_min
= DCCPF_SEQ_WMIN
,
21 seqw_max
= 0xFFFFFFFF; /* maximum on 32 bit */
23 static struct ctl_table dccp_default_table
[] = {
25 .procname
= "seq_window",
26 .data
= &sysctl_dccp_sequence_window
,
27 .maxlen
= sizeof(sysctl_dccp_sequence_window
),
29 .proc_handler
= proc_doulongvec_minmax
,
30 .extra1
= &seqw_min
, /* RFC 4340, 7.5.2 */
34 .procname
= "rx_ccid",
35 .data
= &sysctl_dccp_rx_ccid
,
36 .maxlen
= sizeof(sysctl_dccp_rx_ccid
),
38 .proc_handler
= proc_dointvec_minmax
,
39 .extra1
= SYSCTL_ZERO
,
40 .extra2
= &u8_max
, /* RFC 4340, 10. */
43 .procname
= "tx_ccid",
44 .data
= &sysctl_dccp_tx_ccid
,
45 .maxlen
= sizeof(sysctl_dccp_tx_ccid
),
47 .proc_handler
= proc_dointvec_minmax
,
48 .extra1
= SYSCTL_ZERO
,
49 .extra2
= &u8_max
, /* RFC 4340, 10. */
52 .procname
= "request_retries",
53 .data
= &sysctl_dccp_request_retries
,
54 .maxlen
= sizeof(sysctl_dccp_request_retries
),
56 .proc_handler
= proc_dointvec_minmax
,
61 .procname
= "retries1",
62 .data
= &sysctl_dccp_retries1
,
63 .maxlen
= sizeof(sysctl_dccp_retries1
),
65 .proc_handler
= proc_dointvec_minmax
,
66 .extra1
= SYSCTL_ZERO
,
70 .procname
= "retries2",
71 .data
= &sysctl_dccp_retries2
,
72 .maxlen
= sizeof(sysctl_dccp_retries2
),
74 .proc_handler
= proc_dointvec_minmax
,
75 .extra1
= SYSCTL_ZERO
,
79 .procname
= "tx_qlen",
80 .data
= &sysctl_dccp_tx_qlen
,
81 .maxlen
= sizeof(sysctl_dccp_tx_qlen
),
83 .proc_handler
= proc_dointvec_minmax
,
84 .extra1
= SYSCTL_ZERO
,
87 .procname
= "sync_ratelimit",
88 .data
= &sysctl_dccp_sync_ratelimit
,
89 .maxlen
= sizeof(sysctl_dccp_sync_ratelimit
),
91 .proc_handler
= proc_dointvec_ms_jiffies
,
97 static struct ctl_table_header
*dccp_table_header
;
99 int __init
dccp_sysctl_init(void)
101 dccp_table_header
= register_net_sysctl(&init_net
, "net/dccp/default",
104 return dccp_table_header
!= NULL
? 0 : -ENOMEM
;
107 void dccp_sysctl_exit(void)
109 if (dccp_table_header
!= NULL
) {
110 unregister_net_sysctl_table(dccp_table_header
);
111 dccp_table_header
= NULL
;