OpenSDN source code
agent_route.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef vnsw_agent_route_hpp
6 #define vnsw_agent_route_hpp
7 
8 #include <sys/types.h>
9 #include <sys/socket.h>
10 #include <net/ethernet.h>
11 
12 #include <base/address.h>
13 #include <base/lifetime.h>
14 #include <base/patricia.h>
15 #include <base/task_annotations.h>
16 
17 #include <cmn/agent_cmn.h>
18 #include <cmn/agent.h>
19 #include <agent_types.h>
20 #include <route/route.h>
21 #include <route/table.h>
22 
23 #include <oper/interface_common.h>
24 #include <oper/nexthop.h>
25 #include <oper/peer.h>
26 #include <oper/agent_types.h>
27 #include <oper/multicast.h>
28 #include <sandesh/sandesh_trace.h>
29 
30 class AgentRoute;
31 class AgentPath;
32 class Peer;
33 class EcmpData;
34 
35 struct AgentRouteKey : public AgentKey {
36  AgentRouteKey(const Peer *peer, const std::string &vrf_name) :
38  virtual ~AgentRouteKey() { }
39 
41  virtual std::string ToString() const = 0;
43  bool is_multicast) const = 0;
44  virtual AgentRouteKey *Clone() const = 0;
45 
46  const std::string &vrf_name() const { return vrf_name_; }
47  const Peer *peer() const { return peer_.get(); }
48  void set_peer(const Peer *peer) {peer_ = peer;}
49 
51  std::string vrf_name_;
53 };
54 
55 struct AgentRouteData : public AgentData {
56  enum Type {
60  };
64  virtual ~AgentRouteData() { }
65 
66  virtual std::string ToString() const = 0;
67  virtual AgentPath *CreateAgentPath(const Peer *peer, AgentRoute *rt) const;
68  virtual bool AddChangePathExtended(Agent *agent, AgentPath *path,
69  const AgentRoute *rt) = 0;
70  virtual bool CanDeletePath(Agent *agent, AgentPath *path,
71  const AgentRoute *rt) const {
72  return true;
73  }
74  virtual bool UpdateRoute(AgentRoute *rt) {return false;}
75 
76  bool AddChangePath(Agent *agent, AgentPath *path, const AgentRoute *rt);
77  bool is_multicast() const {return is_multicast_;}
78  uint64_t sequence_number() const {return sequence_number_;}
79 
82  uint64_t sequence_number_;
84 };
85 
87  bool operator() (const AgentRoute *rt1, const AgentRoute *rt2) const;
88 };
89 
90 struct NHComparator {
91  bool operator() (const NextHop *nh1, const NextHop *nh2) const;
92 };
93 
96  }
97 
99  rt_delete_ref_.Reset(NULL);
100  }
101  void ManagedDelete() { }
102 
104 };
105 
109 class AgentRouteTable : public RouteTable {
110 public:
111  static const int kPartitionCount = 1;
112  typedef std::set<const AgentRoute *, RouteComparator> UnresolvedRouteTree;
113  typedef std::set<const NextHop *, NHComparator> UnresolvedNHTree;
114 
115  AgentRouteTable(DB *db, const std::string &name);
116  virtual ~AgentRouteTable();
117 
118  virtual int PartitionCount() const { return kPartitionCount; }
119  virtual std::unique_ptr<DBEntry> AllocEntry(const DBRequestKey *k) const;
120  virtual size_t Hash(const DBEntry *entry) const {return 0;}
121  virtual size_t Hash(const DBRequestKey *key) const {return 0;}
122 
123  virtual Agent::RouteTableType GetTableType() const = 0;
124  virtual std::string GetTableName() const = 0;
125 
126  virtual void ProcessDelete(AgentRoute *rt) { }
127  virtual void ProcessAdd(AgentRoute *rt) { }
128  virtual void NotifyEntry(AgentRoute *entry);
129 
131  const std::string &context) {
132  return AgentSandeshPtr();
133  }
135 
136  // Unresolved route tree accessors
137  UnresolvedRouteTree::const_iterator unresolved_route_begin() const {
138  return unresolved_rt_tree_.begin();
139  }
140  UnresolvedRouteTree::const_iterator unresolved_route_end() const {
141  return unresolved_rt_tree_.end();
142  }
143  int unresolved_route_size() const { return unresolved_rt_tree_.size(); }
144 
145  // Unresolved NH tree accessors
146  void AddUnresolvedNH(const NextHop *);
147  void RemoveUnresolvedNH(const NextHop *);
148  void EvaluateUnresolvedNH(void);
149  UnresolvedNHTree::const_iterator unresolved_nh_begin() const {
150  return unresolved_nh_tree_.begin();
151  }
152  UnresolvedNHTree::const_iterator unresolved_nh_end() const {
153  return unresolved_nh_tree_.end();
154  }
155  void EvaluateUnresolvedRoutes(void);
156  void AddUnresolvedRoute(const AgentRoute *rt);
157  void RemoveUnresolvedRoute(const AgentRoute *rt);
158 
159  Agent *agent() const { return agent_; }
160  const std::string &vrf_name() const;
161  uint32_t vrf_id() const {return vrf_id_;}
162  VrfEntry *vrf_entry() const;
167 
168  // Set VRF for the route-table
169  void SetVrf(VrfEntry * vrf);
170 
171  // Helper functions to delete routes
173 
174  // Lifetime actor routines
176  void ManagedDelete();
177  virtual void RetryDelete();
178 
179  // Process DBRequest inline
180  void Process(DBRequest &req);
181 
182  // Path comparator
183  static bool PathSelection(const Path &path1, const Path &path2);
184  static const std::string &GetSuffix(Agent::RouteTableType type);
185 
186  void AddChangeInput(DBTablePartition *part, VrfEntry *vrf, AgentRoute *rt,
187  AgentRouteKey *key, AgentRouteData *data);
189  AgentRoute *rt, AgentRouteKey *key,
190  AgentRouteData *data, bool *notify);
191 
192 private:
193  class DeleteActor;
195  RouteTableWalkerState *state);
196 
197  void Input(DBTablePartition *part, DBClient *client, DBRequest *req);
198 
200  uint32_t vrf_id_;
202  boost::scoped_ptr<DeleteActor> deleter_;
206  // VRF is stored to identify which VRF this table belonged to
207  // in case lifetimeactor has reset the vrf_.
210 };
211 
212 #define OPER_TRACE_ROUTE(obj, ...)\
213 do {\
214  Oper##obj::TraceMsg(GetOperDBTraceBuf(), __FILE__, __LINE__, __VA_ARGS__);\
215 } while (false)
216 
217 #define OPER_TRACE_ROUTE_ENTRY(obj, table, ...)\
218 do {\
219  Oper##obj::TraceMsg(table->GetOperDBTraceBuf(),\
220  __FILE__, __LINE__, __VA_ARGS__);\
221 } while (false)
222 
224 class AgentRoute : public Route {
225 public:
226  enum Trace {
233  };
234 
237 
239  const std::string &intf_route_type = "interface") :
242  virtual ~AgentRoute() { }
243 
244  // Virtual functions from base DBEntry
245  virtual bool IsLess(const DBEntry &rhs) const;
246  virtual KeyPtr GetDBRequestKey() const = 0;
247  virtual void SetKey(const DBRequestKey *key) = 0;
248 
249  // Virtual functions defined by AgentRoute
250  virtual int CompareTo(const Route &rhs) const = 0;
251  virtual Agent::RouteTableType GetTableType() const = 0;
252  virtual bool DBEntrySandesh(Sandesh *sresp, bool stale) const = 0;
253  virtual std::string ToString() const = 0;
254  virtual const std::string GetAddressString() const = 0;
255  virtual const std::string GetSourceAddressString() const = 0;
256  virtual bool ReComputePathDeletion(AgentPath *path) {return false;}
257  virtual bool ReComputePathAdd(AgentPath *path) {return false;}
258  virtual uint32_t GetActiveLabel() const;
259  virtual AgentPath *FindPathUsingKeyData(const AgentRouteKey *key,
260  const AgentRouteData *data) const;
261  virtual AgentPath *FindPath(const Peer *peer) const;
262  virtual bool RecomputeRoutePath(Agent *agent,
263  DBTablePartition *part,
264  AgentPath *path,
265  AgentRouteData *data) {return false;}
266  //Can be used for operations related to updation of route.
268  const AgentPath *path,
269  bool active_path_changed) {
270  }
271  //Can be used for operations resulting from deletion of route.
272  virtual void DeleteDerivedRoutes(AgentRouteTable *table) { }
273  // Accessor functions
274  bool is_multicast() const {return is_multicast_;}
275  VrfEntry *vrf() const {return vrf_;}
276  uint32_t vrf_id() const;
277  const std::string &intf_route_type() const { return intf_route_type_; }
278  void set_intf_route_type(const std::string &intf_route_type) {
280  }
281  const std::string &origin_vn_name() const {return origin_vn_name_; };
282  void set_origin_vn_name(const VnListType &dest_vn_list) {
283  for (const auto &vn_nm : dest_vn_list) {
284  if (vn_nm == "unresolved") {
285  continue;
286  }
287  else {
288  origin_vn_name_ = vn_nm;
289  return;
290  }
291  };
293  }
294 
295  AgentPath *FindLocalPath() const;
297 
303  AgentPath *GetLocalVmPortPath() const;
304  const AgentPath *GetActivePath() const;
305  const NextHop *GetActiveNextHop() const;
306  const std::string &dest_vn_name() const;
307  bool IsRPFInvalid() const;
308 
309  void EnqueueRouteResync() const;
310  void ResyncTunnelNextHop();
311  bool HasUnresolvedPath();
312  bool Sync(void);
313 
314  //TODO Move dependantroutes and nh to inet4
315  void UpdateDependantRoutes();// analogous to updategatewayroutes
316  bool IsDependantRouteEmpty() { return dependant_routes_.empty(); }
317  bool IsTunnelNHListEmpty() { return tunnel_nh_list_.empty(); }
318 
319  void FillTrace(RouteInfo &route, Trace event, const AgentPath *path) const;
320  bool WaitForTraffic() const;
321 
324  AgentPath *path);
326  AgentPath **path_ptr, AgentRouteKey *key,
327  AgentRouteData *data);
329  AgentPath **path_ptr, AgentRouteKey *key,
330  AgentRouteData *data, bool route_added);
331  void DeleteInput(DBTablePartition *part, AgentRouteTable *table,
332  AgentRouteKey *key, AgentRouteData *data);
336  virtual uint8_t prefix_length() const { return 0; }
337 protected:
338  void SetVrf(VrfEntry *vrf) { vrf_ = vrf; }
339  void RemovePath(AgentPath *path);
340  void InsertPath(const AgentPath *path);
341  virtual void HandleMulticastLabel(const Agent *agent,
342  AgentPath *path,
343  const AgentPath *local_peer_path,
344  const AgentPath *local_vm_peer_path,
345  bool del, uint32_t *evpn_label);
346  virtual bool ReComputeMulticastPaths(AgentPath *path, bool del);
347  virtual void HandleDeviceMastershipUpdate(AgentPath *path, bool del);
350  return dependent_route_table_;
351  }
352  virtual bool ValidateMcastSrc() const { return true; }
353 
354 private:
355  friend class AgentRouteTable;
356  //EcmpData can insert/delete path
357  friend class EcmpData;
358 
359  bool ProcessPath(Agent *agent, DBTablePartition *part, AgentPath *path,
360  AgentRouteData *data);
361 
363  // Unicast table can contain routes for few multicast address
364  // (ex. subnet multicast). Flag to specify if this is multicast route
366  std::string intf_route_type_;
367  std::string origin_vn_name_;
369  DEPENDENCY_LIST(AgentRoute, AgentRoute, dependant_routes_);
370  DEPENDENCY_LIST(NextHop, AgentRoute, tunnel_nh_list_);
372 };
373 
376 template <class PrefixType>
378 public:
379 
381  AgentRoutePrefix(const PrefixType& new_prefix, uint8_t new_plen)
382  : prefix_address_(new_prefix), prefix_length_(new_plen) {}
383 
386 
389  virtual const PrefixType& prefix_address() const {return prefix_address_;}
390 
392  void set_prefix_length(uint8_t new_plen) {
393  prefix_length_ = new_plen;
394  }
395 
396 protected:
397 
399  PrefixType prefix_address_;
400 
402  uint8_t prefix_length_;
403 
404 private:
405 
408 
410 };
411 
412 #define GETPEERNAME(peer) (peer)? peer->GetName() : ""
413 #define AGENT_ROUTE_LOG(table, msg, route, vrf, peer_info)\
414 do {\
415  AgentRouteLog::TraceMsg(table->GetOperDBTraceBuf(), __FILE__, __LINE__,\
416  msg, route, vrf, peer_info);\
417 } while (false)
418 
419 #endif
std::set< std::string > VnListType
Definition: agent.h:212
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
Definition: agent_db.h:18
This class defines interfaces for manipulating the prefix of a route stored in an Agent VRF table.
Definition: agent_route.h:377
AgentRoutePrefix()
Forbid default ctor.
virtual const PrefixType & prefix_address() const
Returns the value of a stored prefix address (IPv4, IPv6 or MAC address)
Definition: agent_route.h:389
uint8_t prefix_length_
The prefix length.
Definition: agent_route.h:402
PrefixType prefix_address_
The prefix address.
Definition: agent_route.h:399
DISALLOW_COPY_AND_ASSIGN(AgentRoutePrefix)
~AgentRoutePrefix()
The destructor of a route prefix.
Definition: agent_route.h:385
AgentRoutePrefix(const PrefixType &new_prefix, uint8_t new_plen)
Creates a new route prefix.
Definition: agent_route.h:381
void set_prefix_length(uint8_t new_plen)
Sets the length of a stored prefix address.
Definition: agent_route.h:392
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge,...
Definition: agent_route.h:109
int unresolved_route_size() const
Definition: agent_route.h:143
void RemoveUnresolvedNH(const NextHop *)
Definition: agent_route.cc:393
void ManagedDelete()
Definition: agent_route.cc:135
UnresolvedNHTree::const_iterator unresolved_nh_end() const
Definition: agent_route.h:152
uint32_t vrf_id() const
Definition: agent_route.h:161
virtual int PartitionCount() const
Definition: agent_route.h:118
bool DelExplicitRouteWalkerCb(DBTablePartBase *part, DBEntryBase *entry)
Definition: agent_route.cc:155
UnresolvedRouteTree unresolved_rt_tree_
Definition: agent_route.h:204
static bool PathSelection(const Path &path1, const Path &path2)
Definition: agent_route.cc:93
virtual void ProcessAdd(AgentRoute *rt)
Definition: agent_route.h:127
const std::string & vrf_name() const
Definition: agent_route.cc:455
DISALLOW_COPY_AND_ASSIGN(AgentRouteTable)
void Process(DBRequest &req)
Definition: agent_route.cc:186
VrfEntryRef vrf_entry_
Definition: agent_route.h:201
Agent * agent() const
Definition: agent_route.h:159
void SetVrf(VrfEntry *vrf)
Definition: agent_route.cc:126
static const int kPartitionCount
Definition: agent_route.h:111
AgentRoute * LocateRoute(DBTablePartition *part, VrfEntry *vrf, AgentRoute *rt, AgentRouteKey *key, AgentRouteData *data, bool *notify)
Definition: agent_route.cc:322
virtual Agent::RouteTableType GetTableType() const =0
UnresolvedRouteTree::const_iterator unresolved_route_end() const
Definition: agent_route.h:140
SandeshTraceBufferPtr OperDBTraceBuf
Definition: agent_route.h:208
virtual void RetryDelete()
Definition: agent_route.cc:164
virtual void ProcessDelete(AgentRoute *rt)
Definition: agent_route.h:126
LifetimeActor * deleter()
Definition: agent_route.cc:451
void DeleteRouteDone(DBTable::DBTableWalkRef walk_ref, DBTableBase *base, RouteTableWalkerState *state)
Definition: agent_route.cc:147
std::set< const NextHop *, NHComparator > UnresolvedNHTree
Definition: agent_route.h:113
virtual SandeshTraceBufferPtr GetOperDBTraceBuf() const
Definition: agent_route.h:134
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
Definition: agent_route.cc:82
void AddUnresolvedRoute(const AgentRoute *rt)
Definition: agent_route.cc:408
void EvaluateUnresolvedRoutes(void)
Definition: agent_route.cc:399
boost::scoped_ptr< DeleteActor > deleter_
Definition: agent_route.h:202
LifetimeRef< AgentRouteTable > vrf_delete_ref_
Definition: agent_route.h:203
virtual std::string GetTableName() const =0
VrfEntry * vrf_entry() const
Definition: agent_route.cc:459
AgentRoute * FindActiveEntryNoLock(const AgentRouteKey *key)
Definition: agent_route.cc:425
void Input(DBTablePartition *part, DBClient *client, DBRequest *req)
Definition: agent_route.cc:199
virtual size_t Hash(const DBEntry *entry) const
Definition: agent_route.h:120
uint32_t vrf_id_
Definition: agent_route.h:200
UnresolvedNHTree unresolved_nh_tree_
Definition: agent_route.h:205
virtual void NotifyEntry(AgentRoute *entry)
Definition: agent_route.cc:174
AgentRouteTable(DB *db, const std::string &name)
Definition: agent_route.cc:71
void EvaluateUnresolvedNH(void)
Definition: agent_route.cc:375
virtual ~AgentRouteTable()
Definition: agent_route.cc:78
static const std::string & GetSuffix(Agent::RouteTableType type)
Definition: agent_route.cc:99
UnresolvedRouteTree::const_iterator unresolved_route_begin() const
Definition: agent_route.h:137
UnresolvedNHTree::const_iterator unresolved_nh_begin() const
Definition: agent_route.h:149
void RemoveUnresolvedRoute(const AgentRoute *rt)
Definition: agent_route.cc:412
virtual size_t Hash(const DBRequestKey *key) const
Definition: agent_route.h:121
AgentRoute * FindActiveEntry(const AgentRouteKey *key)
Definition: agent_route.cc:417
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
Definition: agent_route.h:130
void AddChangeInput(DBTablePartition *part, VrfEntry *vrf, AgentRoute *rt, AgentRouteKey *key, AgentRouteData *data)
Definition: agent_route.cc:243
void AddUnresolvedNH(const NextHop *)
Definition: agent_route.cc:389
std::set< const AgentRoute *, RouteComparator > UnresolvedRouteTree
Definition: agent_route.h:112
Base class for all Route entries in agent.
Definition: agent_route.h:224
virtual int CompareTo(const Route &rhs) const =0
AgentPath * GetLocalVmPortPath() const
Definition: agent_route.cc:845
const std::string & origin_vn_name() const
Definition: agent_route.h:281
virtual void DeleteDerivedRoutes(AgentRouteTable *table)
Definition: agent_route.h:272
const AgentPath * FindIntfOrCompLocalVmPortPath() const
Finds path to an interface or a composite of interfaces and returns it. The priority is given to comp...
Definition: agent_route.cc:817
virtual const std::string GetSourceAddressString() const =0
virtual bool ReComputeMulticastPaths(AgentPath *path, bool del)
virtual AgentPath * FindPathUsingKeyData(const AgentRouteKey *key, const AgentRouteData *data) const
Definition: agent_route.cc:860
virtual void UpdateDerivedRoutes(AgentRouteTable *table, const AgentPath *path, bool active_path_changed)
Definition: agent_route.h:267
bool IsRPFInvalid() const
VrfEntry * vrf_
Definition: agent_route.h:362
bool ProcessPath(Agent *agent, DBTablePartition *part, AgentPath *path, AgentRouteData *data)
Definition: agent_route.cc:986
void AddUnresolvedRouteToTable(AgentRouteTable *table)
Definition: agent_route.cc:352
DEPENDENCY_LIST(NextHop, AgentRoute, tunnel_nh_list_)
std::string intf_route_type_
Definition: agent_route.h:366
AgentPath * FindLocalPath() const
Definition: agent_route.cc:728
void FillTrace(RouteInfo &route, Trace event, const AgentPath *path) const
Definition: agent_path.cc:1583
virtual ~AgentRoute()
Definition: agent_route.h:242
void ResyncTunnelNextHop()
Definition: agent_route.cc:896
bool IsTunnelNHListEmpty()
Definition: agent_route.h:317
void SetVrf(VrfEntry *vrf)
Definition: agent_route.h:338
virtual bool IsLess(const DBEntry &rhs) const
void InsertPath(const AgentPath *path)
Definition: agent_route.cc:601
const AgentPath * GetActivePath() const
Definition: agent_route.cc:877
bool IsDependantRouteEmpty()
Definition: agent_route.h:316
virtual void HandleDeviceMastershipUpdate(AgentPath *path, bool del)
VrfEntry * vrf() const
Definition: agent_route.h:275
virtual void HandleMulticastLabel(const Agent *agent, AgentPath *path, const AgentPath *local_peer_path, const AgentPath *local_vm_peer_path, bool del, uint32_t *evpn_label)
DISALLOW_COPY_AND_ASSIGN(AgentRoute)
const NextHop * GetActiveNextHop() const
Definition: agent_route.cc:882
virtual const std::string GetAddressString() const =0
virtual uint32_t GetActiveLabel() const
Definition: agent_route.cc:891
bool HasUnresolvedPath()
Definition: agent_route.cc:944
bool WaitForTraffic() const
Definition: agent_route.cc:972
DependencyList< NextHop, AgentRoute > TunnelNhDependencyList
Definition: agent_route.h:236
void DeleteInput(DBTablePartition *part, AgentRouteTable *table, AgentRouteKey *key, AgentRouteData *data)
Definition: agent_route.cc:556
bool DeleteAllBgpPath(DBTablePartBase *part, AgentRouteTable *table)
Definition: agent_route.cc:615
bool SubOpResyncInput(VrfEntry *vrf, AgentRouteTable *table, AgentPath **path_ptr, AgentRouteKey *key, AgentRouteData *data)
Definition: agent_route.cc:468
virtual bool DBEntrySandesh(Sandesh *sresp, bool stale) const =0
void UpdateDependantRoutes()
Definition: agent_route.cc:936
DependencyList< AgentRoute, AgentRoute > RouteDependencyList
Definition: agent_route.h:235
const AgentRouteTable * GetDependentRouteTable(void) const
Definition: agent_route.h:349
AgentRouteTable * dependent_route_table_
Definition: agent_route.h:368
virtual void SetKey(const DBRequestKey *key)=0
virtual bool ReComputePathAdd(AgentPath *path)
Definition: agent_route.h:257
virtual uint8_t prefix_length() const
Returns the length of a stored prefix address.
Definition: agent_route.h:336
uint32_t vrf_id() const
bool is_multicast_
Definition: agent_route.h:365
virtual std::string ToString() const =0
virtual KeyPtr GetDBRequestKey() const =0
bool Sync(void)
Definition: agent_route.cc:958
void RemovePath(AgentPath *path)
Definition: agent_route.cc:607
void DeletePathFromPeer(DBTablePartBase *part, AgentRouteTable *table, AgentPath *path)
Definition: agent_route.cc:655
virtual Composite::Type GetMulticastCompType()
Definition: agent_route.h:348
bool is_multicast() const
Definition: agent_route.h:274
virtual AgentPath * FindPath(const Peer *peer) const
Definition: agent_route.cc:865
std::string origin_vn_name_
Definition: agent_route.h:367
const std::string & intf_route_type() const
Definition: agent_route.h:277
void set_intf_route_type(const std::string &intf_route_type)
Definition: agent_route.h:278
void EnqueueRouteResync() const
Definition: agent_route.cc:914
AgentRoute(VrfEntry *vrf, bool is_multicast, const std::string &intf_route_type="interface")
Definition: agent_route.h:238
void set_origin_vn_name(const VnListType &dest_vn_list)
Definition: agent_route.h:282
virtual Agent::RouteTableType GetTableType() const =0
void RemoveUnresolvedRouteFromTable(AgentRouteTable *table)
Definition: agent_route.cc:364
bool SubOpAddChangeInput(VrfEntry *vrf, AgentRouteTable *table, AgentPath **path_ptr, AgentRouteKey *key, AgentRouteData *data, bool route_added)
Definition: agent_route.cc:501
virtual bool ValidateMcastSrc() const
Definition: agent_route.h:352
virtual bool RecomputeRoutePath(Agent *agent, DBTablePartition *part, AgentPath *path, AgentRouteData *data)
Definition: agent_route.h:262
DEPENDENCY_LIST(AgentRoute, AgentRoute, dependant_routes_)
AgentPath * FindLocalVmPortPath() const
Definition: agent_route.cc:743
virtual bool ReComputePathDeletion(AgentPath *path)
Definition: agent_route.h:256
const std::string & dest_vn_name() const
Definition: agent.h:360
RouteTableType
Definition: agent.h:417
static const std::string & NullString()
Definition: agent.h:439
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
const std::string & name() const
Definition: db_table.h:110
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
Definition: db_table.h:169
Definition: db.h:24
Definition: ecmp.h:15
void Reset(LifetimeActor *actor)
Definition: lifetime.h:82
Definition: path.h:10
Definition: peer.h:44
Definition: route.h:14
Definition: trace.h:220
Definition: vrf.h:86
uint8_t type
Definition: load_balance.h:2
boost::intrusive_ptr< const Peer > PeerConstPtr
Definition: peer.h:41
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
Definition: sandesh_trace.h:18
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_route.h:74
uint64_t sequence_number() const
Definition: agent_route.h:78
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)=0
virtual bool CanDeletePath(Agent *agent, AgentPath *path, const AgentRoute *rt) const
Definition: agent_route.h:70
virtual std::string ToString() const =0
virtual AgentPath * CreateAgentPath(const Peer *peer, AgentRoute *rt) const
Definition: agent_route.cc:995
uint64_t sequence_number_
Definition: agent_route.h:82
bool is_multicast_
Definition: agent_route.h:81
@ ROUTE_PREFERENCE_CHANGE
Definition: agent_route.h:58
bool AddChangePath(Agent *agent, AgentPath *path, const AgentRoute *rt)
DISALLOW_COPY_AND_ASSIGN(AgentRouteData)
AgentRouteData(Type type, bool is_multicast, uint64_t sequence_number)
Definition: agent_route.h:61
virtual ~AgentRouteData()
Definition: agent_route.h:64
bool is_multicast() const
Definition: agent_route.h:77
virtual ~AgentRouteKey()
Definition: agent_route.h:38
const Peer * peer() const
Definition: agent_route.h:47
void set_peer(const Peer *peer)
Definition: agent_route.h:48
virtual Agent::RouteTableType GetRouteTableType()=0
virtual AgentRoute * AllocRouteEntry(VrfEntry *vrf, bool is_multicast) const =0
const std::string & vrf_name() const
Definition: agent_route.h:46
virtual AgentRouteKey * Clone() const =0
std::string vrf_name_
Definition: agent_route.h:51
PeerConstPtr peer_
Definition: agent_route.h:50
virtual std::string ToString() const =0
DISALLOW_COPY_AND_ASSIGN(AgentRouteKey)
AgentRouteKey(const Peer *peer, const std::string &vrf_name)
Definition: agent_route.h:36
bool operator()(const NextHop *nh1, const NextHop *nh2) const
Definition: agent_route.cc:64
bool operator()(const AgentRoute *rt1, const AgentRoute *rt2) const
Definition: agent_route.cc:60
LifetimeRef< RouteTableWalkerState > rt_delete_ref_
Definition: agent_route.h:103
RouteTableWalkerState(LifetimeActor *actor)
Definition: agent_route.h:95