Browse Source

add network info to ingress model

abhishek9686 10 months ago
parent
commit
dc7e262602
2 changed files with 8 additions and 4 deletions
  1. 2 0
      logic/peers.go
  2. 6 4
      models/mqtt.go

+ 2 - 0
logic/peers.go

@@ -296,6 +296,8 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
 				hostPeerUpdate.FwUpdate.IngressInfo[node.ID.String()] = models.IngressInfo{
 					IngressID:     node.ID.String(),
 					UserIps:       extUserIps,
+					Network:       node.NetworkRange,
+					Network6:      node.NetworkRange6,
 					Rules:         GetFwRulesOnIngressGateway(node),
 					StaticNodeIps: GetStaticNodeIps(node),
 				}

+ 6 - 4
models/mqtt.go

@@ -34,10 +34,12 @@ type FwRule struct {
 
 // IngressInfo - struct for ingress info
 type IngressInfo struct {
-	IngressID     string   `json:"ingress_id"`
-	UserIps       []net.IP `json:"user_ips"`
-	StaticNodeIps []net.IP `json:"static_node_ips"`
-	Rules         []FwRule `json:"rules"`
+	IngressID     string    `json:"ingress_id"`
+	Network       net.IPNet `json:"network"`
+	Network6      net.IPNet `json:"network6"`
+	UserIps       []net.IP  `json:"user_ips"`
+	StaticNodeIps []net.IP  `json:"static_node_ips"`
+	Rules         []FwRule  `json:"rules"`
 }
 
 // EgressInfo - struct for egress info