Class Lauscher
java.lang.Object
filius.rahmenprogramm.nachrichten.Lauscher
- All Implemented Interfaces:
I18n
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String[]static final Stringstatic final String[]static final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBeobachter(String id, LauscherBeobachter newObserver) voidaddDatenEinheit(NetzwerkInterface networkInterface, SystemSoftware systemSoftware, EthernetFrame frame) Hinzufuegen von einem EthernetFrame zu den DatenvoidaddDroppedDataUnit(EthernetFrame frame) protected Object[]frameWithTimestamp(EthernetFrame frame) 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.Object[][]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.intgetFrameNumber(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.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.String[]Object[]getHexDump(String interfaceId, int entry) getInterfaceByID(String interfaceId) static LauscherintgetOffsetByTimestamp(String interfaceId, long offsetTimestamp) getSystemSoftwareByID(String interfaceId) voidvoidremoveIdentifier(String identifier) voidreset()voidvoidstoreInterfaceById(String interfaceId, NetzwerkInterface networkInterface) Adds the pairinterfaceIdandinterfaceof typeNetzwerkInterfaceto the HashMapInterfaceById.voidstoreSystemSoftwareById(String interfaceId, SystemSoftware systemSoftware) Adds the pairinterfaceIdandsystemSoftwareof typeSystemSoftwareto the HashMapSystemSoftwareById.
-
Field Details
-
ETHERNET
- See Also:
-
ARP
- See Also:
-
IP
- See Also:
-
ICMP
- See Also:
-
TCP
- See Also:
-
UDP
- See Also:
-
HTTP
- See Also:
-
SMTP
- See Also:
-
POP
- See Also:
-
DNS
- See Also:
-
DHCP
- See Also:
-
SPALTEN
-
PROTOKOLL_SCHICHTEN
-
DROPPED
- See Also:
-
-
Method Details
-
reset
public void reset() -
getInterfaceIDs
-
getLauscher
-
getInterfaceByID
-
getSystemSoftwareByID
-
removeIdentifier
-
addBeobachter
-
addDatenEinheit
public void addDatenEinheit(NetzwerkInterface networkInterface, SystemSoftware systemSoftware, EthernetFrame frame) Hinzufuegen von einem EthernetFrame zu den Daten- Parameters:
networkInterface-systemSoftware-frame-
-
addDroppedDataUnit
-
frameWithTimestamp
-
getHexDump
-
getDaten
-
print
-
getOffsetByTimestamp
-
getHeader
-
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 IDinterfaceIdand the second entry the number of the frameframeNumberin 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 interfaceoriginalFrameNumber- 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
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 onettl- the desired TTL- Returns:
- frame with same data and specified TTL (null if it does not exist)
-
getFrame
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 frameframeNumber- number of the frame in the data exchange window- Returns:
- frame which belongs to the parameters
-
getFrameNumber
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 interfaceframe- 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
Adds the pairinterfaceIdandinterfaceof typeNetzwerkInterfaceto the HashMapInterfaceById.- Parameters:
interfaceId- MAC address of the interfacenetworkInterface- interface belonging to the interface ID
-
storeSystemSoftwareById
Adds the pairinterfaceIdandsystemSoftwareof typeSystemSoftwareto the HashMapSystemSoftwareById.- Parameters:
interfaceId- MAC address of the interfacesystemSoftware- systemSoftware (operating system) belonging to the interface ID
-