VirtualBox

source: vbox/trunk/src/VBox/Devices/USB/VUSBSnifferInternal.h@ 97698

Last change on this file since 97698 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 KB
Line 
1/* $Id: VUSBSnifferInternal.h 96407 2022-08-22 17:43:14Z vboxsync $ */
2/** @file
3 * Virtual USB Sniffer facility - Internal header.
4 */
5
6/*
7 * Copyright (C) 2016-2022 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VBOX_INCLUDED_SRC_USB_VUSBSnifferInternal_h
29#define VBOX_INCLUDED_SRC_USB_VUSBSnifferInternal_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <VBox/cdefs.h>
35#include <VBox/types.h>
36
37#include "VUSBSniffer.h"
38
39RT_C_DECLS_BEGIN
40
41/** Pointer to a stream operations structure. */
42typedef struct VUSBSNIFFERSTRM *PVUSBSNIFFERSTRM;
43/** Pointer to the internal format specific state. */
44typedef struct VUSBSNIFFERFMTINT *PVUSBSNIFFERFMTINT;
45
46/**
47 * Stream operations structure.
48 */
49typedef struct VUSBSNIFFERSTRM
50{
51 /**
52 * Write the given buffer to the underlying stream.
53 *
54 * @returns VBox status code.
55 * @param pStrm The pointer to the interface containing this method.
56 * @param pvBuf The buffer to write.
57 * @param cbBuf How many bytes to write.
58 */
59 DECLR3CALLBACKMEMBER(int, pfnWrite, (PVUSBSNIFFERSTRM pStrm, const void *pvBuf, size_t cbBuf));
60
61} VUSBSNIFFERSTRM;
62
63
64/**
65 * VUSB Sniffer format backend.
66 */
67typedef struct VUSBSNIFFERFMT
68{
69 /** Name of the format. */
70 char szName[16];
71 /** Description of the format. */
72 const char *pszDesc;
73 /** Supported file extensions - terminated with a NULL entry. */
74 const char **papszFileExts;
75 /** Size of the format specific state structure in bytes. */
76 size_t cbFmt;
77
78 /**
79 * Initializes the format.
80 *
81 * @returns VBox status code.
82 * @param pThis Pointer to the unitialized format specific state.
83 * @param pStrm The stream to use for writing.
84 */
85 DECLR3CALLBACKMEMBER(int, pfnInit, (PVUSBSNIFFERFMTINT pThis, PVUSBSNIFFERSTRM pStrm));
86
87 /**
88 * Destroys the format instance.
89 *
90 * @returns nothing.
91 * @param pThis Pointer to the format specific state.
92 */
93 DECLR3CALLBACKMEMBER(void, pfnDestroy, (PVUSBSNIFFERFMTINT pThis));
94
95 /**
96 * Records the given VUSB event.
97 *
98 * @returns VBox status code.
99 * @param pThis Pointer to the format specific state.
100 * @param pUrb The URB triggering the event.
101 * @param enmEvent The type of event to record.
102 */
103 DECLR3CALLBACKMEMBER(int, pfnRecordEvent, (PVUSBSNIFFERFMTINT pThis, PVUSBURB pUrb, VUSBSNIFFEREVENT enmEvent));
104
105} VUSBSNIFFERFMT;
106/** Pointer to a VUSB Sniffer format backend. */
107typedef VUSBSNIFFERFMT *PVUSBSNIFFERFMT;
108/** Pointer to a const VUSB Sniffer format backend. */
109typedef const VUSBSNIFFERFMT *PCVUSBSNIFFERFMT;
110
111/** PCAP-Ng format writer. */
112extern const VUSBSNIFFERFMT g_VUsbSnifferFmtPcapNg;
113/** VMware VMX log format writer. */
114extern const VUSBSNIFFERFMT g_VUsbSnifferFmtVmx;
115/** Linux UsbMon log format writer. */
116extern const VUSBSNIFFERFMT g_VUsbSnifferFmtUsbMon;
117
118RT_C_DECLS_END
119#endif /* !VBOX_INCLUDED_SRC_USB_VUSBSnifferInternal_h */
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