@@ -29,27 +29,41 @@ export class PacketInfo extends BaseInfo {
2929 const framePayload = this . packet . rawPacket . payload as IPv4Packet ;
3030
3131 if ( layer == Layer . Link ) {
32+ const srcDevice = this . packet . viewgraph . getDeviceByMac (
33+ this . packet . rawPacket . source ,
34+ ) ;
35+ const dstDevice = this . packet . viewgraph . getDeviceByMac (
36+ this . packet . rawPacket . destination ,
37+ ) ;
38+
3239 this . information . addField (
3340 TOOLTIP_KEYS . SOURCE_MAC_ADDRESS ,
34- this . packet . rawPacket . source . toString ( ) ,
41+ ` ${ this . packet . rawPacket . source . toString ( ) } ${ srcDevice ? " (Device " + srcDevice . id + ")" : "" } ` ,
3542 TOOLTIP_KEYS . SOURCE_MAC_ADDRESS ,
3643 ) ;
3744 this . information . addField (
3845 TOOLTIP_KEYS . DESTINATION_MAC_ADDRESS ,
39- this . packet . rawPacket . destination . toString ( ) ,
46+ ` ${ this . packet . rawPacket . destination . toString ( ) } ${ dstDevice ? " (Device " + dstDevice . id + ")" : "" } ` ,
4047 TOOLTIP_KEYS . DESTINATION_MAC_ADDRESS ,
4148 ) ;
4249 }
4350
4451 if ( layer >= Layer . Network ) {
52+ const srcDevice = this . packet . viewgraph . getDeviceByIP (
53+ framePayload . sourceAddress ,
54+ ) ;
55+ const dstDevice = this . packet . viewgraph . getDeviceByIP (
56+ framePayload . destinationAddress ,
57+ ) ;
58+
4559 this . information . addField (
4660 TOOLTIP_KEYS . SOURCE_IP_ADDRESS ,
47- framePayload . sourceAddress . toString ( ) ,
61+ ` ${ framePayload . sourceAddress . toString ( ) } ${ srcDevice ? " (Device " + srcDevice . id + ")" : "" } ` ,
4862 TOOLTIP_KEYS . SOURCE_IP_ADDRESS ,
4963 ) ;
5064 this . information . addField (
5165 TOOLTIP_KEYS . DESTINATION_IP_ADDRESS ,
52- framePayload . destinationAddress . toString ( ) ,
66+ ` ${ framePayload . destinationAddress . toString ( ) } ${ dstDevice ? " (Device " + dstDevice . id + ")" : "" } ` ,
5367 TOOLTIP_KEYS . DESTINATION_IP_ADDRESS ,
5468 ) ;
5569 }
0 commit comments