Skip to content

Commit d68ad89

Browse files
committed
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.
1 parent f3244db commit d68ad89

File tree

3 files changed

+243
-229
lines changed

3 files changed

+243
-229
lines changed

tunnelrpc/pogs/connectionrpc.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,9 @@ func (a *TunnelAuth) UnmarshalCapnproto(s tunnelrpc.TunnelAuth) error {
224224
}
225225

226226
type ConnectionDetails struct {
227-
UUID uuid.UUID
228-
Location string
227+
UUID uuid.UUID
228+
Location string
229+
TunnelIsRemotelyManaged bool
229230
}
230231

231232
func (details *ConnectionDetails) MarshalCapnproto(s tunnelrpc.ConnectionDetails) error {
@@ -235,6 +236,7 @@ func (details *ConnectionDetails) MarshalCapnproto(s tunnelrpc.ConnectionDetails
235236
if err := s.SetLocationName(details.Location); err != nil {
236237
return err
237238
}
239+
s.SetTunnelIsRemotelyManaged(details.TunnelIsRemotelyManaged)
238240

239241
return nil
240242
}
@@ -252,6 +254,7 @@ func (details *ConnectionDetails) UnmarshalCapnproto(s tunnelrpc.ConnectionDetai
252254
if err != nil {
253255
return err
254256
}
257+
details.TunnelIsRemotelyManaged = s.TunnelIsRemotelyManaged()
255258

256259
return err
257260
}

tunnelrpc/tunnelrpc.capnp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ struct ConnectionDetails {
121121
uuid @0 :Data;
122122
# airport code of the colo where this connection landed
123123
locationName @1 :Text;
124+
# tells if the tunnel is remotely managed
125+
tunnelIsRemotelyManaged @2: Bool;
124126
}
125127

126128
struct TunnelAuth {

0 commit comments

Comments
 (0)