SourceForge Jpcap

net.sourceforge.jpcap.net
Interface IP.ICMP

All Known Implementing Classes:
ICMPPacket
Enclosing interface:
IP

public static interface IP.ICMP

ICMP (Internet Control Message Protocol) API interface.

Since:
2.0.0
Version:
$Revision: 1.1 $
Author:
Esmond Pitt

Method Summary
 int getICMPChecksum()
          Fetch the ICMP checksum.
 byte[] getICMPData()
          Fetch the ICMP data as a byte array.
 byte[] getICMPHeader()
          Fetch the ICMP header as a byte array.
 int getMessageCode()
          Fetch the ICMP message type, including subcode.
 int getMessageMajorCode()
          Fetch the ICMP message type code.
 int getMessageMinorCode()
          Fetch the ICMP message subcode.
 void setMessageCode(short code)
          Set the ICMP message code and subcode (16 bits) as per getMessageCode().
 

Method Detail

getICMPHeader

byte[] getICMPHeader()
Fetch the ICMP header as a byte array. Modifying this byte array has no effect on the packet.

Returns:
the ICMP header.

getICMPData

byte[] getICMPData()
Fetch the ICMP data as a byte array. Modifying this byte array has no effect on the packet.

Returns:
the ICMP data

getMessageCode

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.

setMessageCode

void setMessageCode(short code)
Set the ICMP message code and subcode (16 bits) as per getMessageCode().

Parameters:
code - 2-byte code value.

getMessageMajorCode

int getMessageMajorCode()
Fetch the ICMP message type code.

Returns:
the ICMP message type code.
Since:
2.0.0.

getMessageMinorCode

int getMessageMinorCode()
Fetch the ICMP message subcode.

Returns:
the ICMP message subcode.

getICMPChecksum

int getICMPChecksum()
Fetch the ICMP checksum.

Returns:
the ICMP checksum.

Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008.