Blame view
net/dccp/sysctl.c
2.78 KB
e55d912f5 [DCCP] feat: Intr... |
1 2 3 4 5 6 7 8 9 10 |
/* * net/dccp/sysctl.c * * An implementation of the DCCP protocol * Arnaldo Carvalho de Melo <acme@mandriva.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License v2 * as published by the Free Software Foundation. */ |
e55d912f5 [DCCP] feat: Intr... |
11 12 |
#include <linux/mm.h> #include <linux/sysctl.h> |
2e2e9e92b [DCCP]: Add sysct... |
13 |
#include "dccp.h" |
2a0109a70 [DCCP]: Shift sys... |
14 |
#include "feat.h" |
e55d912f5 [DCCP] feat: Intr... |
15 16 17 18 |
#ifndef CONFIG_SYSCTL #error This file should not be compiled without CONFIG_SYSCTL defined #endif |
883ca833e dccp: Initialisat... |
19 20 |
/* Boundary values */ static int zero = 0, |
8ba7e7bfc dccp: make the re... |
21 |
one = 1, |
883ca833e dccp: Initialisat... |
22 |
u8_max = 0xFF; |
bfbb23466 dccp: make upper ... |
23 24 |
static unsigned long seqw_min = DCCPF_SEQ_WMIN, seqw_max = 0xFFFFFFFF; /* maximum on 32 bit */ |
883ca833e dccp: Initialisat... |
25 |
|
e55d912f5 [DCCP] feat: Intr... |
26 27 |
static struct ctl_table dccp_default_table[] = { { |
e55d912f5 [DCCP] feat: Intr... |
28 |
.procname = "seq_window", |
883ca833e dccp: Initialisat... |
29 30 |
.data = &sysctl_dccp_sequence_window, .maxlen = sizeof(sysctl_dccp_sequence_window), |
e55d912f5 [DCCP] feat: Intr... |
31 |
.mode = 0644, |
883ca833e dccp: Initialisat... |
32 33 |
.proc_handler = proc_doulongvec_minmax, .extra1 = &seqw_min, /* RFC 4340, 7.5.2 */ |
bfbb23466 dccp: make upper ... |
34 |
.extra2 = &seqw_max, |
e55d912f5 [DCCP] feat: Intr... |
35 36 |
}, { |
e55d912f5 [DCCP] feat: Intr... |
37 |
.procname = "rx_ccid", |
883ca833e dccp: Initialisat... |
38 39 |
.data = &sysctl_dccp_rx_ccid, .maxlen = sizeof(sysctl_dccp_rx_ccid), |
e55d912f5 [DCCP] feat: Intr... |
40 |
.mode = 0644, |
883ca833e dccp: Initialisat... |
41 42 43 |
.proc_handler = proc_dointvec_minmax, .extra1 = &zero, .extra2 = &u8_max, /* RFC 4340, 10. */ |
e55d912f5 [DCCP] feat: Intr... |
44 45 |
}, { |
e55d912f5 [DCCP] feat: Intr... |
46 |
.procname = "tx_ccid", |
883ca833e dccp: Initialisat... |
47 48 |
.data = &sysctl_dccp_tx_ccid, .maxlen = sizeof(sysctl_dccp_tx_ccid), |
e55d912f5 [DCCP] feat: Intr... |
49 |
.mode = 0644, |
883ca833e dccp: Initialisat... |
50 51 52 |
.proc_handler = proc_dointvec_minmax, .extra1 = &zero, .extra2 = &u8_max, /* RFC 4340, 10. */ |
e55d912f5 [DCCP] feat: Intr... |
53 54 |
}, { |
2e2e9e92b [DCCP]: Add sysct... |
55 56 57 58 |
.procname = "request_retries", .data = &sysctl_dccp_request_retries, .maxlen = sizeof(sysctl_dccp_request_retries), .mode = 0644, |
883ca833e dccp: Initialisat... |
59 |
.proc_handler = proc_dointvec_minmax, |
8ba7e7bfc dccp: make the re... |
60 |
.extra1 = &one, |
883ca833e dccp: Initialisat... |
61 |
.extra2 = &u8_max, |
2e2e9e92b [DCCP]: Add sysct... |
62 63 |
}, { |
2e2e9e92b [DCCP]: Add sysct... |
64 65 66 67 |
.procname = "retries1", .data = &sysctl_dccp_retries1, .maxlen = sizeof(sysctl_dccp_retries1), .mode = 0644, |
883ca833e dccp: Initialisat... |
68 69 70 |
.proc_handler = proc_dointvec_minmax, .extra1 = &zero, .extra2 = &u8_max, |
2e2e9e92b [DCCP]: Add sysct... |
71 72 |
}, { |
2e2e9e92b [DCCP]: Add sysct... |
73 74 75 76 |
.procname = "retries2", .data = &sysctl_dccp_retries2, .maxlen = sizeof(sysctl_dccp_retries2), .mode = 0644, |
883ca833e dccp: Initialisat... |
77 78 79 |
.proc_handler = proc_dointvec_minmax, .extra1 = &zero, .extra2 = &u8_max, |
2e2e9e92b [DCCP]: Add sysct... |
80 |
}, |
82e3ab9db [DCCP]: Adds the ... |
81 |
{ |
82e3ab9db [DCCP]: Adds the ... |
82 83 84 85 |
.procname = "tx_qlen", .data = &sysctl_dccp_tx_qlen, .maxlen = sizeof(sysctl_dccp_tx_qlen), .mode = 0644, |
883ca833e dccp: Initialisat... |
86 87 |
.proc_handler = proc_dointvec_minmax, .extra1 = &zero, |
82e3ab9db [DCCP]: Adds the ... |
88 |
}, |
a94f0f970 [DCCP]: Rate-limi... |
89 90 91 92 93 94 95 |
{ .procname = "sync_ratelimit", .data = &sysctl_dccp_sync_ratelimit, .maxlen = sizeof(sysctl_dccp_sync_ratelimit), .mode = 0644, .proc_handler = proc_dointvec_ms_jiffies, }, |
82e3ab9db [DCCP]: Adds the ... |
96 |
|
f8572d8f2 sysctl net: Remov... |
97 |
{ } |
e55d912f5 [DCCP] feat: Intr... |
98 |
}; |
e55d912f5 [DCCP] feat: Intr... |
99 100 101 102 |
static struct ctl_table_header *dccp_table_header; int __init dccp_sysctl_init(void) { |
ec8f23ce0 net: Convert all ... |
103 |
dccp_table_header = register_net_sysctl(&init_net, "net/dccp/default", |
b5ccd792f [NET]: Simple ctl... |
104 |
dccp_default_table); |
e55d912f5 [DCCP] feat: Intr... |
105 106 107 108 109 110 111 |
return dccp_table_header != NULL ? 0 : -ENOMEM; } void dccp_sysctl_exit(void) { if (dccp_table_header != NULL) { |
5dd3df105 net: Move all of ... |
112 |
unregister_net_sysctl_table(dccp_table_header); |
e55d912f5 [DCCP] feat: Intr... |
113 114 115 |
dccp_table_header = NULL; } } |