Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

# Packet.c File Reference

`#include "stdarg.h"`
`#include "ntddk.h"`
`#include "ntiologc.h"`
`#include "ndis.h"`
`#include "ntddpack.h"`
`#include "debug.h"`
`#include "packet.h"`
`#include "win_bpf.h"`
`#include "win_bpf_filter_init.h"`
`#include "tme.h"`

Go to the source code of this file.

## Functions
NTSTATUS | DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
| The initialization routine of the driver.
PWCHAR | getAdaptersList (void)
PKEY_VALUE_PARTIAL_INFORMATION | getTcpBindings (void)
BOOLEAN | createDevice (IN OUT PDRIVER_OBJECT adriverObjectP, IN PUNICODE_STRING amacNameP, NDIS_HANDLE aProtoHandle)
| Creates a device for a given MAC.
VOID | NPF_Unload (IN PDRIVER_OBJECT DriverObject)
| Function called by the OS when NPF is unloaded.
NTSTATUS | NPF_IoControl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
| Handles the IOCTL calls.
VOID | NPF_RequestComplete (IN NDIS_HANDLE ProtocolBindingContext, IN PNDIS_REQUEST NdisRequest, IN NDIS_STATUS Status)
| Ends an OID request.
VOID | NPF_Status (IN NDIS_HANDLE ProtocolBindingContext, IN NDIS_STATUS Status, IN PVOID StatusBuffer, IN UINT StatusBufferSize)
| Callback for NDIS StatusHandler. Not used by NPF.
VOID | NPF_StatusComplete (IN NDIS_HANDLE ProtocolBindingContext)
| Callback for NDIS StatusCompleteHandler. Not used by NPF.
NTSTATUS | NPF_ReadRegistry (IN PWSTR *MacDriverName, IN PWSTR *PacketDriverName, IN PUNICODE_STRING RegistryPath)
| Reads the registry keys associated woth NPF if the driver is manually installed via the control panel.
NTSTATUS | NPF_QueryRegistryRoutine (IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
| Function used by NPF_ReadRegistry() to quesry the registry keys associated woth NPF if the driver is manually installed via the control panel.
## Variables
PDEVICE_EXTENSION | GlobalDeviceExtension
NDIS_STRING | NPF_Prefix = NDIS_STRING_CONST("NPF_")
NDIS_STRING | devicePrefix = NDIS_STRING_CONST("\\Device\\")
NDIS_STRING | symbolicLinkPrefix = NDIS_STRING_CONST("\\DosDevices\\")
NDIS_STRING | tcpLinkageKeyName
NDIS_STRING | AdapterListKey
NDIS_STRING | bindValueName = NDIS_STRING_CONST("Bind")
WCHAR * | bindP = NULL
| Global variable that points to the names of the bound adapters.
time_conv | G_Start_Time
| Global start time. Used as an absolute reference for timestamp conversion.
NDIS_SPIN_LOCK | Opened_Instances_Lock
ULONG | NCpu
ULONG | TimestampMode

## Function Documentation

PWCHAR getAdaptersList | ( | void |  | ) |

| Definition at line 212 of file Packet.c. References AdapterListKey, and tcpLinkageKeyName. Referenced by DriverEntry().

PKEY_VALUE_PARTIAL_INFORMATION getTcpBindings | ( | void |  | ) |

| Definition at line 354 of file Packet.c. References bindValueName, and tcpLinkageKeyName. Referenced by DriverEntry().

## Variable Documentation

NDIS_STRING AdapterListKey

| Initial value:
     NDIS_STRING_CONST("\\Registry\\Machine\\System"
                                    L"\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}")
Definition at line 63 of file Packet.c. Referenced by getAdaptersList().

WCHAR* bindP = NULL

| Global variable that points to the names of the bound adapters. Definition at line 68 of file Packet.c. Referenced by DriverEntry(), and NPF_Unload().

NDIS_STRING bindValueName = NDIS_STRING_CONST("Bind")

| Definition at line 65 of file Packet.c. Referenced by getTcpBindings().

NDIS_STRING devicePrefix = NDIS_STRING_CONST("\\Device\\")

| Definition at line 59 of file Packet.c. Referenced by createDevice().

struct time_conv G_Start_Time

| Global start time. Used as an absolute reference for timestamp conversion. Definition at line 70 of file Packet.c.

PDEVICE_EXTENSION GlobalDeviceExtension

| Definition at line 53 of file Packet.c.

ULONG NCpu

| Definition at line 74 of file Packet.c. Referenced by DriverEntry(), NPF_IoControl(), NPF_Read(), and NPF_tap().

NDIS_STRING NPF_Prefix = NDIS_STRING_CONST("NPF_")

| Definition at line 58 of file Packet.c. Referenced by createDevice().

NDIS_SPIN_LOCK Opened_Instances_Lock

| Definition at line 72 of file Packet.c. Referenced by DriverEntry(), NPF_CloseAdapterComplete(), and NPF_OpenAdapterComplete().

NDIS_STRING symbolicLinkPrefix = NDIS_STRING_CONST("\\DosDevices\\")

| Definition at line 60 of file Packet.c. Referenced by createDevice().

NDIS_STRING tcpLinkageKeyName

| Initial value:
     NDIS_STRING_CONST("\\Registry\\Machine\\System"
                                    L"\\CurrentControlSet\\Services\\Tcpip\\Linkage")
Definition at line 61 of file Packet.c. Referenced by getAdaptersList(), and getTcpBindings().

ULONG TimestampMode

| Definition at line 76 of file Packet.c.

documentation. Copyright (c) 2002-2003 Politecnico di Torino. All rights reserved.