Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Dan Lüdtke" <mail@danrl.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Structure(d) output of wg?
Date: Wed, 14 Dec 2016 21:04:16 +0100	[thread overview]
Message-ID: <AD79A695-30E3-425D-9D7F-51AE2A25384D@danrl.com> (raw)

Hi Jason, everyone,

I'd like to discuss the topic of structured output. I am working on =
luci-app-wireguard* which aims to provide status information via the =
user-friendly LUCI interface in LEDE. While writing code to parse the =
output I realized that I may not be the only one who needs to structure =
wg's output. Would it make sense to add support for structured output =
now and thus prevent/reduce parsers and half-baked solutions popping up =
in higher level software in the future?

Something like wg show --json
[
	{
		interface: "foo"
		private_key: "(hidden)",
		preshared_key: "(hidden)",
		listen_port: "12345",
		peers: [
			{
				public_key: "dfkdjkfjslfkd...",
				bandwith: "...",
				last_handshake: "..."
			},
			{
				public_key: "sdj9ad....",
				allowed_ips: "2001:db8::/64",
				bandwith: "..."
			}
		]
	},
	{
		interface: "foo2",
		...you get the idea...
	}
]

JSON is just one idea because it allows nice structuring. CSV, TSV or =
whatever is lean and easy to implement may be an equally good option. =
While structuring, we could also provide even more structure than the =
usual stdout of wg provides. Candidate for lists: allowed_ips
Candidate for sub-structures: bandwith (rx, tx)

What do you think?

Cheers,

Dan


*: Not to be confused with luci-proto-wireguard, kmod-wireguard, and =
wireguard-tools. They provide functionality and configuration =
interfaces, but not monitoring/fancy output.=

             reply	other threads:[~2016-12-14 19:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 20:04 Dan Lüdtke [this message]
2016-12-14 21:09 ` Jason A. Donenfeld
2016-12-14 21:16   ` Dan Lüdtke
2016-12-14 21:15     ` 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=AD79A695-30E3-425D-9D7F-51AE2A25384D@danrl.com \
    --to=mail@danrl.com \
    --cc=Jason@zx2c4.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).