Skip to content

Commit

Permalink
tidy up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel-Pol committed Jan 28, 2025
1 parent aa89f54 commit c41f52a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/types/devices/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export abstract class Device extends Sprite {
// TODO: Most probably it will be different for each type of device
handlePacket(packet: Packet) {
switch (packet.type) {
case "ICMP-8":
case "ICMP-8": {
const destinationDevice = this.viewgraph.getDeviceByIP(
packet.rawPacket.sourceAddress,
);
Expand All @@ -154,6 +154,7 @@ export abstract class Device extends Sprite {
);
}
break;
}
default:
console.warn("Packet’s type unrecognized");
}
Expand Down
2 changes: 1 addition & 1 deletion src/types/packet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { circleGraphicsContext, Colors, ZIndexLevels } from "../utils";
import { RightBar, StyledInfo } from "../graphics/right_bar";
import { Position } from "./common";
import { ViewGraph } from "./graphs/viewgraph";
import { IpAddress, IPv4Packet } from "../packets/ip";
import { IPv4Packet } from "../packets/ip";
import { EchoRequest, EchoReply } from "../packets/icmp";
import { DeviceId, isRouter } from "./graphs/datagraph";
import { Device } from "./devices";
Expand Down

0 comments on commit c41f52a

Please sign in to comment.