Npcap Documentation
repository·master·Indexed 25 days ago
https://github.com/nmap/npcapA high-performance packet capture and injection library for Windows developed by the Nmap Project as a modern successor to WinPcap. Compatible with Windows 7 through 11, it provides the wpcap.dll API for development and supports features such as nanosecond-precision timestamps via PACKET_MODE_NANO and driver statistics via PacketGetInfo().
What's inside Npcap
- Npcap is a packet capture and injection library for Windows developed by the Nmap Project. It serves as a modern, maintained replacement for the unmaintained WinPcap project, offering improved speed, reliability, and security. It is compatible with Windows 7, 8, 8.1, 10, and 11.
Download Npcap installer, SDK, and source
masterThe latest Npcap installers, Software Development Kits (SDK), source code, and debug symbols are available for download at the official Npcap website.
https://npcap.com/#downloadAccess the Npcap HTML documentation
masterThe full, detailed Npcap documentation is available in HTML format at the official website. This guide contains comprehensive information regarding installation, API usage, and development details.
https://npcap.com/guide/Get link speed information
masterThe
PacketGetNetType()function now always sets theLinkSpeedfield to 0. If your software requires link speed information, use one of the following instead:pcap_oid_get_request()GetAdaptersAddresses()
Report Npcap bugs
masterBugs and issues should be reported via the GitHub issues tracker. When reporting a bug, you should include:
- The output from the DiagReport tool.
- The version of the user software being used (e.g., Nmap, Wireshark).
- Clear steps to reproduce the issue.
- Any other relevant technical information.
https://github.com/nmap/npcap/issuesCheck supported BPF extensions with NPF_GETINFO_BPFEXT
masterUse
PacketGetInfo()with theNPF_GETINFO_BPFEXTconstant to determine which BPF extensions the driver supports.Supported extensions include:
SKF_AD_VLAN_TAGSKF_AD_VLAN_TAG_PRESENT
Note: These constants have the same meanings as the Linux kernel's BPF extensions of the same names.
Enable nanosecond-precision timestamps with PACKET_MODE_NANO
masterYou can enable nanosecond-precision timestamps on a packet handle by using the
PACKET_MODE_NANOmode with thePacketSetMode()orpcap_setmode()functions.Requirement: Requires Npcap 1.83 driver or later.
Retrieve driver information and statistics using PacketGetInfo()
masterThe
PacketGetInfo()function allows you to issue information requests to the Npcap driver using thePACKET_OID_DATAstructure.Available Request Constants:
NPF_GETINFO_VERSION: Retrieves the version.NPF_GETINFO_CONFIG: Retrieves configuration information.NPF_GETINFO_BPFEXT: Determines which BPF extensions are supported by the driver.NPF_GETINFO_MODES: Returns supported mode bits forPacketSetMode().NPF_GETINFO_STATS: Retrieves performance statistics for the filter module.NPF_GETINFO_MODDBG: Retrieves internal debugging info unique to a filter module.
Requirement:
NPF_GETINFO_MODES,NPF_GETINFO_STATS, andNPF_GETINFO_MODDBGrequire Npcap 1.84 driver or later.Get the Packet.dll runtime version
masterTo get the runtime version of the
Packet.dlllibrary, use thePacketGetVersion()function.Note: The undocumented
char PacketLibraryVersion[]export has been removed;PacketGetVersion()is the documented and preferred method.Configure SendToRx mode via PacketSetMode()
masterTo enable or disable the SendToRx feature independently of systemwide Registry settings, use the following modes with
PacketSetMode()orpcap_setmode():MODE_SENDTORX: Enables the SendToRx feature.MODE_SENDTORX_CLEAR: Disables the SendToRx feature.
Requirement: Requires Npcap 1.83 driver or later.
Avoid using the packet.dll API
masterThe examples provided in thePacketDriverdirectory utilize thepacket.dllAPI. However, the use of thepacket.dllAPI is strongly discouraged. Developers should use thewpcap.dllAPI instead for Npcap development.Understand the Npcap License
masterThe Npcap License allows end users to download, install, and use Npcap for free on up to 5 systems, including for commercial usage.
Software providers (open source or otherwise) that wish to use Npcap functionality are encouraged to direct their users to npcap.com to download and install the library.
For enterprise features like a silent installer, commercial support, and special license rights, users can purchase Npcap OEM.