]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
slirp debug logging (print format) changes
authorFrode Solheim <frode@fs-uae.net>
Fri, 4 Sep 2015 22:21:29 +0000 (00:21 +0200)
committerFrode Solheim <frode@fs-uae.net>
Fri, 4 Sep 2015 22:21:29 +0000 (00:21 +0200)
slirp/if.cpp
slirp/ip_icmp.cpp
slirp/ip_input.cpp
slirp/ip_output.cpp
slirp/mbuf.cpp
slirp/sbuf.cpp
slirp/socket.cpp
slirp/tcp_input.cpp
slirp/tcp_output.cpp
slirp/tcp_subr.cpp
slirp/udp.cpp

index 65d398be69549967d3b309f6ff4f8d896b3397ca..2bae5185187d44bfdf8fb9e96b5cb0fe787a7277 100644 (file)
@@ -157,8 +157,8 @@ void if_output(struct socket *so, struct mbuf *ifm)
        int on_fastq = 1;
        
        DEBUG_CALL("if_output");
-       DEBUG_ARG("so = %lx", (long)so);
-       DEBUG_ARG("ifm = %lx", (long)ifm);
+       DEBUG_ARG("so = %p", so);
+       DEBUG_ARG("ifm = %p", ifm);
        
        /*
         * First remove the mbuf from m_usedlist,
index 65becfe743fdd978bfe6077906f339bb05e6f274..f82648c8d9826ea855aae067a18cac2741007253 100644 (file)
@@ -128,7 +128,7 @@ void icmp_input(struct mbuf *m, int hlen)
   /* int code; */
        
   DEBUG_CALL("icmp_input");
-  DEBUG_ARG("m = %lx", (long )m);
+  DEBUG_ARG("m = %p", m);
   DEBUG_ARG("m_len = %d", m->m_len);
 
   icmpstat.icps_received++;
