Package org.pcap4j.packet
Class Dot11ManagementPacket.Dot11ManagementHeader
- 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
- Author:
- Kaito Yamada
- See Also:
- IEEE802.11, Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Dot11ManagementHeader(byte[] rawData, int offset, int length)
protected
Dot11ManagementHeader(Dot11ManagementPacket.Builder builder)
-
Method Summary
Modifier and Type Method Description protected java.lang.String
buildString()
This method builds the valuetoString()
will return.protected int
calcHashCode()
This method builds the valuehashCode()
will return using the byte arraygetRawData()
returns.int
calcLength()
This method calculates the valuelength()
will return by adding up the lengths of byte arrays in the listgetRawFields()
returns.boolean
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one using return values ofgetRawData()
.MacAddress
getAddress1()
MacAddress
getAddress2()
MacAddress
getAddress3()
short
getDuration()
int
getDurationAsInt()
Dot11FrameControl
getFrameControl()
protected abstract java.lang.String
getHeaderName()
Dot11HtControl
getHtControl()
protected java.util.List<byte[]>
getRawFields()
Returns a list of byte arrays which represents this header's fields.Dot11SequenceControl
getSequenceControl()
-
Methods inherited from class org.pcap4j.packet.AbstractPacket.AbstractHeader
buildHexString, buildRawData, getRawData, hashCode, length, toHexString, toString
-
-
-
-
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.AbstractHeader
Returns a list of byte arrays which represents this header's fields. This method is called bycalcLength()
andbuildRawData()
.- Specified by:
getRawFields
in classAbstractPacket.AbstractHeader
- Returns:
- a list of byte arrays which represents this header's fields
-
calcLength
public int calcLength()
Description copied from class:AbstractPacket.AbstractHeader
This method calculates the valuelength()
will return by adding up the lengths of byte arrays in the listgetRawFields()
returns.- Overrides:
calcLength
in 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.AbstractHeader
This method builds the valuetoString()
will return.- Overrides:
buildString
in classAbstractPacket.AbstractHeader
- Returns:
- a string representation of this object
-
calcHashCode
protected int calcHashCode()
Description copied from class:AbstractPacket.AbstractHeader
This method builds the valuehashCode()
will return using the byte arraygetRawData()
returns. This method may be better to be overridden for performance reason.- Overrides:
calcHashCode
in classAbstractPacket.AbstractHeader
- Returns:
- a calculated hash code value for the object
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:AbstractPacket.AbstractHeader
Indicates 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:
equals
in classAbstractPacket.AbstractHeader
-
-