From 896041e442362fb225a01418709df1565a66bc26 Mon Sep 17 00:00:00 2001 From: Abhishek Kondur Date: Tue, 31 Oct 2023 10:22:30 +0400 Subject: [PATCH] add peer network info to pull --- controllers/hosts.go | 11 ++++++----- models/structs.go | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/controllers/hosts.go b/controllers/hosts.go index 6c6bbeccb..9f3b1edf4 100644 --- a/controllers/hosts.go +++ b/controllers/hosts.go @@ -123,11 +123,12 @@ func pull(w http.ResponseWriter, r *http.Request) { serverConf.TrafficKey = key response := models.HostPull{ - Host: *host, - Nodes: logic.GetHostNodes(host), - ServerConfig: serverConf, - Peers: hPU.Peers, - PeerIDs: hPU.PeerIDs, + Host: *host, + Nodes: logic.GetHostNodes(host), + ServerConfig: serverConf, + Peers: hPU.Peers, + PeerIDs: hPU.PeerIDs, + HostNetworkInfo: hPU.HostNetworkInfo, } logger.Log(1, hostID, "completed a pull") diff --git a/models/structs.go b/models/structs.go index c67d5eeea..906d16cf8 100644 --- a/models/structs.go +++ b/models/structs.go @@ -223,11 +223,12 @@ type TrafficKeys struct { // HostPull - response of a host's pull type HostPull struct { - Host Host `json:"host" yaml:"host"` - Nodes []Node `json:"nodes" yaml:"nodes"` - Peers []wgtypes.PeerConfig `json:"peers" yaml:"peers"` - ServerConfig ServerConfig `json:"server_config" yaml:"server_config"` - PeerIDs PeerMap `json:"peer_ids,omitempty" yaml:"peer_ids,omitempty"` + Host Host `json:"host" yaml:"host"` + Nodes []Node `json:"nodes" yaml:"nodes"` + Peers []wgtypes.PeerConfig `json:"peers" yaml:"peers"` + ServerConfig ServerConfig `json:"server_config" yaml:"server_config"` + PeerIDs PeerMap `json:"peer_ids,omitempty" yaml:"peer_ids,omitempty"` + HostNetworkInfo HostInfoMap `json:"host_network_info,omitempty" yaml:"host_network_info,omitempty"` } // NodeGet - struct for a single node get response