wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Matt Layher <mdlayher@gmail.com>
To: wireguard@lists.zx2c4.com
Subject: wireguardnl: Go package for interacting with WireGuard via generic netlink
Date: Sat, 21 Jul 2018 15:19:22 -0400	[thread overview]
Message-ID: <0f15823a-d527-f281-1d4b-735d227e3844@gmail.com> (raw)

Hi all!

I've heard quite a few good things about WireGuard and decided to try it 
out at home today.  On top of that, I've done a lot of work with netlink 
and generic netlink in Go, and decided to implement a Go package that 
can use wireguard's generic netlink interface in the same way as the 
"wg" tool.  To avoid confusion with "wireguard" or "wireguard-go", I've 
chosen "wireguardnl" as the name:

https://github.com/mdlayher/wireguardnl

This was just a fun experiment for me (it works, but no tests yet), but 
perhaps it'll be useful for someone who wants to inspect the kernel 
module from a Go program (no support for changing settings as of now, 
but that'd be fun!).

While I'm here, I did have one inquiry about "WG_CMD_GET_DEVICE": after 
working with a handful of generic netlink families, I was slightly 
surprised to see that a request paired with "NLM_F_DUMP" doesn't return 
a list of all WireGuard devices from the kernel.

Per the documentation, sending an interface index or name attribute 
works just fine to retrieve a single device, but perhaps it'd be nice to 
be able to just dump a list of all WireGuard devices when "NLM_F_DUMP" 
and no attributes are specified.  For the time being, I can easily work 
around this with my "Devices" method by attempting to query the kernel 
for WireGuard device information about each of my network interfaces, 
and then filter out the ones that return "ENOTSUP".

Thanks for WireGuard, it seems extremely promising so far!

- Matt Layher

             reply	other threads:[~2018-07-21 19:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-21 19:19 Matt Layher [this message]
2018-07-23 11:59 ` wireguardnl: Go package for interacting with WireGuard via generic netlink Jason A. Donenfeld
2018-07-23 13:43   ` Matt Layher
2018-07-23 15:12     ` Jason A. Donenfeld
2018-07-23 15:29       ` Matt Layher
2018-07-23 15:59         ` Matt Layher
2018-07-23 16:22           ` Jason A. Donenfeld
2018-07-23 16:22         ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0f15823a-d527-f281-1d4b-735d227e3844@gmail.com \
    --to=mdlayher@gmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).