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