VirtualBox

Changeset 17437 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Mar 6, 2009 3:36:26 AM (16 years ago)
Author:
vboxsync
Message:

NAT: missed changes (fix burns)

File:
1 edited

Legend:

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

    r17386 r17437  
    8686    /** Boot file name to provide in the DHCP server response. */
    8787    char                    *pszBootFile;
     88    /** tftp server name to provide in the DHCP server response. */
     89    char                    *pszNextServer;
    8890#ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
    8991    /* polling thread */
     
    799801     * Validate the config.
    800802     */
    801     if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0"))
     803#ifndef VBOX_WITH_SLIRP_DNS_PROXY
     804    if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0"))
     805#else
     806    if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0DNSProxy\0"))
     807#endif
    802808        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, N_("Unknown NAT configuration option, only supports PassDomain, TFTPPrefix, BootFile and Network"));
    803809
     
    809815    pThis->pszTFTPPrefix                = NULL;
    810816    pThis->pszBootFile                  = NULL;
     817    pThis->pszNextServer                = NULL;
    811818    /* IBase */
    812819    pDrvIns->IBase.pfnQueryInterface    = drvNATQueryInterface;
     
    832839    if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND)
    833840        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"BootFile\" string failed"), pDrvIns->iInstance);
     841    rc = CFGMR3QueryStringAlloc(pCfgHandle, "NextServer", &pThis->pszNextServer);
     842    if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND)
     843        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"NextServer\" string failed"), pDrvIns->iInstance);
     844#ifdef VBOX_WITH_SLIRP_DNS_PROXY
     845    bool fDNSProxy;
     846    rc = CFGMR3QueryBool(pCfgHandle, "DNSProxy", &fDNSProxy);
     847    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     848        fDNSProxy = false;
     849#endif
    834850
    835851    /*
     
    872888     * Initialize slirp.
    873889     */
    874     rc = slirp_init(&pThis->pNATState, &szNetAddr[0], Netmask, fPassDomain, pThis->pszTFTPPrefix, pThis->pszBootFile, pThis);
     890    rc = slirp_init(&pThis->pNATState, &szNetAddr[0], Netmask, fPassDomain, pThis);
    875891    if (RT_SUCCESS(rc))
    876892    {
     893        slirp_set_dhcp_TFTP_prefix(pThis->pNATState, pThis->pszTFTPPrefix);
     894        slirp_set_dhcp_TFTP_bootfile(pThis->pNATState, pThis->pszBootFile);
     895        slirp_set_dhcp_next_server(pThis->pNATState, pThis->pszNextServer);
     896#ifdef VBOX_WITH_SLIRP_DNS_PROXY
     897        slirp_set_dhcp_dns_proxy(pThis->pNATState, fDNSProxy);
     898#endif
     899
    877900        slirp_register_timers(pThis->pNATState, pDrvIns);
    878901        int rc2 = drvNATConstructRedir(pDrvIns->iInstance, pThis, pCfgHandle, Network);
     
    946969        AssertMsgFailed(("Add error message for rc=%d (%Rrc)\n", rc, rc));
    947970    }
     971
    948972
    949973#ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
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