Changeset 10806 in vbox for trunk/src/VBox/Devices/Network/testcase
- Timestamp:
- Jul 22, 2008 11:07:38 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 33584
- 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 583 583 { "--duration", 'd', RTGETOPT_REQ_UINT32 }, 584 584 { "--file", 'f', RTGETOPT_REQ_STRING }, 585 { "--interface", 'i', RTGETOPT_REQ_STRING }, 585 586 { "--network", 'n', RTGETOPT_REQ_STRING }, 586 587 { "--promiscuous", 'p', RTGETOPT_REQ_NOTHING }, … … 590 591 { "--text-file", 't', RTGETOPT_REQ_STRING }, 591 592 { "--xmit-test", 'x', RTGETOPT_REQ_NOTHING }, 593 { "--help", 'h', RTGETOPT_REQ_NOTHING }, 594 { "--?", '?', RTGETOPT_REQ_NOTHING }, 592 595 }; 593 596 … … 697 700 case '?': 698 701 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"); 700 703 return 1; 701 704 … … 703 706 if (RT_SUCCESS(ch)) 704 707 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); 705 710 else 706 RTPrintf("tstIntNetR0: invalid argument: %Rrc - \n", ch, Value.pDef->pszLong);711 RTPrintf("tstIntNetR0: invalid argument: %Rrc - %s\n", ch, argv[iArg]); 707 712 return 1; 708 713 } -
trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp
r10740 r10806 102 102 struct TESTFRAME 103 103 { 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 } }; 107 107 108 108 … … 240 240 *puFrame = iFrame; 241 241 #if 0 242 int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, abBuf, cb);242 int rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession, abBuf, cb); 243 243 #else 244 244 INTNETSG Sg; … … 246 246 int rc = intnetR0RingWriteFrame(pArgs->pBuf, &pArgs->pBuf->Send, &Sg); 247 247 if (RT_SUCCESS(rc)) 248 rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, NULL, 0);248 rc = INTNETR0IfSend(pArgs->pIntNet, pArgs->hIf, g_pSession, NULL, 0); 249 249 #endif 250 250 if (VBOX_FAILURE(rc)) … … 265 265 for (unsigned c = 0; c < 20; c++) 266 266 { 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); 268 268 if (VBOX_FAILURE(rc)) 269 269 { … … 297 297 * Wait for data. 298 298 */ 299 int rc = INTNETR0IfWait(pArgs->pIntNet, pArgs->hIf, RT_INDEFINITE_WAIT);299 int rc = INTNETR0IfWait(pArgs->pIntNet, pArgs->hIf, g_pSession, RT_INDEFINITE_WAIT); 300 300 switch (rc) 301 301 { … … 467 467 * Test basic waiting. 468 468 */ 469 rc = INTNETR0IfWait(pIntNet, hIf0, 1);469 rc = INTNETR0IfWait(pIntNet, hIf0, g_pSession, 1); 470 470 if (rc != VERR_TIMEOUT) 471 471 { … … 473 473 g_cErrors++; 474 474 } 475 rc = INTNETR0IfWait(pIntNet, hIf1, 0);475 rc = INTNETR0IfWait(pIntNet, hIf1, g_pSession, 0); 476 476 if (rc != VERR_TIMEOUT) 477 477 { … … 483 483 * Send and receive. 484 484 */ 485 rc = INTNETR0IfSend(pIntNet, hIf0, &g_TestFrame0, sizeof(g_TestFrame0));485 rc = INTNETR0IfSend(pIntNet, hIf0, g_pSession, &g_TestFrame0, sizeof(g_TestFrame0)); 486 486 if (VBOX_SUCCESS(rc)) 487 487 { 488 rc = INTNETR0IfWait(pIntNet, hIf0, 1);488 rc = INTNETR0IfWait(pIntNet, hIf0, g_pSession, 1); 489 489 if (rc != VERR_TIMEOUT) 490 490 { … … 492 492 g_cErrors++; 493 493 } 494 rc = INTNETR0IfWait(pIntNet, hIf1, 0);494 rc = INTNETR0IfWait(pIntNet, hIf1, g_pSession, 0); 495 495 if (rc == VINF_SUCCESS) 496 496 { … … 521 521 * Send a packet from If1 just to set its MAC address. 522 522 */ 523 rc = INTNETR0IfSend(pIntNet, hIf1, &g_TestFrame1, sizeof(g_TestFrame1));523 rc = INTNETR0IfSend(pIntNet, hIf1, g_pSession, &g_TestFrame1, sizeof(g_TestFrame1)); 524 524 if (VBOX_FAILURE(rc)) 525 525 { … … 627 627 } 628 628 629 rc = INTNETR0IfClose(pIntNet, hIf0 );629 rc = INTNETR0IfClose(pIntNet, hIf0, g_pSession); 630 630 if (VBOX_SUCCESS(rc)) 631 631 { … … 639 639 } 640 640 641 rc = INTNETR0IfClose(pIntNet, hIf1 );641 rc = INTNETR0IfClose(pIntNet, hIf1, g_pSession); 642 642 if (VBOX_SUCCESS(rc)) 643 643 { … … 700 700 701 701 if (hIf1 != INTNET_HANDLE_INVALID) 702 rc = INTNETR0IfClose(pIntNet, hIf1 );702 rc = INTNETR0IfClose(pIntNet, hIf1, g_pSession); 703 703 } 704 704 else … … 709 709 710 710 if (hIf0 != INTNET_HANDLE_INVALID) 711 rc = INTNETR0IfClose(pIntNet, hIf0 );711 rc = INTNETR0IfClose(pIntNet, hIf0, g_pSession); 712 712 } 713 713 else
Note:
See TracChangeset
for help on using the changeset viewer.