public abstract class AbstractRouterFabric extends java.lang.Object implements RouterFabric, NetIFListener, DatagramDevice
Modifier | Constructor and Description |
---|---|
protected |
AbstractRouterFabric(Router r,
RouterOptions opt)
Construct a AbstractRouterFabric.
|
Modifier and Type | Method and Description |
---|---|
RouterPort |
addNetIF(NetIF netIF)
Add a Network Interface to this Router.
|
void |
closedDevice(DatagramDevice dd)
A datagram device has closed and must be removed
|
void |
closePort(RouterPort port)
Close port.
|
void |
closePorts()
Close ports.
|
boolean |
doRemove(NetIF netIF,
boolean remote)
Do work for remote or normal remove -- onyl difference is in
sending control close
|
boolean |
echo(Address addr)
Echo command received
|
boolean |
echo(Address dst,
int port)
Echo command received
|
boolean |
enqueueDatagram(Datagram dg)
forward a datagram (does not set src address)
|
NetIF |
findNetIF(java.lang.String name)
Find the netIF which connects to a given end host
or a connection name
|
Address |
getAddress()
Get the Address for this connection.
|
FabricDevice |
getFabricDevice()
Get the FabricDevice associated with Net Device
|
NetIF |
getLocalNetIF()
Get the local NetIF that has the sockets.
|
java.lang.String |
getName()
Get it's name
|
NetIFListener |
getNetIFListener()
Get the Listener of a NetIF.
|
RouterPort |
getPort(int p)
Get port N.
|
DatagramDevice |
getRoute(Datagram dg)
Return either the NetIF for the datagram or failing this null to indicate
unroutable or datagram is for router
|
FabricDevice |
getRouteFabric(Datagram dg)
Get the Fabric Device which this packet should be sent to
|
Router |
getRouter()
Get the Router this Fabric is part of
|
RoutingTable |
getRoutingTable()
Return the routing table
|
boolean |
init()
Initialisation
|
java.util.List<NetIF> |
listNetIF()
Get a list of all connected Network Interfaces
|
java.util.List<RouterPort> |
listPorts()
Get a list of all the ports with Network Interfaces.
|
boolean |
ourAddress(Address addr)
Is this datagram for us
|
boolean |
outQueueHandler(Datagram datagram,
DatagramDevice device)
Datagram which has arrived is ours
|
boolean |
ping(Address dst)
Ping command received
|
void |
remoteClosePort(RouterPort port)
Close port.
|
boolean |
remoteRemoveNetIF(NetIF netIF)
Remove a Network Interface from this Router after remote request
synchronized to prevent multiple calls
|
boolean |
removeNetIF(NetIF netIF)
Remove a Network Interface from this Router.
|
boolean |
sendDatagram(Datagram dg)
Send a Datagram originating at this host (sets src address) and
|
void |
sendGoodbye()
Send goodbye message to all ports
|
void |
setAddress(Address a)
Set the Address for this connection.
|
void |
setName(java.lang.String n)
Set the name of this Net Device
|
void |
setNetIFListener(NetIFListener l)
Set the Listener of NetIF.
|
boolean |
setNetIFWeight(java.lang.String name,
int weight)
Set the netIF weight associated with a link to a certain router name
|
boolean |
start()
Start me up.
|
boolean |
stop()
Stop the RouterFabric.
|
void |
TTLDrop(Datagram dg)
Return a TTL expired datagram unless this is a TTL expired datagram
|
void |
withdrawToOtherInterfaces(java.util.ArrayList<Address> addr,
NetIF netIF)
Send a withdrawal message for a given address
to all interfaces on this network
interface
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
decodeRoutingTable, newRoutingTable
protected AbstractRouterFabric(Router r, RouterOptions opt)
public boolean init()
init
in interface RouterFabric
public boolean start()
start
in interface RouterFabric
public boolean stop()
stop
in interface RouterFabric
public Router getRouter()
getRouter
in interface RouterFabric
public NetIF getLocalNetIF()
getLocalNetIF
in interface RouterFabric
public RouterPort getPort(int p)
getPort
in interface RouterFabric
public java.util.List<RouterPort> listPorts()
listPorts
in interface RouterFabric
public void closePorts()
closePorts
in interface RouterFabric
public void closePort(RouterPort port)
closePort
in interface RouterFabric
public void remoteClosePort(RouterPort port)
public boolean ourAddress(Address addr)
ourAddress
in interface NetIFListener
public DatagramDevice getRoute(Datagram dg) throws java.net.NoRouteToHostException
java.net.NoRouteToHostException
public FabricDevice getRouteFabric(Datagram dg) throws java.net.NoRouteToHostException
getRouteFabric
in interface NetIFListener
java.net.NoRouteToHostException
public void TTLDrop(Datagram dg)
TTLDrop
in interface NetIFListener
public boolean outQueueHandler(Datagram datagram, DatagramDevice device)
outQueueHandler
in interface DatagramDevice
public void sendGoodbye()
RouterFabric
sendGoodbye
in interface RouterFabric
public void withdrawToOtherInterfaces(java.util.ArrayList<Address> addr, NetIF netIF)
public RoutingTable getRoutingTable()
getRoutingTable
in interface RouterFabric
public NetIF findNetIF(java.lang.String name)
findNetIF
in interface RouterFabric
public boolean setNetIFWeight(java.lang.String name, int weight)
setNetIFWeight
in interface RouterFabric
public void setNetIFListener(NetIFListener l)
DatagramDevice
setNetIFListener
in interface DatagramDevice
public NetIFListener getNetIFListener()
DatagramDevice
getNetIFListener
in interface DatagramDevice
public java.util.List<NetIF> listNetIF()
listNetIF
in interface RouterFabric
public boolean ping(Address dst)
ping
in interface RouterFabric
public Address getAddress()
DatagramDevice
getAddress
in interface DatagramDevice
public void setAddress(Address a)
DatagramDevice
setAddress
in interface DatagramDevice
public java.lang.String getName()
NetIFListener
getName
in interface DatagramDevice
getName
in interface NetIFListener
public void setName(java.lang.String n)
DatagramDevice
setName
in interface DatagramDevice
public FabricDevice getFabricDevice()
DatagramDevice
getFabricDevice
in interface DatagramDevice
public boolean sendDatagram(Datagram dg) throws java.net.NoRouteToHostException
DatagramDevice
sendDatagram
in interface DatagramDevice
java.net.NoRouteToHostException
public boolean enqueueDatagram(Datagram dg) throws java.net.NoRouteToHostException
DatagramDevice
enqueueDatagram
in interface DatagramDevice
java.net.NoRouteToHostException
public boolean echo(Address addr)
echo
in interface RouterFabric
public boolean echo(Address dst, int port)
public RouterPort addNetIF(NetIF netIF)
addNetIF
in interface RouterFabric
public boolean removeNetIF(NetIF netIF)
removeNetIF
in interface RouterFabric
public boolean remoteRemoveNetIF(NetIF netIF)
public boolean doRemove(NetIF netIF, boolean remote)
public void closedDevice(DatagramDevice dd)
NetIFListener
closedDevice
in interface NetIFListener
User Space Routing 0.10.3