mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 19:49:45 +03:00
[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.
This commit is contained in:
@@ -144,15 +144,15 @@ tcp_dump_state ( struct tcp_connection *tcp ) {
|
|||||||
static inline __attribute__ (( always_inline )) void
|
static inline __attribute__ (( always_inline )) void
|
||||||
tcp_dump_flags ( struct tcp_connection *tcp, unsigned int flags ) {
|
tcp_dump_flags ( struct tcp_connection *tcp, unsigned int flags ) {
|
||||||
if ( flags & TCP_RST )
|
if ( flags & TCP_RST )
|
||||||
DBGC ( tcp, " RST" );
|
DBGC2 ( tcp, " RST" );
|
||||||
if ( flags & TCP_SYN )
|
if ( flags & TCP_SYN )
|
||||||
DBGC ( tcp, " SYN" );
|
DBGC2 ( tcp, " SYN" );
|
||||||
if ( flags & TCP_PSH )
|
if ( flags & TCP_PSH )
|
||||||
DBGC ( tcp, " PSH" );
|
DBGC2 ( tcp, " PSH" );
|
||||||
if ( flags & TCP_FIN )
|
if ( flags & TCP_FIN )
|
||||||
DBGC ( tcp, " FIN" );
|
DBGC2 ( tcp, " FIN" );
|
||||||
if ( flags & TCP_ACK )
|
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 ) );
|
tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
|
||||||
|
|
||||||
/* Dump header */
|
/* Dump header */
|
||||||
DBGC ( tcp, "TCP %p TX %d->%d %08x..%08zx %08x %4zd",
|
DBGC2 ( tcp, "TCP %p TX %d->%d %08x..%08zx %08x %4zd",
|
||||||
tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
|
tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
|
||||||
ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ),
|
ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) + seq_len ),
|
||||||
ntohl ( tcphdr->ack ), len );
|
ntohl ( tcphdr->ack ), len );
|
||||||
tcp_dump_flags ( tcp, tcphdr->flags );
|
tcp_dump_flags ( tcp, tcphdr->flags );
|
||||||
DBGC ( tcp, "\n" );
|
DBGC2 ( tcp, "\n" );
|
||||||
|
|
||||||
/* Transmit packet */
|
/* Transmit packet */
|
||||||
return tcpip_tx ( iobuf, &tcp_protocol, NULL, &tcp->peer, NULL,
|
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 ) );
|
tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );
|
||||||
|
|
||||||
/* Dump header */
|
/* Dump header */
|
||||||
DBGC ( tcp, "TCP %p TX %d->%d %08x..%08x %08x %4d",
|
DBGC2 ( tcp, "TCP %p TX %d->%d %08x..%08x %08x %4d",
|
||||||
tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
|
tcp, ntohs ( tcphdr->src ), ntohs ( tcphdr->dest ),
|
||||||
ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ),
|
ntohl ( tcphdr->seq ), ( ntohl ( tcphdr->seq ) ),
|
||||||
ntohl ( tcphdr->ack ), 0 );
|
ntohl ( tcphdr->ack ), 0 );
|
||||||
tcp_dump_flags ( tcp, tcphdr->flags );
|
tcp_dump_flags ( tcp, tcphdr->flags );
|
||||||
DBGC ( tcp, "\n" );
|
DBGC2 ( tcp, "\n" );
|
||||||
|
|
||||||
/* Transmit packet */
|
/* Transmit packet */
|
||||||
return tcpip_tx ( iobuf, &tcp_protocol, NULL, st_dest,
|
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 );
|
len = iob_len ( iobuf );
|
||||||
|
|
||||||
/* Dump header */
|
/* Dump header */
|
||||||
DBGC ( tcp, "TCP %p RX %d<-%d %08x %08x..%08zx %4zd",
|
DBGC2 ( tcp, "TCP %p RX %d<-%d %08x %08x..%08zx %4zd",
|
||||||
tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ),
|
tcp, ntohs ( tcphdr->dest ), ntohs ( tcphdr->src ),
|
||||||
ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ),
|
ntohl ( tcphdr->ack ), ntohl ( tcphdr->seq ),
|
||||||
( ntohl ( tcphdr->seq ) + len +
|
( ntohl ( tcphdr->seq ) + len +
|
||||||
( ( tcphdr->flags & ( TCP_SYN | TCP_FIN ) ) ? 1 : 0 ) ), len);
|
( ( tcphdr->flags & ( TCP_SYN | TCP_FIN ) ) ? 1 : 0 )), len);
|
||||||
tcp_dump_flags ( tcp, tcphdr->flags );
|
tcp_dump_flags ( tcp, tcphdr->flags );
|
||||||
DBGC ( tcp, "\n" );
|
DBGC2 ( tcp, "\n" );
|
||||||
|
|
||||||
/* If no connection was found, send RST */
|
/* If no connection was found, send RST */
|
||||||
if ( ! tcp ) {
|
if ( ! tcp ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user