@@ -87,4 +87,11 @@ public abstract class Packet {
public Port getDestination(){
return destination;
}
+
+ /**
+ * Return name of the protocol, the packets is part of
+ *
+ * @return Protocol name
+ */
+ protected abstract String getProtocolName();
@@ -202,4 +202,9 @@ public class MQTT_packet extends Packet {
public String getPayload() {
return "null";
+ @Override
+ protected String getProtocolName() {
+ return "MQTT";
+ }
@@ -169,4 +169,9 @@ public class Ping_packet extends Packet {
for(int i = 0; i<bytes.length; i++)
System.out.println(bytes[i]);
+ return "ICMPv6 Ping";
@@ -72,4 +72,9 @@ public class SimplePacket extends Packet {
return payload == null ? "" : payload;
+ return "Simple";