DRCL J-Sim API

drcl.inet.core
Class CoreServiceLayer

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.inet.CoreServiceLayer
              extended bydrcl.inet.core.CoreServiceLayer
All Implemented Interfaces:
java.lang.Cloneable, InetConstants, ObjectCloneable, ObjectDuplicable, java.io.Serializable

public class CoreServiceLayer
extends CoreServiceLayer

The container class for constructing a network node.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Fields inherited from interface drcl.inet.InetConstants
BYTE_MODE, DEFAULT_BANDWIDTH, DEFAULT_BUFFER_SIZE, DEFAULT_MTU, EVENT_ID_CHANGED_PORT_ID, EVENT_IDENTITY_ADDED, EVENT_IDENTITY_REMOVED, EVENT_IF_NEIGHBOR_DOWN, EVENT_IF_NEIGHBOR_UP, EVENT_IF_PORT_ID, EVENT_LINK_BROKEN, EVENT_LINK_BROKEN_PORT_ID, EVENT_MCAST_HOST_PORT_ID, EVENT_PKT_ARRIVAL, EVENT_PKT_ARRIVAL_PORT_ID, EVENT_RT_ENTRY_ADDED, EVENT_RT_ENTRY_MODIFIED, EVENT_RT_ENTRY_REMOVED, EVENT_RT_MCAST_CHANGED_PORT_ID, EVENT_RT_UCAST_CHANGED_PORT_ID, EVENT_VIF_NEIGHBOR_DOWN, EVENT_VIF_NEIGHBOR_UP, EVENT_VIF_PORT_ID, HOST_ENTRY_EXT, ID_CSL, ID_TRACE_RT, MCAST_QUERY_PORT_ID, PACKET_MODE, PID_AODV, PID_DV, PID_DVMRP, PID_HELLO, PID_IGMP, PID_OSPF, PID_RSVP, PID_TCP, PID_TRACE_RT, PID_UDP, SERVICE_CONFIGSW_PORT_ID, SERVICE_ID_PORT_ID, SERVICE_IF_PORT_ID, SERVICE_MCAST_PORT_ID, SERVICE_RT_PORT_ID, UCAST_QUERY_PORT_ID
 
Constructor Summary
CoreServiceLayer()
           
CoreServiceLayer(java.lang.String id_)
           
 
Method Summary
 void addAddress(long addr_)
          Adds an identity to this core service layer.
 void addRTEntry(RTKey key_, RTEntry entry_, double timeout_)
          Adds a routing entry to this core service layer.
 void duplicate(java.lang.Object source_)
          Duplicates the content of source_, including ID, name, child components and connections among them, to this component.
 double getBandwidth(int ifindex_)
          Returns the bandwidth of the specified interface.
 java.lang.String getBufferMode(int ifindex_)
           
 int getBufferSize(int ifindex_)
          Returns the buffer size of the specified interface.
 long getDefaultAddress()
          Returns the default identity in this core service layer.
 InterfaceInfo getInterfaceInfo(int ifindex_)
          Returns the interface information of the specified interface.
 InterfaceInfo[] getInterfaceInfos()
          Returns all the interface information in an array.
 double getLinkPropDelay(int ifindex_)
          Returns the emulated link propagation delay.
 int getMTU(int ifindex_)
          Returns the MTU of the specified interface.
 Port[][] getNAMPacketEventPorts()
          Returns the ports that output packets that are to be enqueued in and dequeued/dropped from the buffer.
 int getNumOfInterfaces()
          Returns the number of interfaces including virtual ones.
 int getNumOfPhysicalInterfaces()
          Returns the number of physical interfaces
 boolean hasRoutingCapability()
           
 java.lang.String info()
          Returns information regarding this component.
 boolean isLinkEmulationEnabled(int ifindex_)
           
 void removeAddress(long addr_)
          Removes an identity from this core service layer.
 void removeRTEntry(RTKey key_)
          Removes a routing entry from this core service layer.
 RTEntry[] retrieveAllRTEntries()
          Retrieves all RT entries from this core service layer.
 java.lang.Object retrieveRTEntry(RTKey key_, java.lang.String matchMethod_)
          Retrieves an RT entry/RT entries from this core service layer.
 void setBandwidth(double bw_)
          Sets the bandwidth of all the interfaces.
 void setBandwidth(int ifindex_, double bw_)
          Sets the bandwidth of the specified interface.
 void setBuffer(int ifindex_, int bs_, java.lang.String mode_)
          Sets the buffer size of the specified interface.
 void setBuffer(int bs_, java.lang.String mode_)
          Sets the buffer size of all the interfaces.
 void setBufferMode(int ifindex_, java.lang.String mode_)
          Sets the buffer mode of the specified interface.
 void setBufferMode(java.lang.String mode_)
          Sets the buffer mode of all the interfaces.
 void setBufferSize(int bs_)
          Sets the buffer size of all the interfaces.
 void setBufferSize(int ifindex_, int bs_)
          Sets the buffer size of the specified interface.
 void setInterfaceInfo(int ifindex_, InterfaceInfo if_)
          Sets the interface information at the specified interface.
 void setInterfaceInfos(InterfaceInfo[] aa_)
          Sets the interface information of all the interfaces.
 void setLinkEmulationEnabled(int ifindex_, boolean enabled_)
           
 void setLinkPropDelay(int ifindex_, double delay_)
          Sets the emulated link propagation delay.
 void setMTU(int ifindex_, int mtu_)
          Sets the MTU of the specified interface.
 void setMTUs(int mtu_)
          Sets the MTUs of all interfaces.
 void setupVIF(int vifindex_, long peer_, int mtu_)
           
 void setupVIF(int vifindex_, long src_, long peer_, int mtu_)
           
 
