tcp_hostcache.c (203724) | tcp_hostcache.c (207369) |
---|---|
1/*- 2 * Copyright (c) 2002 Andre Oppermann, Internet Business Solutions AG 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 49 unchanged lines hidden (view full) --- 58 */ 59 60/* 61 * Many thanks to jlemon for basic structure of tcp_syncache which is being 62 * followed here. 63 */ 64 65#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Andre Oppermann, Internet Business Solutions AG 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 49 unchanged lines hidden (view full) --- 58 */ 59 60/* 61 * Many thanks to jlemon for basic structure of tcp_syncache which is being 62 * followed here. 63 */ 64 65#include <sys/cdefs.h> |
66__FBSDID("$FreeBSD: head/sys/netinet/tcp_hostcache.c 203724 2010-02-09 21:31:53Z bz $"); | 66__FBSDID("$FreeBSD: head/sys/netinet/tcp_hostcache.c 207369 2010-04-29 11:52:42Z bz $"); |
67 68#include "opt_inet6.h" 69 70#include <sys/param.h> 71#include <sys/systm.h> 72#include <sys/kernel.h> 73#include <sys/lock.h> 74#include <sys/mutex.h> --- 27 unchanged lines hidden (view full) --- 102 103/* Arbitrary values */ 104#define TCP_HOSTCACHE_HASHSIZE 512 105#define TCP_HOSTCACHE_BUCKETLIMIT 30 106#define TCP_HOSTCACHE_EXPIRE 60*60 /* one hour */ 107#define TCP_HOSTCACHE_PRUNE 5*60 /* every 5 minutes */ 108 109static VNET_DEFINE(struct tcp_hostcache, tcp_hostcache); | 67 68#include "opt_inet6.h" 69 70#include <sys/param.h> 71#include <sys/systm.h> 72#include <sys/kernel.h> 73#include <sys/lock.h> 74#include <sys/mutex.h> --- 27 unchanged lines hidden (view full) --- 102 103/* Arbitrary values */ 104#define TCP_HOSTCACHE_HASHSIZE 512 105#define TCP_HOSTCACHE_BUCKETLIMIT 30 106#define TCP_HOSTCACHE_EXPIRE 60*60 /* one hour */ 107#define TCP_HOSTCACHE_PRUNE 5*60 /* every 5 minutes */ 108 109static VNET_DEFINE(struct tcp_hostcache, tcp_hostcache); |
110static VNET_DEFINE(struct callout, tcp_hc_callout); 111 | |
112#define V_tcp_hostcache VNET(tcp_hostcache) | 110#define V_tcp_hostcache VNET(tcp_hostcache) |
111 112static VNET_DEFINE(struct callout, tcp_hc_callout); |
|
113#define V_tcp_hc_callout VNET(tcp_hc_callout) 114 115static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); 116static struct hc_metrics *tcp_hc_insert(struct in_conninfo *); 117static int sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS); 118static void tcp_hc_purge_internal(int); 119static void tcp_hc_purge(void *); 120 --- 571 unchanged lines hidden --- | 113#define V_tcp_hc_callout VNET(tcp_hc_callout) 114 115static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); 116static struct hc_metrics *tcp_hc_insert(struct in_conninfo *); 117static int sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS); 118static void tcp_hc_purge_internal(int); 119static void tcp_hc_purge(void *); 120 --- 571 unchanged lines hidden --- |