tcp_pcap.c (295482) | tcp_pcap.c (302374) |
---|---|
1/*- 2 * Copyright (c) 2015 3 * Jonathan Looney. 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2015 3 * Jonathan Looney. 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/netinet/tcp_pcap.c 295482 2016-02-10 18:54:18Z glebius $ | 26 * $FreeBSD: head/sys/netinet/tcp_pcap.c 302374 2016-07-06 16:17:13Z jtl $ |
27 */ 28 29#include <sys/queue.h> 30#include <sys/param.h> 31#include <sys/types.h> 32#include <sys/socket.h> 33#include <sys/socketvar.h> 34#include <sys/sysctl.h> 35#include <sys/systm.h> 36#include <sys/mbuf.h> 37#include <sys/eventhandler.h> 38#include <machine/atomic.h> 39#include <netinet/tcp_var.h> 40#include <netinet/tcp_pcap.h> 41 42#define M_LEADINGSPACE_NOWRITE(m) \ 43 ((m)->m_data - M_START(m)) 44 | 27 */ 28 29#include <sys/queue.h> 30#include <sys/param.h> 31#include <sys/types.h> 32#include <sys/socket.h> 33#include <sys/socketvar.h> 34#include <sys/sysctl.h> 35#include <sys/systm.h> 36#include <sys/mbuf.h> 37#include <sys/eventhandler.h> 38#include <machine/atomic.h> 39#include <netinet/tcp_var.h> 40#include <netinet/tcp_pcap.h> 41 42#define M_LEADINGSPACE_NOWRITE(m) \ 43 ((m)->m_data - M_START(m)) 44 |
45int tcp_pcap_aggressive_free = 1; |
|
45static int tcp_pcap_clusters_referenced_cur = 0; 46static int tcp_pcap_clusters_referenced_max = 0; 47 | 46static int tcp_pcap_clusters_referenced_cur = 0; 47static int tcp_pcap_clusters_referenced_max = 0; 48 |
49SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_aggressive_free, 50 CTLFLAG_RW, &tcp_pcap_aggressive_free, 0, 51 "Free saved packets when the memory system comes under pressure"); |
|
48SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_cur, 49 CTLFLAG_RD, &tcp_pcap_clusters_referenced_cur, 0, 50 "Number of clusters currently referenced on TCP PCAP queues"); 51SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_max, 52 CTLFLAG_RW, &tcp_pcap_clusters_referenced_max, 0, 53 "Maximum number of clusters allowed to be referenced on TCP PCAP " 54 "queues"); 55 --- 386 unchanged lines hidden --- | 52SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_cur, 53 CTLFLAG_RD, &tcp_pcap_clusters_referenced_cur, 0, 54 "Number of clusters currently referenced on TCP PCAP queues"); 55SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_max, 56 CTLFLAG_RW, &tcp_pcap_clusters_referenced_max, 0, 57 "Maximum number of clusters allowed to be referenced on TCP PCAP " 58 "queues"); 59 --- 386 unchanged lines hidden --- |