public class VectorRoutingTable extends java.lang.Object implements RoutingTable
Modifier and Type | Method and Description |
---|---|
boolean |
addNetIF(NetIF inter,
RouterOptions options)
A new network interface arrives -- add to
routing table if necessary return true if change was made
|
void |
fromBytes(byte[] bytes,
NetIF netif)
From bytes
|
java.util.Collection<? extends RoutingTableEntry> |
getEntries()
Get all the RoutingTable entries.
|
VectorRoutingTableEntry |
getEntry(Address a)
Get an entry from the table
|
NetIF |
getInterface(Address addr)
Return the interface on which to send a packet to a given address
or null if not known
|
int |
getTopology()
Get the current topology we are using
|
boolean |
mergeEntry(VectorRoutingTableEntry newEntry,
NetIF inter,
RouterOptions options)
Merge an entry in this RoutingTable returns true if there has been
a change
|
boolean |
mergeTables(RoutingTable table2,
NetIF inter,
RouterOptions options)
Merge a RoutingTable into this one.
|
boolean |
removeAddress(Address addr)
remove address from table.
|
boolean |
removeNetIF(NetIF netif)
Removes a network interface from a router returns true if
routing table has changed
|
void |
setListener(NetIFListener l)
Set the NetIFListener
|
boolean |
setNetIFWeight(NetIF inter,
int weight)
Sets a weight on a link on the specified NetIF.
|
void |
setTopology(int t)
Set the current topology we are using
|
java.lang.String |
showTransmitted()
SHow only data transmitted
|
int |
size()
The size of the RoutingTable.
|
byte[] |
toBytes()
To byte[]
|
java.lang.String |
toString()
To string
|
public int getTopology()
public void setTopology(int t)
public byte[] toBytes()
toBytes
in interface RoutingTable
public void fromBytes(byte[] bytes, NetIF netif) throws java.lang.Exception
java.lang.Exception
public boolean removeAddress(Address addr)
removeAddress
in interface RoutingTable
public void setListener(NetIFListener l)
setListener
in interface RoutingTable
public int size()
size
in interface RoutingTable
public java.util.Collection<? extends RoutingTableEntry> getEntries()
getEntries
in interface RoutingTable
public NetIF getInterface(Address addr)
getInterface
in interface RoutingTable
public boolean addNetIF(NetIF inter, RouterOptions options)
addNetIF
in interface RoutingTable
public boolean mergeTables(RoutingTable table2, NetIF inter, RouterOptions options)
mergeTables
in interface RoutingTable
public VectorRoutingTableEntry getEntry(Address a)
getEntry
in interface RoutingTable
public boolean mergeEntry(VectorRoutingTableEntry newEntry, NetIF inter, RouterOptions options)
public boolean removeNetIF(NetIF netif)
removeNetIF
in interface RoutingTable
public boolean setNetIFWeight(NetIF inter, int weight)
setNetIFWeight
in interface RoutingTable
public java.lang.String showTransmitted()
showTransmitted
in interface RoutingTable
public java.lang.String toString()
toString
in interface RoutingTable
toString
in class java.lang.Object
User Space Routing 0.10.3