Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_subr.c
| Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | |||||
| SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, CTLFLAG_VNET | CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, CTLFLAG_VNET | CTLFLAG_RW, | ||||
| &VNET_NAME(tcp_do_rfc1323), 0, | &VNET_NAME(tcp_do_rfc1323), 0, | ||||
| "Enable rfc1323 (high performance TCP) extensions"); | "Enable rfc1323 (high performance TCP) extensions"); | ||||
| static int tcp_log_debug = 0; | static int tcp_log_debug = 0; | ||||
| SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, | ||||
| &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); | &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); | ||||
| static int tcp_log_newconn_failed = 0; | |||||
| SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_newconn_failed, CTLFLAG_RW, | |||||
| &tcp_log_newconn_failed, 0, | |||||
| "Log addresses if creating a new connection from the syncache fails"); | |||||
| static int tcp_log_newconn_failed_ratelimit = -1; | |||||
| SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_newconn_failed_ratelimit, CTLFLAG_RW, | |||||
| &tcp_log_newconn_failed_ratelimit, 0, | |||||
| "Per second limit for logging a failed new connection from the syncache"); | |||||
| static int tcp_tcbhashsize; | static int tcp_tcbhashsize; | ||||
| SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, | ||||
| &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); | &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); | ||||
| static int do_tcpdrain = 1; | static int do_tcpdrain = 1; | ||||
| SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_tcpdrain, CTLFLAG_RW, &do_tcpdrain, 0, | SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_tcpdrain, CTLFLAG_RW, &do_tcpdrain, 0, | ||||
| "Enable tcp_drain routine for extra help when low on mbufs"); | "Enable tcp_drain routine for extra help when low on mbufs"); | ||||
| ▲ Show 20 Lines • Show All 2,509 Lines • ▼ Show 20 Lines | tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, | ||||
| const void *ip6hdr) | const void *ip6hdr) | ||||
| { | { | ||||
| /* Is logging enabled? */ | /* Is logging enabled? */ | ||||
| if (tcp_log_in_vain == 0) | if (tcp_log_in_vain == 0) | ||||
| return (NULL); | return (NULL); | ||||
| return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); | return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); | ||||
| } | |||||
| char * | |||||
| tcp_log_newconn(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, | |||||
| const void *ip6hdr) | |||||
| { | |||||
| static struct timeval lasttime; | |||||
| static int curpps; | |||||
| if ((tcp_log_newconn_failed || tcp_log_debug) && | |||||
| ppsratecheck(&lasttime, &curpps, tcp_log_newconn_failed_ratelimit)) | |||||
| return (tcp_log_addr(inc, th, ip4hdr, ip6hdr)); | |||||
| return (NULL); | |||||
| } | } | ||||
| char * | char * | ||||
| tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, | tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, | ||||
| const void *ip6hdr) | const void *ip6hdr) | ||||
| { | { | ||||
| /* Is logging enabled? */ | /* Is logging enabled? */ | ||||
| ▲ Show 20 Lines • Show All 154 Lines • Show Last 20 Lines | |||||