OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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) :
37  AgentKey(), peer_(peer), vrf_name_(vrf_name) { }
38  virtual ~AgentRouteKey() { }
39 
41  virtual std::string ToString() const = 0;
42  virtual AgentRoute *AllocRouteEntry(VrfEntry *vrf,
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  };
62  type_(type), is_multicast_(is_multicast),
63  sequence_number_(sequence_number) { }
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") :
240  Route(), vrf_(vrf), is_multicast_(is_multicast),
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 
282  AgentPath *FindLocalPath() const;
284 
290  AgentPath *GetLocalVmPortPath() const;
291  const AgentPath *GetActivePath() const;
292  const NextHop *GetActiveNextHop() const;
293  const std::string &dest_vn_name() const;
294  bool IsRPFInvalid() const;
295 
296  void EnqueueRouteResync() const;
297  void ResyncTunnelNextHop();
298  bool HasUnresolvedPath();
299  bool Sync(void);
300 
301  //TODO Move dependantroutes and nh to inet4
302  void UpdateDependantRoutes();// analogous to updategatewayroutes
303  bool IsDependantRouteEmpty() { return dependant_routes_.empty(); }
304  bool IsTunnelNHListEmpty() { return tunnel_nh_list_.empty(); }
305 
306  void FillTrace(RouteInfo &route, Trace event, const AgentPath *path) const;
307  bool WaitForTraffic() const;
308 
311  AgentPath *path);
313  AgentPath **path_ptr, AgentRouteKey *key,
314  AgentRouteData *data);
316  AgentPath **path_ptr, AgentRouteKey *key,
317  AgentRouteData *data, bool route_added);
318  void DeleteInput(DBTablePartition *part, AgentRouteTable *table,
319  AgentRouteKey *key, AgentRouteData *data);
323  virtual uint8_t prefix_length() const { return 0; }
324 protected:
325  void SetVrf(VrfEntry *vrf) { vrf_ = vrf; }
326  void RemovePath(AgentPath *path);
327  void InsertPath(const AgentPath *path);
328  virtual void HandleMulticastLabel(const Agent *agent,
329  AgentPath *path,
330  const AgentPath *local_peer_path,
331  const AgentPath *local_vm_peer_path,
332  bool del, uint32_t *evpn_label);
333  virtual bool ReComputeMulticastPaths(AgentPath *path, bool del);
334  virtual void HandleDeviceMastershipUpdate(AgentPath *path, bool del);
337  return dependent_route_table_;
338  }
339  virtual bool ValidateMcastSrc() const { return true; }
340 
341 private:
342  friend class AgentRouteTable;
343  //EcmpData can insert/delete path
344  friend class EcmpData;
345 
346  bool ProcessPath(Agent *agent, DBTablePartition *part, AgentPath *path,
347  AgentRouteData *data);
348 
350  // Unicast table can contain routes for few multicast address
351  // (ex. subnet multicast). Flag to specify if this is multicast route
353  std::string intf_route_type_;
355  DEPENDENCY_LIST(AgentRoute, AgentRoute, dependant_routes_);
356  DEPENDENCY_LIST(NextHop, AgentRoute, tunnel_nh_list_);
358 };
359 
362 template <class PrefixType>
364 public:
365 
367  AgentRoutePrefix(const PrefixType& new_prefix, uint8_t new_plen)
368  : prefix_address_(new_prefix), prefix_length_(new_plen) {}
369 
372 
375  virtual const PrefixType& prefix_address() const {return prefix_address_;}
376 
378  void set_prefix_length(uint8_t new_plen) {
379  prefix_length_ = new_plen;
380  }
381 
382 protected:
383 
385  PrefixType prefix_address_;
386 
388  uint8_t prefix_length_;
389 
390 private:
391 
394 
396 };
397 
398 #define GETPEERNAME(peer) (peer)? peer->GetName() : ""
399 #define AGENT_ROUTE_LOG(table, msg, route, vrf, peer_info)\
400 do {\
401  AgentRouteLog::TraceMsg(table->GetOperDBTraceBuf(), __FILE__, __LINE__,\
402  msg, route, vrf, peer_info);\
403 } while (false)
404 
405 #endif
bool is_multicast_
Definition: agent_route.h:81
uint32_t vrf_id() const
uint64_t sequence_number() const
Definition: agent_route.h:78
virtual ~AgentRouteKey()
Definition: agent_route.h:38
uint64_t sequence_number_
Definition: agent_route.h:82
AgentPath * FindLocalVmPortPath() const
Definition: agent_route.cc:742
SandeshTraceBufferPtr OperDBTraceBuf
Definition: agent_route.h:208
static const std::string & GetSuffix(Agent::RouteTableType type)
Definition: agent_route.cc:99
DISALLOW_COPY_AND_ASSIGN(AgentRoute)
void ResyncTunnelNextHop()
Definition: agent_route.cc:895
DISALLOW_COPY_AND_ASSIGN(AgentRoutePrefix)
virtual bool ReComputePathDeletion(AgentPath *path)
Definition: agent_route.h:256
~AgentRoutePrefix()
The destructor of a route prefix.
Definition: agent_route.h:371
void EnqueueRouteResync() const
Definition: agent_route.cc:913
bool is_multicast() const
Definition: agent_route.h:77
AgentRouteTable * dependent_route_table_
Definition: agent_route.h:354
virtual bool UpdateRoute(AgentRoute *rt)
Definition: agent_route.h:74
virtual uint8_t prefix_length() const
Returns the length of a stored prefix address.
Definition: agent_route.h:323
const std::string & vrf_name() const
Definition: agent_route.cc:455
bool IsTunnelNHListEmpty()
Definition: agent_route.h:304
virtual bool CanDeletePath(Agent *agent, AgentPath *path, const AgentRoute *rt) const
Definition: agent_route.h:70
Definition: vrf.h:86
void AddUnresolvedRouteToTable(AgentRouteTable *table)
Definition: agent_route.cc:352
std::set< const AgentRoute *, RouteComparator > UnresolvedRouteTree
Definition: agent_route.h:112
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
Definition: agent_route.cc:82
virtual const std::string GetAddressString() const =0
std::set< const NextHop *, NHComparator > UnresolvedNHTree
Definition: agent_route.h:113
VrfEntry * vrf_
Definition: agent_route.h:349
void set_intf_route_type(const std::string &intf_route_type)
Definition: agent_route.h:278
UnresolvedNHTree::const_iterator unresolved_nh_end() const
Definition: agent_route.h:152
bool WaitForTraffic() const
Definition: agent_route.cc:971
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
virtual int CompareTo(const Route &rhs) const =0
AgentRoute * LocateRoute(DBTablePartition *part, VrfEntry *vrf, AgentRoute *rt, AgentRouteKey *key, AgentRouteData *data, bool *notify)
Definition: agent_route.cc:322
virtual ~AgentRouteTable()
Definition: agent_route.cc:78
const std::string & intf_route_type() const
Definition: agent_route.h:277
UnresolvedRouteTree::const_iterator unresolved_route_end() const
Definition: agent_route.h:140
bool SubOpAddChangeInput(VrfEntry *vrf, AgentRouteTable *table, AgentPath **path_ptr, AgentRouteKey *key, AgentRouteData *data, bool route_added)
Definition: agent_route.cc:501
virtual void RetryDelete()
Definition: agent_route.cc:164
virtual std::string ToString() const =0
AgentRoute(VrfEntry *vrf, bool is_multicast, const std::string &intf_route_type="interface")
Definition: agent_route.h:238
void EvaluateUnresolvedRoutes(void)
Definition: agent_route.cc:399
bool SubOpResyncInput(VrfEntry *vrf, AgentRouteTable *table, AgentPath **path_ptr, AgentRouteKey *key, AgentRouteData *data)
Definition: agent_route.cc:468
virtual bool AddChangePathExtended(Agent *agent, AgentPath *path, const AgentRoute *rt)=0
bool is_multicast() const
Definition: agent_route.h:274
Definition: route.h:14
UnresolvedNHTree::const_iterator unresolved_nh_begin() const
Definition: agent_route.h:149
AgentRoutePrefix(const PrefixType &new_prefix, uint8_t new_plen)
Creates a new route prefix.
Definition: agent_route.h:367
void DeletePathFromPeer(DBTablePartBase *part, AgentRouteTable *table, AgentPath *path)
Definition: agent_route.cc:654
DISALLOW_COPY_AND_ASSIGN(AgentRouteTable)
virtual AgentPath * FindPathUsingKeyData(const AgentRouteKey *key, const AgentRouteData *data) const
Definition: agent_route.cc:859
DependencyList< AgentRoute, AgentRoute > RouteDependencyList
Definition: agent_route.h:235
void set_prefix_length(uint8_t new_plen)
Sets the length of a stored prefix address.
Definition: agent_route.h:378
virtual void SetKey(const DBRequestKey *key)=0
virtual uint32_t GetActiveLabel() const
Definition: agent_route.cc:890
virtual std::string GetTableName() const =0
uint8_t prefix_length_
The prefix length.
Definition: agent_route.h:388
DependencyList< NextHop, AgentRoute > TunnelNhDependencyList
Definition: agent_route.h:236
uint32_t vrf_id_
Definition: agent_route.h:200
LifetimeActor * deleter()
Definition: agent_route.cc:451
const std::string & dest_vn_name() const
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
Definition: sandesh_trace.h:18
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
Base class for all Route entries in agent.
Definition: agent_route.h:224
virtual size_t Hash(const DBRequestKey *key) const
Definition: agent_route.h:121
virtual KeyPtr GetDBRequestKey() const =0
bool is_multicast_
Definition: agent_route.h:352
virtual AgentRoute * AllocRouteEntry(VrfEntry *vrf, bool is_multicast) const =0
const AgentRouteTable * GetDependentRouteTable(void) const
Definition: agent_route.h:336
virtual const std::string GetSourceAddressString() const =0
Definition: ecmp.h:15
virtual bool DBEntrySandesh(Sandesh *sresp, bool stale) const =0
AgentRoute * FindActiveEntry(const AgentRouteKey *key)
Definition: agent_route.cc:417
LifetimeRef< AgentRouteTable > vrf_delete_ref_
Definition: agent_route.h:203
Definition: db.h:24
const AgentPath * GetActivePath() const
Definition: agent_route.cc:876
bool HasUnresolvedPath()
Definition: agent_route.cc:943
virtual Agent::RouteTableType GetTableType() const =0
virtual int PartitionCount() const
Definition: agent_route.h:118
VrfEntry * vrf_entry() const
Definition: agent_route.cc:459
PrefixType prefix_address_
The prefix address.
Definition: agent_route.h:385
void FillTrace(RouteInfo &route, Trace event, const AgentPath *path) const
Definition: agent_path.cc:1583
void SetVrf(VrfEntry *vrf)
Definition: agent_route.h:325
VrfEntryRef vrf_entry_
Definition: agent_route.h:201
bool Sync(void)
Definition: agent_route.cc:957
uint8_t type
Definition: load_balance.h:109
virtual AgentPath * CreateAgentPath(const Peer *peer, AgentRoute *rt) const
Definition: agent_route.cc:994
AgentRouteData(Type type, bool is_multicast, uint64_t sequence_number)
Definition: agent_route.h:61
boost::scoped_ptr< DeleteActor > deleter_
Definition: agent_route.h:202
virtual void ProcessAdd(AgentRoute *rt)
Definition: agent_route.h:127
Definition: agent.h:358
AgentRoute * FindActiveEntryNoLock(const AgentRouteKey *key)
Definition: agent_route.cc:425
Definition: path.h:10
void Reset(LifetimeActor *actor)
Definition: lifetime.h:82
AgentPath * FindLocalPath() const
Definition: agent_route.cc:727
const NextHop * GetActiveNextHop() const
Definition: agent_route.cc:881
std::string intf_route_type_
Definition: agent_route.h:353
void Input(DBTablePartition *part, DBClient *client, DBRequest *req)
Definition: agent_route.cc:199
void RemovePath(AgentPath *path)
Definition: agent_route.cc:606
virtual Agent::RouteTableType GetRouteTableType()=0
Definition: trace.h:220
virtual bool ReComputeMulticastPaths(AgentPath *path, bool del)
static bool PathSelection(const Path &path1, const Path &path2)
Definition: agent_route.cc:93
AgentRoutePrefix()
Forbid default ctor.
virtual void ProcessDelete(AgentRoute *rt)
Definition: agent_route.h:126
void DeleteRouteDone(DBTable::DBTableWalkRef walk_ref, DBTableBase *base, RouteTableWalkerState *state)
Definition: agent_route.cc:147
bool AddChangePath(Agent *agent, AgentPath *path, const AgentRoute *rt)
Definition: agent_route.cc:999
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
Definition: agent_db.h:18
void InsertPath(const AgentPath *path)
Definition: agent_route.cc:600
const std::string & name() const
Definition: db_table.h:110
PeerConstPtr peer_
Definition: agent_route.h:50
static const int kPartitionCount
Definition: agent_route.h:111
Definition: peer.h:44
void RemoveUnresolvedRouteFromTable(AgentRouteTable *table)
Definition: agent_route.cc:364
virtual void DeleteDerivedRoutes(AgentRouteTable *table)
Definition: agent_route.h:272
bool DelExplicitRouteWalkerCb(DBTablePartBase *part, DBEntryBase *entry)
Definition: agent_route.cc:155
virtual const PrefixType & prefix_address() const
Returns the value of a stored prefix address (IPv4, IPv6 or MAC address)
Definition: agent_route.h:375
virtual std::string ToString() const =0
AgentRouteKey(const Peer *peer, const std::string &vrf_name)
Definition: agent_route.h:36
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:816
DEPENDENCY_LIST(AgentRoute, AgentRoute, dependant_routes_)
AgentPath * GetLocalVmPortPath() const
Definition: agent_route.cc:844
virtual void NotifyEntry(AgentRoute *entry)
Definition: agent_route.cc:174
boost::intrusive_ptr< const Peer > PeerConstPtr
Definition: peer.h:41
virtual AgentRouteKey * Clone() const =0
LifetimeRef< RouteTableWalkerState > rt_delete_ref_
Definition: agent_route.h:103
virtual std::string ToString() const =0
std::string vrf_name_
Definition: agent_route.h:51
virtual bool RecomputeRoutePath(Agent *agent, DBTablePartition *part, AgentPath *path, AgentRouteData *data)
Definition: agent_route.h:262
UnresolvedRouteTree unresolved_rt_tree_
Definition: agent_route.h:204
void RemoveUnresolvedRoute(const AgentRoute *rt)
Definition: agent_route.cc:412
void DeleteInput(DBTablePartition *part, AgentRouteTable *table, AgentRouteKey *key, AgentRouteData *data)
Definition: agent_route.cc:555
void RemoveUnresolvedNH(const NextHop *)
Definition: agent_route.cc:393
bool IsRPFInvalid() const
bool ProcessPath(Agent *agent, DBTablePartition *part, AgentPath *path, AgentRouteData *data)
Definition: agent_route.cc:985
virtual bool ReComputePathAdd(AgentPath *path)
Definition: agent_route.h:257
void UpdateDependantRoutes()
Definition: agent_route.cc:935
int unresolved_route_size() const
Definition: agent_route.h:143
const Peer * peer() const
Definition: agent_route.h:47
virtual bool ValidateMcastSrc() const
Definition: agent_route.h:339
virtual SandeshTraceBufferPtr GetOperDBTraceBuf() const
Definition: agent_route.h:134
virtual ~AgentRoute()
Definition: agent_route.h:242
const std::string & vrf_name() const
Definition: agent_route.h:46
VrfEntry * vrf() const
Definition: agent_route.h:275
RouteTableWalkerState(LifetimeActor *actor)
Definition: agent_route.h:95
Agent * agent() const
Definition: agent_route.h:159
void Process(DBRequest &req)
Definition: agent_route.cc:186
DISALLOW_COPY_AND_ASSIGN(AgentRouteKey)
AgentRouteTable(DB *db, const std::string &name)
Definition: agent_route.cc:71
bool DeleteAllBgpPath(DBTablePartBase *part, AgentRouteTable *table)
Definition: agent_route.cc:614
void AddChangeInput(DBTablePartition *part, VrfEntry *vrf, AgentRoute *rt, AgentRouteKey *key, AgentRouteData *data)
Definition: agent_route.cc:243
UnresolvedRouteTree::const_iterator unresolved_route_begin() const
Definition: agent_route.h:137
void EvaluateUnresolvedNH(void)
Definition: agent_route.cc:375
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
Definition: db_table.h:169
DISALLOW_COPY_AND_ASSIGN(AgentRouteData)
RouteTableType
Definition: agent.h:415
void AddUnresolvedNH(const NextHop *)
Definition: agent_route.cc:389
virtual void HandleDeviceMastershipUpdate(AgentPath *path, bool del)
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)
virtual AgentPath * FindPath(const Peer *peer) const
Definition: agent_route.cc:864
bool IsDependantRouteEmpty()
Definition: agent_route.h:303
void AddUnresolvedRoute(const AgentRoute *rt)
Definition: agent_route.cc:408
bool operator()(const NextHop *nh1, const NextHop *nh2) const
Definition: agent_route.cc:64
virtual Composite::Type GetMulticastCompType()
Definition: agent_route.h:335
virtual void UpdateDerivedRoutes(AgentRouteTable *table, const AgentPath *path, bool active_path_changed)
Definition: agent_route.h:267
bool operator()(const AgentRoute *rt1, const AgentRoute *rt2) const
Definition: agent_route.cc:60
virtual ~AgentRouteData()
Definition: agent_route.h:64
UnresolvedNHTree unresolved_nh_tree_
Definition: agent_route.h:205
void ManagedDelete()
Definition: agent_route.cc:135
virtual bool IsLess(const DBEntry &rhs) const
virtual size_t Hash(const DBEntry *entry) const
Definition: agent_route.h:120
virtual Agent::RouteTableType GetTableType() const =0
void set_peer(const Peer *peer)
Definition: agent_route.h:48
void SetVrf(VrfEntry *vrf)
Definition: agent_route.cc:126
This class defines interfaces for manipulating the prefix of a route stored in an Agent VRF table...
Definition: agent_route.h:363
uint32_t vrf_id() const
Definition: agent_route.h:161
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
Definition: agent_route.h:130