Class EthernetFrame

java.lang.Object
filius.software.ProtocolDataUnit
filius.software.netzzugangsschicht.EthernetFrame
All Implemented Interfaces:
I18n, Serializable

public class EthernetFrame extends ProtocolDataUnit implements I18n
Diese Klasse implementiert einen Frame auf der Netzzugangsschicht.
See Also:
  • Field Details

  • Constructor Details

    • EthernetFrame

      public EthernetFrame(ProtocolDataUnit daten, String quellMacAdresse, String zielMacAdresse, String typ)
      Konstruktor zur Initialisierung der Attribute des Frames
  • Method Details

    • clone

      public EthernetFrame clone()
      Overrides:
      clone in class Object
    • setReadByLauscherForMac

      public void setReadByLauscherForMac(String mac)
    • isReadByLauscherForMac

      public boolean isReadByLauscherForMac(String mac)
    • getDaten

      public ProtocolDataUnit getDaten()
      Zugriff auf die Daten, die mit dem Frame verschickt werden
    • getQuellMacAdresse

      public String getQuellMacAdresse()
      Zugriff auf die Absender-MAC-Adresse
    • getTyp

      public String getTyp()
      Zugriff auf den Protokolltyp. Zulaessig sind ARP und IP
    • getZielMacAdresse

      public String getZielMacAdresse()
      Methode fuer den Zugriff auf die Ziel-MAC-Adresse
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • sameContent

      public boolean sameContent(EthernetFrame frame)
      Checks if the whole content (which consists of zielMacAdresse, quellMacAdresse and daten) of this frame is equal to the frame in the argument.
      Parameters:
      frame - frame to be compared to this frame
      Returns:
      true if zielMacAdresse, quellMacAdresse and daten are equal
    • samePayload

      public boolean samePayload(EthernetFrame frame, int ttl)
      If this frame and the frame in the first argument both encapsule an IP packet, this method checks if the packets have the same content and if the IP packet inside this frame has a specific TTL.
      Parameters:
      frame - the frame whose payload should be compared to this payload
      ttl - the desired TTL of this frame in the first argument
      Returns:
      true if the frame in the first argument has the same payload and the specified TTL
    • toHex

      public Vector<HexDumpEntry> toHex()