- java.lang.Object
-
- org.pcap4j.packet.AbstractPacket
-
- org.pcap4j.packet.LlcPacket
-
public final class LlcPacket extends AbstractPacket
LLC (Logical Link Control) Packet- Since:
- pcap4j 1.6.5
- See Also:
- IEEE 802.2, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLlcPacket.Builderstatic interfaceLlcPacket.LlcControlThe interface representing the Control field of an LLC header.static classLlcPacket.LlcHeaderLLC (Logical Link Control) Header-
Nested classes/interfaces inherited from class org.pcap4j.packet.AbstractPacket
AbstractPacket.AbstractBuilder, AbstractPacket.AbstractHeader
-
Nested classes/interfaces inherited from interface org.pcap4j.packet.Packet
Packet.Header
-
-
Field Summary
Fields Modifier and Type Field Description private LlcPacket.LlcHeaderheaderprivate Packetpayloadprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description privateLlcPacket(byte[] rawData, int offset, int length)privateLlcPacket(LlcPacket.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LlcPacket.BuildergetBuilder()Returns a new Builder object populated with this object's fields' values.LlcPacket.LlcHeadergetHeader()Returns the Header object representing this packet's header.PacketgetPayload()Returns the Packet object representing this packet's payload.static LlcPacketnewPacket(byte[] rawData, int offset, int length)A static factory method.-
Methods inherited from class org.pcap4j.packet.AbstractPacket
buildHexString, buildRawData, buildString, calcHashCode, calcLength, contains, equals, get, getOuterOf, getRawData, hashCode, iterator, length, toHexString, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
header
private final LlcPacket.LlcHeader header
-
payload
private final Packet payload
-
-
Constructor Detail
-
LlcPacket
private LlcPacket(byte[] rawData, int offset, int length) throws IllegalRawDataException- Throws:
IllegalRawDataException
-
LlcPacket
private LlcPacket(LlcPacket.Builder builder)
-
-
Method Detail
-
newPacket
public static LlcPacket newPacket(byte[] rawData, int offset, int length) throws IllegalRawDataException
A static factory method. This method validates the arguments byByteArrays.validateBounds(byte[], int, int), which may throw exceptions undocumented here.- Parameters:
rawData- rawDataoffset- offsetlength- length- Returns:
- a new LlcPacket object.
- Throws:
IllegalRawDataException- if parsing the raw data fails.
-
getHeader
public LlcPacket.LlcHeader getHeader()
Description copied from class:AbstractPacketReturns the Header object representing this packet's header. This subclass have to override this method if the packet represented by the subclass has a header.- Specified by:
getHeaderin interfacePacket- Overrides:
getHeaderin classAbstractPacket- Returns:
- the Header object representing this packet's header. May be null if the header doesn't exist
-
getPayload
public Packet getPayload()
Description copied from class:AbstractPacketReturns the Packet object representing this packet's payload. This subclass have to override this method if the packet represented by the subclass has a payload.- Specified by:
getPayloadin interfacePacket- Overrides:
getPayloadin classAbstractPacket- Returns:
- the Packet object representing this packet's payload. May be null if the payload doesn't exist
-
getBuilder
public LlcPacket.Builder getBuilder()
Description copied from interface:PacketReturns a new Builder object populated with this object's fields' values.- Specified by:
getBuilderin interfacePacket- Specified by:
getBuilderin classAbstractPacket- Returns:
- a new Builder object populated with this object's fields values
-
-