diff --git a/index.html b/index.html index db2eea8..931f877 100644 --- a/index.html +++ b/index.html @@ -103,6 +103,7 @@

DDD Filter applications in the Network

+

diff --git a/js/canvas.js b/js/canvas.js index 100f1a0..8f46c54 100644 --- a/js/canvas.js +++ b/js/canvas.js @@ -81,6 +81,7 @@ function createPackets(numPackets, originEntity, nPorts) { let srcPort = 80; for (let i = 0; i < numPackets; ++i) { let dstPort = DDD.generatePort(nPorts); + console.log(dstPort); let packetX = originEntity.x; let packetY = originEntity.y; let radius = 15; @@ -115,6 +116,23 @@ function dashboardOpenPorts(ddd) { } document.getElementById("openPorts").textContent = "DDD Open Ports: " + printOut; } + +function dashboardAttackerPorts(packets) { + let printPorts = []; + for(let packet of packets){ + printPorts.push(packet.dstPort); + } + var printOut = new String(""); + for (let i = 0; i < printPorts.length; i++) { + if (i == printPorts.length - 1) { + printOut = printOut + " and " + printPorts[i]; + } else { + printOut = printOut + printPorts[i] + ", " + } + } + document.getElementById("attackerPorts").textContent = "Attacker Packet Ports: " + printOut; +} + function dashboardDroppedPackets(garbage){ document.getElementById("droppedPackets").textContent = "Dropped Packets: " + garbage.droppedPackets; } @@ -172,6 +190,7 @@ async function startSimulation() { let attacker = new Attacker(1500, y, server, packetsPerTimeUnit); let packetsList = createPackets(totalPackets, attacker, nPorts); attacker.queue = packetsList; + dashboardAttackerPorts(packetsList); let systemEntities = [attacker, server, router, client, garbage]; if (dddState) {