jist.swans.route
Class RouteDsrMsg.OptionRouteRequest

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

public static class RouteDsrMsg.OptionRouteRequest
extends RouteDsrMsg.Option

A Route Request option.


Field Summary
 
Fields inherited from class jist.swans.route.RouteDsrMsg.Option
optBuf, optBufOffset
 
Constructor Summary
RouteDsrMsg.OptionRouteRequest(byte[] buf, int offset)
          
 
Method Summary
static byte[] create(short id, NetAddress target, NetAddress[] addrs)
          Creates a new Route Request option.
 NetAddress getAddress(int n)
          Returns the nth address listed in the route request option, counting from zero.
 short getId()
          Returns the identification number of this route request.
 int getNumAddresses()
          Returns the number of addresses listed in the route request option (not includingd the target address).
 int getSize()
          Returns the size in bytes of this option.
 NetAddress getTargetAddress()
          Returns the target address of this route request.
 byte getType()
          Returns the DSR type code for this kind of option.
 
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.OptionRouteRequest

public RouteDsrMsg.OptionRouteRequest(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.

getId

public short getId()
Returns the identification number of this route request.

Returns:
the identification number of this route request.

getTargetAddress

public NetAddress getTargetAddress()
Returns the target address of this route request.

Returns:
the target address of this route request.

getNumAddresses

public int getNumAddresses()
Returns the number of addresses listed in the route request option (not includingd the target address).

Returns:
the number of addresses listed in the route request option (not including the target address).

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 Request
Returns:
the address indexed by n.

create

public static byte[] create(short id,
                            NetAddress target,
                            NetAddress[] addrs)
Creates a new Route Request option.

Parameters:
id - the identification number of the route request
target - the address of the node being searched for
addrs - the addresses of the nodes that have forwarded this request
Returns:
the byte array corresponding to the desired option.