Methods inherited from class drcl.comp.Component
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getName, getParent, getPort, getPort, getRoot, getTime, iduplicate, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, reset, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoreServiceLayer

public CoreServiceLayer()

CoreServiceLayer

public CoreServiceLayer(java.lang.String id_)
Method Detail

info

public java.lang.String info()
Description copied from class: Component
Returns information regarding this component. Subclasses should override this method to provide useful information at run time.

Overrides:
info in class CoreServiceLayer

hasRoutingCapability

public boolean hasRoutingCapability()
Specified by:
hasRoutingCapability in class CoreServiceLayer

addAddress

public void addAddress(long addr_)
Description copied from class: CoreServiceLayer
Adds an identity to this core service layer.

Specified by:
addAddress in class CoreServiceLayer

getDefaultAddress

public long getDefaultAddress()
Description copied from class: CoreServiceLayer
Returns the default identity in this core service layer.

Specified by:
getDefaultAddress in class CoreServiceLayer

removeAddress

public void removeAddress(long addr_)
Description copied from class: CoreServiceLayer
Removes an identity from this core service layer.

Specified by:
removeAddress in class CoreServiceLayer

setBandwidth

public void setBandwidth(int ifindex_,
                         double bw_)
Description copied from class: CoreServiceLayer
Sets the bandwidth of the specified interface.

Specified by:
setBandwidth in class CoreServiceLayer

setBandwidth

public void setBandwidth(double bw_)
Description copied from class: CoreServiceLayer
Sets the bandwidth of all the interfaces.

Specified by:
setBandwidth in class CoreServiceLayer

getBandwidth

public double getBandwidth(int ifindex_)
Description copied from class: CoreServiceLayer
Returns the bandwidth of the specified interface.

Specified by:
getBandwidth in class CoreServiceLayer

setBufferSize

public void setBufferSize(int bs_)
Description copied from class: CoreServiceLayer
Sets the buffer size of all the interfaces.

Specified by:
setBufferSize in class CoreServiceLayer
Parameters:
bs_ - buffer size in bytes or packets depending on the mode.

setBuffer

public void setBuffer(int bs_,
                      java.lang.String mode_)
Description copied from class: CoreServiceLayer
Sets the buffer size of all the interfaces.

Specified by:
setBuffer in class CoreServiceLayer
Parameters:
bs_ - buffer size in bytes or packets depending on the mode.
mode_ - can be either "packet" or "byte"

setBufferSize

public void setBufferSize(int ifindex_,
                          int bs_)
Description copied from class: CoreServiceLayer
Sets the buffer size of the specified interface.

Specified by:
setBufferSize in class CoreServiceLayer
Parameters:
bs_ - buffer size in bytes or packets depending on the mode.

setBuffer

public void setBuffer(int ifindex_,
                      int bs_,
                      java.lang.String mode_)
Description copied from class: CoreServiceLayer
Sets the buffer size of the specified interface.

Specified by:
setBuffer in class CoreServiceLayer
Parameters:
bs_ - buffer size in bytes or packets depending on the mode.
mode_ - can be either "packet" or "byte"

setBufferMode

public void setBufferMode(java.lang.String mode_)
Description copied from class: CoreServiceLayer
Sets the buffer mode of all the interfaces.

Specified by:
setBufferMode in class CoreServiceLayer
Parameters:
mode_ - can be either "packet" or "byte".

setBufferMode

public void setBufferMode(int ifindex_,
                          java.lang.String mode_)
Description copied from class: CoreServiceLayer
Sets the buffer mode of the specified interface.

Specified by:
setBufferMode in class CoreServiceLayer
Parameters:
mode_ - can be either "packet" or "byte".

getBufferMode

public java.lang.String getBufferMode(int ifindex_)
Specified by:
getBufferMode in class CoreServiceLayer

getBufferSize

public int getBufferSize(int ifindex_)
Description copied from class: CoreServiceLayer
Returns the buffer size of the specified interface.

Specified by:
getBufferSize in class CoreServiceLayer
Returns:
the buffer size in bytes or packets depending on the mode.
See Also:
CoreServiceLayer.getBufferMode(int)

setLinkEmulationEnabled

