tailcfg,ipn/ipnlocal,wgengine: add values to PeerCapabilities

Define PeerCapabilty and PeerCapMap as the new way of sending down
inter-peer capability information.

Previously, this was unstructured and you could only send down strings
which got too limiting for certain usecases. Instead add the ability
to send down raw JSON messages that are opaque to Tailscale but provide
the applications to define them however they wish.

Also update accessors to use the new values.

Updates #4217

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-07-24 21:07:00 -07:00
committed by Maisem Ali
parent 306deea03a
commit 1ecc16da5f
13 changed files with 139 additions and 68 deletions

View File

@@ -796,7 +796,7 @@ func packetFilterWithIngressCaps() []tailcfg.FilterRule {
CapGrant: []tailcfg.CapGrant{
{
Dsts: []netip.Prefix{tsaddr.AllIPv4(), tsaddr.AllIPv6()},
Caps: []string{tailcfg.CapabilityIngress},
Caps: []tailcfg.PeerCapability{tailcfg.PeerCapabilityIngress},
},
},
})