Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 1.66 KB

PacketFactory.md

File metadata and controls

23 lines (17 loc) · 1.66 KB

Packet Factory

PacketFactoryBinder

[PacketFactoryBinder](https://github.com/kaitoy/pcap4j/blob/master/pcap4j-core/src/main/java/org/pcap4j/packet/factory/PacketFactoryBinder.java) is similar to StaticLoggerBinder of SLF4J. It binds [PacketFactory](https://github.com/kaitoy/pcap4j/blob/master/pcap4j-core/src/main/java/org/pcap4j/packet/factory/PacketFactory.java) implementations to the Pcap4J Core module.

PacketFactory implementations are used to instantiate Packet classes (e.g. EthernetPacket) and packet piese classes (e.g. IpV4Rfc1349Tos) included in Pcap4J Core module, namely pcap4j-core.jar.

PacketFactoryBinder class is included in Pcap4J Core module source but it is a dummy and removed in the assembry process. Actual PacketFactoryBinder class is in Static Packet Factory module (pcap4j-packetfactory-static.jar) and Properties-Based Packet Factory (pcap4j-packetfactory-propertiesbased.jar), which also include PacketFactory implementations.

Static Packet Factory

Static Packet Factory

Properties-Based Packet Factory

Properties-Based Packet Factory