Changeset 63016 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Aug 4, 2016 10:47:52 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 109628
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/lwip-new/vbox/include/lwip-log.h
r55980 r63016 23 23 * ends up as RT's level4. Non-default levels are currently not used 24 24 * much in lwip sources, so enable l4 to get the logs. 25 * 26 * Caveat: Slight snag. The LOG_GROUP_LWIP_XXXX are enum values and 27 * the lwIP XXXX_DEBUG macros are used in \#if XXXX_DEBUG 28 * tests around the place. This make MSC raise complaint 29 * C4668, that e.g. 'LOG_GROUP_LWIP_IP4' is not defined as a 30 * preprocessor macro and therefore placed with '0'. However, 31 * that works just fine because we or LWIP_DB_ON so the test 32 * is true despite the warning. Thus the pragma below 25 33 */ 34 # ifdef _MSC_VER 35 # pragma warning(disable:4668) 36 # endif 26 37 27 # define LWIP_DEBUGF_LOG_GROUP_SHIFT 828 # define LWIP_DEBUGF_LOG_GROUP(_g) \29 (((_g) << LWIP_DEBUGF_LOG_GROUP_SHIFT) | LWIP_DBG_ON)38 # define LWIP_DEBUGF_LOG_GROUP_SHIFT 8 39 # define LWIP_DEBUGF_LOG_GROUP(_g) \ 40 (((_g) << LWIP_DEBUGF_LOG_GROUP_SHIFT) | LWIP_DBG_ON) 30 41 31 # define API_LIB_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_API_LIB)32 # define API_MSG_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_API_MSG)33 # define ETHARP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_ETHARP)34 # define ICMP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_ICMP)35 # define IGMP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IGMP)36 # define INET_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_INET)37 # define IP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IP4)38 # define IP_REASS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IP4_REASS)39 # define IP6_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IP6)40 # define MEM_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_MEM)41 # define MEMP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_MEMP)42 # define NETIF_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_NETIF)43 # define PBUF_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_PBUF)44 # define RAW_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_RAW)45 # define SOCKETS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_SOCKETS)46 # define SYS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_SYS)47 # define TCP_CWND_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_CWND)48 # define TCP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP)49 # define TCP_FR_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_FR)50 # define TCP_INPUT_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_INPUT)51 # define TCP_OUTPUT_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_OUTPUT)52 # define TCP_QLEN_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_QLEN)53 # define TCP_RST_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_RST)54 # define TCP_RTO_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_RTO)55 # define TCP_WND_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_WND)56 # define TCPIP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCPIP)57 # define TIMERS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TIMERS)58 # define UDP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_UDP)42 # define API_LIB_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_API_LIB) 43 # define API_MSG_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_API_MSG) 44 # define ETHARP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_ETHARP) 45 # define ICMP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_ICMP) 46 # define IGMP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IGMP) 47 # define INET_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_INET) 48 # define IP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IP4) 49 # define IP_REASS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IP4_REASS) 50 # define IP6_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_IP6) 51 # define MEM_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_MEM) 52 # define MEMP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_MEMP) 53 # define NETIF_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_NETIF) 54 # define PBUF_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_PBUF) 55 # define RAW_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_RAW) 56 # define SOCKETS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_SOCKETS) 57 # define SYS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_SYS) 58 # define TCP_CWND_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_CWND) 59 # define TCP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP) 60 # define TCP_FR_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_FR) 61 # define TCP_INPUT_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_INPUT) 62 # define TCP_OUTPUT_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_OUTPUT) 63 # define TCP_QLEN_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_QLEN) 64 # define TCP_RST_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_RST) 65 # define TCP_RTO_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_RTO) 66 # define TCP_WND_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCP_WND) 67 # define TCPIP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TCPIP) 68 # define TIMERS_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_TIMERS) 69 # define UDP_DEBUG LWIP_DEBUGF_LOG_GROUP(LOG_GROUP_LWIP_UDP) 59 70 60 71 /* … … 63 74 * log groups defined for them currently. 64 75 */ 65 # undef AUTOIP_DEBUG66 # undef DHCP_DEBUG67 # undef DNS_DEBUG68 # undef PPP_DEBUG69 # undef SLIP_DEBUG70 # undef SNMP_MIB_DEBUG71 # undef SNMP_MSG_DEBUG76 # undef AUTOIP_DEBUG 77 # undef DHCP_DEBUG 78 # undef DNS_DEBUG 79 # undef PPP_DEBUG 80 # undef SLIP_DEBUG 81 # undef SNMP_MIB_DEBUG 82 # undef SNMP_MSG_DEBUG 72 83 73 # ifdef LOG_ENABLED84 # ifdef LOG_ENABLED 74 85 75 # define LWIP_DEBUGF(_when, _args) \76 do { \77 const VBOX_LOGGROUP _group = (_when) >> LWIP_DEBUGF_LOG_GROUP_SHIFT; \78 if (_group >= LOG_GROUP_DEFAULT) { \79 /* severe => l1; serious => l2; warning => l3; default => l4 */ \80 const unsigned int _level = 1U << (LWIP_DBG_MASK_LEVEL + 1 - ((_when) & LWIP_DBG_MASK_LEVEL)); \81 LogIt(_level, _group, _args); \82 } \83 } while (0)86 # define LWIP_DEBUGF(_when, _args) \ 87 do { \ 88 const VBOX_LOGGROUP _group = (_when) >> LWIP_DEBUGF_LOG_GROUP_SHIFT; \ 89 if (_group >= LOG_GROUP_DEFAULT) { \ 90 /* severe => l1; serious => l2; warning => l3; default => l4 */ \ 91 const unsigned int _level = 1U << (LWIP_DBG_MASK_LEVEL + 1 - ((_when) & LWIP_DBG_MASK_LEVEL)); \ 92 LogIt(_level, _group, _args); \ 93 } \ 94 } while (0) 84 95 85 # else /* !LOG_ENABLED */96 # else /* !LOG_ENABLED */ 86 97 87 # define LWIP_DEBUGF(_when, _args) do { } while (0)98 # define LWIP_DEBUGF(_when, _args) do { } while (0) 88 99 89 # endif /* !LOG_ENABLED */100 # endif /* !LOG_ENABLED */ 90 101 91 102 #endif /* LWIP_DEBUG */ -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r63012 r63016 436 436 /* int code; */ 437 437 438 LogFlowFunc(("ENTER: m = % lx, m_len = %d\n", (long)m, m ? m->m_len : 0));438 LogFlowFunc(("ENTER: m = %p, m_len = %d\n", m, m ? m->m_len : 0)); 439 439 440 440 icmpstat.icps_received++; -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r62511 r63016 98 98 STAM_PROFILE_START(&pData->StatIP_input, a); 99 99 100 LogFlowFunc(("ENTER: m = % lx\n", (long)m));100 LogFlowFunc(("ENTER: m = %p\n", m)); 101 101 ip = mtod(m, struct ip *); 102 102 Log2(("ip_dst=%RTnaipv4(len:%d) m_len = %d\n", ip->ip_dst, RT_N2H_U16(ip->ip_len), m->m_len)); -
trunk/src/VBox/Devices/Network/slirp/ip_output.c
r63012 r63016 129 129 130 130 #ifdef LOG_ENABLED 131 LogFlowFunc(("ip_output: so = %R[natsock], m0 = % lx\n", so, (long)m0));131 LogFlowFunc(("ip_output: so = %R[natsock], m0 = %p\n", so, m0)); 132 132 #else 133 133 NOREF(so); -
trunk/src/VBox/Devices/Network/slirp/sbuf.c
r63012 r63016 113 113 114 114 STAM_PROFILE_START(&pData->StatIOSBAppend_pf, a); 115 LogFlow(("sbappend: so = % lx, m = %lx, m->m_len = %d\n", (long)so, (long)m, m ? m->m_len : 0));115 LogFlow(("sbappend: so = %p, m = %p, m->m_len = %d\n", so, m, m ? m->m_len : 0)); 116 116 117 117 STAM_COUNTER_INC(&pData->StatIOSBAppend); -
trunk/src/VBox/Devices/Network/slirp/socket.c
r63013 r63016 640 640 if (ret > 0) 641 641 nn += ret; 642 STAM_STATS({ 643 if (ret > 0 && ret !=iov[1].iov_len)644 645 646 647 648 }); 642 # ifdef VBOX_WITH_STATISTICS 643 if (ret > 0 && ret != (ssize_t)iov[1].iov_len) 644 { 645 STAM_COUNTER_INC(&pData->StatIOWrite_rest); 646 STAM_COUNTER_ADD(&pData->StatIOWrite_rest_bytes, (iov[1].iov_len - ret)); 647 } 648 #endif 649 649 } 650 650 Log2(("%s: wrote(2) nn = %d bytes\n", RT_GCC_EXTENSION __PRETTY_FUNCTION__, nn)); … … 679 679 sorecvfrom(PNATState pData, struct socket *so) 680 680 { 681 LogFlowFunc(("sorecvfrom: so = % lx\n", (long)so));681 LogFlowFunc(("sorecvfrom: so = %p\n", so)); 682 682 683 683 #ifdef RT_OS_WINDOWS … … 840 840 int mlen; 841 841 842 LogFlowFunc(("sosendto: so = %R[natsock], m = % lx\n", so, (long)m));842 LogFlowFunc(("sosendto: so = %R[natsock], m = %p\n", so, m)); 843 843 844 844 memset(&addr, 0, sizeof(struct sockaddr)); -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r63013 r63016 309 309 STAM_PROFILE_START(&pData->StatTCP_input, counter_input); 310 310 311 LogFlow(("tcp_input: m = %8lx, iphlen = %2d, inso = %R[natsock]\n", 312 (long)m, iphlen, inso)); 311 LogFlow(("tcp_input: m = %p, iphlen = %2d, inso = %R[natsock]\n", m, iphlen, inso)); 313 312 314 313 if (inso != NULL) … … 1258 1257 { 1259 1258 tcpstat.tcps_rcvdupack++; 1260 Log2((" dup ack m = % lx, so = %lx\n", (long)m, (long)so));1259 Log2((" dup ack m = %p, so = %p\n", m, so)); 1261 1260 /* 1262 1261 * If we have outstanding data (other than -
trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
r63013 r63016 127 127 register int tlen; 128 128 129 LogFlowFunc(("ENTER: tp = %R[tcpcb793], ti = %lx, m = %lx, ack = %u, seq = %u, flags = %x\n", 130 tp, (long)ti, (long)m, ack, seq, flags)); 129 LogFlowFunc(("ENTER: tp = %R[tcpcb793], ti = %p, m = %p, ack = %u, seq = %u, flags = %x\n", tp, ti, m, ack, seq, flags)); 131 130 132 131 if (m == 0) -
trunk/src/VBox/Devices/Network/slirp/udp.c
r63013 r63016 123 123 */ 124 124 len = RT_N2H_U16((u_int16_t)uh->uh_ulen); 125 Assert( (ip->ip_len + iphlen == m_length(m, NULL)));125 Assert(ip->ip_len + iphlen == (ssize_t)m_length(m, NULL)); 126 126 127 127 if (ip->ip_len != len) … … 472 472 #endif 473 473 Assert(so->so_type == IPPROTO_UDP); 474 LogFlowFunc(("ENTER: so = %R[natsock], m = %p, saddr = %RTnaipv4\n", 475 so, (long)m, addr->sin_addr.s_addr)); 474 LogFlowFunc(("ENTER: so = %R[natsock], m = %p, saddr = %RTnaipv4\n", so, m, addr->sin_addr.s_addr)); 476 475 477 476 if (so->so_laddr.s_addr == INADDR_ANY)
Note:
See TracChangeset
for help on using the changeset viewer.