Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0cae1757
Commit
0cae1757
authored
Mar 15, 2004
by
Art Haas
Committed by
Linus Torvalds
Mar 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPVS]: Add C99 initializers to ip_vs_ctl.c
parent
1b2ed5b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
219 additions
and
88 deletions
+219
-88
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/ipvs/ip_vs_ctl.c
+219
-88
No files found.
net/ipv4/ipvs/ip_vs_ctl.c
View file @
0cae1757
...
@@ -1384,95 +1384,223 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
...
@@ -1384,95 +1384,223 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp,
/*
/*
* IPVS sysctl table (under the /proc/sys/net/ipv4/vs/)
* IPVS sysctl table (under the /proc/sys/net/ipv4/vs/)
*/
*/
struct
ip_vs_sysctl_table
{
struct
ctl_table_header
*
sysctl_header
;
ctl_table
vs_vars
[
NET_IPV4_VS_LAST
];
ctl_table
vs_dir
[
2
];
ctl_table
ipv4_dir
[
2
];
ctl_table
root_dir
[
2
];
};
static
struct
ip_vs_sysctl_table
ipv4_vs_table
=
{
static
struct
ctl_table
vs_vars
[]
=
{
NULL
,
{
{{
NET_IPV4_VS_AMEMTHRESH
,
"amemthresh"
,
.
ctl_name
=
NET_IPV4_VS_AMEMTHRESH
,
&
sysctl_ip_vs_amemthresh
,
sizeof
(
int
),
0644
,
NULL
,
.
procname
=
"amemthresh"
,
&
proc_dointvec
},
.
data
=
&
sysctl_ip_vs_amemthresh
,
.
maxlen
=
sizeof
(
int
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec
,
},
#ifdef CONFIG_IP_VS_DEBUG
#ifdef CONFIG_IP_VS_DEBUG
{
NET_IPV4_VS_DEBUG_LEVEL
,
"debug_level"
,
{
&
sysctl_ip_vs_debug_level
,
sizeof
(
int
),
0644
,
NULL
,
.
ctl_name
=
NET_IPV4_VS_DEBUG_LEVEL
,
&
proc_dointvec
},
.
procname
=
"debug_level"
,
.
data
=
&
sysctl_ip_vs_debug_level
,
.
maxlen
=
sizeof
(
int
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec
,
},
#endif
#endif
{
NET_IPV4_VS_AMDROPRATE
,
"am_droprate"
,
{
&
sysctl_ip_vs_am_droprate
,
sizeof
(
int
),
0644
,
NULL
,
.
ctl_name
=
NET_IPV4_VS_AMDROPRATE
,
&
proc_dointvec
},
.
procname
=
"am_droprate"
,
{
NET_IPV4_VS_DROP_ENTRY
,
"drop_entry"
,
.
data
=
&
sysctl_ip_vs_am_droprate
,
&
sysctl_ip_vs_drop_entry
,
sizeof
(
int
),
0644
,
NULL
,
.
maxlen
=
sizeof
(
int
),
&
proc_do_defense_mode
},
.
mode
=
0644
,
{
NET_IPV4_VS_DROP_PACKET
,
"drop_packet"
,
.
proc_handler
=
&
proc_dointvec
,
&
sysctl_ip_vs_drop_packet
,
sizeof
(
int
),
0644
,
NULL
,
},
&
proc_do_defense_mode
},
{
{
NET_IPV4_VS_SECURE_TCP
,
"secure_tcp"
,
.
ctl_name
=
NET_IPV4_VS_DROP_ENTRY
,
&
sysctl_ip_vs_secure_tcp
,
sizeof
(
int
),
0644
,
NULL
,
.
procname
=
"drop_entry"
,
&
proc_do_defense_mode
},
.
data
=
&
sysctl_ip_vs_drop_entry
,
.
maxlen
=
sizeof
(
int
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_do_defense_mode
,
},
{
.
ctl_name
=
NET_IPV4_VS_DROP_PACKET
,
.
procname
=
"drop_packet"
,
.
data
=
&
sysctl_ip_vs_drop_packet
,
.
maxlen
=
sizeof
(
int
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_do_defense_mode
,
},
{
.
ctl_name
=
NET_IPV4_VS_SECURE_TCP
,
.
procname
=
"secure_tcp"
,
.
data
=
&
sysctl_ip_vs_secure_tcp
,
.
maxlen
=
sizeof
(
int
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_do_defense_mode
,
},
#if 0
#if 0
{NET_IPV4_VS_TO_ES, "timeout_established",
{
&vs_timeout_table_dos.timeout[IP_VS_S_ESTABLISHED],
.ctl_name = NET_IPV4_VS_TO_ES,
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.procname = "timeout_established",
{NET_IPV4_VS_TO_SS, "timeout_synsent",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_ESTABLISHED],
&vs_timeout_table_dos.timeout[IP_VS_S_SYN_SENT],
.maxlen = sizeof(int),
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.mode = 0644,
{NET_IPV4_VS_TO_SR, "timeout_synrecv",
.proc_handler = &proc_dointvec_jiffies,
&vs_timeout_table_dos.timeout[IP_VS_S_SYN_RECV],
},
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
{
{NET_IPV4_VS_TO_FW, "timeout_finwait",
.ctl_name = NET_IPV4_VS_TO_SS,
&vs_timeout_table_dos.timeout[IP_VS_S_FIN_WAIT],
.procname = "timeout_synsent",
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.data = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_SENT],
{NET_IPV4_VS_TO_TW, "timeout_timewait",
.maxlen = sizeof(int),
&vs_timeout_table_dos.timeout[IP_VS_S_TIME_WAIT],
.mode = 0644,
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.proc_handler = &proc_dointvec_jiffies,
{NET_IPV4_VS_TO_CL, "timeout_close",
},
&vs_timeout_table_dos.timeout[IP_VS_S_CLOSE],
{
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.ctl_name = NET_IPV4_VS_TO_SR,
{NET_IPV4_VS_TO_CW, "timeout_closewait",
.procname = "timeout_synrecv",
&vs_timeout_table_dos.timeout[IP_VS_S_CLOSE_WAIT],
.data = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_RECV],
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.maxlen = sizeof(int),
{NET_IPV4_VS_TO_LA, "timeout_lastack",
.mode = 0644,
&vs_timeout_table_dos.timeout[IP_VS_S_LAST_ACK],
.proc_handler = &proc_dointvec_jiffies,
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
},
{NET_IPV4_VS_TO_LI, "timeout_listen",
{
&vs_timeout_table_dos.timeout[IP_VS_S_LISTEN],
.ctl_name = NET_IPV4_VS_TO_FW,
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.procname = "timeout_finwait",
{NET_IPV4_VS_TO_SA, "timeout_synack",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_FIN_WAIT],
&vs_timeout_table_dos.timeout[IP_VS_S_SYNACK],
.maxlen = sizeof(int),
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.mode = 0644,
{NET_IPV4_VS_TO_UDP, "timeout_udp",
.proc_handler = &proc_dointvec_jiffies,
&vs_timeout_table_dos.timeout[IP_VS_S_UDP],
},
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
{
{NET_IPV4_VS_TO_ICMP, "timeout_icmp",
.ctl_name = NET_IPV4_VS_TO_TW,
&vs_timeout_table_dos.timeout[IP_VS_S_ICMP],
.procname = "timeout_timewait",
sizeof(int), 0644, NULL, &proc_dointvec_jiffies},
.data = &vs_timeout_table_dos.timeout[IP_VS_S_TIME_WAIT],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_IPV4_VS_TO_CL,
.procname = "timeout_close",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_IPV4_VS_TO_CW,
.procname = "timeout_closewait",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE_WAIT],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_IPV4_VS_TO_LA,
.procname = "timeout_lastack",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_LAST_ACK],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_IPV4_VS_TO_LI,
.procname = "timeout_listen",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_LISTEN],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_IPV4_VS_TO_SA,
.procname = "timeout_synack",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_SYNACK],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_IPV4_VS_TO_UDP,
.procname = "timeout_udp",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_UDP],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_IPV4_VS_TO_ICMP,
.procname = "timeout_icmp",
.data = &vs_timeout_table_dos.timeout[IP_VS_S_ICMP],
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec_jiffies,
},
#endif
#endif
{
NET_IPV4_VS_CACHE_BYPASS
,
"cache_bypass"
,
{
&
sysctl_ip_vs_cache_bypass
,
sizeof
(
int
),
0644
,
NULL
,
.
ctl_name
=
NET_IPV4_VS_CACHE_BYPASS
,
&
proc_dointvec
},
.
procname
=
"cache_bypass"
,
{
NET_IPV4_VS_EXPIRE_NODEST_CONN
,
"expire_nodest_conn"
,
.
data
=
&
sysctl_ip_vs_cache_bypass
,
&
sysctl_ip_vs_expire_nodest_conn
,
sizeof
(
int
),
0644
,
NULL
,
.
maxlen
=
sizeof
(
int
),
&
proc_dointvec
},
.
mode
=
0644
,
{
NET_IPV4_VS_SYNC_THRESHOLD
,
"sync_threshold"
,
.
proc_handler
=
&
proc_dointvec
,
&
sysctl_ip_vs_sync_threshold
,
sizeof
(
sysctl_ip_vs_sync_threshold
),
},
0644
,
NULL
,
&
proc_do_sync_threshold
},
{
{
NET_IPV4_VS_NAT_ICMP_SEND
,
"nat_icmp_send"
,
.
ctl_name
=
NET_IPV4_VS_EXPIRE_NODEST_CONN
,
&
sysctl_ip_vs_nat_icmp_send
,
sizeof
(
int
),
0644
,
NULL
,
.
procname
=
"expire_nodest_conn"
,
&
proc_dointvec
},
.
data
=
&
sysctl_ip_vs_expire_nodest_conn
,
{
0
}},
.
maxlen
=
sizeof
(
int
),
{{
NET_IPV4_VS
,
"vs"
,
NULL
,
0
,
0555
,
ipv4_vs_table
.
vs_vars
},
.
mode
=
0644
,
{
0
}},
.
proc_handler
=
&
proc_dointvec
,
{{
NET_IPV4
,
"ipv4"
,
NULL
,
0
,
0555
,
ipv4_vs_table
.
vs_dir
},
},
{
0
}},
{
{{
CTL_NET
,
"net"
,
NULL
,
0
,
0555
,
ipv4_vs_table
.
ipv4_dir
},
.
ctl_name
=
NET_IPV4_VS_SYNC_THRESHOLD
,
{
0
}}
.
procname
=
"sync_threshold"
,
.
data
=
&
sysctl_ip_vs_sync_threshold
,
.
maxlen
=
sizeof
(
sysctl_ip_vs_sync_threshold
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_do_sync_threshold
,
},
{
.
ctl_name
=
NET_IPV4_VS_NAT_ICMP_SEND
,
.
procname
=
"nat_icmp_send"
,
.
data
=
&
sysctl_ip_vs_nat_icmp_send
,
.
maxlen
=
sizeof
(
int
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec
,
},
{
.
ctl_name
=
0
}
};
static
ctl_table
vs_table
[]
=
{
{
.
ctl_name
=
NET_IPV4_VS
,
.
procname
=
"vs"
,
.
mode
=
0555
,
.
child
=
vs_vars
},
{
.
ctl_name
=
0
}
};
static
ctl_table
ipv4_table
[]
=
{
{
.
ctl_name
=
NET_IPV4
,
.
procname
=
"ipv4"
,
.
mode
=
0555
,
.
child
=
vs_table
,
},
{
.
ctl_name
=
0
}
};
};
static
ctl_table
vs_root_table
[]
=
{
{
.
ctl_name
=
CTL_NET
,
.
procname
=
"net"
,
.
mode
=
0555
,
.
child
=
ipv4_table
,
},
{
.
ctl_name
=
0
}
};
static
struct
ctl_table_header
*
sysctl_header
;
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
struct
ip_vs_iter
{
struct
ip_vs_iter
{
...
@@ -2184,9 +2312,13 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
...
@@ -2184,9 +2312,13 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
static
struct
nf_sockopt_ops
ip_vs_sockopts
=
{
static
struct
nf_sockopt_ops
ip_vs_sockopts
=
{
{
NULL
,
NULL
},
PF_INET
,
.
pf
=
PF_INET
,
IP_VS_BASE_CTL
,
IP_VS_SO_SET_MAX
+
1
,
do_ip_vs_set_ctl
,
.
set_optmin
=
IP_VS_BASE_CTL
,
IP_VS_BASE_CTL
,
IP_VS_SO_GET_MAX
+
1
,
do_ip_vs_get_ctl
.
set_optmax
=
IP_VS_SO_SET_MAX
+
1
,
.
set
=
do_ip_vs_set_ctl
,
.
get_optmin
=
IP_VS_BASE_CTL
,
.
get_optmax
=
IP_VS_SO_GET_MAX
+
1
,
.
get
=
do_ip_vs_get_ctl
,
};
};
...
@@ -2206,8 +2338,7 @@ int ip_vs_control_init(void)
...
@@ -2206,8 +2338,7 @@ int ip_vs_control_init(void)
proc_net_fops_create
(
"ip_vs"
,
0
,
&
ip_vs_info_fops
);
proc_net_fops_create
(
"ip_vs"
,
0
,
&
ip_vs_info_fops
);
proc_net_fops_create
(
"ip_vs_stats"
,
0
,
&
ip_vs_stats_fops
);
proc_net_fops_create
(
"ip_vs_stats"
,
0
,
&
ip_vs_stats_fops
);
ipv4_vs_table
.
sysctl_header
=
sysctl_header
=
register_sysctl_table
(
vs_root_table
,
0
);
register_sysctl_table
(
ipv4_vs_table
.
root_dir
,
0
);
/* Initialize ip_vs_svc_table, ip_vs_svc_fwm_table, ip_vs_rtable */
/* Initialize ip_vs_svc_table, ip_vs_svc_fwm_table, ip_vs_rtable */
for
(
idx
=
0
;
idx
<
IP_VS_SVC_TAB_SIZE
;
idx
++
)
{
for
(
idx
=
0
;
idx
<
IP_VS_SVC_TAB_SIZE
;
idx
++
)
{
...
@@ -2239,7 +2370,7 @@ void ip_vs_control_cleanup(void)
...
@@ -2239,7 +2370,7 @@ void ip_vs_control_cleanup(void)
ip_vs_trash_cleanup
();
ip_vs_trash_cleanup
();
del_timer_sync
(
&
defense_timer
);
del_timer_sync
(
&
defense_timer
);
ip_vs_kill_estimator
(
&
ip_vs_stats
);
ip_vs_kill_estimator
(
&
ip_vs_stats
);
unregister_sysctl_table
(
ipv4_vs_table
.
sysctl_header
);
unregister_sysctl_table
(
sysctl_header
);
proc_net_remove
(
"ip_vs_stats"
);
proc_net_remove
(
"ip_vs_stats"
);
proc_net_remove
(
"ip_vs"
);
proc_net_remove
(
"ip_vs"
);
nf_unregister_sockopt
(
&
ip_vs_sockopts
);
nf_unregister_sockopt
(
&
ip_vs_sockopts
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment