VirtualBox

忽略:
時間撮記:
2014-10-15 下午12:34:18 (10 年 以前)
作者:
vboxsync
訊息:

USB: Integrate USB sniffer. Make it possible to specify a file to dump the traffic to when attaching a USB device with VBoxManage

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r53031 r53062  
    28272827}
    28282828
    2829 HRESULT Console::attachUSBDevice(const com::Guid &aId)
     2829HRESULT Console::attachUSBDevice(const com::Guid &aId, const com::Utf8Str &aCaptureFilename)
    28302830{
    28312831#ifdef VBOX_WITH_USB
     
    28532853
    28542854    /* Request the device capture */
    2855     return mControl->CaptureUSBDevice(Bstr(aId.toString()).raw());
     2855    return mControl->CaptureUSBDevice(Bstr(aId.toString()).raw(), Bstr(aCaptureFilename).raw());
    28562856
    28572857#else   /* !VBOX_WITH_USB */
     
    52715271 * @note Locks this object for writing.
    52725272 */
    5273 HRESULT Console::i_onUSBDeviceAttach(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs)
     5273HRESULT Console::i_onUSBDeviceAttach(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs,
     5274                                     const Utf8Str &aCaptureFilename)
    52745275{
    52755276#ifdef VBOX_WITH_USB
     
    53095310
    53105311    alock.release();
    5311     HRESULT rc = i_attachUSBDevice(aDevice, aMaskedIfs);
     5312    HRESULT rc = i_attachUSBDevice(aDevice, aMaskedIfs, aCaptureFilename);
    53125313    if (FAILED(rc))
    53135314    {
     
    83168317 * @note Synchronously calls EMT.
    83178318 */
    8318 HRESULT Console::i_attachUSBDevice(IUSBDevice *aHostDevice, ULONG aMaskedIfs)
     8319HRESULT Console::i_attachUSBDevice(IUSBDevice *aHostDevice, ULONG aMaskedIfs,
     8320                                   const Utf8Str &aCaptureFilename)
    83198321{
    83208322    AssertReturn(aHostDevice, E_FAIL);
     
    83658367
    83668368    int vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), 0 /* idDstCpu (saved state, see #6232) */,
    8367                                (PFNRT)i_usbAttachCallback, 9,
     8369                               (PFNRT)i_usbAttachCallback, 10,
    83688370                               this, ptrVM.rawUVM(), aHostDevice, uuid.raw(), fRemote,
    8369                                Address.c_str(), pvRemoteBackend, portVersion, aMaskedIfs);
     8371                               Address.c_str(), pvRemoteBackend, portVersion, aMaskedIfs,
     8372                               aCaptureFilename.isEmpty() ? NULL : aCaptureFilename.c_str());
    83708373    if (RT_SUCCESS(vrc))
    83718374    {
     
    84188421DECLCALLBACK(int)
    84198422Console::i_usbAttachCallback(Console *that, PUVM pUVM, IUSBDevice *aHostDevice, PCRTUUID aUuid, bool aRemote,
    8420                              const char *aAddress, void *pvRemoteBackend, USHORT aPortVersion, ULONG aMaskedIfs)
     8423                             const char *aAddress, void *pvRemoteBackend, USHORT aPortVersion, ULONG aMaskedIfs,
     8424                             const char *pszCaptureFilename)
    84218425{
    84228426    LogFlowFuncEnter();
     
    84298433                                        aPortVersion == 3 ? VUSB_STDVER_30 :
    84308434                                        aPortVersion == 2 ? VUSB_STDVER_11 : VUSB_STDVER_20,
    8431                                         aMaskedIfs);
     8435                                        aMaskedIfs, pszCaptureFilename);
    84328436    LogFlowFunc(("vrc=%Rrc\n", vrc));
    84338437    LogFlowFuncLeave();
     
    90539057            {
    90549058                alock.release();
    9055                 hrc = i_onUSBDeviceAttach(pUSBDevice, NULL, fMaskedIfs);
     9059                hrc = i_onUSBDeviceAttach(pUSBDevice, NULL, fMaskedIfs, Utf8Str());
    90569060                alock.acquire();
    90579061
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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