public final class IcmpPacket extends Object implements L4Packet, IcmpHeader
IcmpPacket class implements a cache for an ICMP instance.| Constructor and Description |
|---|
IcmpPacket(ICMP icmp)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
IcmpPacket |
clone()
Return a deep copy of this instance.
|
boolean |
commit(CachedPacketContext pctx)
Finalize modification to the packet.
|
VTNIcmpMatch |
createMatch(Set<FlowMatchType> fields)
Construct match fields to test layer 4 protocol header in this packet.
|
short |
getIcmpCode()
Return the ICMP code.
|
short |
getIcmpType()
Return the ICMP type.
|
ICMP |
getPacket()
Return a
ICMP instance configured in this instance. |
void |
setDescription(StringBuilder builder)
Set a brief description into the given string builder.
|
void |
setIcmpCode(short code)
Set the ICMP code.
|
void |
setIcmpType(short type)
Set the ICMP type.
|
boolean |
updateChecksum(Inet4Packet ipv4)
Calculate the checksum of the packet.
|
public ICMP getPacket()
ICMP instance configured in this instance.
Note that modification to the ICMP header is not applied to the
returned until commit(CachedPacketContext) is called.
getPacket in interface CachedPacketICMP instance.public boolean commit(CachedPacketContext pctx) throws VTNException
commit in interface CachedPacketpctx - The runtime context for modifying packet.true only if this packet is modified.VTNException - Failed to copy the packet.public IcmpPacket clone()
public VTNIcmpMatch createMatch(Set<FlowMatchType> fields) throws RpcException
Note that this method creates match fields that matches the original packet. Any modification to the packet is ignored.
createMatch in interface L4Packetfields - A set of FlowMatchType instances corresponding to
match fields to be tested.VTNLayer4Match instance.RpcException - This packet is broken.public boolean updateChecksum(Inet4Packet ipv4)
This method does nothing because the ICMP checksum is computed by
ICMP class.
updateChecksum in interface L4Packetipv4 - Never used.false.public short getIcmpType()
getIcmpType in interface IcmpHeaderpublic void setIcmpType(short type)
setIcmpType in interface IcmpHeadertype - A short integer value which indicates the ICMP type.public short getIcmpCode()
getIcmpCode in interface IcmpHeaderpublic void setIcmpCode(short code)
setIcmpCode in interface IcmpHeadercode - A short integer value which indicates the ICMP code.public void setDescription(StringBuilder builder)
setDescription in interface ProtocolHeaderbuilder - A StringBuilder instance.Copyright © 2018 OpenDaylight. All rights reserved.