public static final class IpV4Packet.IpV4Header extends AbstractPacket.AbstractHeader
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildString()
This method builds the value
toString() will return. |
protected int |
calcHashCode()
This method builds the value
hashCode() will return using
the byte array getRawData() returns. |
protected int |
calcLength()
This method calculates the value
length() will return by
adding up the lengths of byte arrays in the list
getRawFields() returns. |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one using
return values of
getRawData(). |
boolean |
getDontFragmentFlag() |
Inet4Address |
getDstAddr() |
short |
getFragmentOffset() |
short |
getHeaderChecksum() |
short |
getIdentification() |
int |
getIdentificationAsInt() |
byte |
getIhl() |
int |
getIhlAsInt() |
boolean |
getMoreFragmentFlag() |
List<IpV4Packet.IpV4Option> |
getOptions() |
byte[] |
getPadding() |
IpNumber |
getProtocol() |
protected List<byte[]> |
getRawFields()
Returns a list of byte arrays which represents this header's fields.
|
boolean |
getReservedFlag() |
Inet4Address |
getSrcAddr() |
IpV4Packet.IpV4Tos |
getTos() |
short |
getTotalLength() |
int |
getTotalLengthAsInt() |
byte |
getTtl() |
int |
getTtlAsInt() |
IpVersion |
getVersion() |
boolean |
hasValidChecksum(boolean acceptZero) |
buildHexString, buildRawData, getRawData, hashCode, length, toHexString, toStringpublic IpVersion getVersion()
public byte getIhl()
public int getIhlAsInt()
public IpV4Packet.IpV4Tos getTos()
public short getTotalLength()
public int getTotalLengthAsInt()
public short getIdentification()
public int getIdentificationAsInt()
public boolean getReservedFlag()
public boolean getDontFragmentFlag()
public boolean getMoreFragmentFlag()
public short getFragmentOffset()
public byte getTtl()
public int getTtlAsInt()
public IpNumber getProtocol()
public short getHeaderChecksum()
public Inet4Address getSrcAddr()
public Inet4Address getDstAddr()
public List<IpV4Packet.IpV4Option> getOptions()
public byte[] getPadding()
public boolean hasValidChecksum(boolean acceptZero)
acceptZero - acceptZeroprotected List<byte[]> getRawFields()
AbstractPacket.AbstractHeadercalcLength()
and buildRawData().getRawFields in class AbstractPacket.AbstractHeaderprotected int calcLength()
AbstractPacket.AbstractHeaderlength() will return by
adding up the lengths of byte arrays in the list
getRawFields() returns.calcLength in class AbstractPacket.AbstractHeaderprotected String buildString()
AbstractPacket.AbstractHeadertoString() will return.buildString in class AbstractPacket.AbstractHeaderpublic boolean equals(Object obj)
AbstractPacket.AbstractHeadergetRawData().
This method should be overridden so that it does more strict comparisons
more efficiently.equals in class AbstractPacket.AbstractHeaderprotected int calcHashCode()
AbstractPacket.AbstractHeaderhashCode() will return using
the byte array getRawData() returns.
This method may be better to be overridden for performance reason.calcHashCode in class AbstractPacket.AbstractHeaderCopyright © 2011–2016 Pcap4J.org. All rights reserved.