version 1.266, 2008/04/12 05:58:22 |
version 1.267, 2008/04/23 06:09:04 |
Line 149 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 149 __KERNEL_RCSID(0, "$NetBSD$"); |
|
|
|
#ifdef IPSEC |
#ifdef IPSEC |
#include <netinet6/ipsec.h> |
#include <netinet6/ipsec.h> |
|
#include <netinet6/ipsec_private.h> |
#include <netkey/key.h> |
#include <netkey/key.h> |
#endif |
#endif |
#ifdef FAST_IPSEC |
#ifdef FAST_IPSEC |
Line 835 ip_input(struct mbuf *m) |
|
Line 836 ip_input(struct mbuf *m) |
|
} |
} |
#ifdef IPSEC |
#ifdef IPSEC |
if (ipsec4_in_reject(m, NULL)) { |
if (ipsec4_in_reject(m, NULL)) { |
ipsecstat.in_polvio++; |
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
goto bad; |
goto bad; |
} |
} |
#endif |
#endif |
|
|
*/ |
*/ |
if ((inetsw[ip_protox[ip->ip_p]].pr_flags & PR_LASTHDR) != 0 && |
if ((inetsw[ip_protox[ip->ip_p]].pr_flags & PR_LASTHDR) != 0 && |
ipsec4_in_reject(m, NULL)) { |
ipsec4_in_reject(m, NULL)) { |
ipsecstat.in_polvio++; |
IPSEC_STATINC(IPSEC_STAT_IN_POLVIO); |
goto bad; |
goto bad; |
} |
} |
#endif |
#endif |
Line 2194 sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG |
|
Line 2195 sysctl_net_inet_ip_hashsize(SYSCTLFN_ARG |
|
} |
} |
#endif /* GATEWAY */ |
#endif /* GATEWAY */ |
|
|
static void |
|
ipstat_convert_to_user_cb(void *v1, void *v2, struct cpu_info *ci) |
|
{ |
|
uint64_t *ipsc = v1; |
|
uint64_t *ips = v2; |
|
u_int i; |
|
|
|
for (i = 0; i < IP_NSTATS; i++) |
|
ips[i] += ipsc[i]; |
|
} |
|
|
|
static void |
|
ipstat_convert_to_user(uint64_t *ips) |
|
{ |
|
|
|
memset(ips, 0, sizeof(uint64_t) * IP_NSTATS); |
|
percpu_foreach(ipstat_percpu, ipstat_convert_to_user_cb, ips); |
|
} |
|
|
|
static int |
static int |
sysctl_net_inet_ip_stats(SYSCTLFN_ARGS) |
sysctl_net_inet_ip_stats(SYSCTLFN_ARGS) |
{ |
{ |
struct sysctlnode node; |
netstat_sysctl_context ctx; |
uint64_t ips[IP_NSTATS]; |
uint64_t ips[IP_NSTATS]; |
|
|
ipstat_convert_to_user(ips); |
ctx.ctx_stat = ipstat_percpu; |
node = *rnode; |
ctx.ctx_counters = ips; |
node.sysctl_data = ips; |
ctx.ctx_ncounters = IP_NSTATS; |
node.sysctl_size = sizeof(ips); |
return (NETSTAT_SYSCTL(&ctx)); |
return (sysctl_lookup(SYSCTLFN_CALL(&node))); |
|
} |
} |
|
|
SYSCTL_SETUP(sysctl_net_inet_ip_setup, "sysctl net.inet.ip subtree setup") |
SYSCTL_SETUP(sysctl_net_inet_ip_setup, "sysctl net.inet.ip subtree setup") |