Deleted Added
full compact
tcp_hostcache.c (215317) tcp_hostcache.c (215701)
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 215317 2010-11-14 20:38:11Z dim $");
66__FBSDID("$FreeBSD: head/sys/netinet/tcp_hostcache.c 215701 2010-11-22 19:32:54Z dim $");
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>

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

101#include <vm/uma.h>
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
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>

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

101#include <vm/uma.h>
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);
109static VNET_DEFINE(struct tcp_hostcache, tcp_hostcache);
110#define V_tcp_hostcache VNET(tcp_hostcache)
111
110#define V_tcp_hostcache VNET(tcp_hostcache)
111
112STATIC_VNET_DEFINE(struct callout, tcp_hc_callout);
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 ---