Native recognize ICMPv6

This commit is contained in:
M66B 2016-01-26 15:07:26 +01:00
parent 8d9ecd010b
commit ef0231f560
2 changed files with 7 additions and 3 deletions

View File

@ -128,7 +128,7 @@ public class LogAdapter extends CursorAdapter {
// https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers // https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
if (protocol == 0) // HOPOPT if (protocol == 0) // HOPOPT
tvProtocol.setText("HOPO" + version); tvProtocol.setText("HOPO" + version);
else if (protocol == 1) // ICMP else if (protocol == 1 || protocol == 58) // ICMPv4/v6
tvProtocol.setText("ICMP" + version); tvProtocol.setText("ICMP" + version);
else if (protocol == 6) // TCP else if (protocol == 6) // TCP
tvProtocol.setText("TCP" + version); tvProtocol.setText("TCP" + version);

View File

@ -898,7 +898,8 @@ void check_tcp_sockets(const struct arguments *args, fd_set *rfds, fd_set *wfds,
} }
} }
//https://en.wikipedia.org/wiki/IPv6_packet#Extension_headers // https://en.wikipedia.org/wiki/IPv6_packet#Extension_headers
// http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
int is_lower_layer(int protocol) { int is_lower_layer(int protocol) {
// No next header = 59 // No next header = 59
return (protocol == 0 || // Hop-by-Hop Options return (protocol == 0 || // Hop-by-Hop Options
@ -912,7 +913,10 @@ int is_lower_layer(int protocol) {
} }
int is_upper_layer(int protocol) { int is_upper_layer(int protocol) {
return (protocol == IPPROTO_TCP || protocol == IPPROTO_UDP || protocol == IPPROTO_ICMP); return (protocol == IPPROTO_TCP ||
protocol == IPPROTO_UDP ||
protocol == IPPROTO_ICMP ||
protocol == 58); // ICMP for IPv6
} }
void handle_ip(const struct arguments *args, const uint8_t *pkt, const size_t length) { void handle_ip(const struct arguments *args, const uint8_t *pkt, const size_t length) {