Tutorials
Basic Reassembly
ProtocolStack stack = new ProtocolStack();
stack.getProtocol(IpProtocol.class).enableReassembly(true);
try (NetPcap pcap = NetPcap.openOffline("fragments.pcap", stack)) {
Ip4 ip = new Ip4();
pcap.loop(-1, packet -> {
if (packet.hasHeader(ip)) {
// Arrives reassembled
System.out.println("Reassembled: " + ip.totalLen());
}
});
}Tunnel Decapsulation
stack.setProtocol(new VlanProtocol()).decap();
stack.setProtocol(new GreProtocol()).decap();
// Downstream sees clean inner trafficMore tutorials will be added as features stabilize.
Last updated