debug.c revision 675054ac8b27a3e5b50a1542935a3b1dec753bef
/*
* Copyright (c) 1995 Danny Gasparovski.
* Portions copyright (c) 2000 Kelly Price.
*
* Please read the file COPYRIGHT for the
* terms and conditions of the copyright.
*/
#include <slirp.h>
/* Carry over one item from main.c so that the tty's restored.
extern struct termios slirp_tty_settings;
extern int slirp_tty_restore;
/*
* Dump a packet in the same format as tcpdump -x
*/
#ifdef DEBUG
void
dump_packet(void *dat, int n)
{
}
#endif
#if 0
/*
* Statistic routines
*
* These will print statistics to the screen, the debug file (dfd), or
* a buffer, depending on "type", so that the stats can be sent over
* the link as well.
*/
void
{
char buff[512];
lprint(" \r\n");
if (if_comp & IF_COMPRESS)
else if (if_comp & IF_NOCOMPRESS)
else
lprint(" using %s encapsulation (VJ compression is %s)\r\n", (
#ifdef USE_PPP
#endif
"SLIP"), buff);
#ifndef FULL_BOLT
#endif
lprint("Interface stats:\r\n");
}
void
{
}
#endif
void
{
lprint(" \r\n");
lprint("IP stats:\r\n");
lprint(" %6d total packets received (%d were unaligned)\r\n",
}
#if 0
void
vjstats()
{
lprint(" \r\n");
lprint("VJ compression stats:\r\n");
lprint(" %6d outbound packets (%d compressed)\r\n",
lprint(" %6d searches for connection stats (%d misses)\r\n",
}
#endif
void
{
lprint(" \r\n");
lprint("TCP stats:\r\n");
lprint(" %6d data packets (%d bytes)\r\n",
lprint(" %6d data packets retransmitted (%d bytes)\r\n",
lprint(" %6d ack-only packets (%d delayed)\r\n",
lprint(" %6d acks (for %d bytes)\r\n",
lprint(" %6d packets received in sequence (%d bytes)\r\n",
lprint(" %6d completely duplicate packets (%d bytes)\r\n",
lprint(" %6d packets with some duplicate data (%d bytes duped)\r\n",
lprint(" %6d out-of-order packets (%d bytes)\r\n",
lprint(" %6d packets of data after window (%d bytes)\r\n",
lprint(" %6d discarded for bad header offset fields\r\n",
lprint(" %6d connections closed (including %d drop)\r\n",
lprint(" %6d segments we tried to get rtt (%d succeeded)\r\n",
lprint(" %6d connections dropped by rxmt timeout\r\n",
/* lprint(" Packets received too short: %d\r\n", tcpstat.tcps_rcvshort); */
/* lprint(" Segments dropped due to PAWS: %d\r\n", tcpstat.tcps_pawsdrop); */
}
void
{
lprint(" \r\n");
lprint("UDP stats:\r\n");
}
void
{
lprint(" \r\n");
lprint("ICMP stats:\r\n");
}
void
{
struct mbuf *m;
int i;
lprint(" \r\n");
lprint("Mbuf stats:\r\n");
i = 0;
i++;
lprint(" %6d mbufs on free list\r\n", i);
i = 0;
i++;
lprint(" %6d mbufs on used list\r\n", i);
}
void
{
char buff[256];
int n;
lprint(" \r\n");
"Proto[state] Sock Local Address, Port Remote Address, Port RecvQ SendQ\r\n");
while (n < 17)
buff[n++] = ' ';
buff[17] = 0;
lprint("%s %3d %15s %5d ",
lprint("%15s %5d %5d %5d\r\n",
}
while (n < 17)
buff[n++] = ' ';
buff[17] = 0;
lprint("%s %3d %15s %5d ",
lprint("%15s %5d %5d %5d\r\n",
}
}