Changeset 89962 in vbox for trunk/src/VBox/ValidationKit/utils
- Timestamp:
- Jun 30, 2021 7:02:07 AM (4 years ago)
- Location:
- trunk/src/VBox/ValidationKit/utils/audio
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
r89891 r89962 635 635 RT_ZERO(TstEnv); 636 636 637 int rc = AudioTestSvcCreate(&TstEnv.u.Guest.Srv); 638 637 639 const char *pszDevice = NULL; /* Custom device to use. Can be NULL if not being used. */ 638 640 const char *pszTag = NULL; /* Custom tag to use. Can be NULL if not being used. */ … … 645 647 646 648 const char *pszGuestTcpAddr = NULL; 647 uint16_t uGuestTcpPort = ATS_TCP_ GUEST_DEFAULT_PORT;649 uint16_t uGuestTcpPort = ATS_TCP_DEF_BIND_PORT_GUEST; 648 650 const char *pszValKitTcpAddr = NULL; 649 uint16_t uValKitTcpPort = ATS_TCP_ HOST_DEFAULT_PORT;650 651 int rc;651 uint16_t uValKitTcpPort = ATS_TCP_DEF_BIND_PORT_VALKIT; 652 653 int ch; 652 654 RTGETOPTUNION ValueUnion; 653 while (( rc= RTGetOpt(pGetState, &ValueUnion)))654 { 655 switch ( rc)655 while ((ch = RTGetOpt(pGetState, &ValueUnion))) 656 { 657 switch (ch) 656 658 { 657 659 case 'a': … … 757 759 758 760 default: 759 return RTGetOptPrintError(rc, &ValueUnion); 761 rc = AudioTestSvcHandleOption(&TstEnv.u.Guest.Srv, ch, &ValueUnion); 762 if (RT_FAILURE(rc)) 763 return RTGetOptPrintError(rc, &ValueUnion); 760 764 } 761 765 } … … 774 778 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "No test mode (--mode) specified!\n"); 775 779 776 if (TstEnv.enmMode == AUDIOTESTMODE_HOST)777 {778 if (!pszGuestTcpAddr)779 return RTMsgErrorExit(RTEXITCODE_SYNTAX, "No guest ATS address (--guest-ats-addr) specified!\n");780 }781 782 780 /* For now all tests have the same test environment. */ 783 rc = audioTestEnvInit(&TstEnv, pDrvReg, fWithDrvAudio, 784 pszValKitTcpAddr, uValKitTcpPort, 785 pszGuestTcpAddr, uGuestTcpPort); 781 rc = audioTestEnvInit(&TstEnv, pDrvReg, fWithDrvAudio); 786 782 if (RT_SUCCESS(rc)) 787 783 rc = audioTestWorker(&TstEnv); … … 806 802 g_aCmdTestOptions, 807 803 RT_ELEMENTS(g_aCmdTestOptions), 808 audioTestCmdTestHelp 804 audioTestCmdTestHelp, 805 true /* fNeedsTransport */ 809 806 }; 810 807 … … 985 982 RT_ELEMENTS(g_aCmdVerifyOptions), 986 983 NULL, 984 false /* fNeedsTransport */ 987 985 }; 988 986 … … 1067 1065 RTStrmPrintf(pStrm, " %s\n", pszHelp); 1068 1066 } 1067 1068 if (pCmd->fNeedsTransport) 1069 { 1070 for (uintptr_t iTx = 0; iTx < g_cTransports; iTx++) 1071 g_apTransports[iTx]->pfnUsage(pStrm); 1072 } 1069 1073 } 1070 1074 … … 1155 1159 if (strcmp(ValueUnion.psz, pCmd->pszCommand) == 0) 1156 1160 { 1157 size_t const cCombinedOptions = pCmd->cOptions + RT_ELEMENTS(g_aCmdCommonOptions); 1161 size_t cCombinedOptions = pCmd->cOptions + RT_ELEMENTS(g_aCmdCommonOptions); 1162 if (pCmd->fNeedsTransport) 1163 { 1164 for (uintptr_t iTx = 0; iTx < g_cTransports; iTx++) 1165 cCombinedOptions += g_apTransports[iTx]->cOpts; 1166 } 1158 1167 PRTGETOPTDEF paCombinedOptions = (PRTGETOPTDEF)RTMemAlloc(cCombinedOptions * sizeof(RTGETOPTDEF)); 1159 1168 if (paCombinedOptions) 1160 1169 { 1170 unsigned idxOpts = 0; 1161 1171 memcpy(paCombinedOptions, g_aCmdCommonOptions, sizeof(g_aCmdCommonOptions)); 1162 memcpy(&paCombinedOptions[RT_ELEMENTS(g_aCmdCommonOptions)], 1163 pCmd->paOptions, pCmd->cOptions * sizeof(RTGETOPTDEF)); 1172 idxOpts += RT_ELEMENTS(g_aCmdCommonOptions); 1173 memcpy(&paCombinedOptions[idxOpts], pCmd->paOptions, pCmd->cOptions * sizeof(RTGETOPTDEF)); 1174 idxOpts += pCmd->cOptions; 1175 if (pCmd->fNeedsTransport) 1176 { 1177 for (uintptr_t iTx = 0; iTx < g_cTransports; iTx++) 1178 { 1179 memcpy(&paCombinedOptions[idxOpts], 1180 g_apTransports[iTx]->paOpts, g_apTransports[iTx]->cOpts * sizeof(RTGETOPTDEF)); 1181 idxOpts += g_apTransports[iTx]->cOpts; 1182 } 1183 } 1164 1184 1165 1185 rc = RTGetOptInit(&GetState, argc, argv, paCombinedOptions, cCombinedOptions, -
trunk/src/VBox/ValidationKit/utils/audio/vkatCmdGeneric.cpp
r89643 r89962 157 157 RT_ELEMENTS(g_aCmdEnumOptions), 158 158 audioTestCmdEnumHelp, 159 false /* fNeedsTransport */ 159 160 }; 160 161 … … 486 487 RT_ELEMENTS(g_aCmdPlayOptions), 487 488 audioTestCmdPlayHelp, 489 false /* fNeedsTransport */ 488 490 }; 489 491 … … 866 868 RT_ELEMENTS(g_aCmdRecOptions), 867 869 audioTestCmdRecHelp, 870 false /* fNeedsTransport */ 868 871 }; 869 872 -
trunk/src/VBox/ValidationKit/utils/audio/vkatCmdSelfTest.cpp
r89890 r89962 77 77 2 /* 16-bit */, true /* fSigned */, 2 /* cChannels */, 44100 /* uHz */); 78 78 79 rc = audioTestEnvInit(pTstEnvGst, pTstEnvGst->DrvStack.pDrvReg, pCtx->fWithDrvAudio, 80 pCtx->Host.szValKitAtsAddr, pCtx->Host.uValKitAtsPort, 81 pCtx->Guest.szAtsAddr, pCtx->Guest.uAtsPort); 79 rc = audioTestEnvInit(pTstEnvGst, pTstEnvGst->DrvStack.pDrvReg, pCtx->fWithDrvAudio); 82 80 if (RT_SUCCESS(rc)) 83 81 { … … 159 157 pTstEnvHst->enmMode = AUDIOTESTMODE_HOST; 160 158 161 rc = audioTestEnvInit(pTstEnvHst, &g_DrvHostValidationKitAudio, true /* fWithDrvAudio */, 162 pCtx->Host.szValKitAtsAddr, pCtx->Host.uValKitAtsPort, 163 pCtx->Host.szGuestAtsAddr, pCtx->Host.uGuestAtsPort); 159 rc = audioTestEnvInit(pTstEnvHst, &g_DrvHostValidationKitAudio, true /* fWithDrvAudio */); 164 160 if (RT_SUCCESS(rc)) 165 161 { … … 346 342 RT_ELEMENTS(s_aCmdSelftestOptions), 347 343 audioTestCmdSelftestHelp, 344 true /* fNeedsTransport */ 348 345 }; 349 346 -
trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp
r89892 r89962 574 574 *********************************************************************************************************************************/ 575 575 576 int audioTestEnvConnectToHostAts(PAUDIOTESTENV pTstEnv, 577 const char *pszHostTcpAddr, uint32_t uHostTcpPort) 578 { 579 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connecting to host ATS at %s:%RU32 ...\n", 580 (pszHostTcpAddr && *pszHostTcpAddr) ? pszHostTcpAddr : ATS_TCP_HOST_DEFAULT_ADDR_STR, 581 uHostTcpPort ? uHostTcpPort : ATS_TCP_HOST_DEFAULT_PORT); 582 583 int rc = AudioTestSvcClientConnect(&pTstEnv->u.Host.AtsClValKit, pszHostTcpAddr, uHostTcpPort); 576 /** 577 * Connects an ATS client via TCP/IP to a peer. 578 * 579 * @returns VBox status code. 580 * @param pTstEnv Test environment to use. 581 * @param pClient Client to connect. 582 * @param pszWhat Hint of what to connect to where. 583 * @param pszTcpBindAddr TCP/IP bind address. Optionl and can be NULL. 584 * Server mode will be disabled then. 585 * @param uTcpBindPort TCP/IP bind port. Optionl and can be 0. 586 * Server mode will be disabled then. * 587 * @param pszTcpConnectAddr TCP/IP connect address. Optionl and can be NULL. 588 * Client mode will be disabled then. 589 * @param uTcpConnectPort TCP/IP connect port. Optionl and can be 0. 590 * Client mode will be disabled then. 591 */ 592 int audioTestEnvConnectViaTcp(PAUDIOTESTENV pTstEnv, PATSCLIENT pClient, const char *pszWhat, 593 const char *pszTcpBindAddr, uint16_t uTcpBindPort, 594 const char *pszTcpConnectAddr, uint16_t uTcpConnectPort) 595 { 596 RT_NOREF(pTstEnv); 597 598 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connecting %s ...\n", pszWhat); 599 600 RTGETOPTUNION Val; 601 RT_ZERO(Val); 602 603 int rc; 604 605 if ( !pszTcpBindAddr 606 || !uTcpBindPort) 607 { 608 Val.psz = "client"; 609 } 610 else if ( !pszTcpConnectAddr 611 || !uTcpConnectPort) 612 { 613 Val.psz = "server"; 614 } 615 else 616 Val.psz = "both"; 617 618 rc = AudioTestSvcClientHandleOption(pClient, ATSTCPOPT_MODE, &Val); 619 AssertRCReturn(rc, rc); 620 621 if ( !RTStrCmp(Val.psz, "client") 622 || !RTStrCmp(Val.psz, "both")) 623 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connecting at %s:%RU32\n", pszTcpConnectAddr, uTcpConnectPort); 624 625 if ( !RTStrCmp(Val.psz, "server") 626 || !RTStrCmp(Val.psz, "both")) 627 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Listening at %s:%RU32\n", pszTcpBindAddr ? pszTcpBindAddr : "<None>", uTcpBindPort); 628 629 if (pszTcpBindAddr) 630 { 631 Val.psz = pszTcpBindAddr; 632 rc = AudioTestSvcClientHandleOption(pClient, ATSTCPOPT_BIND_ADDRESS, &Val); 633 AssertRCReturn(rc, rc); 634 } 635 636 if (uTcpBindPort) 637 { 638 Val.u16 = uTcpBindPort; 639 rc = AudioTestSvcClientHandleOption(pClient, ATSTCPOPT_BIND_PORT, &Val); 640 AssertRCReturn(rc, rc); 641 } 642 643 if (pszTcpConnectAddr) 644 { 645 Val.psz = pszTcpConnectAddr; 646 rc = AudioTestSvcClientHandleOption(pClient, ATSTCPOPT_CONNECT_ADDRESS, &Val); 647 AssertRCReturn(rc, rc); 648 } 649 650 if (uTcpConnectPort) 651 { 652 Val.u16 = uTcpConnectPort; 653 rc = AudioTestSvcClientHandleOption(pClient, ATSTCPOPT_CONNECT_PORT, &Val); 654 AssertRCReturn(rc, rc); 655 } 656 657 rc = AudioTestSvcClientConnect(pClient); 584 658 if (RT_FAILURE(rc)) 585 659 { 586 RTTestFailed(g_hTest, "Connecting to host ATS failed with %Rrc\n", rc);660 RTTestFailed(g_hTest, "Connecting %s failed with %Rrc\n", pszWhat, rc); 587 661 return rc; 588 662 } 589 663 590 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connected to host ATS\n"); 591 return rc; 592 } 593 594 int audioTestEnvConnectToGuestAts(PAUDIOTESTENV pTstEnv, 595 const char *pszGuestTcpAddr, uint32_t uGuestTcpPort) 596 { 597 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Connecting to guest ATS at %s:%RU32 ...\n", 598 (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "127.0.0.1", 599 uGuestTcpPort ? uGuestTcpPort : ATS_TCP_GUEST_DEFAULT_PORT); 600 601 int rc = AudioTestSvcClientConnect(&pTstEnv->u.Host.AtsClGuest, pszGuestTcpAddr, uGuestTcpPort); 664 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connected %s\n", pszWhat); 665 return rc; 666 } 667 668 /** 669 * Configures and starts an ATS TCP/IP server. 670 * 671 * @returns VBox status code. 672 * @param pSrv ATS server instance to configure and start. 673 * @param pCallbacks ATS callback table to use. 674 * @param pszDesc Hint of server type which is being started. 675 * @param pszTcpBindAddr TCP/IP bind address. Optionl and can be NULL. 676 * Server mode will be disabled then. 677 * @param uTcpBindPort TCP/IP bind port. Optionl and can be 0. 678 * Server mode will be disabled then. * 679 * @param pszTcpConnectAddr TCP/IP connect address. Optionl and can be NULL. 680 * Client mode will be disabled then. 681 * @param uTcpConnectPort TCP/IP connect port. Optionl and can be 0. 682 * Client mode will be disabled then. 683 */ 684 int audioTestEnvConfigureAndStartTcpServer(PATSSERVER pSrv, PCATSCALLBACKS pCallbacks, const char *pszDesc, 685 const char *pszTcpBindAddr, uint16_t uTcpBindPort, 686 const char *pszTcpConnectAddr, uint16_t uTcpConnectPort) 687 { 688 RTGETOPTUNION Val; 689 RT_ZERO(Val); 690 691 if (pszTcpBindAddr) 692 { 693 Val.psz = pszTcpBindAddr; 694 AudioTestSvcHandleOption(pSrv, ATSTCPOPT_BIND_ADDRESS, &Val); 695 } 696 697 if (uTcpBindPort) 698 { 699 Val.u16 = uTcpBindPort; 700 AudioTestSvcHandleOption(pSrv, ATSTCPOPT_BIND_PORT, &Val); 701 } 702 703 if (pszTcpConnectAddr) 704 { 705 Val.psz = pszTcpConnectAddr; 706 AudioTestSvcHandleOption(pSrv, ATSTCPOPT_CONNECT_ADDRESS, &Val); 707 } 708 709 if (uTcpConnectPort) 710 { 711 Val.u16 = uTcpConnectPort; 712 AudioTestSvcHandleOption(pSrv, ATSTCPOPT_CONNECT_PORT, &Val); 713 } 714 715 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Starting server for %s at %s:%RU32 ...\n", 716 pszDesc, pszTcpBindAddr[0] ? pszTcpBindAddr : "0.0.0.0", uTcpBindPort); 717 if (pszTcpConnectAddr[0]) 718 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Trying %s to connect as client to %s:%RU32 ...\n", 719 pszDesc, pszTcpConnectAddr[0] ? pszTcpConnectAddr : "0.0.0.0", uTcpConnectPort); 720 721 int rc = AudioTestSvcInit(pSrv, pCallbacks); 722 if (RT_SUCCESS(rc)) 723 rc = AudioTestSvcStart(pSrv); 724 602 725 if (RT_FAILURE(rc)) 603 { 604 RTTestFailed(g_hTest, "Connecting to guest ATS failed with %Rrc\n", rc); 605 return rc; 606 } 607 608 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Connected to guest ATS\n"); 726 RTTestFailed(g_hTest, "Starting server for %s failed with %Rrc\n", pszDesc, rc); 727 609 728 return rc; 610 729 } … … 616 735 * @param pDrvReg Audio driver to use. 617 736 * @param fWithDrvAudio Whether to include DrvAudio in the stack or not. 618 * @param pszHostTcpAddr Host ATS TCP/IP address to connect to.619 * If NULL, ATS_TCP_HOST_DEFAULT_ADDR_STR will be used.620 * @param uHostTcpPort Host ATS TCP/IP port to connect to.621 * If 0, ATS_TCP_HOST_DEFAULT_PORT will be used.622 * @param pszGuestTcpAddr Guest ATS TCP/IP address to connect to.623 * If NULL, any address (0.0.0.0) will be used.624 * @param uGuestTcpPort Guest ATS TCP/IP port to connect to.625 * If 0, ATS_TCP_GUEST_DEFAULT_PORT will be used.626 737 */ 627 738 int audioTestEnvInit(PAUDIOTESTENV pTstEnv, 628 PCPDMDRVREG pDrvReg, bool fWithDrvAudio, 629 const char *pszHostTcpAddr, uint32_t uHostTcpPort, 630 const char *pszGuestTcpAddr, uint32_t uGuestTcpPort) 739 PCPDMDRVREG pDrvReg, bool fWithDrvAudio) 631 740 { 632 741 int rc = VINF_SUCCESS; … … 656 765 if (!pDrvReg) 657 766 pDrvReg = AudioTestGetDefaultBackend(); 658 659 if (!uHostTcpPort)660 uHostTcpPort = ATS_TCP_HOST_DEFAULT_PORT;661 662 if (!uGuestTcpPort)663 uGuestTcpPort = ATS_TCP_GUEST_DEFAULT_PORT;664 767 665 768 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Initializing environment for mode '%s'\n", pTstEnv->enmMode == AUDIOTESTMODE_HOST ? "host" : "guest"); … … 732 835 return rc; 733 836 734 /** @todo Implement NAT mode like we do for TxS later? */735 837 if (pTstEnv->enmMode == AUDIOTESTMODE_GUEST) 736 838 { … … 749 851 Callbacks.pvUser = &Ctx; 750 852 853 if (!pTstEnv->u.Guest.TcpOpts.uTcpBindPort) 854 pTstEnv->u.Guest.TcpOpts.uTcpBindPort = ATS_TCP_DEF_BIND_PORT_GUEST; 855 856 if (!pTstEnv->u.Guest.TcpOpts.szTcpBindAddr[0]) 857 RTStrCopy(pTstEnv->u.Guest.TcpOpts.szTcpBindAddr, sizeof(pTstEnv->u.Guest.TcpOpts.szTcpBindAddr), "0.0.0.0"); 858 859 if (!pTstEnv->u.Guest.TcpOpts.uTcpConnectPort) 860 pTstEnv->u.Guest.TcpOpts.uTcpConnectPort = ATS_TCP_DEF_CONNECT_PORT_GUEST; 861 862 if (!pTstEnv->u.Guest.TcpOpts.szTcpConnectAddr[0]) 863 RTStrCopy(pTstEnv->u.Guest.TcpOpts.szTcpConnectAddr, sizeof(pTstEnv->u.Guest.TcpOpts.szTcpConnectAddr), "10.0.2.2"); 864 751 865 /* 752 866 * Start the ATS (Audio Test Service) on the guest side. … … 756 870 * Note that we have to bind to "0.0.0.0" by default so that the host can connect to it. 757 871 */ 758 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Starting guest ATS at %s:%RU32...\n", 759 (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "0.0.0.0", uGuestTcpPort); 760 rc = AudioTestSvcInit(&pTstEnv->u.Guest.Srv, 761 (pszGuestTcpAddr && *pszGuestTcpAddr) ? pszGuestTcpAddr : "0.0.0.0", uGuestTcpPort, &Callbacks); 872 rc = audioTestEnvConfigureAndStartTcpServer(&pTstEnv->u.Guest.Srv, &Callbacks, "Guest ATS", 873 pTstEnv->u.Guest.TcpOpts.szTcpBindAddr, pTstEnv->u.Guest.TcpOpts.uTcpBindPort, 874 pTstEnv->u.Guest.TcpOpts.szTcpConnectAddr, pTstEnv->u.Guest.TcpOpts.uTcpConnectPort); 875 876 } 877 else /* Host mode */ 878 { 879 880 ATSCALLBACKCTX Ctx; 881 Ctx.pTstEnv = pTstEnv; 882 883 ATSCALLBACKS Callbacks; 884 RT_ZERO(Callbacks); 885 Callbacks.pvUser = &Ctx; 886 887 if (!pTstEnv->u.Host.TcpOpts.uTcpBindPort) 888 pTstEnv->u.Host.TcpOpts.uTcpBindPort = ATS_TCP_DEF_BIND_PORT_HOST; 889 890 if (!pTstEnv->u.Host.TcpOpts.szTcpBindAddr[0]) 891 RTStrCopy(pTstEnv->u.Host.TcpOpts.szTcpBindAddr, sizeof(pTstEnv->u.Host.TcpOpts.szTcpBindAddr), "0.0.0.0"); 892 893 if (!pTstEnv->u.Host.TcpOpts.uTcpConnectPort) 894 pTstEnv->u.Host.TcpOpts.uTcpConnectPort = ATS_TCP_DEF_CONNECT_PORT_HOST_PORT_FWD; 895 896 if (!pTstEnv->u.Host.TcpOpts.szTcpConnectAddr[0]) 897 RTStrCopy(pTstEnv->u.Host.TcpOpts.szTcpConnectAddr, sizeof(pTstEnv->u.Host.TcpOpts.szTcpConnectAddr), 898 ATS_TCP_DEF_CONNECT_HOST_ADDR_STR); /** @todo Get VM IP? Needs port forwarding. */ 899 900 /* We need to start a server on the host so that VMs configured with NAT networking 901 * can connect to it as well. */ 902 rc = AudioTestSvcClientCreate(&pTstEnv->u.Host.AtsClGuest); 762 903 if (RT_SUCCESS(rc)) 763 rc = AudioTestSvcStart(&pTstEnv->u.Guest.Srv); 764 765 if (RT_FAILURE(rc)) 766 RTTestFailed(g_hTest, "Starting ATS failed with %Rrc\n", rc); 767 } 768 else /* Host mode */ 769 { 770 rc = audioTestEnvConnectToHostAts(pTstEnv, pszHostTcpAddr, uHostTcpPort); 904 rc = audioTestEnvConnectViaTcp(pTstEnv, &pTstEnv->u.Host.AtsClGuest, 905 "Host -> Guest ATS", 906 pTstEnv->u.Host.TcpOpts.szTcpBindAddr, pTstEnv->u.Host.TcpOpts.uTcpBindPort, 907 pTstEnv->u.Host.TcpOpts.szTcpConnectAddr, pTstEnv->u.Host.TcpOpts.uTcpConnectPort); 771 908 if (RT_SUCCESS(rc)) 772 rc = audioTestEnvConnectToGuestAts(pTstEnv, pszGuestTcpAddr, uGuestTcpPort); 909 { 910 if (!pTstEnv->ValKitTcpOpts.uTcpConnectPort) 911 pTstEnv->ValKitTcpOpts.uTcpConnectPort = ATS_TCP_DEF_CONNECT_PORT_VALKIT; 912 913 if (!pTstEnv->ValKitTcpOpts.szTcpConnectAddr[0]) 914 RTStrCopy(pTstEnv->ValKitTcpOpts.szTcpConnectAddr, sizeof(pTstEnv->ValKitTcpOpts.szTcpConnectAddr), 915 ATS_TCP_DEF_CONNECT_HOST_ADDR_STR); 916 917 rc = AudioTestSvcClientCreate(&pTstEnv->u.Host.AtsClValKit); 918 if (RT_SUCCESS(rc)) 919 rc = audioTestEnvConnectViaTcp(pTstEnv, &pTstEnv->u.Host.AtsClValKit, 920 "Host -> Validation Kit Host Audio Driver ATS", 921 pTstEnv->ValKitTcpOpts.szTcpBindAddr, pTstEnv->ValKitTcpOpts.uTcpBindPort, 922 pTstEnv->ValKitTcpOpts.szTcpConnectAddr, pTstEnv->ValKitTcpOpts.uTcpConnectPort); 923 } 773 924 } 774 925 -
trunk/src/VBox/ValidationKit/utils/audio/vkatInternal.h
r89890 r89962 173 173 /** Maximum audio streams a test environment can handle. */ 174 174 #define AUDIOTESTENV_MAX_STREAMS 8 175 176 /** 177 * Structure for keeping TCP/IP-specific options. 178 */ 179 typedef struct AUDIOTESTENVTCPOPTS 180 { 181 /** Bind address (server mode). When empty, "0.0.0.0" (any host) will be used. */ 182 char szTcpBindAddr[128]; 183 /** Bind port (server mode). */ 184 uint16_t uTcpBindPort; 185 /** Connection address (client mode). */ 186 char szTcpConnectAddr[128]; 187 /** Connection port (client mode). */ 188 uint16_t uTcpConnectPort; 189 } AUDIOTESTENVTCPOPTS; 190 typedef AUDIOTESTENVTCPOPTS *PAUDIOTESTENVTCPOPTS; 175 191 176 192 /** … … 218 234 struct 219 235 { 236 AUDIOTESTENVTCPOPTS TcpOpts; 220 237 /** ATS instance to use. */ 221 ATSSERVER Srv;238 ATSSERVER Srv; 222 239 } Guest; 223 240 struct 224 241 { 242 AUDIOTESTENVTCPOPTS TcpOpts; 243 /** ATS instance to use. */ 244 ATSSERVER Srv; 225 245 /** Client connected to the ATS on the guest side. */ 226 246 ATSCLIENT AtsClGuest; … … 233 253 } Host; 234 254 } u; 255 AUDIOTESTENVTCPOPTS ValKitTcpOpts; 235 256 } AUDIOTESTENV; 236 257 … … 312 333 /** Gets help for an option. */ 313 334 DECLCALLBACKMEMBER(const char *, pfnOptionHelp,(PCRTGETOPTDEF pOpt)); 335 /** Flag indicating if the command needs the ATS transport layer. 336 * Needed for command line parsing. */ 337 bool fNeedsTransport; 314 338 } VKATCMD; 315 339 /** Pointer to a const VKAT command entry. */ … … 423 447 /** @name ATS routines 424 448 * @{ */ 425 int audioTestEnvConnectTo HostAts(PAUDIOTESTENV pTstEnv,449 int audioTestEnvConnectToValKitAts(PAUDIOTESTENV pTstEnv, 426 450 const char *pszHostTcpAddr, uint32_t uHostTcpPort); 427 451 /** @} */ … … 429 453 /** @name Test environment handling 430 454 * @{ */ 431 int audioTestEnvInit(PAUDIOTESTENV pTstEnv, PCPDMDRVREG pDrvReg, bool fWithDrvAudio , const char *pszHostTcpAddr, uint32_t uHostTcpPort, const char *pszGuestTcpAddr, uint32_t uGuestTcpPort);455 int audioTestEnvInit(PAUDIOTESTENV pTstEnv, PCPDMDRVREG pDrvReg, bool fWithDrvAudio); 432 456 void audioTestEnvDestroy(PAUDIOTESTENV pTstEnv); 433 457 int audioTestEnvPrologue(PAUDIOTESTENV pTstEnv, bool fPack, char *pszPackFile, size_t cbPackFile);
Note:
See TracChangeset
for help on using the changeset viewer.