net.sourceforge.jpcap.net
Class ICMPPacket
java.lang.Object
|
+--net.sourceforge.jpcap.net.Packet
|
+--net.sourceforge.jpcap.net.EthernetPacket
|
+--net.sourceforge.jpcap.net.IPPacket
|
+--net.sourceforge.jpcap.net.ICMPPacket
- All Implemented Interfaces:
- EthernetFields, ICMPFields, IPFields
- public class ICMPPacket
- extends IPPacket
- implements ICMPFields
An ICMP packet.
Extends an IP packet, adding an ICMP header and ICMP data payload.
Fields inherited from interface net.sourceforge.jpcap.net.IPFields |
IP_CODE_LEN, IP_CODE_POS, IP_CSUM_LEN, IP_CSUM_POS, IP_DST_POS, IP_FRAG_LEN, IP_FRAG_POS, IP_HEADER_LEN, IP_ID_LEN, IP_ID_POS, IP_LEN_LEN, IP_LEN_POS, IP_SRC_POS, IP_TOS_LEN, IP_TOS_POS, IP_TTL_LEN, IP_TTL_POS, IP_VER_LEN, IP_VER_POS |
Constructor Summary |
ICMPPacket(int lLen,
byte[] bytes)
|
Methods inherited from class net.sourceforge.jpcap.net.IPPacket |
getDestinationAddress, getFragmentFlags, getFragmentOffset, getHeaderLength, getId, getLength, getProtocol, getSourceAddress, getTimeToLive, getTypeOfService, getVersion, toVerboseString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ICMPPacket
public ICMPPacket(int lLen,
byte[] bytes)
getHeader
public byte[] getHeader()
- Fetch the icmp header, excluding icmp data payload.
- Overrides:
getHeader
in class IPPacket
getData
public byte[] getData()
- Fetch data portion of the icmp header.
- Overrides:
getData
in class IPPacket
getMessageCode
public int getMessageCode()
- Fetch the ICMP message type, including subcode. Return value can be
used with ICMPMessage.getDescription().
- Returns:
- a 2-byte value containing the message type in the high byte
and the message type subcode in the low byte.
getMessageMajorCode
public int getMessageMajorCode()
- Fetch the ICMP message type code. Formerly .getMessageType().
getMessageType
public int getMessageType()
- For backward compatibility. @deprecated use getMessageMajorCode().
getMessageMinorCode
public int getMessageMinorCode()
- Fetch the ICMP message subcode.
getChecksum
public int getChecksum()
- Fetch the ICMP header checksum.
- Overrides:
getChecksum
in class IPPacket
toString
public java.lang.String toString()
- Convert this ICMP packet to a readable string.
- Overrides:
toString
in class IPPacket