concast.base
Interface UserAPI

All Known Implementing Classes:
Merged

public interface UserAPI


Method Summary
 boolean cancelTimer()
          Remove timer for current tag (DEC), if any returns true if was removed false, if it was not found in any case, after calling this method there are no more timers are pending for current tag (DEC)
 void debug(java.lang.String s)
          Print logging message, for user only
 void debugOFF()
          Turn debugging of current merged off.
 void debugON()
          Turn debug option on.
 void enableUNL(boolean update)
          Disable/Enable UNL updates.
 byte[] getByteArray(java.lang.String name)
           
 javax.crypto.Cipher getCipherDec()
          Retrieve (decryption) cipher from the flow state
 javax.crypto.Cipher getCipherEnc()
          Retrieves (encryption) cipher from the flow state
 javax.crypto.Mac getCipherMac()
          Retrieve mac cipher from the flow state
 long getCurrentTag()
          Returns current value of tag
 long getDEClimit()
          Returns MAX_ACTIVE_DECS as described in the draft Maximum amount of per-flow state kept at a node
 int getInt(java.lang.String name)
           
 long getLong(java.lang.String name)
           
 int getMyID()
          Returns ID to identify current node (currently it is based on the IP address
 byte[] getSecretEncKey()
          Returns secret key for data encryption/decryption.
 byte[] getSecretKey()
          Returns secret key material for generating secret keys.
 boolean getSecretKeyUpdated()
          Returns true, if the secret key has been updated and sets this flag to false.
 byte[] getSecretMacKey()
          Returns secret key for secure-hash mac.
 long getSenderID()
          Returns upstream neighbor ID of the current incoming packet.
 long getTimer()
          Returns absolute number of milliseconds - time at which second part of the packet processing (buildAndFwdIfDone) has been scheduled, or 0 if it has not been scheduled
 UNL getUNL()
          Returns Upstream Neighbor List
 void logUdp(java.lang.String s)
          Print the message to the UDP socket.
 boolean putByteArray(java.lang.String name, byte[] value)
           
 boolean putCipherDec(javax.crypto.Cipher c)
          Store decryption cipher in the flow state.
 boolean putCipherEnc(javax.crypto.Cipher c)
          Allows to store initialized (encryption) cipher in the flow state.
 boolean putCipherMac(javax.crypto.Mac m)
          Store mac cipher in the flow state.
 boolean putInt(java.lang.String name, int value)
          The following 6 method are used to store and retrieve data in the flow state.
 boolean putLong(java.lang.String name, long value)
           
 boolean setTimer(long time)
          This method can only be called from user done() method.
 

Method Detail

getTimer

public long getTimer()
Returns absolute number of milliseconds - time at which second part of the packet processing (buildAndFwdIfDone) has been scheduled, or 0 if it has not been scheduled

setTimer

public boolean setTimer(long time)
This method can only be called from user done() method. Calling this methods tell merged : "I'm not ready to build a message right now. I want to try again at time (absolute in milliseconds)". At that time (or a soon as possible after) the second part of the packet processing will be performed. returns true, if time was setup return false, otherwise

cancelTimer

public boolean cancelTimer()
Remove timer for current tag (DEC), if any returns true if was removed false, if it was not found in any case, after calling this method there are no more timers are pending for current tag (DEC)

getDEClimit

public long getDEClimit()
Returns MAX_ACTIVE_DECS as described in the draft Maximum amount of per-flow state kept at a node

getUNL

public UNL getUNL()
           throws java.io.IOException
Returns Upstream Neighbor List

enableUNL

public void enableUNL(boolean update)
Disable/Enable UNL updates.

getCurrentTag

public long getCurrentTag()
Returns current value of tag

getMyID

public int getMyID()
Returns ID to identify current node (currently it is based on the IP address

putInt

public boolean putInt(java.lang.String name,
                      int value)
The following 6 method are used to store and retrieve data in the flow state. This data can be shared between multiple DECs. put*() method returns true, if value has been stored in the flow state and false if it has not been stored, in the case of exceeding memory for the flow state

putLong

public boolean putLong(java.lang.String name,
                       long value)

putByteArray

public boolean putByteArray(java.lang.String name,
                            byte[] value)

getInt

public int getInt(java.lang.String name)

getLong

public long getLong(java.lang.String name)

getByteArray

public byte[] getByteArray(java.lang.String name)

getSenderID

public long getSenderID()
Returns upstream neighbor ID of the current incoming packet. This method is only available from gettag() and merge() methods, and only in first time calls of done(), buildmsg() methods, that are executed when the packet first arrives. Call of this method from any other done() or buildmsg() methods returns 0 (because merged does not store this id). This ID is one of ID's in the UNL list.

getSecretKey

public byte[] getSecretKey()
Returns secret key material for generating secret keys. This key is supplied by the receiver and is passed by the CSPD

getSecretEncKey

public byte[] getSecretEncKey()
Returns secret key for data encryption/decryption. This key is supplied by the receiver and is passed by the CSPD

getSecretMacKey

public byte[] getSecretMacKey()
Returns secret key for secure-hash mac. This key is supplied by the receiver and is passed by the CSPD

getSecretKeyUpdated

public boolean getSecretKeyUpdated()
Returns true, if the secret key has been updated and sets this flag to false. Otherwise, returns false.

putCipherEnc

public boolean putCipherEnc(javax.crypto.Cipher c)
Allows to store initialized (encryption) cipher in the flow state. This is used for optimization (to initialize cipher only once).

getCipherEnc

public javax.crypto.Cipher getCipherEnc()
Retrieves (encryption) cipher from the flow state

putCipherDec

public boolean putCipherDec(javax.crypto.Cipher c)
Store decryption cipher in the flow state.

getCipherDec

public javax.crypto.Cipher getCipherDec()
Retrieve (decryption) cipher from the flow state

putCipherMac

public boolean putCipherMac(javax.crypto.Mac m)
Store mac cipher in the flow state.

getCipherMac

public javax.crypto.Mac getCipherMac()
Retrieve mac cipher from the flow state

debugON

public void debugON()
Turn debug option on. Will create a log file and print log messages of the current merged, when rcsp is in debugging mode

debugOFF

public void debugOFF()
Turn debugging of current merged off.

debug

public void debug(java.lang.String s)
Print logging message, for user only

logUdp

public void logUdp(java.lang.String s)
Print the message to the UDP socket. Added for the Darpa demo in Jan 2003