1 | /* $Id: DBGCIoProvInternal.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DBGC - Debugger Console, Internal I/O provider header file.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2020-2024 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 DEBUGGER_INCLUDED_SRC_DBGCIoProvInternal_h
|
---|
29 | #define DEBUGGER_INCLUDED_SRC_DBGCIoProvInternal_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 |
|
---|
35 | /*******************************************************************************
|
---|
36 | * Header Files *
|
---|
37 | *******************************************************************************/
|
---|
38 | #include <VBox/dbg.h>
|
---|
39 | #include <VBox/err.h>
|
---|
40 | #include <VBox/vmm/cfgm.h>
|
---|
41 |
|
---|
42 |
|
---|
43 | /*******************************************************************************
|
---|
44 | * Structures and Typedefs *
|
---|
45 | *******************************************************************************/
|
---|
46 |
|
---|
47 | /** An Opaque I/O provider handle. */
|
---|
48 | typedef struct DBGCIOPROVINT *DBGCIOPROV;
|
---|
49 | /** Pointer to an opaque I/O provider handle. */
|
---|
50 | typedef DBGCIOPROV *PDBGCIOPROV;
|
---|
51 |
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * I/O provider registration record.
|
---|
55 | */
|
---|
56 | typedef struct DBGCIOPROVREG
|
---|
57 | {
|
---|
58 | /** Unique name for the I/O provider. */
|
---|
59 | const char *pszName;
|
---|
60 | /** I/O provider description. */
|
---|
61 | const char *pszDesc;
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * Creates an I/O provider instance from the given config.
|
---|
65 | *
|
---|
66 | * @returns VBox status code.
|
---|
67 | * @param phDbgcIoProv Where to store the handle to the I/O provider instance on success.
|
---|
68 | * @param pCfg The config to use.
|
---|
69 | */
|
---|
70 | DECLCALLBACKMEMBER(int, pfnCreate, (PDBGCIOPROV phDbgcIoProv, PCFGMNODE pCfg));
|
---|
71 |
|
---|
72 | /**
|
---|
73 | * Destroys the given I/O provider instance.
|
---|
74 | *
|
---|
75 | * @param hDbgcIoProv The I/O provider instance handle to destroy.
|
---|
76 | */
|
---|
77 | DECLCALLBACKMEMBER(void, pfnDestroy, (DBGCIOPROV hDbgcIoProv));
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * Waits for someone to connect to the provider instance.
|
---|
81 | *
|
---|
82 | * @returns VBox status code.
|
---|
83 | * @retval VERR_TIMEOUT if the waiting time was exceeded without anyone connecting.
|
---|
84 | * @retval VERR_INTERRUPTED if the waiting was interrupted by DBGCIOPROVREG::pfnWaitInterrupt.
|
---|
85 | * @param hDbgcIoProv The I/O provider instance handle.
|
---|
86 | * @param cMsTimeout Number of milliseconds to wait, use RT_INDEFINITE_WAIT to wait indefinitely.
|
---|
87 | * @param ppDbgcIo Where to return the I/O connection callback table upon a succesful return.
|
---|
88 | */
|
---|
89 | DECLCALLBACKMEMBER(int, pfnWaitForConnect, (DBGCIOPROV hDbgcIoProv, RTMSINTERVAL cMsTimeout, PCDBGCIO *ppDbgcIo));
|
---|
90 |
|
---|
91 | /**
|
---|
92 | * Interrupts the thread waiting in DBGCIOPROVREG::pfnWaitForConnect.
|
---|
93 | *
|
---|
94 | * @returns VBox status code.
|
---|
95 | * @param hDbgcIoProv The I/O provider instance handle.
|
---|
96 | */
|
---|
97 | DECLCALLBACKMEMBER(int, pfnWaitInterrupt, (DBGCIOPROV hDbgcIoProv));
|
---|
98 |
|
---|
99 | } DBGCIOPROVREG;
|
---|
100 | /** Pointer to an I/O provider registration record. */
|
---|
101 | typedef DBGCIOPROVREG *PDBGCIOPROVREG;
|
---|
102 | /** Pointer toa const I/O provider registration record. */
|
---|
103 | typedef const DBGCIOPROVREG *PCDBGCIOPROVREG;
|
---|
104 |
|
---|
105 |
|
---|
106 | /*******************************************************************************
|
---|
107 | * Global Variables *
|
---|
108 | *******************************************************************************/
|
---|
109 | extern const DBGCIOPROVREG g_DbgcIoProvTcp;
|
---|
110 | extern const DBGCIOPROVREG g_DbgcIoProvUdp;
|
---|
111 | extern const DBGCIOPROVREG g_DbgcIoProvIpc;
|
---|
112 |
|
---|
113 |
|
---|
114 | #endif /* !DEBUGGER_INCLUDED_SRC_DBGCIoProvInternal_h */
|
---|
115 |
|
---|