Changeset 17437 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Mar 6, 2009 3:36:26 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r17386 r17437 86 86 /** Boot file name to provide in the DHCP server response. */ 87 87 char *pszBootFile; 88 /** tftp server name to provide in the DHCP server response. */ 89 char *pszNextServer; 88 90 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC 89 91 /* polling thread */ … … 799 801 * Validate the config. 800 802 */ 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 802 808 return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES, N_("Unknown NAT configuration option, only supports PassDomain, TFTPPrefix, BootFile and Network")); 803 809 … … 809 815 pThis->pszTFTPPrefix = NULL; 810 816 pThis->pszBootFile = NULL; 817 pThis->pszNextServer = NULL; 811 818 /* IBase */ 812 819 pDrvIns->IBase.pfnQueryInterface = drvNATQueryInterface; … … 832 839 if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND) 833 840 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 834 850 835 851 /* … … 872 888 * Initialize slirp. 873 889 */ 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); 875 891 if (RT_SUCCESS(rc)) 876 892 { 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 877 900 slirp_register_timers(pThis->pNATState, pDrvIns); 878 901 int rc2 = drvNATConstructRedir(pDrvIns->iInstance, pThis, pCfgHandle, Network); … … 946 969 AssertMsgFailed(("Add error message for rc=%d (%Rrc)\n", rc, rc)); 947 970 } 971 948 972 949 973 #ifndef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
Note:
See TracChangeset
for help on using the changeset viewer.