diff options
author | luigi <luigi@FreeBSD.org> | 2012-08-06 11:02:23 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2012-08-06 11:02:23 +0000 |
commit | eed7c1d3a532f42854b50b30bef7bfe6bac1c302 (patch) | |
tree | 24fcdb8528fb40538173b8955231c0eb50bed14d /sys/netinet/ipfw | |
parent | b53e8390d6aa61e8b65635cd0606a93b948b7255 (diff) | |
download | FreeBSD-src-eed7c1d3a532f42854b50b30bef7bfe6bac1c302.zip FreeBSD-src-eed7c1d3a532f42854b50b30bef7bfe6bac1c302.tar.gz |
move functions outside the SYSBEGIN/SYSEND block
(SYSBEGIN/SYSEND are specific to ipfw/dummynet and are used to
emulate sysctl on platforms that do not have them, and they work
by creating an array which contains all the sysctl-ed symbols.)
Diffstat (limited to 'sys/netinet/ipfw')
-rw-r--r-- | sys/netinet/ipfw/ip_dn_io.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/sys/netinet/ipfw/ip_dn_io.c b/sys/netinet/ipfw/ip_dn_io.c index a39f169..becd85e 100644 --- a/sys/netinet/ipfw/ip_dn_io.c +++ b/sys/netinet/ipfw/ip_dn_io.c @@ -98,17 +98,11 @@ extern void (*bridge_dn_p)(struct mbuf *, struct ifnet *); #ifdef SYSCTL_NODE -SYSBEGIN(f4) - -SYSCTL_DECL(_net_inet); -SYSCTL_DECL(_net_inet_ip); -static SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); - -/* wrapper to pass dn_cfg fields to SYSCTL_* */ -//#define DC(x) (&(VNET_NAME(_base_dn_cfg).x)) -#define DC(x) (&(dn_cfg.x)) -/* parameters */ - +/* + * Because of the way the SYSBEGIN/SYSEND macros work on other + * platforms, there should not be functions between them. + * So keep the handlers outside the block. + */ static int sysctl_hash_size(SYSCTL_HANDLER_ARGS) { @@ -124,10 +118,6 @@ sysctl_hash_size(SYSCTL_HANDLER_ARGS) return (0); } -SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, hash_size, - CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_hash_size, - "I", "Default hash table size"); - static int sysctl_limits(SYSCTL_HANDLER_ARGS) { @@ -154,6 +144,23 @@ sysctl_limits(SYSCTL_HANDLER_ARGS) return (0); } +SYSBEGIN(f4) + +SYSCTL_DECL(_net_inet); +SYSCTL_DECL(_net_inet_ip); +static SYSCTL_NODE(_net_inet_ip, OID_AUTO, dummynet, CTLFLAG_RW, 0, "Dummynet"); + +/* wrapper to pass dn_cfg fields to SYSCTL_* */ +//#define DC(x) (&(VNET_NAME(_base_dn_cfg).x)) +#define DC(x) (&(dn_cfg.x)) +/* parameters */ + + +SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, hash_size, + CTLTYPE_INT | CTLFLAG_RW, 0, 0, sysctl_hash_size, + "I", "Default hash table size"); + + SYSCTL_PROC(_net_inet_ip_dummynet, OID_AUTO, pipe_slot_limit, CTLTYPE_LONG | CTLFLAG_RW, 0, 1, sysctl_limits, "L", "Upper limit in slots for pipe queue."); |