summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_input.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-02-15 11:16:09 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-02-15 11:16:09 +0000
commit9af28b7ef8fcb82425389802b33fbb5d219d5bfa (patch)
tree788d8b71f7760ef08a3dd2762ae90f9eb83dfd9e /sys/netinet/ip_input.c
parent1de25cf61875f377333aa5a709a844f94c3e27f6 (diff)
switch to sysctl_int_arr(); ok itojun, henning, miod, deraadt
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r--sys/netinet/ip_input.c67
1 files changed, 6 insertions, 61 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 214635ed801..4472fcbe4b0 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_input.c,v 1.116 2004/02/13 01:29:46 brad Exp $ */
+/* $OpenBSD: ip_input.c,v 1.117 2004/02/15 11:16:08 markus Exp $ */
/* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */
/*
@@ -140,6 +140,8 @@ extern int ipport_hifirstauto;
extern int ipport_hilastauto;
extern struct baddynamicports baddynamicports;
+int *ipctl_vars[IPCTL_MAXID] = IPCTL_VARS;
+
extern struct domain inetdomain;
extern struct protosw inetsw[];
u_char ip_protox[IPPROTO_MAX];
@@ -1605,13 +1607,6 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
return (ENOTDIR);
switch (name[0]) {
- case IPCTL_FORWARDING:
- return (sysctl_int(oldp, oldlenp, newp, newlen, &ipforwarding));
- case IPCTL_SENDREDIRECTS:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsendredirects));
- case IPCTL_DEFTTL:
- return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_defttl));
#ifdef notyet
case IPCTL_DEFMTU:
return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtu));
@@ -1624,9 +1619,6 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
return (EPERM);
return (sysctl_int(oldp, oldlenp, newp, newlen,
&ip_dosourceroute));
- case IPCTL_DIRECTEDBCAST:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ip_directedbcast));
case IPCTL_MTUDISC:
error = sysctl_int(oldp, oldlenp, newp, newlen,
&ip_mtudisc);
@@ -1646,53 +1638,6 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
rt_timer_queue_change(ip_mtudisc_timeout_q,
ip_mtudisc_timeout);
return (error);
- case IPCTL_IPPORT_FIRSTAUTO:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipport_firstauto));
- case IPCTL_IPPORT_LASTAUTO:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipport_lastauto));
- case IPCTL_IPPORT_HIFIRSTAUTO:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipport_hifirstauto));
- case IPCTL_IPPORT_HILASTAUTO:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipport_hilastauto));
- case IPCTL_IPPORT_MAXQUEUE:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ip_maxqueue));
- case IPCTL_ENCDEBUG:
- return (sysctl_int(oldp, oldlenp, newp, newlen, &encdebug));
- case IPCTL_IPSEC_EMBRYONIC_SA_TIMEOUT:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_keep_invalid));
- case IPCTL_IPSEC_REQUIRE_PFS:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_require_pfs));
- case IPCTL_IPSEC_SOFT_ALLOCATIONS:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_soft_allocations));
- case IPCTL_IPSEC_ALLOCATIONS:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_exp_allocations));
- case IPCTL_IPSEC_SOFT_BYTES:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_soft_bytes));
- case IPCTL_IPSEC_BYTES:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_exp_bytes));
- case IPCTL_IPSEC_TIMEOUT:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_exp_timeout));
- case IPCTL_IPSEC_SOFT_TIMEOUT:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_soft_timeout));
- case IPCTL_IPSEC_SOFT_FIRSTUSE:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_soft_first_use));
- case IPCTL_IPSEC_FIRSTUSE:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_exp_first_use));
case IPCTL_IPSEC_ENC_ALGORITHM:
return (sysctl_tstring(oldp, oldlenp, newp, newlen,
ipsec_def_enc, sizeof(ipsec_def_enc)));
@@ -1700,14 +1645,14 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
return (sysctl_tstring(oldp, oldlenp, newp, newlen,
ipsec_def_auth,
sizeof(ipsec_def_auth)));
- case IPCTL_IPSEC_EXPIRE_ACQUIRE:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipsec_expire_acquire));
case IPCTL_IPSEC_IPCOMP_ALGORITHM:
return (sysctl_tstring(oldp, oldlenp, newp, newlen,
ipsec_def_comp,
sizeof(ipsec_def_comp)));
default:
+ if (name[0] < IPCTL_MAXID)
+ return (sysctl_int_arr(ipctl_vars, name, namelen,
+ oldp, oldlenp, newp, newlen));
return (EOPNOTSUPP);
}
/* NOTREACHED */