Changeset 10559 in vbox for trunk/src/VBox
- Timestamp:
- Jul 12, 2008 12:57:37 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r10557 r10559 92 92 93 93 /** 94 * A trunk interface. 95 */ 96 typedef struct INTNETTRUNKIF 97 { 98 /** The port interface we present to the component. */ 99 INTNETTRUNKSWPORT SwitchPort; 100 /** The port interface we get from the component. */ 101 PINTNETTRUNKIFPORT pIfPort; 102 /** The trunk mutex that serializes all calls <b>to</b> the component. */ 103 RTSEMFASTMUTEX FastMutex; 104 } INTNETTRUNKIF; 105 /** Pointer to a trunk interface. */ 106 typedef INTNETTRUNKIF *PINTNETTRUNKIF; 107 108 109 /** 94 110 * Internal representation of a network. 95 111 */ … … 1247 1263 static int intnetNetworkCreateTrunkConnection(PINTNETNETWORK pNetwork, PSUPDRVSESSION pSession) 1248 1264 { 1249 const char *psz FactoryUUID;1265 const char *pszName; 1250 1266 switch (pNetwork->enmTrunkType) 1251 1267 { … … 1260 1276 1261 1277 case kIntNetTrunkType_NetFlt: 1262 psz FactoryUUID = INTNETTRUNKFACTORY_NETFLT_UUID_STR;1278 pszName = "VBoxNetFlt"; 1263 1279 break; 1264 1280 case kIntNetTrunkType_NetTap: 1265 psz FactoryUUID = INTNETTRUNKFACTORY_NETTAP_UUID_STR;1281 pszName = "VBoxNetTap"; 1266 1282 break; 1267 1283 case kIntNetTrunkType_SrvNat: 1268 psz FactoryUUID = INTNETTRUNKFACTORY_SRVNAT_UUID_STR;1284 pszName = "VBoxSrvNat"; 1269 1285 break; 1270 1286 } 1271 1287 1272 /* 1273 * Query the factory. 1274 */ 1275 1288 #if 0 1289 /* 1290 * Allocate the trunk interface. 1291 */ 1292 PINTNETTRUNKIF pTrunkIF = (PINTNETTRUNKIF)RTMemAllocZ(sizeof(*pTrunkIF)); 1293 if (!pTrunkIF) 1294 return VERR_NO_MEMORY; 1295 pTrunkIF->SwitchPort.u32Version = INTNETTRUNKSWPORT_VERSION; 1296 pTrunkIF->SwitchPort.pfnSetSGPhys = intnetTrunkIfPortSetSGPhys; 1297 pTrunkIF->SwitchPort.pfnRecv = intnetTrunkIfPortRecv; 1298 pTrunkIF->SwitchPort.pfnSGRetain = intnetTrunkIfPortSGRetain; 1299 pTrunkIF->SwitchPort.pfnSGRelease = intnetTrunkIfPortSGRelease; 1300 pTrunkIF->SwitchPort.u32VersionEnd = INTNETTRUNKSWPORT_VERSION; 1301 //pTrunkIF->pIfPort = NULL; 1302 int rc = RTSemFastMutexCreate(&pTrunkIF->FastMutex); 1303 if (RT_SUCCESS(rc)) 1304 { 1305 /* 1306 * Query the factory we want, then use it create and connect the trunk. 1307 */ 1308 PINTNETTRUNKFACTORY pTrunkFactory = NULL; 1309 rc = SUPR0ComponentQueryFactory(pSession, pszName, INTNETTRUNKFACTORY_UUID_STR, (void **)&pTrunkFactory); 1310 if (RT_SUCCESS(rc)) 1311 { 1312 rc = pTrunkFactory->pfnCreateAndConnect(pTrunkFactory, pNetwork->szTrunk, &pTrunkIF->SwitchPort, &pTrunkIF->pIfPort); 1313 /** @todo pTrunkFactory->pfnRelease(pTrunkFactory); */ 1314 if (RT_SUCCESS(rc)) 1315 { 1316 Assert(pTrunkIF->pIfPort); 1317 LogFlow(("intnetNetworkCreateTrunkConnection: VINF_SUCCESS - pszName=%s szTrunk=%s Network=%s\n", 1318 rc, pszName, pNetwork->szTrunk, pNetwork->szName)); 1319 return VINF_SUCCESS; 1320 } 1321 } 1322 1323 RTMemFree(pTrunkIF); 1324 } 1325 LogFlow(("intnetNetworkCreateTrunkConnection: %Rrc - pszName=%s szTrunk=%s Network=%s\n", 1326 rc, pszName, pNetwork->szTrunk, pNetwork->szName)); 1327 return rc; 1328 #else 1276 1329 return VERR_NOT_IMPLEMENTED; 1330 #endif 1277 1331 } 1278 1332
Note:
See TracChangeset
for help on using the changeset viewer.