Prechádzať zdrojové kódy

add inet info to peer update

abhishek9686 1 rok pred
rodič
commit
718535cc19
2 zmenil súbory, kde vykonal 12 pridanie a 11 odobranie
  1. 1 0
      controllers/hosts.go
  2. 11 11
      models/structs.go

+ 1 - 0
controllers/hosts.go

@@ -143,6 +143,7 @@ func pull(w http.ResponseWriter, r *http.Request) {
 		FwUpdate:        hPU.FwUpdate,
 		ChangeDefaultGw: hPU.ChangeDefaultGw,
 		DefaultGwIp:     hPU.DefaultGwIp,
+		IsInternetGw:    hPU.IsInternetGw,
 	}
 
 	logger.Log(1, hostID, "completed a pull")

+ 11 - 11
models/structs.go

@@ -232,17 +232,17 @@ 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"`
-	HostNetworkInfo   HostInfoMap           `json:"host_network_info,omitempty"  yaml:"host_network_info,omitempty"`
-	EgressRoutes      []EgressNetworkRoutes `json:"egress_network_routes"`
-	FwUpdate          FwUpdate              `json:"fw_update"`
-	ChangeDefaultGw   bool                  `json:"change_default_gw"`
-	DefaultGwIp       net.IP                `json:"default_gw_ip"`
-	DefaultGwEndpoint net.IPNet             `json:"default_gw_endpoint"`
+	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"`
+	EgressRoutes    []EgressNetworkRoutes `json:"egress_network_routes"`
+	FwUpdate        FwUpdate              `json:"fw_update"`
+	ChangeDefaultGw bool                  `json:"change_default_gw"`
+	DefaultGwIp     net.IP                `json:"default_gw_ip"`
+	IsInternetGw    bool                  `json:"is_inet_gw"`
 }
 
 type DefaultGwInfo struct {