sidnet.stack.users.triggers_project.routing
Class ShortestGeographicalPathRouting
java.lang.Object
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
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 |
ERROR
public static final byte ERROR
- See Also:
- Constant Field Values
SUCCESS
public static final byte SUCCESS
- See Also:
- Constant Field Values
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
peek
public void peek(NetMessage msg,
MacAddress lastHopMac)
- SWANS legacy. We no longer enable this
- Specified by:
peek
in interface RouteInterface
- Parameters:
msg
- incoming packetlastHopMac
- 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 messageNetAddress
- the original source of the messageMacAddress
- the MAC address 1-hop neighbor from which this nodes received this messagemacId
- the macId interface through which this message was receivedNetAddress
- the IP address of the ultimate node destination (this)priority
- the priority of the incoming messagettl
- 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()