[97046] | 1 | /* $Id: IntNetSwitchInternal.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
| 3 | * VirtualBox internal network switch process - Internal header.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2022-2023 Oracle and/or its affiliates.
|
---|
[97046] | 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 | *
|
---|
[97058] | 25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
[97046] | 26 | */
|
---|
| 27 |
|
---|
[97058] | 28 | #ifndef VBOX_INCLUDED_SRC_IntNetSwitch_IntNetSwitchInternal_h
|
---|
| 29 | #define VBOX_INCLUDED_SRC_IntNetSwitch_IntNetSwitchInternal_h
|
---|
[97046] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | /*********************************************************************************************************************************
|
---|
| 36 | * Header Files *
|
---|
| 37 | *********************************************************************************************************************************/
|
---|
[97084] | 38 | #define IN_INTNET_TESTCASE
|
---|
| 39 | #define IN_INTNET_R3
|
---|
| 40 |
|
---|
[97046] | 41 | #include <VBox/cdefs.h>
|
---|
| 42 | #include <VBox/types.h>
|
---|
| 43 |
|
---|
| 44 | #undef INTNETR0DECL
|
---|
| 45 | #define INTNETR0DECL INTNETR3DECL
|
---|
| 46 | #undef DECLR0CALLBACKMEMBER
|
---|
| 47 | #define DECLR0CALLBACKMEMBER(type, name, args) DECLR3CALLBACKMEMBER(type, name, args)
|
---|
| 48 | typedef struct SUPDRVSESSION *MYPSUPDRVSESSION;
|
---|
| 49 | #define PSUPDRVSESSION MYPSUPDRVSESSION
|
---|
| 50 |
|
---|
[97084] | 51 | #include <VBox/intnet.h>
|
---|
[97046] | 52 | #include <VBox/sup.h>
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 | /*********************************************************************************************************************************
|
---|
| 56 | * Defined Constants And Macros *
|
---|
| 57 | *********************************************************************************************************************************/
|
---|
| 58 |
|
---|
| 59 |
|
---|
| 60 | /*********************************************************************************************************************************
|
---|
| 61 | * Structures and Typedefs *
|
---|
| 62 | *********************************************************************************************************************************/
|
---|
| 63 |
|
---|
| 64 | /**
|
---|
| 65 | * Security objectype.
|
---|
| 66 | */
|
---|
| 67 | typedef enum SUPDRVOBJTYPE
|
---|
| 68 | {
|
---|
| 69 | /** The usual invalid object. */
|
---|
| 70 | SUPDRVOBJTYPE_INVALID = 0,
|
---|
| 71 | /** Internal network. */
|
---|
| 72 | SUPDRVOBJTYPE_INTERNAL_NETWORK,
|
---|
| 73 | /** Internal network interface. */
|
---|
| 74 | SUPDRVOBJTYPE_INTERNAL_NETWORK_INTERFACE,
|
---|
| 75 | /** The first invalid object type in this end. */
|
---|
| 76 | SUPDRVOBJTYPE_END,
|
---|
| 77 | /** The usual 32-bit type size hack. */
|
---|
| 78 | SUPDRVOBJTYPE_32_BIT_HACK = 0x7ffffff
|
---|
| 79 | } SUPDRVOBJTYPE;
|
---|
| 80 |
|
---|
| 81 | /**
|
---|
| 82 | * Object destructor callback.
|
---|
| 83 | * This is called for reference counted objectes when the count reaches 0.
|
---|
| 84 | *
|
---|
| 85 | * @param pvObj The object pointer.
|
---|
| 86 | * @param pvUser1 The first user argument.
|
---|
| 87 | * @param pvUser2 The second user argument.
|
---|
| 88 | */
|
---|
| 89 | typedef DECLCALLBACKTYPE(void, FNSUPDRVDESTRUCTOR,(void *pvObj, void *pvUser1, void *pvUser2));
|
---|
| 90 | /** Pointer to a FNSUPDRVDESTRUCTOR(). */
|
---|
| 91 | typedef FNSUPDRVDESTRUCTOR *PFNSUPDRVDESTRUCTOR;
|
---|
| 92 |
|
---|
| 93 |
|
---|
| 94 | RT_C_DECLS_BEGIN
|
---|
| 95 |
|
---|
| 96 | INTNETR3DECL(void *) SUPR0ObjRegister(PSUPDRVSESSION pSession, SUPDRVOBJTYPE enmType,
|
---|
| 97 | PFNSUPDRVDESTRUCTOR pfnDestructor, void *pvUser1, void *pvUser2);
|
---|
| 98 | INTNETR3DECL(int) SUPR0ObjAddRefEx(void *pvObj, PSUPDRVSESSION pSession, bool fNoBlocking);
|
---|
| 99 | INTNETR3DECL(int) SUPR0ObjAddRef(void *pvObj, PSUPDRVSESSION pSession);
|
---|
| 100 | INTNETR3DECL(int) SUPR0ObjRelease(void *pvObj, PSUPDRVSESSION pSession);
|
---|
| 101 | INTNETR3DECL(int) SUPR0ObjVerifyAccess(void *pvObj, PSUPDRVSESSION pSession, const char *pszObjName);
|
---|
| 102 | INTNETR3DECL(int) SUPR0MemAlloc(PSUPDRVSESSION pSession, uint32_t cb, PRTR0PTR ppvR0, PRTR3PTR ppvR3);
|
---|
| 103 | INTNETR3DECL(int) SUPR0MemFree(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr);
|
---|
| 104 |
|
---|
| 105 |
|
---|
| 106 | RT_C_DECLS_END
|
---|
| 107 |
|
---|
[97058] | 108 | #endif /* !VBOX_INCLUDED_SRC_IntNetSwitch_IntNetSwitchInternal_h */
|
---|
[97046] | 109 |
|
---|