sidnet.stack.users.marco_project.commons
Class HeartbeatProtocol

java.lang.Object
  extended by sidnet.stack.users.marco_project.commons.HeartbeatProtocol
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, Protocol, NetInterface.NetHandler, RouteInterface, RouteInterface.HeartbeatProtocol

public class HeartbeatProtocol
extends java.lang.Object
implements RouteInterface.HeartbeatProtocol


Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.swans.route.RouteInterface
RouteInterface.Aodv, RouteInterface.BezierRouting, RouteInterface.Dsr, RouteInterface.ECGRIDRouting, RouteInterface.GenericRouting, RouteInterface.HeartbeatProtocol, RouteInterface.MultiTreeRouting, RouteInterface.RandomPathRouting, RouteInterface.ShortestPathRouting, RouteInterface.Zrp
 
Constructor Summary
HeartbeatProtocol(NetAddress localAddr, Node myNode, PanelContext hostPanelContext, long beatInterval)
          Creates a new instance of HeartbeatProtocol
 
Method Summary
 void dropNotify(Message msg, MacAddress nextHopMac, Reason reason)
          Notification mechanism for packet dropped due to various "Reasons"
 RouteInterface.HeartbeatProtocol getProxy()
           
 void peek(NetMessage msg, MacAddress lastHopMac)
          Called by the network layer for every incoming packet.
 void receive(Message msg, NetAddress src, MacAddress lastHop, byte macId, NetAddress dst, byte priority, byte ttl)
          Receive a message from network layer.
 void send(NetMessage msg)
          Send a message through the routing protocol
 void setNetEntity(NetInterface netEntity)
           
 void start()
          Start running protocol.
 void wakeAndBeat(long beatInterval, boolean wakeAndBeatStarted)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeartbeatProtocol

public HeartbeatProtocol(NetAddress localAddr,
                         Node myNode,
                         PanelContext hostPanelContext,
                         long beatInterval)
Creates a new instance of HeartbeatProtocol

Method Detail

dropNotify

public void dropNotify(Message msg,
                       MacAddress nextHopMac,
                       Reason reason)
Description copied from interface: NetInterface.NetHandler
Notification mechanism for packet dropped due to various "Reasons"

Specified by:
dropNotify in interface NetInterface.NetHandler

peek

public void peek(NetMessage msg,
                 MacAddress lastHopMac)
Description copied from interface: RouteInterface
Called by the network layer for every incoming packet. A routing implementation may wish to look at these packets for informational purposes, but should not change their contents.

Specified by:
peek in interface RouteInterface
Parameters:
msg - incoming packet
lastHopMac - last link-level hop of incoming packet

send

public void send(NetMessage msg)
Description copied from interface: NetInterface.NetHandler
Send a message through the routing protocol

Specified by:
send in interface NetInterface.NetHandler
Specified by:
send in interface RouteInterface
Parameters:
msg - outgoing packet

wakeAndBeat

public void wakeAndBeat(long beatInterval,
                        boolean wakeAndBeatStarted)
Specified by:
wakeAndBeat in interface RouteInterface.HeartbeatProtocol

receive

public void receive(Message msg,
                    NetAddress src,
                    MacAddress lastHop,
                    byte macId,
                    NetAddress dst,
                    byte priority,
                    byte ttl)
Description copied from interface: NetInterface.NetHandler
Receive a message from network layer.

Specified by:
receive in interface NetInterface.NetHandler
Parameters:
msg - message received
src - source network address
lastHop - source link address
macId - incoming interface
dst - destination network address
priority - packet priority
ttl - packet time-to-live

getProxy

public RouteInterface.HeartbeatProtocol getProxy()

setNetEntity

public void setNetEntity(NetInterface netEntity)

start

public void start()
Description copied from interface: Protocol
Start running protocol.

Specified by:
start in interface Protocol