verinec.netsim.components.layers
Class DataLinkLayer
java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
verinec.netsim.components.layers.abstractNetworkLayer
verinec.netsim.components.layers.DataLinkLayer
- All Implemented Interfaces:
- Observer, Subject
public class DataLinkLayer
- extends abstractNetworkLayer
A DatalinkLayer (Layer 2 in the OSI Model). It does not represent the Layer
itself. It represents a NIC.
- Version:
- $Revision:835 $
- Author:
- Dominik Jungo
| Methods inherited from class verinec.netsim.components.layers.abstractNetworkLayer |
addAddress, addProcessor, addresses, attachLower, attachUpper, detachLower, detachUpper, getDownEvent, getFirstAddress, getLayerName, getLowerobserver, getNode, getProcessor, getUpEvent, processorelements, sendDown, sendUp, setNode |
| Methods inherited from class desmoj.core.simulator.ModelComponent |
current, currentEntity, currentEvent, currentModel, currentSimProcess, currentTime, debugIsOn, debugOff, debugOn, epsilon, getModel, isExperimentCompatible, isModelCompatible, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn |
iface
private String iface
interfaceID
private String interfaceID
DataLinkLayer
public DataLinkLayer(Model owner,
EventProcessor processor,
String iface,
String interfaceID)
- Constructs a new NIC
- Parameters:
owner - a Modelprocessor - a Processoriface - the name of this NIC, e.g. eth0. if the name is null, a random name is chosen. this name has the structure r_iface followed by a random integer.interfaceID - the interface ref_id
setInterfaceID
private void setInterfaceID(String interfaceID)
getInterfaceID
public String getInterfaceID()
- gets the interface ref_id
- Returns:
- the interface ref_id
getInterface
public String getInterface()
- gets the name of the interface
- Returns:
- the name of the interface
setInterface
public void setInterface(String string)
- sets the name of the interface
- Parameters:
string - a name
compareAddress
public boolean compareAddress(IAddress address)
- Description copied from class:
abstractNetworkLayer
- Checks if an address is associated with this layer.
- Overrides:
compareAddress in class abstractNetworkLayer
- Parameters:
address - an address to compare with
- Returns:
- true if the address is in this layers address list, false
otherwise.
- See Also:
abstractNetworkLayer.compareAddress(verinec.netsim.addresses.IAddress)