OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ecmp.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #include <boost/foreach.hpp>
6 #include <boost/uuid/uuid_io.hpp>
7 
8 #include <base/address_util.h>
10 #include <cmn/agent_cmn.h>
11 #include <route/route.h>
12 #include <oper/ecmp.h>
13 #include <oper/ecmp_load_balance.h>
14 #include <oper/route_common.h>
15 #include <oper/vrf.h>
16 #include <oper/tunnel_nh.h>
17 #include <oper/mpls.h>
18 #include <oper/vxlan.h>
19 #include <oper/mirror_table.h>
20 #include <oper/multicast.h>
21 #include <oper/agent_sandesh.h>
22 
23 using namespace std;
24 using namespace boost::asio;
25 
27  const string &vrf_name,
28  const string &route_str,
29  AgentPath *path,
30  bool del) :
31  path_(path), ecmp_path_(NULL), delete_(del),
32  alloc_label_(true), label_(MplsTable::kInvalidLabel),
33  vrf_name_(vrf_name), route_str_(route_str),
34  vn_list_(path->dest_vn_list()),
35  sg_list_(path->sg_list()),
36  tag_list_(path->tag_list()),
37  community_list_(path->communities()),
38  path_preference_(path->path_preference()),
39  tunnel_bmap_(path->tunnel_bmap()),
40  ecmp_load_balance_(path->ecmp_load_balance()),
41  nh_req_(), agent_(agent) {
42 }
43 
45  if (path_->peer() == NULL) {
46  return false;
47  }
48 
50  return LocalVmPortPeerEcmp(rt);
51  }
52 
53  if (path_->peer()->GetType() == Peer::BGP_PEER) {
54  alloc_label_ = false;
55  return BgpPeerEcmp();
56  }
57 
58  return false;
59 }
60 
62  const TagList &tag_list,
63  const CommunityList &community_list,
64  const PathPreference &path_preference,
65  const TunnelType::TypeBmap bmap,
66  const EcmpLoadBalance &ecmp_load_balance,
67  const VnListType &vn_list,
68  DBRequest &nh_req) {
69  sg_list_ = sg_list;
70  vn_list_ = vn_list;
71  tag_list_ = tag_list;
72  community_list_ = community_list;
73  path_preference_ = path_preference;
74  tunnel_bmap_ = bmap;
75  ecmp_load_balance_ = ecmp_load_balance;
76  nh_req_.Swap(&nh_req);
77 
78  return Update(NULL);
79 }
80 
83  if (delete_) {
84  return EcmpDeletePath(rt);
85  } else {
86  if (path_->path_preference().is_ecmp() == false) {
87  return false;
88  }
89  return EcmpAddPath(rt);
90  }
91 }
92 
94  ecmp_path_ = path_;
95  //Bgp peer update for ecmp should always accompany nh_req.
96  //Any other request like sync is to be ignored.
97  NextHopKey *key = static_cast<NextHopKey *>(nh_req_.key.get());
98  if (!key)
99  return false;
100  return ModifyEcmpPath();
101 }
102 
103 // Handle add/update of a path in route.
104 // If there are more than one path of type LOCAL_VM_PORT_PEER, creates/updates
105 // Composite-NH for them
110  } else {
112  }
113 
114  // Count number of paths from LOCAL_VM_PORT_PEER already present
115  const AgentPath *vm_port_path = NULL;
116  int count = 0;
117  for(Route::PathList::const_iterator it = rt->GetPathList().begin();
118  it != rt->GetPathList().end(); it++) {
119  const AgentPath *it_path =
120  static_cast<const AgentPath *>(it.operator->());
121 
122  if (it_path->peer() == agent_->ecmp_peer())
123  assert(ecmp_path_ == it_path);
124 
125  if (it_path->peer() &&
126  it_path->peer()->GetType() == Peer::LOCAL_VM_PORT_PEER &&
127  it_path->path_preference().is_ecmp() == true) {
128  count++;
129  if (it_path != path_)
130  vm_port_path = it_path;
131  }
132  }
133 
134  if (count == 0) {
135  return false;
136  }
137 
138  // Sanity check. When more than one LOCAL_VM_PORT_PEER, ECMP must be present
139  if (count > 2) {
140  assert(ecmp_path_ != NULL);
141  }
142 
143  if (count == 1) {
144  assert(ecmp_path_ == NULL);
145  return false;
146  }
147 
148  bool ret = false;
149  if (count == 2 && ecmp_path_ == NULL) {
150  // This is second path being added, make ECMP
151  AllocateEcmpPath(rt, vm_port_path);
152  ret = true;
153  } else if (count > 2) {
154  // ECMP already present, add/update Component-NH for the path
155  AppendEcmpPath(rt, path_);
156  ret = true;
157  } else if (ecmp_path_) {
158  bool updated = UpdateComponentNH(rt, path_);
159  //No update happened for component NH, so verify if params are to be
160  //synced. If update of component NH is done, then params would also have
161  //been updated, so no need to do it again.
162  if (!updated) {
163  updated = SyncParams();
164  }
165  if (updated) {
166  ret = true;
167  }
168  }
169 
170  return ret;
171 }
172 
173 // Function to create a ECMP path from path and path2
174 // Creates Composite-NH with 2 Component-NH (one for each of path and path2)
175 // Creates a new MPLS Label for the ECMP path
177  // Allocate and insert a path
178  ecmp_path_ = new AgentPath(agent_->ecmp_peer(), rt);
179  rt->InsertPath(ecmp_path_);
180 
181  const NextHop* path1_nh = path_->ComputeNextHop(agent_);
182  bool composite_nh_policy = path1_nh->NexthopToInterfacePolicy();
183 
184  // Create Component NH to be added to ECMP path
185  DBEntryBase::KeyPtr key1 = path1_nh->GetDBRequestKey();
186  NextHopKey *nh_key1 = static_cast<NextHopKey *>(key1.release());
187  std::unique_ptr<const NextHopKey> nh_akey1(nh_key1);
188  nh_key1->SetPolicy(false);
189  ComponentNHKeyPtr component_nh_data1(new ComponentNHKey(path_->label(),
190  std::move(nh_akey1)));
191 
192  const NextHop* path2_nh = path2->ComputeNextHop(agent_);
193  if (!composite_nh_policy) {
194  composite_nh_policy = path2_nh->NexthopToInterfacePolicy();
195  }
196  DBEntryBase::KeyPtr key2 = path2_nh->GetDBRequestKey();
197  NextHopKey *nh_key2 = static_cast<NextHopKey *>(key2.release());
198  std::unique_ptr<const NextHopKey> nh_akey2(nh_key2);
199  nh_key2->SetPolicy(false);
200  ComponentNHKeyPtr component_nh_data2(new ComponentNHKey(path2->label(),
201  std::move(nh_akey2)));
202 
203  ComponentNHKeyList component_nh_list;
204  component_nh_list.push_back(component_nh_data2);
205  component_nh_list.push_back(component_nh_data1);
206 
207  // Directly call AddChangePath to update NH in the ECMP path
208  // It will also create CompositeNH if necessary
210  nh_req.key.reset(new CompositeNHKey(Composite::LOCAL_ECMP,
211  composite_nh_policy, component_nh_list,
212  vrf_name_));
213  nh_req.data.reset(new CompositeNHData());
214  nh_req_.Swap(&nh_req);
215 
217  ModifyEcmpPath();
218 
219  RouteInfo rt_info;
221  AgentRouteTable *table = static_cast<AgentRouteTable *>(rt->get_table());
222  OPER_TRACE_ROUTE_ENTRY(Route, table, rt_info);
223  AGENT_ROUTE_LOG(table, "Path Add", rt->ToString(), vrf_name_,
225 }
226 
228  assert(ecmp_path_);
229  const NextHop* path_nh = path->ComputeNextHop(agent_);
230  DBEntryBase::KeyPtr key = path_nh->GetDBRequestKey();
231  NextHopKey *nh_key = static_cast<NextHopKey *>(key.release());
232  std::unique_ptr<const NextHopKey> nh_akey(nh_key);
233  nh_key->SetPolicy(false);
234  ComponentNHKeyPtr comp_nh_key_ptr(new ComponentNHKey(path->label(), std::move(nh_akey)));
235 
236  ComponentNHKeyList component_nh_key_list;
237  const CompositeNH *comp_nh =
238  static_cast<const CompositeNH *>(ecmp_path_->ComputeNextHop(agent_));
239  DBEntryBase::KeyPtr comp_nh_key = comp_nh->GetDBRequestKey();
240  NextHopKey *cnh_key = static_cast<NextHopKey *>(comp_nh_key.get());
241  bool composite_nh_policy = false;
242  component_nh_key_list = comp_nh->AddComponentNHKey(comp_nh_key_ptr,
243  composite_nh_policy);
244  // Form the request for Inet4UnicastEcmpRoute and invoke AddChangePath
245  // Get the existing comp_nh key and do a resync
247  cnh_key->sub_op_ = AgentKey::RESYNC;
248  CompositeNHKey *composite_nh_key = new CompositeNHKey(Composite::LOCAL_ECMP,
249  composite_nh_policy,
250  component_nh_key_list,
251  vrf_name_);
252  nh_req.key = std::move(comp_nh_key);
253  nh_req.data.reset(new CompositeNHData(component_nh_key_list));
254  nh_req_.Swap(&nh_req);
255 
256  label_ = ecmp_path_->label();
257  ModifyEcmpPath(composite_nh_key);
258  path->SyncRoute(true);
259 
260  RouteInfo rt_info;
261  rt->FillTrace(rt_info, AgentRoute::CHANGE_PATH, path);
262  AgentRouteTable *table = static_cast<AgentRouteTable *>(rt->get_table());
263  OPER_TRACE_ROUTE_ENTRY(Route, table, rt_info);
264  AGENT_ROUTE_LOG(table, "Path change", rt->ToString(), vrf_name_,
266 }
267 
268 // Handle deletion of a path in route. If the path being deleted is part of
269 // ECMP, then deletes the Component-NH for the path.
270 // Delete ECMP path if there is single Component-NH in Composite-NH
272  if (path_->peer() == NULL) {
273  return false;
274  }
275 
277  return false;
278  }
279 
280  // Composite-NH is made from LOCAL_VM_PORT_PEER, count number of paths
281  // with LOCAL_VM_PORT_PEER
282  int count = 0;
283  for(Route::PathList::const_iterator it = rt->GetPathList().begin();
284  it != rt->GetPathList().end(); it++) {
285  const AgentPath *it_path =
286  static_cast<const AgentPath *>(it.operator->());
287 
288  if (it_path->peer() &&
289  it_path->peer()->GetType() == Peer::LOCAL_VM_PORT_PEER &&
290  it_path->path_preference().is_ecmp() == true &&
291  it_path != path_)
292  count++;
293  }
294 
295  // Sanity check. When more than one LOCAL_VM_PORT_PEER, ECMP must be present
296  if (count >= 1) {
297  if (ecmp_path_ == NULL) {
298  return false;
299  }
300  }
301 
302  if (count == 1 && ecmp_path_) {
303  // There is single path of type LOCAL_VM_PORT_PEER. Delete the ECMP path
304  rt->RemovePath(ecmp_path_);
305  //Enqueue MPLS label delete request
307  delete ecmp_path_;
308  } else if (count > 1) {
309  // Remove Component-NH for the path being deleted
311  }
312 
313  return true;
314 }
315 
316 bool EcmpData::UpdateNh(CompositeNHKey *composite_nh_key) {
317  NextHop *nh = NULL;
318  bool ret = false;
319 
321  NextHopKey *key = static_cast<NextHopKey *>(nh_req_.key.get());
322 
323  // Create MPLS label and point it to Composite NH
324  if (alloc_label_) {
326  route_str_);
327  }
328 
329  if (composite_nh_key) {
330  key = static_cast<NextHopKey *>(composite_nh_key);
331  }
332 
333  nh = static_cast<NextHop *>(agent_->nexthop_table()->
334  FindActiveEntry(key));
335  if (nh == NULL) {
337  if (vrf->IsDeleted())
338  return ret;
339  assert(0);
340  }
341 
342  MplsLabel *mpls = agent_->mpls_table()->
343  FindMplsLabel(label_);
344  if (mpls && (ecmp_path_->local_ecmp_mpls_label() == NULL)) {
346  }
347  if (ecmp_path_->ChangeNH(agent_, nh) == true)
348  ret = true;
349 
350  return ret;
351 }
352 
354  bool ret = false;
355 
357  TunnelType::Type new_tunnel_type =
359  if (ecmp_path_->tunnel_type() != new_tunnel_type) {
360  ecmp_path_->set_tunnel_type(new_tunnel_type);
361  ret = true;
362  }
363 
364  if (ecmp_path_->dest_vn_list() != vn_list_) {
366  ret = true;
367  }
368 
369  if (ecmp_path_->sg_list() != sg_list_) {
371  ret = true;
372  }
373 
374  if (ecmp_path_->tag_list() != tag_list_) {
376  ret = true;
377  }
378 
381  ret = true;
382  }
383 
386  ret = true;
387  }
388 
391  ret = true;
392  }
393 
394  return ret;
395 }
396 
397 bool EcmpData::ModifyEcmpPath(CompositeNHKey *composite_nh_key) {
398  bool ret = false;
399 
400  if (UpdateNh(composite_nh_key)) {
401  ret = true;
402  }
403 
404  if (ecmp_path_->label() != label_) {
406  ret = true;
407  }
408 
409  if (SyncParams()) {
410  ret = true;
411  }
412 
413  ecmp_path_->set_unresolved(false);
414  ret = true;
415 
416  return ret;
417 }
418 
419 /* When label of VMI changes and if that VMI (ie VMI's InterfaceNH) is part of
420  * ECMP, then update the CompositeNH for ECMP route to point to right label for
421  * that VMI. Label of VMI can change when policy-status of VMI changes */
423  if (!ecmp_path_) {
424  return false;
425  }
426  //Build ComponentNHKey for new path
427  const NextHop* path_nh = path->ComputeNextHop(agent_);
428  DBEntryBase::KeyPtr key = path_nh->GetDBRequestKey();
429  NextHopKey *nh_key = static_cast<NextHopKey *>(key.get());
430  nh_key->SetPolicy(false);
431 
432  ComponentNHKeyList component_nh_key_list;
433  const CompositeNH *comp_nh =
434  static_cast<const CompositeNH *>(ecmp_path_->ComputeNextHop(agent_));
435  bool composite_nh_policy = false;
436  bool updated = comp_nh->UpdateComponentNHKey(path->label(), nh_key,
437  component_nh_key_list,
438  composite_nh_policy);
439 
440  if (!updated) {
441  return false;
442  }
443  // Form the request for Inet4UnicastEcmpRoute and invoke AddChangePath
445  nh_req.key.reset(new CompositeNHKey(Composite::LOCAL_ECMP,
446  composite_nh_policy,
447  component_nh_key_list,
448  vrf_name_));
449  nh_req.data.reset(new CompositeNHData());
450  nh_req_.Swap(&nh_req);
451  label_ = ecmp_path_->label();
452  ModifyEcmpPath();
453 
454  RouteInfo rt_info;
455  rt->FillTrace(rt_info, AgentRoute::CHANGE_PATH, path);
456  AgentRouteTable *table = static_cast<AgentRouteTable *>(rt->get_table());
457  OPER_TRACE_ROUTE_ENTRY(Route, table, rt_info);
458  AGENT_ROUTE_LOG(table, "Path Update", rt->ToString(), vrf_name_,
460  return true;
461 }
462 
464  assert(ecmp_path_);
466  NextHopKey *nh_key = static_cast<NextHopKey *>(key.release());
467  std::unique_ptr<const NextHopKey> nh_akey(nh_key);
468  nh_key->SetPolicy(false);
469  ComponentNHKeyPtr comp_nh_key_ptr(new ComponentNHKey(path->label(), std::move(nh_akey)));
470 
471  ComponentNHKeyList component_nh_key_list;
472  bool comp_nh_policy = false;
473  const CompositeNH *comp_nh =
474  static_cast<const CompositeNH *>(ecmp_path_->ComputeNextHop(agent_));
475  component_nh_key_list = comp_nh->DeleteComponentNHKey(comp_nh_key_ptr,
476  comp_nh_policy);
477 
478  // Form the request for Inet4UnicastEcmpRoute and invoke AddChangePath
480  nh_req.key.reset(new CompositeNHKey(Composite::LOCAL_ECMP,
481  comp_nh_policy, component_nh_key_list,
482  vrf_name_));
483  nh_req.data.reset(new CompositeNHData());
484  nh_req_.Swap(&nh_req);
485  label_ = ecmp_path_->label();
486  UpdateNh();
487 
488  RouteInfo rt_info;
489  rt->FillTrace(rt_info, AgentRoute::CHANGE_PATH, path);
490  AgentRouteTable *table = static_cast<AgentRouteTable *>(rt->get_table());
491  OPER_TRACE_ROUTE_ENTRY(Route, table, rt_info);
492  AGENT_ROUTE_LOG(table, "Path change", rt->ToString(), vrf_name_,
494 }
495 
497  Agent *agent =
498  (static_cast<InetUnicastAgentRouteTable *> (rt->get_table()))->agent();
499 
500  if (rt->FindPath(agent->ecmp_peer())) {
501  return rt->FindPath(agent->ecmp_peer())->ComputeNextHop(agent);
502  }
503 
504  //If a route is leaked, and it points to local composite nexthop
505  //then choose that
506  if (rt->GetActivePath()->local_ecmp_mpls_label()) {
507  return rt->GetActivePath()->local_ecmp_mpls_label()->nexthop();
508  }
509 
510  //Choose the first local vm peer path
511  for (Route::PathList::const_iterator it = rt->GetPathList().begin();
512  it != rt->GetPathList().end(); it++) {
513  const AgentPath *path = static_cast<const AgentPath *>(it.operator->());
514  if (path) {
515  if (path->peer() &&
516  path->peer()->GetType() == Peer::LOCAL_VM_PORT_PEER) {
517  return path->ComputeNextHop(agent);
518  }
519  }
520  }
521 
522  const NextHop *nh = rt->GetActiveNextHop();
523  if (nh && nh->GetType() == NextHop::COMPOSITE ) {
524  const CompositeNH *comp_nh = static_cast<const CompositeNH *>(nh);
525  //Get the local composite NH
526  return comp_nh->GetLocalNextHop();
527  }
528  return NULL;
529 }
uint32_t TypeBmap
Definition: nexthop.h:248
void set_path_preference(const PathPreference &rp)
Definition: agent_path.h:331
bool SyncParams()
Definition: ecmp.cc:353
const VnListType & dest_vn_list() const
Definition: agent_path.h:258
void set_communities(const CommunityList &communities)
Definition: agent_path.h:293
#define OPER_TRACE_ROUTE_ENTRY(obj, table,...)
Definition: agent_route.h:217
bool ChangeNH(Agent *agent, NextHop *nh)
Definition: agent_path.cc:119
DBRequest nh_req_
Definition: ecmp.h:68
void set_unresolved(bool unresolved)
Definition: agent_path.h:285
bool alloc_label_
Definition: ecmp.h:57
Definition: vrf.h:86
const TagList & tag_list() const
Definition: agent_path.h:249
const PathPreference & path_preference() const
Definition: agent_path.h:329
static const NextHop * GetLocalNextHop(const AgentRoute *rt)
Definition: ecmp.cc:496
void set_local_ecmp_mpls_label(MplsLabel *mpls)
Definition: agent_path.cc:1805
VrfEntry * FindVrfFromName(const string &name)
Definition: vrf.cc:873
NextHopTable * nexthop_table() const
Definition: agent.h:475
DBTableBase * get_table() const
Definition: db_entry.cc:119
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_sg_list(const SecurityGroupList &sg)
Definition: agent_path.h:291
const NextHop * nexthop() const
Definition: mpls.h:80
bool IsDeleted() const
Definition: db_entry.h:49
uint8_t sub_op_
Definition: agent_db.h:106
std::vector< int > SecurityGroupList
Definition: agent.h:201
Definition: route.h:14
std::unique_ptr< DBRequestData > data
Definition: db_table.h:49
bool UpdateComponentNH(AgentRoute *rt, AgentPath *path)
Definition: ecmp.cc:422
#define AGENT_ROUTE_LOG(table, msg, route, vrf, peer_info)
Definition: agent_route.h:399
const NextHop * GetLocalNextHop() const
Definition: nexthop.cc:1798
const Peer * ecmp_peer() const
Definition: agent.h:1025
static TypeBmap MplsType()
Definition: nexthop.h:312
bool EcmpDeletePath(AgentRoute *rt)
Definition: ecmp.cc:271
boost::shared_ptr< const ComponentNHKey > ComponentNHKeyPtr
Definition: nexthop.h:1639
bool NexthopToInterfacePolicy() const
Definition: nexthop.cc:262
const MplsLabel * local_ecmp_mpls_label() const
Definition: agent_path.cc:1815
MplsTable * mpls_table() const
Definition: agent.h:510
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
Type GetType() const
Definition: nexthop.h:405
Base class for all Route entries in agent.
Definition: agent_route.h:224
AgentPath * path_
Definition: ecmp.h:54
void Swap(DBRequest *rhs)
Definition: db_table.cc:43
std::vector< ComponentNHKeyPtr > ComponentNHKeyList
Definition: nexthop.h:1641
TunnelType::TypeBmap tunnel_bmap_
Definition: ecmp.h:66
bool UpdateWithParams(const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &community_list, const PathPreference &path_preference, const TunnelType::TypeBmap bmap, const EcmpLoadBalance &ecmp_load_balance, const VnListType &vn_list, DBRequest &nh_req)
Definition: ecmp.cc:61
const Type GetType() const
Definition: peer.h:87
void set_tunnel_bmap(TunnelType::TypeBmap bmap)
Definition: agent_path.h:289
const AgentPath * GetActivePath() const
Definition: agent_route.cc:876
SecurityGroupList sg_list_
Definition: ecmp.h:62
bool EcmpAddPath(AgentRoute *rt)
Definition: ecmp.cc:106
void FillTrace(RouteInfo &route, Trace event, const AgentPath *path) const
Definition: agent_path.cc:1583
AgentPath * ecmp_path_
Definition: ecmp.h:55
Definition: agent.h:358
const NextHop * GetActiveNextHop() const
Definition: agent_route.cc:881
uint32_t label() const
Definition: agent_path.h:264
std::unique_ptr< DBRequestKey > key
Definition: db_table.h:48
void RemovePath(AgentPath *path)
Definition: agent_route.cc:606
const Peer * peer() const
Definition: agent_path.h:263
void DeleteComponentNH(AgentRoute *rt, AgentPath *path)
Definition: ecmp.cc:463
ComponentNHKeyList DeleteComponentNHKey(ComponentNHKeyPtr component_nh_key, bool &comp_nh_new_policy) const
Definition: nexthop.cc:2555
#define GETPEERNAME(peer)
Definition: agent_route.h:398
bool UpdateComponentNHKey(uint32_t label, NextHopKey *nh_key, ComponentNHKeyList &component_nh_key_list, bool &comp_nh_policy) const
Definition: nexthop.cc:2454
void InsertPath(const AgentPath *path)
Definition: agent_route.cc:600
std::vector< std::string > CommunityList
Definition: bgp_config.h:347
bool LocalVmPortPeerEcmp(AgentRoute *rt)
Definition: ecmp.cc:81
VnListType vn_list_
Definition: ecmp.h:61
std::set< std::string > VnListType
Definition: agent.h:212
bool is_ecmp() const
Definition: agent_path.h:49
virtual KeyPtr GetDBRequestKey() const =0
bool ModifyEcmpPath(CompositeNHKey *composite_nh_key=NULL)
Definition: ecmp.cc:397
static TypeBmap NativeType()
Definition: nexthop.h:325
static Type ComputeType(TypeBmap bmap)
Definition: nexthop.cc:33
static const uint32_t kInvalidLabel
Definition: mpls.h:101
VrfTable * vrf_table() const
Definition: agent.h:485
uint32_t CreateRouteLabel(uint32_t label, const NextHopKey *nh_key, const std::string &vrf_name, const std::string &route)
Definition: mpls.cc:341
Definition: mpls.h:99
std::string vrf_name_
Definition: ecmp.h:59
std::string route_str_
Definition: ecmp.h:60
bool delete_
Definition: ecmp.h:56
void set_tag_list(const TagList &tag)
Definition: agent_path.h:292
virtual std::string ToString() const =0
CommunityList community_list_
Definition: ecmp.h:64
bool Update(AgentRoute *rt)
Definition: ecmp.cc:44
void AppendEcmpPath(AgentRoute *rt, AgentPath *path)
Definition: ecmp.cc:227
TagList tag_list_
Definition: ecmp.h:63
void Process(DBRequest &req)
Definition: nexthop.cc:367
ComponentNHKeyList AddComponentNHKey(ComponentNHKeyPtr component_nh_key, bool &comp_nh_policy) const
Definition: nexthop.cc:2485
Definition: mpls.h:52
EcmpLoadBalance ecmp_load_balance_
Definition: ecmp.h:67
void set_label(uint32_t label)
Definition: agent_path.h:282
void AllocateEcmpPath(AgentRoute *rt, const AgentPath *path2)
Definition: ecmp.cc:176
Agent * agent_
Definition: ecmp.h:69
void set_dest_vn_list(const VnListType &dest_vn_list)
Definition: agent_path.h:283
virtual const NextHop * ComputeNextHop(Agent *agent) const
Definition: agent_path.cc:91
void SetPolicy(bool policy)
Definition: nexthop.h:495
EcmpData(Agent *agent, const string &vrf_name, const string &route_str, AgentPath *path, bool del)
Definition: ecmp.cc:26
uint32_t tunnel_bmap() const
Definition: agent_path.h:267
bool BgpPeerEcmp()
Definition: ecmp.cc:93
virtual AgentPath * FindPath(const Peer *peer) const
Definition: agent_route.cc:864
void set_tunnel_type(TunnelType::Type type)
Definition: agent_path.h:290
const CommunityList & communities() const
Definition: agent_path.h:250
uint32_t label_
Definition: ecmp.h:58
PathPreference path_preference_
Definition: ecmp.h:65
const SecurityGroupList & sg_list() const
Definition: agent_path.h:248
const EcmpLoadBalance & ecmp_load_balance() const
Definition: agent_path.h:365
bool UpdateNh(CompositeNHKey *composite_nh_key=NULL)
Definition: ecmp.cc:316
void set_ecmp_load_balance(const EcmpLoadBalance &ecmp_load_balance)
Definition: agent_path.h:368
void FreeLabel(uint32_t label)
Definition: mpls.cc:267
void SyncRoute(bool sync)
Definition: agent_path.h:318
const PathList & GetPathList() const
Definition: route.h:46
virtual KeyPtr GetDBRequestKey() const
Definition: nexthop.cc:2183
std::vector< int > TagList
Definition: agent.h:202