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