public class ICMP extends BasePacket
| Modifier and Type | Field and Description |
|---|---|
protected short |
checksum |
static short |
ICMP_HEADER_LENGTH |
protected byte |
icmpCode |
protected byte |
icmpType |
static byte |
SUBTYPE_ECHO_REPLY |
static byte |
TYPE_ECHO_REPLY |
static byte |
TYPE_ECHO_REQUEST |
parent, payload| Constructor and Description |
|---|
ICMP() |
| Modifier and Type | Method and Description |
|---|---|
static Ethernet |
buildIcmpReply(Ethernet ethRequest)
Builds an ICMP reply using the supplied ICMP request.
|
static Deserializer<ICMP> |
deserializer()
Deserializer function for ICMP packets.
|
boolean |
equals(java.lang.Object obj) |
short |
getChecksum() |
byte |
getIcmpCode() |
byte |
getIcmpType() |
int |
hashCode() |
byte[] |
serialize()
Serializes the packet.
|
ICMP |
setChecksum(short checksum) |
ICMP |
setIcmpCode(byte icmpCode) |
ICMP |
setIcmpType(byte icmpType) |
java.lang.String |
toString() |
clone, getParent, getPayload, resetChecksum, setParent, setPayloadprotected byte icmpType
protected byte icmpCode
protected short checksum
public static final byte TYPE_ECHO_REQUEST
public static final byte TYPE_ECHO_REPLY
public static final byte SUBTYPE_ECHO_REPLY
public static final short ICMP_HEADER_LENGTH
public byte getIcmpType()
public ICMP setIcmpType(byte icmpType)
icmpType - to setpublic byte getIcmpCode()
public ICMP setIcmpCode(byte icmpCode)
icmpCode - code to setpublic short getChecksum()
public ICMP setChecksum(short checksum)
checksum - the checksum to setpublic byte[] serialize()
public int hashCode()
hashCode in class BasePacketpublic boolean equals(java.lang.Object obj)
equals in class BasePacketpublic static Deserializer<ICMP> deserializer()
public java.lang.String toString()
toString in class java.lang.Object