shaohua_project.sweep.routing
Class SweepRouting

java.lang.Object
  extended by shaohua_project.sweep.routing.SweepRouting
All Implemented Interfaces:
JistAPI.Proxiable, JistAPI.Timeless, NetInterface.NetHandler, RouteInterface

public class SweepRouting
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
SweepRouting(Node myNode)
          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, Region region)
           
 Location2D getVertex(Region region, boolean closest)
           
 void handle_MessageData(NetMessage msg)
           
 void handle_MessageQueryP2P(NetMessage msg)
           
 void handle_MessageSourceDiscovery(NetMessage msg)
           
 void handle_MessageSweepRequest(Message msg)
           
 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)
           
 void sendToLinkLayer(Message msg, NetAddress originalSourceIP, NetAddress finalDestinationIP, NetAddress nextHopDestIP)
           
 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

SweepRouting

public SweepRouting(Node myNode)
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

handle_MessageQueryP2P

public void handle_MessageQueryP2P(NetMessage msg)

handle_MessageSourceDiscovery

public void handle_MessageSourceDiscovery(NetMessage msg)

handle_MessageData

public void handle_MessageData(NetMessage msg)

handle_MessageSweepRequest

public void handle_MessageSweepRequest(Message msg)

getThroughShortestPath

public NetAddress getThroughShortestPath(Location2D destLocation,
                                         Region region)

getVertex

public Location2D getVertex(Region region,
                            boolean closest)

sendToAppLayer

public void sendToAppLayer(Message msg,
                           NetAddress src)

sendToLinkLayer

public void sendToLinkLayer(Message msg,
                            NetAddress originalSourceIP,
                            NetAddress finalDestinationIP,
                            NetAddress nextHopDestIP)

sendToLinkLayer

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

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()