mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
IP Dump supports flow filtering
Every packet is assigned a "flow id", and the UI allows you to filter displayed packet data by flow id.
This commit is contained in:
parent
ebfcde2618
commit
da0489b638
@ -80,8 +80,6 @@
|
|||||||
var capacity = [];
|
var capacity = [];
|
||||||
var activeFilter = null;
|
var activeFilter = null;
|
||||||
var activeSet = null;
|
var activeSet = null;
|
||||||
var activeChart = 0;
|
|
||||||
var activePage = 0;
|
|
||||||
|
|
||||||
function filter(newFilter) {
|
function filter(newFilter) {
|
||||||
activeFilter = newFilter;
|
activeFilter = newFilter;
|
||||||
@ -95,12 +93,6 @@
|
|||||||
viewPage(0);
|
viewPage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setChart(n) {
|
|
||||||
activeChart = n;
|
|
||||||
paginator(activePage);
|
|
||||||
viewPage(activePage);
|
|
||||||
}
|
|
||||||
|
|
||||||
function proto(n) {
|
function proto(n) {
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 6: return "TCP"
|
case 6: return "TCP"
|
||||||
@ -165,7 +157,7 @@ if (hdr->cwr) flags |= 128;
|
|||||||
paginator += "<option onclick='viewPage(" + i + ");'>" + i + "</option> ";
|
paginator += "<option onclick='viewPage(" + i + ");'>" + i + "</option> ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
paginator += "</select> | ";
|
paginator += "</select><br />";
|
||||||
|
|
||||||
// Offer flow filtering
|
// Offer flow filtering
|
||||||
paginator += "<strong>Filter Flows</strong>: ";
|
paginator += "<strong>Filter Flows</strong>: ";
|
||||||
@ -182,28 +174,7 @@ if (hdr->cwr) flags |= 128;
|
|||||||
paginator += "<option onclick='filter(\"" + key + "\");'>" + key + "</option>";
|
paginator += "<option onclick='filter(\"" + key + "\");'>" + key + "</option>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
paginator += "</select> | ";
|
|
||||||
|
|
||||||
// Offer graph choices
|
|
||||||
paginator += "<strong>Graph</strong>: ";
|
|
||||||
paginator += "<select>";
|
|
||||||
if (activeChart == 0) {
|
|
||||||
paginator += "<option selected>Packet-Size Chart</option>";
|
|
||||||
} else {
|
|
||||||
paginator += "<option onclick='setChart(0);'>Packet-Size Chart</option>";
|
|
||||||
}
|
|
||||||
if (activeChart == 1) {
|
|
||||||
paginator += "<option selected>Piano Roll Flow Chart</option>";
|
|
||||||
} else {
|
|
||||||
paginator += "<option onclick='setChart(1);'>Piano Roll Flow Chart</option>";
|
|
||||||
}
|
|
||||||
if (activeChart == 2) {
|
|
||||||
paginator += "<option selected>TCP Window Chart</option>";
|
|
||||||
} else {
|
|
||||||
paginator += "<option onclick='setChart(2);'>TCP Window Chart</option>";
|
|
||||||
}
|
|
||||||
paginator += "</select>";
|
paginator += "</select>";
|
||||||
paginator += "</div>";
|
|
||||||
|
|
||||||
$("#pages").html(paginator);
|
$("#pages").html(paginator);
|
||||||
}
|
}
|
||||||
@ -343,7 +314,6 @@ if (hdr->cwr) flags |= 128;
|
|||||||
data.forEach(packet => packet.timestamp -= min_ts);
|
data.forEach(packet => packet.timestamp -= min_ts);
|
||||||
|
|
||||||
// Divide the packets into flows and append the flow_id
|
// Divide the packets into flows and append the flow_id
|
||||||
let flowCounter = 0;
|
|
||||||
data.forEach(packet => {
|
data.forEach(packet => {
|
||||||
let flow_id = proto(packet.ip_protocol) + " " + packet.src + ":" + packet.src_port + " <-> " + packet.dst + ":" + packet.dst_port;
|
let flow_id = proto(packet.ip_protocol) + " " + packet.src + ":" + packet.src_port + " <-> " + packet.dst + ":" + packet.dst_port;
|
||||||
let reverse_flow_id = proto(packet.ip_protocol) + " " + packet.dst + ":" + packet.dst_port + " <-> " + packet.src + ":" + packet.src_port;
|
let reverse_flow_id = proto(packet.ip_protocol) + " " + packet.dst + ":" + packet.dst_port + " <-> " + packet.src + ":" + packet.src_port;
|
||||||
@ -352,11 +322,11 @@ if (hdr->cwr) flags |= 128;
|
|||||||
} else if (flows.hasOwnProperty(reverse_flow_id)) {
|
} else if (flows.hasOwnProperty(reverse_flow_id)) {
|
||||||
packet.flow_id = reverse_flow_id;
|
packet.flow_id = reverse_flow_id;
|
||||||
} else {
|
} else {
|
||||||
flows[flow_id] = { flowCounter };
|
flows[flow_id] = {};
|
||||||
packet.flow_id = flow_id;
|
packet.flow_id = flow_id;
|
||||||
flowCounter++;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
console.log(flows);
|
||||||
|
|
||||||
packets = data;
|
packets = data;
|
||||||
activeSet = packets;
|
activeSet = packets;
|
||||||
|
Loading…
Reference in New Issue
Block a user