Watt-32 tcp/ip  2.2 dev-rel.10
sock_dbu.c
Go to the documentation of this file.
1 
4 #include <stdio.h>
5 
6 #include "copyrigh.h"
7 #include "wattcp.h"
8 #include "strings.h"
9 #include "misc.h"
10 #include "timer.h"
11 #include "pcdbug.h"
12 #include "pcbuf.h"
13 
14 void W32_CALL sock_debugdump (const sock_type *s)
15 {
16 #if defined(USE_DEBUG)
17  const _tcp_Socket *tcp = &s->tcp;
18 
19  if (s->raw.ip_type == IP4_TYPE)
20  return;
21 
22 #if defined(__SMALL__) && !defined(__SMALL32__)
23  (*_printf) ("next %04X\n", s->tcp.next);
24 #elif defined(__LARGE__)
25  (*_printf) ("next %04X:%04X\n", FP_SEG(s->tcp.next), FP_OFF(s->tcp.next));
26 #else
27  (*_printf) ("next %" ADDR_FMT "\n", ADDR_CAST(s->tcp.next));
28 #endif
29 
30  (*_printf) ("type %d\n", s->tcp.ip_type);
31 
32  (*_printf) ("stat/error %s\n", s->tcp.err_msg ? s->tcp.err_msg : "(none)");
33  (*_printf) ("usr-timer %08lX (%sexpired)\n",
34  s->tcp.usertimer, chk_timeout(s->tcp.usertimer) ? "" : "not ");
35 
36  switch (s->tcp.ip_type)
37  {
38  case UDP_PROTO:
39  (*_printf) ("udp rxdata %u `%.*s'\n",
40  s->tcp.rx_datalen, s->tcp.rx_datalen, s->tcp.rx_data);
41  break;
42  case TCP_PROTO:
43  (*_printf) ("tcp rxdata %u `%.*s'\n",
44  tcp->rx_datalen, tcp->rx_datalen, tcp->rx_data);
45  (*_printf) ("tcp state %u (%s)\n",
46  tcp->state, tcpStateName(tcp->state));
47  break;
48  }
49 #else
50  ARGSUSED (s);
51 #endif
52 }
WORD ip_type
same ofs as for udp/tcp Socket
Definition: wattcp.h:695
Core definitions.
BOOL W32_CALL chk_timeout(DWORD value)
Check if milli-sec value has expired:
Definition: timer.c:547
struct tcp_Socket * next
link to next tcp-socket
Definition: wattcp.h:613
UINT state
tcp connection state
Definition: wattcp.h:622