From 860f25171948674098dbd6104eaac5f463720f3b Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 26 Jan 2016 09:09:00 +0100 Subject: [PATCH] Append IP version to protocol --- FAQ.md | 4 ++-- .../main/java/eu/faircode/netguard/LogAdapter.java | 12 ++++++------ app/src/main/res/layout/log.xml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/FAQ.md b/FAQ.md index 4d9487e9..cfe79860 100644 --- a/FAQ.md +++ b/FAQ.md @@ -250,11 +250,11 @@ Protocols: * T = TCP * U = UDP * Number = one of the protocols in [this list](https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers) +* 4 = IPv4 +* 6 = IPv6 Packet flags: -* 4 = IPv4 -* 6 = IPv6 * S = SYN * A = ACK * P = PSH diff --git a/app/src/main/java/eu/faircode/netguard/LogAdapter.java b/app/src/main/java/eu/faircode/netguard/LogAdapter.java index c4ce6f9c..b490bb83 100644 --- a/app/src/main/java/eu/faircode/netguard/LogAdapter.java +++ b/app/src/main/java/eu/faircode/netguard/LogAdapter.java @@ -124,17 +124,17 @@ public class LogAdapter extends CursorAdapter { // https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers if (protocol == 0) // HOPOPT - tvProtocol.setText("HOPO"); + tvProtocol.setText("HOPO" + version); else if (protocol == 1) // ICMP - tvProtocol.setText("ICMP"); + tvProtocol.setText("ICMP" + version); else if (protocol == 6) // TCP - tvProtocol.setText("TCP"); + tvProtocol.setText("TCP" + version); else if (protocol == 17) // UDP - tvProtocol.setText("UDP"); + tvProtocol.setText("UDP" + version); else - tvProtocol.setText(protocol < 0 ? "" : Integer.toString(protocol)); + tvProtocol.setText(protocol < 0 ? "" : "P" + Integer.toString(protocol) + "V" + version); - tvFlags.setText(version + flags); + tvFlags.setText(flags); tvSPort.setText(sport < 0 ? "" : Integer.toString(sport)); tvDPort.setText(dport < 0 ? "" : Integer.toString(dport)); diff --git a/app/src/main/res/layout/log.xml b/app/src/main/res/layout/log.xml index cc750ef0..bd974790 100644 --- a/app/src/main/res/layout/log.xml +++ b/app/src/main/res/layout/log.xml @@ -51,7 +51,7 @@