- java.lang.Object
-
- org.pcap4j.packet.AbstractPacket.AbstractHeader
-
- org.pcap4j.packet.Dot11ManagementPacket.Dot11ManagementHeader
-
- All Implemented Interfaces:
java.io.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 frame0 15 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Frame Control | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Duration | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Address1 | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Address2 | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Address3 | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Sequence Control | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HT Control | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Since:
- pcap4j 1.7.0
- See Also:
- IEEE802.11, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private MacAddressaddress1private static intADDRESS1_OFFSETprivate static intADDRESS1_SIZEprivate MacAddressaddress2private static intADDRESS2_OFFSETprivate static intADDRESS2_SIZEprivate MacAddressaddress3private static intADDRESS3_OFFSETprivate static intADDRESS3_SIZEprivate static intDOT11_HEADER_MIN_SIZEprivate shortdurationprivate static intDURATION_OFFSETprivate static intDURATION_SIZEprivate static intFRAME_CONTROL_OFFSETprivate static intFRAME_CONTROL_SIZEprivate Dot11FrameControlframeControlprivate static intHT_CONTROL_OFFSETprivate static intHT_CONTROL_SIZEprivate Dot11HtControlhtControlprivate static intSEQUENCE_CONTROL_OFFSETprivate static intSEQUENCE_CONTROL_SIZEprivate Dot11SequenceControlsequenceControlprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protectedDot11ManagementHeader(byte[] rawData, int offset, int length)protectedDot11ManagementHeader(Dot11ManagementPacket.Builder builder)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringbuildString()This method builds the valuetoString()will return.protected intcalcHashCode()This method builds the valuehashCode()will return using the byte arraygetRawData()returns.intcalcLength()This method calculates the valuelength()will return by adding up the lengths of byte arrays in the listgetRawFields()returns.booleanequals(java.lang.Object obj)Indicates whether some other object is "equal to" this one using return values ofgetRawData().MacAddressgetAddress1()MacAddressgetAddress2()MacAddressgetAddress3()shortgetDuration()intgetDurationAsInt()Dot11FrameControlgetFrameControl()protected abstract java.lang.StringgetHeaderName()Dot11HtControlgetHtControl()protected java.util.List<byte[]>getRawFields()Returns a list of byte arrays which represents this header's fields.Dot11SequenceControlgetSequenceControl()-
Methods inherited from class org.pcap4j.packet.AbstractPacket.AbstractHeader
buildHexString, buildRawData, getRawData, hashCode, length, toHexString, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
FRAME_CONTROL_OFFSET
private static final int FRAME_CONTROL_OFFSET
- See Also:
- Constant Field Values
-
FRAME_CONTROL_SIZE
private static final int FRAME_CONTROL_SIZE
- See Also:
- Constant Field Values
-
DURATION_OFFSET
private static final int DURATION_OFFSET
- See Also:
- Constant Field Values
-
DURATION_SIZE
private static final int DURATION_SIZE
- See Also:
- Constant Field Values
-
ADDRESS1_OFFSET
private static final int ADDRESS1_OFFSET
- See Also:
- Constant Field Values
-
ADDRESS1_SIZE
private static final int ADDRESS1_SIZE
- See Also:
- Constant Field Values
-
ADDRESS2_OFFSET
private static final int ADDRESS2_OFFSET
- See Also:
- Constant Field Values
-
ADDRESS2_SIZE
private static final int ADDRESS2_SIZE
- See Also:
- Constant Field Values
-
ADDRESS3_OFFSET
private static final int ADDRESS3_OFFSET
- See Also:
- Constant Field Values
-
ADDRESS3_SIZE
private static final int ADDRESS3_SIZE
- See Also:
- Constant Field Values
-
SEQUENCE_CONTROL_OFFSET
private static final int SEQUENCE_CONTROL_OFFSET
- See Also:
- Constant Field Values
-
SEQUENCE_CONTROL_SIZE
private static final int SEQUENCE_CONTROL_SIZE
- See Also:
- Constant Field Values
-
HT_CONTROL_OFFSET
private static final int HT_CONTROL_OFFSET
- See Also:
- Constant Field Values
-
HT_CONTROL_SIZE
private static final int HT_CONTROL_SIZE
- See Also:
- Constant Field Values
-
DOT11_HEADER_MIN_SIZE
private static final int DOT11_HEADER_MIN_SIZE
- See Also:
- Constant Field Values
-
frameControl
private final Dot11FrameControl frameControl
-
duration
private final short duration
-
address1
private final MacAddress address1
-
address2
private final MacAddress address2
-
address3
private final MacAddress address3
-
sequenceControl
private final Dot11SequenceControl sequenceControl
-
htControl
private final Dot11HtControl htControl
-
-
Constructor Detail
-
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
protected Dot11ManagementHeader(Dot11ManagementPacket.Builder builder)
- Parameters:
builder- builder
-
-
Method Detail
-
getFrameControl
public Dot11FrameControl getFrameControl()
- Returns:
- frameControl
-
getDuration
public short getDuration()
- Returns:
- duration
-
getDurationAsInt
public int getDurationAsInt()
- Returns:
- duration
-
getAddress1
public MacAddress getAddress1()
- Returns:
- address1
-
getAddress2
public MacAddress getAddress2()
- Returns:
- address2
-
getAddress3
public MacAddress getAddress3()
- Returns:
- address3
-
getSequenceControl
public Dot11SequenceControl getSequenceControl()
- Returns:
- sequenceControl
-
getHtControl
public Dot11HtControl getHtControl()
- Returns:
- htControl. May be null.
-
getRawFields
protected java.util.List<byte[]> 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
protected abstract java.lang.String getHeaderName()
- Returns:
- the header name.
-
buildString
protected java.lang.String 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
public boolean equals(java.lang.Object obj)
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
-
-