sidnet.stack.users.triggers_project.routing
Class ShortestGeographicalPathRouting

java.lang.Object
  extended by sidnet.stack.users.triggers_project.routing.ShortestGeographicalPathRouting
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, NetInterface.NetHandler, RouteInterface

public class ShortestGeographicalPathRouting
extends java.lang.Object
implements RouteInterface


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
 
Field Summary
static byte ERROR
           
static byte SUCCESS
           
 
Constructor Summary
ShortestGeographicalPathRouting(Node myNode, StatsCollector stats)
          Creates a new instance of ShortestGeographicalPathRouting
 
Method Summary
 void dropNotify(Message msg, MacAddress nextHopMac, Reason reason)
          Notification mechanism for packet dropped due to various "Reasons"
 RouteInterface getProxy()
           
 NetAddress getThroughShortestPath(Location2D destLocation)
           
 void peek(NetMessage msg, MacAddress lastHopMac)
          SWANS legacy.
 void receive(Message msg, NetAddress src, MacAddress lastHop, byte macId, NetAddress dst, byte priority, byte ttl)
          Receive a message from the network layer This method is typically called when this node is the ultimate destination of an incoming data-message (the sink)
 void send(NetMessage msg)
          Send a message This method is being called when a message, comming from either the application layer or the mac layer, needs to be forwarded
 void sendToAppLayer(Message msg, NetAddress src)
           
 byte sendToLinkLayer(NetMessage.Ip ipMsg, NetAddress nextHopDestIP)
           
 void setAppInterface(AppInterface appInterface)
           
 void setNetEntity(NetInterface netEntity)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final byte ERROR
See Also:
Constant Field Values

SUCCESS

public static final byte SUCCESS
See Also:
Constant Field Values
Constructor Detail

ShortestGeographicalPathRouting

public ShortestGeographicalPathRouting(Node myNode,
                                       StatsCollector stats)
Creates a new instance of ShortestGeographicalPathRouting

Parameters:
Node - the SIDnet node handle to access its GUI-primitives and shared environment
Method Detail

peek

public void peek(NetMessage msg,
                 MacAddress lastHopMac)
SWANS legacy. We no longer enable this

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

receive

public void receive(Message msg,
                    NetAddress src,
                    MacAddress lastHop,
                    byte macId,
                    NetAddress dst,
                    byte priority,
                    byte ttl)
Receive a message from the network layer This method is typically called when this node is the ultimate destination of an incoming data-message (the sink)

Specified by:
receive in interface NetInterface.NetHandler
Parameters:
Message - the incomming message
NetAddress - the original source of the message
MacAddress - the MAC address 1-hop neighbor from which this nodes received this message
macId - the macId interface through which this message was received
NetAddress - the IP address of the ultimate node destination (this)
priority - the priority of the incoming message
ttl - Time To Leave

send

public void send(NetMessage msg)
Send a message This method is being called when a message, comming from either the application layer or the mac layer, needs to be forwarded

Specified by:
send in interface NetInterface.NetHandler
Specified by:
send in interface RouteInterface
Parameters:
NetMessage - the 'NetMessage' wrapped Message

sendToAppLayer

public void sendToAppLayer(Message msg,
                           NetAddress src)

sendToLinkLayer

public byte sendToLinkLayer(NetMessage.Ip ipMsg,
                            NetAddress nextHopDestIP)

getThroughShortestPath

public NetAddress getThroughShortestPath(Location2D destLocation)

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

getProxy

public RouteInterface getProxy()

setNetEntity

public void setNetEntity(NetInterface netEntity)

setAppInterface

public void setAppInterface(AppInterface appInterface)

start

public void start()