public void setLinkEmulationEnabled(int ifindex_,
                                    boolean enabled_)
Specified by:
setLinkEmulationEnabled in class CoreServiceLayer

isLinkEmulationEnabled

public boolean isLinkEmulationEnabled(int ifindex_)
Specified by:
isLinkEmulationEnabled in class CoreServiceLayer

setLinkPropDelay

public void setLinkPropDelay(int ifindex_,
                             double delay_)
Sets the emulated link propagation delay. Used with link emulation enabled at that interface.

Specified by:
setLinkPropDelay in class CoreServiceLayer

getLinkPropDelay

public double getLinkPropDelay(int ifindex_)
Returns the emulated link propagation delay. Used with link emulation enabled at that interface.

Specified by:
getLinkPropDelay in class CoreServiceLayer

setMTU

public void setMTU(int ifindex_,
                   int mtu_)
Description copied from class: CoreServiceLayer
Sets the MTU of the specified interface.

Specified by:
setMTU in class CoreServiceLayer

setMTUs

public void setMTUs(int mtu_)
Description copied from class: CoreServiceLayer
Sets the MTUs of all interfaces.

Specified by:
setMTUs in class CoreServiceLayer

getMTU

public int getMTU(int ifindex_)
Description copied from class: CoreServiceLayer
Returns the MTU of the specified interface.

Specified by:
getMTU in class CoreServiceLayer

setInterfaceInfo

public void setInterfaceInfo(int ifindex_,
                             InterfaceInfo if_)
Description copied from class: CoreServiceLayer
Sets the interface information at the specified interface.

Specified by:
setInterfaceInfo in class CoreServiceLayer

setInterfaceInfos

public void setInterfaceInfos(InterfaceInfo[] aa_)
Description copied from class: CoreServiceLayer
Sets the interface information of all the interfaces.

Specified by:
setInterfaceInfos in class CoreServiceLayer

getInterfaceInfo

public InterfaceInfo getInterfaceInfo(int ifindex_)
Description copied from class: CoreServiceLayer
Returns the interface information of the specified interface.

Specified by:
getInterfaceInfo in class CoreServiceLayer

getInterfaceInfos

public InterfaceInfo[] getInterfaceInfos()
Description copied from class: CoreServiceLayer
Returns all the interface information in an array.

Specified by:
getInterfaceInfos in class CoreServiceLayer

getNumOfInterfaces

public int getNumOfInterfaces()
Description copied from class: CoreServiceLayer
Returns the number of interfaces including virtual ones.

Specified by:
getNumOfInterfaces in class CoreServiceLayer

getNumOfPhysicalInterfaces

public int getNumOfPhysicalInterfaces()
Description copied from class: CoreServiceLayer
Returns the number of physical interfaces

Specified by:
getNumOfPhysicalInterfaces in class CoreServiceLayer

addRTEntry

public void addRTEntry(RTKey key_,
                       RTEntry entry_,
                       double timeout_)
Description copied from class: CoreServiceLayer
Adds a routing entry to this core service layer.

Specified by:
addRTEntry in class CoreServiceLayer

removeRTEntry

public void removeRTEntry(RTKey key_)
Description copied from class: CoreServiceLayer
Removes a routing entry from this core service layer.

Specified by:
removeRTEntry in class CoreServiceLayer

retrieveRTEntry

public java.lang.Object retrieveRTEntry(RTKey key_,
                                        java.lang.String matchMethod_)
Description copied from class: CoreServiceLayer
Retrieves an RT entry/RT entries from this core service layer.

Specified by:
retrieveRTEntry in class CoreServiceLayer
Returns:
RTEntry[] if matchMethod_ is MATCH_ALL or MATCH_WILDCARD.
See Also:
RTKey, RTEntry, Map

retrieveAllRTEntries

public RTEntry[] retrieveAllRTEntries()
Description copied from class: CoreServiceLayer
Retrieves all RT entries from this core service layer.

Specified by:
retrieveAllRTEntries in class CoreServiceLayer
Returns:
all RT entries in RTEntry[].
See Also:
RTKey, RTEntry

setupVIF

public void setupVIF(int vifindex_,
                     long peer_,
                     int mtu_)
Specified by:
setupVIF in class CoreServiceLayer

setupVIF

public void setupVIF(int vifindex_,
                     long src_,
                     long peer_,
                     int mtu_)
Specified by:
setupVIF in class CoreServiceLayer

getNAMPacketEventPorts

public Port[][] getNAMPacketEventPorts()
Description copied from class: CoreServiceLayer
Returns the ports that output packets that are to be enqueued in and dequeued/dropped from the buffer. Returned is a 2-dimensional port array. The first dimension is outgoing interface. The second dimension consists of three ports: enqueue-event port, dequeue-event port, and drop-event port.

Specified by:
getNAMPacketEventPorts in class CoreServiceLayer

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: Component
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. Subclasses need to override this method to copy its own variables.

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class Component

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~