VirtualBox

Ignore:
Timestamp:
Jul 22, 2008 11:07:38 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
33584
Message:

intnet: Push the session down to all the INTNETR0* apis.

Location:
trunk/src/VBox/Devices/Network/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp

    r10764 r10806  
    583583        { "--duration",     'd', RTGETOPT_REQ_UINT32 },
    584584        { "--file",         'f', RTGETOPT_REQ_STRING },
     585        { "--interface",    'i', RTGETOPT_REQ_STRING },
    585586        { "--network",      'n', RTGETOPT_REQ_STRING },
    586587        { "--promiscuous",  'p', RTGETOPT_REQ_NOTHING },
     
    590591        { "--text-file",    't', RTGETOPT_REQ_STRING },
    591592        { "--xmit-test",    'x', RTGETOPT_REQ_NOTHING },
     593        { "--help",         'h', RTGETOPT_REQ_NOTHING },
     594        { "--?",            '?', RTGETOPT_REQ_NOTHING },
    592595    };
    593596
     
    697700            case '?':
    698701            case 'h':
    699                 RTPrintf("syntax: tstIntNet-1 [-pSt] [-d <secs>] [-f <file>] [-r <size>] [-s <size>]\n");
     702                RTPrintf("syntax: tstIntNet-1 [-pStx-] [-d <secs>] [-f <file>] [-r <size>] [-s <size>]\n");
    700703                return 1;
    701704
     
    703706                if (RT_SUCCESS(ch))
    704707                    RTPrintf("tstIntNetR0: invalid argument (%#x): %s\n", ch, Value.psz);
     708                else if (Value.pDef)
     709                    RTPrintf("tstIntNetR0: invalid argument: %Rrc - %s\n", ch, Value.pDef->pszLong);
    705710                else
    706                     RTPrintf("tstIntNetR0: invalid argument: %Rrc - \n", ch, Value.pDef->pszLong);
     711                    RTPrintf("tstIntNetR0: invalid argument: %Rrc - %s\n", ch, argv[iArg]);
    707712                return 1;
    708713        }
  • trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp

    r10740 r10806  
    102102struct TESTFRAME
    103103{
    104     uint16_t    au16[6];
    105 } g_TestFrame0 = { { /* dst:*/ 0xffff, 0xffff, 0xffff, /*src:*/0x8086, 0, 0} },
    106   g_TestFrame1 = { { /* dst:*/0, 0, 0,                /*src:*/0x8086, 0, 1} };
     104    uint16_t    au16[7];
     105} g_TestFrame0 = { { /* dst:*/ 0xffff, 0xffff, 0xffff, /*src:*/0x8086, 0, 0, 0x0800 } },
     106  g_TestFrame1 = { { /* dst:*/ 0, 0, 0,                /*src:*/0x8086, 0, 1, 0x0800 } };
    107107
    108108
     
    240240        *puFrame = iFrame;
    241241#if 0
    242         int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, abBuf, cb);
     242        int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession, abBuf, cb);
    243243#else
    244244        INTNETSG Sg;
     
    246246        int rc = intnetR0RingWriteFrame(pArgs->pBuf, &pArgs->pBuf->Send, &Sg);
    247247        if (RT_SUCCESS(rc))
    248             rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, NULL, 0);
     248            rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession, NULL, 0);
    249249#endif
    250250        if (VBOX_FAILURE(rc))
     
    265265    for (unsigned c = 0; c < 20; c++)
    266266    {
    267         int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, abBuf, sizeof(PDMMAC) * 2 + sizeof(unsigned) * 4);
     267        int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession, abBuf, sizeof(PDMMAC) * 2 + sizeof(unsigned) * 4);
    268268        if (VBOX_FAILURE(rc))
    269269        {
     
    297297         * Wait for data.
    298298         */
    299         int rc = INTNETR0IfWait(pArgs->pIntNet, pArgs->hIf, RT_INDEFINITE_WAIT);
     299        int rc = INTNETR0IfWait(pArgs->pIntNet, pArgs->hIf, g_pSession, RT_INDEFINITE_WAIT);
    300300        switch (rc)
    301301        {
     
    467467                     * Test basic waiting.
    468468                     */
    469                     rc = INTNETR0IfWait(pIntNet, hIf0, 1);
     469                    rc = INTNETR0IfWait(pIntNet, hIf0, g_pSession, 1);
    470470                    if (rc != VERR_TIMEOUT)
    471471                    {
     
    473473                        g_cErrors++;
    474474                    }
    475                     rc = INTNETR0IfWait(pIntNet, hIf1, 0);
     475                    rc = INTNETR0IfWait(pIntNet, hIf1, g_pSession, 0);
    476476                    if (rc != VERR_TIMEOUT)
    477477                    {
     
    483483                     * Send and receive.
    484484                     */
    485                     rc = INTNETR0IfSend(pIntNet, hIf0, &g_TestFrame0, sizeof(g_TestFrame0));
     485                    rc = INTNETR0IfSend(pIntNet, hIf0, g_pSession, &g_TestFrame0, sizeof(g_TestFrame0));
    486486                    if (VBOX_SUCCESS(rc))
    487487                    {
    488                         rc = INTNETR0IfWait(pIntNet, hIf0, 1);
     488                        rc = INTNETR0IfWait(pIntNet, hIf0, g_pSession, 1);
    489489                        if (rc != VERR_TIMEOUT)
    490490                        {
     
    492492                            g_cErrors++;
    493493                        }
    494                         rc = INTNETR0IfWait(pIntNet, hIf1, 0);
     494                        rc = INTNETR0IfWait(pIntNet, hIf1, g_pSession, 0);
    495495                        if (rc == VINF_SUCCESS)
    496496                        {
     
    521521                             * Send a packet from If1 just to set its MAC address.
    522522                             */
    523                             rc = INTNETR0IfSend(pIntNet, hIf1, &g_TestFrame1, sizeof(g_TestFrame1));
     523                            rc = INTNETR0IfSend(pIntNet, hIf1, g_pSession, &g_TestFrame1, sizeof(g_TestFrame1));
    524524                            if (VBOX_FAILURE(rc))
    525525                            {
     
    627627                                        }
    628628
    629                                         rc = INTNETR0IfClose(pIntNet, hIf0);
     629                                        rc = INTNETR0IfClose(pIntNet, hIf0, g_pSession);
    630630                                        if (VBOX_SUCCESS(rc))
    631631                                        {
     
    639639                                        }
    640640
    641                                         rc = INTNETR0IfClose(pIntNet, hIf1);
     641                                        rc = INTNETR0IfClose(pIntNet, hIf1, g_pSession);
    642642                                        if (VBOX_SUCCESS(rc))
    643643                                        {
     
    700700
    701701                if (hIf1 != INTNET_HANDLE_INVALID)
    702                     rc = INTNETR0IfClose(pIntNet, hIf1);
     702                    rc = INTNETR0IfClose(pIntNet, hIf1, g_pSession);
    703703            }
    704704            else
     
    709709
    710710            if (hIf0 != INTNET_HANDLE_INVALID)
    711                 rc = INTNETR0IfClose(pIntNet, hIf0);
     711                rc = INTNETR0IfClose(pIntNet, hIf0, g_pSession);
    712712        }
    713713        else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette