OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agent_path.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_path_hpp
6 #define vnsw_agent_path_hpp
7 
8 #include <cmn/agent_cmn.h>
9 #include <cmn/agent.h>
10 #include <route/path.h>
11 #include <oper/nexthop.h>
12 #include <oper/agent_route.h>
13 #include <oper/mpls.h>
14 #include <oper/vxlan.h>
15 //Forward declaration
16 class AgentXmppChannel;
17 struct InterfaceKey;
18 class PhysicalInterface;
19 class Peer;
20 class EvpnPeer;
21 class EcmpLoadBalance;
22 class TsnElector;
23 
25 public:
26  enum Preference {
27  INVALID = 0,
28  HA_STALE = 1,
29  LOW = 100,
30  HIGH = 200
31  };
33  wait_for_traffic_(true), ecmp_(false), static_preference_(false),
35  PathPreference(uint32_t sequence, uint32_t preference,
36  bool wait_for_traffic, bool ecmp): loc_sequence_(0), sequence_(sequence),
37  preference_(preference), wait_for_traffic_(wait_for_traffic),
38  ecmp_(ecmp), static_preference_(false), dependent_ip_(Ip4Address(0)) {}
39  uint32_t loc_sequence() const {return loc_sequence_;}
40  uint32_t sequence() const { return sequence_;}
41  uint32_t preference() const { return preference_;}
42  bool wait_for_traffic() const {
43  return wait_for_traffic_;
44  }
45  bool ecmp() const {
46  return ecmp_;
47  }
48 
49  bool is_ecmp() const {
50  if ((preference_ == HIGH && sequence_ == 0)) {
51  return true;
52  }
53 
54  if (static_preference_) {
55  return false;
56  }
57 
58  if (ecmp_ == true) {
59  return true;
60  }
61  return false;
62  }
63 
64  bool static_preference() const {
65  return static_preference_;
66  }
67 
68  const IpAddress& dependent_ip() const {
69  return dependent_ip_;
70  }
71 
72  const std::string& vrf() const {
73  return vrf_;
74  }
75 
76  void set_loc_sequence(uint32_t loc_sequence) {
78  }
79  void set_sequence(uint32_t sequence) {
81  }
82  void set_preference(uint32_t preference) {
84  }
87  }
88  void set_ecmp(bool ecmp) {
89  ecmp_ = ecmp;
90  }
91 
92  void set_static_preference(bool static_pref) {
93  static_preference_ = static_pref;
94  }
95 
96  void set_dependent_ip(const IpAddress &ip) {
97  dependent_ip_ = ip;
98  }
99 
100  void set_vrf(const std::string &vrf) {
101  vrf_ = vrf;
102  }
103 
104  bool operator!=(const PathPreference &rhs) const {
105  return (loc_sequence_ != rhs.loc_sequence_
106  || sequence_ != rhs.sequence_
107  || preference_ != rhs.preference_
109  || ecmp_ != rhs.ecmp_);
110  }
111 
112  bool operator<(const PathPreference &rhs) const {
113  if (preference_ < rhs.preference_) {
114  return true;
115  }
116 
117  if (sequence_ < rhs.sequence_) {
118  return true;
119  }
120 
121  if (loc_sequence_ < rhs.loc_sequence_) {
122  return true;
123  }
124  return false;
125  }
126 
127  bool operator==(const PathPreference &rhs) const {
128  if (loc_sequence_ == rhs.loc_sequence_ &&
129  preference_ == rhs.preference_ &&
130  sequence_ == rhs.sequence_) {
131  return true;
132  }
133 
134  return false;
135  }
136 
137 
138  //Check if any configuration values have changed
139  //ecmp flag and static preference are updated from
140  //configuration, if static preference flag is set,
141  //then preference also would be picked from configuration
142  bool ConfigChanged(const PathPreference &rhs) const {
143  bool ret = false;
144  if (ecmp_ != rhs.ecmp_) {
145  ret = true;
146  } else if (static_preference_ != rhs.static_preference_) {
147  ret = true;
148  } else if (static_preference_ && preference_ != rhs.preference_) {
149  ret = true;
150  } else if (dependent_ip_ != rhs.dependent_ip_) {
151  ret = true;
152  }
153  return ret;
154  }
155 
156  bool IsDependentRt(void) const {
157  if (dependent_ip_.is_v4()) {
158  if (dependent_ip_ != Ip4Address(0)) {
159  return true;
160  }
161  } else if (dependent_ip_.is_v6()) {
162  if (!dependent_ip_.is_unspecified()) {
163  return true;
164  }
165  }
166  return false;
167  }
168 
169 
170 private:
171  uint32_t loc_sequence_;
172  uint32_t sequence_;
173  uint32_t preference_;
175  bool ecmp_;
178  std::string vrf_;
179 };
180 
181 //Route data to change preference and sequence number of path
183  PathPreferenceData(const PathPreference &path_preference):
185  path_preference_(path_preference) { }
186  virtual std::string ToString() const {
187  return "";
188  }
189  virtual bool AddChangePathExtended(Agent*, AgentPath*, const AgentRoute*);
191 };
192 
194 public:
195  AgentPathEcmpComponent(IpAddress addr, uint32_t label, AgentRoute *rt);
197  bool Unresolved() {return unresolved;}
198 
199  bool operator == (const AgentPathEcmpComponent &rhs) const {
200  if (addr_ == rhs.addr_ && label_ == rhs.label_) {
201  return true;
202  }
203 
204  return false;
205  }
207  uint32_t GetLabel() {return label_;}
209  if (rt) {
210  dependent_rt_.reset(rt);
211  } else {
213  }
214  }
215 
216  void SetUnresolved(bool flag) {
217  unresolved = flag;
218  }
219 
220 private:
222  uint32_t label_;
226 };
227 
228 typedef boost::shared_ptr<AgentPathEcmpComponent> AgentPathEcmpComponentPtr;
229 typedef std::vector<AgentPathEcmpComponentPtr> AgentPathEcmpComponentPtrList;
230 // A common class for all different type of paths
231 class AgentPath : public Path {
232 public:
233  AgentPath(const Peer *peer, AgentRoute *rt);
234  virtual ~AgentPath();
235 
236  virtual const NextHop *ComputeNextHop(Agent *agent) const;
237  virtual bool IsLess(const AgentPath &right) const;
238  //UsablePath
239  //This happens when a route is dependant on other route to get the path and
240  //in these cases active path of other route will be usable path.
241  //If there is no dependant route then it returns self.
242  virtual const AgentPath *UsablePath() const;
243  //Syncs path parameters. Parent route is also used to pick params.
244  virtual bool Sync(AgentRoute *sync_route);
245  void ImportPrevActiveNH(Agent *agent, NextHop *nh);
246  virtual bool PostChangeNH(Agent *agent, NextHop *nh);
247 
248  const SecurityGroupList &sg_list() const {return sg_list_;}
249  const TagList &tag_list() const {return tag_list_;}
250  const CommunityList &communities() const {return communities_;}
251  const std::string &dest_vn_name() const {
252  assert(dest_vn_list_.size() <= 1);
253  if (dest_vn_list_.size())
254  return *dest_vn_list_.begin();
255  else
256  return Agent::NullString();
257  }
258  const VnListType &dest_vn_list() const {return dest_vn_list_;}
259  const std::string &origin_vn() const {return origin_vn_;}
260  void GetDestinationVnList(std::vector<std::string> *vn_list) const;
261  uint32_t GetActiveLabel() const;
262  NextHop *nexthop() const;
263  const Peer *peer() const {return peer_.get();}
264  uint32_t label() const {return label_;}
265  uint32_t vxlan_id() const {return vxlan_id_;}
267  uint32_t tunnel_bmap() const {return tunnel_bmap_;}
268  const IpAddress& gw_ip() const {return gw_ip_;}
269  const std::string &vrf_name() const {return vrf_name_;}
270  bool force_policy() const {return force_policy_;}
271  const bool unresolved() const {return unresolved_;}
272  const Ip4Address& tunnel_dest() const {return tunnel_dest_;}
273  bool is_subnet_discard() const {return is_subnet_discard_;}
275 
278  }
279 
280  void set_nexthop(NextHop *nh);
282  void set_label(uint32_t label) {label_ = label;}
284  void set_origin_vn(const std::string &origin_vn) {origin_vn_ = origin_vn;}
286  void set_gw_ip(const IpAddress &addr) {gw_ip_ = addr;}
288  void set_vrf_name(const std::string &vrf_name) {vrf_name_ = vrf_name;}
291  void set_sg_list(const SecurityGroupList &sg) {sg_list_ = sg;}
292  void set_tag_list(const TagList &tag) {tag_list_ = tag;}
294  void clear_sg_list() { sg_list_.clear(); }
295  void clear_tag_list() { tag_list_.clear(); }
296  void clear_communities() { communities_.clear(); }
299  }
300  void set_is_subnet_discard(bool discard) {
301  is_subnet_discard_= discard;
302  }
304  subnet_service_ip_ = ip;
305  }
306 
307  void set_copy_local_path(bool copy_local_path) {
308  copy_local_path_ = copy_local_path;
309  }
310 
312  bool dest_vn_match(const std::string &vn) const;
313  const MplsLabel* local_ecmp_mpls_label() const;
316  const AgentRoute *dependant_rt() const {return dependant_rt_.get();}
317  bool ChangeNH(Agent *agent, NextHop *nh);
318  void SyncRoute(bool sync) {sync_ = sync;}
319  bool RouteNeedsSync() {return sync_;}
320  uint32_t GetTunnelBmap() const;
321  bool UpdateNHPolicy(Agent *agent);
322  bool UpdateTunnelType(Agent *agent, const AgentRoute *sync_route);
323  bool ResolveGwNextHops(Agent *agent, const AgentRoute *sync_route);
324  bool RebakeAllTunnelNHinCompositeNH(const AgentRoute *sync_route);
325  virtual std::string ToString() const { return "AgentPath"; }
326  void SetSandeshData(PathSandeshData &data) const;
327  uint32_t preference() const { return path_preference_.preference();}
328  uint32_t sequence() const { return path_preference_.sequence();}
333  composite_nh_key_.reset(key);
334  }
336  return composite_nh_key_.get();
337  }
338  bool ReorderCompositeNH(Agent *agent, CompositeNHKey *nh,
339  bool &comp_nh_policy,
340  const AgentPath *local_path);
341  bool ChangeCompositeNH(Agent *agent, CompositeNHKey *nh);
342  // Get nexthop-ip address to be used for path
343  const Ip4Address *NexthopIp(Agent *agent) const;
344 
345  MacAddress arp_mac() const {return arp_mac_;}
346  void set_arp_mac(const MacAddress &mac) {
347  arp_mac_ = mac;
348  }
349  const Interface* arp_interface() const {return arp_interface_.get();}
350  void set_arp_interface(const Interface *intf) {
351  arp_interface_ = intf;
352  }
353 
354  bool arp_valid() const { return arp_valid_;}
355  void set_arp_valid(bool valid) { arp_valid_ = valid;}
356 
357  bool ecmp_suppressed() const { return ecmp_suppressed_;}
358  void set_ecmp_suppressed(bool suppresed) { ecmp_suppressed_ = suppresed;}
359 
360  bool CopyArpData();
361  bool CopyNdpData();
362  const IpAddress& GetFixedIp() const {
364  }
366  return ecmp_load_balance_;
367  }
370  }
371 
372  bool is_local() const {
373  return is_local_;
374  }
375 
376  void set_is_local(bool is_local) {
378  }
379 
380  bool is_health_check_service() const {
382  }
383 
386  }
387 
388  bool etree_leaf() const {
389  return etree_leaf_;
390  }
391 
392  void set_etree_leaf(bool leaf) {
393  etree_leaf_ = leaf;
394  }
395 
396  bool layer2_control_word() const {
397  return layer2_control_word_;
398  }
399 
402  }
403 
404  void set_native_vrf_id(uint32_t vrf_id) {
405  native_vrf_id_ = vrf_id;
406  }
407 
408  uint32_t native_vrf_id() const {
409  return native_vrf_id_;
410  }
411 
412  void UpdateEcmpHashFields(const Agent *agent,
414  DBRequest &nh_req);
415  uint64_t peer_sequence_number() const {return peer_sequence_number_;}
416  void set_peer_sequence_number(uint64_t sequence_number) {
417  peer_sequence_number_ = sequence_number;
418  }
419  bool ResyncControlWord(const AgentRoute *rt);
420  bool inactive() const {return inactive_;}
421  void set_inactive(bool inactive) {
423  }
424 
425  void ResetEcmpHashFields();
427  const AgentPath *local_path);
430  ecmp_member_list_ = list;
431  }
434  dependent_table_ = table;
435  }
436  void SetDynamicLearntRouteFlag(bool is_learnt_route) {
437  is_learnt_route_ = is_learnt_route;
438  }
440  return is_learnt_route_;
441  }
442 
443 private:
445  // Nexthop for route. Not used for gateway routes
447  // MPLS Label sent by control-node
448  uint32_t label_;
449  // VXLAN-ID sent by control-node
450  uint32_t vxlan_id_;
451  // destination vn-name used in policy lookups
453  // Origin VN name to be populated in flows
454  std::string origin_vn_;
455 
456  // sync_ flag says that any change in this path sholud result in re-sync
457  // of all paths in the route. This can be used in cases where some
458  // properties are inherited from one path to other
459  bool sync_;
460 
461  // When force_policy_ is not set,
462  // Use nexthop with policy if policy enabled on interface
463  // Use nexthop without policy if policy is disabled on interface
464  // When force_policy_ is set
465  // Use nexthop with policy irrespective of interface configuration
470 
471  // tunnel destination address
473  // tunnel_bmap_ sent by control-node
475  // tunnel-type computed for the path
477 
478  // VRF for gw_ip_ in gateway route
479  std::string vrf_name_;
480  // gateway for the route
482  // gateway route is unresolved if,
483  // - no route present for gw_ip_
484  // - ARP not resolved for gw_ip_
486  // subnet route with discard nexthop.
488  // route for the gateway
491  //Local MPLS label path is dependent on
493  //CompositeNH key for resync
494  boost::scoped_ptr<CompositeNHKey> composite_nh_key_;
495  //Gateway address of the subnet this route belong to.
496  //This IP address gets used in sending arp query to the VM
497  //helping in deciding the priority during live migration and
498  //allowed address pair
500  //Mac address of ARP NH, used to notify change
501  //to routes dependent on mac change, or ageout of ARP
503  //Interface on which ARP would be resolved
506  // set true if path was supposed to be ecmp, however ecmp was suppressed
507  // by taking only one of the nexthop from the path
510  // if the path is marked local do no export it to BGP and do not
511  // program it to vrouter
512  bool is_local_;
513  // if the path is marked service health check set vrouter to do proxy arp
514  // TODO(prabhjot) need to find more genric solution for marking proxy arp
515  // to move all the logic of identifing proxy arp in one place
517  // These Ecmp fields will hold the corresponding composite nh ecmp fields reference
518  // if the path's ecmp load balance field is not set
521  //Is the path an etree leaf or root
523  //Should control word of 4 bytes be inserted while egressing the
524  //packet, which could be used by receiving router to determine
525  //if its a l2 packet or l3 packet.
527  bool inactive_;
529  //Valid for routes exported in ip-fabric:__default__ VRF
530  //Indicates the VRF from which routes was originated
531  uint32_t native_vrf_id_;
537 };
538 
539 /*
540  * EvpnDerivedPath
541  *
542  * Used by bridge routes. This path is derived from AgentPath as
543  * common route code expects type AgentPath. Also EvpnDerivedPath
544  * keeps reference path from Evpn route.
545  * evpn_peer_ref is unique peer generated for each evpn route.
546  * ip_addr is the IP taken from parent evpn route.
547  * parent is for debugging to know which evpn route added the path.
548  */
549 class EvpnDerivedPath : public AgentPath {
550 public:
551  EvpnDerivedPath(const EvpnPeer *evpn_peer,
552  const IpAddress &ip_addr,
553  uint32_t ethernet_tag,
554  const std::string &parent);
555  virtual ~EvpnDerivedPath() { }
556 
557  virtual const NextHop *ComputeNextHop(Agent *agent) const;
558  virtual bool IsLess(const AgentPath &right) const;
559 
560  //Data get/set
561  const IpAddress &ip_addr() const {return ip_addr_;}
562  void set_ip_addr(const IpAddress &ip_addr) {ip_addr_ = ip_addr;}
563  const std::string &parent() const {return parent_;}
564  void set_parent(const std::string &parent) {parent_ = parent;}
565  uint32_t ethernet_tag() const {return ethernet_tag_;}
566  void set_ethernet_tag(uint32_t ethernet_tag) {ethernet_tag_ = ethernet_tag;}
567 
568 private:
569  //Key parameters for comparision
571  uint32_t ethernet_tag_;
572  //Data
573  std::string parent_;
575 };
576 
577 /*
578  * EvpnDerivedPathData
579  * Route data used to transfer information from Evpn route for bridge rute
580  * creation.
581  * path_parameters_changed - Telss if some parameters changed in reference path.
582  * Currently its always true as any change in path attributes results in
583  * notification of evpn route and thats when bridge route is also updated.
584  */
586 public:
587  EvpnDerivedPathData(const EvpnRouteEntry *evpn_rt);
588  virtual ~EvpnDerivedPathData() { }
589  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
590  const AgentRoute *rt);
591  virtual std::string ToString() const {return "EvpnDerivedPathData";}
592  virtual AgentPath *CreateAgentPath(const Peer *peer, AgentRoute *rt) const;
593 
594  EvpnPeer *evpn_peer() const;
595  const IpAddress &ip_addr() const {return ip_addr_;}
596  const std::string &parent() const {return parent_;}
597  void set_parent(const std::string &parent) {parent_ = parent;}
599  uint32_t ethernet_tag() const {return ethernet_tag_;}
600  const AgentPath *reference_path() const {return reference_path_;}
601 
602  virtual bool CanDeletePath(Agent *agent, AgentPath *path,
603  const AgentRoute *rt) const;
604 private:
605  void CopyData(const AgentPath *path);
606 
607  uint32_t ethernet_tag_;
609  std::string parent_;
610  //reference_path holds good if route request is inline i.e. via Process
611  //and not via Enqueue.
615 };
616 
617 class ResolveRoute : public AgentRouteData {
618 public:
619  ResolveRoute(const InterfaceKey *key, bool policy, const uint32_t label,
620  const std::string &vn_name, const SecurityGroupList &sg_list,
621  const TagList &tag_list) :
623  intf_key_(key->Clone()), policy_(policy),
624  label_(label), dest_vn_name_(vn_name), path_sg_list_(sg_list),
625  path_tag_list_(tag_list) {}
626  virtual ~ResolveRoute() { }
627  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
628  const AgentRoute *rt);
629  virtual std::string ToString() const {return "Resolve";}
630 private:
631  boost::scoped_ptr<const InterfaceKey> intf_key_;
632  bool policy_;
633  uint32_t label_;
634  const std::string dest_vn_name_;
638 };
639 
640 class LocalVmRoute : public AgentRouteData {
641 public:
642  LocalVmRoute(const VmInterfaceKey &intf, uint32_t mpls_label,
643  uint32_t vxlan_id, bool force_policy, const VnListType &vn_list,
644  uint8_t flags, const SecurityGroupList &sg_list,
645  const TagList &tag_list,
646  const CommunityList &communities,
648  const IpAddress &subnet_service_ip,
649  const EcmpLoadBalance &ecmp_load_balance, bool is_local,
650  bool is_health_check_service, uint64_t sequence_number,
651  bool etree_leaf, bool native_encap,
652  const std::string &intf_route_type = "",
653  bool is_learnt_route = false):
654  AgentRouteData(AgentRouteData::ADD_DEL_CHANGE, false, sequence_number),
655  intf_(intf), mpls_label_(mpls_label),
656  vxlan_id_(vxlan_id), force_policy_(force_policy),
657  dest_vn_list_(vn_list), proxy_arp_(false), sync_route_(false),
658  flags_(flags), sg_list_(sg_list), tag_list_(tag_list),
659  communities_(communities),
660  tunnel_bmap_(TunnelType::MplsType()),
661  path_preference_(path_preference),
662  subnet_service_ip_(subnet_service_ip),
663  ecmp_load_balance_(ecmp_load_balance), is_local_(is_local),
664  is_health_check_service_(is_health_check_service),
665  etree_leaf_(etree_leaf), native_encap_(native_encap),
667  native_vrf_id_(VrfEntry::kInvalidIndex),
668  is_learnt_route_(is_learnt_route) {
669  }
670  virtual ~LocalVmRoute() { }
671  void DisableProxyArp() {proxy_arp_ = false;}
672  virtual std::string ToString() const {return "local VM";}
673  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
674  const AgentRoute *rt);
675  virtual bool UpdateRoute(AgentRoute *rt);
676  const CommunityList &communities() const {return communities_;}
677  const SecurityGroupList &sg_list() const {return sg_list_;}
678  const TagList &tag_list() const {return tag_list_;}
683  }
684  uint32_t vxlan_id() const {return vxlan_id_;}
685  uint32_t tunnel_bmap() const {return tunnel_bmap_;}
686  bool proxy_arp() const {return proxy_arp_;}
687  bool etree_leaf() const { return etree_leaf_;}
688  const std::string &intf_route_type() const { return intf_route_type_; }
689  void set_native_vrf_id(uint32_t vrf_id) {
690  native_vrf_id_ = vrf_id;
691  }
692  uint32_t native_vrf_id() const {
693  return native_vrf_id_;
694  }
695 private:
697  uint32_t mpls_label_;
698  uint32_t vxlan_id_;
703  uint8_t flags_;
711  bool is_local_;
715  std::string intf_route_type_;
716  uint32_t native_vrf_id_;
719 };
720 
721 class PBBRoute : public AgentRouteData {
722 public:
723  PBBRoute(const VrfKey &vrf_key, const MacAddress &mac, uint32_t isid,
724  const VnListType &vn_list, const SecurityGroupList &sg_list,
725  const TagList &tag_list):
727  vrf_key_(vrf_key), dmac_(mac), isid_(isid),
728  dest_vn_list_(vn_list), sg_list_(sg_list), tag_list_(tag_list) {
729  }
730 
731  virtual ~PBBRoute() { }
732  virtual std::string ToString() const {return "PBB route";}
733  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
734  const AgentRoute *rt);
735  const SecurityGroupList &sg_list() const {return sg_list_;}
736  const TagList &tag_list() const {return tag_list_;}
737 
738 private:
741  uint32_t isid_;
747 };
748 
750 public:
751  InetInterfaceRoute(const InetInterfaceKey &intf, uint32_t label,
752  int tunnel_bmap, const VnListType &dest_vn_list,
753  uint64_t sequence_number):
754  AgentRouteData(AgentRouteData::ADD_DEL_CHANGE, false, sequence_number),
755  intf_(intf), label_(label), tunnel_bmap_(tunnel_bmap),
756  dest_vn_list_(dest_vn_list) {
757  }
758  virtual ~InetInterfaceRoute() { }
759  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
760  const AgentRoute *rt);
761  virtual std::string ToString() const {return "host";}
762  virtual bool UpdateRoute(AgentRoute *rt);
763 
764 private:
766  uint32_t label_;
770 };
771 
772 class HostRoute : public AgentRouteData {
773 public:
774  HostRoute(const PacketInterfaceKey &intf, const std::string &dest_vn_name):
776  intf_(intf), dest_vn_name_(dest_vn_name),
777  proxy_arp_(false), policy_(false) {
778  }
779  virtual ~HostRoute() { }
780  void set_proxy_arp() {proxy_arp_ = true;}
781  void set_policy(bool policy) {
782  policy_ = policy;
783  }
784  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
785  const AgentRoute *rt);
786  virtual std::string ToString() const {return "host";}
787  virtual bool UpdateRoute(AgentRoute *rt);
788 
789 private:
791  std::string dest_vn_name_;
793  bool policy_;
795 };
796 
798 public:
799  L2ReceiveRoute(const std::string &dest_vn_name, uint32_t vxlan_id,
800  uint32_t mpls_label, const PathPreference &pref,
801  uint64_t sequence_number) :
802  AgentRouteData(AgentRouteData::ADD_DEL_CHANGE, false, sequence_number),
803  dest_vn_name_(dest_vn_name), vxlan_id_(vxlan_id),
804  mpls_label_(mpls_label), path_preference_(pref) {
805  }
806  virtual ~L2ReceiveRoute() { }
807  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
808  const AgentRoute *rt);
809  virtual std::string ToString() const {return "l2-receive";}
810  virtual bool UpdateRoute(AgentRoute *rt) {return false;}
811 
812 private:
813  std::string dest_vn_name_;
814  uint32_t vxlan_id_;
815  uint32_t mpls_label_;
818 };
819 
820 class VlanNhRoute : public AgentRouteData {
821 public:
822  VlanNhRoute(const VmInterfaceKey &intf, uint16_t tag, uint32_t label,
823  const VnListType &dest_vn_list, const SecurityGroupList &sg_list,
824  const TagList &tag_list,
825  const PathPreference &path_preference, uint64_t sequence_number) :
826  AgentRouteData(AgentRouteData::ADD_DEL_CHANGE, false, sequence_number),
827  intf_(intf), tag_(tag), label_(label),
828  dest_vn_list_(dest_vn_list), sg_list_(sg_list), tag_list_(tag_list),
829  path_preference_(path_preference), tunnel_bmap_(TunnelType::MplsType()) {
830  }
831  virtual ~VlanNhRoute() { }
832  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
833  const AgentRoute *rt);
834  virtual std::string ToString() const {return "vlannh";}
835 
836 private:
838  uint16_t tag_;
839  uint32_t label_;
846 };
847 
849 public:
850  MulticastRoutePath(const Peer *peer);
851  virtual ~MulticastRoutePath() { }
852 
853  virtual bool PostChangeNH(Agent *agent, NextHop *nh);
855  original_nh_ = nh;
856  }
858  return original_nh_;
859  }
860  NextHop *UpdateNH(Agent *agent, CompositeNH *cnh,
861  const TsnElector *te);
862  void UpdateLabels(uint32_t evpn_label, uint32_t fabric_label) {
863  evpn_label_ = evpn_label;
864  fabric_label_ = fabric_label;
865  }
866 
867 private:
869  uint32_t evpn_label_;
870  uint32_t fabric_label_;
872 };
873 
875 public:
876  MulticastRoute(const string &vn_name, uint32_t label, int vxlan_id,
877  uint32_t tunnel_type, DBRequest &nh_req,
879  bool ha_stale = false):
880  AgentRouteData(AgentRouteData::ADD_DEL_CHANGE, true, sequence_number),
881  vn_name_(vn_name), label_(label), vxlan_id_(vxlan_id),
882  tunnel_type_(tunnel_type), comp_nh_type_(comp_nh_type),
883  ha_stale_(ha_stale) {
884  composite_nh_req_.Swap(&nh_req);
885  }
886  virtual ~MulticastRoute() { }
887  virtual AgentPath *CreateAgentPath(const Peer *peer, AgentRoute *rt) const;
888  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
889  const AgentRoute *rt);
890  virtual std::string ToString() const {return "multicast";}
891  uint32_t vxlan_id() const {return vxlan_id_;}
893  static bool CopyPathParameters(Agent *agent,
894  AgentPath *path,
895  const std::string &dest_vn_name,
896  bool unresolved,
897  uint32_t vxlan_id,
898  uint32_t label,
899  uint32_t tunnel_type,
900  NextHop *nh,
901  const AgentRoute *rt,
902  bool ha_stale = false);
903  virtual bool CanDeletePath(Agent *agent, AgentPath *path,
904  const AgentRoute *rt) const;
905 private:
906  string vn_name_;
907  uint32_t label_;
908  uint32_t vxlan_id_;
909  uint32_t tunnel_type_;
912  bool ha_stale_;
914 };
915 
917 public:
918  IpamSubnetRoute(DBRequest &nh_req, const std::string &dest_vn_name);
919  virtual ~IpamSubnetRoute() {}
920  virtual string ToString() const {return "subnet route";}
921  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
922  const AgentRoute *rt);
923  virtual bool UpdateRoute(AgentRoute *rt);
924 
925 private:
927  std::string dest_vn_name_;
929 };
930 
931 class ReceiveRoute : public AgentRouteData {
932 public:
933  ReceiveRoute(const InterfaceKey &intf_key, uint32_t label,
934  uint32_t tunnel_bmap, bool policy, const std::string &vn) :
936  label_(label), tunnel_bmap_(tunnel_bmap),
937  policy_(policy), proxy_arp_(false), ipam_host_route_(false), vn_(vn), sg_list_(), tag_list_() {
938  intf_.reset(intf_key.Clone());
939  }
940  virtual ~ReceiveRoute() { }
941 
942  void SetProxyArp(bool proxy_arp) { proxy_arp_ = proxy_arp; }
943  void SetIpamHostRoute(bool ipam_host_route) { ipam_host_route_ = ipam_host_route; }
944 
945  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
946  const AgentRoute *rt);
947  virtual std::string ToString() const {return "receive";}
948  virtual bool UpdateRoute(AgentRoute *rt);
949 
950 private:
951  boost::scoped_ptr<InterfaceKey> intf_;
952  uint32_t label_;
954  bool policy_;
957  std::string vn_;
961 };
962 
964 public:
965  Inet4UnicastArpRoute(const std::string &vrf_name,
966  const Ip4Address &addr, bool policy,
967  const VnListType &vn_list, const SecurityGroupList &sg,
968  const TagList &tag) :
970  vrf_name_(vrf_name), addr_(addr), policy_(policy),
971  vn_list_(vn_list), sg_list_(sg), tag_list_(tag) {
972  }
973  virtual ~Inet4UnicastArpRoute() { }
974 
975  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
976  const AgentRoute *rt);
977  virtual std::string ToString() const {return "arp";}
978 private:
979  std::string vrf_name_;
981  bool policy_;
986 };
987 
989 public:
990  InetUnicastNdpRoute(const std::string &vrf_name,
991  const IpAddress &addr, bool policy,
992  const VnListType &vn_list, const SecurityGroupList &sg,
993  const TagList &tag) :
995  vrf_name_(vrf_name), addr_(addr), policy_(policy),
996  vn_list_(vn_list), sg_list_(sg), tag_list_(tag) {
997  }
998  virtual ~InetUnicastNdpRoute() { }
999 
1000  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
1001  const AgentRoute *rt);
1002  virtual std::string ToString() const {return "ndp";}
1003 private:
1004  std::string vrf_name_;
1006  bool policy_;
1011 };
1012 
1014 public:
1016  const std::string &vrf_name,
1017  const VnListType &vn_list,
1018  uint32_t label, const SecurityGroupList &sg,
1019  const TagList &tag,
1020  const CommunityList &communities,
1021  bool native_encap):
1023  gw_list_(gw_list), vrf_name_(vrf_name), vn_list_(vn_list),
1024  mpls_label_(label), sg_list_(sg), tag_list_(tag), communities_(communities),
1025  native_encap_(native_encap) {
1026  }
1028  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
1029  const AgentRoute *rt);
1030  virtual std::string ToString() const {return "gateway";}
1031 
1032 private:
1034  std::string vrf_name_;
1036  uint32_t mpls_label_;
1042 };
1043 
1044 class DropRoute : public AgentRouteData {
1045 public:
1046  DropRoute(const string &vn_name) :
1048  vn_(vn_name) { }
1049  virtual ~DropRoute() { }
1050  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
1051  const AgentRoute *rt);
1052  virtual std::string ToString() const {return "drop";}
1053 private:
1054  std::string vn_;
1056 };
1057 
1059 public:
1061  const std::string &vn_name);
1063 
1064  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
1065  const AgentRoute *rt);
1066  virtual std::string ToString() const {return "Interface";}
1067 
1068 private:
1069  std::unique_ptr<InterfaceKey> interface_key_;
1070  std::string vn_name_;
1072 };
1073 
1074 //MacVmBindingPath is used to store VM interface from which
1075 //this route was added. This helps in retrieving the
1076 //VM using MAC in a VRF. Also it stores the flood dhcp
1077 //flag which is used to decide if DHCP request are to
1078 //be answered by agent or external DHCP server.
1079 class MacVmBindingPath : public AgentPath {
1080 public:
1081  MacVmBindingPath(const Peer *peer);
1082  virtual ~MacVmBindingPath() { }
1083 
1084  virtual const NextHop *ComputeNextHop(Agent *agent) const;
1085  virtual bool IsLess(const AgentPath &right) const;
1086 
1087  //Data get/set
1088  const VmInterface *vm_interface() const {
1089  return dynamic_cast<const VmInterface *>(vm_interface_.get());
1090  }
1093  }
1094  virtual bool flood_dhcp() const {return flood_dhcp_;}
1096 
1097 private:
1098  //Key parameters for comparision
1100  // should vrouter flood the DHCP request coming from this source route
1103 };
1104 
1105 //MacVmBindingPathData is expected to be used only in
1106 //inline calls as it is carrying interface pointer.
1107 //In case request is required key will have to be
1108 //provided.
1110 public:
1111  MacVmBindingPathData(const VmInterface *vm_intf, bool flood_dhcp) :
1113  vm_intf_(vm_intf), flood_dhcp_(flood_dhcp) { }
1115  virtual AgentPath *CreateAgentPath(const Peer *peer, AgentRoute *rt) const;
1116  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
1117  const AgentRoute *rt);
1118  virtual std::string ToString() const {return "MacVmBindingPathData";}
1119 
1120 private:
1124 };
1125 
1126 /*
1127  * InetEvpnRoutePath/InetEvpnRouteData
1128  *
1129  * InetEvpnRoute is derived from evpn route.
1130  * Installation of evpn route initiates addition of inet route as well.
1131  * This is done inline and request contains parent evpn route.
1132  * Nexthop derivation: NH is not picked from EVPN route for this path.
1133  * LPM search is done on the inet route prefix and whatever is the supernet
1134  * route, NH is picked from there. In case host route is available the path from
1135  * same takes higher precedence than InetEvpnRoute path.
1136  */
1138 public:
1139  InetEvpnRoutePath(const Peer *peer,
1140  const MacAddress &mac,
1141  const std::string &parent,
1142  AgentRoute *rt);
1143  virtual ~InetEvpnRoutePath() { }
1144  virtual std::string ToString() const { return "InetEvpnRoutePath"; }
1145  virtual const AgentPath *UsablePath() const;
1146  virtual const NextHop *ComputeNextHop(Agent *agent) const;
1147  //Syncs path parameters. Parent route is used for setting dependant rt.
1148  virtual bool Sync(AgentRoute *sync_route);
1149  bool SyncDependantRoute(const AgentRoute *sync_route);
1150  virtual bool IsLess(const AgentPath &rhs) const;
1151 
1152  const MacAddress &MacAddr() const {return mac_;}
1153  void SetMacAddr(const MacAddress &mac) {mac_ = mac;}
1154  const std::string &Parent() const {return parent_;}
1155  void SetParent(const std::string &parent) {parent_ = parent;}
1156 
1157 
1158 private:
1160  std::string parent_;
1162 };
1163 
1165 public:
1166  InetEvpnRouteData(const EvpnRouteEntry *evpn_rt);
1167  virtual ~InetEvpnRouteData() { }
1168  virtual AgentPath *CreateAgentPath(const Peer *peer, AgentRoute *rt) const;
1169  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
1170  const AgentRoute *rt);
1171  virtual std::string ToString() const {return "Derived Inet route from Evpn";}
1172  const MacAddress &MacAddr() const {return mac_;}
1173  const std::string &parent() const {return parent_;}
1174  virtual bool CanDeletePath(Agent *agent, AgentPath *path,
1175  const AgentRoute *rt) const;
1176 
1177 private:
1179  std::string parent_;
1181 };
1182 
1183 // EvpnRoutingData
1184 // Used to do vxlan routing, will be used for following-
1185 // 1) Adding inet route to L2 VRF inet table.
1186 // 2) Adding evpn route(type 5) in routing vrf
1187 // 3) Adding inet route to routing vrf inet table.
1189 public:
1190  EvpnRoutingData(DBRequest &nh_req,
1191  const SecurityGroupList &sg_list,
1192  const CommunityList &communities,
1193  const PathPreference &path_preference,
1194  const EcmpLoadBalance &ecmp_load_balance,
1195  const TagList &tag_list,
1196  VrfEntryConstRef vrf_entry,
1197  uint32_t vxlan_id,
1198  const VnListType& vn_list,
1199  const std::string& origin_vn = "");
1200  virtual ~EvpnRoutingData() { }
1201  virtual AgentPath *CreateAgentPath(const Peer *peer, AgentRoute *rt) const;
1202  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
1203  const AgentRoute *rt);
1204  virtual std::string ToString() const {return "Evpn routing data";}
1205  //Checks if path is evpnrouting path and deletes leak route before path gets
1206  //destroyed.
1207  virtual bool CanDeletePath(Agent *agent, AgentPath *path,
1208  const AgentRoute *rt) const;
1209  virtual bool UpdateRoute(AgentRoute *rt);
1210 
1211 private:
1219  uint32_t vxlan_id_;
1221  const std::string origin_vn_;
1223 };
1224 
1225 class EvpnRoutingPath : public AgentPath {
1226 public:
1227  EvpnRoutingPath(const Peer *peer, AgentRoute *rt,
1229  virtual ~EvpnRoutingPath();
1230 
1231  const VrfEntry *routing_vrf() const;
1232  void set_routing_vrf(const VrfEntry *vrf);
1233  void DeleteEvpnType5Route(Agent *agent, const AgentRoute *rt) const;
1234 
1235 private:
1239 };
1240 
1241 #endif // vnsw_agent_path_hpp
InterfaceConstRef vm_interface_
Definition: agent_path.h:1099
VrfEntryConstRef routing_vrf_
Definition: agent_path.h:1218
TagList tag_list_
Definition: agent_path.h:959
void set_path_preference(const PathPreference &path_preference)
Definition: agent_path.h:681
MulticastRoutePath(const Peer *peer)
Definition: agent_path.cc:1316
MacAddress dmac_
Definition: agent_path.h:740
SecurityGroupList sg_list_
Definition: agent_path.h:1008
virtual std::string ToString() const
Definition: agent_path.h:629
uint32_t ethernet_tag() const
Definition: agent_path.h:565
NextHopRef original_nh() const
Definition: agent_path.h:857
void set_sequence(uint32_t sequence)
Definition: agent_path.h:79
uint64_t sequence_number() const
Definition: agent_route.h:78
uint32_t TypeBmap
Definition: nexthop.h:248
boost::scoped_ptr< CompositeNHKey > composite_nh_key_
Definition: agent_path.h:494
const TagList & tag_list() const
Definition: agent_path.h:678
EvpnRoutingData(DBRequest &nh_req, const SecurityGroupList &sg_list, const CommunityList &communities, const PathPreference &path_preference, const EcmpLoadBalance &ecmp_load_balance, const TagList &tag_list, VrfEntryConstRef vrf_entry, uint32_t vxlan_id, const VnListType &vn_list, const std::string &origin_vn="")
Definition: agent_path.cc:2084
virtual std::string ToString() const
Definition: agent_path.h:890
bool force_policy_
Definition: agent_path.h:699
const CommunityList communities_
Definition: agent_path.h:1214
virtual ~L2ReceiveRoute()
Definition: agent_path.h:806
void set_path_preference(const PathPreference &rp)
Definition: agent_path.h:331
uint32_t l3_vrf_vxlan_id_
Definition: agent_path.h:1237
uint32_t native_vrf_id_
Definition: agent_path.h:531
virtual bool AddChangePathExtended(Agent *, AgentPath *, const AgentRoute *)
Definition: agent_path.cc:1472
virtual ~MacVmBindingPath()
Definition: agent_path.h:1082
bool inactive() const
Definition: agent_path.h:420
bool static_preference_
Definition: agent_path.h:176
DISALLOW_COPY_AND_ASSIGN(AgentPath)
uint32_t vxlan_id_
Definition: agent_path.h:698
const VnListType & dest_vn_list() const
Definition: agent_path.h:258
void set_vm_interface(const VmInterface *vm_interface)
Definition: agent_path.h:1091
std::string dest_vn_name_
Definition: agent_path.h:813
bool sync_
Definition: agent_path.h:459
void set_communities(const CommunityList &communities)
Definition: agent_path.h:293
PathPreferenceData(const PathPreference &path_preference)
Definition: agent_path.h:183
uint32_t fabric_label_
Definition: agent_path.h:870
void ResetEcmpHashFields()
Definition: agent_path.cc:2029
void SetDependentTable(AgentRouteTable *table)
Definition: agent_path.h:433
SecurityGroupList sg_list_
Definition: agent_path.h:704
MacVmBindingPathData(const VmInterface *vm_intf, bool flood_dhcp)
Definition: agent_path.h:1111
bool ChangeNH(Agent *agent, NextHop *nh)
Definition: agent_path.cc:119
uint32_t tunnel_type_
Definition: agent_path.h:909
bool operator==(const PathPreference &rhs) const
Definition: agent_path.h:127
uint32_t tunnel_bmap() const
Definition: agent_path.h:685
void set_gw_ip(const IpAddress &addr)
Definition: agent_path.h:286
uint32_t preference_
Definition: agent_path.h:173
void set_unresolved(bool unresolved)
Definition: agent_path.h:285
uint32_t mpls_label_
Definition: agent_path.h:697
PathPreference(uint32_t sequence, uint32_t preference, bool wait_for_traffic, bool ecmp)
Definition: agent_path.h:35
Definition: vrf.h:86
const TagList & tag_list() const
Definition: agent_path.h:249
virtual std::string ToString() const
Definition: agent_path.h:1066
const PathPreference & path_preference() const
Definition: agent_path.h:329
bool force_policy() const
Definition: agent_path.h:270
bool CopyArpData()
Definition: agent_path.cc:582
DISALLOW_COPY_AND_ASSIGN(PBBRoute)
DependencyRef< AgentRoute, AgentRoute > dependant_rt_
Definition: agent_path.h:489
bool is_local_
Definition: agent_path.h:512
const IpAddress subnet_service_ip() const
Definition: agent_path.h:274
std::string origin_vn_
Definition: agent_path.h:454
virtual std::string ToString() const
Definition: agent_path.h:809
void set_local_ecmp_mpls_label(MplsLabel *mpls)
Definition: agent_path.cc:1805
const MacAddress & MacAddr() const
Definition: agent_path.h:1152
void clear()
Definition: dependency.h:42
const IpAddress & ip_addr() const
Definition: agent_path.h:561
virtual AgentPath * CreateAgentPath(const Peer *peer, AgentRoute *rt) const
Definition: agent_path.cc:665
virtual ~DropRoute()
Definition: agent_path.h:1049
void set_original_nh(NextHopRef nh)
Definition: agent_path.h:854
MulticastRoute(const string &vn_name, uint32_t label, int vxlan_id, uint32_t tunnel_type, DBRequest &nh_req, COMPOSITETYPE comp_nh_type, uint64_t sequence_number, bool ha_stale=false)
Definition: agent_path.h:876
bool wait_for_traffic_
Definition: agent_path.h:174
VnListType dest_vn_list_
Definition: agent_path.h:840
DISALLOW_COPY_AND_ASSIGN(MulticastRoutePath)
InetInterfaceRoute(const InetInterfaceKey &intf, uint32_t label, int tunnel_bmap, const VnListType &dest_vn_list, uint64_t sequence_number)
Definition: agent_path.h:751
void SetUnresolved(bool flag)
Definition: agent_path.h:216
const std::string & parent() const
Definition: agent_path.h:596
CommunityList communities_
Definition: agent_path.h:469
bool RouteNeedsSync()
Definition: agent_path.h:319
virtual const NextHop * ComputeNextHop(Agent *agent) const
Definition: agent_path.cc:1971
SecurityGroupList sg_list_
Definition: agent_path.h:958
void ImportPrevActiveNH(Agent *agent, NextHop *nh)
Definition: agent_path.cc:299
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:1500
void set_routing_vrf(const VrfEntry *vrf)
Definition: agent_path.cc:2062
DependencyRef< AgentRoute, MplsLabel > local_ecmp_mpls_label_
Definition: agent_path.h:492
uint32_t vxlan_id_
Definition: agent_path.h:908
TunnelType::Type tunnel_type() const
Definition: agent_path.h:266
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge, EVPN (Type2/Type5). This base class contains common code for all types of route tables.
Definition: agent_route.h:109
void set_ethernet_tag(uint32_t ethernet_tag)
Definition: agent_path.h:566
virtual ~EvpnDerivedPathData()
Definition: agent_path.h:588
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
virtual InterfaceKey * Clone() const =0
VnListType dest_vn_list_
Definition: agent_path.h:742
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_path.cc:2190
DISALLOW_COPY_AND_ASSIGN(InetInterfaceRoute)
void ClearDependantRoute()
Definition: agent_path.h:314
uint32_t preference() const
Definition: agent_path.h:41
IpAddress gw_ip_
Definition: agent_path.h:481
void set_sg_list(const SecurityGroupList &sg)
Definition: agent_path.h:291
uint32_t ethernet_tag_
Definition: agent_path.h:571
std::string vrf_name_
Definition: agent_path.h:1004
bool RebakeAllTunnelNHinCompositeNH(const AgentRoute *sync_route)
Definition: agent_path.cc:151
void DisableProxyArp()
Definition: agent_path.h:671
DBRequest nh_req_
Definition: agent_path.h:926
DISALLOW_COPY_AND_ASSIGN(IpamSubnetRoute)
ReceiveRoute(const InterfaceKey &intf_key, uint32_t label, uint32_t tunnel_bmap, bool policy, const std::string &vn)
Definition: agent_path.h:933
boost::asio::ip::address IpAddress
Definition: address.h:13
virtual bool PostChangeNH(Agent *agent, NextHop *nh)
Definition: agent_path.cc:147
virtual ~EvpnRoutingData()
Definition: agent_path.h:1200
void set_vxlan_id(uint32_t vxlan_id)
Definition: agent_path.h:281
EcmpLoadBalance ecmp_load_balance_
Definition: agent_path.h:509
DISALLOW_COPY_AND_ASSIGN(VlanNhRoute)
DISALLOW_COPY_AND_ASSIGN(ResolveRoute)
uint32_t GetTunnelBmap() const
Definition: agent_path.cc:70
PathPreference path_preference_
Definition: agent_path.h:843
bool ipam_host_route_
Definition: agent_path.h:956
boost::shared_ptr< AgentPathEcmpComponent > AgentPathEcmpComponentPtr
Definition: agent_path.h:228
virtual bool IsLess(const AgentPath &rhs) const
std::vector< int > SecurityGroupList
Definition: agent.h:201
InetEvpnRouteData(const EvpnRouteEntry *evpn_rt)
const std::string & dest_vn_name() const
Definition: agent_path.h:251
virtual ~AgentPath()
Definition: agent_path.cc:66
virtual ~LocalVmRoute()
Definition: agent_path.h:670
void set_ip_addr(const IpAddress &ip_addr)
Definition: agent_path.h:562
IpAddress ip_addr_
Definition: agent_path.h:570
std::string parent_
Definition: agent_path.h:1160
const TagList path_tag_list_
Definition: agent_path.h:636
virtual bool CanDeletePath(Agent *agent, AgentPath *path, const AgentRoute *rt) const
Definition: agent_path.cc:1467
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:1230
virtual ~InetUnicastNdpRoute()
Definition: agent_path.h:998
const SecurityGroupList & sg_list() const
Definition: agent_path.h:735
virtual AgentPath * CreateAgentPath(const Peer *peer, AgentRoute *rt) const
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:1169
DISALLOW_COPY_AND_ASSIGN(InetEvpnRouteData)
virtual ~InetEvpnRouteData()
Definition: agent_path.h:1167
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:1119
COMPOSITETYPE comp_nh_type_
Definition: agent_path.h:911
const std::string & parent() const
Definition: agent_path.h:1173
const VrfEntry * routing_vrf() const
Definition: agent_path.cc:2058
EvpnDerivedPath(const EvpnPeer *evpn_peer, const IpAddress &ip_addr, uint32_t ethernet_tag, const std::string &parent)
Definition: agent_path.cc:626
ObjectType * get() const
Definition: dependency.h:49
TunnelType::TypeBmap tunnel_bmap_
Definition: agent_path.h:844
bool is_health_check_service_
Definition: agent_path.h:516
bool IsDynamicLearntRoute()
Definition: agent_path.h:439
string vn_name_
Definition: agent_path.h:906
const AgentRoute * dependant_rt() const
Definition: agent_path.h:316
void set_native_vrf_id(uint32_t vrf_id)
Definition: agent_path.h:404
void set_loc_sequence(uint32_t loc_sequence)
Definition: agent_path.h:76
EcmpHashFields ecmp_hash_fields_
Definition: agent_path.h:519
void set_is_health_check_service(bool val)
Definition: agent_path.h:384
virtual std::string ToString() const
Definition: agent_path.h:977
virtual std::string ToString() const
Definition: agent_path.h:672
bool policy_
Definition: agent_path.h:793
virtual std::string ToString() const
Definition: agent_path.h:186
VrfEntryConstRef routing_vrf_
Definition: agent_path.h:1236
virtual bool CanDeletePath(Agent *agent, AgentPath *path, const AgentRoute *rt) const
const SecurityGroupList sg_list_
Definition: agent_path.h:1213
void CopyData(const AgentPath *path)
std::string dest_vn_name_
Definition: agent_path.h:791
std::string vn_
Definition: agent_path.h:957
bool CopyNdpData()
Definition: agent_path.cc:604
virtual bool IsLess(const AgentPath &right) const
Definition: agent_path.cc:1967
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:1384
InterfaceConstRef arp_interface_
Definition: agent_path.h:504
virtual AgentPath * CreateAgentPath(const Peer *peer, AgentRoute *rt) const
Definition: agent_path.cc:1975
TagList tag_list_
Definition: agent_path.h:468
EvpnRoutingPath(const Peer *peer, AgentRoute *rt, VrfEntryConstRef routing_vrf)
Definition: agent_path.cc:2048
void set_is_local(bool is_local)
Definition: agent_path.h:376
bool ecmp_suppressed_
Definition: agent_path.h:508
std::string parent_
Definition: agent_path.h:1179
void set_vrf(const std::string &vrf)
Definition: agent_path.h:100
DISALLOW_COPY_AND_ASSIGN(MulticastRoute)
const MplsLabel * local_ecmp_mpls_label() const
Definition: agent_path.cc:1815
virtual const NextHop * ComputeNextHop(Agent *agent) const
bool is_subnet_discard_
Definition: agent_path.h:487
const std::string dest_vn_name_
Definition: agent_path.h:634
NextHopRef nh_
Definition: agent_path.h:446
L2ReceiveRoute(const std::string &dest_vn_name, uint32_t vxlan_id, uint32_t mpls_label, const PathPreference &pref, uint64_t sequence_number)
Definition: agent_path.h:799
bool operator<(const PathPreference &rhs) const
Definition: agent_path.h:112
ResolveRoute(const InterfaceKey *key, bool policy, const uint32_t label, const std::string &vn_name, const SecurityGroupList &sg_list, const TagList &tag_list)
Definition: agent_path.h:619
bool operator==(const AgentPathEcmpComponent &rhs) const
Definition: agent_path.h:199
bool is_learnt_route_
Definition: agent_path.h:535
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
void set_native_vrf_id(uint32_t vrf_id)
Definition: agent_path.h:689
bool ChangeCompositeNH(Agent *agent, CompositeNHKey *nh)
Definition: agent_path.cc:1920
bool ReorderCompositeNH(Agent *agent, CompositeNHKey *nh, bool &comp_nh_policy, const AgentPath *local_path)
Definition: agent_path.cc:1851
std::string vrf_
Definition: agent_path.h:178
void SetParent(const std::string &parent)
Definition: agent_path.h:1155
VnListType vn_list_
Definition: agent_path.h:982
void SetDynamicLearntRouteFlag(bool is_learnt_route)
Definition: agent_path.h:436
const AgentPath * reference_path() const
Definition: agent_path.h:600
bool is_health_check_service_
Definition: agent_path.h:712
Base class for all Route entries in agent.
Definition: agent_route.h:224
void Swap(DBRequest *rhs)
Definition: db_table.cc:43
void UpdateDependentRoute(AgentRoute *rt)
Definition: agent_path.h:208
virtual bool CanDeletePath(Agent *agent, AgentPath *path, const AgentRoute *rt) const
Definition: agent_path.cc:754
virtual ~ReceiveRoute()
Definition: agent_path.h:940
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:854
CompositeNHKey * composite_nh_key()
Definition: agent_path.h:335
static bool CopyPathParameters(Agent *agent, AgentPath *path, const std::string &dest_vn_name, bool unresolved, uint32_t vxlan_id, uint32_t label, uint32_t tunnel_type, NextHop *nh, const AgentRoute *rt, bool ha_stale=false)
Definition: agent_path.cc:1417
virtual bool IsLess(const AgentPath &right) const
Definition: agent_path.cc:561
AgentPath(const Peer *peer, AgentRoute *rt)
Definition: agent_path.cc:51
virtual const AgentPath * UsablePath() const
Definition: agent_path.cc:574
DISALLOW_COPY_AND_ASSIGN(ReceiveRoute)
bool etree_leaf() const
Definition: agent_path.h:687
DISALLOW_COPY_AND_ASSIGN(EvpnRoutingData)
boost::scoped_ptr< const InterfaceKey > intf_key_
Definition: agent_path.h:631
void ResetEcmpMemberList(AgentPathEcmpComponentPtrList list)
Definition: agent_path.h:429
int tunnel_bmap_
Definition: agent_path.h:953
bool operator!=(const PathPreference &rhs) const
Definition: agent_path.h:104
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_path.cc:1097
const Ip4Address & tunnel_dest() const
Definition: agent_path.h:272
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:1271
virtual std::string ToString() const
Definition: agent_path.h:1171
void clear_tag_list()
Definition: agent_path.h:295
const CommunityList communities_
Definition: agent_path.h:1039
Ip4Address tunnel_dest_
Definition: agent_path.h:472
uint32_t native_vrf_id() const
Definition: agent_path.h:692
virtual string ToString() const
Definition: agent_path.h:920
const MacAddress & MacAddr() const
Definition: agent_path.h:1172
TunnelType::TypeBmap tunnel_bmap_
Definition: agent_path.h:474
InetUnicastNdpRoute(const std::string &vrf_name, const IpAddress &addr, bool policy, const VnListType &vn_list, const SecurityGroupList &sg, const TagList &tag)
Definition: agent_path.h:990
TunnelType::TypeBmap tunnel_bmap_
Definition: agent_path.h:707
virtual bool Sync(AgentRoute *sync_route)
bool ecmp() const
Definition: agent_path.h:45
bool layer2_control_word() const
Definition: agent_path.h:396
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:766
void set_tunnel_bmap(TunnelType::TypeBmap bmap)
Definition: agent_path.h:289
NextHop * nexthop() const
Definition: agent_path.cc:87
bool is_local() const
Definition: agent_path.h:372
TunnelType::Type GetTunnelType() const
Definition: agent_path.h:276
uint32_t vxlan_id_
Definition: agent_path.h:1219
bool sync_route_
Definition: agent_path.h:702
COMPOSITETYPE comp_nh_type() const
Definition: agent_path.h:892
std::string parent_
Definition: agent_path.h:609
DependencyRef< AgentRoute, AgentRoute > dependent_rt_
Definition: agent_path.h:223
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:2111
virtual std::string ToString() const
Definition: agent_path.h:761
virtual ~Inet4UnicastGatewayRoute()
Definition: agent_path.h:1027
SecurityGroupList sg_list_
Definition: agent_path.h:467
const TagList & tag_list() const
Definition: agent_path.h:736
DISALLOW_COPY_AND_ASSIGN(AgentPathEcmpComponent)
virtual std::string ToString() const
Definition: agent_path.h:834
virtual ~EvpnRoutingPath()
Definition: agent_path.cc:2055
void set_dependent_ip(const IpAddress &ip)
Definition: agent_path.h:96
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_path.cc:1301
void set_arp_interface(const Interface *intf)
Definition: agent_path.h:350
uint8_t type
Definition: load_balance.h:109
void set_ecmp_suppressed(bool suppresed)
Definition: agent_path.h:358
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:1983
bool is_local_
Definition: agent_path.h:711
bool IsDependentRt(void) const
Definition: agent_path.h:156
DBRequest nh_req_
Definition: agent_path.h:1212
virtual std::string ToString() const
Definition: agent_path.h:786
Definition: agent.h:358
bool etree_leaf_
Definition: agent_path.h:713
std::string vrf_name_
Definition: agent_path.h:479
virtual ~PBBRoute()
Definition: agent_path.h:731
const SecurityGroupList sg_list_
Definition: agent_path.h:1037
const IpAddress & gw_ip() const
Definition: agent_path.h:268
Definition: path.h:10
PathPreference & path_preference_non_const()
Definition: agent_path.h:330
bool static_preference() const
Definition: agent_path.h:64
bool unresolved_
Definition: agent_path.h:485
AgentRouteTable * dependent_table_
Definition: agent_path.h:534
MacVmBindingPath(const Peer *peer)
Definition: agent_path.cc:1963
Definition: vrf.h:22
const std::string & vrf() const
Definition: agent_path.h:72
DISALLOW_COPY_AND_ASSIGN(InetEvpnRoutePath)
virtual ~Inet4UnicastInterfaceRoute()
Definition: agent_path.h:1062
void set_subnet_service_ip(const IpAddress &ip)
Definition: agent_path.h:303
InetInterfaceKey intf_
Definition: agent_path.h:765
uint32_t sequence() const
Definition: agent_path.h:328
bool is_subnet_discard() const
Definition: agent_path.h:273
uint32_t label() const
Definition: agent_path.h:264
void set_layer2_control_word(bool layer2_control_word)
Definition: agent_path.h:400
void set_vrf_name(const std::string &vrf_name)
Definition: agent_path.h:288
Inet4UnicastArpRoute(const std::string &vrf_name, const Ip4Address &addr, bool policy, const VnListType &vn_list, const SecurityGroupList &sg, const TagList &tag)
Definition: agent_path.h:965
uint32_t ethernet_tag_
Definition: agent_path.h:607
uint32_t label_
Definition: agent_path.h:633
virtual std::string ToString() const
Definition: agent_path.h:1002
NextHopRef original_nh_
Definition: agent_path.h:868
uint32_t loc_sequence() const
Definition: agent_path.h:39
uint32_t native_vrf_id_
Definition: agent_path.h:716
virtual ~MulticastRoute()
Definition: agent_path.h:886
void set_copy_local_path(bool copy_local_path)
Definition: agent_path.h:307
void set_parent(const std::string &parent)
Definition: agent_path.h:597
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:673
EcmpLoadBalance ecmp_load_balance_
Definition: agent_path.h:710
Inet4UnicastInterfaceRoute(const PhysicalInterface *intrface, const std::string &vn_name)
bool inactive_
Definition: agent_path.h:527
VmInterfaceKey intf_
Definition: agent_path.h:837
bool is_health_check_service() const
Definition: agent_path.h:380
const MacAddress mac_
Definition: agent_path.h:1178
DISALLOW_COPY_AND_ASSIGN(Inet4UnicastInterfaceRoute)
std::string vn_
Definition: agent_path.h:1054
virtual AgentPath * CreateAgentPath(const Peer *peer, AgentRoute *rt) const
Definition: agent_path.cc:2106
void UpdateLabels(uint32_t evpn_label, uint32_t fabric_label)
Definition: agent_path.h:862
uint32_t native_vrf_id() const
Definition: agent_path.h:408
TagList tag_list_
Definition: agent_path.h:744
static const std::string & NullString()
Definition: agent.h:437
const Peer * peer() const
Definition: agent_path.h:263
const VmInterface * vm_interface() const
Definition: agent_path.h:1088
bool is_learnt_route_
Definition: agent_path.h:717
boost::intrusive_ptr< const Interface > InterfaceConstRef
Definition: agent.h:51
DISALLOW_COPY_AND_ASSIGN(MacVmBindingPathData)
VnListType vn_list_
Definition: agent_path.h:1007
DropRoute(const string &vn_name)
Definition: agent_path.h:1046
IpAddress ip_addr_
Definition: agent_path.h:608
MacAddress arp_mac_
Definition: agent_path.h:502
const std::string & origin_vn() const
Definition: agent_path.h:259
PBBRoute(const VrfKey &vrf_key, const MacAddress &mac, uint32_t isid, const VnListType &vn_list, const SecurityGroupList &sg_list, const TagList &tag_list)
Definition: agent_path.h:723
const bool unresolved() const
Definition: agent_path.h:271
void set_wait_for_traffic(bool wait_for_traffic)
Definition: agent_path.h:85
bool arp_valid_
Definition: agent_path.h:505
void set_preference(uint32_t preference)
Definition: agent_path.h:82
const AgentPath * reference_path_
Definition: agent_path.h:612
const std::string & vrf_name() const
Definition: agent_path.h:269
void ResetDependantRoute(AgentRoute *rt)
Definition: agent_path.h:315
bool etree_leaf() const
Definition: agent_path.h:388
virtual std::string ToString() const
Definition: agent_path.h:1052
virtual ~InetEvpnRoutePath()
Definition: agent_path.h:1143
std::vector< std::string > CommunityList
Definition: bgp_config.h:347
void SetSandeshData(PathSandeshData &data) const
Definition: agent_path.cc:1720
std::vector< Ip4Address > AddressList
Definition: agent.h:217
void set_peer_sequence_number(uint64_t sequence_number)
Definition: agent_path.h:416
virtual bool PostChangeNH(Agent *agent, NextHop *nh)
Definition: agent_path.cc:1322
bool native_encap_
Definition: agent_path.h:714
DISALLOW_COPY_AND_ASSIGN(L2ReceiveRoute)
PeerConstPtr peer_
Definition: agent_path.h:444
Definition: peer.h:44
VmInterfaceKey intf_
Definition: agent_path.h:696
bool proxy_arp() const
Definition: agent_path.h:686
uint32_t isid_
Definition: agent_path.h:741
virtual ~InetInterfaceRoute()
Definition: agent_path.h:758
VlanNhRoute(const VmInterfaceKey &intf, uint16_t tag, uint32_t label, const VnListType &dest_vn_list, const SecurityGroupList &sg_list, const TagList &tag_list, const PathPreference &path_preference, uint64_t sequence_number)
Definition: agent_path.h:822
uint8_t flags_
Definition: agent_path.h:703
uint64_t peer_sequence_number() const
Definition: agent_path.h:415
std::set< std::string > VnListType
Definition: agent.h:212
bool is_ecmp() const
Definition: agent_path.h:49
const VmInterface * vm_intf_
Definition: agent_path.h:1121
uint64_t peer_sequence_number_
Definition: agent_path.h:520
bool force_policy_
Definition: agent_path.h:466
const SecurityGroupList path_sg_list_
Definition: agent_path.h:635
void set_tunnel_dest(const Ip4Address &tunnel_dest)
Definition: agent_path.h:297
static Type ComputeType(TypeBmap bmap)
Definition: nexthop.cc:33
const std::string origin_vn_
Definition: agent_path.h:1221
virtual bool IsLess(const AgentPath &right) const
Definition: agent_path.cc:635
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_path.cc:843
virtual bool CanDeletePath(Agent *agent, AgentPath *path, const AgentRoute *rt) const
Definition: agent_path.cc:2178
Inet4UnicastGatewayRoute(const AddressList &gw_list, const std::string &vrf_name, const VnListType &vn_list, uint32_t label, const SecurityGroupList &sg, const TagList &tag, const CommunityList &communities, bool native_encap)
Definition: agent_path.h:1015
virtual std::string ToString() const
Definition: agent_path.h:1204
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:14
virtual std::string ToString() const
Definition: agent_path.h:325
uint32_t mpls_label_
Definition: agent_path.h:815
DISALLOW_COPY_AND_ASSIGN(LocalVmRoute)
SecurityGroupList sg_list_
Definition: agent_path.h:983
EvpnPeer * evpn_peer() const
std::vector< AgentPathEcmpComponentPtr > AgentPathEcmpComponentPtrList
Definition: agent_path.h:229
uint32_t GetActiveLabel() const
Definition: agent_path.cc:79
VrfKey vrf_key_
Definition: agent_path.h:739
bool ResolveGwNextHops(Agent *agent, const AgentRoute *sync_route)
Definition: agent_path.cc:327
bool UpdateNHPolicy(Agent *agent)
Definition: agent_path.cc:184
virtual bool Sync(AgentRoute *sync_route)
Definition: agent_path.cc:440
uint32_t evpn_label_
Definition: agent_path.h:869
virtual std::string ToString() const
Definition: agent_path.h:591
virtual std::string ToString() const
Definition: agent_path.h:732
void clear_sg_list()
Definition: agent_path.h:294
boost::intrusive_ptr< const Peer > PeerConstPtr
Definition: peer.h:41
const IpAddress & GetFixedIp() const
Definition: agent_path.h:362
void set_inactive(bool inactive)
Definition: agent_path.h:421
AgentPathEcmpComponentPtrList ecmp_member_list_
Definition: agent_path.h:533
std::string dest_vn_name_
Definition: agent_path.h:927
virtual ~EvpnDerivedPath()
Definition: agent_path.h:555
virtual AgentPath * CreateAgentPath(const Peer *peer, AgentRoute *rt) const
Definition: agent_path.cc:1379
DISALLOW_COPY_AND_ASSIGN(EvpnDerivedPathData)
const CommunityList & communities() const
Definition: agent_path.h:676
DISALLOW_COPY_AND_ASSIGN(HostRoute)
void set_ethernet_tag(uint32_t ethernet_tag)
Definition: agent_path.h:598
virtual std::string ToString() const
Definition: agent_path.h:1144
virtual const NextHop * ComputeNextHop(Agent *agent) const
Definition: agent_path.cc:647
void UpdateEcmpHashFields(const Agent *agent, const EcmpLoadBalance &ecmp_load_balance, DBRequest &nh_req)
Definition: agent_path.cc:2006
void set_tag_list(const TagList &tag)
Definition: agent_path.h:292
HostRoute(const PacketInterfaceKey &intf, const std::string &dest_vn_name)
Definition: agent_path.h:774
const TagList tag_list_
Definition: agent_path.h:1038
void set_nexthop(NextHop *nh)
Definition: agent_path.cc:578
const TagList tag_list_
Definition: agent_path.h:1217
boost::scoped_ptr< InterfaceKey > intf_
Definition: agent_path.h:951
void set_is_subnet_discard(bool discard)
Definition: agent_path.h:300
CommunityList communities_
Definition: agent_path.h:706
PathPreference path_preference_
Definition: agent_path.h:745
SecurityGroupList sg_list_
Definition: agent_path.h:841
virtual ~AgentPathEcmpComponent()
Definition: agent_path.h:196
void set_origin_vn(const std::string &origin_vn)
Definition: agent_path.h:284
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
uint32_t vxlan_id_
Definition: agent_path.h:450
InetEvpnRoutePath(const Peer *peer, const MacAddress &mac, const std::string &parent, AgentRoute *rt)
AgentPathEcmpComponent(IpAddress addr, uint32_t label, AgentRoute *rt)
Definition: agent_path.cc:2198
VnListType dest_vn_list_
Definition: agent_path.h:768
uint32_t label_
Definition: agent_path.h:952
TagList tag_list_
Definition: agent_path.h:705
const VnListType dest_vn_list_
Definition: agent_path.h:1220
PathPreference path_preference_
Definition: agent_path.h:708
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_path.cc:788
Definition: mpls.h:52
uint32_t label_
Definition: agent_path.h:448
VnListType dest_vn_list_
Definition: agent_path.h:700
bool proxy_arp_
Definition: agent_path.h:955
virtual std::string ToString() const
Definition: agent_path.h:947
void set_flood_dhcp(bool flood_dhcp)
Definition: agent_path.h:1095
bool dest_vn_match(const std::string &vn) const
Definition: agent_path.cc:1809
DISALLOW_COPY_AND_ASSIGN(Inet4UnicastGatewayRoute)
void SetMacAddr(const MacAddress &mac)
Definition: agent_path.h:1153
uint32_t vxlan_id() const
Definition: agent_path.h:684
void set_etree_leaf(bool leaf)
Definition: agent_path.h:392
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_path.cc:1536
void DeleteEvpnType5Route(Agent *agent, const AgentRoute *rt) const
Definition: agent_path.cc:2066
#define COMPOSITETYPE
Definition: nexthop.h:1600
void set_arp_valid(bool valid)
Definition: agent_path.h:355
void set_composite_nh_key(CompositeNHKey *key)
Definition: agent_path.h:332
void set_static_preference(bool static_pref)
Definition: agent_path.h:92
bool proxy_arp_
Definition: agent_path.h:792
virtual bool flood_dhcp() const
Definition: agent_path.h:1094
AgentRoute * GetParentRoute()
Definition: agent_path.h:428
const SecurityGroupList & sg_list() const
Definition: agent_path.h:677
VnListType dest_vn_list_
Definition: agent_path.h:452
EvpnDerivedPathData(const EvpnRouteEntry *evpn_rt)
Definition: agent_path.cc:651
TagList tag_list_
Definition: agent_path.h:842
virtual ~HostRoute()
Definition: agent_path.h:779
uint32_t vxlan_id() const
Definition: agent_path.h:891
bool ecmp_suppressed() const
Definition: agent_path.h:357
bool arp_valid() const
Definition: agent_path.h:354
void set_label(uint32_t label)
Definition: agent_path.h:282
bool SyncDependantRoute(const AgentRoute *sync_route)
const std::string & parent() const
Definition: agent_path.h:563
void SetProxyArp(bool proxy_arp)
Definition: agent_path.h:942
void set_arp_mac(const MacAddress &mac)
Definition: agent_path.h:346
MacAddress mac_
Definition: agent_path.h:1159
uint32_t label_
Definition: agent_path.h:907
bool layer2_control_word_
Definition: agent_path.h:526
AgentRoute * parent_rt_
Definition: agent_path.h:532
std::string vrf_name_
Definition: agent_path.h:979
DISALLOW_COPY_AND_ASSIGN(MacVmBindingPath)
LocalVmRoute(const VmInterfaceKey &intf, uint32_t mpls_label, uint32_t vxlan_id, bool force_policy, const VnListType &vn_list, uint8_t flags, const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &communities, const PathPreference &path_preference, const IpAddress &subnet_service_ip, const EcmpLoadBalance &ecmp_load_balance, bool is_local, bool is_health_check_service, uint64_t sequence_number, bool etree_leaf, bool native_encap, const std::string &intf_route_type="", bool is_learnt_route=false)
Definition: agent_path.h:642
const Ip4Address * NexthopIp(Agent *agent) const
Definition: agent_path.cc:1955
bool UpdateTunnelType(Agent *agent, const AgentRoute *sync_route)
Definition: agent_path.cc:228
virtual ~ResolveRoute()
Definition: agent_path.h:626
void set_dest_vn_list(const VnListType &dest_vn_list)
Definition: agent_path.h:283
DBRequest composite_nh_req_
Definition: agent_path.h:910
virtual const NextHop * ComputeNextHop(Agent *agent) const
Definition: agent_path.cc:91
bool wait_for_traffic() const
Definition: agent_path.h:42
IpamSubnetRoute(DBRequest &nh_req, const std::string &dest_vn_name)
Definition: agent_path.cc:1493
virtual ~Inet4UnicastArpRoute()
Definition: agent_path.h:973
std::string intf_route_type_
Definition: agent_path.h:715
bool ConfigChanged(const PathPreference &rhs) const
Definition: agent_path.h:142
DISALLOW_COPY_AND_ASSIGN(Inet4UnicastArpRoute)
PathPreference path_preference_
Definition: agent_path.h:190
PacketInterfaceKey intf_
Definition: agent_path.h:790
IpAddress dependent_ip_
Definition: agent_path.h:177
uint16_t tag_
Definition: agent_path.h:838
virtual std::string ToString() const
Definition: agent_path.h:1030
const PathPreference path_preference_
Definition: agent_path.h:1215
void set_ecmp(bool ecmp)
Definition: agent_path.h:88
virtual ~MulticastRoutePath()
Definition: agent_path.h:851
PathPreference path_preference_
Definition: agent_path.h:490
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:885
const IpAddress & dependent_ip() const
Definition: agent_path.h:68
uint32_t label_
Definition: agent_path.h:839
bool copy_local_path_
Definition: agent_path.h:528
bool etree_leaf_
Definition: agent_path.h:522
bool ResyncControlWord(const AgentRoute *rt)
Definition: agent_path.cc:2033
uint32_t preference() const
Definition: agent_path.h:327
uint32_t ethernet_tag() const
Definition: agent_path.h:599
uint32_t tunnel_bmap() const
Definition: agent_path.h:267
void reset(ObjectType *ptr)
Definition: dependency.h:32
std::string parent_
Definition: agent_path.h:573
void clear_communities()
Definition: agent_path.h:296
const Interface * arp_interface() const
Definition: agent_path.h:349
IpAddress subnet_service_ip_
Definition: agent_path.h:499
void set_tunnel_type(TunnelType::Type type)
Definition: agent_path.h:290
IpAddress GetGwIpAddr()
Definition: agent_path.h:206
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:799
DISALLOW_COPY_AND_ASSIGN(EvpnRoutingPath)
const CommunityList & communities() const
Definition: agent_path.h:250
const std::string & Parent() const
Definition: agent_path.h:1154
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_path.h:810
Definition: peer.h:257
void set_proxy_arp()
Definition: agent_path.h:780
void set_force_policy(bool force_policy)
Definition: agent_path.h:287
uint32_t sequence_
Definition: agent_path.h:172
const PathPreference path_preference_
Definition: agent_path.h:816
DISALLOW_COPY_AND_ASSIGN(InetUnicastNdpRoute)
virtual ~VlanNhRoute()
Definition: agent_path.h:831
const EcmpLoadBalance ecmp_load_balance_
Definition: agent_path.h:1216
DISALLOW_COPY_AND_ASSIGN(DropRoute)
IpAddress subnet_service_ip_
Definition: agent_path.h:709
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_path.cc:905
uint32_t sequence() const
Definition: agent_path.h:40
void GetDestinationVnList(std::vector< std::string > *vn_list) const
Definition: agent_path.cc:1713
virtual ~MacVmBindingPathData()
Definition: agent_path.h:1114
const IpAddress & ip_addr() const
Definition: agent_path.h:595
uint32_t vxlan_id_
Definition: agent_path.h:814
void set_parent(const std::string &parent)
Definition: agent_path.h:564
DISALLOW_COPY_AND_ASSIGN(EvpnDerivedPath)
TunnelType::Type tunnel_type_
Definition: agent_path.h:476
const SecurityGroupList & sg_list() const
Definition: agent_path.h:248
uint32_t vxlan_id() const
Definition: agent_path.h:265
virtual const AgentPath * UsablePath() const
SecurityGroupList sg_list_
Definition: agent_path.h:743
const EcmpLoadBalance & ecmp_load_balance() const
Definition: agent_path.h:365
const std::string & intf_route_type() const
Definition: agent_path.h:688
virtual ~IpamSubnetRoute()
Definition: agent_path.h:919
void set_ecmp_load_balance(const EcmpLoadBalance &ecmp_load_balance)
Definition: agent_path.h:368
NextHop * UpdateNH(Agent *agent, CompositeNH *cnh, const TsnElector *te)
Definition: agent_path.cc:1347
void SetIpamHostRoute(bool ipam_host_route)
Definition: agent_path.h:943
const PathPreference & path_preference() const
Definition: agent_path.h:680
AgentRouteTable * GetDependentTable() const
Definition: agent_path.h:432
void CopyLocalPath(CompositeNHKey *composite_nh_key, const AgentPath *local_path)
Definition: agent_path.cc:1824
void SyncRoute(bool sync)
Definition: agent_path.h:318
void set_tunnel_bmap(TunnelType::TypeBmap bmap)
Definition: agent_path.h:679
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)
bool proxy_arp_
Definition: agent_path.h:701
boost::intrusive_ptr< NextHop > NextHopRef
Definition: agent.h:124
virtual std::string ToString() const
Definition: agent_path.h:1118
std::vector< int > TagList
Definition: agent.h:202
void set_policy(bool policy)
Definition: agent_path.h:781
std::unique_ptr< InterfaceKey > interface_key_
Definition: agent_path.h:1069
MacAddress arp_mac() const
Definition: agent_path.h:345
uint32_t loc_sequence_
Definition: agent_path.h:171