Deleted Added
full compact
tcp_hostcache.c (195699) tcp_hostcache.c (195727)
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 195699 2009-07-14 22:48:30Z rwatson $");
66__FBSDID("$FreeBSD: head/sys/netinet/tcp_hostcache.c 195727 2009-07-16 21:13:04Z rwatson $");
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>

--- 29 unchanged lines hidden (view full) ---

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
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>

--- 29 unchanged lines hidden (view full) ---

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_GET(tcp_hostcache)
113#define V_tcp_hc_callout VNET_GET(tcp_hc_callout)
112#define V_tcp_hostcache VNET(tcp_hostcache)
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(void *);
119
120SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0,
121 "TCP Host cache");

--- 550 unchanged lines hidden ---
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(void *);
119
120SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0,
121 "TCP Host cache");

--- 550 unchanged lines hidden ---