40#include "opt_tcpdebug.h"
52#include <sys/kernel.h>
56#include <sys/protosw.h>
57#include <sys/socket.h>
74static int tcpconsdebug = 0;
100 struct tcphdr *th,
int req)
113 bzero(td,
sizeof(*td));
115 isipv6 = (ipgen != NULL && ((
struct ip *)ipgen)->ip_v == 6) ? 1 : 0;
119 (isipv6 != 0) ? AF_INET6 :
139 bcopy(ipgen, td->td_ip6buf,
sizeof(td->td_ip6buf));
161 if (tcpconsdebug == 0)
164 printf(
"%p %s:", tp, tcpstates[ostate]);
167 printf(
"%s ", tanames[act]);
172 if (ipgen == NULL || th == NULL)
180 ntohs(((
struct ip *)ipgen)->
ip_len);
186 len -=
sizeof (
struct tcphdr);
188 printf(
"[%x..%x)", seq, seq+len);
191 printf(
"@%x, urp=%x", ack, th->th_urp);
196 if (tcp_get_flags(th) & TH_##f) { \
197 printf("%s%s", cp, #f); \
201 pf(SYN); pf(ACK); pf(FIN); pf(RST); pf(PUSH); pf(URG);
207 printf(
"%s", prurequests[req&0xff]);
208 if ((req & 0xff) == PRU_SLOWTIMO)
209 printf(
"<%s>", tcptimers[req>>8]);
213 printf(
" -> %s", tcpstates[tp->
t_state]);
219 "\trcv_(nxt,wnd,up) (%lx,%lx,%lx) snd_(una,nxt,max) (%lx,%lx,%lx)\n",
222 printf(
"\tsnd_(wl1,wl2,wnd) (%lx,%lx,%lx)\n",
struct tcp_debug::@39 td_ti6
MTX_SYSINIT(tcp_debug_mtx, &tcp_debug_mtx, "tcp_debug_mtx", MTX_DEF)
void tcp_trace(short act, short ostate, struct tcpcb *tp, void *ipgen, struct tcphdr *th, int req)
static uint16_t tcp_get_flags(const struct tcphdr *th)