Deleted Added
full compact
tcp_hostcache.c (191917) tcp_hostcache.c (193731)
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 191917 2009-05-08 14:34:25Z zec $");
66__FBSDID("$FreeBSD: head/sys/netinet/tcp_hostcache.c 193731 2009-06-08 17:15:40Z zec $");
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>

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

225 /*
226 * Set up periodic cache cleanup.
227 */
228 callout_init(&V_tcp_hc_callout, CALLOUT_MPSAFE);
229 callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz,
230 tcp_hc_purge, curvnet);
231}
232
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>

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

225 /*
226 * Set up periodic cache cleanup.
227 */
228 callout_init(&V_tcp_hc_callout, CALLOUT_MPSAFE);
229 callout_reset(&V_tcp_hc_callout, V_tcp_hostcache.prune * hz,
230 tcp_hc_purge, curvnet);
231}
232
233#ifdef VIMAGE
234void
235tcp_hc_destroy(void)
236{
237 INIT_VNET_INET(curvnet);
238
239 /* XXX TODO walk the hashtable and free all entries */
240
241 callout_drain(&V_tcp_hc_callout);
242}
243#endif
244
233/*
234 * Internal function: look up an entry in the hostcache or return NULL.
235 *
236 * If an entry has been returned, the caller becomes responsible for
237 * unlocking the bucket row after he is done reading/modifying the entry.
238 */
239static struct hc_metrics *
240tcp_hc_lookup(struct in_conninfo *inc)

--- 427 unchanged lines hidden ---
245/*
246 * Internal function: look up an entry in the hostcache or return NULL.
247 *
248 * If an entry has been returned, the caller becomes responsible for
249 * unlocking the bucket row after he is done reading/modifying the entry.
250 */
251static struct hc_metrics *
252tcp_hc_lookup(struct in_conninfo *inc)

--- 427 unchanged lines hidden ---