go-ping / ping

ICMP Ping library for Go
MIT License
1.33k stars 345 forks source link

added SetSrcAddress and GetIfaceIpv4Addr methods #171

Closed shreyaskapale closed 1 year ago

shreyaskapale commented 3 years ago

added SetSrcAddress and GetIfaceIpv4Addr methods

  1. SetSrcAddress takes in either interface name of the source example "eth0" or the address "192.168.1.239" and sets source ip in the Pinger Class.
  2. GetIfaceIpv4Addr is a helper function which returns a ipv4 address when interface name is supplied.
SuperQ commented 3 years ago

This needs to handle both IPv4 and Ipv6. This should also include tests.

shreyaskapale commented 3 years ago

This needs to handle both IPv4 and Ipv6. This should also include tests.

I will try adding ipv6 handler and include tests for the same.

shreyaskapale commented 3 years ago

This needs to handle both IPv4 and Ipv6. This should also include tests.

Please review the new commits I have added handlers for both and also included the tests for the same

SuperQ commented 1 year ago

See https://github.com/go-ping/ping/pull/226