1 | /** @file
|
---|
2 | * VBoxNetFlt - Briefly describe this file, optionally with a longer description
|
---|
3 | * in a separate paragraph. (HostDrivers)
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008 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 | * Based in part on Microsoft DDK sample code for Ndis Intermediate Miniport passthru driver sample.
|
---|
28 | *+---------------------------------------------------------------------------
|
---|
29 | *
|
---|
30 | * Microsoft Windows
|
---|
31 | * Copyright (C) Microsoft Corporation, 2001.
|
---|
32 | *
|
---|
33 | * Author: Alok Sinha 15-May-01
|
---|
34 | *
|
---|
35 | *----------------------------------------------------------------------------
|
---|
36 | */
|
---|
37 |
|
---|
38 | #ifndef ___VBox_WinNetConfig_h
|
---|
39 | #define ___VBox_WinNetConfig_h
|
---|
40 |
|
---|
41 | #include <winsock2.h>
|
---|
42 | #include <Windows.h>
|
---|
43 | #include <Netcfgn.h>
|
---|
44 | #include <Setupapi.h>
|
---|
45 | #include <iprt/cdefs.h>
|
---|
46 |
|
---|
47 | /** @defgroup grp_vboxnetcfgwin The Windows Network Configration Library
|
---|
48 | * @{ */
|
---|
49 |
|
---|
50 | /** @def VBOXNETCFGWIN_DECL
|
---|
51 | * The usual declaration wrapper.
|
---|
52 | */
|
---|
53 | #if 0
|
---|
54 | /* enable this in case we include this in a dll*/
|
---|
55 | # ifdef IN_VBOXDDU
|
---|
56 | # define VBOXNETCFGWIN_DECL(_type) DECLEXPORT(_type)
|
---|
57 | # else
|
---|
58 | # define VBOXNETCFGWIN_DECL(_type) DECLIMPORT(_type)
|
---|
59 | # endif
|
---|
60 | #else
|
---|
61 | /*enable this in case we include this in a static lib*/
|
---|
62 | # define VBOXNETCFGWIN_DECL(_type) _type
|
---|
63 | #endif
|
---|
64 |
|
---|
65 | RT_C_DECLS_BEGIN
|
---|
66 |
|
---|
67 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinQueryINetCfg(IN BOOL fGetWriteLock, IN LPCWSTR lpszAppName, OUT INetCfg** ppnc, OUT LPWSTR *lpszLockedBy);
|
---|
68 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinReleaseINetCfg(IN INetCfg *pnc, IN BOOL fHasWriteLock);
|
---|
69 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetComponentEnum(INetCfg *pnc, IN const GUID *pguidClass, OUT IEnumNetCfgComponent **ppencc);
|
---|
70 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetFirstComponent(IN IEnumNetCfgComponent *pencc, OUT INetCfgComponent **ppncc);
|
---|
71 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetNextComponent(IN IEnumNetCfgComponent *pencc, OUT INetCfgComponent **ppncc);
|
---|
72 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinInstallComponent(IN INetCfg *pnc, IN LPCWSTR szComponentId, IN const GUID *pguidClass);
|
---|
73 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinInstallNetComponent(IN INetCfg *pnc, IN LPCWSTR lpszComponentId, IN const GUID *pguidClass,
|
---|
74 | IN LPCWSTR * apInfFullPaths, IN UINT cInfFullPaths);
|
---|
75 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinUninstallComponent(IN INetCfg *pnc, IN INetCfgComponent *pncc);
|
---|
76 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetNextBindingPath(IN IEnumNetCfgBindingPath *pencbp, OUT INetCfgBindingPath **ppncbp);
|
---|
77 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetNextBindingInterface(IN IEnumNetCfgBindingInterface *pencbi, OUT INetCfgBindingInterface **ppncbi);
|
---|
78 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetFirstBindingInterface(IN IEnumNetCfgBindingInterface *pencbi, OUT INetCfgBindingInterface **ppncbi);
|
---|
79 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetBindingInterfaceEnum(IN INetCfgBindingPath *pncbp, OUT IEnumNetCfgBindingInterface **ppencbi);
|
---|
80 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetFirstBindingPath(IN IEnumNetCfgBindingPath *pencbp, OUT INetCfgBindingPath **ppncbp);
|
---|
81 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetBindingPathEnum(IN INetCfgComponent *pncc, IN DWORD dwBindingType, OUT IEnumNetCfgBindingPath **ppencbp);
|
---|
82 | VBOXNETCFGWIN_DECL(VOID) VBoxNetCfgWinReleaseRef(IN IUnknown *punk);
|
---|
83 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetComponentByGuid(IN INetCfg *pNc, IN const GUID *pguidClass, IN const GUID * pComponentGuid, OUT INetCfgComponent **ppncc);
|
---|
84 |
|
---|
85 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetFltUninstall(IN INetCfg *pNc);
|
---|
86 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetFltInstall(IN INetCfg *pNc, IN LPCWSTR * apInfFullPaths, IN UINT cInfFullPaths);
|
---|
87 |
|
---|
88 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGenHostonlyConnectionName (PCWSTR DevName, WCHAR *pBuf, PULONG pcbBuf);
|
---|
89 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRenameConnection (LPWSTR pGuid, PCWSTR NewName);
|
---|
90 |
|
---|
91 | typedef BOOL (*VBOXNETCFGWIN_NETENUM_CALLBACK) (HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pContext);
|
---|
92 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnumNetDevices(LPWSTR pPnPId, VBOXNETCFGWIN_NETENUM_CALLBACK callback, PVOID pContext);
|
---|
93 |
|
---|
94 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveHostOnlyNetworkInterface (const GUID *pGUID, BSTR *pErrMsg);
|
---|
95 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveAllNetDevicesOfId(LPWSTR pPnPId);
|
---|
96 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface (LPCWSTR pInfPath, bool bIsInfPathFile, GUID *pGuid, BSTR *lppszName, BSTR *pErrMsg);
|
---|
97 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinUninstallInfs (const GUID * pGuid, LPCWSTR pPnPId, DWORD Flags);
|
---|
98 |
|
---|
99 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinDhcpRediscover(const GUID *pGuid);
|
---|
100 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnableDynamicIpConfig(const GUID *pGuid);
|
---|
101 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnableStaticIpConfig(const GUID *pGuid, ULONG ip, ULONG mask);
|
---|
102 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinIsDhcpEnabled(const GUID * pGuid, BOOL *pEnabled);
|
---|
103 |
|
---|
104 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGenHostOnlyNetworkNetworkIp(PULONG pNetIp, PULONG pNetMask);
|
---|
105 |
|
---|
106 | typedef struct _ADAPTER_SETTINGS
|
---|
107 | {
|
---|
108 | ULONG ip;
|
---|
109 | ULONG mask;
|
---|
110 | BOOL bDhcp;
|
---|
111 | }ADAPTER_SETTINGS, *PADAPTER_SETTINGS;
|
---|
112 |
|
---|
113 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinGetAdapterSettings(const GUID * pGuid, PADAPTER_SETTINGS pSettings);
|
---|
114 |
|
---|
115 | VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinInstallInf(IN LPCWSTR pInfFullPath);
|
---|
116 |
|
---|
117 | typedef VOID (*LOG_ROUTINE) (LPCWSTR szString);
|
---|
118 | VBOXNETCFGWIN_DECL(VOID) VBoxNetCfgWinSetLogging(LOG_ROUTINE Log);
|
---|
119 |
|
---|
120 | RT_C_DECLS_END
|
---|
121 |
|
---|
122 | /** @} */
|
---|
123 |
|
---|
124 | #endif
|
---|
125 |
|
---|