OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vn.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef vnsw_agent_vn_hpp
6 #define vnsw_agent_vn_hpp
7 
8 #include <cmn/agent_cmn.h>
9 #include <cmn/agent.h>
10 #include <oper/agent_types.h>
11 #include <oper/oper_db.h>
12 #include <oper/oper_dhcp_options.h>
14 
15 class AgentRouteResync;
16 
17 namespace autogen {
18  class NetworkIpam;
19  class VirtualDns;
20  struct IpamType;
21  struct VirtualDnsType;
22 }
23 
24 bool IsVRFServiceChainingInstance(const std::string &vn_name,
25  const std::string &vrf_name);
26 class VmInterface;
27 
28 struct VnIpam {
30  uint32_t plen;
32  // In case of TSN, we could have different addresses for default_gw & dns
34  bool installed; // is the route to send pkts to host installed
37  std::string ipam_name;
39  uint32_t alloc_unit;
40 
41  VnIpam(const std::string& ip, uint32_t len, const std::string& gw,
42  const std::string& dns, bool dhcp, const std::string &name,
43  const std::vector<autogen::DhcpOptionType> &dhcp_options,
44  const std::vector<autogen::RouteType> &host_routes,
45  uint32_t alloc);
46 
47  bool IsV4() const {
48  return ip_prefix.is_v4();
49  }
50  bool IsV6() const {
51  return ip_prefix.is_v6();
52  }
53  bool operator<(const VnIpam &rhs) const {
54  if (ip_prefix != rhs.ip_prefix)
55  return ip_prefix < rhs.ip_prefix;
56 
57  return (plen < rhs.plen);
58  }
60 
61  bool IsSubnetMember(const IpAddress &ip) const;
62 };
63 
64 // Per IPAM data of the VN
67 
68  bool operator==(const VnIpamLinkData &rhs) const {
71  return true;
72  return false;
73  }
74 };
75 
76 struct VnKey : public AgentOperDBKey {
77  VnKey(const boost::uuids::uuid &id) : AgentOperDBKey(), uuid_(id) { }
78  virtual ~VnKey() { }
79 
81 };
82 
83 struct VnData : public AgentOperDBData {
84  typedef std::map<std::string, VnIpamLinkData> VnIpamDataMap;
85  typedef std::pair<std::string, VnIpamLinkData> VnIpamDataPair;
86 
87  VnData(const Agent *agent, IFMapNode *node, const string &name,
88  const boost::uuids::uuid &acl_id, const string &vrf_name,
89  const boost::uuids::uuid &mirror_acl_id,
90  const boost::uuids::uuid &mc_acl_id, const std::vector<VnIpam> &ipam,
91  const VnIpamDataMap &vn_ipam_data, int vxlan_id, int vnid,
92  bool admin_state, bool enable_rpf, bool flood_unknown_unicast,
93  Agent::ForwardingMode forwarding_mode,
94  const boost::uuids::uuid &qos_config_uuid, bool mirror_destination,
95  bool pbb_etree_enable, bool pbb_evpn_enable,
96  bool layer2_control_word, UuidList slo_list,
97  bool underlay_forwarding,
98  bool vxlan_routing_vn,
99  const boost::uuids::uuid &logical_router_uuid,
100  UuidList mp_list, bool cfg_igmp_enable, uint32_t vn_max_flows,
101  bool mac_ip_learning_enable,
102  const boost::uuids::uuid &health_check_uuid) :
103  AgentOperDBData(agent, node), name_(name), vrf_name_(vrf_name),
104  acl_id_(acl_id), mirror_acl_id_(mirror_acl_id),
105  mirror_cfg_acl_id_(mc_acl_id), ipam_(ipam), vn_ipam_data_(vn_ipam_data),
106  vxlan_id_(vxlan_id), vnid_(vnid), admin_state_(admin_state),
107  enable_rpf_(enable_rpf), flood_unknown_unicast_(flood_unknown_unicast),
108  forwarding_mode_(forwarding_mode), qos_config_uuid_(qos_config_uuid),
109  mirror_destination_(mirror_destination),
110  pbb_etree_enable_(pbb_etree_enable), pbb_evpn_enable_(pbb_evpn_enable),
111  layer2_control_word_(layer2_control_word), slo_list_(slo_list),
112  underlay_forwarding_(underlay_forwarding),
113  vxlan_routing_vn_(vxlan_routing_vn),
114  logical_router_uuid_(logical_router_uuid), mp_list_(mp_list),
115  cfg_igmp_enable_(cfg_igmp_enable),
116  vn_max_flows_(vn_max_flows),
117  mac_ip_learning_enable_(mac_ip_learning_enable),
118  health_check_uuid_(health_check_uuid) {
119  };
120  virtual ~VnData() { }
121 
122  string name_;
123  string vrf_name_;
127  std::vector<VnIpam> ipam_;
130  int vnid_;
146  uint32_t vn_max_flows_;
149 };
150 
151 class VnEntry : AgentRefCount<VnEntry>, public AgentOperDBEntry {
152 public:
153  VnEntry(Agent *agent, boost::uuids::uuid id);
154  virtual ~VnEntry();
155 
156  virtual bool IsLess(const DBEntry &rhs) const;
157  virtual KeyPtr GetDBRequestKey() const;
158  virtual void SetKey(const DBRequestKey *key);
159  virtual string ToString() const;
160 
161  const boost::uuids::uuid &GetUuid() const {return uuid_;};
162  const string &GetName() const {return name_;};
163  bool IsAclSet() const {
164  return ((acl_.get() != NULL) || (mirror_acl_.get() != NULL) ||
165  (mirror_cfg_acl_.get() != NULL));
166  }
167  const AclDBEntry *GetAcl() const {return acl_.get();}
168  const AclDBEntry *GetMirrorAcl() const {return mirror_acl_.get();}
169  const AclDBEntry *GetMirrorCfgAcl() const {return mirror_cfg_acl_.get();}
170  VrfEntry *GetVrf() const {return vrf_.get();}
171  const std::vector<VnIpam> &GetVnIpam() const { return ipam_; }
172  const VnIpam *GetIpam(const IpAddress &ip) const;
173  IpAddress GetGatewayFromIpam(const IpAddress &ip) const;
174  IpAddress GetDnsFromIpam(const IpAddress &ip) const;
175  uint32_t GetAllocUnitFromIpam(const IpAddress &ip) const;
176  bool GetVnHostRoutes(const std::string &ipam,
177  std::vector<OperDhcpOptions::HostRoute> *routes) const;
178  bool GetIpamName(const IpAddress &vm_addr, std::string *ipam_name) const;
179  bool GetIpamData(const IpAddress &vm_addr, std::string *ipam_name,
180  autogen::IpamType *ipam_type) const;
181  bool GetIpamVdnsData(const IpAddress &vm_addr,
182  autogen::IpamType *ipam_type,
183  autogen::VirtualDnsType *vdns_type) const;
184  bool GetPrefix(const Ip6Address &ip, Ip6Address *prefix,
185  uint8_t *plen) const;
186  std::string GetProject() const;
187  int GetVxLanId() const;
188 
189  const VxLanId *vxlan_id_ref() const {return vxlan_id_ref_.get();}
191  bool bridging() const {return bridging_;};
192  bool layer3_forwarding() const {return layer3_forwarding_;};
196 
197  bool admin_state() const {return admin_state_;}
198  bool enable_rpf() const {return enable_rpf_;}
200 
201  const AgentQosConfig* qos_config() const {
202  return qos_config_.get();
203  }
204 
205  const bool mirror_destination() const {
206  return mirror_destination_;
207  }
208  int vnid() const {return vnid_;}
209 
210  bool pbb_etree_enable() const {
211  return pbb_etree_enable_;
212  }
213 
214  bool pbb_evpn_enable() const {
215  return pbb_evpn_enable_;
216  }
217 
218  bool layer2_control_word() const {
219  return layer2_control_word_;
220  }
221 
222  const UuidList &slo_list() const {
223  return slo_list_;
224  }
225 
226  bool underlay_forwarding() const {
227  return underlay_forwarding_;
228  }
229 
230  const UuidList &mp_list() const {
231  return mp_list_;
232  }
233 
234  bool cfg_igmp_enable() const {
235  return cfg_igmp_enable_;
236  }
237 
238  bool mac_ip_learning_enable() const {
240  }
241 
243  return health_check_uuid_;
244  }
245 
246  uint32_t GetRefCount() const {
248  }
249  bool DBEntrySandesh(Sandesh *sresp, std::string &name) const;
250  void SendObjectLog(AgentLogEvent::type event) const;
251  bool IdentifyBgpRoutersServiceIp(const IpAddress &ip_address, bool *is_dns,
252  bool *is_gateway) const;
253  void AllocWalker();
254  void ReleaseWalker();
255  bool vxlan_routing_vn() const {return vxlan_routing_vn_;}
257  return logical_router_uuid_;
258  }
259  uint32_t vn_max_flows() const {return vn_max_flows_;}
260 
261  const VrfEntry* lr_vrf() const {
262  return lr_vrf_.get();
263  }
264 
265  void set_lr_vrf(const VrfEntry *vrf) {
266  lr_vrf_.reset(vrf);
267  }
268 
269 private:
270  friend class VnTable;
271  bool Resync(Agent *agent);
272  bool ChangeHandler(Agent *agent, const DBRequest *req);
273  bool UpdateVxlan(Agent *agent, bool op_del);
274  void ResyncRoutes();
275  bool UpdateForwardingMode(Agent *agent);
276  bool ApplyAllIpam(Agent *agent, VrfEntry *old_vrf, bool del);
277  bool ApplyIpam(Agent *agent, VnIpam *ipam, VrfEntry *old_vrf, bool del);
278  bool CanInstallIpam(const VnIpam *ipam);
279  bool UpdateIpam(Agent *agent, std::vector<VnIpam> &new_ipam);
280  bool HandleIpamChange(Agent *agent, VnIpam *old_ipam, VnIpam *new_ipam);
281  void UpdateHostRoute(Agent *agent, const IpAddress &old_address,
282  const IpAddress &new_address, bool policy);
283  bool AddIpamRoutes(Agent *agent, VnIpam *ipam);
284  void DelIpamRoutes(Agent *agent, VnIpam *ipam, VrfEntry *vrf);
285  void AddHostRoute(const IpAddress &address, bool policy);
286  void DelHostRoute(const IpAddress &address);
287  void AddSubnetRoute(VnIpam *ipam);
288  void DelSubnetRoute(VnIpam *ipam);
289 
292  string name_;
297  std::vector<VnIpam> ipam_;
300  int vnid_;
301  // Based on vxlan-network-identifier mode, the active_vxlan_id_ is picked
302  // from either vxlan_id_ or vnid_
304  bool bridging_;
308  uint32_t table_label_;
324  uint32_t vn_max_flows_;
329 };
330 
331 class VnTable : public AgentOperDBTable {
332 public:
333  VnTable(DB *db, const std::string &name);
334  virtual ~VnTable();
335 
336  virtual std::unique_ptr<DBEntry> AllocEntry(const DBRequestKey *k) const;
337  virtual size_t Hash(const DBEntry *entry) const {return 0;};
338  virtual size_t Hash(const DBRequestKey *key) const {return 0;};
340  const std::string &context);
341 
342  virtual DBEntry *OperDBAdd(const DBRequest *req);
343  virtual bool OperDBOnChange(DBEntry *entry, const DBRequest *req);
344  virtual bool OperDBDelete(DBEntry *entry, const DBRequest *req);
345  virtual bool OperDBResync(DBEntry *entry, const DBRequest *req);
346 
347  virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req,
348  const boost::uuids::uuid &u);
349  virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u);
350  virtual bool ProcessConfig(IFMapNode *node, DBRequest &req,
351  const boost::uuids::uuid &u);
352  virtual void Clear();
353 
354  void CfgForwardingFlags(IFMapNode *node, bool *rpf,
355  bool *flood_unknown_unicast,
356  Agent::ForwardingMode *forwarding_mode,
357  bool *mirror_destination);
358 
359  static DBTableBase *CreateTable(DB *db, const std::string &name);
360  static VnTable *GetInstance() {return vn_table_;};
361 
362  void AddVn(const boost::uuids::uuid &vn_uuid, const string &name,
363  const boost::uuids::uuid &acl_id, const string &vrf_name,
364  const std::vector<VnIpam> &ipam,
365  const VnData::VnIpamDataMap &vn_ipam_data, int vn_id,
366  int vxlan_id, bool admin_state, bool enable_rpf,
367  bool flood_unknown_unicast, bool pbb_etree_enable,
368  bool pbb_evpn_enable, bool layer2_control_word);
369  void DelVn(const boost::uuids::uuid &vn_uuid);
370  void ResyncReq(const boost::uuids::uuid &vn);
371  VnEntry *Find(const boost::uuids::uuid &vn_uuid);
373  bool VnEntryWalk(DBTablePartBase *partition, DBEntryBase *entry);
374  void VnEntryWalkDone(DBTable::DBTableWalkRef walk_ref, DBTableBase *partition);
375  int GetCfgVnId(autogen::VirtualNetwork *cfg_vn);
376 
377 private:
379  bool IsGwHostRouteRequired();
380  bool IsGatewayL2(const string &gateway) const;
381  void BuildVnIpamData(const std::vector<autogen::IpamSubnetType> &subnets,
382  const std::string &ipam_name,
383  std::vector<VnIpam> *vn_ipam);
384  VnData *BuildData(IFMapNode *node);
386  std::string node_type);
388 
390 };
391 
393 public:
394 
395  OperNetworkIpam(Agent *agent, DomainConfig *domain_config);
396  virtual ~OperNetworkIpam();
397 
398  void ConfigDelete(IFMapNode *node);
399  void ConfigAddChange(IFMapNode *node);
400  void ConfigManagerEnqueue(IFMapNode *node);
401 private:
404 };
405 
407 public:
408 
409  OperVirtualDns(Agent *agent, DomainConfig *domain_config);
410  virtual ~OperVirtualDns();
411 
412  void ConfigDelete(IFMapNode *node);
413  void ConfigAddChange(IFMapNode *node);
414  void ConfigManagerEnqueue(IFMapNode *node);
415 private:
418 };
419 
421 public:
422  typedef std::map<std::string, autogen::IpamType> IpamDomainConfigMap;
423  typedef std::pair<std::string, autogen::IpamType> IpamDomainConfigPair;
424  typedef std::map<std::string, autogen::VirtualDnsType> VdnsDomainConfigMap;
425  typedef std::pair<std::string, autogen::VirtualDnsType> VdnsDomainConfigPair;
426  typedef boost::function<void(IFMapNode *)> Callback;
427 
428  DomainConfig(Agent *);
429  virtual ~DomainConfig();
430  void Init();
431  void Terminate();
432  void RegisterIpamCb(Callback cb);
433  void RegisterVdnsCb(Callback cb);
434  void IpamDelete(IFMapNode *node);
435  void IpamAddChange(IFMapNode *node);
436  void VDnsDelete(IFMapNode *node);
437  void VDnsAddChange(IFMapNode *node);
438  bool GetIpam(const std::string &name, autogen::IpamType *ipam);
439  bool GetVDns(const std::string &vdns, autogen::VirtualDnsType *vdns_type);
440 
441 private:
442  void CallVdnsCb(IFMapNode *node);
443  void CallIpamCb(IFMapNode *node);
444  bool IpamChanged(const autogen::IpamType &old,
445  const autogen::IpamType &cur) const;
446 
449  std::vector<Callback> ipam_callback_;
450  std::vector<Callback> vdns_callback_;
451 
453 };
454 
455 #endif // vnsw_agent_vn_hpp
int GetVxLanId() const
Definition: vn.cc:727
Agent * agent_
Definition: vn.h:290
const UuidList & slo_list() const
Definition: vn.h:222
bool mac_ip_learning_enable_
Definition: vn.h:147
uint32_t alloc_unit
Definition: vn.h:39
UuidList slo_list_
Definition: vn.h:318
std::map< std::string, autogen::IpamType > IpamDomainConfigMap
Definition: vn.h:422
bool IsGwHostRouteRequired()
bool layer3_forwarding_
Definition: vn.h:305
const std::vector< HostRoute > & host_routes() const
IpAddress GetDnsFromIpam(const IpAddress &ip) const
Definition: vn.cc:668
string name_
Definition: vn.h:122
void SendObjectLog(AgentLogEvent::type event) const
Definition: vn.cc:1322
void ResyncReq(const boost::uuids::uuid &vn)
Definition: vn.cc:1211
void ConfigDelete(IFMapNode *node)
Definition: vn.cc:1588
bool enable_rpf() const
Definition: vn.h:198
bool enable_rpf_
Definition: vn.h:132
bool IsVRFServiceChainingInstance(const string &vn_name, const string &vrf_name)
Definition: vn.cc:860
bool pbb_evpn_enable_
Definition: vn.h:138
bool mac_ip_learning_enable() const
Definition: vn.h:238
uint32_t GetRefCount() const
Definition: agent_db.h:54
ForwardingMode
Definition: agent.h:403
Definition: vrf.h:86
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
Definition: vn.cc:1140
Agent * agent() const
Definition: oper_db.h:245
bool mirror_destination_
Definition: vn.h:314
const AclDBEntry * GetAcl() const
Definition: vn.h:167
Definition: vn.h:76
DISALLOW_COPY_AND_ASSIGN(OperNetworkIpam)
boost::uuids::uuid logical_router_uuid_
Definition: vn.h:143
const VnIpam * GetIpam(const IpAddress &ip) const
Definition: vn.cc:651
VnData * BuildData(IFMapNode *node)
Definition: vn.cc:952
std::pair< std::string, VnIpamLinkData > VnIpamDataPair
Definition: vn.h:85
void set_lr_vrf(const VrfEntry *vrf)
Definition: vn.h:265
boost::uuids::uuid uuid_
Definition: vn.h:80
Definition: vn.h:28
void IpamAddChange(IFMapNode *node)
Definition: vn.cc:1440
std::map< std::string, VnIpamLinkData > VnIpamDataMap
Definition: vn.h:84
bool enable_rpf_
Definition: vn.h:309
DomainConfig * domain_config_
Definition: vn.h:402
bool UpdateForwardingMode(Agent *agent)
Definition: vn.cc:345
void CallIpamCb(IFMapNode *node)
Definition: vn.cc:1482
void DelIpamRoutes(Agent *agent, VnIpam *ipam, VrfEntry *vrf)
Definition: vn.cc:547
IpamDomainConfigMap ipam_config_
Definition: vn.h:447
static DBTableBase * CreateTable(DB *db, const std::string &name)
Definition: vn.cc:753
void CallVdnsCb(IFMapNode *node)
Definition: vn.cc:1488
int vnid_
Definition: vn.h:130
void set_layer3_forwarding(bool layer3_forwarding)
Definition: vn.h:193
bool cfg_igmp_enable_
Definition: vn.h:323
boost::asio::ip::address IpAddress
Definition: address.h:13
std::pair< std::string, autogen::VirtualDnsType > VdnsDomainConfigPair
Definition: vn.h:425
VxLanIdRef vxlan_id_ref_
Definition: vn.h:307
virtual ~OperNetworkIpam()
Definition: vn.cc:1566
bool ChangeHandler(Agent *agent, const DBRequest *req)
Definition: vn.cc:133
uint32_t vn_max_flows_
Definition: vn.h:146
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
Definition: vn.cc:1400
void DelVn(const boost::uuids::uuid &vn_uuid)
Definition: vn.cc:1204
VnEntry(Agent *agent, boost::uuids::uuid id)
Definition: vn.cc:87
virtual ~VnEntry()
Definition: vn.cc:98
uint32_t vn_max_flows() const
Definition: vn.h:259
bool cfg_igmp_enable_
Definition: vn.h:145
bool IsV4() const
Definition: vn.h:47
void Terminate()
Definition: vn.cc:1421
string vrf_name_
Definition: vn.h:123
void ConfigManagerEnqueue(IFMapNode *node)
Definition: vn.cc:1596
int vxlan_id_
Definition: vn.h:129
boost::uuids::uuid uuid
bool GetIpam(const std::string &name, autogen::IpamType *ipam)
Definition: vn.cc:1542
AclDBEntryRef acl_
Definition: vn.h:293
AclDBEntryRef mirror_acl_
Definition: vn.h:294
IpAddress GetSubnetAddress() const
Definition: vn.cc:63
Agent::ForwardingMode forwarding_mode() const
Definition: vn.h:195
virtual ~OperVirtualDns()
Definition: vn.cc:1585
bool pbb_etree_enable() const
Definition: vn.h:210
boost::uuids::uuid acl_id_
Definition: vn.h:124
Definition: vxlan.h:14
IFMapNode * FindTarget(IFMapAgentTable *table, IFMapNode *node, std::string node_type)
Definition: vn.cc:888
virtual KeyPtr GetDBRequestKey() const
Definition: vn.cc:112
void ConfigManagerEnqueue(IFMapNode *node)
Definition: vn.cc:1577
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
VdnsDomainConfigMap vdns_config_
Definition: vn.h:448
virtual ~VnTable()
Definition: vn.cc:746
void ResyncRoutes()
bool GetIpamVdnsData(const IpAddress &vm_addr, autogen::IpamType *ipam_type, autogen::VirtualDnsType *vdns_type) const
Definition: vn.cc:684
bool ApplyIpam(Agent *agent, VnIpam *ipam, VrfEntry *old_vrf, bool del)
Definition: vn.cc:380
bool installed
Definition: vn.h:34
OperDhcpOptions oper_dhcp_options
Definition: vn.h:38
bool flood_unknown_unicast() const
Definition: vn.h:199
bool IsSubnetMember(const IpAddress &ip) const
Definition: vn.cc:73
bool pbb_evpn_enable() const
Definition: vn.h:214
virtual void SetKey(const DBRequestKey *key)
Definition: vn.cc:116
std::string GetProject() const
Definition: vn.cc:716
Definition: db.h:24
bool cfg_igmp_enable() const
Definition: vn.h:234
uint32_t GetRefCount() const
Definition: vn.h:246
void VDnsAddChange(IFMapNode *node)
Definition: vn.cc:1467
VnIpam(const std::string &ip, uint32_t len, const std::string &gw, const std::string &dns, bool dhcp, const std::string &name, const std::vector< autogen::DhcpOptionType > &dhcp_options, const std::vector< autogen::RouteType > &host_routes, uint32_t alloc)
Definition: vn.cc:48
OperNetworkIpam(Agent *agent, DomainConfig *domain_config)
Definition: vn.cc:1562
VnData(const Agent *agent, IFMapNode *node, const string &name, const boost::uuids::uuid &acl_id, const string &vrf_name, const boost::uuids::uuid &mirror_acl_id, const boost::uuids::uuid &mc_acl_id, const std::vector< VnIpam > &ipam, const VnIpamDataMap &vn_ipam_data, int vxlan_id, int vnid, bool admin_state, bool enable_rpf, bool flood_unknown_unicast, Agent::ForwardingMode forwarding_mode, const boost::uuids::uuid &qos_config_uuid, bool mirror_destination, bool pbb_etree_enable, bool pbb_evpn_enable, bool layer2_control_word, UuidList slo_list, bool underlay_forwarding, bool vxlan_routing_vn, const boost::uuids::uuid &logical_router_uuid, UuidList mp_list, bool cfg_igmp_enable, uint32_t vn_max_flows, bool mac_ip_learning_enable, const boost::uuids::uuid &health_check_uuid)
Definition: vn.h:87
uint8_t type
Definition: load_balance.h:109
IpAddress default_gw
Definition: vn.h:31
virtual ~DomainConfig()
Definition: vn.cc:1415
bool IpamChanged(const autogen::IpamType &old, const autogen::IpamType &cur) const
Definition: vn.cc:1494
virtual bool OperDBDelete(DBEntry *entry, const DBRequest *req)
Definition: vn.cc:790
Definition: agent.h:358
void VnEntryWalkDone(DBTable::DBTableWalkRef walk_ref, DBTableBase *partition)
Definition: vn.cc:831
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
Definition: vn.cc:764
boost::uuids::uuid uuid_
Definition: vn.h:291
bool IsAclSet() const
Definition: vn.h:163
void ConfigAddChange(IFMapNode *node)
Definition: vn.cc:1592
void ConfigAddChange(IFMapNode *node)
Definition: vn.cc:1573
void AllocWalker()
Definition: vn.cc:603
uint32_t GetAllocUnitFromIpam(const IpAddress &ip) const
Definition: vn.cc:676
virtual bool OperDBResync(DBEntry *entry, const DBRequest *req)
Definition: vn.cc:818
AgentRouteWalkerPtr route_resync_walker_
Definition: vn.h:312
bool HandleIpamChange(Agent *agent, VnIpam *old_ipam, VnIpam *new_ipam)
Definition: vn.cc:449
boost::asio::ip::address_v6 Ip6Address
Definition: address.h:15
UuidList mp_list_
Definition: vn.h:322
boost::intrusive_ptr< const AgentQosConfig > AgentQosConfigConstRef
Definition: agent.h:178
std::vector< Callback > ipam_callback_
Definition: vn.h:449
boost::intrusive_ptr< AclDBEntry > AclDBEntryRef
Definition: agent.h:141
bool vxlan_routing_vn() const
Definition: vn.h:255
bool pbb_evpn_enable_
Definition: vn.h:316
std::vector< VnIpam > ipam_
Definition: vn.h:297
bool GetVnHostRoutes(const std::string &ipam, std::vector< OperDhcpOptions::HostRoute > *routes) const
Definition: vn.cc:620
const AclDBEntry * GetMirrorAcl() const
Definition: vn.h:168
virtual bool OperDBOnChange(DBEntry *entry, const DBRequest *req)
Definition: vn.cc:804
uint32_t plen
Definition: vn.h:30
bool AddIpamRoutes(Agent *agent, VnIpam *ipam)
Definition: vn.cc:526
int vnid() const
Definition: vn.h:208
string name_
Definition: vn.h:292
std::pair< std::string, autogen::IpamType > IpamDomainConfigPair
Definition: vn.h:423
virtual bool IsLess(const DBEntry &rhs) const
Definition: vn.cc:101
void ConfigDelete(IFMapNode *node)
Definition: vn.cc:1569
void ReleaseWalker()
Definition: vn.cc:612
IpAddress ip_prefix
Definition: vn.h:29
bool flood_unknown_unicast_
Definition: vn.h:133
const VxLanId * vxlan_id_ref() const
Definition: vn.h:189
boost::intrusive_ptr< VxLanId > VxLanIdRef
Definition: agent.h:104
Agent::ForwardingMode forwarding_mode_
Definition: vn.h:311
DISALLOW_COPY_AND_ASSIGN(OperVirtualDns)
virtual ~VnKey()
Definition: vn.h:78
VnKey(const boost::uuids::uuid &id)
Definition: vn.h:77
std::vector< Callback > vdns_callback_
Definition: vn.h:450
bool underlay_forwarding_
Definition: vn.h:141
uint32_t vn_max_flows_
Definition: vn.h:324
bool DBEntrySandesh(Sandesh *sresp, std::string &name) const
Definition: vn.cc:1223
const std::vector< VnIpam > & GetVnIpam() const
Definition: vn.h:171
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
Definition: agent_db.h:18
const std::string & name() const
Definition: db_table.h:110
bool dhcp_enable
Definition: vn.h:35
DISALLOW_COPY_AND_ASSIGN(VnEntry)
VnEntry * Find(const boost::uuids::uuid &vn_uuid)
Definition: vn.cc:759
static VnTable * GetInstance()
Definition: vn.h:360
boost::uuids::uuid mirror_acl_id_
Definition: vn.h:125
boost::uuids::uuid health_check_uuid_
Definition: vn.h:326
AgentQosConfigConstRef qos_config_
Definition: vn.h:313
void AddHostRoute(const IpAddress &address, bool policy)
Definition: vn.cc:559
boost::intrusive_ptr< AgentRouteWalker > AgentRouteWalkerPtr
VnIpamDataMap vn_ipam_data_
Definition: vn.h:128
IpAddress dns_server
Definition: vn.h:33
DISALLOW_COPY_AND_ASSIGN(DomainConfig)
int active_vxlan_id_
Definition: vn.h:303
std::vector< boost::uuids::uuid > UuidList
Definition: agent.h:203
UuidList slo_list_
Definition: vn.h:140
Definition: vn.h:151
bool admin_state() const
Definition: vn.h:197
bool dhcp_enable_v6
Definition: vn.h:36
bool admin_state_
Definition: vn.h:131
bool bridging_
Definition: vn.h:304
bool IsV6() const
Definition: vn.h:50
Definition: vn.h:331
bool UpdateVxlan(Agent *agent, bool op_del)
Definition: vn.cc:320
bool underlay_forwarding_
Definition: vn.h:319
boost::uuids::uuid qos_config_uuid_
Definition: vn.h:135
DomainConfig * domain_config_
Definition: vn.h:416
int GetCfgVnId(autogen::VirtualNetwork *cfg_vn)
Definition: vn.cc:899
const boost::uuids::uuid & logical_router_uuid() const
Definition: vn.h:256
VrfEntry * GetVrf() const
Definition: vn.h:170
const Agent * agent() const
Definition: oper_db.h:65
std::string ipam_name
Definition: vn.h:37
AclDBEntryRef mirror_cfg_acl_
Definition: vn.h:295
boost::uuids::uuid mirror_cfg_acl_id_
Definition: vn.h:126
void CfgForwardingFlags(IFMapNode *node, bool *rpf, bool *flood_unknown_unicast, Agent::ForwardingMode *forwarding_mode, bool *mirror_destination)
Definition: vn.cc:906
boost::function< void(IFMapNode *)> Callback
Definition: vn.h:426
bool CanInstallIpam(const VnIpam *ipam)
Definition: vn.cc:396
void AddVn(const boost::uuids::uuid &vn_uuid, const string &name, const boost::uuids::uuid &acl_id, const string &vrf_name, const std::vector< VnIpam > &ipam, const VnData::VnIpamDataMap &vn_ipam_data, int vn_id, int vxlan_id, bool admin_state, bool enable_rpf, bool flood_unknown_unicast, bool pbb_etree_enable, bool pbb_evpn_enable, bool layer2_control_word)
Definition: vn.cc:1178
bool flood_unknown_unicast_
Definition: vn.h:310
const boost::uuids::uuid & health_check_uuid() const
Definition: vn.h:242
bool layer3_forwarding() const
Definition: vn.h:192
void BuildVnIpamData(const std::vector< autogen::IpamSubnetType > &subnets, const std::string &ipam_name, std::vector< VnIpam > *vn_ipam)
Definition: vn.cc:926
virtual DBEntry * OperDBAdd(const DBRequest *req)
Definition: vn.cc:770
boost::uuids::uuid health_check_uuid_
Definition: vn.h:148
void IpamDelete(IFMapNode *node)
Definition: vn.cc:1434
virtual void Clear()
Definition: vn.cc:749
bool layer2_control_word_
Definition: vn.h:317
OperVirtualDns(Agent *agent, DomainConfig *domain_config)
Definition: vn.cc:1581
const AgentQosConfig * qos_config() const
Definition: vn.h:201
bool mirror_destination_
Definition: vn.h:136
void Init()
Definition: vn.cc:1418
void DelHostRoute(const IpAddress &address)
Definition: vn.cc:572
bool operator<(const VnIpam &rhs) const
Definition: vn.h:53
void set_bridging(bool bridging)
Definition: vn.h:190
void RegisterIpamCb(Callback cb)
Definition: vn.cc:1424
int vxlan_id_
Definition: vn.h:299
int vnid_
Definition: vn.h:300
bool layer2_control_word() const
Definition: vn.h:218
DISALLOW_COPY_AND_ASSIGN(VnTable)
bool vxlan_routing_vn_
Definition: vn.h:142
const boost::uuids::uuid & GetUuid() const
Definition: vn.h:161
bool mac_ip_learning_enable_
Definition: vn.h:325
const string & GetName() const
Definition: vn.h:162
OperDhcpOptions oper_dhcp_options_
Definition: vn.h:66
void AddSubnetRoute(VnIpam *ipam)
Definition: vn.cc:587
uint32_t table_label_
Definition: vn.h:308
bool IsGatewayL2(const string &gateway) const
std::vector< VnIpam > ipam_
Definition: vn.h:127
bool GetVDns(const std::string &vdns, autogen::VirtualDnsType *vdns_type)
Definition: vn.cc:1550
UuidList mp_list_
Definition: vn.h:144
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
Definition: db_table.h:169
void GlobalVrouterConfigChanged()
Definition: vn.cc:838
virtual bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
Definition: vn.cc:1164
const VrfEntry * lr_vrf() const
Definition: vn.h:261
Agent::ForwardingMode forwarding_mode_
Definition: vn.h:134
Definition: vn.h:83
bool underlay_forwarding() const
Definition: vn.h:226
boost::uuids::uuid logical_router_uuid_
Definition: vn.h:321
bool pbb_etree_enable_
Definition: vn.h:315
bool operator==(const VnIpamLinkData &rhs) const
Definition: vn.h:68
bool bridging() const
Definition: vn.h:191
std::map< std::string, autogen::VirtualDnsType > VdnsDomainConfigMap
Definition: vn.h:424
bool GetIpamName(const IpAddress &vm_addr, std::string *ipam_name) const
Definition: vn.cc:630
virtual size_t Hash(const DBRequestKey *key) const
Definition: vn.h:338
bool vxlan_routing_vn_
Definition: vn.h:320
DomainConfig(Agent *)
Definition: vn.cc:1412
const UuidList & mp_list() const
Definition: vn.h:230
VnData::VnIpamDataMap vn_ipam_data_
Definition: vn.h:298
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
Definition: vn.cc:1148
VrfEntryRef vrf_
Definition: vn.h:296
DBTable::DBTableWalkRef walk_ref_
Definition: vn.h:387
const bool mirror_destination() const
Definition: vn.h:205
virtual size_t Hash(const DBEntry *entry) const
Definition: vn.h:337
bool VnEntryWalk(DBTablePartBase *partition, DBEntryBase *entry)
Definition: vn.cc:823
bool Resync(Agent *agent)
Definition: vn.cc:123
virtual ~VnData()
Definition: vn.h:120
bool GetPrefix(const Ip6Address &ip, Ip6Address *prefix, uint8_t *plen) const
Definition: vn.cc:700
void VDnsDelete(IFMapNode *node)
Definition: vn.cc:1461
Definition: acl.h:92
VrfEntryConstRef lr_vrf_
Definition: vn.h:327
void UpdateHostRoute(Agent *agent, const IpAddress &old_address, const IpAddress &new_address, bool policy)
Definition: vn.cc:515
bool pbb_etree_enable_
Definition: vn.h:137
const AclDBEntry * GetMirrorCfgAcl() const
Definition: vn.h:169
void DelSubnetRoute(VnIpam *ipam)
Definition: vn.cc:595
virtual string ToString() const
Definition: vn.cc:106
bool UpdateIpam(Agent *agent, std::vector< VnIpam > &new_ipam)
Definition: vn.cc:403
bool layer2_control_word_
Definition: vn.h:139
IpAddress GetGatewayFromIpam(const IpAddress &ip) const
Definition: vn.cc:660
bool IdentifyBgpRoutersServiceIp(const IpAddress &ip_address, bool *is_dns, bool *is_gateway) const
void RegisterVdnsCb(Callback cb)
Definition: vn.cc:1428
bool ApplyAllIpam(Agent *agent, VrfEntry *old_vrf, bool del)
Definition: vn.cc:370
bool GetIpamData(const IpAddress &vm_addr, std::string *ipam_name, autogen::IpamType *ipam_type) const
Definition: vn.cc:641
static VnTable * vn_table_
Definition: vn.h:378
bool admin_state_
Definition: vn.h:306
VnTable(DB *db, const std::string &name)
Definition: vn.cc:740