mirror of https://github.com/xemu-project/xemu.git
slirp/debug: Print IP addresses in human readable form
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
787bbc306e
commit
3ad9319f5c
|
@ -33,7 +33,7 @@ void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN])
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
DEBUG_CALL("arp_table_add");
|
DEBUG_CALL("arp_table_add");
|
||||||
DEBUG_ARG("ip = 0x%x", ip_addr);
|
DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr));
|
||||||
DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n",
|
DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||||
ethaddr[0], ethaddr[1], ethaddr[2],
|
ethaddr[0], ethaddr[1], ethaddr[2],
|
||||||
ethaddr[3], ethaddr[4], ethaddr[5]));
|
ethaddr[3], ethaddr[4], ethaddr[5]));
|
||||||
|
@ -67,7 +67,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
DEBUG_CALL("arp_table_search");
|
DEBUG_CALL("arp_table_search");
|
||||||
DEBUG_ARG("ip = 0x%x", ip_addr);
|
DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr));
|
||||||
|
|
||||||
/* If broadcast address */
|
/* If broadcast address */
|
||||||
if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) {
|
if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) {
|
||||||
|
|
|
@ -701,10 +701,10 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr,
|
||||||
memset(&addr, 0, addrlen);
|
memset(&addr, 0, addrlen);
|
||||||
|
|
||||||
DEBUG_CALL("tcp_listen");
|
DEBUG_CALL("tcp_listen");
|
||||||
DEBUG_ARG("haddr = %x", haddr);
|
DEBUG_ARG("haddr = %s", inet_ntoa(*(struct in_addr *)&haddr));
|
||||||
DEBUG_ARG("hport = %d", hport);
|
DEBUG_ARG("hport = %d", ntohs(hport));
|
||||||
DEBUG_ARG("laddr = %x", laddr);
|
DEBUG_ARG("laddr = %s", inet_ntoa(*(struct in_addr *)&laddr));
|
||||||
DEBUG_ARG("lport = %d", lport);
|
DEBUG_ARG("lport = %d", ntohs(lport));
|
||||||
DEBUG_ARG("flags = %x", flags);
|
DEBUG_ARG("flags = %x", flags);
|
||||||
|
|
||||||
so = socreate(slirp);
|
so = socreate(slirp);
|
||||||
|
|
|
@ -241,8 +241,8 @@ int udp_output(struct socket *so, struct mbuf *m,
|
||||||
DEBUG_CALL("udp_output");
|
DEBUG_CALL("udp_output");
|
||||||
DEBUG_ARG("so = %p", so);
|
DEBUG_ARG("so = %p", so);
|
||||||
DEBUG_ARG("m = %p", m);
|
DEBUG_ARG("m = %p", m);
|
||||||
DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr);
|
DEBUG_ARG("saddr = %s", inet_ntoa(saddr->sin_addr));
|
||||||
DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr);
|
DEBUG_ARG("daddr = %s", inet_ntoa(daddr->sin_addr));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adjust for header
|
* Adjust for header
|
||||||
|
|
Loading…
Reference in New Issue