FreeBSD kernel IPv4 code
|
#include <sys/queue.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
#include <sys/eventhandler.h>
#include <machine/atomic.h>
#include <netinet/tcp_var.h>
#include <netinet/tcp_pcap.h>
Go to the source code of this file.
Macros | |
#define | M_LEADINGSPACE_NOWRITE(m) ((m)->m_data - M_START(m)) |
#define | V_tcp_pcap_packets VNET(tcp_pcap_packets) |
Functions | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcp_pcap_aggressive_free, CTLFLAG_RW, &tcp_pcap_aggressive_free, 0, "Free saved packets when the memory system comes under pressure") | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_cur, CTLFLAG_RD, &tcp_pcap_clusters_referenced_cur, 0, "Number of clusters currently referenced on TCP PCAP queues") | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_max, CTLFLAG_RW, &tcp_pcap_clusters_referenced_max, 0, "Maximum number of clusters allowed to be referenced on TCP PCAP " "queues") | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcp_pcap_alloc_reuse_ext, CTLFLAG_RD, &tcp_pcap_alloc_reuse_ext, 0, "Number of mbufs with external storage reused for the TCP PCAP " "functionality") | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcp_pcap_alloc_reuse_mbuf, CTLFLAG_RD, &tcp_pcap_alloc_reuse_mbuf, 0, "Number of mbufs with internal storage reused for the TCP PCAP " "functionality") | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcp_pcap_alloc_new_mbuf, CTLFLAG_RD, &tcp_pcap_alloc_new_mbuf, 0, "Number of new mbufs allocated for the TCP PCAP functionality") | |
VNET_DEFINE (int, tcp_pcap_packets)=0 | |
SYSCTL_INT (_net_inet_tcp, OID_AUTO, tcp_pcap_packets, CTLFLAG_RW, &VNET_NAME(tcp_pcap_packets), 0, "Default number of packets saved per direction per TCPCB") | |
static void | tcp_pcap_max_set (void) |
void | tcp_pcap_init (void) |
static __inline bool | tcp_pcap_take_cluster_reference (void) |
static __inline void | tcp_pcap_adj_cluster_reference (struct mbuf *m, int adj) |
static void | tcp_pcap_m_freem (struct mbuf *mb) |
static void | tcp_pcap_copy_bestfit (struct tcphdr *th, struct mbuf *m, struct mbuf *n) |
void | tcp_pcap_add (struct tcphdr *th, struct mbuf *m, struct mbufq *queue) |
void | tcp_pcap_drain (struct mbufq *queue) |
void | tcp_pcap_tcpcb_init (struct tcpcb *tp) |
void | tcp_pcap_set_sock_max (struct mbufq *queue, int newval) |
int | tcp_pcap_get_sock_max (struct mbufq *queue) |
Variables | |
int | tcp_pcap_aggressive_free = 1 |
static int | tcp_pcap_clusters_referenced_cur = 0 |
static int | tcp_pcap_clusters_referenced_max = 0 |
static int | tcp_pcap_alloc_reuse_ext = 0 |
static int | tcp_pcap_alloc_reuse_mbuf = 0 |
static int | tcp_pcap_alloc_new_mbuf = 0 |
#define M_LEADINGSPACE_NOWRITE | ( | m | ) | ((m)->m_data - M_START(m)) |
Definition at line 42 of file tcp_pcap.c.
#define V_tcp_pcap_packets VNET(tcp_pcap_packets) |
Definition at line 76 of file tcp_pcap.c.
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
tcp_pcap_aggressive_free | , | ||
CTLFLAG_RW | , | ||
& | tcp_pcap_aggressive_free, | ||
0 | , | ||
"Free saved packets when the memory system comes under pressure" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
tcp_pcap_alloc_new_mbuf | , | ||
CTLFLAG_RD | , | ||
& | tcp_pcap_alloc_new_mbuf, | ||
0 | , | ||
"Number of new mbufs allocated for the TCP PCAP functionality" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
tcp_pcap_alloc_reuse_ext | , | ||
CTLFLAG_RD | , | ||
& | tcp_pcap_alloc_reuse_ext, | ||
0 | , | ||
"Number of mbufs with external storage reused for the TCP PCAP " "functionality" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
tcp_pcap_alloc_reuse_mbuf | , | ||
CTLFLAG_RD | , | ||
& | tcp_pcap_alloc_reuse_mbuf, | ||
0 | , | ||
"Number of mbufs with internal storage reused for the TCP PCAP " "functionality" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
tcp_pcap_clusters_referenced_cur | , | ||
CTLFLAG_RD | , | ||
& | tcp_pcap_clusters_referenced_cur, | ||
0 | , | ||
"Number of clusters currently referenced on TCP PCAP queues" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
tcp_pcap_clusters_referenced_max | , | ||
CTLFLAG_RW | , | ||
& | tcp_pcap_clusters_referenced_max, | ||
0 | , | ||
"Maximum number of clusters allowed to be referenced on TCP PCAP " "queues" | |||
) |
SYSCTL_INT | ( | _net_inet_tcp | , |
OID_AUTO | , | ||
tcp_pcap_packets | , | ||
CTLFLAG_RW | , | ||
& | VNET_NAMEtcp_pcap_packets, | ||
0 | , | ||
"Default number of packets saved per direction per TCPCB" | |||
) |
void tcp_pcap_add | ( | struct tcphdr * | th, |
struct mbuf * | m, | ||
struct mbufq * | queue | ||
) |
Definition at line 264 of file tcp_pcap.c.
References M_LEADINGSPACE_NOWRITE, tcp_pcap_adj_cluster_reference(), tcp_pcap_alloc_new_mbuf, tcp_pcap_alloc_reuse_ext, tcp_pcap_alloc_reuse_mbuf, tcp_pcap_clusters_referenced_cur, tcp_pcap_copy_bestfit(), tcp_pcap_m_freem(), and tcp_pcap_take_cluster_reference().
Referenced by tcp_default_output(), and tcp_do_segment().
|
static |
Definition at line 120 of file tcp_pcap.c.
References tcp_pcap_clusters_referenced_cur.
Referenced by tcp_pcap_add().
|
static |
Definition at line 159 of file tcp_pcap.c.
Referenced by tcp_pcap_add().
void tcp_pcap_drain | ( | struct mbufq * | queue | ) |
Definition at line 426 of file tcp_pcap.c.
References tcp_pcap_m_freem().
Referenced by tcp_discardcb(), and tcp_drain().
int tcp_pcap_get_sock_max | ( | struct mbufq * | queue | ) |
Definition at line 449 of file tcp_pcap.c.
Referenced by tcp_default_ctloutput().
void tcp_pcap_init | ( | void | ) |
Definition at line 90 of file tcp_pcap.c.
References tcp_pcap_max_set().
Referenced by tcp_init().
|
static |
Definition at line 139 of file tcp_pcap.c.
References tcp_pcap_clusters_referenced_cur.
Referenced by tcp_pcap_add(), tcp_pcap_drain(), and tcp_pcap_set_sock_max().
|
static |
Definition at line 83 of file tcp_pcap.c.
References tcp_pcap_clusters_referenced_max.
Referenced by tcp_pcap_init().
void tcp_pcap_set_sock_max | ( | struct mbufq * | queue, |
int | newval | ||
) |
Definition at line 441 of file tcp_pcap.c.
References tcp_pcap_m_freem().
Referenced by tcp_default_ctloutput().
|
static |
Definition at line 104 of file tcp_pcap.c.
References tcp_pcap_clusters_referenced_cur, and tcp_pcap_clusters_referenced_max.
Referenced by tcp_pcap_add().
void tcp_pcap_tcpcb_init | ( | struct tcpcb * | tp | ) |
Definition at line 434 of file tcp_pcap.c.
References V_tcp_pcap_packets.
Referenced by tcp_newtcpcb().
|
pure virtual |
int tcp_pcap_aggressive_free = 1 |
Definition at line 45 of file tcp_pcap.c.
Referenced by tcp_drain().
|
static |
Definition at line 62 of file tcp_pcap.c.
Referenced by tcp_pcap_add().
|
static |
Definition at line 60 of file tcp_pcap.c.
Referenced by tcp_pcap_add().
|
static |
Definition at line 61 of file tcp_pcap.c.
Referenced by tcp_pcap_add().
|
static |
Definition at line 46 of file tcp_pcap.c.
Referenced by tcp_pcap_add(), tcp_pcap_adj_cluster_reference(), tcp_pcap_m_freem(), and tcp_pcap_take_cluster_reference().
|
static |
Definition at line 47 of file tcp_pcap.c.
Referenced by tcp_pcap_max_set(), and tcp_pcap_take_cluster_reference().