Append IP version to protocol

This commit is contained in:
M66B 2016-01-26 09:09:00 +01:00
parent eef1540a5a
commit 860f251719
3 changed files with 10 additions and 10 deletions

4
FAQ.md
View File

@ -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

View File

@ -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));

View File

@ -51,7 +51,7 @@
<TextView
android:id="@+id/tvProtocol"
android:layout_width="36dp"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="@android:style/TextAppearance.Material.Small"
@ -59,7 +59,7 @@
<TextView
android:id="@+id/tvFlags"
android:layout_width="36dp"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="@android:style/TextAppearance.Material.Small"