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