diff options
author | Michael Brown <mcb30@etherboot.org> | 2009-06-23 13:34:48 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2009-06-23 13:35:45 +0100 |
commit | a2f753ba649fe0ae7fdfe20dd24f743e2c82841a (patch) | |
tree | 854460d7f22287fd6178db01e8ebd1493168c654 | |
parent | f8448735b09af59760eb10fa4c8e759274d0830c (diff) | |
download | ipxe-a2f753ba649fe0ae7fdfe20dd24f743e2c82841a.tar.gz |
[tcp] Move high-frequency debug messages to DBGLVL_EXTRA
This makes it possible to leave TCP debugging enabled in order to see
interesting TCP events, without flooding the console with at least one
message per packet.
-rw-r--r-- | src/net/tcp.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/net/tcp.c b/src/net/tcp.c index 29e233fa5..b03dfadfe 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -144,15 +144,15 @@ tcp_dump_state ( struct tcp_connection *tcp ) { static inline __attribute__ (( always_inline )) void tcp_dump_flags ( struct tcp_connection *tcp, unsigned int flags ) { if ( flags & TCP_RST ) - DBGC ( tcp, " RST" ); + DBGC2 ( tcp, " RST" ); if ( flags & TCP_SYN ) - DBGC ( tcp, " SYN" ); + DBGC2 ( tcp, " SYN" ); if ( flags & TCP_PSH ) - DBGC ( tcp, " PSH" ); + DBGC2 ( tcp, " PSH" ); if ( flags & TCP_FIN ) - DBGC ( tcp, " FIN" ); + DBGC2 ( tcp, " FIN" ); if ( flags & TCP_ACK ) - DBGC ( tcp, " ACK" ); + DBGC2 ( tcp, " ACK" ); } /*************************************************************************** @@ -487,12 +487,12 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) { tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) ); /* Dump header */ - DBGC ( tcp, "TCP %p TX %d->%d %08x..%08zx %08x %4zd", - tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ), - ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ), - ntohl ( tcphdr->ack ), len ); + DBGC2 ( tcp, "TCP %p TX %d->%d %08x..%08zx %08x %4zd", + tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ), + ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ), + ntohl ( tcphdr->ack ), len ); tcp_dump_flags ( tcp, tcphdr->flags ); - DBGC ( tcp, "\n" ); + DBGC2 ( tcp, "\n" ); /* Transmit packet */ return tcpip_tx ( iobuf, &tcp_protocol, NULL, &tcp->peer, NULL, @@ -568,12 +568,12 @@ static int tcp_xmit_reset ( struct tcp_connection *tcp, tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) ); /* Dump header */ - DBGC ( tcp, "TCP %p TX %d->%d %08x..%08x %08x %4d", - tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ), - ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ), - ntohl ( tcphdr->ack ), 0 ); + DBGC2 ( tcp, "TCP %p TX %d->%d %08x..%08x %08x %4d", + tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ), + ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ), + ntohl ( tcphdr->ack ), 0 ); tcp_dump_flags ( tcp, tcphdr->flags ); - DBGC ( tcp, "\n" ); + DBGC2 ( tcp, "\n" ); /* Transmit packet */ return tcpip_tx ( iobuf, &tcp_protocol, NULL, st_dest, @@ -913,13 +913,13 @@ static int tcp_rx ( struct io_buffer *iobuf, len = iob_len ( iobuf ); /* Dump header */ - DBGC ( tcp, "TCP %p RX %d<-%d %08x %08x..%08zx %4zd", - tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ), - ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ), - ( ntohl ( tcphdr->seq ) + len + - ( ( tcphdr->flags & ( TCP_SYN | TCP_FIN ) ) ? 1 : 0 ) ), len); + DBGC2 ( tcp, "TCP %p RX %d<-%d %08x %08x..%08zx %4zd", + tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ), + ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ), + ( ntohl ( tcphdr->seq ) + len + + ( ( tcphdr->flags & ( TCP_SYN | TCP_FIN ) ) ? 1 : 0 )), len); tcp_dump_flags ( tcp, tcphdr->flags ); - DBGC ( tcp, "\n" ); + DBGC2 ( tcp, "\n" ); /* If no connection was found, send RST */ if ( ! tcp ) { |