sysctl_net_llc.c 1.8 KB
Newer Older
1 2
/*
 * sysctl_net_llc.c: sysctl interface to LLC net subsystem.
3
 *
4 5 6 7 8 9
 * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
 */

#include <linux/mm.h>
#include <linux/init.h>
#include <linux/sysctl.h>
10
#include <net/net_namespace.h>
11
#include <net/llc.h>
12 13 14 15 16 17 18 19 20

#ifndef CONFIG_SYSCTL
#error This file should not be compiled without CONFIG_SYSCTL defined
#endif

static struct ctl_table llc2_timeout_table[] = {
	{
		.procname	= "ack",
		.data		= &sysctl_llc2_ack_timeout,
21
		.maxlen		= sizeof(sysctl_llc2_ack_timeout),
22
		.mode		= 0644,
Alexey Dobriyan's avatar
Alexey Dobriyan committed
23
		.proc_handler   = proc_dointvec_jiffies,
24 25 26 27
	},
	{
		.procname	= "busy",
		.data		= &sysctl_llc2_busy_timeout,
28
		.maxlen		= sizeof(sysctl_llc2_busy_timeout),
29
		.mode		= 0644,
Alexey Dobriyan's avatar
Alexey Dobriyan committed
30
		.proc_handler   = proc_dointvec_jiffies,
31 32 33 34
	},
	{
		.procname	= "p",
		.data		= &sysctl_llc2_p_timeout,
35
		.maxlen		= sizeof(sysctl_llc2_p_timeout),
36
		.mode		= 0644,
Alexey Dobriyan's avatar
Alexey Dobriyan committed
37
		.proc_handler   = proc_dointvec_jiffies,
38 39 40 41
	},
	{
		.procname	= "rej",
		.data		= &sysctl_llc2_rej_timeout,
42
		.maxlen		= sizeof(sysctl_llc2_rej_timeout),
43
		.mode		= 0644,
Alexey Dobriyan's avatar
Alexey Dobriyan committed
44
		.proc_handler   = proc_dointvec_jiffies,
45
	},
46
	{ },
47 48 49
};

static struct ctl_table llc_station_table[] = {
50
	{ },
51 52
};

53 54
static struct ctl_table_header *llc2_timeout_header;
static struct ctl_table_header *llc_station_header;
55 56 57

int __init llc_sysctl_init(void)
{
58 59
	llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
	llc_station_header = register_net_sysctl(&init_net, "net/llc/station", llc_station_table);
60

61 62 63 64 65
	if (!llc2_timeout_header || !llc_station_header) {
		llc_sysctl_exit();
		return -ENOMEM;
	}
	return 0;
66 67 68 69
}

void llc_sysctl_exit(void)
{
70 71 72 73 74 75 76
	if (llc2_timeout_header) {
		unregister_net_sysctl_table(llc2_timeout_header);
		llc2_timeout_header = NULL;
	}
	if (llc_station_header) {
		unregister_net_sysctl_table(llc_station_header);
		llc_station_header = NULL;
77 78
	}
}