jist.swans.route
Class RouteDsrMsg.OptionRouteError

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

public static class RouteDsrMsg.OptionRouteError
extends RouteDsrMsg.Option

A Route Error option.


Field Summary
 
Fields inherited from class jist.swans.route.RouteDsrMsg.Option
optBuf, optBufOffset
 
Constructor Summary
RouteDsrMsg.OptionRouteError(byte[] buf, int offset)
          
 
Method Summary
static byte[] create(byte type, int salvage, NetAddress src, NetAddress dest, byte[] tsi)
          Creates a new Route Error option.
 NetAddress getDestAddress()
          Returns the destination of this Route Error.
 int getErrorType()
          Returns the error code contained in this Route Error.
 int getSalvageCount()
          Returns the salvage count of this Route Error.
 int getSize()
          Returns the size in bytes of this option.
 NetAddress getSourceAddress()
          Returns the source of this Route Error.
 byte getType()
          Returns the DSR type code for this kind of option.
 int getTypeSpecificInfoBytes(byte[] buf, int offset)
          Returns the type-specific information contained in this Route Error.
 int getTypeSpecificInfoSize()
          Returns the size in bytes of any type-specific information contained in this Route Error.
 
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.OptionRouteError

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

getErrorType

public int getErrorType()
Returns the error code contained in this Route Error.

Returns:
the error code contained in this Route Error.

getSalvageCount

public int getSalvageCount()
Returns the salvage count of this Route Error.

Returns:
the salvage count of this Route Error.

getSourceAddress

public NetAddress getSourceAddress()
Returns the source of this Route Error.

Returns:
the source of this Route Error.

getDestAddress

public NetAddress getDestAddress()
Returns the destination of this Route Error.

Returns:
the destination of this Route Error.

getTypeSpecificInfoSize

public int getTypeSpecificInfoSize()
Returns the size in bytes of any type-specific information contained in this Route Error.

Returns:
the size in bytes of the type-specific information.

getTypeSpecificInfoBytes

public int getTypeSpecificInfoBytes(byte[] buf,
                                    int offset)
Returns the type-specific information contained in this Route Error.

Parameters:
buf - the byte array to copy the type-specific information into
offset - the offset into buf where copying should begin
Returns:
the number of bytes copied into buf.

create

public static byte[] create(byte type,
                            int salvage,
                            NetAddress src,
                            NetAddress dest,
                            byte[] tsi)
Creates a new Route Error option.

Parameters:
type - the code corresponding to the type of error being reported
salvage - the salvage count
src - the source address of the error
dest - the destination address of the error
tsi - any type-specific information for this error
Returns:
the byte array corresponding to the desired option.