Module com.slytechs.sdk.jnetpcap.api


module com.slytechs.sdk.jnetpcap.api
High-level packet capture and protocol dissection API for jNetPcap.

This module provides NetPcap, the primary entry point for packet capture and offline file reading. It bridges the low-level libpcap bindings in com.slytechs.sdk.jnetpcap with the protocol dissection framework in com.slytechs.sdk.protocol.core.

Key Classes

  • NetPcap - Live capture and offline file reading with integrated protocol dissection
  • PacketHandler - Callback interfaces for packet processing

Quick Start

try (NetPcap pcap = NetPcap.openOffline("capture.pcap")) {
	Ip4 ip = new Ip4();
	pcap.loop(-1, packet -> {
		if (packet.hasHeader(ip))
			System.out.println(ip.src() + " -> " + ip.dst());
	});
}

Module Dependencies

This module re-exports the following modules transitively, so consumers only need a single dependency:

  • com.slytechs.sdk.jnetpcap - Low-level libpcap FFM bindings
  • com.slytechs.sdk.protocol.core - Packet, Header, PacketSettings
  • com.slytechs.sdk.protocol.tcpip - Ethernet, IPv4, TCP, UDP and more
  • com.slytechs.sdk.common - Memory management and utilities
Author:
Mark Bednarczyk [mark@slytechs.com], Sly Technologies Inc.
See Also:
  • Packages

    Exports
    Package
    Description
    jNetPcap 3.0 API - High-performance packet capture with protocol dissection.