Experiment: delete SYN log when SNI

This commit is contained in:
M66B 2023-08-29 18:25:06 +02:00
parent 1f8ed9282a
commit 1c53f47413
1 changed files with 24 additions and 0 deletions

View File

@ -369,6 +369,30 @@ public class DatabaseHelper extends SQLiteOpenHelper {
SQLiteDatabase db = this.getWritableDatabase();
db.beginTransactionNonExclusive();
try {
if (false &&
packet.protocol == 6 /* TCP */ &&
packet.daddr != null &&
packet.dport > 0 &&
packet.uid > 0 &&
"sni".equals(packet.data)) {
int deleted = db.delete("log", "time > ?" +
" AND protocol = ?" +
" AND version = ?" +
" AND flags = ?" +
" AND daddr = ?" +
" AND dport = ?" +
" AND uid = ?",
new String[]{
Long.toString(packet.time - 2000L),
Integer.toString(packet.protocol),
Integer.toString(packet.version),
"S", // SYN
packet.daddr,
Integer.toString(packet.dport),
Integer.toString(packet.uid)
});
Log.i(TAG, "Deleted=" + deleted + " packet=" + packet + " dname=" + dname);
}
ContentValues cv = new ContentValues();
cv.put("time", packet.time);
cv.put("version", packet.version);