VirtualBox

Changeset 20383 in vbox for trunk/src


Ignore:
Timestamp:
Jun 8, 2009 8:40:30 AM (16 years ago)
Author:
vboxsync
Message:

NAT: Introduced parameters in extra data for tuning NAT buffers

Host's stack paramenters

SocketRcvBuf - SO_RCVBUF
SocketSndBuf - SO_SNDBUF

Slirp's stack parameters

TcpRcvSpace - tuning receiving buffer
TcpSndSpace - tuning send buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r20257 r20383  
    719719     */
    720720#ifndef VBOX_WITH_SLIRP_DNS_PROXY
    721     if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0"))
     721    if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0"
    722722#else
    723     if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0DNSProxy\0"))
    724 #endif
     723    if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0DNSProxy\0"
     724#endif
     725        "SocketRcvBuf\0SocketSndBuf\0TcpRcvSpace\0TcpSndSpace"))
    725726        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, N_("Unknown NAT configuration option, only supports PassDomain, TFTPPrefix, BootFile and Network"));
    726727
     
    806807        slirp_set_dhcp_dns_proxy(pThis->pNATState, !!fDNSProxy);
    807808#endif
    808 
     809#define SLIRP_SET_TUNING_VALUE(name, setter)            \
     810    do                                                  \
     811    {                                                   \
     812        int len = 0;                                    \
     813        rc = CFGMR3QueryS32(pCfgHandle, name, &len);    \
     814        if (RT_SUCCESS(rc))                             \
     815            setter(pThis->pNATState, len);              \
     816    }while(0)
     817        SLIRP_SET_TUNING_VALUE("SocketRcvBuf", slirp_set_rcvbuf);
     818        SLIRP_SET_TUNING_VALUE("SocketSndBuf", slirp_set_sndbuf);
     819        SLIRP_SET_TUNING_VALUE("TcpRcvSpace", slirp_set_tcp_rcvspace);
     820        SLIRP_SET_TUNING_VALUE("TcpSndSpace", slirp_set_tcp_sndspace);
     821   
    809822        slirp_register_timers(pThis->pNATState, pDrvIns);
    810823        int rc2 = drvNATConstructRedir(pDrvIns->iInstance, pThis, pCfgHandle, Network);
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