1 | /* $Id: UsbTestServiceGadgetHostInternal.h 76531 2018-12-30 06:03:11Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * UsbTestServ - Remote USB test configuration and execution server, Gadget API.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-2017 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 ___UsbTestServiceGadgetHostInternal_h___
|
---|
28 | #define ___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 |
|
---|
38 | RT_C_DECLS_BEGIN
|
---|
39 |
|
---|
40 | /** Pointer to an opaque type dependent gadget host instance data. */
|
---|
41 | typedef struct UTSGADGETHOSTTYPEINT *PUTSGADGETHOSTTYPEINT;
|
---|
42 | /** Pointer to a gadget host instance pointer. */
|
---|
43 | typedef PUTSGADGETHOSTTYPEINT *PPUTSGADETHOSTTYPEINT;
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * Gadget host interface.
|
---|
47 | */
|
---|
48 | typedef 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. */
|
---|
114 | typedef UTSGADGETHOSTIF *PUTSGADGETHOSTIF;
|
---|
115 | /** Pointer to a const gadget host callback table. */
|
---|
116 | typedef const struct UTSGADGETHOSTIF *PCUTSGADGETHOSTIF;
|
---|
117 |
|
---|
118 | extern UTSGADGETHOSTIF const g_UtsGadgetHostIfUsbIp;
|
---|
119 |
|
---|
120 | RT_C_DECLS_END
|
---|
121 |
|
---|
122 | #endif
|
---|
123 |
|
---|