1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-01 12:54:07 +00:00

Native warning for urgent TCP

This commit is contained in:
M66B 2016-02-11 15:21:55 +01:00
parent e78133d381
commit 31b0b8e7ad
2 changed files with 7 additions and 1 deletions

View file

@ -254,6 +254,8 @@ void handle_ip(const struct arguments *args,
flags[flen++] = 'F';
if (tcp->rst)
flags[flen++] = 'R';
if (tcp->urg)
flags[flen++] = 'U';
// TODO checksum
}

View file

@ -380,10 +380,14 @@ jboolean handle_tcp(const struct arguments *args,
flags[flen++] = 'S';
if (tcphdr->ack)
flags[flen++] = 'A';
if (tcphdr->psh)
flags[flen++] = 'P';
if (tcphdr->fin)
flags[flen++] = 'F';
if (tcphdr->rst)
flags[flen++] = 'R';
if (tcphdr->urg)
flags[flen++] = 'U';
flags[flen] = 0;
char packet[250];
@ -395,7 +399,7 @@ jboolean handle_tcp(const struct arguments *args,
ntohl(tcphdr->seq) - (cur == NULL ? 0 : cur->remote_start),
tcphdr->ack ? ntohl(tcphdr->ack_seq) - (cur == NULL ? 0 : cur->local_start) : 0,
datalen, ntohs(tcphdr->window), uid);
log_android(ANDROID_LOG_DEBUG, packet);
log_android(tcphdr->urg ? ANDROID_LOG_WARN : ANDROID_LOG_DEBUG, packet);
// Check session
if (cur == NULL) {