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.)
This commit is contained in:
parent
b53e8390d6
commit
eed7c1d3a5
@ -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.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user