Blame view

net/tipc/sysctl.c 3.47 KB
cc79dd1ba   Ying Xue   tipc: change sock...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  /*
   * net/tipc/sysctl.c: sysctl interface to TIPC subsystem
   *
   * Copyright (c) 2013, Wind River Systems
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. Neither the names of the copyright holders nor the names of its
   *    contributors may be used to endorse or promote products derived from
   *    this software without specific prior written permission.
   *
   * Alternatively, this software may be distributed under the terms of the
   * GNU General Public License ("GPL") version 2 as published by the Free
   * Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   * POSSIBILITY OF SUCH DAMAGE.
   */
  
  #include "core.h"
01e661ebf   Tuong Lien   tipc: add trace_e...
37
  #include "trace.h"
fc1b6d6de   Tuong Lien   tipc: introduce T...
38
  #include "crypto.h"
a91d55d16   Tuong Lien   tipc: enable broa...
39
  #include "bcast.h"
cc79dd1ba   Ying Xue   tipc: change sock...
40
41
42
43
44
45
46
47
48
49
  #include <linux/sysctl.h>
  
  static struct ctl_table_header *tipc_ctl_hdr;
  
  static struct ctl_table tipc_table[] = {
  	{
  		.procname	= "tipc_rmem",
  		.data		= &sysctl_tipc_rmem,
  		.maxlen		= sizeof(sysctl_tipc_rmem),
  		.mode		= 0644,
4bcd4ec10   Jie Liu   tipc: set sysctl_...
50
  		.proc_handler	= proc_dointvec_minmax,
eec4844fa   Matteo Croce   proc/sysctl: add ...
51
  		.extra1         = SYSCTL_ONE,
cc79dd1ba   Ying Xue   tipc: change sock...
52
  	},
a5325ae5b   Erik Hugne   tipc: add name di...
53
54
55
56
57
  	{
  		.procname	= "named_timeout",
  		.data		= &sysctl_tipc_named_timeout,
  		.maxlen		= sizeof(sysctl_tipc_named_timeout),
  		.mode		= 0644,
4bcd4ec10   Jie Liu   tipc: set sysctl_...
58
  		.proc_handler	= proc_dointvec_minmax,
eec4844fa   Matteo Croce   proc/sysctl: add ...
59
  		.extra1         = SYSCTL_ZERO,
a5325ae5b   Erik Hugne   tipc: add name di...
60
  	},
01e661ebf   Tuong Lien   tipc: add trace_e...
61
62
63
64
65
66
67
  	{
  		.procname       = "sk_filter",
  		.data           = &sysctl_tipc_sk_filter,
  		.maxlen         = sizeof(sysctl_tipc_sk_filter),
  		.mode           = 0644,
  		.proc_handler   = proc_doulongvec_minmax,
  	},
fc1b6d6de   Tuong Lien   tipc: introduce T...
68
69
70
71
72
73
74
75
76
  #ifdef CONFIG_TIPC_CRYPTO
  	{
  		.procname	= "max_tfms",
  		.data		= &sysctl_tipc_max_tfms,
  		.maxlen		= sizeof(sysctl_tipc_max_tfms),
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_minmax,
  		.extra1         = SYSCTL_ONE,
  	},
1ef6f7c93   Tuong Lien   tipc: add automat...
77
78
79
80
81
82
83
84
85
  	{
  		.procname	= "key_exchange_enabled",
  		.data		= &sysctl_tipc_key_exchange_enabled,
  		.maxlen		= sizeof(sysctl_tipc_key_exchange_enabled),
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_minmax,
  		.extra1         = SYSCTL_ZERO,
  		.extra2         = SYSCTL_ONE,
  	},
fc1b6d6de   Tuong Lien   tipc: introduce T...
86
  #endif
a91d55d16   Tuong Lien   tipc: enable broa...
87
88
89
90
91
92
93
  	{
  		.procname	= "bc_retruni",
  		.data		= &sysctl_tipc_bc_retruni,
  		.maxlen		= sizeof(sysctl_tipc_bc_retruni),
  		.mode		= 0644,
  		.proc_handler	= proc_doulongvec_minmax,
  	},
cc79dd1ba   Ying Xue   tipc: change sock...
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  	{}
  };
  
  int tipc_register_sysctl(void)
  {
  	tipc_ctl_hdr = register_net_sysctl(&init_net, "net/tipc", tipc_table);
  	if (tipc_ctl_hdr == NULL)
  		return -ENOMEM;
  	return 0;
  }
  
  void tipc_unregister_sysctl(void)
  {
  	unregister_net_sysctl_table(tipc_ctl_hdr);
  }