java.lang.Object
org.pcap4j.packet.AbstractPacket.AbstractHeader
org.pcap4j.packet.Dot11ManagementPacket.Dot11ManagementHeader
- All Implemented Interfaces:
Serializable,Packet.Header
- Direct Known Subclasses:
Dot11ProbeRequestPacket.Dot11ProbeRequestHeader
- Enclosing class:
Dot11ManagementPacket
public abstract static class Dot11ManagementPacket.Dot11ManagementHeader
extends AbstractPacket.AbstractHeader
Header of IEEE802.11 management frame
0 15 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Frame Control | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Duration | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Address1 | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Address2 | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Address3 | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Control | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HT Control | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Since:
- pcap4j 1.7.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MacAddressprivate static final intprivate static final intprivate final MacAddressprivate static final intprivate static final intprivate final MacAddressprivate static final intprivate static final intprivate static final intprivate final shortprivate static final intprivate static final intprivate static final intprivate static final intprivate final Dot11FrameControlprivate static final intprivate static final intprivate final Dot11HtControlprivate static final intprivate static final intprivate final Dot11SequenceControlprivate static final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDot11ManagementHeader(byte[] rawData, int offset, int length) protected -
Method Summary
Modifier and TypeMethodDescriptionprotected StringThis method builds the valuetoString()will return.protected intThis method builds the valuehashCode()will return using the byte arraygetRawData()returns.intThis method calculates the valuelength()will return by adding up the lengths of byte arrays in the listgetRawFields()returns.booleanIndicates whether some other object is "equal to" this one using return values ofgetRawData().shortintprotected abstract Stringprotected List<byte[]> Returns a list of byte arrays which represents this header's fields.Methods inherited from class org.pcap4j.packet.AbstractPacket.AbstractHeader
buildHexString, buildRawData, getRawData, hashCode, length, toHexString, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FRAME_CONTROL_OFFSET
private static final int FRAME_CONTROL_OFFSET- See Also:
-
FRAME_CONTROL_SIZE
private static final int FRAME_CONTROL_SIZE- See Also:
-
DURATION_OFFSET
private static final int DURATION_OFFSET- See Also:
-
DURATION_SIZE
private static final int DURATION_SIZE- See Also:
-
ADDRESS1_OFFSET
private static final int ADDRESS1_OFFSET- See Also:
-
ADDRESS1_SIZE
private static final int ADDRESS1_SIZE- See Also:
-
ADDRESS2_OFFSET
private static final int ADDRESS2_OFFSET- See Also:
-
ADDRESS2_SIZE
private static final int ADDRESS2_SIZE- See Also:
-
ADDRESS3_OFFSET
private static final int ADDRESS3_OFFSET- See Also:
-
ADDRESS3_SIZE
private static final int ADDRESS3_SIZE- See Also:
-
SEQUENCE_CONTROL_OFFSET
private static final int SEQUENCE_CONTROL_OFFSET- See Also:
-
SEQUENCE_CONTROL_SIZE
private static final int SEQUENCE_CONTROL_SIZE- See Also:
-
HT_CONTROL_OFFSET
private static final int HT_CONTROL_OFFSET- See Also:
-
HT_CONTROL_SIZE
private static final int HT_CONTROL_SIZE- See Also:
-
DOT11_HEADER_MIN_SIZE
private static final int DOT11_HEADER_MIN_SIZE- See Also:
-
frameControl
-
duration
private final short duration -
address1
-
address2
-
address3
-
sequenceControl
-
htControl
-
-
Constructor Details
-
Dot11ManagementHeader
protected Dot11ManagementHeader(byte[] rawData, int offset, int length) throws IllegalRawDataException - Parameters:
rawData- rawDataoffset- offsetlength- length- Throws:
IllegalRawDataException- if parsing the raw data fails.
-
Dot11ManagementHeader
- Parameters:
builder- builder
-
-
Method Details
-
getFrameControl
- Returns:
- frameControl
-
getDuration
public short getDuration()- Returns:
- duration
-
getDurationAsInt
public int getDurationAsInt()- Returns:
- duration
-
getAddress1
- Returns:
- address1
-
getAddress2
- Returns:
- address2
-
getAddress3
- Returns:
- address3
-
getSequenceControl
- Returns:
- sequenceControl
-
getHtControl
- Returns:
- htControl. May be null.
-
getRawFields
Description copied from class:AbstractPacket.AbstractHeaderReturns a list of byte arrays which represents this header's fields. This method is called bycalcLength()andbuildRawData().- Specified by:
getRawFieldsin classAbstractPacket.AbstractHeader- Returns:
- a list of byte arrays which represents this header's fields
-
calcLength
public int calcLength()Description copied from class:AbstractPacket.AbstractHeaderThis method calculates the valuelength()will return by adding up the lengths of byte arrays in the listgetRawFields()returns.- Overrides:
calcLengthin classAbstractPacket.AbstractHeader- Returns:
- a calculated length
-
getHeaderName
- Returns:
- the header name.
-
buildString
Description copied from class:AbstractPacket.AbstractHeaderThis method builds the valuetoString()will return.- Overrides:
buildStringin classAbstractPacket.AbstractHeader- Returns:
- a string representation of this object
-
calcHashCode
protected int calcHashCode()Description copied from class:AbstractPacket.AbstractHeaderThis method builds the valuehashCode()will return using the byte arraygetRawData()returns. This method may be better to be overridden for performance reason.- Overrides:
calcHashCodein classAbstractPacket.AbstractHeader- Returns:
- a calculated hash code value for the object
-
equals
Description copied from class:AbstractPacket.AbstractHeaderIndicates whether some other object is "equal to" this one using return values ofgetRawData(). This method should be overridden so that it does more strict comparisons more efficiently.- Overrides:
equalsin classAbstractPacket.AbstractHeader
-