Class Lauscher

java.lang.Object
filius.rahmenprogramm.nachrichten.Lauscher
All Implemented Interfaces:
I18n

public class Lauscher extends Object implements I18n
  • Field Details

  • Method Details

    • reset

      public void reset()
    • getInterfaceIDs

      public Collection<String> getInterfaceIDs()
    • getLauscher

      public static Lauscher getLauscher()
    • getInterfaceByID

      public NetzwerkInterface getInterfaceByID(String interfaceId)
    • getSystemSoftwareByID

      public SystemSoftware getSystemSoftwareByID(String interfaceId)
    • removeIdentifier

      public void removeIdentifier(String identifier)
    • addBeobachter

      public void addBeobachter(String id, LauscherBeobachter newObserver)
    • addDatenEinheit

      public void addDatenEinheit(NetzwerkInterface networkInterface, SystemSoftware systemSoftware, EthernetFrame frame)
      Hinzufuegen von einem EthernetFrame zu den Daten
      Parameters:
      networkInterface -
      systemSoftware -
      frame -
    • addDroppedDataUnit

      public void addDroppedDataUnit(EthernetFrame frame)
    • frameWithTimestamp

      protected Object[] frameWithTimestamp(EthernetFrame frame)
    • getHexDump

      public Object[] getHexDump(String interfaceId, int entry)
    • getDaten

      public Object[][] getDaten(String interfaceId, boolean inheritAddress, int offset)
    • print

      public void print(String interfaceId)
    • getOffsetByTimestamp

      public int getOffsetByTimestamp(String interfaceId, long offsetTimestamp)
    • getHeader

      public String[] getHeader()
    • getDroppedDataUnits

      public List<String> getDroppedDataUnits()
    • resetDroppedDataUnits

      public void resetDroppedDataUnits()
    • getCorrespondingFrame

      public Object[] getCorrespondingFrame(String originalInterfaceId, int originalFrameNumber, InternetKnoten node)
      General: If a frame was forwarded by the node (this means that it is a router), given a received / sent frame, the method finds the sent / received frame with the same encapsuled IP packet on another interface of the node. Specific: Given an interface ID and the frame number in the data exchange window (Datenaustausch), other interfaces of the node will be searched for a frame which has the same content and a TTL increased by 1 if the frame was sent or a TTL decreased by 1 if the frame was received. <br \> The first entry of the returned array contains the network interface ID interfaceId and the second entry the number of the frame frameNumber in the data exchange window. If the two entries are the null pointer each, it means that the layer 2 (IP or ICMP) packet was originally sent or ultimately received by this node, i.e. that there is no corresponding frame.
      Parameters:
      originalInterfaceId - MAC address of the network interface
      originalFrameNumber - number of the frame in the data exchange window (Datenaustausch)
      node - The node whose message details table (Datenaustausch) we are on
      Returns:
      Array of length two. First entry is the interface ID, second entry the frame number in the data exchange window (starts with 1). If no corresponding frame exists, the two entries are null.
    • getFrameWithSameContentAndSpecificTTL

      public EthernetFrame getFrameWithSameContentAndSpecificTTL(EthernetFrame originalFrame, int ttl)
      Returns the ethernet frame with the same payload as the frame in the first argument but with a desired TTL. If the frame in the first argument does not encapsule an IP packet (e.g. an ARP packet) the method returns null. If no such frame exists it returns null as well.
      Parameters:
      originalFrame - the frame whose data should be equal to the returned one
      ttl - the desired TTL
      Returns:
      frame with same data and specified TTL (null if it does not exist)
    • getFrame

      public EthernetFrame getFrame(String interfaceId, int frameNumber)
      This helper method returns the frame in the Lauscher data that belongs to the network interface indicated in the first parameter and the frame number in the data exchange window in the second parameter.
      Parameters:
      interfaceId - MAC address of the network interface whose data exchange should be searched for the frame
      frameNumber - number of the frame in the data exchange window
      Returns:
      frame which belongs to the parameters
    • getFrameNumber

      public int getFrameNumber(String interfaceId, EthernetFrame frame)
      Returns the frame number (number of a frame in the data exchange window of an interface) to a given interface ID and ethernet frame. Returns 0 if the frame was not found.
      Parameters:
      interfaceId - ID of the interface
      frame - frame which the number should be computed for
      Returns:
      the frame number in the data exchange window (starts with 1) or 0 if the frame was not found
    • storeInterfaceById

      public void storeInterfaceById(String interfaceId, NetzwerkInterface networkInterface)
      Adds the pair interfaceId and interface of type NetzwerkInterface to the HashMap InterfaceById.
      Parameters:
      interfaceId - MAC address of the interface
      networkInterface - interface belonging to the interface ID
    • storeSystemSoftwareById

      public void storeSystemSoftwareById(String interfaceId, SystemSoftware systemSoftware)
      Adds the pair interfaceId and systemSoftware of type SystemSoftware to the HashMap SystemSoftwareById.
      Parameters:
      interfaceId - MAC address of the interface
      systemSoftware - systemSoftware (operating system) belonging to the interface ID