VirtualBox

source: vbox/trunk/src/VBox/Devices/USB/VUSBSniffer.h@ 59615

Last change on this file since 59615 was 59615, checked in by vboxsync, 9 years ago

USB/VUSBSniffer: Separate API from format to make it possible to introduce other formats to capture the traffic in (will come next)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1/* $Id: VUSBSniffer.h 59615 2016-02-09 13:08:14Z vboxsync $ */
2/** @file
3 * Virtual USB - Sniffer facility.
4 */
5
6/*
7 * Copyright (C) 2014-2016 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___VUSBSniffer_h
19#define ___VUSBSniffer_h
20
21#include <VBox/cdefs.h>
22#include <VBox/types.h>
23#include <VBox/vusb.h>
24
25RT_C_DECLS_BEGIN
26
27/** Opaque VUSB sniffer handle. */
28typedef struct VUSBSNIFFERINT *VUSBSNIFFER;
29/** Pointer to a VUSB sniffer handle. */
30typedef VUSBSNIFFER *PVUSBSNIFFER;
31
32/** NIL sniffer instance handle. */
33#define VUSBSNIFFER_NIL ((VUSBSNIFFER)0)
34
35/**
36 * VUSB Sniffer event types.
37 */
38typedef enum VUSBSNIFFEREVENT
39{
40 /** Invalid event. */
41 VUSBSNIFFEREVENT_INVALID = 0,
42 /** URB submit event. */
43 VUSBSNIFFEREVENT_SUBMIT,
44 /** URB complete event. */
45 VUSBSNIFFEREVENT_COMPLETE,
46 /** URB submit failed event. */
47 VUSBSNIFFEREVENT_ERROR_SUBMIT,
48 /** URB completed with error event. */
49 VUSBSNIFFEREVENT_ERROR_COMPLETE,
50 /** 32bit hack. */
51 VUSBSNIFFEREVENT_32BIT_HACK = 0x7fffffff
52} VUSBSNIFFEREVENT;
53
54/**
55 * Create a new VUSB sniffer instance dumping to the given capture file.
56 *
57 * @returns VBox status code.
58 * @param phSniffer Where to store the handle to the sniffer instance on success.
59 * @param fFlags Flags, reserved, must be 0.
60 * @param pszCaptureFilename The filename to use for capturing the sniffed data.
61 * @param pszFmt The format of the dump, NULL to select one based on the filename
62 * extension.
63 * @param pszDesc Optional description for the dump.
64 */
65DECLHIDDEN(int) VUSBSnifferCreate(PVUSBSNIFFER phSniffer, uint32_t fFlags,
66 const char *pszCaptureFilename, const char *pszFmt,
67 const char *pszDesc);
68
69/**
70 * Destroys the given VUSB sniffer instance.
71 *
72 * @returns nothing.
73 * @param hSniffer The sniffer instance to destroy.
74 */
75DECLHIDDEN(void) VUSBSnifferDestroy(VUSBSNIFFER hSniffer);
76
77/**
78 * Records an VUSB event.
79 *
80 * @returns VBox status code.
81 * @param hSniffer The sniffer instance.
82 * @param pUrb The URB triggering the event.
83 * @param enmEvent The type of event to record.
84 */
85DECLHIDDEN(int) VUSBSnifferRecordEvent(VUSBSNIFFER hSniffer, PVUSBURB pUrb, VUSBSNIFFEREVENT enmEvent);
86
87
88RT_C_DECLS_END
89#endif
90
Note: See TracBrowser for help on using the repository browser.

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