jist.swans.route
Class RouteDsrMsg.OptionRouteReply

java.lang.Object
  extended by jist.swans.route.RouteDsrMsg.Option
      extended by jist.swans.route.RouteDsrMsg.OptionRouteReply
Enclosing class:
RouteDsrMsg

public static class RouteDsrMsg.OptionRouteReply
extends RouteDsrMsg.Option

A Route Reply option.


Field Summary
 
Fields inherited from class jist.swans.route.RouteDsrMsg.Option
optBuf, optBufOffset
 
Constructor Summary
RouteDsrMsg.OptionRouteReply(byte[] buf, int offset)
          
 
Method Summary
static byte[] create(boolean lastHopExternal, NetAddress[] addrs)
          Creates a new Route Reply option.
static byte[] create(NetAddress[] addrs)
          Creates a new Route Reply option with the Last Hop External field set to false.
 NetAddress getAddress(int n)
          Returns the nth address listed in the route request option, counting from zero.
 int getNumAddresses()
          Returns the number of addresses listed in the Route Reply option.
 int getSize()
          Returns the size in bytes of this option.
 byte getType()
          Returns the DSR type code for this kind of option.
 boolean isLastHopExternal()
          Determines whether the last hop of the path is external.
 
Methods inherited from class jist.swans.route.RouteDsrMsg.Option
create, equals, getBytes, getType, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouteDsrMsg.OptionRouteReply

public RouteDsrMsg.OptionRouteReply(byte[] buf,
                                    int offset)

Method Detail

getType

public byte getType()
Returns the DSR type code for this kind of option.

Specified by:
getType in class RouteDsrMsg.Option
Returns:
the DSR type code for this kind of option.

getSize

public int getSize()
Returns the size in bytes of this option.

Specified by:
getSize in class RouteDsrMsg.Option
Returns:
the size in bytes of this option.

isLastHopExternal

public boolean isLastHopExternal()
Determines whether the last hop of the path is external.

Returns:
whether the last hop of this route is external.

getNumAddresses

public int getNumAddresses()
Returns the number of addresses listed in the Route Reply option.

Returns:
the number of addresses listed in the Route Reply option.

getAddress

public NetAddress getAddress(int n)
Returns the nth address listed in the route request option, counting from zero.

Parameters:
n - the index into the route
Returns:
the address indexed by n.

create

public static byte[] create(boolean lastHopExternal,
                            NetAddress[] addrs)
Creates a new Route Reply option.

Parameters:
lastHopExternal - whether the last hop in the route is external
addrs - the addresses of the nodes in the route
Returns:
the byte array corresponding to the desired option.

create

public static byte[] create(NetAddress[] addrs)
Creates a new Route Reply option with the Last Hop External field set to false.

Parameters:
addrs - the addresses of the nodes in the route
Returns:
the byte array corresponding to the desired option.