TUN-6142: Add tunnel details support to RPC

This commit adds the tunnel details to RPC register connection response
so we can have access to some of the details associacted to the tunnel
that only the edge knows.

Currently this is limited to knowing if the tunnel is remotely managed
or not. In the future we could extend this with more information.
This commit is contained in:
João Oliveirinha
2022-04-27 14:34:11 +01:00
parent f3244db861
commit d68ad89159
3 changed files with 243 additions and 229 deletions

View File

@@ -224,8 +224,9 @@ func (a *TunnelAuth) UnmarshalCapnproto(s tunnelrpc.TunnelAuth) error {
}
type ConnectionDetails struct {
UUID uuid.UUID
Location string
UUID uuid.UUID
Location string
TunnelIsRemotelyManaged bool
}
func (details *ConnectionDetails) MarshalCapnproto(s tunnelrpc.ConnectionDetails) error {
@@ -235,6 +236,7 @@ func (details *ConnectionDetails) MarshalCapnproto(s tunnelrpc.ConnectionDetails
if err := s.SetLocationName(details.Location); err != nil {
return err
}
s.SetTunnelIsRemotelyManaged(details.TunnelIsRemotelyManaged)
return nil
}
@@ -252,6 +254,7 @@ func (details *ConnectionDetails) UnmarshalCapnproto(s tunnelrpc.ConnectionDetai
if err != nil {
return err
}
details.TunnelIsRemotelyManaged = s.TunnelIsRemotelyManaged()
return err
}