Changeset 11157 in vbox
- Timestamp:
- Aug 5, 2008 11:08:37 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/intnet.h
r11101 r11157 492 492 * @remarks Called while owning the network and the out-bound trunk port semaphores. 493 493 */ 494 DECLR0CALLBACKMEMBER(void, pfnGetMacAddress,(PINTNETTRUNKIFPORT pIfPort, P PDMMAC pMac));494 DECLR0CALLBACKMEMBER(void, pfnGetMacAddress,(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac)); 495 495 496 496 /** … … 511 511 * with pfnGetHostMac? 512 512 */ 513 DECLR0CALLBACKMEMBER(bool, pfnIsHostMac,(PINTNETTRUNKIFPORT pIfPort, PC PDMMAC pMac));513 DECLR0CALLBACKMEMBER(bool, pfnIsHostMac,(PINTNETTRUNKIFPORT pIfPort, PCRTMAC pMac)); 514 514 515 515 /** … … 780 780 INTNETIFHANDLE hIf; 781 781 /** The new MAC address. */ 782 PDMMACMac;782 RTMAC Mac; 783 783 } INTNETIFSETMACADDRESSREQ; 784 784 /** Pointer to an INTNETR0IfSetMacAddressReq / VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS request buffer. */ … … 933 933 */ 934 934 INTNETR0DECL(int) INTNETR0IfSetPromiscuousMode( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous); 935 INTNETR0DECL(int) INTNETR0IfSetMacAddress( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PC PDMMAC pMac);935 INTNETR0DECL(int) INTNETR0IfSetMacAddress( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac); 936 936 INTNETR0DECL(int) INTNETR0IfSetActive( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive); 937 937 -
trunk/include/VBox/pdmifs.h
r10837 r11157 2192 2192 * @thread EMT 2193 2193 */ 2194 DECLR3CALLBACKMEMBER(int, pfnGetMac,(PPDMINETWORKCONFIG pInterface, P PDMMAC pMac));2194 DECLR3CALLBACKMEMBER(int, pfnGetMac,(PPDMINETWORKCONFIG pInterface, PRTMAC pMac)); 2195 2195 2196 2196 /** -
trunk/include/VBox/types.h
r11155 r11157 496 496 497 497 498 /** PDM MAC address.499 * @obsolete Use RTMAC. */500 typedef RTMAC PDMMAC;501 /** Pointer to a MAC address. */502 typedef PDMMAC *PPDMMAC;503 /** Pointer to a const MAC address. */504 typedef const PDMMAC *PCPDMMAC;505 506 498 /** 507 499 * Data transport buffer (scatter/gather) -
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r9212 r11157 201 201 RTUINT cLinkDownReported; 202 202 /** The configured MAC address. */ 203 PDMMACMacConfigured;203 RTMAC MacConfigured; 204 204 /** Alignment padding. */ 205 205 uint8_t Alignment4[HC_ARCH_BITS == 64 ? 6 : 2]; … … 4179 4179 { 4180 4180 PCNetState *pData = PDMINS2DATA(pDevIns, PCNetState *); 4181 PDMMACMac;4181 RTMAC Mac; 4182 4182 if ( SSM_VERSION_MAJOR_CHANGED(u32Version, PCNET_SAVEDSTATE_VERSION) 4183 4183 || SSM_VERSION_MINOR(u32Version) < 7) … … 4399 4399 * @thread EMT 4400 4400 */ 4401 static DECLCALLBACK(int) pcnetGetMac(PPDMINETWORKCONFIG pInterface, P PDMMAC pMac)4401 static DECLCALLBACK(int) pcnetGetMac(PPDMINETWORKCONFIG pInterface, PRTMAC pMac) 4402 4402 { 4403 4403 PCNetState *pData = INETWORKCONFIG_2_DATA(pInterface); -
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r11075 r11157 189 189 Assert(pRingBuf); 190 190 Assert(pvFrame); 191 Assert(cbFrame >= sizeof( PDMMAC) * 2);191 Assert(cbFrame >= sizeof(RTMAC) * 2); 192 192 uint32_t offWrite = pRingBuf->offWrite; 193 193 Assert(offWrite == RT_ALIGN_32(offWrite, sizeof(INTNETHDR))); -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r9523 r11157 372 372 if (pData->pConfig) 373 373 { 374 PDMMAC Mac;374 RTMAC Mac; 375 375 pData->pConfig->pfnGetMac(pData->pConfig, &Mac); 376 376 slirp_set_ethaddr(pData->pNATState, Mac.au8); -
trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp
r10758 r11157 213 213 * @thread EMT 214 214 */ 215 static DECLCALLBACK(int) drvNetSnifferGetMac(PPDMINETWORKCONFIG pInterface, P PDMMAC pMac)215 static DECLCALLBACK(int) drvNetSnifferGetMac(PPDMINETWORKCONFIG pInterface, PRTMAC pMac) 216 216 { 217 217 PDRVNETSNIFFER pThis = PDMINETWORKCONFIG_2_DRVNETSNIFFER(pInterface); -
trunk/src/VBox/Devices/Network/DrvTAP.cpp
r9124 r11157 97 97 # ifdef VBOX_WITH_CROSSBOW 98 98 /** Crossbow: MAC address of the device. */ 99 PDMMACMacAddress;99 RTMAC MacAddress; 100 100 /** Crossbow: Handle of the NIC. */ 101 101 dlpi_handle_t pDeviceHandle; … … 403 403 char *pszHex = "0123456789abcdef"; 404 404 uint8_t *pMacAddr8 = pData->MacAddress.au8; 405 char szMacAddress[3 * sizeof( PDMMAC)];406 for (unsigned int i = 0; i < sizeof( PDMMAC); i++)405 char szMacAddress[3 * sizeof(RTMAC)]; 406 for (unsigned int i = 0; i < sizeof(RTMAC); i++) 407 407 { 408 408 szMacAddress[3 * i] = pszHex[((*pMacAddr8 >> 4) & 0x0f)]; -
trunk/src/VBox/Devices/Network/DrvTAPOs2.cpp
r8610 r11157 118 118 STAM_PROFILE_START(&pThis->StatTransmit, a); 119 119 120 /* 121 * If the pvBuf is a high address, we'll have to copy it onto a 120 /* 121 * If the pvBuf is a high address, we'll have to copy it onto a 122 122 * stack buffer of the tap driver will trap. 123 123 */ … … 149 149 static unsigned cComplaints = 0; 150 150 if (cComplaints++ < 256) 151 LogRel(("%s: send failed. rc=%d Parm={%ld,%ld} cb=%d\n", 151 LogRel(("%s: send failed. rc=%d Parm={%ld,%ld} cb=%d\n", 152 152 pThis->szName, rc, Parm[0], Parm[1], cb)); 153 153 if (rc) … … 230 230 231 231 /* 232 * Loop while the thread is running, quit immediately when 232 * Loop while the thread is running, quit immediately when 233 233 * we're supposed to suspend or terminate. 234 234 */ … … 284 284 else if (rc) 285 285 { 286 LogFlow(("%s: ReceiveThread: DoDevIOCtl -> %s Parm={%ld, %ld}\n", 286 LogFlow(("%s: ReceiveThread: DoDevIOCtl -> %s Parm={%ld, %ld}\n", 287 287 pThis->szName, rc, Parm[0], Parm[1])); 288 288 rc = RTErrConvertFromOS2(rc); … … 378 378 if ( orc 379 379 || Parm[0]) 380 LogRel(("%s: Failed to disconnect %d from %d! orc=%d Parm={%ld,%ld}\n", 380 LogRel(("%s: Failed to disconnect %d from %d! orc=%d Parm={%ld,%ld}\n", 381 381 pThis->szName, pThis->iLan, pThis->iConnectedTo, orc, Parm[0], Parm[1])); 382 382 pThis->iConnectedTo = -1; … … 484 484 if (VBOX_FAILURE(rc)) 485 485 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 486 N_("Failed to query LanNumber! orc=%d Parm={%ld,%ld}"), 486 N_("Failed to query LanNumber! orc=%d Parm={%ld,%ld}"), 487 487 orc, Parm[0], Parm[1]); 488 488 pThis->iLan = (int32_t)Data; 489 489 Log(("%s: iLan=%d Parm[1]=%ld\n", pThis->szName, pThis->iLan, Parm[1])); 490 490 491 /* 491 /* 492 492 * Connect it requested. 493 493 */ … … 511 511 if (VBOX_FAILURE(rc)) 512 512 return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, 513 N_("Failed to connect %d to %d! orc=%d Parm={%ld,%ld}"), 513 N_("Failed to connect %d to %d! orc=%d Parm={%ld,%ld}"), 514 514 pThis->iLan, iConnectTo, orc, Parm[0], Parm[1]); 515 515 Log(("%s: Connected to %d\n", pThis->szName, iConnectTo)); … … 517 517 } 518 518 519 /* 519 /* 520 520 * Log the config. 521 521 */ 522 522 Parm[0] = Parm[1] = ~0UL; /* mysterious output */ 523 PDMMAC Mac;523 RTMAC Mac; 524 524 cbParm = sizeof(Parm); 525 525 cbData = sizeof(Mac); … … 527 527 &Parm[0], cbParm, &cbParm, 528 528 &Mac, cbData, &cbData); 529 if ( !orc 529 if ( !orc 530 530 && !Parm[0] 531 531 /*&& !Parm[1]?*/) 532 LogRel(("%s: iLan=%d iConnectedTo=%d Mac=%02x:%02x:%02x:%02x:%02x:%02x\n", 533 pThis->szName, pThis->iLan, pThis->iConnectedTo, 532 LogRel(("%s: iLan=%d iConnectedTo=%d Mac=%02x:%02x:%02x:%02x:%02x:%02x\n", 533 pThis->szName, pThis->iLan, pThis->iConnectedTo, 534 534 Mac.au8[0], Mac.au8[1], Mac.au8[2], Mac.au8[3], Mac.au8[4], Mac.au8[5])); 535 535 else 536 LogRel(("%s: iLan=%d iConnectedTo Mac=failed - orc=%d Parm={%ld,%ld}\n", 536 LogRel(("%s: iLan=%d iConnectedTo Mac=failed - orc=%d Parm={%ld,%ld}\n", 537 537 pThis->szName, pThis->iLan, pThis->iConnectedTo, Parm[0], Parm[1])); 538 538 -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r11133 r11157 2674 2674 * @param pMAC The new MAC address. 2675 2675 */ 2676 INTNETR0DECL(int) INTNETR0IfSetMacAddress(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PC PDMMAC pMac)2676 INTNETR0DECL(int) INTNETR0IfSetMacAddress(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac) 2677 2677 { 2678 2678 LogFlow(("INTNETR0IfSetMacAddress: pIntNet=%p hIf=%RX32 pMac=%p:{%.6Rhxs}\n", pIntNet, hIf, pMac, pMac)); -
trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
r11056 r11157 183 183 Assert(pRingBuf); 184 184 Assert(pvFrame); 185 Assert(cbFrame >= sizeof( PDMMAC) * 2);185 Assert(cbFrame >= sizeof(RTMAC) * 2); 186 186 uint32_t offWrite = pRingBuf->offWrite; 187 187 Assert(offWrite == RT_ALIGN_32(offWrite, sizeof(INTNETHDR))); … … 331 331 * @param pFileText The file to write a textual packet summary to (optional). 332 332 */ 333 static void doXmitTest(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF pBuf, PC PDMMAC pSrcMac, PRTSTREAM pFileRaw, PRTSTREAM pFileText)333 static void doXmitTest(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF pBuf, PCRTMAC pSrcMac, PRTSTREAM pFileRaw, PRTSTREAM pFileText) 334 334 { 335 335 uint8_t abFrame[4096]; … … 346 346 pDhcpMsg->Op = 1; /* request */ 347 347 pDhcpMsg->HType = 1; /* ethernet */ 348 pDhcpMsg->HLen = sizeof( PDMMAC);348 pDhcpMsg->HLen = sizeof(RTMAC); 349 349 pDhcpMsg->Hops = 0; 350 350 pDhcpMsg->XID = g_DhcpXID = RTRandU32(); … … 432 432 */ 433 433 static void doPacketSniffing(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF pBuf, uint32_t cMillies, 434 PRTSTREAM pFileRaw, PRTSTREAM pFileText, PC PDMMAC pSrcMac)434 PRTSTREAM pFileRaw, PRTSTREAM pFileText, PCRTMAC pSrcMac) 435 435 { 436 436 /* … … 498 498 if ( pDhcpMsg->Op == 2 /* boot reply */ 499 499 && pDhcpMsg->HType == 1 /* ethernet */ 500 && pDhcpMsg->HLen == sizeof( PDMMAC)500 && pDhcpMsg->HLen == sizeof(RTMAC) 501 501 && (pDhcpMsg->XID == g_DhcpXID || !g_DhcpXID) 502 502 && !memcmp(&pDhcpMsg->CHAddr[0], pSrcMac, sizeof(*pSrcMac))) … … 581 581 PRTSTREAM pFileText = g_pStdOut; 582 582 bool fXmitTest = false; 583 PDMMACSrcMac;583 RTMAC SrcMac; 584 584 SrcMac.au8[0] = 0x08; 585 585 SrcMac.au8[1] = 0x03; -
trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp
r11071 r11157 211 211 PINTNETBUF pBuf; 212 212 INTNETIFHANDLE hIf; 213 PDMMAC Mac;213 RTMAC Mac; 214 214 uint64_t u64Start; 215 215 uint64_t u64End; … … 231 231 */ 232 232 uint8_t abBuf[4096] = {0}; 233 P PDMMAC pMacSrc = (PPDMMAC)&abBuf[0];234 P PDMMAC pMacDst = pMacSrc + 1;233 PRTMAC pMacSrc = (PRTMAC)&abBuf[0]; 234 PRTMAC pMacDst = pMacSrc + 1; 235 235 *pMacSrc = pArgs->Mac; 236 236 *pMacDst = pArgs->Mac; … … 270 270 for (unsigned c = 0; c < 20; c++) 271 271 { 272 int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession, abBuf, sizeof( PDMMAC) * 2 + sizeof(unsigned) * 4);272 int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession, abBuf, sizeof(RTMAC) * 2 + sizeof(unsigned) * 4); 273 273 if (VBOX_FAILURE(rc)) 274 274 { … … 327 327 uint8_t abBuf[16384]; 328 328 unsigned cb = intnetR0RingReadFrame(pArgs->pBuf, &pArgs->pBuf->Recv, abBuf); 329 unsigned *puFrame = (unsigned *)&abBuf[sizeof( PDMMAC) * 2];329 unsigned *puFrame = (unsigned *)&abBuf[sizeof(RTMAC) * 2]; 330 330 331 331 /* check for termination frame. */ 332 if ( cb == sizeof( PDMMAC) * 2 + sizeof(unsigned) * 4332 if ( cb == sizeof(RTMAC) * 2 + sizeof(unsigned) * 4 333 333 && puFrame[0] == 0xffffdead 334 334 && puFrame[1] == 0xffffdead … … 343 343 344 344 /* validate frame header */ 345 P PDMMAC pMacSrc = (PPDMMAC)&abBuf[0];346 P PDMMAC pMacDst = pMacSrc + 1;345 PRTMAC pMacSrc = (PRTMAC)&abBuf[0]; 346 PRTMAC pMacDst = pMacSrc + 1; 347 347 if ( pMacDst->au16[0] != 0x8086 348 348 || pMacDst->au16[1] != 0 -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r11083 r11157 1034 1034 char *macStr = (char*)macAddrUtf8.raw(); 1035 1035 Assert(strlen(macStr) == 12); 1036 PDMMAC Mac;1036 RTMAC Mac; 1037 1037 memset(&Mac, 0, sizeof(Mac)); 1038 1038 char *pMac = (char*)&Mac; -
trunk/src/VBox/Main/darwin/iokit.cpp
r11100 r11157 1480 1480 1481 1481 /* Get the MAC address. */ 1482 PDMMAC Mac;1482 RTMAC Mac; 1483 1483 AssertBreak(darwinDictGetData(PropsRef, CFSTR("IOMACAddress"), &Mac, sizeof(Mac))); 1484 1484 -
trunk/src/VBox/Main/darwin/iokit.h
r10895 r11157 55 55 RTUUID Uuid; 56 56 /** The MAC address. */ 57 PDMMAC Mac;57 RTMAC Mac; 58 58 /** Internal category number (0..7). */ 59 59 int iCat; -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r8155 r11157 578 578 rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATERC(); 579 579 rc = CFGMR3InsertInteger(pCfg, "Am79C973", 1); UPDATERC(); 580 PDMMAC Mac;580 RTMAC Mac; 581 581 Mac.au16[0] = 0x0080; 582 582 Mac.au16[2] = Mac.au16[1] = 0x8086; … … 817 817 static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES; 818 818 PRTLOGGER pRelLogger; 819 rc = RTLogCreate(&pRelLogger, RTLOGFLAGS_PREFIX_TIME_PROG, "all", "VBOX_RELEASE_LOG", 819 rc = RTLogCreate(&pRelLogger, RTLOGFLAGS_PREFIX_TIME_PROG, "all", "VBOX_RELEASE_LOG", 820 820 RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_FILE, "./tstAnimate.log"); 821 821 if (VBOX_SUCCESS(rc)) … … 857 857 { 858 858 if (fPowerOn) 859 { 859 { 860 860 /* 861 861 * Adjust warpspeed?
Note:
See TracChangeset
for help on using the changeset viewer.