]> 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>
Tue, 1 Feb 2022 19:16:42 +0000 (20:16 +0100)
commita702597e228006460b1b9f01fb9d8cc12327132f
tree1fb3df08ceb5b5f1388b69fc38cea896b7557de1
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.

Currently is missing:
- Write deadlines
- Context support

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