大网数据广告活动
网络与域名解析

Writing a Driver to Capture PPP Frames

· 52CE 我爱测

This document explains how to develop a driver that can capture PPP frames in Windows Vista before they are compressed/encrypted in the send path or after they are decompressed/decrypted in the receive path.

When Point-to-Point Protocol (PPP) frames are sent through a Point-to-Point Tunneling Protocol (PPTP) tunnel with encryption turned on, or through a Layer 2 Tunneling Protocol (L2TP) tunnel that uses IPSec for encryption, the typical PPP frame capture utility can only capture PPP frames that have an encrypted protocol identity field. This document explains how to develop a driver that can capture PPP frames in Windows Vista before they are compressed/encrypted in the send path or after they are decompressed/decrypted in the receive path.

  1. Write an NDIS protocol driver. For details, see NDIS 6.0 Protocol Drivers or NDIS Protocol Drivers (NDIS 5.1).

  2. Install the driver with a hardware identity of "ms_netmon". For detailed instructions on how to install the driver with a specific hardware identity, see INF Models Section.

    [!Note]
    Each Windows Vista machine permits the installation of only one driver entity that has the "ms_netmon" hardware identity. To install another driver with this identity, the first driver must be uninstalled. A driver that is installed without using the "ms_netmon" hardware identity cannot perform the binding needed to capture PPP frames.

  3. The protocol driver should specify "ndiswanbh" as the binding interface for capturing PPP frames. For detailed instructions, see Specifying Binding Interfaces.

  4. The ProtocolBindAdapter implementation in the driver should support "NdisMediumWan" as a part of the medium array, so that it can open the ndiswanbh miniport edge using the NdisOpenAdapter function.

  5. If the ProtocolOpenAdapterComplete function is called with status NDIS_STATUS_SUCCESS, the protocol driver should set the OID_GEN_CURRENT_PACKET_FILTER OID with the flags NDIS_PACKET_TYPE_PROMISCUOUS and NDIS_PACKET_TYPE_ALL_LOCAL over this binding. Once this is done, the protocol driver will receive the decrypted PPP frames from the PPP framing layer in its ProtocolReceive function.

Note:
This information only applies to drivers on a Windows Vista machine.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。