Package org.pcap4j.packet
Class ArpPacket.ArpHeader
- java.lang.Object
-
- org.pcap4j.packet.AbstractPacket.AbstractHeader
-
- org.pcap4j.packet.ArpPacket.ArpHeader
-
- All Implemented Interfaces:
java.io.Serializable
,Packet.Header
- Enclosing class:
- ArpPacket
public static final class ArpPacket.ArpHeader extends AbstractPacket.AbstractHeader
- Author:
- Kaito Yamada
- See Also:
- Serialized Form
-
-
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.boolean
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one using return values ofgetRawData()
.MacAddress
getDstHardwareAddr()
java.net.InetAddress
getDstProtocolAddr()
byte
getHardwareAddrLength()
int
getHardwareAddrLengthAsInt()
ArpHardwareType
getHardwareType()
ArpOperation
getOperation()
byte
getProtocolAddrLength()
int
getProtocolAddrLengthAsInt()
EtherType
getProtocolType()
protected java.util.List<byte[]>
getRawFields()
Returns a list of byte arrays which represents this header's fields.MacAddress
getSrcHardwareAddr()
java.net.InetAddress
getSrcProtocolAddr()
int
length()
Returns the header length in bytes.-
Methods inherited from class org.pcap4j.packet.AbstractPacket.AbstractHeader
buildHexString, buildRawData, calcLength, getRawData, hashCode, toHexString, toString
-
-
-
-
Method Detail
-
getHardwareType
public ArpHardwareType getHardwareType()
- Returns:
- hardwareType
-
getProtocolType
public EtherType getProtocolType()
- Returns:
- protocolType
-
getHardwareAddrLength
public byte getHardwareAddrLength()
- Returns:
- hardwareAddrLength
-
getHardwareAddrLengthAsInt
public int getHardwareAddrLengthAsInt()
- Returns:
- hardwareAddrLength
-
getProtocolAddrLength
public byte getProtocolAddrLength()
- Returns:
- protocolAddrLength
-
getProtocolAddrLengthAsInt
public int getProtocolAddrLengthAsInt()
- Returns:
- protocolAddrLength
-
getOperation
public ArpOperation getOperation()
- Returns:
- operation
-
getSrcHardwareAddr
public MacAddress getSrcHardwareAddr()
- Returns:
- srcHardwareAddr
-
getSrcProtocolAddr
public java.net.InetAddress getSrcProtocolAddr()
- Returns:
- srcProtocolAddr
-
getDstHardwareAddr
public MacAddress getDstHardwareAddr()
- Returns:
- dstHardwareAddr
-
getDstProtocolAddr
public java.net.InetAddress getDstProtocolAddr()
- Returns:
- dstProtocolAddr
-
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
-
length
public int length()
Description copied from class:AbstractPacket.AbstractHeader
Returns the header length in bytes. This method callscalcLength()
and caches the return value when it is called for the first time, and then, this method returns the cached value from the second time.- Specified by:
length
in interfacePacket.Header
- Overrides:
length
in classAbstractPacket.AbstractHeader
- Returns:
- the length of the byte stream of the header represented by this object in bytes
-
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
-
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
-
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
-
-