thombashi / pingparsing

pingparsing is a CLI-tool/Python-library parser and transmitter for ping command :arrow_right_hook:
https://pingparsing.rtfd.io/
MIT License
78 stars 10 forks source link

Show received addresses in icmp_replies (especially for broadcast pings) #38

Closed vi closed 3 years ago

vi commented 4 years ago

icmp_replies section seems to omit the actual address it received a reply from.

For example, from this input:

PING ff02::2%usb0(ff02::2%usb0) 56 data bytes
64 bytes from fe80::783c:caff:fe12:b46c%usb0: icmp_seq=1 ttl=64 time=2.71 ms

--- ff02::2%usb0 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.708/2.708/2.708/0.000 ms

I get approximately this output:

{
    "destination": "ff02::2%usb0",
    "packet_transmit": 1,
    "packet_receive": 1,
    "packet_loss_count": 0,
    "packet_loss_rate": 0.0,
    "rtt_min": 7.222,
    "rtt_avg": 7.222,
    "rtt_max": 7.222,
    "rtt_mdev": 0.0,
    "packet_duplicate_count": 0,
    "packet_duplicate_rate": 0.0,
    "icmp_replies": [
        {
            "icmp_seq": 1,
            "ttl": 64,
            "time": 7.22,
            "duplicate": false
        }
    ]
}

The point is extracting that fe80::783c:caff:fe12:b46c,which is missing in the output.

thombashi commented 3 years ago

Thank you for your feedback. Received addresses will be shown in icmp_replies with pingparsing 1.3.0 or later.