@@ -262,7 +262,7 @@ void icmp_error(struct mbuf *msrc, u_char type, u_char code, int minsize, const
   register struct mbuf *m;
 
   DEBUG_CALL("icmp_error");
-  DEBUG_ARG("msrc = %lx", (long )msrc);
+  DEBUG_ARG("msrc = %p", msrc);
   DEBUG_ARG("msrc_len = %d", msrc->m_len);
 
   if(type!=ICMP_UNREACH && type!=ICMP_TIMXCEED) goto end_error;
index c594556aa2d0507adf6f18b8c364c952607b8584..9a70a3a673b6a00ea9fd1da68e76a4b9a65ed748 100644 (file)
@@ -76,7 +76,7 @@ void ip_input(struct mbuf *m)
        int hlen;
        
        DEBUG_CALL("ip_input");
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("m = %p", m);
        DEBUG_ARG("m_len = %d", m->m_len);
 
        ipstat.ips_total++;
@@ -249,9 +249,9 @@ struct ip *ip_reass(struct ip *ip, struct ipq *fp)
        int i, next;
        
        DEBUG_CALL("ip_reass");
-       DEBUG_ARG("ip = %lx", (long)ip);
-       DEBUG_ARG("fp = %lx", (long)fp);
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("ip = %p", ip);
+       DEBUG_ARG("fp = %p", fp);
+       DEBUG_ARG("m = %p", m);
 
        /*
         * Presence of header sizes in mbufs
@@ -416,7 +416,7 @@ void ip_freef(struct ipq *fp)
 void ip_enq(struct ipasfrag *p, struct ipasfrag *prev)
 {
        DEBUG_CALL("ip_enq");
-       DEBUG_ARG("prev = %lx", (long)prev);
+       DEBUG_ARG("prev = %p", prev);
        p->ipf_prev =  prev;
        p->ipf_next = prev->ipf_next;
        ((struct ipasfrag *)(prev->ipf_next))->ipf_prev = p;
index 114a56d13c8e3cf3514e3f58db1bccaed5a5ed50..146922e6ac5daa88c5ec92101af152bacb1001c9 100644 (file)
@@ -56,8 +56,8 @@ int ip_output(struct socket *so, struct mbuf *m0)
        int len, off, error = 0;
 
        DEBUG_CALL("ip_output");
-       DEBUG_ARG("so = %lx", (long)so);
-       DEBUG_ARG("m0 = %lx", (long)m0);
+       DEBUG_ARG("so = %p", so);
+       DEBUG_ARG("m0 = %p", m0);
        
        /* We do no options */
 /*     if (opt) {
index 41ea3e4d28f4e3c4be64888278d3d718aeabf2f2..e2b00851e2c4a6a2b00abbf88a5ae9bb274d1c69 100644 (file)
@@ -103,7 +103,7 @@ struct mbuf *m_get(void)
        m->m_nextpkt = 0;
        m->m_prevpkt = 0;
 end_error:
-       DEBUG_ARG("m = %lx", (long )m);
+       DEBUG_ARG("m = %p", m);
        return m;
 }
 
@@ -111,7 +111,7 @@ void m_free(struct mbuf *m)
 {
        
   DEBUG_CALL("m_free");
-  DEBUG_ARG("m = %lx", (long )m);
+  DEBUG_ARG("m = %p", m);
        
   if(m) {
        /* Remove from m_usedlist */
@@ -230,7 +230,7 @@ struct mbuf *dtom(void *dat)
        struct mbuf *m;
        
        DEBUG_CALL("dtom");
-       DEBUG_ARG("dat = %lx", (long )dat);
+       DEBUG_ARG("dat = %p", dat);
 
        /* bug corrected for M_EXT buffers */
        for (m = m_usedlist.m_next; m != &m_usedlist; m = m->m_next) {
index 4ccc008a1f18cc6bd26bf6c751b162a2d0648b9f..fe0392d1203b4768c1ba83ef4d5be8758c743417 100644 (file)
@@ -69,8 +69,8 @@ void sbappend(struct socket *so, struct mbuf *m)
        int ret = 0;
        
        DEBUG_CALL("sbappend");
-       DEBUG_ARG("so = %lx", (long)so);
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("so = %p", so);
+       DEBUG_ARG("m = %p", m);
        DEBUG_ARG("m->m_len = %d", m->m_len);
        
        /* Shouldn't happen, but...  e.g. foreign host closes connection */
index 4fce2d39d5965cef094cc64dda1308b89e42ff6b..ab5e3dcc0acc290937d8b5e179ef1e93fde9020f 100644 (file)
@@ -93,7 +93,7 @@ int soread(struct socket *so)
        int mss = so->so_tcpcb->t_maxseg;
        
        DEBUG_CALL("soread");
-       DEBUG_ARG("so = %lx", (long )so);
+       DEBUG_ARG("so = %p", so);
        
        /* 
         * No need to check if there's enough room to read.
@@ -198,7 +198,7 @@ void sorecvoob(struct socket *so)
        struct tcpcb *tp = sototcpcb(so);
 
        DEBUG_CALL("sorecvoob");
-       DEBUG_ARG("so = %lx", (long)so);
+       DEBUG_ARG("so = %p", so);
        
        /*
         * We take a guess at how much urgent data has arrived.
@@ -227,7 +227,7 @@ int sosendoob(struct socket *so)
        int n, len;
        
        DEBUG_CALL("sosendoob");
-       DEBUG_ARG("so = %lx", (long)so);
+       DEBUG_ARG("so = %p", so);
        DEBUG_ARG("sb->sb_cc = %d", sb->sb_cc);
        
        if (so->so_urgc > 2048)
@@ -284,7 +284,7 @@ int sowrite(struct socket *so)
        struct iovec iov[2];
        
        DEBUG_CALL("sowrite");
-       DEBUG_ARG("so = %lx", (long)so);
+       DEBUG_ARG("so = %p", so);
        
        if (so->so_urgc) {
                sosendoob(so);
@@ -373,7 +373,7 @@ void sorecvfrom(struct socket *so)
        socklen_t addrlen = sizeof(struct sockaddr_in);
        
        DEBUG_CALL("sorecvfrom");
-       DEBUG_ARG("so = %lx", (long)so);
+       DEBUG_ARG("so = %p", so);
        
        if (so->so_type == IPPROTO_ICMP) {   /* This is a "ping" reply */
          char buff[256];
@@ -472,8 +472,8 @@ int sosendto(struct socket *so, struct mbuf *m)
        struct sockaddr_in addr;
 
        DEBUG_CALL("sosendto");
-       DEBUG_ARG("so = %lx", (long)so);
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("so = %p", so);
+       DEBUG_ARG("m = %p", m);
        
         addr.sin_family = AF_INET;
        if ((so->so_faddr.s_addr & htonl(0xffffff00)) == special_addr.s_addr) {
index 4a0e1179812cda11ad5d4299954d177807bf0cc4..71d94a188e7661077af1bff4eb0ff73e53c03ebe 100644 (file)
@@ -244,8 +244,8 @@ void tcp_input(struct mbuf *m, int iphlen, struct socket *inso)
 /*     int ts_present = 0; */
 
        DEBUG_CALL("tcp_input");
-       DEBUG_ARGS((" m = %8lx  iphlen = %2d  inso = %lx\n", 
-                   (long )m, iphlen, (long )inso ));
+       DEBUG_ARGS((" m = %p  iphlen = %2d  inso = %p\n", 
+                   m, iphlen, inso ));
        
        /*
         * If called with m == 0, then we're continuing the connect
@@ -1065,8 +1065,8 @@ trimthenstep6:
                if (SEQ_LEQ(ti->ti_ack, tp->snd_una)) {
                        if (ti->ti_len == 0 && tiwin == tp->snd_wnd) {
                          tcpstat.tcps_rcvdupack++;
-                         DEBUG_MISC((" dup ack  m = %lx  so = %lx \n",
-                                     (long )m, (long )so));
+                         DEBUG_MISC((" dup ack  m = %p  so = %p \n",
+                                     m, so));
                                /*
                                 * If we have outstanding data (other than
                                 * a window probe), this is a completely
@@ -1488,7 +1488,7 @@ void tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcpiphdr *ti)
        int opt, optlen;
 
        DEBUG_CALL("tcp_dooptions");
-       DEBUG_ARGS((" tp = %lx  cnt=%i \n", (long )tp, cnt));
+       DEBUG_ARGS((" tp = %p  cnt=%i \n", tp, cnt));
 
        for (; cnt > 0; cnt -= optlen, cp += optlen) {
                opt = cp[0];
@@ -1597,7 +1597,7 @@ void tcp_xmit_timer(struct tcpcb *tp, int rtt)
        short delta;
 
        DEBUG_CALL("tcp_xmit_timer");
-       DEBUG_ARG("tp = %lx", (long)tp);
+       DEBUG_ARG("tp = %p", tp);
        DEBUG_ARG("rtt = %d", rtt);
        
        tcpstat.tcps_rttupdated++;
@@ -1685,7 +1685,7 @@ int tcp_mss(struct tcpcb *tp, u_int offer)
        int mss;
        
        DEBUG_CALL("tcp_mss");
-       DEBUG_ARG("tp = %lx", (long)tp);
+       DEBUG_ARG("tp = %p", tp);
        DEBUG_ARG("offer = %d", offer);
        
        mss = min(if_mtu, if_mru) - sizeof(struct tcpiphdr);
index ea1c69e702c219095bdd0b46822e5b3d57f42a54..47bfc00f02165c9cefa9bdce21155bb4ed837b2a 100644 (file)
@@ -75,7 +75,7 @@ int tcp_output(struct tcpcb *tp)
        int idle, sendalot;
        
        DEBUG_CALL("tcp_output");
-       DEBUG_ARG("tp = %lx", (long )tp);
+       DEBUG_ARG("tp = %p", tp);
        
        /*
         * Determine length of data that should be transmitted,
index 554601fcf753de0563a8b530d5ac76fa8ed5c284..4205478cd35cdae9ee2f2280af3bde82fad2b30e 100644 (file)
@@ -124,9 +124,9 @@ void tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m, tcp_seq
        int win = 0;
 
        DEBUG_CALL("tcp_respond");
-       DEBUG_ARG("tp = %lx", (long)tp);
-       DEBUG_ARG("ti = %lx", (long)ti);
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("tp = %p", tp);
+       DEBUG_ARG("ti = %p", ti);
+       DEBUG_ARG("m = %p", m);
        DEBUG_ARG("ack = %u", ack);
        DEBUG_ARG("seq = %u", seq);
        DEBUG_ARG("flags = %x", flags);
@@ -243,7 +243,7 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err)
 */
 
        DEBUG_CALL("tcp_drop");
-       DEBUG_ARG("tp = %lx", (long)tp);
+       DEBUG_ARG("tp = %p", tp);
        DEBUG_ARG("errno = %d", errno);
        
        if (TCPS_HAVERCVDSYN(tp->t_state)) {
@@ -272,7 +272,7 @@ struct tcpcb *tcp_close(struct tcpcb *tp)
        struct mbuf *m;
 
        DEBUG_CALL("tcp_close");
-       DEBUG_ARG("tp = %lx", (long )tp);
+       DEBUG_ARG("tp = %p", tp);
        
        /* free the reassembly queue, if any */
        t = tcpfrag_list_first(tp);
@@ -345,7 +345,7 @@ void tcp_sockclosed(struct tcpcb *tp)
 {
 
        DEBUG_CALL("tcp_sockclosed");
-       DEBUG_ARG("tp = %lx", (long)tp);
+       DEBUG_ARG("tp = %p", tp);
        
        switch (tp->t_state) {
 
@@ -387,7 +387,7 @@ SOCKET tcp_fconnect(struct socket *so)
   SOCKET ret=0;
   
   DEBUG_CALL("tcp_fconnect");
-  DEBUG_ARG("so = %lx", (long )so);
+  DEBUG_ARG("so = %p", so);
 
   if( (ret=so->s=socket(AF_INET,SOCK_STREAM,0)) >= 0) {
        int opt;
@@ -453,7 +453,7 @@ void tcp_connect(struct socket *inso)
        int opt;
 
        DEBUG_CALL("tcp_connect");
-       DEBUG_ARG("inso = %lx", (long)inso);
+       DEBUG_ARG("inso = %p", inso);
        
        /*
         * If it's an SS_ACCEPTONCE socket, no need to socreate()
@@ -624,8 +624,8 @@ int tcp_emu(struct socket *so, struct mbuf *m)
        char *bptr;
        
        DEBUG_CALL("tcp_emu");
-       DEBUG_ARG("so = %lx", (long)so);
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("so = %p", so);
+       DEBUG_ARG("m = %p", m);
        
        switch(so->so_emu) {
                int x, i;
@@ -1237,7 +1237,7 @@ int tcp_ctl(struct socket *so)
         //     struct socket *tmpso;
        
        DEBUG_CALL("tcp_ctl");
-       DEBUG_ARG("so = %lx", (long )so);
+       DEBUG_ARG("so = %p", so);
        
 #if 0
        /*
index d04d6106a0adec2f0dbfdba7f81829b6d005e45b..a87b658ed1d35a47a687cb8a4e830ac068b8473d 100644 (file)
@@ -84,7 +84,7 @@ void udp_input(struct mbuf *m, int iphlen)
        struct socket *so;
        
        DEBUG_CALL("udp_input");
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("m = %p", m);
        DEBUG_ARG("iphlen = %d", iphlen);
        
        udpstat.udps_ipackets++;
@@ -259,8 +259,8 @@ int udp_output2(struct socket *so, struct mbuf *m,
        int error = 0;
 
        DEBUG_CALL("udp_output");
-       DEBUG_ARG("so = %lx", (long)so);
-       DEBUG_ARG("m = %lx", (long)m);
+       DEBUG_ARG("so = %p", so);
+       DEBUG_ARG("m = %p", m);
        DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr);
        DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr);