drcl.inet.contract
Class RTConfig
java.lang.Object
|
+--drcl.comp.Contract
|
+--drcl.inet.contract.RTConfig
- public class RTConfig
- extends Contract
The RouteConfiguration contract.
This contract defines five services at the reactor:
-
RTEntryAddition
- The initiator sends a request that consists of:
- an integer of value 0 (the "add" command),
- the key of the entry (
RTKey),
- the entry (
RTEntry) and
- the lifetime for the entry (
double).
The reactor adds (modifies if the entry
already exists) the entry in the routing
table and keeps the entry until the lifetime ends.
The lifetime can be nonpositive or Double.NaN to have the
entry not removed. In the case of a modification, zero lifetime
makes the reactor keep the previous lifetime setting.
-
Graft
- The initiator sends a request that has the same format as an "add" request
except that the first command field is an integer of 1 (the "graft" command).
Upon receipt of a "graft" request, the reactor modifies the route entry
as if it were an "add" request except that the reactor grafts the outgoing
interfaces specified in the route entry in the request, instead of
replacing with them.
-
Prune
- The initiator sends a request that has the same format as an "add" request
except that the first command field is an integer of 2 (the "prune" command).
Upon receipt of a "prune" request, the reactor modifies the route entry
as if it were an "add" request except that the reactor prunes the outgoing
interfaces specified in the route entry in the request, instead of
replacing with them.
-
RTEntriesRemoval
- The initiator sends a request that consists of:
- an integer of value 3 (the "remove" command),
- the key to the entries (
RTKey), and
- the method of matching the key to the keys in the routing table.
For exact match, the key in the request is used to find the entry with
exactly the same key in the routing table. For all matches, the reactor
finds all the route entries with their keys matched to only the value
(the mask field is ignored) of the key in the request. For the longest
match, the reactor finds the route entry, among all the matched entries,
with its key being matched to the value of the key in the request by
most number of bits. For wildcard match, the reactor find the route
entries with their keys' values (not including mask) matched to the
key in the request. All the entries of the matched keys are removed
and returned. In the cases of exact and longest matches, at most one
entry is returned in RTEntry. In other cases,
an array of matched entries (drcl.inet.data.RTEntry[]) are returned.
-
RTEntriesRetrieval
- The format of a retrieval request is the same as a removal except that
the first command field is an integer of 4 (the "retrieve" command).
The reactor will return all the matched entries in the same fashion as
responding a removal request except that the entries are not removed from
the routing table.
This class also provides a set of static methods to faciliate conducting the
above services
(add(...),
graft(...),
prune(...),
remove(...) and
retrieve(...)) from the specified port.
In addition, it provides a
convenient call getAllEntries(drcl.comp.Port) to get all the routing entries from
a specified port.
These methods are particularly useful in implementing
a (routing) protocol that is in charge of maintaining the routing table of
the node.
- Version:
- 1.0, 10/17/2000
- Author:
- Hung-ying Tyan
- See Also:
RTKey,
RTEntry
|
Field Summary |
static int |
ADD
The "add" command used in the "add an entry" service. |
static int |
ENTRY
|
static java.lang.Object |
EXTENSION_NO_CHANGE
|
static int |
GRAFT
The "graft" command used in the "graft" service. |
static RTConfig |
INSTANCE
|
static int |
KEY
|
static java.lang.String |
MATCH_ALL
The match-all argument used in the "remove" or "retrieve" service. |
static java.lang.String |
MATCH_EXACT
The exact match argument used in the "remove" or "retrieve" service. |
static java.lang.String |
MATCH_LONGEST
The longest match argument used in the "remove" or "retrieve" service. |
static int |
MATCH_TYPE
|
static java.lang.String |
MATCH_WILDCARD
The wildcard match argument used in the "remove" or "retrieve" service. |
static long |
NEXT_HOP_NO_CHANGE
|
static BitSet |
OUT_IFS_NO_CHANGE
|
static int |
PRUNE
The "prune" command used in the "prune" service. |
static int |
REMOVE
The "remove" command used in the "remove entries" service. |
static int |
RETRIEVE
The "retrieve" command used in the "retrieve entries" service. |
static int |
TIMEOUT
|
static double |
TIMEOUT_NO_CHANGE
|
static int |
TYPE
|
|
Method Summary |
static void |
add(RTKey key_,
RTEntry entry_,
double timeout_,
Port out_)
|
static java.lang.Object |
createAddRequest(RTKey key_,
RTEntry entry_,
double timeout_)
|
static java.lang.Object |
createGetAllRequest()
|
static java.lang.Object |
createGraftRequest(RTKey key_,
BitSet bs_,
double timeout_)
|
static java.lang.Object |
createGraftRequest(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_)
|
static java.lang.Object |
createPruneRequest(RTKey key_,
BitSet bs_,
double timeout_)
|
static java.lang.Object |
createPruneRequest(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_)
|
static java.lang.Object |
createRemoveRequest(RTKey key_,
java.lang.String match_)
|
static java.lang.Object |
createRetrieveRequest(RTKey key_,
java.lang.String match_)
|
static java.lang.Object |
getAllEntries(Port out_)
|
java.lang.Object |
getContractContent()
Returns the content of this contract (format?). |
java.lang.String |
getName()
|
static void |
graft(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_,
Port out_)
|
static void |
prune(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_,
Port out_)
|
static java.lang.Object |
remove(RTKey key_,
java.lang.String match_,
Port out_)
|
static java.lang.Object |
retrieve(RTKey key_,
java.lang.String match_,
Port out_)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final RTConfig INSTANCE
NEXT_HOP_NO_CHANGE
public static final long NEXT_HOP_NO_CHANGE
OUT_IFS_NO_CHANGE
public static final BitSet OUT_IFS_NO_CHANGE
EXTENSION_NO_CHANGE
public static final java.lang.Object EXTENSION_NO_CHANGE
TIMEOUT_NO_CHANGE
public static final double TIMEOUT_NO_CHANGE
ADD
public static final int ADD
- The "add" command used in the "add an entry" service.
GRAFT
public static final int GRAFT
- The "graft" command used in the "graft" service.
PRUNE
public static final int PRUNE
- The "prune" command used in the "prune" service.
REMOVE
public static final int REMOVE
- The "remove" command used in the "remove entries" service.
RETRIEVE
public static final int RETRIEVE
- The "retrieve" command used in the "retrieve entries" service.
TYPE
public static final int TYPE
KEY
public static final int KEY
ENTRY
public static final int ENTRY
TIMEOUT
public static final int TIMEOUT
MATCH_TYPE
public static final int MATCH_TYPE
MATCH_EXACT
public static final java.lang.String MATCH_EXACT
- The exact match argument used in the "remove" or "retrieve" service.
In this type of match,
the key is used to find exactly the same key in the routing table.
Exactly one key or none in the routing table will be matched to the given
key.
MATCH_LONGEST
public static final java.lang.String MATCH_LONGEST
- The longest match argument used in the "remove" or "retrieve" service.
In this type of match,
the value of the key is used to
find the longest match among all matched keys.
Exactly one key or none in the routing table will be matched to the given
key.
- See Also:
MATCH_ALL
MATCH_ALL
public static final java.lang.String MATCH_ALL
- The match-all argument used in the "remove" or "retrieve" service.
In this type of match,
only the value of the key is used to find all the matched keys in the
routing table.
There may be more than one key or none at all in the routing table matched to the
given key.
MATCH_WILDCARD
public static final java.lang.String MATCH_WILDCARD
- The wildcard match argument used in the "remove" or "retrieve" service.
In this type of match,
only the values of the keys in the routing table is used to match
the given key.
There may be more than one key or none at all in the routing table matched to the
given key. The given key with value 0 and mask 0 will be wildcard matched
to all possible keys.
RTConfig
public RTConfig()
RTConfig
public RTConfig(int role_)
getName
public java.lang.String getName()
- Overrides:
getName in class Contract
getContractContent
public java.lang.Object getContractContent()
- Description copied from class:
Contract
- Returns the content of this contract (format?).
- Overrides:
getContractContent in class Contract
add
public static void add(RTKey key_,
RTEntry entry_,
double timeout_,
Port out_)
graft
public static void graft(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_,
Port out_)
prune
public static void prune(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_,
Port out_)
remove
public static java.lang.Object remove(RTKey key_,
java.lang.String match_,
Port out_)
retrieve
public static java.lang.Object retrieve(RTKey key_,
java.lang.String match_,
Port out_)
getAllEntries
public static java.lang.Object getAllEntries(Port out_)
createAddRequest
public static java.lang.Object createAddRequest(RTKey key_,
RTEntry entry_,
double timeout_)
createGraftRequest
public static java.lang.Object createGraftRequest(RTKey key_,
BitSet bs_,
double timeout_)
createGraftRequest
public static java.lang.Object createGraftRequest(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_)
createPruneRequest
public static java.lang.Object createPruneRequest(RTKey key_,
BitSet bs_,
double timeout_)
createPruneRequest
public static java.lang.Object createPruneRequest(RTKey key_,
BitSet bs_,
java.lang.Object extension_,
double timeout_)
createRemoveRequest
public static java.lang.Object createRemoveRequest(RTKey key_,
java.lang.String match_)
createRetrieveRequest
public static java.lang.Object createRetrieveRequest(RTKey key_,
java.lang.String match_)
createGetAllRequest
public static java.lang.Object createGetAllRequest()
Copyright © 2001 - DRCL, OSU ~ Back to JavaSim Home ~