OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
controller_export.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #include <boost/uuid/uuid_io.hpp>
6 
7 #include <cmn/agent_cmn.h>
8 #include <init/agent_param.h>
10 #include <oper/route_common.h>
11 #include <oper/peer.h>
12 #include <oper/nexthop.h>
13 #include <oper/peer.h>
14 #include <oper/mirror_table.h>
15 #include "oper/tunnel_nh.h"
16 
21 #include <controller/controller_types.h>
22 
24  DBState(), exported_(false), ingress_replication_exported_(false),
25  multicast_exported_(false),
26  force_chg_(false), label_(MplsTable::kInvalidLabel), vn_(), sg_list_(),
27  tag_list_(), tunnel_type_(TunnelType::INVALID), path_preference_(),
28  destination_(), source_(), ecmp_load_balance_(), isid_(0), tunnel_bmap_(0) {
29 }
30 
31 bool RouteExport::State::Changed(const AgentRoute *route, const AgentPath *path) const {
32  if (exported_ == false)
33  return true;
34 
35  if (force_chg_ == true)
36  return true;
37 
38  if (label_ != path->GetActiveLabel())
39  return true;
40 
41  if (tunnel_type_ != path->tunnel_type()) {
42  return true;
43  };
44 
45  if (vn_ != path->dest_vn_name())
46  return true;
47 
48  if (sg_list_ != path->sg_list())
49  return true;
50 
51  if (tag_list_ != path->tag_list())
52  return true;
53 
54  if (communities_ != path->communities())
55  return true;
56 
57  if (path_preference_ != path->path_preference())
58  return true;
59 
60  if(ecmp_load_balance_ != path->ecmp_load_balance())
61  return true;
62 
63  if (etree_leaf_ != path->etree_leaf())
64  return true;
65 
66  if (tunnel_bmap_ != path->tunnel_bmap())
67  return true;
68 
69  return false;
70 }
71 
72 void RouteExport::State::Update(const AgentRoute *route, const AgentPath *path) {
73  force_chg_ = false;
74  label_ = path->GetActiveLabel();
75  vn_ = path->dest_vn_name();
76  sg_list_ = path->sg_list();
77  tag_list_ = path->tag_list();
78  communities_ = path->communities();
79  tunnel_type_ = path->tunnel_type();
80  path_preference_ = path->path_preference();
81  ecmp_load_balance_ = path->ecmp_load_balance();
82  etree_leaf_ = path->etree_leaf();
83  tunnel_bmap_ = path->tunnel_bmap();
84 }
85 
87  rt_table_(rt_table), marked_delete_(false),
88  table_delete_ref_(this, rt_table->deleter()) {
89  walk_ref_ = rt_table->AllocWalker(
90  boost::bind(&RouteExport::DeleteState, this, _1, _2),
91  boost::bind(&RouteExport::Walkdone, _1, _2, this));
92 }
93 
95  if (rt_table_) {
98  }
100 }
101 
103  marked_delete_ = true;
104 }
105 
106 // Route entry add/change/del notification handler
107 void RouteExport::Notify(const Agent *agent,
108  AgentXmppChannel *bgp_xmpp_peer,
109  bool associate,
111  DBTablePartBase *partition,
112  DBEntryBase *e) {
113  AgentRoute *route = static_cast<AgentRoute *>(e);
114 
115  // Primitive checks for non-delete notification
116  if (!route->IsDeleted()) {
117  // If there is no active BGP peer attached to channel, ignore
118  // non-delete notification for this channel
119  if (!AgentXmppChannel::IsBgpPeerActive(agent, bgp_xmpp_peer))
120  return;
121 
122  if (route->GetActivePath()->inactive())
123  return;
124 
125  // Extract the listener ID of active BGP peer for route table to which
126  // this route entry belongs to. Listeners of route table can be active
127  // bgp peers as well as decommisioned BGP peers(if they exist). Active
128  // and decommisoned BGP peer can co-exist till cleanup timer is fired.
129  // During this interval ignore notification for decommisioned bgp peer
130  // listener id
131  VrfEntry *vrf = route->vrf();
132  BgpPeer *bgp_peer = static_cast<BgpPeer *>(bgp_xmpp_peer->
133  bgp_peer_id());
134  DBTableBase::ListenerId vrf_id = bgp_peer->GetVrfExportListenerId();
135  VrfExport::State *vs =
136  static_cast<VrfExport::State *>(vrf->GetState(vrf->get_table(),
137  vrf_id));
138  // If VRF state is not present then listener has not been added.
139  // Addition of listener later will result in walk to notify all routes.
140  // That in turn will add state as well by calling current routine.
141  // Therefore return when empty VRF state is found.
142  if (!vs)
143  return;
144 
145  //Make sure that vrf has been subscribed before route is published.
146  if (vs->IsExportable(bgp_xmpp_peer->sequence_number()))
147  return;
148 
149  // There may be instances when decommisioned peer is not yet
150  // unregistered while a new peer is already present. So there will be
151  // two notifications. If its for decommisioned peer then ignore the same
152  // by checking the listener id with active bgp peer listener id.
153  DBTableBase::ListenerId id = vs->rt_export_[route->GetTableType()]->
154  GetListenerId();
155  if (id != id_)
156  return;
157  }
158 
159  //If channel is no more active, ignore any updates.
160  //It may happen that notify is enqueued before channel is removed.
161  if (!AgentXmppChannel::IsBgpPeerActive(agent, bgp_xmpp_peer))
162  return;
163 
164  if (route->is_multicast()) {
165  MulticastNotify(bgp_xmpp_peer, associate, partition, e);
166  } else {
167  UnicastNotify(bgp_xmpp_peer, partition, e, type);
168  }
169 }
170 
172  DBTablePartBase *partition, DBEntryBase *e,
174  AgentRoute *route = static_cast<AgentRoute *>(e);
175  //TODO Currently BRIDGE notifications are coming because multicast route
176  //are installed in same. Once multicast route is shifted to EVPN table
177  //then there will be no export from Bridge and check below can be removed.
178  if (route->GetTableType() == Agent::BRIDGE)
179  return;
180 
181  if (route->vrf()->ShouldExportRoute() == false) {
182  return;
183  }
184 
185  AgentRouteTable *table = static_cast<AgentRouteTable *>
186  (partition->parent());
187  State *state = static_cast<State *>(route->GetState(partition->parent(),
188  id_));
189  AgentPath *path = NULL;
190  path = route->FindLocalVmPortPath();
191 
192  std::stringstream path_str;
193  if (path && path->peer())
194  path_str << path->peer()->GetName();
195  else
196  path_str << "None";
197 
198  if (marked_delete_) {
199  //Ignore route updates on delete marked vrf
200  goto done;
201  }
202  // if vrf is fabric vrf and route is not labelled inet route
203  // then don't export the route
204  if (path && (route->vrf()->GetName() == table->agent()->fabric_vrf_name())
205  && (type != Agent::INET4_MPLS)) {
206  //Dont export vhost IP path to control-node
207  const InetUnicastRouteEntry *inet_rt =
208  dynamic_cast<const InetUnicastRouteEntry *>(route);
209  if (inet_rt && inet_rt->prefix_address() == table->agent()->router_id()) {
210  path = NULL;
211  }
212  }
213 
214  if (!state && route->IsDeleted()) {
215  goto done;
216  }
217 
218  if (state == NULL) {
219  state = new State();
220  route->SetState(partition->parent(), id_, state);
221  }
222 
223  if (path && !path->is_local()) {
224  if (state->Changed(route, path)) {
225  state->Update(route, path);
226  VnListType vn_list;
227  vn_list.insert(state->vn_);
228  uint32_t label = state->label_;
229  if ((route->vrf()->GetName() == table->agent()->fabric_vrf_name()) &&
230  (label != MplsTable::kInvalidLabel )&& (label != MplsTable::kImplicitNullLabel )) {
231  label = 0;
232  }
233  state->exported_ =
235  static_cast<AgentRoute * >(route),
236  path->NexthopIp(table->agent()), vn_list,
237  label, path->GetTunnelBmap(),
238  &path->sg_list(), &path->tag_list(), &path->communities(),
239  type, state->path_preference_,
240  state->ecmp_load_balance_,
241  path->native_vrf_id());
242  }
243  } else {
244  if (state->exported_ == true) {
245  VnListType vn_list;
246  vn_list.insert(state->vn_);
248  static_cast<AgentRoute *>(route), vn_list,
249  (state->tunnel_type_ == TunnelType::VXLAN ?
250  state->label_ : 0),
251  TunnelType::AllType(), NULL, NULL, NULL,
252  type, state->path_preference_);
253  state->exported_ = false;
254  }
255  }
256 done:
257  if (route->IsDeleted()) {
258  if (state) {
259  route->ClearState(partition->parent(), id_);
260  delete state;
261  }
262  }
263 }
264 
265 static const AgentPath *GetMulticastExportablePath(const Agent *agent,
266  const AgentRoute *route) {
267  const AgentPath *active_path = route->FindPath(agent->local_vm_peer());
268 
269  //OVS peer path
270  if (active_path == NULL) {
271  const EvpnRouteEntry *evpn_route =
272  dynamic_cast<const EvpnRouteEntry *>(route);
273  active_path = evpn_route ? evpn_route->FindOvsPath() : NULL;
274  }
275  //If no loca peer, then look for tor peer as that should also result
276  //in export of route.
277  if (active_path == NULL)
278  active_path = route->FindPath(agent->multicast_tor_peer());
279  //Subnet discard
280  if (active_path == NULL) {
281  const AgentPath *local_path = route->FindPath(agent->local_peer());
282  if (local_path && !agent->tor_agent_enabled()) {
283  return local_path;
284  }
285  }
286 
287  return active_path;
288 }
289 
291  bool can_dissociate = route->IsDeleted();
292  Agent *agent = static_cast<AgentRouteTable*>(route->get_table())->
293  agent();
294  const AgentPath *local_path = route->FindPath(agent->local_peer());
295 
296  if (route->GetTableType() == Agent::INET4_MULTICAST) {
297  const AgentPath *active_path = route->FindPath(agent->local_vm_peer());
298  if (!active_path) {
299  return true;
300  }
301  return can_dissociate;
302  }
303 
304  if (local_path && !agent->tor_agent_enabled()) {
305  return can_dissociate;
306  }
307  if (route->is_multicast()) {
308  const AgentPath *active_path = GetMulticastExportablePath(agent, route);
309  if (active_path == NULL)
310  return true;
311  const NextHop *nh = active_path ? active_path->ComputeNextHop(agent) : NULL;
312  const CompositeNH *cnh = static_cast<const CompositeNH *>(nh);
313  if (cnh && cnh->ComponentNHCount() == 0)
314  return true;
315  }
316  return can_dissociate;
317 }
318 
320  AgentXmppChannel *bgp_xmpp_peer,
321  AgentRoute *route,
322  RouteExport::State *state) {
323  const AgentPath *active_path = GetMulticastExportablePath(agent, route);
324  //Agent running as tor(simulate_evpn_tor) - dont subscribe
325  //Route has path with peer OVS_PEER i.e. TOR agent mode - dont subscribe
326  //Subscribe condition:
327  //first time subscription or force change
328  if (!(agent->simulate_evpn_tor()) &&
329  (active_path->peer()->GetType() != Peer::OVS_PEER) &&
330  ((state->multicast_exported_ == false) ||
331  (state->force_chg_ == true))) {
332  //TODO optimize by checking for force_chg? In other cases duplicate
333  //request can be filtered.
334  if (state->multicast_exported_ == true) {
335  //Unsubscribe before re-sending subscription, this makes sure in any
336  //corner case control-node does not see this as a duplicate request.
338  route);
339  state->multicast_exported_ = false;
340  }
341  //Sending 255.255.255.255 for fabric tree
342  state->multicast_exported_ =
344  route);
345  }
346 }
347 
348 // Handles subscription of multicast routes.
349 // Following are the kind of subscription:
350 // Fabric - For fabric replication tree
351 // EVPN Ingress replication - For adding compute node in EVPN replication list.
352 // TOR Ingress replication - For adding in TOR replication list (relevant for
353 // TSN).
354 //
355 // For Tor-agent its a route with tunnel NH and there is no subscription.
357  bool associate,
358  DBTablePartBase *partition,
359  DBEntryBase *e) {
360  Agent *agent = bgp_xmpp_peer->agent();
361  AgentRoute *route = static_cast<AgentRoute *>(e);
362  State *state = static_cast<State *>(route->GetState(partition->parent(), id_));
363 
364  // Bridge Multicast routes are not sent to control.
365  BridgeRouteEntry *l2_route = dynamic_cast<BridgeRouteEntry *>(route);
366  if ((route->GetTableType() == Agent::BRIDGE) &&
367  (l2_route->prefix_address() != MacAddress::BroadcastMac())) {
368 
369  return;
370  }
371 
372  bool route_can_be_dissociated = MulticastRouteCanDissociate(route);
373 
374  if (marked_delete_ && state) {
375  route->ClearState(partition->parent(), id_);
376  delete state;
377  state = NULL;
378  return;
379  }
380 
381  //Handle withdraw for following cases:
382  //- Route is not having any active multicast exportable path or is deleted.
383  //- associate(false): Bgp Peer has gone down and state needs to be removed.
384  if (route_can_be_dissociated || !associate) {
385  if (state == NULL) {
386  return;
387  }
388 
389  if (state->multicast_exported_ == true) {
391  route);
392  state->multicast_exported_ = false;
393  }
394 
395  if ((state->ingress_replication_exported_ == true)) {
396  uint32_t label = state->label_;
397  if (route->vrf()->IsPbbVrf()) {
398  label = state->isid_;
399  }
402  route,
403  state->vn_,
404  label,
405  state->destination_,
406  state->source_,
408  state->ingress_replication_exported_ = false;
409  }
410 
411  route->ClearState(partition->parent(), id_);
412  delete state;
413  state = NULL;
414  return;
415  }
416 
417  if (marked_delete_) {
418  //Ignore route updates on delete marked vrf
419  return;
420  }
421 
422  if (state == NULL) {
423  state = new State();
424  route->SetState(partition->parent(), id_, state);
425  }
426 
427  // Bridge Broadcast route is sent with 255.255.255.255 address to control.
428  // Inet Multicast route can be because of MVPN or EVPN:
429  // For EVPN: send route updates for ERMVPN and EVPN.
430  // For MVPN: send route updates for ERMVPN on native VRF
431  // and MVPN on ip-fabric VRF.
432  if (route->vrf()->ShouldExportRoute()) {
433  SubscribeMulticastRouting(agent, bgp_xmpp_peer, route, state);
434  }
435 
436  bool ingress_replication = true;
437  if ((route->GetTableType() == Agent::INET4_MULTICAST) &&
438  (agent->params()->mvpn_ipv4_enable())) {
439 
440  ingress_replication = false;
441  }
442  if (ingress_replication) {
443  SubscribeIngressReplication(agent, bgp_xmpp_peer, route, state);
444  }
445 
446  state->force_chg_ = false;
447  return;
448 }
449 
451  AgentXmppChannel *bgp_xmpp_peer,
452  AgentRoute *route,
453  RouteExport::State *state) {
454  //Check if bridging mode is enabled for this VN by verifying bridge flag
455  //in local peer path.
456  bool bridging = false;
457  if (route->vrf() && route->vrf()->vn() && route->vrf()->vn()->bridging())
458  bridging = true;
459 
460  const AgentPath *active_path = GetMulticastExportablePath(agent, route);
461  //Sending ff:ff:ff:ff:ff:ff for evpn replication
462  TunnelType::Type old_tunnel_type = state->tunnel_type_;
463  uint32_t old_label = state->label_;
464  TunnelType::Type new_tunnel_type = active_path->tunnel_type();
465  uint32_t new_label = active_path->GetActiveLabel();
466 
467  //Evaluate if ingress replication subscription needs to be withdrawn.
468  //Conditions: Tunnel type changed (VXLAN to MPLS) in turn label change,
469  //bridging is disabled/enabled on VN
470  if ((state->ingress_replication_exported_ == true) ||
471  (state->force_chg_ == true)) {
472  bool withdraw = false;
473  uint32_t withdraw_label = 0;
474 
475  if (old_tunnel_type == TunnelType::VXLAN) {
476  if ((new_tunnel_type != TunnelType::VXLAN) ||
477  (old_label != new_label)) {
478  withdraw_label = old_label;
479  withdraw = true;
480  }
481  } else if (new_tunnel_type == TunnelType::VXLAN) {
482  withdraw = true;
483  }
484 
485  if (route->vrf()->IsPbbVrf()) {
486  if (state->isid_ != active_path->vxlan_id()) {
487  uint32_t old_isid = state->isid_;
488  state->isid_ = active_path->vxlan_id();
489  withdraw_label = old_isid;
490  withdraw = true;
491  } else {
492  state->isid_ = active_path->vxlan_id();
493  }
494  }
495 
496  if (bridging == false)
497  withdraw = true;
498 
499  if (withdraw) {
501  (bgp_xmpp_peer, route, state->vn_, withdraw_label,
502  state->destination_, state->source_,
503  state->tunnel_type_);
504  state->ingress_replication_exported_ = false;
505  }
506  }
507 
508  state->isid_ = active_path->vxlan_id();
509  //Update state values with new values if there is any change.
510  //Also force change same i.e. update.
511  if (active_path->tunnel_type() != state->tunnel_type_) {
512  state->force_chg_ = true;
513  state->tunnel_type_ = active_path->tunnel_type();
514  }
515 
516  if (active_path->GetActiveLabel() != state->label_) {
517  state->force_chg_ = true;
518  state->label_ = active_path->GetActiveLabel();
519  }
520 
521  if (route->vrf()->IsPbbVrf()) {
522  if (active_path->vxlan_id() == 0) {
523  return;
524  }
525  }
526 
527  //Subcribe if:
528  //- Bridging is enabled
529  //- First time (ingress_replication_exported is false)
530  //- Forced Change
531  if (bridging &&
532  ((state->ingress_replication_exported_ == false) ||
533  (state->force_chg_ == true))) {
534  state->label_ = active_path->GetActiveLabel();
535  state->vn_ = route->dest_vn_name();
536  const TunnelNH *tnh =
537  dynamic_cast<const TunnelNH *>(active_path->nexthop());
538  if (tnh) {
539  state->destination_ = tnh->GetDip()->to_string();
540  state->source_ = tnh->GetSip()->to_string();
541  }
543  TagList tag;
546  (bgp_xmpp_peer, route,
547  active_path->NexthopIp(agent),
548  route->dest_vn_name(), state->label_,
550  &sg, &tag, NULL, state->destination_,
551  state->source_, PathPreference());
552  }
553 }
554 
556  DBEntryBase *entry) {
557  State *state = static_cast<State *>
558  (entry->GetState(partition->parent(), id_));
559  if (state) {
560  entry->ClearState(partition->parent(), id_);
561  delete state;
562  }
563  return true;
564 }
565 
567  DBTableBase *partition,
568  RouteExport *rt_export) {
569  delete rt_export;
570 }
571 
573  //Start unregister process
575 }
576 
578  AgentXmppChannel *bgp_xmpp_peer) {
579  RouteExport *rt_export = new RouteExport(table);
580  bool associate = true;
581  rt_export->id_ = table->Register(boost::bind(&RouteExport::Notify,
582  rt_export, table->agent(), bgp_xmpp_peer,
583  associate, table->GetTableType(), _1, _2));
584  return rt_export;
585 }
586 
const std::string & GetName() const
Definition: peer.h:86
AgentPath * FindLocalVmPortPath() const
Definition: agent_route.cc:742
void MulticastNotify(AgentXmppChannel *bgp_xmpp_peer, bool associate, DBTablePartBase *partition, DBEntryBase *e)
bool DeleteState(DBTablePartBase *partition, DBEntryBase *entry)
bool inactive() const
Definition: agent_path.h:420
bool IsExportable(uint64_t sequence_number)
void WalkTable(DBTableWalkRef walk)
Definition: db_table.cc:625
static const AgentPath * GetMulticastExportablePath(const Agent *agent, const AgentRoute *route)
Definition: vrf.h:86
const TagList & tag_list() const
Definition: agent_path.h:249
const PathPreference & path_preference() const
Definition: agent_path.h:329
DBState * GetState(DBTableBase *tbl_base, ListenerId listener) const
Definition: db_entry.cc:37
bool tor_agent_enabled() const
Definition: agent.h:1164
bool MulticastRouteCanDissociate(const AgentRoute *route)
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
TunnelType::Type tunnel_type_
bool simulate_evpn_tor() const
Definition: agent.h:1155
bool IsDeleted() const
Definition: db_entry.h:49
void SetState(DBTableBase *tbl_base, ListenerId listener, DBState *state)
Definition: db_entry.cc:22
static bool ControllerSendRouteAdd(AgentXmppChannel *peer, AgentRoute *route, const Ip4Address *nexthop_ip, const VnListType &vn_list, uint32_t label, uint32_t tunnel_bmap, const SecurityGroupList *sg_list, const TagList *tag_list, const CommunityList *communities, Agent::RouteTableType type, const PathPreference &path_preference, const EcmpLoadBalance &ecmp_load_balance, uint32_t native_vrf_id)
uint32_t GetTunnelBmap() const
Definition: agent_path.cc:70
static void Walkdone(DBTable::DBTableWalkRef walk_ref, DBTableBase *table, RouteExport *rt)
std::vector< int > SecurityGroupList
Definition: agent.h:201
int ListenerId
Definition: db_table.h:62
bool is_multicast() const
Definition: agent_route.h:274
const std::string & dest_vn_name() const
Definition: agent_path.h:251
DBTableWalkRef AllocWalker(WalkFn walk_fn, WalkCompleteFn walk_complete)
Definition: db_table.cc:613
DBTableBase * parent()
const Ip4Address * GetDip() const
Definition: tunnel_nh.h:37
const string & GetName() const
Definition: vrf.h:100
const std::string & dest_vn_name() const
void Notify(const Agent *agent, AgentXmppChannel *bgp_xmpp_peer, bool associate, Agent::RouteTableType type, DBTablePartBase *partition, DBEntryBase *e)
Base class for all Route entries in agent.
Definition: agent_route.h:224
static bool ControllerSendMcastRouteAdd(AgentXmppChannel *peer, AgentRoute *route)
DBTableBase::ListenerId GetListenerId() const
void Unregister(ListenerId listener)
Definition: db_table.cc:186
PathPreference path_preference_
AgentRouteTable * rt_table_
std::string destination_
void ReleaseWalker(DBTableWalkRef &walk)
Definition: db_table.cc:619
ListenerId Register(ChangeCallback callback, const std::string &name="unspecified")
Definition: db_table.cc:181
const AgentPath * FindOvsPath() const
const std::string & fabric_vrf_name() const
Definition: agent.h:903
bool Changed(const AgentRoute *route, const AgentPath *path) const
const Type GetType() const
Definition: peer.h:87
const AgentPath * GetActivePath() const
Definition: agent_route.cc:876
NextHop * nexthop() const
Definition: agent_path.cc:87
bool mvpn_ipv4_enable() const
Definition: agent_param.h:565
bool is_local() const
Definition: agent_path.h:372
virtual Agent::RouteTableType GetTableType() const =0
void SubscribeMulticastRouting(const Agent *agent, AgentXmppChannel *bgp_xmpp_peer, AgentRoute *route, RouteExport::State *state)
void UnicastNotify(AgentXmppChannel *bgp_xmpp_peer, DBTablePartBase *partition, DBEntryBase *e, Agent::RouteTableType type)
uint8_t type
Definition: load_balance.h:109
Definition: agent.h:358
void Reset(LifetimeActor *actor)
Definition: lifetime.h:82
void SubscribeIngressReplication(Agent *agent, AgentXmppChannel *bgp_xmpp_peer, AgentRoute *route, RouteExport::State *state)
uint64_t sequence_number() const
Ip4Address router_id() const
Definition: agent.h:666
uint32_t native_vrf_id() const
Definition: agent_path.h:408
DBTableBase::ListenerId GetVrfExportListenerId()
Definition: peer.h:171
static TypeBmap AllType()
Definition: nexthop.h:321
const Peer * peer() const
Definition: agent_path.h:263
const Peer * local_peer() const
Definition: agent.h:1022
void Update(const AgentRoute *route, const AgentPath *path)
static const MacAddress & BroadcastMac()
Definition: mac_address.h:152
bool etree_leaf() const
Definition: agent_path.h:388
const Ip4Address * GetSip() const
Definition: tunnel_nh.h:36
AgentParam * params() const
Definition: agent.h:1218
std::set< std::string > VnListType
Definition: agent.h:212
void ClearState(DBTableBase *tbl_base, ListenerId listener)
Definition: db_entry.cc:73
virtual const PrefixType & prefix_address() const
Returns the value of a stored prefix address (IPv4, IPv6 or MAC address)
Definition: agent_route.h:375
uint32_t GetActiveLabel() const
Definition: agent_path.cc:79
static const uint32_t kInvalidLabel
Definition: mpls.h:101
static const uint32_t kImplicitNullLabel
Definition: mpls.h:105
LifetimeRef< RouteExport > table_delete_ref_
Definition: mpls.h:99
const Peer * multicast_tor_peer() const
Definition: agent.h:1031
DBTable::DBTableWalkRef walk_ref_
size_t ComponentNHCount() const
Definition: nexthop.h:1815
VnEntry * vn() const
Definition: vrf.h:101
static bool ControllerSendRouteDelete(AgentXmppChannel *peer, AgentRoute *route, const VnListType &vn_list, uint32_t label, uint32_t tunnel_bmap, const SecurityGroupList *sg_list, const TagList *tag_list, const CommunityList *communities, Agent::RouteTableType type, const PathPreference &path_preference)
EcmpLoadBalance ecmp_load_balance_
VrfEntry * vrf() const
Definition: agent_route.h:275
RouteExport(AgentRouteTable *rt)
Agent * agent() const
Definition: agent_route.h:159
RouteExport * rt_export_[Agent::ROUTE_TABLE_MAX]
const Peer * local_vm_peer() const
Definition: agent.h:1023
const Ip4Address * NexthopIp(Agent *agent) const
Definition: agent_path.cc:1955
static RouteExport * Init(AgentRouteTable *table, AgentXmppChannel *bgp_xmpp_peer)
static bool ControllerSendMcastRouteDelete(AgentXmppChannel *peer, AgentRoute *route)
virtual const NextHop * ComputeNextHop(Agent *agent) const
Definition: agent_path.cc:91
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
Definition: db_table.h:169
RouteTableType
Definition: agent.h:415
static TypeBmap GetTunnelBmap(TunnelType::Type type)
Definition: nexthop.h:314
uint32_t tunnel_bmap() const
Definition: agent_path.h:267
static bool ControllerSendEvpnRouteAdd(AgentXmppChannel *peer, AgentRoute *route, const Ip4Address *nexthop_ip, std::string vn, uint32_t mpls_label, uint32_t tunnel_bmap, const SecurityGroupList *sg_list, const TagList *tag_list, const CommunityList *communities, const std::string &destination, const std::string &source, const PathPreference &path_preference)
bool bridging() const
Definition: vn.h:191
virtual AgentPath * FindPath(const Peer *peer) const
Definition: agent_route.cc:864
const CommunityList & communities() const
Definition: agent_path.h:250
Agent * agent() const
bool IsPbbVrf() const
Definition: vrf.h:205
bool ShouldExportRoute() const
Definition: vrf.h:132
const SecurityGroupList & sg_list() const
Definition: agent_path.h:248
uint32_t vxlan_id() const
Definition: agent_path.h:265
const EcmpLoadBalance & ecmp_load_balance() const
Definition: agent_path.h:365
virtual Agent::RouteTableType GetTableType() const =0
static bool ControllerSendEvpnRouteDelete(AgentXmppChannel *peer, AgentRoute *route, std::string vn, uint32_t mpls_label, const std::string &destination, const std::string &source, uint32_t tunnel_bmap)
static bool IsBgpPeerActive(const Agent *agent, AgentXmppChannel *peer)
DBTableBase::ListenerId id_
std::vector< int > TagList
Definition: agent.h:202