public static final class IpV4Packet.IpV4Header extends AbstractPacket.AbstractHeader implements IpPacket.IpHeader
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.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(java.lang.Object obj)
Indicates whether some other object is "equal to" this one using
return values of
getRawData(). |
boolean |
getDontFragmentFlag() |
java.net.Inet4Address |
getDstAddr() |
short |
getFragmentOffset() |
short |
getHeaderChecksum() |
short |
getIdentification() |
int |
getIdentificationAsInt() |
byte |
getIhl() |
int |
getIhlAsInt() |
boolean |
getMoreFragmentFlag() |
java.util.List<IpV4Packet.IpV4Option> |
getOptions() |
byte[] |
getPadding() |
IpNumber |
getProtocol() |
protected java.util.List<byte[]> |
getRawFields()
Returns a list of byte arrays which represents this header's fields.
|
boolean |
getReservedFlag() |
java.net.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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetRawData, lengthpublic IpVersion getVersion()
getVersion in interface IpPacket.IpHeaderpublic 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()
getProtocol in interface IpPacket.IpHeaderpublic short getHeaderChecksum()
public java.net.Inet4Address getSrcAddr()
getSrcAddr in interface IpPacket.IpHeaderpublic java.net.Inet4Address getDstAddr()
getDstAddr in interface IpPacket.IpHeaderpublic java.util.List<IpV4Packet.IpV4Option> getOptions()
public byte[] getPadding()
public boolean hasValidChecksum(boolean acceptZero)
acceptZero - acceptZeroprotected java.util.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 java.lang.String buildString()
AbstractPacket.AbstractHeadertoString() will return.buildString in class AbstractPacket.AbstractHeaderpublic boolean equals(java.lang.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 - 2018 Pcap4J.org. All rights reserved.