net.floodlightcontroller.packet
Class ICMP
java.lang.Object
net.floodlightcontroller.packet.BasePacket
net.floodlightcontroller.packet.ICMP
- All Implemented Interfaces:
- IPacket
public class ICMP
- extends BasePacket
Implements ICMP packet format
- Author:
- shudong.zhou@bigswitch.com
Constructor Summary |
ICMP()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
icmpType
protected byte icmpType
icmpCode
protected byte icmpCode
checksum
protected short checksum
paddingMap
public static final java.util.Map<java.lang.Byte,java.lang.Short> paddingMap
ECHO_REPLY
public static final byte ECHO_REPLY
- See Also:
- Constant Field Values
ECHO_REQUEST
public static final byte ECHO_REQUEST
- See Also:
- Constant Field Values
TIME_EXCEEDED
public static final byte TIME_EXCEEDED
- See Also:
- Constant Field Values
DESTINATION_UNREACHABLE
public static final byte DESTINATION_UNREACHABLE
- See Also:
- Constant Field Values
CODE_PORT_UNREACHABLE
public static final byte CODE_PORT_UNREACHABLE
- See Also:
- Constant Field Values
ICMP
public ICMP()
getIcmpType
public byte getIcmpType()
- Returns:
- the icmpType
setIcmpType
public ICMP setIcmpType(byte icmpType)
- Parameters:
icmpType
- to set
getIcmpCode
public byte getIcmpCode()
- Returns:
- the icmp code
setIcmpCode
public ICMP setIcmpCode(byte icmpCode)
- Parameters:
icmpCode
- code to set
getChecksum
public short getChecksum()
- Returns:
- the checksum
setChecksum
public ICMP setChecksum(short checksum)
- Parameters:
checksum
- the checksum to set
serialize
public byte[] serialize()
- Serializes the packet. Will compute and set the following fields if they
are set to specific values at the time serialize is called:
-checksum : 0
-length : 0
- Returns:
- a byte[] containing this packet and payloads
hashCode
public int hashCode()
- Overrides:
hashCode
in class BasePacket
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class BasePacket
deserialize
public IPacket deserialize(byte[] data,
int offset,
int length)
throws PacketParsingException
- Description copied from interface:
IPacket
- Deserializes this packet layer and all possible payloads
offset
- offset to start deserializing fromlength
- length of the data to deserialize
- Returns:
- the deserialized data
- Throws:
PacketParsingException