VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/utils/usb/UsbTestServiceGadgetHostInternal.h@ 77994

Last change on this file since 77994 was 76579, checked in by vboxsync, 6 years ago

ValKit: scm header guard alignment.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/* $Id: UsbTestServiceGadgetHostInternal.h 76579 2019-01-01 06:14:44Z vboxsync $ */
2/** @file
3 * UsbTestServ - Remote USB test configuration and execution server, Gadget API.
4 */
5
6/*
7 * Copyright (C) 2016-2019 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 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#ifndef VBOX_INCLUDED_SRC_usb_UsbTestServiceGadgetHostInternal_h
28#define VBOX_INCLUDED_SRC_usb_UsbTestServiceGadgetHostInternal_h
29#ifndef RT_WITHOUT_PRAGMA_ONCE
30# pragma once
31#endif
32
33#include <iprt/cdefs.h>
34#include <iprt/types.h>
35
36#include "UsbTestServiceGadget.h"
37
38RT_C_DECLS_BEGIN
39
40/** Pointer to an opaque type dependent gadget host instance data. */
41typedef struct UTSGADGETHOSTTYPEINT *PUTSGADGETHOSTTYPEINT;
42/** Pointer to a gadget host instance pointer. */
43typedef PUTSGADGETHOSTTYPEINT *PPUTSGADETHOSTTYPEINT;
44
45/**
46 * Gadget host interface.
47 */
48typedef struct UTSGADGETHOSTIF
49{
50 /** The gadget host type implemented. */
51 UTSGADGETHOSTTYPE enmType;
52 /** Description. */
53 const char *pszDesc;
54 /** Size of the interface specific instance data. */
55 size_t cbIf;
56
57 /**
58 * Initializes the gadget host interface.
59 *
60 * @returns IPRT status code.
61 * @param pIf The interface specific instance data.
62 * @param paCfg The configuration of the interface.
63 */
64 DECLR3CALLBACKMEMBER(int, pfnInit, (PUTSGADGETHOSTTYPEINT pIf, PCUTSGADGETCFGITEM paCfg));
65
66 /**
67 * Terminates the gadget host interface.
68 *
69 * @returns nothing.
70 * @param pIf The interface specific instance data.
71 */
72 DECLR3CALLBACKMEMBER(void, pfnTerm, (PUTSGADGETHOSTTYPEINT pIf));
73
74 /**
75 * Adds the given gadget to the host interface.
76 *
77 * @returns IPRT status code.
78 * @param pIf The interface specific instance data.
79 * @param hGadget The gadget handle to add.
80 */
81 DECLR3CALLBACKMEMBER(int, pfnGadgetAdd, (PUTSGADGETHOSTTYPEINT pIf, UTSGADGET hGadget));
82
83 /**
84 * Removes the given gadget from the host interface.
85 *
86 * @returns IPRT status code.
87 * @param pIf The interface specific instance data.
88 * @param hGadget The gadget handle to remove.
89 */
90 DECLR3CALLBACKMEMBER(int, pfnGadgetRemove, (PUTSGADGETHOSTTYPEINT pIf, UTSGADGET hGadget));
91
92 /**
93 * Connects the given gadget to the host interface so it appears as connected to the client
94 * of the gadget host.
95 *
96 * @returns IPRT status code.
97 * @param pIf The interface specific instance data.
98 * @param hGadget The gadget handle to add.
99 */
100 DECLR3CALLBACKMEMBER(int, pfnGadgetConnect, (PUTSGADGETHOSTTYPEINT pIf, UTSGADGET hGadget));
101
102 /**
103 * Disconnects the given gadget from the host interface so it appears as disconnected to the client
104 * of the gadget host.
105 *
106 * @returns IPRT status code.
107 * @param pIf The interface specific instance data.
108 * @param hGadget The gadget handle to add.
109 */
110 DECLR3CALLBACKMEMBER(int, pfnGadgetDisconnect, (PUTSGADGETHOSTTYPEINT pIf, UTSGADGET hGadget));
111
112} UTSGADGETHOSTIF;
113/** Pointer to a gadget host callback table. */
114typedef UTSGADGETHOSTIF *PUTSGADGETHOSTIF;
115/** Pointer to a const gadget host callback table. */
116typedef const struct UTSGADGETHOSTIF *PCUTSGADGETHOSTIF;
117
118extern UTSGADGETHOSTIF const g_UtsGadgetHostIfUsbIp;
119
120RT_C_DECLS_END
121
122#endif /* !VBOX_INCLUDED_SRC_usb_UsbTestServiceGadgetHostInternal_h */
123
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