ANTS v2.0 API

ants.dante
Class DanteCapsule

java.lang.Object
  |
  +--ants.core.Capsule
        |
        +--ants.dante.DanteCapsule

public final class DanteCapsule
extends Capsule
implements DanteConstants

Negotiates a dynamic address on behalf of an ABONE edge node. This capsule must operate at the so-called virtual-link layer because tunnels and routes have not yet been established. This class takes some liberties with the official DANTE header specification. For example, the core virtual link layer address is not passed.

Author:
Andrew Whitaker

Fields inherited from class ants.core.Capsule
MAX_TTL
 
Fields inherited from interface ants.dante.DanteConstants
DANTE_CLIENT_PORT, DANTE_SERVER_PORT, DANTE_VERSION, ERROR, INIT, JOIN, KEEP_ALIVE_FREQUENCY, LEAVE, MAX_FAILURES, REFRESH, RESPONSE, TIMEOUT, UNDEFINED
 
Constructor Summary
DanteCapsule()
           
DanteCapsule(int type, int coreAddress, int edgeAddress, java.lang.String edgePhysAddress, java.lang.String edgeProtocol)
           
 
Method Summary
 Xdr decode()
          Decode a capsule header from this Capsule's xdr field.
 Xdr encode()
          Encode this capsule's header into a new Xdr.
 boolean evaluate(Node n)
          The forwarding routine for the Capsule.
 int getCoreVNA()
           
 java.lang.String getEdgePhysAddress()
           
 java.lang.String getEdgeProtocol()
           
 int getEdgeVNA()
           
 int getType()
           
 int length()
          Return the length of the capsule header that all capsule encodings will include.
 byte[] mid()
           
 byte[] pid()
           
 void setCoreVNA(int a)
           
 void setEdgeVNA(int a)
           
 void setType(int type)
           
 
Methods inherited from class ants.core.Capsule
create, encodeCapsuleForSend, findExtension, findMID, findPID, getDst, getPrevious, getSrc, getTTL, prime, setDst, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DanteCapsule

public DanteCapsule()

DanteCapsule

public DanteCapsule(int type,
                    int coreAddress,
                    int edgeAddress,
                    java.lang.String edgePhysAddress,
                    java.lang.String edgeProtocol)
Method Detail

mid

public byte[] mid()

pid

public byte[] pid()

setEdgeVNA

public void setEdgeVNA(int a)

getEdgeVNA

public int getEdgeVNA()

getCoreVNA

public int getCoreVNA()

setCoreVNA

public void setCoreVNA(int a)

getEdgePhysAddress

public java.lang.String getEdgePhysAddress()

getEdgeProtocol

public java.lang.String getEdgeProtocol()

getType

public int getType()

setType

public void setType(int type)

evaluate

public boolean evaluate(Node n)
Description copied from class: Capsule
The forwarding routine for the Capsule. This is invoked by the router when a capsule is received.

This method should not access other Java classes, and should only interact with the local system through the local node interface. This routine should "terminate quickly."

XXX perhaps default to forwarding the Capsule?

Overrides:
evaluate in class Capsule
Tags copied from class: Capsule
Parameters:
node - the local node interface
Returns:
an indicationof whether the forwarding was successful.

encode

public Xdr encode()
Description copied from class: Capsule
Encode this capsule's header into a new Xdr. Return the new Xdr.

Because this header must go first in the Xdr, this encoder unilaterally sets the xdr buffer pointer to the beginning of the buffer and writes its data there.

The format of the Xdr is:

 MethodID         (16 bytes)
 src address      ( 4 bytes)
 dst address      ( 4 bytes)
 previous address ( 4 bytes)
 TTL              ( 4 bytes)
 
Overrides:
encode in class Capsule
Tags copied from class: Capsule
Returns:
the new Xdr representing this capsule.
See Also:
#xdr

decode

public Xdr decode()
Description copied from class: Capsule
Decode a capsule header from this Capsule's xdr field.
Overrides:
decode in class Capsule
Tags copied from class: Capsule
Returns:
the new Xdr based on the current xdr.

length

public int length()
Description copied from class: Capsule
Return the length of the capsule header that all capsule encodings will include.
Overrides:
length in class Capsule
Tags copied from class: Capsule
Returns:
the length of the capsule header

ANTS v2.0 API

This documentation is Copyright (C) 1998-2001 The University of Utah and the University of Washington. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for ANTS v2.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/