Changeset 25966 in vbox for trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp
- Timestamp:
- Jan 22, 2010 11:15:43 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56818
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp
r25893 r25966 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VBox network devices: 4 * Network sniffer filter driver 3 * DrvNetSniffer - Network sniffer filter driver. 5 4 */ 6 5 7 6 /* 8 * Copyright (C) 2006-20 07Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 9 8 * 10 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 30 29 #include <VBox/log.h> 31 30 #include <iprt/assert.h> 31 #include <iprt/critsect.h> 32 32 #include <iprt/file.h> 33 33 #include <iprt/process.h> 34 34 #include <iprt/string.h> 35 35 #include <iprt/time.h> 36 #include <iprt/ critsect.h>36 #include <iprt/uuid.h> 37 37 #include <VBox/param.h> 38 38 … … 46 46 /** 47 47 * Block driver instance data. 48 * 49 * @implements PDMINETWORKCONNECTOR 50 * @implements PDMINETWORKPORT 51 * @implements PDMINETWORKCONFIG 48 52 */ 49 53 typedef struct DRVNETSNIFFER … … 248 252 249 253 /** 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 } 254 * @interface_method_impl{PDMIBASE,pfnQueryInterface} 255 */ 256 static DECLCALLBACK(void *) drvNetSnifferQueryInterface(PPDMIBASE pInterface, const char *pszIID) 257 { 258 PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface); 259 PDRVNETSNIFFER pThis = PDMINS_2_DATA(pDrvIns, PDRVNETSNIFFER); 260 if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0) 261 return &pDrvIns->IBase; 262 if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONNECTOR) == 0) 263 return &pThis->INetworkConnector; 264 if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_PORT) == 0) 265 return &pThis->INetworkPort; 266 if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_NETWORK_CONFIG) == 0) 267 return &pThis->INetworkConfig; 268 return NULL; 275 269 } 276 270
Note:
See TracChangeset
for help on using the changeset viewer.