VirtualBox

Ignore:
Timestamp:
Apr 15, 2009 12:14:23 PM (16 years ago)
Author:
vboxsync
Message:

NAT: removed VBOX_WITH_SIMPLIFIED_SLIRP_SYNC as the poller API was removed some days ago

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/bootp.c

    r18874 r18902  
    180180    rbp = mtod(m, struct bootp_t *);
    181181    memset(rbp, 0, sizeof(struct bootp_t));
    182 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    183     m->m_data += sizeof(struct udpiphdr);
    184 #endif
    185182
    186183    if (dhcp_msg_type == DHCPDISCOVER)
     
    341338             - sizeof(struct ip)
    342339             - sizeof(struct udphdr);
    343 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    344340    m->m_data += sizeof(struct udphdr)
    345              + sizeof(struct ip);
    346 #endif
     341               + sizeof(struct ip);
    347342    /* Reply to the broadcast address, as some clients perform paranoid checks. */
    348343    daddr.sin_addr.s_addr = INADDR_BROADCAST;
  • trunk/src/VBox/Devices/Network/slirp/if.c

    r16653 r18902  
    2828if_init(PNATState pData)
    2929{
    30 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    3130    /* 14 for ethernet */
    32     if_maxlinkhdr =  14;
    33 #else
    34     /* 2 for alignment, 14 for ethernet, 40 for TCP/IP */
    35     if_maxlinkhdr =  2 + 14 + 40;
    36 #endif
     31    if_maxlinkhdr = 14;
    3732    if_queued = 0;
    3833    if_thresh = 10;
     
    229224        }
    230225
    231 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    232226        if_encap(pData, ETH_P_IP, ifm);
    233 #else
    234         if_encap(pData,  mtod(ifm, uint8_t *), ifm->m_len);
    235         m_free(pData, ifm);
    236 #endif
    237227
    238228        if (!if_queued)
  • trunk/src/VBox/Devices/Network/slirp/ip_icmp.c

    r17222 r18902  
    4343
    4444#ifdef RT_OS_WINDOWS
    45 # ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    4645# define ICMP_SEND_ECHO(event, routine, addr, data, datasize, ipopt)                                        \
    4746                IcmpSendEcho2(pData->icmp_socket.sh, (event), NULL, NULL, (addr), (data), (datasize),       \
    4847                               (ipopt), pData->pvIcmpBuffer, pData->szIcmpBuffer, 1)
    49 # else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    50 # define ICMP_SEND_ECHO(event, routine, addr, data, datasize, ipopt)                                                        \
    51                 IcmpSendEcho2(pData->icmp_socket.sh, NULL, (FARPROC)(routine), (void *)pData, (addr), (data), (datasize),   \
    52                              (ipopt), pData->pvIcmpBuffer, pData->szIcmpBuffer, 1)
    53 static void WINAPI notify_slirp(void *);
    54 # endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    5548#endif /* RT_OS_WINDOWS */
    5649
     
    152145    }
    153146    pData->icmp_socket.sh = IcmpCreateFile();
    154 # ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    155147    pData->phEvents[VBOX_ICMP_EVENT_INDEX] = CreateEvent(NULL, FALSE, FALSE, NULL);
    156 # endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    157148    pData->szIcmpBuffer = sizeof(ICMP_ECHO_REPLY) * 10;
    158149    pData->pvIcmpBuffer = RTMemAlloc(pData->szIcmpBuffer);
     
    657648    icmpstat.icps_reflect++;
    658649}
    659 #if defined(RT_OS_WINDOWS) && !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)
    660 static void WINAPI
    661 notify_slirp(void *ctx)
    662 {
    663     /* pData name is important see slirp_state.h */
    664     PNATState pData = (PNATState)ctx;
    665     fIcmp = 1;
    666 }
    667 #endif
  • trunk/src/VBox/Devices/Network/slirp/libslirp.h

    r17436 r18902  
    3434void slirp_link_down(PNATState);
    3535
    36 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)
    37 # if defined(RT_OS_WINDOWS)
     36#if defined(RT_OS_WINDOWS)
    3837void slirp_select_fill(PNATState pData, int *pndfs);
    3938
    4039void slirp_select_poll(PNATState pData, int fTimeout, int fIcmp);
    41 # else /* RT_OS_WINDOWS */
     40#else /* RT_OS_WINDOWS */
    4241void slirp_select_fill(PNATState pData, int *pnfds, struct pollfd *polls);
    4342void slirp_select_poll(PNATState pData, struct pollfd *polls, int ndfs);
    44 # endif /* !RT_OS_WINDOWS */
    45 #else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    46 void slirp_select_fill(PNATState pData, int *pnfds,
    47                        fd_set *readfds, fd_set *writefds, fd_set *xfds);
    48 
    49 void slirp_select_poll(PNATState pData, int *pnfds,
    50                        fd_set *readfds, fd_set *writefds, fd_set *xfds);
    51 #endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     43#endif /* !RT_OS_WINDOWS */
    5244
    5345void slirp_input(PNATState pData, const uint8_t *pkt, int pkt_len);
     
    5648/* you must provide the following functions: */
    5749int slirp_can_output(void * pvUser);
    58 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    5950void slirp_output(void * pvUser, void *pvArg, const uint8_t *pkt, int pkt_len);
    6051void slirp_post_sent(PNATState pData, void *pvArg);
    61 #else
    62 void slirp_output(void * pvUser, const uint8_t *pkt, int pkt_len);
    63 #endif
    6452
    6553int slirp_redir(PNATState pData, int is_udp, int host_port,
     
    7462void slirp_set_dhcp_dns_proxy(PNATState pData, bool fDNSProxy);
    7563#endif
    76 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     64
     65#if defined(RT_OS_WINDOWS)
    7766
    7867
     
    10392HANDLE *slirp_get_events(PNATState pData);
    10493void slirp_register_external_event(PNATState pData, HANDLE hEvent, int index);
    105 #endif
     94#endif /* RT_OS_WINDOWS */
     95
    10696#ifdef VBOX_WITH_SLIRP_MT
    10797void slirp_process_queue(PNATState pData);
  • trunk/src/VBox/Devices/Network/slirp/main.h

    r15890 r18902  
    1010#endif
    1111
    12 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    1312void if_encap(PNATState pData, uint16_t eth_proto, struct mbuf *m);
    14 #else
    15 void if_encap(PNATState pData, const uint8_t *ip_data, int ip_data_len);
    16 #endif
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r18874 r18902  
    1919#endif
    2020
    21 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)
    22 
    23 # ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    24 #  define DO_ENGAGE_EVENT1(so, fdset, label)          \
    25     do {                                             \
    26         FD_SET((so)->s, (fdset));                    \
    27         UPD_NFDS((so)->s);                           \
    28     } while(0)
    29 
    30 
    31 #  define DO_ENGAGE_EVENT2(so, fdset1, fdset2, label) \
    32     do {                                             \
    33         FD_SET((so)->s, (fdset1));                   \
    34         FD_SET((so)->s, (fdset2));                   \
    35         UPD_NFDS((so)->s);                           \
    36     } while(0)
    37 
    38 #  define DO_POLL_EVENTS(rc, error, so, events, label) do {} while (0)
    39 
    40 #  define DO_CHECK_FD_SET(so, events, fdset) (FD_ISSET((so)->s, fdset))
    41 #  define DO_UNIX_CHECK_FD_SET(so, events, fdset )  0 /*specific for Unix API */
    42 # else /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     21#if !defined(RT_OS_WINDOWS)
     22
    4323#  define DO_ENGAGE_EVENT1(so, fdset, label)                        \
    4424    do {                                                            \
     
    8262#  define DO_UNIX_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset) /*specific for Unix API */
    8363#  define DO_WIN_CHECK_FD_SET(so, events, fdset ) 0 /* specific for Windows Winsock API */
    84 # endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    8564
    8665# ifndef RT_OS_WINDOWS
     
    10584    } while (0)
    10685# else /* !RT_OS_WINDOWS */
    107 #  ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    108 #   define DO_WIN_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset)
    109 #  else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    110 #   define DO_WIN_CHECK_FD_SET(so, events, fdset ) 0
    111 #  endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     86#  define DO_WIN_CHECK_FD_SET(so, events, fdset ) DO_CHECK_FD_SET((so), (events), fdset)
    11287#  define ICMP_ENGAGE_EVENT(so, fdset) do {} while(0)
    11388#endif /* RT_OS_WINDOWS */
    11489
    115 #else /* defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */
     90#else /* defined(RT_OS_WINDOWS) */
    11691
    11792/*
     
    164139# define DO_UNIX_CHECK_FD_SET(so, events, fdset ) 1 /*specific for Unix API */
    165140
    166 #endif /* defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) */
     141#endif /* defined(RT_OS_WINDOWS) */
    167142
    168143#define TCP_ENGAGE_EVENT1(so, fdset) \
     
    193168 */
    194169#if VBOX_WITH_DEBUG_NAT_SOCKETS
    195 # if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)
    196 #  if defined(RT_OS_WINDOWS)
    197 #   define  DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset)             \
    198     do {                                                                                \
    199         LogRel(("  " #proto " %R[natsock] %R[natwinnetevents]\n", (so), (winevent)));   \
    200     } while (0)
    201 #  else /* RT_OS_WINDOWS */
    202 #   define  DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset)         \
    203     do {                                                                            \
    204             LogRel(("  " #proto " %R[natsock] %s %s %s er: %s, %s, %s\n", (so),     \
    205                      CHECK_FD_SET(so, ign ,r_fdset) ? "READ":"",                    \
    206                      CHECK_FD_SET(so, ign, w_fdset) ? "WRITE":"",                   \
    207                      CHECK_FD_SET(so, ign, x_fdset) ? "OOB":"",                     \
    208                      CHECK_FD_SET(so, ign, rderr) ? "RDERR":"",                     \
    209                      CHECK_FD_SET(so, ign, rdhup) ? "RDHUP":"",                     \
    210                      CHECK_FD_SET(so, ign, nval) ? "RDNVAL":""));                   \
    211     } while (0)
    212 #  endif /* !RT_OS_WINDOWS */
    213 # else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    214 #  define  DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset)  \
    215     do {                                                                    \
    216             LogRel(("  " #proto " %R[natsock] %s %s %s\n", (so),            \
    217                 FD_ISSET((so)->s, (r_fdset))?"READ":"",                     \
    218                 FD_ISSET((so)->s, (w_fdset))?"WRITE":"",                    \
    219                 FD_ISSET((so)->s, (x_fdset))?"OOB":""));                    \
    220     } while (0)
    221 # endif
     170# if defined(RT_OS_WINDOWS)
     171#  define  DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset)             \
     172   do {                                                                                \
     173       LogRel(("  " #proto " %R[natsock] %R[natwinnetevents]\n", (so), (winevent)));   \
     174   } while (0)
     175# else /* RT_OS_WINDOWS */
     176#  define  DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset)         \
     177   do {                                                                            \
     178           LogRel(("  " #proto " %R[natsock] %s %s %s er: %s, %s, %s\n", (so),     \
     179                    CHECK_FD_SET(so, ign ,r_fdset) ? "READ":"",                    \
     180                    CHECK_FD_SET(so, ign, w_fdset) ? "WRITE":"",                   \
     181                    CHECK_FD_SET(so, ign, x_fdset) ? "OOB":"",                     \
     182                    CHECK_FD_SET(so, ign, rderr) ? "RDERR":"",                     \
     183                    CHECK_FD_SET(so, ign, rdhup) ? "RDHUP":"",                     \
     184                    CHECK_FD_SET(so, ign, nval) ? "RDNVAL":""));                   \
     185   } while (0)
     186# endif /* !RT_OS_WINDOWS */
    222187#else /* VBOX_WITH_DEBUG_NAT_SOCKETS */
    223188# define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) do {} while (0)
     
    643608        WSAStartup(MAKEWORD(2, 0), &Data);
    644609    }
    645 # if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)
    646610    pData->phEvents[VBOX_SOCKET_EVENT_INDEX] = CreateEvent(NULL, FALSE, FALSE, NULL);
    647 # endif
    648611#endif
    649612#ifdef VBOX_WITH_SLIRP_MT
     
    810773}
    811774
    812 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    813 void slirp_select_fill(PNATState pData, int *pnfds,
    814                        fd_set *readfds, fd_set *writefds, fd_set *xfds)
    815 #else /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    816 # ifdef RT_OS_WINDOWS
     775#ifdef RT_OS_WINDOWS
    817776void slirp_select_fill(PNATState pData, int *pnfds)
    818 # else /* RT_OS_WINDOWS */
     777#else /* RT_OS_WINDOWS */
    819778void slirp_select_fill(PNATState pData, int *pnfds, struct pollfd *polls)
    820 # endif /* !RT_OS_WINDOWS */
    821 #endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     779#endif /* !RT_OS_WINDOWS */
    822780{
    823781    struct socket *so, *so_next;
    824782    int nfds;
    825 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     783#if defined(RT_OS_WINDOWS)
    826784    int rc;
    827785    int error;
    828 #endif
    829 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && !defined(RT_OS_WINDOWS)
     786#else
    830787    int poll_index = 0;
    831788#endif
     
    868825        QSOCKET_FOREACH(so, so_next, tcp)
    869826        /* { */
    870 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && !defined(RT_OS_WINDOWS)
     827#if !defined(RT_OS_WINDOWS)
    871828            so->so_poll_index = -1;
    872829#endif
     
    940897
    941898            STAM_COUNTER_INC(&pData->StatUDP);
    942 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && !defined(RT_OS_WINDOWS)
     899#if !defined(RT_OS_WINDOWS)
    943900            so->so_poll_index = -1;
    944901#endif
     
    989946    }
    990947
    991 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)
    992 # if defined(RT_OS_WINDOWS)
     948#if defined(RT_OS_WINDOWS)
    993949    *pnfds = VBOX_EVENT_COUNT;
    994 # else /* RT_OS_WINDOWS */
     950#else /* RT_OS_WINDOWS */
    995951    AssertRelease(poll_index <= *pnfds);
    996952    *pnfds = poll_index;
    997 # endif /* !RT_OS_WINDOWS */
    998 #else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    999     *pnfds = nfds;
    1000 #endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     953#endif /* !RT_OS_WINDOWS */
    1001954
    1002955    STAM_PROFILE_STOP(&pData->StatFill, a);
    1003956}
    1004957
    1005 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC)
    1006 # if defined(RT_OS_WINDOWS)
     958#if defined(RT_OS_WINDOWS)
    1007959void slirp_select_poll(PNATState pData, int fTimeout, int fIcmp)
    1008 # else /* RT_OS_WINDOWS */
     960#else /* RT_OS_WINDOWS */
    1009961void slirp_select_poll(PNATState pData, struct pollfd *polls, int ndfs)
    1010 # endif /* !RT_OS_WINDOWS */
    1011 #else /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
    1012 void slirp_select_poll(PNATState pData, fd_set *readfds, fd_set *writefds, fd_set *xfds)
    1013 #endif /* !VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     962#endif /* !RT_OS_WINDOWS */
    1014963{
    1015964    struct socket *so, *so_next;
    1016965    int ret;
    1017 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     966#if defined(RT_OS_WINDOWS)
    1018967    WSANETWORKEVENTS NetworkEvents;
    1019968    int rc;
    1020969    int error;
    1021 #endif
    1022 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && !defined(RT_OS_WINDOWS)
     970#else
    1023971    int poll_index = 0;
    1024972#endif
     
    1050998        }
    1051999    }
    1052 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     1000#if defined(RT_OS_WINDOWS)
    10531001    if (fTimeout)
    10541002        return; /* only timer update */
     
    11431091                {
    11441092                    TCP_CONNECT(pData, so);
    1145 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     1093#if defined(RT_OS_WINDOWS)
    11461094                    if (!(NetworkEvents.lNetworkEvents & FD_CLOSE))
    11471095#endif
     
    11551103            }
    11561104
    1157 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     1105#if defined(RT_OS_WINDOWS)
    11581106            /*
    11591107             * Check for FD_CLOSE events.
     
    14501398AssertCompileSize(struct arphdr, 28);
    14511399
    1452 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    14531400static void arp_input(PNATState pData, struct mbuf *m)
    1454 #else
    1455 static void arp_input(PNATState pData, const uint8_t *pkt, int pkt_len)
    1456 #endif
    14571401{
    14581402    struct ethhdr *eh;
     
    14631407    struct ex_list *ex_ptr;
    14641408    uint32_t htip;
    1465 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    1466     uint8_t arp_reply[sizeof(struct arphdr) + ETH_HLEN];
    1467     eh = (struct ethhdr *)pkt;
    1468 #else
    14691409    struct mbuf *mr;
    14701410    eh = mtod(m, struct ethhdr *);
    1471 #endif
    14721411    ah = (struct arphdr *)&eh[1];
    14731412    htip = ntohl(*(uint32_t*)ah->ar_tip);
    14741413
    1475 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    14761414    mr = m_get(pData);
    14771415    mr->m_data += if_maxlinkhdr;
    14781416    mr->m_len = sizeof(struct arphdr);
    14791417    rah = mtod(mr, struct arphdr *);
    1480 #else
    1481     reh = (struct ethhdr *)arp_reply;
    1482     rah = (struct arphdr *)&reh[1];
    1483 #endif
    14841418
    14851419    ar_op = ntohs(ah->ar_op);
     
    15001434                return;
    15011435        arp_ok:
    1502 
    1503 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    1504                 memcpy(reh->h_dest, eh->h_source, ETH_ALEN);
    1505                 memcpy(reh->h_source, &special_addr, ETH_ALEN);
    1506                 reh->h_source[5] = ah->ar_tip[3];
    1507                 reh->h_proto = htons(ETH_P_ARP);
    1508 #endif
    15091436                rah->ar_hrd = htons(1);
    15101437                rah->ar_pro = htons(ETH_P_IP);
     
    15261453                memcpy(rah->ar_tha, ah->ar_sha, ETH_ALEN);
    15271454                memcpy(rah->ar_tip, ah->ar_sip, 4);
    1528 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    15291455                if_encap(pData, ETH_P_ARP, mr);
    15301456                m_free(pData, m);
    1531 #else
    1532                 slirp_output(pData->pvUser, arp_reply, sizeof(arp_reply));
    1533 #endif
    15341457            }
    15351458            break;
     
    15701493    {
    15711494        case ETH_P_ARP:
    1572 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    15731495            arp_input(pData, m);
    1574 #else
    1575             arp_input(pData, pkt, pkt_len);
    1576             m_free(pData, m);
    1577 #endif
    15781496            break;
    15791497        case ETH_P_IP:
     
    16021520
    16031521/* output the IP packet to the ethernet device */
    1604 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    16051522void if_encap(PNATState pData, uint16_t eth_proto, struct mbuf *m)
    1606 #else
    1607 void if_encap(PNATState pData, uint8_t *ip_data, int ip_data_len)
    1608 #endif
    1609 {
    1610 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
     1523{
    16111524    struct ethhdr *eh;
    16121525    uint8_t *buf = RTMemAlloc(1600);
     1526
    16131527    m->m_data -= if_maxlinkhdr;
    16141528    m->m_len += ETH_HLEN;
    16151529    eh = mtod(m, struct ethhdr *);
    1616 #else
    1617     uint8_t buf[1600];
    1618     struct ethhdr *eh = (struct ethhdr *)buf;
    1619 
    1620     if (ip_data_len + ETH_HLEN > sizeof(buf))
    1621         return;
    1622 
    1623     memcpy(buf + sizeof(struct ethhdr), ip_data, ip_data_len);
    1624 #endif
    1625 
    16261530
    16271531    memcpy(eh->h_dest, client_ethaddr, ETH_ALEN);
     
    16291533    /* XXX: not correct */
    16301534    eh->h_source[5] = CTL_ALIAS;
    1631 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    16321535    eh->h_proto = htons(eth_proto);
    16331536#if 0
     
    16381541    m_free(pData, m);
    16391542#endif
    1640 #else
    1641     eh->h_proto = htons(ETH_P_IP);
    1642     slirp_output(pData->pvUser, buf, ip_data_len + ETH_HLEN);
    1643 #endif
    16441543}
    16451544
     
    16751574}
    16761575
    1677 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     1576#if defined(RT_OS_WINDOWS)
    16781577HANDLE *slirp_get_events(PNATState pData)
    16791578{
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r18584 r18902  
    183183    HMODULE hmIcmpLibrary;
    184184# endif
    185 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     185#if defined(RT_OS_WINDOWS)
    186186# define VBOX_SOCKET_EVENT (pData->phEvents[VBOX_SOCKET_EVENT_INDEX])
    187187    HANDLE phEvents[VBOX_EVENT_COUNT];
    188 #endif
    189 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
    190     int fIcmp;
    191188#endif
    192189#ifdef VBOX_WITH_SLIRP_DNS_PROXY
     
    334331#define tcp_reass_maxseg pData->tcp_reass_maxseg
    335332#define tcp_reass_overflows pData->tcp_reass_overflows
    336 
    337 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
    338 # define fIcmp pData->fIcmp
    339 #endif
    340333
    341334#define queue_tcp_label tcb
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r17363 r18902  
    6565        so->so_state = SS_NOFDREF;
    6666        so->s = -1;
    67 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && !defined(RT_OS_WINDOWS)
     67#if !defined(RT_OS_WINDOWS)
    6868        so->so_poll_index = -1;
    6969#endif
     
    198198    if (nn <= 0)
    199199    {
    200 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
     200#if defined(RT_OS_WINDOWS)
    201201        /*
    202202         * Special case for WSAEnumNetworkEvents: If we receive 0 bytes that
     
    513513        }
    514514        m->m_data += if_maxlinkhdr;
    515 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    516515        m->m_data += sizeof(struct udphdr)
    517                     + sizeof(struct ip); /*XXX: no options atm*/
    518 #endif
     516                   + sizeof(struct ip); /*XXX: no options atm*/
    519517
    520518        /*
     
    10021000
    10031001    len = pData->pfIcmpParseReplies(pData->pvIcmpBuffer, pData->szIcmpBuffer);
    1004 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    1005     fIcmp = 0;  /* reply processed */
    1006 #endif
    10071002    if (len < 0)
    10081003    {
  • trunk/src/VBox/Devices/Network/slirp/socket.h

    r17363 r18902  
    7171    int             so_deleted;
    7272#endif
    73 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    74 # ifndef RT_OS_WINDOWS
     73#ifndef RT_OS_WINDOWS
    7574    int so_poll_index;
    76 # else /* !RT_OS_WINDOWS */
     75#else /* !RT_OS_WINDOWS */
    7776    /*
    7877     * FD_CLOSE event has been occured on socket
    7978     */
    8079    int so_close;
    81 # endif /* RT_OS_WINDOWS */
    82 #endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     80#endif /* RT_OS_WINDOWS */
    8381#ifdef VBOX_WITH_SLIRP_DNS_PROXY
    8482    void (* so_timeout)(PNATState pData, struct socket *so, void *arg);
  • trunk/src/VBox/Devices/Network/slirp/tcp_output.c

    r15890 r18902  
    428428        }
    429429        m->m_data += if_maxlinkhdr;
    430 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    431430        m->m_data += sizeof(struct ip)
    432             + sizeof(struct tcphdr);
    433 #endif
     431                   + sizeof(struct tcphdr);
    434432        m->m_len = hdrlen;
    435433    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette