From 49e9113e0fbd2c0b8299985d5142c5c0fc2c1bbd Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Tue, 5 Jul 2022 19:47:50 +0200 Subject: [PATCH] Enhance status command (#382) Print peer status from the package Added --detail flag for detailed status output --- client/cmd/status.go | 260 +++++++++- client/internal/connect.go | 1 + client/internal/engine.go | 10 +- client/internal/peer/status.go | 8 +- client/internal/peer/status_test.go | 6 +- client/proto/daemon.pb.go | 706 ++++++++++++++++++++++++---- client/proto/daemon.proto | 44 +- client/server/server.go | 47 +- client/status/status.go | 8 + client/status/status_test.go | 16 + 10 files changed, 978 insertions(+), 128 deletions(-) diff --git a/client/cmd/status.go b/client/cmd/status.go index a0444a62d..6dcd8cae6 100644 --- a/client/cmd/status.go +++ b/client/cmd/status.go @@ -3,13 +3,23 @@ package cmd import ( "context" "fmt" + "github.com/netbirdio/netbird/client/internal" + "github.com/netbirdio/netbird/client/internal/peer" + "github.com/netbirdio/netbird/client/proto" + nbStatus "github.com/netbirdio/netbird/client/status" "github.com/netbirdio/netbird/util" - "github.com/spf13/cobra" "google.golang.org/grpc/status" + "net/netip" + "sort" + "strings" +) - "github.com/netbirdio/netbird/client/internal" - "github.com/netbirdio/netbird/client/proto" +var ( + detailFlag bool + ipsFilter []string + statusFilter string + ipsFilterMap map[string]struct{} ) var statusCmd = &cobra.Command{ @@ -20,7 +30,12 @@ var statusCmd = &cobra.Command{ cmd.SetOut(cmd.OutOrStdout()) - err := util.InitLog(logLevel, "console") + err := parseFilters() + if err != nil { + return err + } + + err = util.InitLog(logLevel, "console") if err != nil { return fmt.Errorf("failed initializing log %v", err) } @@ -35,21 +50,244 @@ var statusCmd = &cobra.Command{ } defer conn.Close() - resp, err := proto.NewDaemonServiceClient(conn).Status(cmd.Context(), &proto.StatusRequest{}) + resp, err := proto.NewDaemonServiceClient(conn).Status(cmd.Context(), &proto.StatusRequest{GetFullPeerStatus: true}) if err != nil { return fmt.Errorf("status failed: %v", status.Convert(err).Message()) } - cmd.Printf("Status: %s\n\n", resp.GetStatus()) + daemonStatus := fmt.Sprintf("Daemon status: %s\n", resp.GetStatus()) if resp.GetStatus() == string(internal.StatusNeedsLogin) || resp.GetStatus() == string(internal.StatusLoginFailed) { - cmd.Printf("Run UP command to log in with SSO (interactive login):\n\n" + - " netbird up \n\n" + - "If you are running a self-hosted version and no SSO provider has been configured in your Management Server,\n" + - "you can use a setup-key:\n\n netbird up --management-url --setup-key \n\n" + - "More info: https://www.netbird.io/docs/overview/setup-keys\n\n") + cmd.Printf("%s\n"+ + "Run UP command to log in with SSO (interactive login):\n\n"+ + " netbird up \n\n"+ + "If you are running a self-hosted version and no SSO provider has been configured in your Management Server,\n"+ + "you can use a setup-key:\n\n netbird up --management-url --setup-key \n\n"+ + "More info: https://www.netbird.io/docs/overview/setup-keys\n\n", + daemonStatus, + ) + return nil } + pbFullStatus := resp.GetFullStatus() + fullStatus := fromProtoFullStatus(pbFullStatus) + + cmd.Print(parseFullStatus(fullStatus, detailFlag, daemonStatus)) + return nil }, } + +func init() { + ipsFilterMap = make(map[string]struct{}) + statusCmd.PersistentFlags().BoolVarP(&detailFlag, "detail", "d", false, "display detailed status information") + statusCmd.PersistentFlags().StringSliceVar(&ipsFilter, "filter-by-ips", []string{}, "filters the detailed output by a list of one or more IPs, e.g. --filter-by-ips 100.64.0.100,100.64.0.200") + statusCmd.PersistentFlags().StringVar(&statusFilter, "filter-by-status", "", "filters the detailed output by connection status(connected|disconnected), e.g. --filter-by-status connected") +} + +func parseFilters() error { + switch strings.ToLower(statusFilter) { + case "", "disconnected", "connected": + default: + return fmt.Errorf("wrong status filter, should be one of connected|disconnected, got: %s", statusFilter) + } + + if len(ipsFilter) > 0 { + for _, addr := range ipsFilter { + _, err := netip.ParseAddr(addr) + if err != nil { + return fmt.Errorf("got an invalid IP address in the filter: address %s, error %s", addr, err) + } + ipsFilterMap[addr] = struct{}{} + } + } + return nil +} + +func fromProtoFullStatus(pbFullStatus *proto.FullStatus) nbStatus.FullStatus { + var fullStatus nbStatus.FullStatus + fullStatus.ManagementState.URL = pbFullStatus.ManagementState.URL + fullStatus.ManagementState.Connected = pbFullStatus.ManagementState.Connected + + fullStatus.SignalState.URL = pbFullStatus.SignalState.URL + fullStatus.SignalState.Connected = pbFullStatus.SignalState.Connected + + fullStatus.LocalPeerState.IP = pbFullStatus.LocalPeerState.IP + fullStatus.LocalPeerState.PubKey = pbFullStatus.LocalPeerState.PubKey + fullStatus.LocalPeerState.KernelInterface = pbFullStatus.LocalPeerState.KernelInterface + + var peersState []nbStatus.PeerState + + for _, pbPeerState := range pbFullStatus.Peers { + timeLocal := pbPeerState.ConnStatusUpdate.AsTime().Local() + peerState := nbStatus.PeerState{ + IP: pbPeerState.IP, + PubKey: pbPeerState.PubKey, + ConnStatus: pbPeerState.ConnStatus, + ConnStatusUpdate: timeLocal, + Relayed: pbPeerState.Relayed, + Direct: pbPeerState.Direct, + LocalIceCandidateType: pbPeerState.LocalIceCandidateType, + RemoteIceCandidateType: pbPeerState.RemoteIceCandidateType, + } + peersState = append(peersState, peerState) + } + + fullStatus.Peers = peersState + + return fullStatus +} + +func parseFullStatus(fullStatus nbStatus.FullStatus, printDetail bool, daemonStatus string) string { + var ( + managementStatusURL = "" + signalStatusURL = "" + managementConnString = "Disconnected" + signalConnString = "Disconnected" + interfaceTypeString = "Userspace" + ) + + if printDetail { + managementStatusURL = fmt.Sprintf(" to %s", fullStatus.ManagementState.URL) + signalStatusURL = fmt.Sprintf(" to %s", fullStatus.SignalState.URL) + } + + if fullStatus.ManagementState.Connected { + managementConnString = "Connected" + } + + if fullStatus.SignalState.Connected { + signalConnString = "Connected" + } + + interfaceIP := fullStatus.LocalPeerState.IP + + if fullStatus.LocalPeerState.KernelInterface { + interfaceTypeString = "Kernel" + } else if fullStatus.LocalPeerState.IP == "" { + interfaceTypeString = "N/A" + interfaceIP = "N/A" + } + + parsedPeersString, peersConnected := parsePeers(fullStatus.Peers, printDetail) + + peersCountString := fmt.Sprintf("%d/%d Connected", peersConnected, len(fullStatus.Peers)) + + summary := fmt.Sprintf( + "%s"+ // daemon status + "Management: %s%s\n"+ + "Signal: %s%s\n"+ + "NetBird IP: %s\n"+ + "Interface type: %s\n"+ + "Peers count: %s\n", + daemonStatus, + managementConnString, + managementStatusURL, + signalConnString, + signalStatusURL, + interfaceIP, + interfaceTypeString, + peersCountString, + ) + + if printDetail { + return fmt.Sprintf( + "Peers detail:"+ + "%s\n"+ + "%s", + parsedPeersString, + summary, + ) + } + return summary +} + +func parsePeers(peers []nbStatus.PeerState, printDetail bool) (string, int) { + var ( + peersString = "" + peersConnected = 0 + ) + + if len(peers) > 0 { + sort.SliceStable(peers, func(i, j int) bool { + iAddr, _ := netip.ParseAddr(peers[i].IP) + jAddr, _ := netip.ParseAddr(peers[j].IP) + return iAddr.Compare(jAddr) == -1 + }) + } + + connectedStatusString := peer.StatusConnected.String() + + for _, peerState := range peers { + peerConnectionStatus := false + if peerState.ConnStatus == connectedStatusString { + peersConnected = peersConnected + 1 + peerConnectionStatus = true + } + + if printDetail { + + if skipDetailByFilters(peerState, peerConnectionStatus) { + continue + } + + localICE := "-" + remoteICE := "-" + connType := "-" + + if peerConnectionStatus { + localICE = peerState.LocalIceCandidateType + remoteICE = peerState.RemoteIceCandidateType + connType = "P2P" + if peerState.Relayed { + connType = "Relayed" + } + } + + peerString := fmt.Sprintf( + "\n Peer:\n"+ + " NetBird IP: %s\n"+ + " Public key: %s\n"+ + " Status: %s\n"+ + " -- detail --\n"+ + " Connection type: %s\n"+ + " Direct: %t\n"+ + " ICE candidate (Local/Remote): %s/%s\n"+ + " Last connection update: %s\n", + peerState.IP, + peerState.PubKey, + peerState.ConnStatus, + connType, + peerState.Direct, + localICE, + remoteICE, + peerState.ConnStatusUpdate.Format("2006-01-02 15:04:05"), + ) + + peersString = peersString + peerString + } + } + return peersString, peersConnected +} + +func skipDetailByFilters(peerState nbStatus.PeerState, isConnected bool) bool { + statusEval := false + ipEval := false + + if statusFilter != "" { + lowerStatusFilter := strings.ToLower(statusFilter) + if lowerStatusFilter == "disconnected" && isConnected { + statusEval = true + } else if lowerStatusFilter == "connected" && !isConnected { + statusEval = true + } + } + + if len(ipsFilter) > 0 { + _, ok := ipsFilterMap[peerState.IP] + if !ok { + ipEval = true + } + } + return statusEval || ipEval +} diff --git a/client/internal/connect.go b/client/internal/connect.go index dfcb1ebf8..ab7126d88 100644 --- a/client/internal/connect.go +++ b/client/internal/connect.go @@ -75,6 +75,7 @@ func RunClient(ctx context.Context, config *Config, statusRecorder *nbStatus.Sta engineCtx, cancel := context.WithCancel(ctx) defer func() { statusRecorder.MarkManagementDisconnected(managementURL) + statusRecorder.CleanLocalPeerState() cancel() }() diff --git a/client/internal/engine.go b/client/internal/engine.go index d93ec9642..cd969c0cf 100644 --- a/client/internal/engine.go +++ b/client/internal/engine.go @@ -305,15 +305,17 @@ func (e *Engine) removePeer(peerKey string) error { e.sshServer.RemoveAuthorizedKey(peerKey) } - conn, exists := e.peerConns[peerKey] - if exists { + defer func() { err := e.statusRecorder.RemovePeer(peerKey) if err != nil { - log.Warn("received error when removing peer from status recorder: ", err) + log.Warnf("received error when removing peer %s from status recorder: %v", peerKey, err) } + }() + conn, exists := e.peerConns[peerKey] + if exists { delete(e.peerConns, peerKey) - err = conn.Close() + err := conn.Close() if err != nil { switch err.(type) { case *peer.ConnectionAlreadyClosedError: diff --git a/client/internal/peer/status.go b/client/internal/peer/status.go index a0cfa4dbe..b542dc21b 100644 --- a/client/internal/peer/status.go +++ b/client/internal/peer/status.go @@ -7,11 +7,11 @@ type ConnStatus int func (s ConnStatus) String() string { switch s { case StatusConnecting: - return "StatusConnecting" + return "Connecting" case StatusConnected: - return "StatusConnected" + return "Connected" case StatusDisconnected: - return "StatusDisconnected" + return "Disconnected" default: log.Errorf("unknown status: %d", s) return "INVALID_PEER_CONNECTION_STATUS" @@ -19,7 +19,7 @@ func (s ConnStatus) String() string { } const ( - StatusConnected = iota + StatusConnected ConnStatus = iota StatusConnecting StatusDisconnected ) diff --git a/client/internal/peer/status_test.go b/client/internal/peer/status_test.go index 54b172d3f..564fd41c1 100644 --- a/client/internal/peer/status_test.go +++ b/client/internal/peer/status_test.go @@ -12,9 +12,9 @@ func TestConnStatus_String(t *testing.T) { status ConnStatus want string }{ - {"StatusConnected", StatusConnected, "StatusConnected"}, - {"StatusDisconnected", StatusDisconnected, "StatusDisconnected"}, - {"StatusConnecting", StatusConnecting, "StatusConnecting"}, + {"StatusConnected", StatusConnected, "Connected"}, + {"StatusDisconnected", StatusDisconnected, "Disconnected"}, + {"StatusConnecting", StatusConnecting, "Connecting"}, } for _, table := range tables { diff --git a/client/proto/daemon.pb.go b/client/proto/daemon.pb.go index a5e65f542..900dc59c2 100644 --- a/client/proto/daemon.pb.go +++ b/client/proto/daemon.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.26.0 -// protoc v3.19.4 +// protoc v3.21.2 // source: daemon.proto package proto @@ -10,6 +10,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" _ "google.golang.org/protobuf/types/descriptorpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -332,6 +333,8 @@ type StatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + GetFullPeerStatus bool `protobuf:"varint,1,opt,name=getFullPeerStatus,proto3" json:"getFullPeerStatus,omitempty"` } func (x *StatusRequest) Reset() { @@ -366,13 +369,21 @@ func (*StatusRequest) Descriptor() ([]byte, []int) { return file_daemon_proto_rawDescGZIP(), []int{6} } +func (x *StatusRequest) GetGetFullPeerStatus() bool { + if x != nil { + return x.GetFullPeerStatus + } + return false +} + type StatusResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // status of the server. - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + FullStatus *FullStatus `protobuf:"bytes,2,opt,name=fullStatus,proto3" json:"fullStatus,omitempty"` } func (x *StatusResponse) Reset() { @@ -414,6 +425,13 @@ func (x *StatusResponse) GetStatus() string { return "" } +func (x *StatusResponse) GetFullStatus() *FullStatus { + if x != nil { + return x.FullStatus + } + return nil +} + type DownRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -612,83 +630,493 @@ func (x *GetConfigResponse) GetAdminURL() string { return "" } +// PeerState contains the latest state of a peer +type PeerState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IP string `protobuf:"bytes,1,opt,name=IP,proto3" json:"IP,omitempty"` + PubKey string `protobuf:"bytes,2,opt,name=pubKey,proto3" json:"pubKey,omitempty"` + ConnStatus string `protobuf:"bytes,3,opt,name=connStatus,proto3" json:"connStatus,omitempty"` + ConnStatusUpdate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=connStatusUpdate,proto3" json:"connStatusUpdate,omitempty"` + Relayed bool `protobuf:"varint,5,opt,name=relayed,proto3" json:"relayed,omitempty"` + Direct bool `protobuf:"varint,6,opt,name=direct,proto3" json:"direct,omitempty"` + LocalIceCandidateType string `protobuf:"bytes,7,opt,name=localIceCandidateType,proto3" json:"localIceCandidateType,omitempty"` + RemoteIceCandidateType string `protobuf:"bytes,8,opt,name=remoteIceCandidateType,proto3" json:"remoteIceCandidateType,omitempty"` +} + +func (x *PeerState) Reset() { + *x = PeerState{} + if protoimpl.UnsafeEnabled { + mi := &file_daemon_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerState) ProtoMessage() {} + +func (x *PeerState) ProtoReflect() protoreflect.Message { + mi := &file_daemon_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerState.ProtoReflect.Descriptor instead. +func (*PeerState) Descriptor() ([]byte, []int) { + return file_daemon_proto_rawDescGZIP(), []int{12} +} + +func (x *PeerState) GetIP() string { + if x != nil { + return x.IP + } + return "" +} + +func (x *PeerState) GetPubKey() string { + if x != nil { + return x.PubKey + } + return "" +} + +func (x *PeerState) GetConnStatus() string { + if x != nil { + return x.ConnStatus + } + return "" +} + +func (x *PeerState) GetConnStatusUpdate() *timestamppb.Timestamp { + if x != nil { + return x.ConnStatusUpdate + } + return nil +} + +func (x *PeerState) GetRelayed() bool { + if x != nil { + return x.Relayed + } + return false +} + +func (x *PeerState) GetDirect() bool { + if x != nil { + return x.Direct + } + return false +} + +func (x *PeerState) GetLocalIceCandidateType() string { + if x != nil { + return x.LocalIceCandidateType + } + return "" +} + +func (x *PeerState) GetRemoteIceCandidateType() string { + if x != nil { + return x.RemoteIceCandidateType + } + return "" +} + +// LocalPeerState contains the latest state of the local peer +type LocalPeerState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IP string `protobuf:"bytes,1,opt,name=IP,proto3" json:"IP,omitempty"` + PubKey string `protobuf:"bytes,2,opt,name=pubKey,proto3" json:"pubKey,omitempty"` + KernelInterface bool `protobuf:"varint,3,opt,name=kernelInterface,proto3" json:"kernelInterface,omitempty"` +} + +func (x *LocalPeerState) Reset() { + *x = LocalPeerState{} + if protoimpl.UnsafeEnabled { + mi := &file_daemon_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LocalPeerState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalPeerState) ProtoMessage() {} + +func (x *LocalPeerState) ProtoReflect() protoreflect.Message { + mi := &file_daemon_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LocalPeerState.ProtoReflect.Descriptor instead. +func (*LocalPeerState) Descriptor() ([]byte, []int) { + return file_daemon_proto_rawDescGZIP(), []int{13} +} + +func (x *LocalPeerState) GetIP() string { + if x != nil { + return x.IP + } + return "" +} + +func (x *LocalPeerState) GetPubKey() string { + if x != nil { + return x.PubKey + } + return "" +} + +func (x *LocalPeerState) GetKernelInterface() bool { + if x != nil { + return x.KernelInterface + } + return false +} + +// SignalState contains the latest state of a signal connection +type SignalState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + URL string `protobuf:"bytes,1,opt,name=URL,proto3" json:"URL,omitempty"` + Connected bool `protobuf:"varint,2,opt,name=connected,proto3" json:"connected,omitempty"` +} + +func (x *SignalState) Reset() { + *x = SignalState{} + if protoimpl.UnsafeEnabled { + mi := &file_daemon_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignalState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignalState) ProtoMessage() {} + +func (x *SignalState) ProtoReflect() protoreflect.Message { + mi := &file_daemon_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignalState.ProtoReflect.Descriptor instead. +func (*SignalState) Descriptor() ([]byte, []int) { + return file_daemon_proto_rawDescGZIP(), []int{14} +} + +func (x *SignalState) GetURL() string { + if x != nil { + return x.URL + } + return "" +} + +func (x *SignalState) GetConnected() bool { + if x != nil { + return x.Connected + } + return false +} + +// ManagementState contains the latest state of a management connection +type ManagementState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + URL string `protobuf:"bytes,1,opt,name=URL,proto3" json:"URL,omitempty"` + Connected bool `protobuf:"varint,2,opt,name=connected,proto3" json:"connected,omitempty"` +} + +func (x *ManagementState) Reset() { + *x = ManagementState{} + if protoimpl.UnsafeEnabled { + mi := &file_daemon_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ManagementState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManagementState) ProtoMessage() {} + +func (x *ManagementState) ProtoReflect() protoreflect.Message { + mi := &file_daemon_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManagementState.ProtoReflect.Descriptor instead. +func (*ManagementState) Descriptor() ([]byte, []int) { + return file_daemon_proto_rawDescGZIP(), []int{15} +} + +func (x *ManagementState) GetURL() string { + if x != nil { + return x.URL + } + return "" +} + +func (x *ManagementState) GetConnected() bool { + if x != nil { + return x.Connected + } + return false +} + +// FullStatus contains the full state held by the Status instance +type FullStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ManagementState *ManagementState `protobuf:"bytes,1,opt,name=managementState,proto3" json:"managementState,omitempty"` + SignalState *SignalState `protobuf:"bytes,2,opt,name=signalState,proto3" json:"signalState,omitempty"` + LocalPeerState *LocalPeerState `protobuf:"bytes,3,opt,name=localPeerState,proto3" json:"localPeerState,omitempty"` + Peers []*PeerState `protobuf:"bytes,4,rep,name=peers,proto3" json:"peers,omitempty"` +} + +func (x *FullStatus) Reset() { + *x = FullStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_daemon_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FullStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FullStatus) ProtoMessage() {} + +func (x *FullStatus) ProtoReflect() protoreflect.Message { + mi := &file_daemon_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FullStatus.ProtoReflect.Descriptor instead. +func (*FullStatus) Descriptor() ([]byte, []int) { + return file_daemon_proto_rawDescGZIP(), []int{16} +} + +func (x *FullStatus) GetManagementState() *ManagementState { + if x != nil { + return x.ManagementState + } + return nil +} + +func (x *FullStatus) GetSignalState() *SignalState { + if x != nil { + return x.SignalState + } + return nil +} + +func (x *FullStatus) GetLocalPeerState() *LocalPeerState { + if x != nil { + return x.LocalPeerState + } + return nil +} + +func (x *FullStatus) GetPeers() []*PeerState { + if x != nil { + return x.Peers + } + return nil +} + var File_daemon_proto protoreflect.FileDescriptor var file_daemon_proto_rawDesc = []byte{ 0x0a, 0x0c, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x74, - 0x75, 0x70, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x74, - 0x75, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x53, 0x68, 0x61, 0x72, - 0x65, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, - 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x12, - 0x1a, 0x0a, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x22, 0xb5, 0x01, 0x0a, 0x0d, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, - 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x53, 0x53, 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x53, 0x53, 0x4f, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x28, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, - 0x52, 0x49, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x52, 0x49, 0x12, 0x38, 0x0a, 0x17, 0x76, 0x65, 0x72, + 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x90, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, + 0x74, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, + 0x74, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, + 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, + 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x22, 0xb5, 0x01, 0x0a, + 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, + 0x0a, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x53, 0x53, 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x53, 0x53, 0x4f, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x28, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x55, 0x52, 0x49, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x52, 0x49, 0x12, 0x38, 0x0a, 0x17, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x52, 0x49, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x52, 0x49, 0x43, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x52, 0x49, 0x43, 0x6f, 0x6d, 0x70, 0x6c, - 0x65, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x13, 0x57, 0x61, 0x69, 0x74, 0x53, 0x53, 0x4f, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x57, 0x61, 0x69, 0x74, 0x53, 0x53, - 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0b, - 0x0a, 0x09, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0c, 0x0a, 0x0a, 0x55, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x28, 0x0a, 0x0e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb3, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, - 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x55, 0x72, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, 0x69, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x46, - 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x22, 0x0a, - 0x0c, 0x70, 0x72, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, - 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, 0x32, 0xf7, 0x02, - 0x0a, 0x0d, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x36, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x14, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, - 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, - 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x57, 0x61, 0x69, 0x74, 0x53, - 0x53, 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, - 0x2e, 0x57, 0x61, 0x69, 0x74, 0x53, 0x53, 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x57, 0x61, - 0x69, 0x74, 0x53, 0x53, 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x02, 0x55, 0x70, 0x12, 0x11, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, - 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x2e, - 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x33, - 0x0a, 0x04, 0x44, 0x6f, 0x77, 0x6e, 0x12, 0x13, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, - 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x64, 0x61, - 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, - 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x08, 0x5a, 0x06, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x65, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x13, 0x57, 0x61, 0x69, 0x74, 0x53, 0x53, 0x4f, 0x4c, + 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x57, 0x61, 0x69, 0x74, 0x53, + 0x53, 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x0b, 0x0a, 0x09, 0x55, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0c, 0x0a, 0x0a, + 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x67, + 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x50, + 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x5c, 0x0a, 0x0e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x66, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x2e, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0a, 0x66, 0x75, 0x6c, + 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb3, 0x01, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x46, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x46, 0x69, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x46, 0x69, 0x6c, 0x65, + 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x52, 0x4c, + 0x22, 0xbb, 0x02, 0x0a, 0x09, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x49, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x50, 0x12, 0x16, + 0x0a, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x10, 0x63, 0x6f, + 0x6e, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x12, 0x34, 0x0a, 0x15, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x15, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x49, 0x63, 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, 0x63, + 0x65, 0x43, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x62, + 0x0a, 0x0e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x50, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x50, + 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x6b, 0x65, 0x72, 0x6e, + 0x65, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0f, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, + 0x63, 0x65, 0x22, 0x3d, 0x0a, 0x0b, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x52, 0x4c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x55, 0x52, 0x4c, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, + 0x64, 0x22, 0x41, 0x0a, 0x0f, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x52, 0x4c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x55, 0x52, 0x4c, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x65, 0x64, 0x22, 0xef, 0x01, 0x0a, 0x0a, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, + 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x61, + 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3e, 0x0a, + 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, + 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0e, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x27, 0x0a, + 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, + 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x32, 0xf7, 0x02, 0x0a, 0x0d, 0x44, 0x61, 0x65, 0x6d, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, + 0x6e, 0x12, 0x14, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, + 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x4b, 0x0a, 0x0c, 0x57, 0x61, 0x69, 0x74, 0x53, 0x53, 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x12, 0x1b, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x53, 0x53, + 0x4f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x57, 0x61, 0x69, 0x74, 0x53, 0x53, 0x4f, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2d, 0x0a, + 0x02, 0x55, 0x70, 0x12, 0x11, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x55, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, + 0x55, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x15, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x04, 0x44, 0x6f, 0x77, 0x6e, 0x12, + 0x13, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, + 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, + 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x2e, 0x64, 0x61, 0x65, 0x6d, + 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x08, 0x5a, 0x06, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -703,39 +1131,51 @@ func file_daemon_proto_rawDescGZIP() []byte { return file_daemon_proto_rawDescData } -var file_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_daemon_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_daemon_proto_goTypes = []interface{}{ - (*LoginRequest)(nil), // 0: daemon.LoginRequest - (*LoginResponse)(nil), // 1: daemon.LoginResponse - (*WaitSSOLoginRequest)(nil), // 2: daemon.WaitSSOLoginRequest - (*WaitSSOLoginResponse)(nil), // 3: daemon.WaitSSOLoginResponse - (*UpRequest)(nil), // 4: daemon.UpRequest - (*UpResponse)(nil), // 5: daemon.UpResponse - (*StatusRequest)(nil), // 6: daemon.StatusRequest - (*StatusResponse)(nil), // 7: daemon.StatusResponse - (*DownRequest)(nil), // 8: daemon.DownRequest - (*DownResponse)(nil), // 9: daemon.DownResponse - (*GetConfigRequest)(nil), // 10: daemon.GetConfigRequest - (*GetConfigResponse)(nil), // 11: daemon.GetConfigResponse + (*LoginRequest)(nil), // 0: daemon.LoginRequest + (*LoginResponse)(nil), // 1: daemon.LoginResponse + (*WaitSSOLoginRequest)(nil), // 2: daemon.WaitSSOLoginRequest + (*WaitSSOLoginResponse)(nil), // 3: daemon.WaitSSOLoginResponse + (*UpRequest)(nil), // 4: daemon.UpRequest + (*UpResponse)(nil), // 5: daemon.UpResponse + (*StatusRequest)(nil), // 6: daemon.StatusRequest + (*StatusResponse)(nil), // 7: daemon.StatusResponse + (*DownRequest)(nil), // 8: daemon.DownRequest + (*DownResponse)(nil), // 9: daemon.DownResponse + (*GetConfigRequest)(nil), // 10: daemon.GetConfigRequest + (*GetConfigResponse)(nil), // 11: daemon.GetConfigResponse + (*PeerState)(nil), // 12: daemon.PeerState + (*LocalPeerState)(nil), // 13: daemon.LocalPeerState + (*SignalState)(nil), // 14: daemon.SignalState + (*ManagementState)(nil), // 15: daemon.ManagementState + (*FullStatus)(nil), // 16: daemon.FullStatus + (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp } var file_daemon_proto_depIdxs = []int32{ - 0, // 0: daemon.DaemonService.Login:input_type -> daemon.LoginRequest - 2, // 1: daemon.DaemonService.WaitSSOLogin:input_type -> daemon.WaitSSOLoginRequest - 4, // 2: daemon.DaemonService.Up:input_type -> daemon.UpRequest - 6, // 3: daemon.DaemonService.Status:input_type -> daemon.StatusRequest - 8, // 4: daemon.DaemonService.Down:input_type -> daemon.DownRequest - 10, // 5: daemon.DaemonService.GetConfig:input_type -> daemon.GetConfigRequest - 1, // 6: daemon.DaemonService.Login:output_type -> daemon.LoginResponse - 3, // 7: daemon.DaemonService.WaitSSOLogin:output_type -> daemon.WaitSSOLoginResponse - 5, // 8: daemon.DaemonService.Up:output_type -> daemon.UpResponse - 7, // 9: daemon.DaemonService.Status:output_type -> daemon.StatusResponse - 9, // 10: daemon.DaemonService.Down:output_type -> daemon.DownResponse - 11, // 11: daemon.DaemonService.GetConfig:output_type -> daemon.GetConfigResponse - 6, // [6:12] is the sub-list for method output_type - 0, // [0:6] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 16, // 0: daemon.StatusResponse.fullStatus:type_name -> daemon.FullStatus + 17, // 1: daemon.PeerState.connStatusUpdate:type_name -> google.protobuf.Timestamp + 15, // 2: daemon.FullStatus.managementState:type_name -> daemon.ManagementState + 14, // 3: daemon.FullStatus.signalState:type_name -> daemon.SignalState + 13, // 4: daemon.FullStatus.localPeerState:type_name -> daemon.LocalPeerState + 12, // 5: daemon.FullStatus.peers:type_name -> daemon.PeerState + 0, // 6: daemon.DaemonService.Login:input_type -> daemon.LoginRequest + 2, // 7: daemon.DaemonService.WaitSSOLogin:input_type -> daemon.WaitSSOLoginRequest + 4, // 8: daemon.DaemonService.Up:input_type -> daemon.UpRequest + 6, // 9: daemon.DaemonService.Status:input_type -> daemon.StatusRequest + 8, // 10: daemon.DaemonService.Down:input_type -> daemon.DownRequest + 10, // 11: daemon.DaemonService.GetConfig:input_type -> daemon.GetConfigRequest + 1, // 12: daemon.DaemonService.Login:output_type -> daemon.LoginResponse + 3, // 13: daemon.DaemonService.WaitSSOLogin:output_type -> daemon.WaitSSOLoginResponse + 5, // 14: daemon.DaemonService.Up:output_type -> daemon.UpResponse + 7, // 15: daemon.DaemonService.Status:output_type -> daemon.StatusResponse + 9, // 16: daemon.DaemonService.Down:output_type -> daemon.DownResponse + 11, // 17: daemon.DaemonService.GetConfig:output_type -> daemon.GetConfigResponse + 12, // [12:18] is the sub-list for method output_type + 6, // [6:12] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_daemon_proto_init() } @@ -888,6 +1328,66 @@ func file_daemon_proto_init() { return nil } } + file_daemon_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_daemon_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LocalPeerState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_daemon_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignalState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_daemon_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManagementState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_daemon_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FullStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -895,7 +1395,7 @@ func file_daemon_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_daemon_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 17, NumExtensions: 0, NumServices: 1, }, diff --git a/client/proto/daemon.proto b/client/proto/daemon.proto index 67f0ec62d..e45333b4d 100644 --- a/client/proto/daemon.proto +++ b/client/proto/daemon.proto @@ -1,6 +1,7 @@ syntax = "proto3"; import "google/protobuf/descriptor.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "/proto"; @@ -59,11 +60,14 @@ message UpRequest {} message UpResponse {} -message StatusRequest{} +message StatusRequest{ + bool getFullPeerStatus = 1; +} message StatusResponse{ // status of the server. string status = 1; + FullStatus fullStatus = 2; } message DownRequest {} @@ -88,3 +92,41 @@ message GetConfigResponse { // adminURL settings value. string adminURL = 5; } + +// PeerState contains the latest state of a peer +message PeerState { + string IP = 1; + string pubKey = 2; + string connStatus = 3; + google.protobuf.Timestamp connStatusUpdate = 4; + bool relayed = 5; + bool direct = 6; + string localIceCandidateType = 7; + string remoteIceCandidateType =8; +} + +// LocalPeerState contains the latest state of the local peer +message LocalPeerState { + string IP = 1; + string pubKey = 2; + bool kernelInterface =3; +} + +// SignalState contains the latest state of a signal connection +message SignalState { + string URL = 1; + bool connected = 2; +} + +// ManagementState contains the latest state of a management connection +message ManagementState { + string URL = 1; + bool connected = 2; +} +// FullStatus contains the full state held by the Status instance +message FullStatus { + ManagementState managementState = 1; + SignalState signalState = 2; + LocalPeerState localPeerState = 3; + repeated PeerState peers = 4; +} \ No newline at end of file diff --git a/client/server/server.go b/client/server/server.go index 7e0f3bcc9..3358ad669 100644 --- a/client/server/server.go +++ b/client/server/server.go @@ -4,6 +4,7 @@ import ( "context" "fmt" nbStatus "github.com/netbirdio/netbird/client/status" + "google.golang.org/protobuf/types/known/timestamppb" "sync" "time" @@ -386,7 +387,7 @@ func (s *Server) Down(ctx context.Context, msg *proto.DownRequest) (*proto.DownR // Status starts engine work in the daemon. func (s *Server) Status( - ctx context.Context, + _ context.Context, msg *proto.StatusRequest, ) (*proto.StatusResponse, error) { s.mutex.Lock() @@ -397,7 +398,15 @@ func (s *Server) Status( return nil, err } - return &proto.StatusResponse{Status: string(status)}, nil + statusResponse := proto.StatusResponse{Status: string(status)} + + if msg.GetFullPeerStatus { + fullStatus := s.statusRecorder.GetFullStatus() + pbFullStatus := toProtoFullStatus(fullStatus) + statusResponse.FullStatus = pbFullStatus + } + + return &statusResponse, nil } // GetConfig of the daemon. @@ -433,3 +442,37 @@ func (s *Server) GetConfig(ctx context.Context, msg *proto.GetConfigRequest) (*p PreSharedKey: preSharedKey, }, nil } + +func toProtoFullStatus(fullStatus nbStatus.FullStatus) *proto.FullStatus { + pbFullStatus := proto.FullStatus{ + ManagementState: &proto.ManagementState{}, + SignalState: &proto.SignalState{}, + LocalPeerState: &proto.LocalPeerState{}, + Peers: []*proto.PeerState{}, + } + + pbFullStatus.ManagementState.URL = fullStatus.ManagementState.URL + pbFullStatus.ManagementState.Connected = fullStatus.ManagementState.Connected + + pbFullStatus.SignalState.URL = fullStatus.SignalState.URL + pbFullStatus.SignalState.Connected = fullStatus.SignalState.Connected + + pbFullStatus.LocalPeerState.IP = fullStatus.LocalPeerState.IP + pbFullStatus.LocalPeerState.PubKey = fullStatus.LocalPeerState.PubKey + pbFullStatus.LocalPeerState.KernelInterface = fullStatus.LocalPeerState.KernelInterface + + for _, peerState := range fullStatus.Peers { + pbPeerState := &proto.PeerState{ + IP: peerState.IP, + PubKey: peerState.PubKey, + ConnStatus: peerState.ConnStatus, + ConnStatusUpdate: timestamppb.New(peerState.ConnStatusUpdate), + Relayed: peerState.Relayed, + Direct: peerState.Direct, + LocalIceCandidateType: peerState.LocalIceCandidateType, + RemoteIceCandidateType: peerState.RemoteIceCandidateType, + } + pbFullStatus.Peers = append(pbFullStatus.Peers, pbPeerState) + } + return &pbFullStatus +} diff --git a/client/status/status.go b/client/status/status.go index 3880044cf..3b96a8098 100644 --- a/client/status/status.go +++ b/client/status/status.go @@ -124,6 +124,14 @@ func (d *Status) UpdateLocalPeerState(localPeerState LocalPeerState) { d.localPeer = localPeerState } +// CleanLocalPeerState cleans local peer status +func (d *Status) CleanLocalPeerState() { + d.mux.Lock() + defer d.mux.Unlock() + + d.localPeer = LocalPeerState{} +} + // MarkManagementDisconnected sets ManagementState to disconnected func (d *Status) MarkManagementDisconnected(managementURL string) { d.mux.Lock() diff --git a/client/status/status_test.go b/client/status/status_test.go index 92792f635..02abfbfe0 100644 --- a/client/status/status_test.go +++ b/client/status/status_test.go @@ -71,6 +71,22 @@ func TestUpdateLocalPeerState(t *testing.T) { assert.Equal(t, localPeerState, status.localPeer, "local peer status should be equal") } +func TestCleanLocalPeerState(t *testing.T) { + emptyLocalPeerState := LocalPeerState{} + localPeerState := LocalPeerState{ + IP: "10.10.10.10", + PubKey: "abc", + KernelInterface: false, + } + status := NewRecorder() + + status.localPeer = localPeerState + + status.CleanLocalPeerState() + + assert.Equal(t, emptyLocalPeerState, status.localPeer, "local peer status should be empty") +} + func TestUpdateSignalState(t *testing.T) { url := "https://signal" var tests = []struct {