ReactOS 0.4.16-dev-1946-g52006dd
interface.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS IF Monitor DLL
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: NetSh Helper interface context functions
5 * COPYRIGHT: Copyright 2025 Eric Kohl <eric.kohl@reactos.org>
6 */
7
8#include "precomp.h"
9
10#include <guiddef.h>
11
12#define NDEBUG
13#include <debug.h>
14
15#include "guid.h"
16#include "resource.h"
17
18static FN_HANDLE_CMD InterfaceShowInterface;
19
20static
23{
25};
26
27static
30{
32};
33
34
35static
39 LPCWSTR pwszMachine,
40 LPWSTR *argv,
45 BOOL *pbDone)
46{
47 PrintMessage(L"InterfaceShowInterface(): Not implemented yet!\n");
48
49 return ERROR_SUCCESS;
50}
51
52
53static
57 _In_ LPCWSTR pwszRouter,
61{
62 DPRINT("InterfaceDumpFn(%S %p %lu %p)\n", pwszRouter, ppwcArguments, dwArgCount, pvData);
63
65 PrintMessage(L"# Interface Configuration\n");
67 PrintMessage(L"pushd interface\n");
69
71 PrintMessage(L"popd\n");
72 PrintMessage(L"# End of Interface Configuration\n");
74
75 return ERROR_SUCCESS;
76}
77
78
82 _In_ const GUID *pguidParent,
84{
85 NS_CONTEXT_ATTRIBUTES ContextAttributes;
86
87 DPRINT("InterfaceStart()\n");
88
89 ZeroMemory(&ContextAttributes, sizeof(ContextAttributes));
90 ContextAttributes.dwVersion = 1;
91 ContextAttributes.pwszContext = L"interface";
92 ContextAttributes.guidHelper = GUID_IFMON_INTERFACE;
93
94 ContextAttributes.ulNumTopCmds = 0;
95 ContextAttributes.pTopCmds = NULL;
96
97 ContextAttributes.ulNumGroups = sizeof(InterfaceGroups) / sizeof(CMD_GROUP_ENTRY);
98 ContextAttributes.pCmdGroups = InterfaceGroups;
99
100 ContextAttributes.pfnDumpFn = InterfaceDumpFn;
101
102 RegisterContext(&ContextAttributes);
103
104 return ERROR_SUCCESS;
105}
106
107
108DWORD
109WINAPI
111{
112 NS_HELPER_ATTRIBUTES HelperAttributes;
113
114 DPRINT("RegisterInterfaceHelper()\n");
115
116 ZeroMemory(&HelperAttributes, sizeof(HelperAttributes));
117 HelperAttributes.dwVersion = 1;
118 HelperAttributes.guidHelper = GUID_IFMON_INTERFACE;
119 HelperAttributes.pfnStart = InterfaceStart;
120 HelperAttributes.pfnStop = NULL;
121 RegisterHelper(NULL, &HelperAttributes);
122
123 return ERROR_SUCCESS;
124}
VOID PrintMessage(DWORD dwMessage)
Definition: arp.c:95
DWORD WINAPI RegisterContext(_In_ const NS_CONTEXT_ATTRIBUTES *pChildContext)
Definition: context.c:909
static HINSTANCE hDllInstance
Definition: clb.c:9
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
DWORD WINAPI RegisterInterfaceHelper(VOID)
Definition: interface.c:110
static CMD_ENTRY InterfaceShowCommands[]
Definition: interface.c:22
static FN_HANDLE_CMD InterfaceShowInterface
Definition: interface.c:18
static CMD_GROUP_ENTRY InterfaceGroups[]
Definition: interface.c:29
static DWORD WINAPI InterfaceDumpFn(_In_ LPCWSTR pwszRouter, _In_ LPWSTR *ppwcArguments, _In_ DWORD dwArgCount, _In_ LPCVOID pvData)
Definition: interface.c:56
DWORD WINAPI InterfaceStart(_In_ const GUID *pguidParent, _In_ DWORD dwVersion)
Definition: interface.c:81
#define IDS_DUMP_NEWLINE
Definition: resource.h:32
#define IDS_DUMP_HEADERLINE
Definition: resource.h:33
#define IDS_HLP_INTERFACE_SHOW
Definition: resource.h:2
#define IDS_HLP_INTERFACE_SHOW_INTERFACE
Definition: resource.h:3
#define IDS_HLP_INTERFACE_SHOW_INTERFACE_EX
Definition: resource.h:4
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI RegisterHelper(_In_ const GUID *pguidParentHelper, _In_ const NS_HELPER_ATTRIBUTES *pHelperAttributes)
Definition: helper.c:385
#define ZeroMemory
Definition: minwinbase.h:31
CONST void * LPCVOID
Definition: minwindef.h:164
#define argv
Definition: mplay32.c:18
DWORD CDECL PrintMessageFromModule(_In_ HANDLE hModule, _In_ DWORD dwMsgId,...)
Definition: netsh.c:523
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
_In_ LPWSTR * ppwcArguments
Definition: netsh.h:114
_In_ DWORD dwVersion
Definition: netsh.h:85
_In_ LPWSTR _In_ DWORD dwArgCount
Definition: netsh.h:115
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD _In_ LPCVOID _Out_ BOOL * pbDone
Definition: netsh.h:143
_In_ LPWSTR _In_ DWORD dwCurrentIndex
Definition: netsh.h:139
#define _In_
Definition: no_sal2.h:158
#define DPRINT
Definition: sndvol32.h:73
Definition: netsh.h:148
Definition: netsh.h:158
CMD_ENTRY * pTopCmds
Definition: netsh.h:199
CMD_GROUP_ENTRY * pCmdGroups
Definition: netsh.h:201
PNS_CONTEXT_DUMP_FN pfnDumpFn
Definition: netsh.h:203
PNS_HELPER_STOP_FN pfnStop
Definition: netsh.h:180
PNS_HELPER_START_FN pfnStart
Definition: netsh.h:179
#define WINAPI
Definition: msvc.h:6
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WCHAR * LPWSTR
Definition: xmlstorage.h:184