sidnet.stack.users.waspsample.routing
Class TreeRouting
java.lang.Object
sidnet.stack.users.waspsample.routing.TreeRouting
- All Implemented Interfaces:
- JistAPI.Proxiable, JistAPI.Timeless, NetInterface.NetHandler, RouteInterface
public class TreeRouting
- 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()
|
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 |
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
myLevel
public int myLevel
TreeRouting
public TreeRouting(NetAddress localAddr,
Node myNode)
- Creates a new instance of MultiTreeRouting
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 packetlastHopMac
- 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
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 receivedsrc
- source network addresslastHop
- source link addressmacId
- incoming interfacedst
- destination network addresspriority
- packet priorityttl
- packet time-to-live
sendToAppLayer
public void sendToAppLayer(Message msg,
NetAddress src)
sendToLinkLayer
public byte sendToLinkLayer(NetMessage.Ip ipMsg,
NetAddress nextHopDestIP)
getProxy
public RouteInterface getProxy()
setNetEntity
public void setNetEntity(NetInterface netEntity)
setAppInterface
public void setAppInterface(AppInterface appInterface)
start
public void start()
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