]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
tun/netstack: implement ICMP ping
authorThomas H. Ptacek <thomas@sockpuppet.org>
Mon, 31 Jan 2022 22:55:36 +0000 (16:55 -0600)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 2 Feb 2022 22:09:37 +0000 (23:09 +0100)
commitb9669b734e30e717835ed44ea01f7ee7cdce5563
tree8d4c0d9ad1cb99116250007e41d6b288ce254565
parente0b8f11489c57cbb38b12ae446cf41c4df6ac553
tun/netstack: implement ICMP ping

Provide a PacketConn interface for netstack's ICMP endpoint; netstack
currently only provides EchoRequest/EchoResponse ICMP support, so this
code exposes only an interface for doing ping.

Signed-off-by: Thomas Ptacek <thomas@sockpuppet.org>
[Jason: rework structure, match std go interfaces, add example code]
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tun/netstack/examples/ping_client.go [new file with mode: 0644]
tun/netstack/tun.go