Changeset 43636 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Oct 15, 2012 6:40:08 AM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 81376
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevINIP.cpp
r36044 r43636 37 37 #include "lwip/udp.h" 38 38 #include "lwip/tcp.h" 39 #ifdef VBOX_WITH_NEW_LWIP 40 # include "lwip/tcp_impl.h" 41 #endif 39 42 #include "lwip/tcpip.h" 40 43 #include "lwip/sockets.h" … … 205 208 LogFlow(("%s: netif=%p p=%p ipaddr=%#04x\n", __FUNCTION__, netif, p, 206 209 ipaddr->addr)); 210 #ifndef VBOX_WITH_NEW_LWIP 207 211 lrc = lwip_etharp_output(netif, ipaddr, p); 212 #else 213 lrc = lwip_etharp_output(netif, p, ipaddr); 214 #endif 208 215 LogFlow(("%s: return %d\n", __FUNCTION__, lrc)); 209 216 return lrc; … … 299 306 netif->mtu = DEVINIP_MAX_FRAME; 300 307 netif->flags = NETIF_FLAG_BROADCAST; 308 #ifdef VBOX_WITH_NEW_LWIP 309 /* @todo: why explicit ARP routing required for 1.2.0 case? */ 310 netif->flags |= NETIF_FLAG_ETHARP; 311 netif->flags |= NETIF_FLAG_ETHERNET; 312 #endif 301 313 netif->output = devINIPOutput; 302 314 netif->linkoutput = devINIPOutputRaw; … … 376 388 { 377 389 case ETHTYPE_IP: /* IP packet */ 390 #ifndef VBOX_WITH_NEW_LWIP 378 391 lwip_pbuf_header(p, -(ssize_t)sizeof(struct eth_hdr)); 392 #endif 379 393 lrc = iface->input(p, iface); 380 394 if (lrc) … … 382 396 break; 383 397 case ETHTYPE_ARP: /* ARP packet */ 398 #ifndef VBOX_WITH_NEW_LWIP 384 399 lwip_etharp_arp_input(iface, (struct eth_addr *)iface->hwaddr, p); 400 #else 401 ethernet_input(p, iface); 402 #endif 385 403 break; 386 404 default: … … 411 429 { 412 430 sys_sem_t *sem = (sys_sem_t *)arg; 431 #ifndef VBOX_WITH_NEW_LWIP 413 432 lwip_sys_sem_signal(*sem); 433 #else 434 lwip_sys_sem_signal(sem); 435 #endif 414 436 } 415 437 … … 513 535 netif_set_down(&pThis->IntNetIF); 514 536 netif_remove(&pThis->IntNetIF); 537 #ifndef VBOX_WITH_NEW_LWIP 515 538 tcpip_terminate(); 516 539 lwip_sys_sem_wait(pThis->LWIPTcpInitSem); 517 540 lwip_sys_sem_free(pThis->LWIPTcpInitSem); 541 #else 542 /* no termination on new lwip ??? Hmmm... */ 543 lwip_sys_sem_wait(&pThis->LWIPTcpInitSem, 0); 544 lwip_sys_sem_free(&pThis->LWIPTcpInitSem); 545 #endif 518 546 } 519 547 … … 538 566 PDEVINTNETIP pThis = PDMINS_2_DATA(pDevIns, PDEVINTNETIP); 539 567 int rc = VINF_SUCCESS; 568 #ifdef VBOX_WITH_NEW_LWIP 569 err_t errRc = ERR_OK; 570 #endif 540 571 LogFlow(("%s: pDevIns=%p iInstance=%d pCfg=%p\n", __FUNCTION__, 541 572 pDevIns, iInstance, pCfg)); … … 718 749 goto out; 719 750 TMTimerSetMillies(pThis->TCPFastTimer, TCP_SLOW_INTERVAL); 751 #ifndef VBOX_WITH_NEW_LWIP 720 752 pThis->LWIPTcpInitSem = lwip_sys_sem_new(0); 721 753 { … … 723 755 lwip_sys_sem_wait(pThis->LWIPTcpInitSem); 724 756 } 757 #else 758 errRc = lwip_sys_sem_new(&pThis->LWIPTcpInitSem, 0); 759 /* VERR_INTERNAL_ERROR perhaps should be replaced with right error code */ 760 AssertReturn(errRc == ERR_OK, VERR_INTERNAL_ERROR); 761 { 762 lwip_tcpip_init(devINIPTcpipInitDone, &pThis->LWIPTcpInitSem); 763 lwip_sys_sem_wait(&pThis->LWIPTcpInitSem, 0); 764 } 765 #endif 725 766 726 767 /*
Note:
See TracChangeset
for help on using the changeset viewer.