Browse Source

add node network to ext. model

Abhishek Kondur 2 years ago
parent
commit
4deaac5de1
2 changed files with 2 additions and 0 deletions
  1. 1 0
      logic/peers.go
  2. 1 0
      models/mqtt.go

+ 1 - 0
logic/peers.go

@@ -449,6 +449,7 @@ func GetPeerUpdateForHost(host *models.Host) (models.HostPeerUpdate, error) {
 							IP:   net.ParseIP(node.PrimaryAddress()),
 							IP:   net.ParseIP(node.PrimaryAddress()),
 							Mask: getCIDRMaskFromAddr(node.PrimaryAddress()),
 							Mask: getCIDRMaskFromAddr(node.PrimaryAddress()),
 						},
 						},
+						Network: node.PrimaryNetworkRange(),
 						ExtPeerAddr: net.IPNet{
 						ExtPeerAddr: net.IPNet{
 							IP:   net.ParseIP(extPeerIdAndAddr.Address),
 							IP:   net.ParseIP(extPeerIdAndAddr.Address),
 							Mask: getCIDRMaskFromAddr(extPeerIdAndAddr.Address),
 							Mask: getCIDRMaskFromAddr(extPeerIdAndAddr.Address),

+ 1 - 0
models/mqtt.go

@@ -54,6 +54,7 @@ type PeerRouteInfo struct {
 // ExtClientInfo - struct for ext. client and it's peers
 // ExtClientInfo - struct for ext. client and it's peers
 type ExtClientInfo struct {
 type ExtClientInfo struct {
 	IngGwAddr   net.IPNet                `json:"ingress_gw_addr" yaml:"ingress_gw_addr"`
 	IngGwAddr   net.IPNet                `json:"ingress_gw_addr" yaml:"ingress_gw_addr"`
+	Network     net.IPNet                `json:"network" yaml:"network"`
 	Masquerade  bool                     `json:"masquerade" yaml:"masquerade"`
 	Masquerade  bool                     `json:"masquerade" yaml:"masquerade"`
 	ExtPeerAddr net.IPNet                `json:"ext_peer_addr" yaml:"ext_peer_addr"`
 	ExtPeerAddr net.IPNet                `json:"ext_peer_addr" yaml:"ext_peer_addr"`
 	ExtPeerKey  string                   `json:"ext_peer_key" yaml:"ext_peer_key"`
 	ExtPeerKey  string                   `json:"ext_peer_key" yaml:"ext_peer_key"`