- Timestamp:
- Mar 16, 2009 2:47:42 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Makefile.kmk
r17796 r17940 623 623 Input/DrvMouseQueue.cpp \ 624 624 Network/DrvIntNet.cpp \ 625 Network/DhcpServerRunner.cpp \ 625 626 PC/DrvACPI.cpp \ 626 627 Serial/DrvChar.cpp \ … … 717 718 PC/DrvACPI.cpp \ 718 719 Network/DrvIntNet.cpp \ 720 Network/DhcpServerRunner.cpp \ 719 721 Network/DrvNetSniffer.cpp \ 720 722 Network/Pcap.cpp \ -
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r16967 r17940 45 45 #endif 46 46 47 #include "DhcpServerRunner.h" 47 48 48 49 /******************************************************************************* … … 1067 1068 Log(("IntNet%d: hIf=%RX32 '%s'\n", pDrvIns->iInstance, pThis->hIf, pThis->szNetwork)); 1068 1069 1070 #if 0 1071 DhcpServerRunner dhcp; 1072 dhcp.setOption(DHCPCFG_NETNAME, OpenReq.szNetwork); 1073 dhcp.setOption(DHCPCFG_TRUNKNAME, OpenReq.szTrunk); 1074 switch(OpenReq.enmTrunkType) 1075 { 1076 case kIntNetTrunkType_WhateverNone: 1077 dhcp.setOption(DHCPCFG_TRUNKTYPE, TRUNKTYPE_WHATEVER); 1078 break; 1079 case kIntNetTrunkType_NetFlt: 1080 dhcp.setOption(DHCPCFG_TRUNKTYPE, TRUNKTYPE_NETFLT); 1081 break; 1082 case kIntNetTrunkType_NetAdp: 1083 dhcp.setOption(DHCPCFG_TRUNKTYPE, TRUNKTYPE_NETADP); 1084 break; 1085 case kIntNetTrunkType_SrvNat: 1086 dhcp.setOption(DHCPCFG_TRUNKTYPE, TRUNKTYPE_SRVNAT); 1087 break; 1088 } 1089 //temporary hack for testing 1090 // DHCPCFG_NAME 1091 dhcp.setOption(DHCPCFG_MACADDRESS, "080027A03128"); 1092 dhcp.setOption(DHCPCFG_IPADDRESS, "192.168.55.1"); 1093 // DHCPCFG_LEASEDB, 1094 // DHCPCFG_VERBOSE, 1095 // DHCPCFG_BEGINCONFIG, 1096 // DHCPCFG_GATEWAY, 1097 dhcp.setOption(DHCPCFG_LOWERIP, "192.168.55.10"); 1098 dhcp.setOption(DHCPCFG_UPPERIP, "192.168.55.100"); 1099 dhcp.setOption(DHCPCFG_NETMASK, "255.255.255.0"); 1100 // DHCPCFG_HELP, 1101 // DHCPCFG_VERSION, 1102 // DHCPCFG_NOTOPT_MAXVAL 1103 dhcp.start(); 1104 1105 dhcp.detachFromServer(); /* need to do this to avoid server shutdown on runner destruction */ 1106 #endif 1069 1107 /* 1070 1108 * Get default buffer. … … 1116 1154 } 1117 1155 1118 1156 return rc; 1119 1157 } 1120 1158 -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r17885 r17940 1299 1299 } 1300 1300 1301 1301 1302 NetworkAttachmentType_T networkAttachment; 1302 1303 hrc = networkAdapter->COMGETTER(AttachmentType)(&networkAttachment); H(); 1304 Bstr networkName; 1303 1305 switch (networkAttachment) 1304 1306 { … … 1344 1346 STR_CONV(); 1345 1347 if (psz && *psz) 1348 { 1346 1349 rc = CFGMR3InsertString(pCfg, "Network", psz); RC_CHECK(); 1350 networkName = Bstr(psz); 1351 } 1352 1347 1353 STR_FREE(); 1348 1354 } … … 1486 1492 RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s", pszHifName); 1487 1493 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK(); 1494 networkName = Bstr(szNetwork); 1488 1495 1489 1496 # if defined(RT_OS_DARWIN) … … 1707 1714 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1708 1715 rc = CFGMR3InsertString(pCfg, "Network", psz); RC_CHECK(); 1716 networkName = Bstr(psz); 1709 1717 } 1710 1718 STR_FREE(); … … 1781 1789 RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s", pszHifName); 1782 1790 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK(); 1791 networkName = Bstr(szNetwork); 1783 1792 #elif defined(RT_OS_DARWIN) 1784 1793 rc = CFGMR3InsertString(pCfg, "Trunk", "vboxnet0"); RC_CHECK(); 1785 1794 rc = CFGMR3InsertString(pCfg, "Network", "HostInterfaceNetworking-vboxnet0"); RC_CHECK(); 1786 1795 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK(); 1796 networkName = Bstr("HostInterfaceNetworking-vboxnet0"); 1787 1797 #else 1788 1798 rc = CFGMR3InsertString(pCfg, "Trunk", "vboxnet0"); RC_CHECK(); 1789 1799 rc = CFGMR3InsertString(pCfg, "Network", "HostInterfaceNetworking-vboxnet0"); RC_CHECK(); 1790 1800 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK(); 1801 networkName = Bstr("HostInterfaceNetworking-vboxnet0"); 1791 1802 #endif 1792 1803 break; … … 1797 1808 break; 1798 1809 } 1810 1811 ComPtr<IDhcpServer> dhcpServer; 1812 hrc = virtualBox->FindDhcpServerByName(networkName.mutableRaw(), dhcpServer.asOutParam()); 1813 if(FAILED(hrc)) 1814 { 1815 LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(Id) failed, hrc (0x%x)", hrc)); 1816 H(); 1817 } 1818 1799 1819 } 1800 1820 -
trunk/src/VBox/Main/generic/DhcpServerRunner.cpp
r17920 r17940 64 64 } 65 65 66 void DhcpServerRunner::detachFromServer() 67 { 68 mProcess = NIL_RTPROCESS; 69 } 70 66 71 int DhcpServerRunner::start() 67 72 { -
trunk/src/VBox/Main/generic/DhcpServerRunner.h
r17882 r17940 69 69 int stop(); 70 70 bool isRunning(); 71 72 void detachFromServer(); 71 73 private: 72 74 Utf8Str mOptions[DHCPCFG_NOTOPT_MAXVAL];
Note:
See TracChangeset
for help on using the changeset viewer.