1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox network devices:
|
---|
4 | * Network sniffer filter driver
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 |
|
---|
24 | /*******************************************************************************
|
---|
25 | * Header Files *
|
---|
26 | *******************************************************************************/
|
---|
27 | #define LOG_GROUP LOG_GROUP_DRV_NAT
|
---|
28 | #include <VBox/pdmdrv.h>
|
---|
29 |
|
---|
30 | #include <VBox/log.h>
|
---|
31 | #include <iprt/assert.h>
|
---|
32 | #include <iprt/file.h>
|
---|
33 | #include <iprt/process.h>
|
---|
34 | #include <iprt/string.h>
|
---|
35 | #include <iprt/time.h>
|
---|
36 | #include <iprt/critsect.h>
|
---|
37 | #include <VBox/param.h>
|
---|
38 |
|
---|
39 | #include "Pcap.h"
|
---|
40 | #include "Builtins.h"
|
---|
41 |
|
---|
42 |
|
---|
43 | /*******************************************************************************
|
---|
44 | * Structures and Typedefs *
|
---|
45 | *******************************************************************************/
|
---|
46 | /**
|
---|
47 | * Block driver instance data.
|
---|
48 | */
|
---|
49 | typedef struct DRVNETSNIFFER
|
---|
50 | {
|
---|
51 | /** The network interface. */
|
---|
52 | PDMINETWORKCONNECTOR INetworkConnector;
|
---|
53 | /** The network interface. */
|
---|
54 | PDMINETWORKPORT INetworkPort;
|
---|
55 | /** The network config interface. */
|
---|
56 | PDMINETWORKCONFIG INetworkConfig;
|
---|
57 | /** The port we're attached to. */
|
---|
58 | PPDMINETWORKPORT pPort;
|
---|
59 | /** The config port interface we're attached to. */
|
---|
60 | PPDMINETWORKCONFIG pConfig;
|
---|
61 | /** The connector that's attached to us. */
|
---|
62 | PPDMINETWORKCONNECTOR pConnector;
|
---|
63 | /** The filename. */
|
---|
64 | char szFilename[RTPATH_MAX];
|
---|
65 | /** The filehandle. */
|
---|
66 | RTFILE File;
|
---|
67 | /** The lock serializing the file access. */
|
---|
68 | RTCRITSECT Lock;
|
---|
69 | /** The NanoTS delta we pass to the pcap writers. */
|
---|
70 | uint64_t StartNanoTS;
|
---|
71 | /** Pointer to the driver instance. */
|
---|
72 | PPDMDRVINS pDrvIns;
|
---|
73 |
|
---|
74 | } DRVNETSNIFFER, *PDRVNETSNIFFER;
|
---|
75 |
|
---|
76 | /** Converts a pointer to NAT::INetworkConnector to a PDRVNETSNIFFER. */
|
---|
77 | #define PDMINETWORKCONNECTOR_2_DRVNETSNIFFER(pInterface) ( (PDRVNETSNIFFER)((uintptr_t)pInterface - RT_OFFSETOF(DRVNETSNIFFER, INetworkConnector)) )
|
---|
78 |
|
---|
79 | /** Converts a pointer to NAT::INetworkPort to a PDRVNETSNIFFER. */
|
---|
80 | #define PDMINETWORKPORT_2_DRVNETSNIFFER(pInterface) ( (PDRVNETSNIFFER)((uintptr_t)pInterface - RT_OFFSETOF(DRVNETSNIFFER, INetworkPort)) )
|
---|
81 |
|
---|
82 | /** Converts a pointer to NAT::INetworkConfig to a PDRVNETSNIFFER. */
|
---|
83 | #define PDMINETWORKCONFIG_2_DRVNETSNIFFER(pInterface) ( (PDRVNETSNIFFER)((uintptr_t)pInterface - RT_OFFSETOF(DRVNETSNIFFER, INetworkConfig)) )
|
---|
84 |
|
---|
85 |
|
---|
86 |
|
---|
87 | /**
|
---|
88 | * Send data to the network.
|
---|
89 | *
|
---|
90 | * @returns VBox status code.
|
---|
91 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
92 | * @param pvBuf Data to send.
|
---|
93 | * @param cb Number of bytes to send.
|
---|
94 | * @thread EMT
|
---|
95 | */
|
---|
96 | static DECLCALLBACK(int) drvNetSnifferSend(PPDMINETWORKCONNECTOR pInterface, const void *pvBuf, size_t cb)
|
---|
97 | {
|
---|
98 | PDRVNETSNIFFER pThis = PDMINETWORKCONNECTOR_2_DRVNETSNIFFER(pInterface);
|
---|
99 |
|
---|
100 | /* output to sniffer */
|
---|
101 | RTCritSectEnter(&pThis->Lock);
|
---|
102 | PcapFileFrame(pThis->File, pThis->StartNanoTS, pvBuf, cb, cb);
|
---|
103 | RTCritSectLeave(&pThis->Lock);
|
---|
104 |
|
---|
105 | /* pass down */
|
---|
106 | if (pThis->pConnector)
|
---|
107 | {
|
---|
108 | int rc = pThis->pConnector->pfnSend(pThis->pConnector, pvBuf, cb);
|
---|
109 | #if 0
|
---|
110 | RTCritSectEnter(&pThis->Lock);
|
---|
111 | u64TS = RTTimeProgramNanoTS();
|
---|
112 | Hdr.ts_sec = (uint32_t)(u64TS / 1000000000);
|
---|
113 | Hdr.ts_usec = (uint32_t)((u64TS / 1000) % 1000000);
|
---|
114 | Hdr.incl_len = 0;
|
---|
115 | RTFileWrite(pThis->File, &Hdr, sizeof(Hdr), NULL);
|
---|
116 | RTCritSectLeave(&pThis->Lock);
|
---|
117 | #endif
|
---|
118 | return rc;
|
---|
119 | }
|
---|
120 | return VINF_SUCCESS;
|
---|
121 | }
|
---|
122 |
|
---|
123 |
|
---|
124 | /**
|
---|
125 | * Set promiscuous mode.
|
---|
126 | *
|
---|
127 | * This is called when the promiscuous mode is set. This means that there doesn't have
|
---|
128 | * to be a mode change when it's called.
|
---|
129 | *
|
---|
130 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
131 | * @param fPromiscuous Set if the adaptor is now in promiscuous mode. Clear if it is not.
|
---|
132 | * @thread EMT
|
---|
133 | */
|
---|
134 | static DECLCALLBACK(void) drvNetSnifferSetPromiscuousMode(PPDMINETWORKCONNECTOR pInterface, bool fPromiscuous)
|
---|
135 | {
|
---|
136 | LogFlow(("drvNetSnifferSetPromiscuousMode: fPromiscuous=%d\n", fPromiscuous));
|
---|
137 | PDRVNETSNIFFER pThis = PDMINETWORKCONNECTOR_2_DRVNETSNIFFER(pInterface);
|
---|
138 | if (pThis->pConnector)
|
---|
139 | pThis->pConnector->pfnSetPromiscuousMode(pThis->pConnector, fPromiscuous);
|
---|
140 | }
|
---|
141 |
|
---|
142 |
|
---|
143 | /**
|
---|
144 | * Notification on link status changes.
|
---|
145 | *
|
---|
146 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
147 | * @param enmLinkState The new link state.
|
---|
148 | * @thread EMT
|
---|
149 | */
|
---|
150 | static DECLCALLBACK(void) drvNetSnifferNotifyLinkChanged(PPDMINETWORKCONNECTOR pInterface, PDMNETWORKLINKSTATE enmLinkState)
|
---|
151 | {
|
---|
152 | LogFlow(("drvNetSnifferNotifyLinkChanged: enmLinkState=%d\n", enmLinkState));
|
---|
153 | PDRVNETSNIFFER pThis = PDMINETWORKCONNECTOR_2_DRVNETSNIFFER(pInterface);
|
---|
154 | if (pThis->pConnector)
|
---|
155 | pThis->pConnector->pfnNotifyLinkChanged(pThis->pConnector, enmLinkState);
|
---|
156 | }
|
---|
157 |
|
---|
158 |
|
---|
159 | /**
|
---|
160 | * Check how much data the device/driver can receive data now.
|
---|
161 | * This must be called before the pfnRecieve() method is called.
|
---|
162 | *
|
---|
163 | * @returns Number of bytes the device can receive now.
|
---|
164 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
165 | * @thread EMT
|
---|
166 | */
|
---|
167 | static DECLCALLBACK(int) drvNetSnifferWaitReceiveAvail(PPDMINETWORKPORT pInterface, unsigned cMillies)
|
---|
168 | {
|
---|
169 | PDRVNETSNIFFER pThis = PDMINETWORKPORT_2_DRVNETSNIFFER(pInterface);
|
---|
170 | return pThis->pPort->pfnWaitReceiveAvail(pThis->pPort, cMillies);
|
---|
171 | }
|
---|
172 |
|
---|
173 |
|
---|
174 | /**
|
---|
175 | * Receive data from the network.
|
---|
176 | *
|
---|
177 | * @returns VBox status code.
|
---|
178 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
179 | * @param pvBuf The available data.
|
---|
180 | * @param cb Number of bytes available in the buffer.
|
---|
181 | * @thread EMT
|
---|
182 | */
|
---|
183 | static DECLCALLBACK(int) drvNetSnifferReceive(PPDMINETWORKPORT pInterface, const void *pvBuf, size_t cb)
|
---|
184 | {
|
---|
185 | PDRVNETSNIFFER pThis = PDMINETWORKPORT_2_DRVNETSNIFFER(pInterface);
|
---|
186 |
|
---|
187 | /* output to sniffer */
|
---|
188 | RTCritSectEnter(&pThis->Lock);
|
---|
189 | PcapFileFrame(pThis->File, pThis->StartNanoTS, pvBuf, cb, cb);
|
---|
190 | RTCritSectLeave(&pThis->Lock);
|
---|
191 |
|
---|
192 | /* pass up */
|
---|
193 | int rc = pThis->pPort->pfnReceive(pThis->pPort, pvBuf, cb);
|
---|
194 | #if 0
|
---|
195 | RTCritSectEnter(&pThis->Lock);
|
---|
196 | u64TS = RTTimeProgramNanoTS();
|
---|
197 | Hdr.ts_sec = (uint32_t)(u64TS / 1000000000);
|
---|
198 | Hdr.ts_usec = (uint32_t)((u64TS / 1000) % 1000000);
|
---|
199 | Hdr.incl_len = 0;
|
---|
200 | RTFileWrite(pThis->File, &Hdr, sizeof(Hdr), NULL);
|
---|
201 | RTCritSectLeave(&pThis->Lock);
|
---|
202 | #endif
|
---|
203 | return rc;
|
---|
204 | }
|
---|
205 |
|
---|
206 |
|
---|
207 | /**
|
---|
208 | * Gets the current Media Access Control (MAC) address.
|
---|
209 | *
|
---|
210 | * @returns VBox status code.
|
---|
211 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
212 | * @param pMac Where to store the MAC address.
|
---|
213 | * @thread EMT
|
---|
214 | */
|
---|
215 | static DECLCALLBACK(int) drvNetSnifferGetMac(PPDMINETWORKCONFIG pInterface, PRTMAC pMac)
|
---|
216 | {
|
---|
217 | PDRVNETSNIFFER pThis = PDMINETWORKCONFIG_2_DRVNETSNIFFER(pInterface);
|
---|
218 | return pThis->pConfig->pfnGetMac(pThis->pConfig, pMac);
|
---|
219 | }
|
---|
220 |
|
---|
221 | /**
|
---|
222 | * Gets the new link state.
|
---|
223 | *
|
---|
224 | * @returns The current link state.
|
---|
225 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
226 | * @thread EMT
|
---|
227 | */
|
---|
228 | static DECLCALLBACK(PDMNETWORKLINKSTATE) drvNetSnifferGetLinkState(PPDMINETWORKCONFIG pInterface)
|
---|
229 | {
|
---|
230 | PDRVNETSNIFFER pThis = PDMINETWORKCONFIG_2_DRVNETSNIFFER(pInterface);
|
---|
231 | return pThis->pConfig->pfnGetLinkState(pThis->pConfig);
|
---|
232 | }
|
---|
233 |
|
---|
234 | /**
|
---|
235 | * Sets the new link state.
|
---|
236 | *
|
---|
237 | * @returns VBox status code.
|
---|
238 | * @param pInterface Pointer to the interface structure containing the called function pointer.
|
---|
239 | * @param enmState The new link state
|
---|
240 | * @thread EMT
|
---|
241 | */
|
---|
242 | static DECLCALLBACK(int) drvNetSnifferSetLinkState(PPDMINETWORKCONFIG pInterface, PDMNETWORKLINKSTATE enmState)
|
---|
243 | {
|
---|
244 | PDRVNETSNIFFER pThis = PDMINETWORKCONFIG_2_DRVNETSNIFFER(pInterface);
|
---|
245 | return pThis->pConfig->pfnSetLinkState(pThis->pConfig, enmState);
|
---|
246 | }
|
---|
247 |
|
---|
248 |
|
---|
249 | /**
|
---|
250 | * Queries an interface to the driver.
|
---|
251 | *
|
---|
252 | * @returns Pointer to interface.
|
---|
253 | * @returns NULL if the interface was not supported by the driver.
|
---|
254 | * @param pInterface Pointer to this interface structure.
|
---|
255 | * @param enmInterface The requested interface identification.
|
---|
256 | * @thread Any thread.
|
---|
257 | */
|
---|
258 | static DECLCALLBACK(void *) drvNetSnifferQueryInterface(PPDMIBASE pInterface, PDMINTERFACE enmInterface)
|
---|
259 | {
|
---|
260 | PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
|
---|
261 | PDRVNETSNIFFER pThis = PDMINS_2_DATA(pDrvIns, PDRVNETSNIFFER);
|
---|
262 | switch (enmInterface)
|
---|
263 | {
|
---|
264 | case PDMINTERFACE_BASE:
|
---|
265 | return &pDrvIns->IBase;
|
---|
266 | case PDMINTERFACE_NETWORK_CONNECTOR:
|
---|
267 | return &pThis->INetworkConnector;
|
---|
268 | case PDMINTERFACE_NETWORK_PORT:
|
---|
269 | return &pThis->INetworkPort;
|
---|
270 | case PDMINTERFACE_NETWORK_CONFIG:
|
---|
271 | return &pThis->INetworkConfig;
|
---|
272 | default:
|
---|
273 | return NULL;
|
---|
274 | }
|
---|
275 | }
|
---|
276 |
|
---|
277 |
|
---|
278 | /**
|
---|
279 | * Destruct a driver instance.
|
---|
280 | *
|
---|
281 | * Most VM resources are freed by the VM. This callback is provided so that any non-VM
|
---|
282 | * resources can be freed correctly.
|
---|
283 | *
|
---|
284 | * @param pDrvIns The driver instance data.
|
---|
285 | */
|
---|
286 | static DECLCALLBACK(void) drvNetSnifferDestruct(PPDMDRVINS pDrvIns)
|
---|
287 | {
|
---|
288 | PDRVNETSNIFFER pThis = PDMINS_2_DATA(pDrvIns, PDRVNETSNIFFER);
|
---|
289 |
|
---|
290 | if (RTCritSectIsInitialized(&pThis->Lock))
|
---|
291 | RTCritSectDelete(&pThis->Lock);
|
---|
292 |
|
---|
293 | if (pThis->File != NIL_RTFILE)
|
---|
294 | {
|
---|
295 | RTFileClose(pThis->File);
|
---|
296 | pThis->File = NIL_RTFILE;
|
---|
297 | }
|
---|
298 | }
|
---|
299 |
|
---|
300 |
|
---|
301 | /**
|
---|
302 | * Construct a NAT network transport driver instance.
|
---|
303 | *
|
---|
304 | * @returns VBox status.
|
---|
305 | * @param pDrvIns The driver instance data.
|
---|
306 | * If the registration structure is needed, pDrvIns->pDrvReg points to it.
|
---|
307 | * @param pCfgHandle Configuration node handle for the driver. Use this to obtain the configuration
|
---|
308 | * of the driver instance. It's also found in pDrvIns->pCfgHandle, but like
|
---|
309 | * iInstance it's expected to be used a bit in this function.
|
---|
310 | */
|
---|
311 | static DECLCALLBACK(int) drvNetSnifferConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle)
|
---|
312 | {
|
---|
313 | PDRVNETSNIFFER pThis = PDMINS_2_DATA(pDrvIns, PDRVNETSNIFFER);
|
---|
314 | LogFlow(("drvNetSnifferConstruct:\n"));
|
---|
315 |
|
---|
316 | /*
|
---|
317 | * Validate the config.
|
---|
318 | */
|
---|
319 | if (!CFGMR3AreValuesValid(pCfgHandle, "File\0"))
|
---|
320 | return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
|
---|
321 |
|
---|
322 | /*
|
---|
323 | * Init the static parts.
|
---|
324 | */
|
---|
325 | pThis->pDrvIns = pDrvIns;
|
---|
326 | pThis->File = NIL_RTFILE;
|
---|
327 | /* The pcap file *must* start at time offset 0,0. */
|
---|
328 | pThis->StartNanoTS = RTTimeNanoTS() - RTTimeProgramNanoTS();
|
---|
329 | /* IBase */
|
---|
330 | pDrvIns->IBase.pfnQueryInterface = drvNetSnifferQueryInterface;
|
---|
331 | /* INetworkConnector */
|
---|
332 | pThis->INetworkConnector.pfnSend = drvNetSnifferSend;
|
---|
333 | pThis->INetworkConnector.pfnSetPromiscuousMode = drvNetSnifferSetPromiscuousMode;
|
---|
334 | pThis->INetworkConnector.pfnNotifyLinkChanged = drvNetSnifferNotifyLinkChanged;
|
---|
335 | /* INetworkPort */
|
---|
336 | pThis->INetworkPort.pfnWaitReceiveAvail = drvNetSnifferWaitReceiveAvail;
|
---|
337 | pThis->INetworkPort.pfnReceive = drvNetSnifferReceive;
|
---|
338 | /* INetworkConfig */
|
---|
339 | pThis->INetworkConfig.pfnGetMac = drvNetSnifferGetMac;
|
---|
340 | pThis->INetworkConfig.pfnGetLinkState = drvNetSnifferGetLinkState;
|
---|
341 | pThis->INetworkConfig.pfnSetLinkState = drvNetSnifferSetLinkState;
|
---|
342 |
|
---|
343 | /*
|
---|
344 | * Get the filename.
|
---|
345 | */
|
---|
346 | int rc = CFGMR3QueryString(pCfgHandle, "File", pThis->szFilename, sizeof(pThis->szFilename));
|
---|
347 | if (rc == VERR_CFGM_VALUE_NOT_FOUND)
|
---|
348 | RTStrPrintf(pThis->szFilename, sizeof(pThis->szFilename), "./VBox-%x.pcap", RTProcSelf());
|
---|
349 | else if (RT_FAILURE(rc))
|
---|
350 | {
|
---|
351 | AssertMsgFailed(("Failed to query \"File\", rc=%Rrc.\n", rc));
|
---|
352 | return rc;
|
---|
353 | }
|
---|
354 |
|
---|
355 | /*
|
---|
356 | * Query the network port interface.
|
---|
357 | */
|
---|
358 | pThis->pPort = (PPDMINETWORKPORT)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_NETWORK_PORT);
|
---|
359 | if (!pThis->pPort)
|
---|
360 | {
|
---|
361 | AssertMsgFailed(("Configuration error: the above device/driver didn't export the network port interface!\n"));
|
---|
362 | return VERR_PDM_MISSING_INTERFACE_ABOVE;
|
---|
363 | }
|
---|
364 |
|
---|
365 | /*
|
---|
366 | * Query the network config interface.
|
---|
367 | */
|
---|
368 | pThis->pConfig = (PPDMINETWORKCONFIG)pDrvIns->pUpBase->pfnQueryInterface(pDrvIns->pUpBase, PDMINTERFACE_NETWORK_CONFIG);
|
---|
369 | if (!pThis->pConfig)
|
---|
370 | {
|
---|
371 | AssertMsgFailed(("Configuration error: the above device/driver didn't export the network config interface!\n"));
|
---|
372 | return VERR_PDM_MISSING_INTERFACE_ABOVE;
|
---|
373 | }
|
---|
374 |
|
---|
375 | /*
|
---|
376 | * Query the network connector interface.
|
---|
377 | */
|
---|
378 | PPDMIBASE pBaseDown;
|
---|
379 | rc = pDrvIns->pDrvHlp->pfnAttach(pDrvIns, &pBaseDown);
|
---|
380 | if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
|
---|
381 | pThis->pConnector = NULL;
|
---|
382 | else if (RT_SUCCESS(rc))
|
---|
383 | {
|
---|
384 | pThis->pConnector = (PPDMINETWORKCONNECTOR)pBaseDown->pfnQueryInterface(pBaseDown, PDMINTERFACE_NETWORK_CONNECTOR);
|
---|
385 | if (!pThis->pConnector)
|
---|
386 | {
|
---|
387 | AssertMsgFailed(("Configuration error: the driver below didn't export the network connector interface!\n"));
|
---|
388 | return VERR_PDM_MISSING_INTERFACE_BELOW;
|
---|
389 | }
|
---|
390 | }
|
---|
391 | else
|
---|
392 | {
|
---|
393 | AssertMsgFailed(("Failed to attach to driver below! rc=%Rrc\n", rc));
|
---|
394 | return rc;
|
---|
395 | }
|
---|
396 |
|
---|
397 | /*
|
---|
398 | * Create the lock.
|
---|
399 | */
|
---|
400 | rc = RTCritSectInit(&pThis->Lock);
|
---|
401 | if (RT_FAILURE(rc))
|
---|
402 | return rc;
|
---|
403 |
|
---|
404 | /*
|
---|
405 | * Open output file / pipe.
|
---|
406 | */
|
---|
407 | rc = RTFileOpen(&pThis->File, pThis->szFilename,
|
---|
408 | RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_WRITE);
|
---|
409 | if (RT_FAILURE(rc))
|
---|
410 | {
|
---|
411 | AssertMsgFailed(("Failed to create file '%s' for writing. rc=%Rrc\n", pThis->szFilename, rc));
|
---|
412 | return rc;
|
---|
413 | }
|
---|
414 |
|
---|
415 | /*
|
---|
416 | * Write pcap header.
|
---|
417 | * Some time is done since capturing pThis->StartNanoTS so capture the current time again.
|
---|
418 | */
|
---|
419 | PcapFileHdr(pThis->File, RTTimeNanoTS());
|
---|
420 |
|
---|
421 | return VINF_SUCCESS;
|
---|
422 | }
|
---|
423 |
|
---|
424 |
|
---|
425 |
|
---|
426 | /**
|
---|
427 | * Network sniffer filter driver registration record.
|
---|
428 | */
|
---|
429 | const PDMDRVREG g_DrvNetSniffer =
|
---|
430 | {
|
---|
431 | /* u32Version */
|
---|
432 | PDM_DRVREG_VERSION,
|
---|
433 | /* szDriverName */
|
---|
434 | "NetSniffer",
|
---|
435 | /* pszDescription */
|
---|
436 | "Network Sniffer Filter Driver",
|
---|
437 | /* fFlags */
|
---|
438 | PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
|
---|
439 | /* fClass. */
|
---|
440 | PDM_DRVREG_CLASS_NETWORK,
|
---|
441 | /* cMaxInstances */
|
---|
442 | 1,
|
---|
443 | /* cbInstance */
|
---|
444 | sizeof(DRVNETSNIFFER),
|
---|
445 | /* pfnConstruct */
|
---|
446 | drvNetSnifferConstruct,
|
---|
447 | /* pfnDestruct */
|
---|
448 | drvNetSnifferDestruct,
|
---|
449 | /* pfnIOCtl */
|
---|
450 | NULL,
|
---|
451 | /* pfnPowerOn */
|
---|
452 | NULL,
|
---|
453 | /* pfnReset */
|
---|
454 | NULL,
|
---|
455 | /* pfnSuspend */
|
---|
456 | NULL,
|
---|
457 | /* pfnResume */
|
---|
458 | NULL,
|
---|
459 | /* pfnDetach */
|
---|
460 | NULL,
|
---|
461 | /* pfnPowerOff */
|
---|
462 | NULL
|
---|
463 | };
|
---|
464 |
|
---|