verinec.netsim.components.layers
Class DataLinkLayer

java.lang.Object
  extended by desmoj.core.simulator.NamedObject
      extended by desmoj.core.simulator.ModelComponent
          extended by verinec.netsim.components.layers.abstractNetworkLayer
              extended by 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

Field Summary
private  String iface
           
private  String interfaceID
           
 
Constructor Summary
DataLinkLayer(Model owner, EventProcessor processor, String iface, String interfaceID)
          Constructs a new NIC
 
Method Summary
 boolean compareAddress(IAddress address)
          Checks if an address is associated with this layer.
 String getInterface()
          gets the name of the interface
 String getInterfaceID()
          gets the interface ref_id
 void setInterface(String string)
          sets the name of the interface
private  void setInterfaceID(String interfaceID)
           
 
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
 
Methods inherited from class desmoj.core.simulator.NamedObject
getName, getQuotedName, rename, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iface

private String iface

interfaceID

private String interfaceID
Constructor Detail

DataLinkLayer

public DataLinkLayer(Model owner,
                     EventProcessor processor,
                     String iface,
                     String interfaceID)
Constructs a new NIC

Parameters:
owner - a Model
processor - a Processor
iface - 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
Method Detail

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)

Copyright © 2005 Verinec, DIUF