blob: 21295993fdb84f2dd53dea972b137eb95395aca2 [file] [log] [blame]
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -08001/*
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 Meloe55d9122006-03-20 19:25:02 -080012#include <linux/mm.h>
13#include <linux/sysctl.h>
Gerrit Renker2e2e9e92006-11-13 13:23:52 -020014#include "dccp.h"
Ian McDonald2a0109a2006-08-26 19:15:35 -070015#include "feat.h"
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080016
17#ifndef CONFIG_SYSCTL
18#error This file should not be compiled without CONFIG_SYSCTL defined
19#endif
20
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080021static struct ctl_table dccp_default_table[] = {
22 {
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080023 .procname = "seq_window",
Gerrit Renkerafb0a342006-11-13 13:25:41 -020024 .data = &sysctl_dccp_feat_sequence_window,
25 .maxlen = sizeof(sysctl_dccp_feat_sequence_window),
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080026 .mode = 0644,
27 .proc_handler = proc_dointvec,
28 },
29 {
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080030 .procname = "rx_ccid",
Gerrit Renkerafb0a342006-11-13 13:25:41 -020031 .data = &sysctl_dccp_feat_rx_ccid,
32 .maxlen = sizeof(sysctl_dccp_feat_rx_ccid),
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080033 .mode = 0644,
34 .proc_handler = proc_dointvec,
35 },
36 {
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080037 .procname = "tx_ccid",
Gerrit Renkerafb0a342006-11-13 13:25:41 -020038 .data = &sysctl_dccp_feat_tx_ccid,
39 .maxlen = sizeof(sysctl_dccp_feat_tx_ccid),
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080040 .mode = 0644,
41 .proc_handler = proc_dointvec,
42 },
43 {
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080044 .procname = "ack_ratio",
Gerrit Renkerafb0a342006-11-13 13:25:41 -020045 .data = &sysctl_dccp_feat_ack_ratio,
46 .maxlen = sizeof(sysctl_dccp_feat_ack_ratio),
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080047 .mode = 0644,
48 .proc_handler = proc_dointvec,
49 },
50 {
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080051 .procname = "send_ackvec",
Gerrit Renkerafb0a342006-11-13 13:25:41 -020052 .data = &sysctl_dccp_feat_send_ack_vector,
53 .maxlen = sizeof(sysctl_dccp_feat_send_ack_vector),
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080054 .mode = 0644,
55 .proc_handler = proc_dointvec,
56 },
57 {
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080058 .procname = "send_ndp",
Gerrit Renkerafb0a342006-11-13 13:25:41 -020059 .data = &sysctl_dccp_feat_send_ndp_count,
60 .maxlen = sizeof(sysctl_dccp_feat_send_ndp_count),
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -080061 .mode = 0644,
62 .proc_handler = proc_dointvec,
63 },
Gerrit Renker2e2e9e92006-11-13 13:23:52 -020064 {
Gerrit Renker2e2e9e92006-11-13 13:23:52 -020065 .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 Renker2e2e9e92006-11-13 13:23:52 -020072 .procname = "retries1",
73 .data = &sysctl_dccp_retries1,
74 .maxlen = sizeof(sysctl_dccp_retries1),
75 .mode = 0644,
76 .proc_handler = proc_dointvec,
77 },
78 {
Gerrit Renker2e2e9e92006-11-13 13:23:52 -020079 .procname = "retries2",
80 .data = &sysctl_dccp_retries2,
81 .maxlen = sizeof(sysctl_dccp_retries2),
82 .mode = 0644,
83 .proc_handler = proc_dointvec,
84 },
Ian McDonald82e3ab92006-11-20 19:19:32 -020085 {
Ian McDonald82e3ab92006-11-20 19:19:32 -020086 .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 Renkera94f0f92007-09-26 11:31:49 -030092 {
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 McDonald82e3ab92006-11-20 19:19:32 -020099
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -0800100 { .ctl_name = 0, }
101};
102
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -0800103static struct ctl_path dccp_path[] = {
104 { .procname = "net", .ctl_name = CTL_NET, },
105 { .procname = "dccp", .ctl_name = NET_DCCP, },
106 { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, },
107 { }
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -0800108};
109
110static struct ctl_table_header *dccp_table_header;
111
112int __init dccp_sysctl_init(void)
113{
Pavel Emelyanovb5ccd792008-01-09 00:30:05 -0800114 dccp_table_header = register_sysctl_paths(dccp_path,
115 dccp_default_table);
Arnaldo Carvalho de Meloe55d9122006-03-20 19:25:02 -0800116
117 return dccp_table_header != NULL ? 0 : -ENOMEM;
118}
119
120void dccp_sysctl_exit(void)
121{
122 if (dccp_table_header != NULL) {
123 unregister_sysctl_table(dccp_table_header);
124 dccp_table_header = NULL;
125 }
126}