]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
device: add Device.ListenPort and Device.SetListenPort js/sample-api
authorJosh Bleecher Snyder <josh@tailscale.com>
Tue, 22 Dec 2020 19:12:54 +0000 (11:12 -0800)
committerJosh Bleecher Snyder <josh@tailscale.com>
Tue, 22 Dec 2020 19:29:28 +0000 (11:29 -0800)
commit4794021bb8c697f107e6a2689bb9096eabb17888
tree398f09211d65d0bd85ca6ece81072abd20868ebb
parent60b271ff95405de2b36ef99b64bd42516218e2e8
device: add Device.ListenPort and Device.SetListenPort

This is a sample commit for a possible way to make
a Go API that lives alongside UAPI.

The general idea is to add Device and Peer methods
corresponding to UAPI directives, including a way to
look up a peer from a device based on a public key,
as in UAPI.

The UAPI code then deals with parsing and generating textual
input/output, and calls the Go methods to do the work.

This commit also contains a bug fix for a racy access of device.net.port
I will send an independently commit that fixes those directly in UAPI.
This commit is NOT meant to be merged as-is.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
device/device.go
device/uapi.go