Skip to content

Commit 071249d

Browse files
authored
fix: Refactor ARP packet details (#249)
1 parent df5f58f commit 071249d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/packets/arp.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { IpAddress } from "./ip";
22
import { ARP_PROTOCOL_TYPE, FramePayload, MacAddress } from "./ethernet";
3+
import { TOOLTIP_KEYS } from "../utils/constants/tooltips_constants";
34

45
const ETHERNET_HTYPE = 1;
56
const IPv4_PTYPE = 0x0800;
@@ -94,15 +95,15 @@ export abstract class ArpPacket implements FramePayload {
9495
// eslint-disable-next-line
9596
getDetails(_layer: number): Record<string, string | number | object> {
9697
return {
97-
HTYPE: this.htype,
98-
PTYPE: this.ptype,
99-
HLEN: this.hlen,
100-
PLEN: this.plen,
101-
OP: this.op,
102-
SHA: this.sha.toString(),
103-
SPA: this.spa.toString(),
104-
THA: this.tha.toString(),
105-
TPA: this.tpa.toString(),
98+
[TOOLTIP_KEYS.HTYPE]: this.htype,
99+
[TOOLTIP_KEYS.PTYPE]: this.ptype,
100+
[TOOLTIP_KEYS.HLEN]: this.hlen,
101+
[TOOLTIP_KEYS.PLEN]: this.plen,
102+
[TOOLTIP_KEYS.OP]: this.op,
103+
[TOOLTIP_KEYS.SHA]: this.sha.toString(),
104+
[TOOLTIP_KEYS.SPA]: this.spa.toString(),
105+
[TOOLTIP_KEYS.THA]: this.tha.toString(),
106+
[TOOLTIP_KEYS.TPA]: this.tpa.toString(),
106107
};
107108
}
108109
}

0 commit comments

Comments
 (0)