Class fi.hut.tcm.jacob.tcpip.icmp.IcmpChecksumState
java.lang.Object
|
+--fi.hut.tcm.jacob.tcpip.icmp.IcmpChecksumState
- public class IcmpChecksumState
- extends java.lang.Object
- implements fi.hut.tcm.jacob.conduits.State
IcmpChecksumState
Provides the entry points for incoming and outgoing messages. The
entry points (methods applyFromNet and applyToNet) calls the
appropriate Messenger methods for handling the ICMP checksum. Either
calculating and adding the checksum if the ICMP message is an outgoing
one, or validating the ICMP checksum if the ICMP message is an incoming
one.
Method Summary
|
boolean
|
applyFromNet(fi.hut.tcm.jacob.conduits.Message message,
fi.hut.tcm.jacob.conduits.Messenger messenger)
An entry point for messages coming from the net. |
void
|
applyToNet(fi.hut.tcm.jacob.conduits.Message message,
fi.hut.tcm.jacob.conduits.Messenger messenger)
An entry point for messages coming from the net. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
instance
public static IcmpChecksumState instance
- A
final
reference to the state. There can only be one
instance of each State
.
applyFromNet
public boolean applyFromNet(fi.hut.tcm.jacob.conduits.Message message,
fi.hut.tcm.jacob.conduits.Messenger messenger)
- An entry point for messages coming from the net. Validates the ICMP
packet checksum using methods provided by the
Messenger
.
- Parameters:
message
- which Message
to apply
messenger
- the Messenger
of this
Message
message
- the message to apply operations on
messenger
- which messenger
applyToNet
public void applyToNet(fi.hut.tcm.jacob.conduits.Message message,
fi.hut.tcm.jacob.conduits.Messenger messenger)
- An entry point for messages coming from the net. Validates the ICMP
packet checksum using methods provided by the
Messenger
.
- Parameters:
message
- the message to apply operations on
messenger
- which messenger