VirtualBox

Changeset 11157

Show
Ignore:
Timestamp:
08/06/08 01:08:37 (4 months ago)
Author:
vboxsync
Message:

Replaced PDMMAC by RTMAC.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/intnet.h

    r11101 r11157  
    492492     * @remarks Called while owning the network and the out-bound trunk port semaphores. 
    493493     */ 
    494     DECLR0CALLBACKMEMBER(void, pfnGetMacAddress,(PINTNETTRUNKIFPORT pIfPort, PPDMMAC pMac)); 
     494    DECLR0CALLBACKMEMBER(void, pfnGetMacAddress,(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac)); 
    495495 
    496496    /** 
     
    511511     *          with pfnGetHostMac? 
    512512     */ 
    513     DECLR0CALLBACKMEMBER(bool, pfnIsHostMac,(PINTNETTRUNKIFPORT pIfPort, PCPDMMAC pMac)); 
     513    DECLR0CALLBACKMEMBER(bool, pfnIsHostMac,(PINTNETTRUNKIFPORT pIfPort, PCRTMAC pMac)); 
    514514 
    515515    /** 
     
    780780    INTNETIFHANDLE  hIf; 
    781781    /** The new MAC address. */ 
    782     PDMMAC          Mac; 
     782    RTMAC           Mac; 
    783783} INTNETIFSETMACADDRESSREQ; 
    784784/** Pointer to an INTNETR0IfSetMacAddressReq / VMMR0_DO_INTNET_IF_SET_MAC_ADDRESS request buffer. */ 
     
    933933 */ 
    934934INTNETR0DECL(int) INTNETR0IfSetPromiscuousMode( PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fPromiscuous); 
    935 INTNETR0DECL(int) INTNETR0IfSetMacAddress(      PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCPDMMAC pMac); 
     935INTNETR0DECL(int) INTNETR0IfSetMacAddress(      PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac); 
    936936INTNETR0DECL(int) INTNETR0IfSetActive(          PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, bool fActive); 
    937937 
  • trunk/include/VBox/pdmifs.h

    r10837 r11157  
    21922192     * @thread  EMT 
    21932193     */ 
    2194     DECLR3CALLBACKMEMBER(int, pfnGetMac,(PPDMINETWORKCONFIG pInterface, PPDMMAC pMac)); 
     2194    DECLR3CALLBACKMEMBER(int, pfnGetMac,(PPDMINETWORKCONFIG pInterface, PRTMAC pMac)); 
    21952195 
    21962196    /** 
  • trunk/include/VBox/types.h

    r11155 r11157  
    496496 
    497497 
    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  
    506498/** 
    507499 * Data transport buffer (scatter/gather) 
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r9212 r11157  
    201201    RTUINT                              cLinkDownReported; 
    202202    /** The configured MAC address. */ 
    203     PDMMAC                              MacConfigured; 
     203    RTMAC                               MacConfigured; 
    204204    /** Alignment padding. */ 
    205205    uint8_t                             Alignment4[HC_ARCH_BITS == 64 ? 6 : 2]; 
     
    41794179{ 
    41804180    PCNetState *pData = PDMINS2DATA(pDevIns, PCNetState *); 
    4181     PDMMAC      Mac; 
     4181    RTMAC       Mac; 
    41824182    if (   SSM_VERSION_MAJOR_CHANGED(u32Version, PCNET_SAVEDSTATE_VERSION) 
    41834183        || SSM_VERSION_MINOR(u32Version) < 7) 
     
    43994399 * @thread  EMT 
    44004400 */ 
    4401 static DECLCALLBACK(int) pcnetGetMac(PPDMINETWORKCONFIG pInterface, PPDMMAC pMac) 
     4401static DECLCALLBACK(int) pcnetGetMac(PPDMINETWORKCONFIG pInterface, PRTMAC pMac) 
    44024402{ 
    44034403    PCNetState *pData = INETWORKCONFIG_2_DATA(pInterface); 
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r11075 r11157  
    189189    Assert(pRingBuf); 
    190190    Assert(pvFrame); 
    191     Assert(cbFrame >= sizeof(PDMMAC) * 2); 
     191    Assert(cbFrame >= sizeof(RTMAC) * 2); 
    192192    uint32_t offWrite = pRingBuf->offWrite; 
    193193    Assert(offWrite == RT_ALIGN_32(offWrite, sizeof(INTNETHDR))); 
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r9523 r11157  
    372372    if (pData->pConfig) 
    373373    { 
    374         PDMMAC Mac; 
     374        RTMAC Mac; 
    375375        pData->pConfig->pfnGetMac(pData->pConfig, &Mac); 
    376376        slirp_set_ethaddr(pData->pNATState, Mac.au8); 
  • trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp

    r10758 r11157  
    213213 * @thread  EMT 
    214214 */ 
    215 static DECLCALLBACK(int) drvNetSnifferGetMac(PPDMINETWORKCONFIG pInterface, PPDMMAC pMac) 
     215static DECLCALLBACK(int) drvNetSnifferGetMac(PPDMINETWORKCONFIG pInterface, PRTMAC pMac) 
    216216{ 
    217217    PDRVNETSNIFFER pThis = PDMINETWORKCONFIG_2_DRVNETSNIFFER(pInterface); 
  • trunk/src/VBox/Devices/Network/DrvTAP.cpp

    r9124 r11157  
    9797# ifdef VBOX_WITH_CROSSBOW 
    9898    /** Crossbow: MAC address of the device. */ 
    99     PDMMAC                  MacAddress; 
     99    RTMAC                   MacAddress; 
    100100    /** Crossbow: Handle of the NIC. */ 
    101101    dlpi_handle_t           pDeviceHandle; 
     
    403403    char *pszHex = "0123456789abcdef"; 
    404404    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++) 
    407407    { 
    408408        szMacAddress[3 * i] = pszHex[((*pMacAddr8 >> 4) & 0x0f)]; 
  • trunk/src/VBox/Devices/Network/DrvTAPOs2.cpp

    r8610 r11157  
    118118    STAM_PROFILE_START(&pThis->StatTransmit, a); 
    119119 
    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 
    122122     * stack buffer of the tap driver will trap. 
    123123     */ 
     
    149149        static unsigned cComplaints = 0; 
    150150        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", 
    152152                    pThis->szName, rc, Parm[0], Parm[1], cb)); 
    153153        if (rc) 
     
    230230 
    231231    /* 
    232      * Loop while the thread is running, quit immediately when  
     232     * Loop while the thread is running, quit immediately when 
    233233     * we're supposed to suspend or terminate. 
    234234     */ 
     
    284284        else if (rc) 
    285285        { 
    286             LogFlow(("%s: ReceiveThread: DoDevIOCtl -> %s Parm={%ld, %ld}\n",  
     286            LogFlow(("%s: ReceiveThread: DoDevIOCtl -> %s Parm={%ld, %ld}\n", 
    287287                     pThis->szName, rc, Parm[0], Parm[1])); 
    288288            rc = RTErrConvertFromOS2(rc); 
     
    378378        if (    orc 
    379379            ||  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", 
    381381                    pThis->szName, pThis->iLan, pThis->iConnectedTo, orc, Parm[0], Parm[1])); 
    382382        pThis->iConnectedTo = -1; 
     
    484484    if (VBOX_FAILURE(rc)) 
    485485        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}"), 
    487487                                   orc, Parm[0], Parm[1]); 
    488488    pThis->iLan = (int32_t)Data; 
    489489    Log(("%s: iLan=%d Parm[1]=%ld\n", pThis->szName, pThis->iLan, Parm[1])); 
    490490 
    491     /*  
     491    /* 
    492492     * Connect it requested. 
    493493     */ 
     
    511511        if (VBOX_FAILURE(rc)) 
    512512            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}"), 
    514514                                       pThis->iLan, iConnectTo, orc, Parm[0], Parm[1]); 
    515515        Log(("%s: Connected to %d\n", pThis->szName, iConnectTo)); 
     
    517517    } 
    518518 
    519     /*  
     519    /* 
    520520     * Log the config. 
    521521     */ 
    522522    Parm[0] = Parm[1] = ~0UL; /* mysterious output */ 
    523     PDMMAC Mac; 
     523    RTMAC Mac; 
    524524    cbParm = sizeof(Parm); 
    525525    cbData = sizeof(Mac); 
     
    527527                      &Parm[0], cbParm, &cbParm, 
    528528                      &Mac, cbData, &cbData); 
    529     if (    !orc  
     529    if (    !orc 
    530530        &&  !Parm[0] 
    531531      /*&&  !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, 
    534534                Mac.au8[0], Mac.au8[1], Mac.au8[2], Mac.au8[3], Mac.au8[4], Mac.au8[5])); 
    535535    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", 
    537537                pThis->szName, pThis->iLan, pThis->iConnectedTo, Parm[0], Parm[1])); 
    538538 
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r11133 r11157  
    26742674 * @param   pMAC            The new MAC address. 
    26752675 */ 
    2676 INTNETR0DECL(int) INTNETR0IfSetMacAddress(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCPDMMAC pMac) 
     2676INTNETR0DECL(int) INTNETR0IfSetMacAddress(PINTNET pIntNet, INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PCRTMAC pMac) 
    26772677{ 
    26782678    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  
    183183    Assert(pRingBuf); 
    184184    Assert(pvFrame); 
    185     Assert(cbFrame >= sizeof(PDMMAC) * 2); 
     185    Assert(cbFrame >= sizeof(RTMAC) * 2); 
    186186    uint32_t offWrite = pRingBuf->offWrite; 
    187187    Assert(offWrite == RT_ALIGN_32(offWrite, sizeof(INTNETHDR))); 
     
    331331 * @param   pFileText       The file to write a textual packet summary to (optional). 
    332332 */ 
    333 static void doXmitTest(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF pBuf, PCPDMMAC pSrcMac, PRTSTREAM pFileRaw, PRTSTREAM pFileText) 
     333static void doXmitTest(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF pBuf, PCRTMAC pSrcMac, PRTSTREAM pFileRaw, PRTSTREAM pFileText) 
    334334{ 
    335335    uint8_t abFrame[4096]; 
     
    346346    pDhcpMsg->Op = 1; /* request */ 
    347347    pDhcpMsg->HType = 1; /* ethernet */ 
    348     pDhcpMsg->HLen = sizeof(PDMMAC); 
     348    pDhcpMsg->HLen = sizeof(RTMAC); 
    349349    pDhcpMsg->Hops = 0; 
    350350    pDhcpMsg->XID = g_DhcpXID = RTRandU32(); 
     
    432432 */ 
    433433static void doPacketSniffing(INTNETIFHANDLE hIf, PSUPDRVSESSION pSession, PINTNETBUF pBuf, uint32_t cMillies, 
    434                              PRTSTREAM pFileRaw, PRTSTREAM pFileText, PCPDMMAC pSrcMac) 
     434                             PRTSTREAM pFileRaw, PRTSTREAM pFileText, PCRTMAC pSrcMac) 
    435435{ 
    436436    /* 
     
    498498                        if (    pDhcpMsg->Op == 2 /* boot reply */ 
    499499                            &&  pDhcpMsg->HType == 1 /* ethernet */ 
    500                             &&  pDhcpMsg->HLen == sizeof(PDMMAC) 
     500                            &&  pDhcpMsg->HLen == sizeof(RTMAC) 
    501501                            &&  (pDhcpMsg->XID == g_DhcpXID || !g_DhcpXID) 
    502502                            &&  !memcmp(&pDhcpMsg->CHAddr[0], pSrcMac, sizeof(*pSrcMac))) 
     
    581581    PRTSTREAM   pFileText = g_pStdOut; 
    582582    bool        fXmitTest = false; 
    583     PDMMAC      SrcMac; 
     583    RTMAC       SrcMac; 
    584584    SrcMac.au8[0] = 0x08; 
    585585    SrcMac.au8[1] = 0x03; 
  • trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp

    r11071 r11157  
    211211    PINTNETBUF pBuf; 
    212212    INTNETIFHANDLE hIf; 
    213     PDMMAC Mac; 
     213    RTMAC Mac; 
    214214    uint64_t u64Start; 
    215215    uint64_t u64End; 
     
    231231     */ 
    232232    uint8_t abBuf[4096] = {0}; 
    233     PPDMMAC pMacSrc = (PPDMMAC)&abBuf[0]; 
    234     PPDMMAC pMacDst = pMacSrc + 1; 
     233    PRTMAC pMacSrc = (PRTMAC)&abBuf[0]; 
     234    PRTMAC pMacDst = pMacSrc + 1; 
    235235    *pMacSrc = pArgs->Mac; 
    236236    *pMacDst = pArgs->Mac; 
     
    270270    for (unsigned c = 0; c < 20; c++) 
    271271    { 
    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); 
    273273        if (VBOX_FAILURE(rc)) 
    274274        { 
     
    327327            uint8_t abBuf[16384]; 
    328328            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]; 
    330330 
    331331            /* check for termination frame. */ 
    332             if (    cb == sizeof(PDMMAC) * 2 + sizeof(unsigned) * 4 
     332            if (    cb == sizeof(RTMAC) * 2 + sizeof(unsigned) * 4 
    333333                &&  puFrame[0] == 0xffffdead 
    334334                &&  puFrame[1] == 0xffffdead 
     
    343343 
    344344            /* validate frame header */ 
    345             PPDMMAC pMacSrc = (PPDMMAC)&abBuf[0]; 
    346             PPDMMAC pMacDst = pMacSrc + 1; 
     345            PRTMAC pMacSrc = (PRTMAC)&abBuf[0]; 
     346            PRTMAC pMacDst = pMacSrc + 1; 
    347347            if (    pMacDst->au16[0] != 0x8086 
    348348                ||  pMacDst->au16[1] != 0 
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r11083 r11157  
    10341034        char *macStr = (char*)macAddrUtf8.raw(); 
    10351035        Assert(strlen(macStr) == 12); 
    1036         PDMMAC Mac; 
     1036        RTMAC Mac; 
    10371037        memset(&Mac, 0, sizeof(Mac)); 
    10381038        char *pMac = (char*)&Mac; 
  • trunk/src/VBox/Main/darwin/iokit.cpp

    r11100 r11157  
    14801480 
    14811481                        /* Get the MAC address. */ 
    1482                         PDMMAC Mac; 
     1482                        RTMAC Mac; 
    14831483                        AssertBreak(darwinDictGetData(PropsRef, CFSTR("IOMACAddress"), &Mac, sizeof(Mac))); 
    14841484 
  • trunk/src/VBox/Main/darwin/iokit.h

    r10895 r11157  
    5555    RTUUID Uuid; 
    5656    /** The MAC address. */ 
    57     PDMMAC Mac; 
     57    RTMAC Mac; 
    5858    /** Internal category number (0..7). */ 
    5959    int iCat; 
  • trunk/src/VBox/VMM/testcase/tstAnimate.cpp

    r8155 r11157  
    578578    rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                               UPDATERC(); 
    579579    rc = CFGMR3InsertInteger(pCfg,  "Am79C973",             1);                     UPDATERC(); 
    580     PDMMAC Mac; 
     580    RTMAC Mac; 
    581581    Mac.au16[0] = 0x0080; 
    582582    Mac.au16[2] = Mac.au16[1] = 0x8086; 
     
    817817    static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES; 
    818818    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", 
    820820                     RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_FILE, "./tstAnimate.log"); 
    821821    if (VBOX_SUCCESS(rc)) 
     
    857857            { 
    858858                if (fPowerOn) 
    859                 {    
     859                { 
    860860                    /* 
    861861                     * Adjust warpspeed? 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy