OpenSDN source code
inet_unicast_route.h
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 #ifndef vnsw_inet_unicast_route_hpp
7 #define vnsw_inet_unicast_route_hpp
8 
9 class VlanNhRoute;
10 class LocalVmRoute;
11 class InetInterfaceRoute;
12 class ClonedLocalPath;
13 class EcmpLoadBalance;
14 
16 // UNICAST INET
19 public:
20  InetUnicastRouteKey(const Peer *peer, const string &vrf_name,
21  const IpAddress &dip, uint8_t plen) :
23  virtual ~InetUnicastRouteKey() { }
24 
25  //Called from oute creation in input of route table
26  AgentRoute *AllocRouteEntry(VrfEntry *vrf, bool is_multicast) const;
28  if (dip_.is_v4()) {
29  return Agent::INET4_UNICAST;
30  }
31  if (dip_.is_v6()) {
32  return Agent::INET6_UNICAST;
33  }
34  return Agent::INVALID;
35  }
36  virtual string ToString() const;
37  virtual AgentRouteKey *Clone() const;
38 
39  const IpAddress &addr() const {return dip_;}
40  uint8_t plen() const {return plen_;}
41 
42 protected:
44  uint8_t plen_;
45 private:
47 };
49 public:
50  InetMplsUnicastRouteKey(const Peer *peer, const string &vrf_name,
51  const IpAddress &dip, uint8_t plen) :
54 
56  if (dip_.is_v4()) {
57  return Agent::INET4_MPLS;
58  }
59  return Agent::INVALID;
60  }
61  virtual AgentRouteKey *Clone() const;
62 
63 private:
65 };
66 
68  public AgentRoutePrefix<IpAddress> {
69 public:
71  uint8_t plen, bool is_multicast);
72  virtual ~InetUnicastRouteEntry() { }
73 
74  virtual int CompareTo(const Route &rhs) const;
75  virtual std::string ToString() const;
76  virtual KeyPtr GetDBRequestKey() const;
77  virtual void SetKey(const DBRequestKey *key);
78  virtual bool DBEntrySandesh(Sandesh *sresp, bool stale) const;
79  virtual const std::string GetAddressString() const {
80  return prefix_address_.to_string();
81  }
82  virtual const std::string GetSourceAddressString() const {
83  return "0.0.0.0";
84  }
85  virtual Agent::RouteTableType GetTableType() const;
86  virtual bool ReComputePathDeletion(AgentPath *path);
87  virtual bool ReComputePathAdd(AgentPath *path);
89  uint8_t prefix_length() const { return prefix_length_; }
90  void set_addr(IpAddress addr) { prefix_address_ = addr; };
91 
92  //Key for patricia node lookup
93  class Rtkey {
94  public:
95  static std::size_t BitLength(const InetUnicastRouteEntry *key) {
96  return key->prefix_length();
97  }
98  static char ByteValue(
99  const InetUnicastRouteEntry *key, std::size_t i) {
100  if (key->prefix_address().is_v4()) {
101  Ip4Address::bytes_type addr_bytes;
102  addr_bytes = key->prefix_address().to_v4().to_bytes();
103  char res = static_cast<char>(addr_bytes[i]);
104  return res;
105  } else {
106  Ip6Address::bytes_type addr_bytes;
107  addr_bytes = key->prefix_address().to_v6().to_bytes();
108  volatile char res = static_cast<char>(addr_bytes[i]);
109  return res;
110  }
111  }
112  };
113 
114  bool DBEntrySandesh(Sandesh *sresp, IpAddress addr, uint8_t plen, bool stale) const;
115  bool IsHostRoute() const;
116  bool IpamSubnetRouteAvailable() const;
118 
121  bool proxy_arp);
122 
123  bool ipam_subnet_route() const {return ipam_subnet_route_;}
124  bool ipam_host_route() const { return ipam_host_route_; }
125  bool proxy_arp() const {return proxy_arp_;}
126  virtual AgentPath *FindPathUsingKeyData(const AgentRouteKey *key,
127  const AgentRouteData *data) const;
128 
129 protected:
131 
133  // Flag set if route exactly matches a subnet in IPAM
134  // ARP packets hitting this route must be flooded even if its ECMP route
136  // Flag set if this is host route and falls in an IPAM subnet
137  // ARP packets hitting this route are flooded if MAC stitching is missing
139  // Specifies if ARP must be force proxied for this route
141 private:
143  const AgentRouteData *data) const;
145 };
146 
148 public:
152 
153  InetUnicastAgentRouteTable(DB *db, const std::string &name);
155 
158  virtual string GetTableName() const {
159  if (type_ == Agent::INET4_UNICAST) {
160  return "Inet4UnicastAgentRouteTable";
161  }
162  if (type_ == Agent::INET4_MPLS) {
163  return "Inet4MplsAgentRouteTable";
164  }
165  if (type_ == Agent::INET6_UNICAST) {
166  return "Inet6UnicastAgentRouteTable";
167  }
168  return "Unknown";
169  }
171  return type_;
172  }
173  virtual void ProcessAdd(AgentRoute *rt) {
174  tree_.Insert(static_cast<InetUnicastRouteEntry *>(rt));
175  }
176  virtual void ProcessDelete(AgentRoute *rt) {
177  tree_.Remove(static_cast<InetUnicastRouteEntry *>(rt));
178  }
180  const std::string &context);
182  return FindLPM(key);
183  }
185  return FindLPM(ip);
186  }
187 
189  return static_cast<const InetUnicastRouteEntry *>(tree_.FindNext(rt));
190  }
191 
193  return static_cast<InetUnicastRouteEntry *>(tree_.FindNext(rt));
194  }
195 
196  static DBTableBase *CreateTable(DB *db, const std::string &name);
197  static void DeleteReq(const Peer *peer, const string &vrf_name,
198  const IpAddress &addr, uint8_t plen,
199  AgentRouteData *data);
200  static void DeleteMplsRouteReq(const Peer *peer, const string &vrf_name,
201  const IpAddress &addr, uint8_t plen,
202  AgentRouteData *data);
203  static void Delete(const Peer *peer, const string &vrf_name,
204  const IpAddress &addr, uint8_t plen);
205  void Delete(const Peer *peer, const string &vrf_name,
206  const IpAddress &addr, uint8_t plen,
207  AgentRouteData *data);
208  static void AddHostRoute(const string &vrf_name,
209  const IpAddress &addr, uint8_t plen,
210  const std::string &dest_vn_name,
211  bool policy);
212  void AddLocalVmRouteReq(const Peer *peer, const string &vm_vrf,
213  const IpAddress &addr, uint8_t plen,
214  LocalVmRoute *data);
215  void AddLocalVmRouteReq(const Peer *peer, const string &vm_vrf,
216  const IpAddress &addr, uint8_t plen,
217  const boost::uuids::uuid &intf_uuid,
218  const VnListType &vn_list,
219  uint32_t label,
220  const SecurityGroupList &sg_list,
221  const TagList &tag_list,
222  const CommunityList &communities,
223  bool force_policy,
224  const PathPreference &path_preference,
225  const IpAddress &subnet_service_ip,
226  const EcmpLoadBalance &ecmp_load_balance,
227  bool is_local,
228  bool is_health_check_service,
229  bool native_encap,
230  const std::string &intf_name = "",
231  bool is_learnt_route = false);
232  static void AddLocalVmRoute(const Peer *peer, const string &vm_vrf,
233  const IpAddress &addr, uint8_t plen,
234  const boost::uuids::uuid &intf_uuid,
235  const VnListType &vn_list,
236  uint32_t label,
237  const SecurityGroupList &sg_list,
238  const TagList &tag_list,
239  const CommunityList &communities,
240  bool force_policy,
241  const PathPreference &path_preference,
242  const IpAddress &subnet_service_ip,
243  const EcmpLoadBalance &ecmp_load_balance,
244  bool is_local, bool is_health_check_service,
245  const std::string &intf_name,
246  bool native_encap,
247  const std::string &intf_route_type = VmInterface::kInterface,
248  bool is_learnt_route = false);
249  void ResyncRoute(const Peer *peer, const string &vrf,
250  const IpAddress &addr, uint8_t plen);
251  static void AddRemoteVmRouteReq(const Peer *peer, const string &vm_vrf,
252  const IpAddress &vm_addr,uint8_t plen,
253  AgentRouteData *data);
254  void AddVlanNHRouteReq(const Peer *peer, const string &vm_vrf,
255  const IpAddress &addr, uint8_t plen,
256  VlanNhRoute *data);
257  void AddVlanNHRouteReq(const Peer *peer, const string &vm_vrf,
258  const IpAddress &addr, uint8_t plen,
259  const boost::uuids::uuid &intf_uuid, uint16_t tag,
260  uint32_t label, const VnListType &dest_vn_list,
261  const SecurityGroupList &sg_list_,
262  const TagList &tag_list,
263  const PathPreference &path_preference);
264  static void AddVlanNHRoute(const Peer *peer, const string &vm_vrf,
265  const IpAddress &addr, uint8_t plen,
266  const boost::uuids::uuid &intf_uuid, uint16_t tag,
267  uint32_t label, const VnListType &dest_vn_list,
268  const SecurityGroupList &sg_list_,
269  const TagList &tag_list,
270  const PathPreference &path_preference);
272  static InetUnicastRouteEntry *FindResolveRoute(const string &vrf_name,
273  const Ip4Address &ip);
274  static bool ShouldAddArp(const Ip4Address &ip);
275  static void CheckAndAddArpReq(const string &vrf_name, const Ip4Address &ip,
276  const Interface *intf,
277  const VnListType &vn_list,
278  const SecurityGroupList &sg,
279  const TagList &tag);
280  static void CheckAndAddArpRoute(const string &route_vrf_name,
281  const Ip4Address &ip,
282  const MacAddress &mac,
283  const Interface *intf,
284  bool resolved,
285  const VnListType &vn_list,
286  const SecurityGroupList &sg,
287  const TagList &tag);
288  static void AddArpReq(const string &route_vrf_name,
289  const Ip4Address &ip,
290  const string &nh_vrf_name,
291  const Interface *intf,
292  bool policy,
293  const VnListType &dest_vn_list,
294  const SecurityGroupList &sg_list,
295  const TagList &tag_list);
296  static void ArpRoute(DBRequest::DBOperation op,
297  const string &route_vrf_name,
298  const Ip4Address &ip,
299  const MacAddress &mac,
300  const string &nh_vrf_name,
301  const Interface &intf,
302  bool resolved,
303  const uint8_t plen,
304  bool policy,
305  const VnListType &dest_vn_list,
306  const SecurityGroupList &sg_list,
307  const TagList &tag_list);
308  static void NdpRoute(DBRequest::DBOperation op,
309  const string &route_vrf_name,
310  const IpAddress &ip,
311  const MacAddress &mac,
312  const string &nh_vrf_name,
313  const Interface &intf,
314  bool resolved,
315  const uint8_t plen,
316  bool policy,
317  const VnListType &dest_vn_list,
318  const SecurityGroupList &sg_list,
319  const TagList &tag_list);
320  static void AddResolveRoute(const Peer *peer,
321  const string &vrf_name, const Ip4Address &ip,
322  const uint8_t plen,
323  const InterfaceKey &intf_key,
324  const uint32_t label, bool policy,
325  const std::string &vn_name,
326  const SecurityGroupList &sg_list,
327  const TagList &tag_list);
328  void AddInetInterfaceRouteReq(const Peer *peer, const string &vm_vrf,
329  const Ip4Address &addr, uint8_t plen,
330  InetInterfaceRoute *data);
331  void AddInetInterfaceRouteReq(const Peer *peer, const string &vm_vrf,
332  const Ip4Address &addr, uint8_t plen,
333  const string &interface,
334  uint32_t label,
335  const VnListType &vn_list);
336 
337  static void AddVHostRecvRoute(const Peer *peer, const string &vrf,
338  const InterfaceKey &interface,
339  const IpAddress &addr, uint8_t plen,
340  const string &vn_name, bool policy,
341  bool native_encap,
342  bool ipam_host_route = true);
343  static void AddVHostRecvRouteReq(const Peer *peer, const string &vrf,
344  const InterfaceKey &interface,
345  const IpAddress &addr, uint8_t plen,
346  const string &vn_name, bool policy,
347  bool native_encap);
348  static void AddVHostMplsRecvRouteReq(const Peer *peer, const string &vrf,
349  const InterfaceKey &interface,
350  const IpAddress &addr, uint8_t plen,
351  const string &vn_name, bool policy,
352  bool native_encap);
353  static void AddVHostSubnetRecvRoute(const Peer *peer, const string &vrf,
354  const InterfaceKey &interface,
355  const Ip4Address &addr, uint8_t plen,
356  const std::string &vn_name,
357  bool policy);
358  static void DelVHostSubnetRecvRoute(const string &vm_vrf,
359  const Ip4Address &addr, uint8_t plen);
360  static void AddDropRoute(const string &vm_vrf,
361  const Ip4Address &addr, uint8_t plen,
362  const string &vn_name);
363  static void AddGatewayRoute(const Peer *peer,
364  const string &vrf_name,
365  const Ip4Address &dst_addr,uint8_t plen,
366  const AddressList &gw_list,
367  const VnListType &vn_name, uint32_t label,
368  const SecurityGroupList &sg_list,
369  const TagList &tag_list,
370  const CommunityList &communities,
371  bool native_encap);
372  static void AddGatewayRouteReq(const Peer *peer,
373  const string &vrf_name,
374  const Ip4Address &dst_addr,uint8_t plen,
375  const AddressList &gw_list,
376  const VnListType &vn_name, uint32_t label,
377  const SecurityGroupList &sg_list,
378  const TagList &tag_list,
379  const CommunityList &communities,
380  bool native_encap);
381  static void AddLocalMplsRouteReq(const Peer *peer,
382  const string &vrf_name,
383  const Ip4Address &dst_addr,uint8_t plen,
384  const Ip4Address &gw_ip,
385  const VnListType &vn_name, uint32_t label,
386  const SecurityGroupList &sg_list,
387  const TagList &tag_list,
388  const CommunityList &communities,
389  bool native_encap);
390  static void AddMplsRouteInternal(const Peer *peer,
391  DBRequest *req, const string &vrf_name,
392  const IpAddress &dst_addr, uint8_t plen,
393  const IpAddress &gw_ip,
394  const VnListType &vn_name, uint32_t label,
395  const SecurityGroupList &sg_list,
396  const TagList &tag_list,
397  const CommunityList &communities,
398  bool native_encap);
399  static void AddMplsRouteReq(const Peer *peer,
400  const string &vrf_name,
401  const IpAddress &dst_addr,uint8_t plen,
402  AgentRouteData *data);
403  void AddIpamSubnetRoute(const string &vm_vrf, const IpAddress &addr,
404  uint8_t plen, const std::string &vn_name);
405  void AddVrouterSubnetRoute(const IpAddress &dst_addr, uint8_t plen);
406  void AddVhostMplsRoute(const IpAddress &vhost_addr, const Peer *peer);
407  void AddInterfaceRouteReq(Agent *agent, const Peer *peer,
408  const string &vrf_name,
409  const Ip4Address &ip, uint8_t plen,
410  const Interface *intrface,
411  const std::string &vn_name);
412  void AddClonedLocalPathReq(const Peer *peer, const string &vm_vrf,
413  const IpAddress &addr,
414  uint8_t plen, ClonedLocalPath *data);
415  bool ResyncSubnetRoutes(const InetUnicastRouteEntry *rt, bool val);
416  uint8_t GetHostPlen(const IpAddress &ip_addr) const;
417  void AddEvpnRoute(const AgentRoute *evpn_entry);
418  void DeleteEvpnRoute(const AgentRoute *rt);
420  const Peer *peer);
422  uint16_t plen) const;
424  void AddEvpnRoutingRoute(const IpAddress &ip_addr,
425  uint8_t plen,
426  const VrfEntry *vrf,
427  const Peer *peer,
428  const SecurityGroupList &sg_list,
429  const CommunityList &communities,
430  const PathPreference &path_preference,
431  const EcmpLoadBalance &ecmp_load_balance,
432  const TagList &tag_list,
433  DBRequest &nh_req,
434  uint32_t vxlan_id,
435  const VnListType& vn_list,
436  const std::string& origin_vn = "");
437  void AddEvpnRoutingRouteReq(const IpAddress &ip_addr,
438  uint8_t plen,
439  const VrfEntry *vrf,
440  const Peer *peer,
441  const SecurityGroupList &sg_list,
442  const CommunityList &communities,
443  const PathPreference &path_preference,
444  const EcmpLoadBalance &ecmp_load_balance,
445  const TagList &tag_list,
446  DBRequest &nh_req,
447  uint32_t vxlan_id,
448  const VnListType& vn_list,
449  const std::string& origin_vn = "");
450 
451 
452 private:
458 };
459 
460 #endif // vnsw_inet_unicast_route_hpp
boost::asio::ip::address IpAddress
Definition: address.h:14
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:15
std::vector< uint64_t > TagList
Definition: agent.h:203
std::vector< int > SecurityGroupList
Definition: agent.h:202
std::vector< Ip4Address > AddressList
Definition: agent.h:218
std::set< std::string > VnListType
Definition: agent.h:213
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
Definition: agent_db.h:21
std::vector< std::string > CommunityList
Definition: bgp_config.h:348
This class defines interfaces for manipulating the prefix of a route stored in an Agent VRF table.
Definition: agent_route.h:378
virtual const PrefixType & prefix_address() const
Returns the value of a stored prefix address (IPv4, IPv6 or MAC address)
Definition: agent_route.h:390
uint8_t prefix_length_
The prefix length.
Definition: agent_route.h:403
IpAddress prefix_address_
The prefix address.
Definition: agent_route.h:400
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge,...
Definition: agent_route.h:110
const std::string & vrf_name() const
Definition: agent_route.cc:456
Agent * agent() const
Definition: agent_route.h:160
Base class for all Route entries in agent.
Definition: agent_route.h:225
VrfEntry * vrf() const
Definition: agent_route.h:276
bool is_multicast() const
Definition: agent_route.h:275
Definition: agent.h:361
RouteTableType
Definition: agent.h:418
@ INET6_UNICAST
Definition: agent.h:424
@ INET4_MPLS
Definition: agent.h:425
@ INET4_UNICAST
Definition: agent.h:420
@ INVALID
Definition: agent.h:419
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
const std::string & name() const
Definition: db_table.h:111
Definition: db.h:25
virtual Agent::RouteTableType GetRouteTableType()
InetMplsUnicastRouteKey(const Peer *peer, const string &vrf_name, const IpAddress &dip, uint8_t plen)
DISALLOW_COPY_AND_ASSIGN(InetMplsUnicastRouteKey)
virtual AgentRouteKey * Clone() const
Agent::RouteTableType type_
InetUnicastRouteEntry * FindResolveRoute(const Ip4Address &ip)
static void AddMplsRouteReq(const Peer *peer, const string &vrf_name, const IpAddress &dst_addr, uint8_t plen, AgentRouteData *data)
static void AddVHostRecvRoute(const Peer *peer, const string &vrf, const InterfaceKey &interface, const IpAddress &addr, uint8_t plen, const string &vn_name, bool policy, bool native_encap, bool ipam_host_route=true)
static void AddResolveRoute(const Peer *peer, const string &vrf_name, const Ip4Address &ip, const uint8_t plen, const InterfaceKey &intf_key, const uint32_t label, bool policy, const std::string &vn_name, const SecurityGroupList &sg_list, const TagList &tag_list)
static void NdpRoute(DBRequest::DBOperation op, const string &route_vrf_name, const IpAddress &ip, const MacAddress &mac, const string &nh_vrf_name, const Interface &intf, bool resolved, const uint8_t plen, bool policy, const VnListType &dest_vn_list, const SecurityGroupList &sg_list, const TagList &tag_list)
static void Delete(const Peer *peer, const string &vrf_name, const IpAddress &addr, uint8_t plen)
void TraverseHostRoutesInSubnet(InetUnicastRouteEntry *rt, const Peer *peer)
static bool ShouldAddArp(const Ip4Address &ip)
const InetUnicastRouteEntry * GetNext(const InetUnicastRouteEntry *rt)
static void AddVHostRecvRouteReq(const Peer *peer, const string &vrf, const InterfaceKey &interface, const IpAddress &addr, uint8_t plen, const string &vn_name, bool policy, bool native_encap)
uint8_t GetHostPlen(const IpAddress &ip_addr) const
void AddEvpnRoutingRoute(const IpAddress &ip_addr, uint8_t plen, const VrfEntry *vrf, const Peer *peer, const SecurityGroupList &sg_list, const CommunityList &communities, const PathPreference &path_preference, const EcmpLoadBalance &ecmp_load_balance, const TagList &tag_list, DBRequest &nh_req, uint32_t vxlan_id, const VnListType &vn_list, const std::string &origin_vn="")
InetUnicastRouteEntry * FindRouteUsingKey(InetUnicastRouteEntry &key)
bool ResyncSubnetRoutes(const InetUnicastRouteEntry *rt, bool val)
InetUnicastRouteEntry * FindRoute(const IpAddress &ip)
virtual void ProcessDelete(AgentRoute *rt)
void AddInterfaceRouteReq(Agent *agent, const Peer *peer, const string &vrf_name, const Ip4Address &ip, uint8_t plen, const Interface *intrface, const std::string &vn_name)
static void AddRemoteVmRouteReq(const Peer *peer, const string &vm_vrf, const IpAddress &vm_addr, uint8_t plen, AgentRouteData *data)
virtual void ProcessAdd(AgentRoute *rt)
static void AddVHostSubnetRecvRoute(const Peer *peer, const string &vrf, const InterfaceKey &interface, const Ip4Address &addr, uint8_t plen, const std::string &vn_name, bool policy)
DBTableWalker::WalkId walkid_
static void DelVHostSubnetRecvRoute(const string &vm_vrf, const Ip4Address &addr, uint8_t plen)
void AddIpamSubnetRoute(const string &vm_vrf, const IpAddress &addr, uint8_t plen, const std::string &vn_name)
InetUnicastRouteEntry * FindLPM(const IpAddress &ip)
void AddClonedLocalPathReq(const Peer *peer, const string &vm_vrf, const IpAddress &addr, uint8_t plen, ClonedLocalPath *data)
static void AddVHostMplsRecvRouteReq(const Peer *peer, const string &vrf, const InterfaceKey &interface, const IpAddress &addr, uint8_t plen, const string &vn_name, bool policy, bool native_encap)
DISALLOW_COPY_AND_ASSIGN(InetUnicastAgentRouteTable)
static void AddArpReq(const string &route_vrf_name, const Ip4Address &ip, const string &nh_vrf_name, const Interface *intf, bool policy, const VnListType &dest_vn_list, const SecurityGroupList &sg_list, const TagList &tag_list)
static void AddLocalVmRoute(const Peer *peer, const string &vm_vrf, const IpAddress &addr, uint8_t plen, const boost::uuids::uuid &intf_uuid, const VnListType &vn_list, uint32_t label, const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &communities, bool force_policy, const PathPreference &path_preference, const IpAddress &subnet_service_ip, const EcmpLoadBalance &ecmp_load_balance, bool is_local, bool is_health_check_service, const std::string &intf_name, bool native_encap, const std::string &intf_route_type=VmInterface::kInterface, bool is_learnt_route=false)
void DeleteEvpnRoute(const AgentRoute *rt)
void ResyncRoute(const Peer *peer, const string &vrf, const IpAddress &addr, uint8_t plen)
static void CheckAndAddArpReq(const string &vrf_name, const Ip4Address &ip, const Interface *intf, const VnListType &vn_list, const SecurityGroupList &sg, const TagList &tag)
void AddInetInterfaceRouteReq(const Peer *peer, const string &vm_vrf, const Ip4Address &addr, uint8_t plen, InetInterfaceRoute *data)
static void CheckAndAddArpRoute(const string &route_vrf_name, const Ip4Address &ip, const MacAddress &mac, const Interface *intf, bool resolved, const VnListType &vn_list, const SecurityGroupList &sg, const TagList &tag)
InetUnicastRouteEntry * GetNextNonConst(const InetUnicastRouteEntry *rt)
void AddLocalVmRouteReq(const Peer *peer, const string &vm_vrf, const IpAddress &addr, uint8_t plen, LocalVmRoute *data)
InetUnicastRouteEntry * GetSuperNetRoute(const IpAddress &addr)
void AddEvpnRoutingRouteReq(const IpAddress &ip_addr, uint8_t plen, const VrfEntry *vrf, const Peer *peer, const SecurityGroupList &sg_list, const CommunityList &communities, const PathPreference &path_preference, const EcmpLoadBalance &ecmp_load_balance, const TagList &tag_list, DBRequest &nh_req, uint32_t vxlan_id, const VnListType &vn_list, const std::string &origin_vn="")
void AddVrouterSubnetRoute(const IpAddress &dst_addr, uint8_t plen)
void AddEvpnRoute(const AgentRoute *evpn_entry)
virtual string GetTableName() const
static void AddLocalMplsRouteReq(const Peer *peer, const string &vrf_name, const Ip4Address &dst_addr, uint8_t plen, const Ip4Address &gw_ip, const VnListType &vn_name, uint32_t label, const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &communities, bool native_encap)
InetUnicastAgentRouteTable(DB *db, const std::string &name)
static void AddDropRoute(const string &vm_vrf, const Ip4Address &addr, uint8_t plen, const string &vn_name)
static void DeleteReq(const Peer *peer, const string &vrf_name, const IpAddress &addr, uint8_t plen, AgentRouteData *data)
static void ArpRoute(DBRequest::DBOperation op, const string &route_vrf_name, const Ip4Address &ip, const MacAddress &mac, const string &nh_vrf_name, const Interface &intf, bool resolved, const uint8_t plen, bool policy, const VnListType &dest_vn_list, const SecurityGroupList &sg_list, const TagList &tag_list)
static void AddGatewayRoute(const Peer *peer, const string &vrf_name, const Ip4Address &dst_addr, uint8_t plen, const AddressList &gw_list, const VnListType &vn_name, uint32_t label, const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &communities, bool native_encap)
IpAddress GetSubnetAddress(const IpAddress &addr, uint16_t plen) const
static void AddVlanNHRoute(const Peer *peer, const string &vm_vrf, const IpAddress &addr, uint8_t plen, const boost::uuids::uuid &intf_uuid, uint16_t tag, uint32_t label, const VnListType &dest_vn_list, const SecurityGroupList &sg_list_, const TagList &tag_list, const PathPreference &path_preference)
static void AddMplsRouteInternal(const Peer *peer, DBRequest *req, const string &vrf_name, const IpAddress &dst_addr, uint8_t plen, const IpAddress &gw_ip, const VnListType &vn_name, uint32_t label, const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &communities, bool native_encap)
static void DeleteMplsRouteReq(const Peer *peer, const string &vrf_name, const IpAddress &addr, uint8_t plen, AgentRouteData *data)
virtual Agent::RouteTableType GetTableType() const
static void AddHostRoute(const string &vrf_name, const IpAddress &addr, uint8_t plen, const std::string &dest_vn_name, bool policy)
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
void AddVlanNHRouteReq(const Peer *peer, const string &vm_vrf, const IpAddress &addr, uint8_t plen, VlanNhRoute *data)
static void AddGatewayRouteReq(const Peer *peer, const string &vrf_name, const Ip4Address &dst_addr, uint8_t plen, const AddressList &gw_list, const VnListType &vn_name, uint32_t label, const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &communities, bool native_encap)
Patricia::Tree< InetUnicastRouteEntry, &InetUnicastRouteEntry::rtnode_, InetUnicastRouteEntry::Rtkey > InetRouteTree
void AddVhostMplsRoute(const IpAddress &vhost_addr, const Peer *peer)
static DBTableBase * CreateTable(DB *db, const std::string &name)
static char ByteValue(const InetUnicastRouteEntry *key, std::size_t i)
static std::size_t BitLength(const InetUnicastRouteEntry *key)
virtual void SetKey(const DBRequestKey *key)
virtual std::string ToString() const
virtual bool ReComputePathAdd(AgentPath *path)
bool IpamSubnetRouteAvailable() const
virtual bool DBEntrySandesh(Sandesh *sresp, bool stale) const
DISALLOW_COPY_AND_ASSIGN(InetUnicastRouteEntry)
virtual Agent::RouteTableType GetTableType() const
InetUnicastRouteEntry(VrfEntry *vrf, const IpAddress &addr, uint8_t plen, bool is_multicast)
uint8_t prefix_length() const
!
virtual const std::string GetAddressString() const
virtual AgentPath * FindPathUsingKeyData(const AgentRouteKey *key, const AgentRouteData *data) const
virtual KeyPtr GetDBRequestKey() const
InetUnicastRouteEntry * GetIpamSuperNetRoute() const
virtual const std::string GetSourceAddressString() const
void set_addr(IpAddress addr)
bool UpdateIpamHostFlags(bool ipam_host_route)
virtual bool ReComputePathDeletion(AgentPath *path)
bool UpdateRouteFlags(bool ipam_subnet_route, bool ipam_host_route, bool proxy_arp)
virtual int CompareTo(const Route &rhs) const
AgentPath * FindEvpnPathUsingKeyData(const AgentRouteKey *key, const AgentRouteData *data) const
const IpAddress & addr() const
virtual AgentRouteKey * Clone() const
virtual string ToString() const
DISALLOW_COPY_AND_ASSIGN(InetUnicastRouteKey)
uint8_t plen() const
InetUnicastRouteKey(const Peer *peer, const string &vrf_name, const IpAddress &dip, uint8_t plen)
AgentRoute * AllocRouteEntry(VrfEntry *vrf, bool is_multicast) const
virtual Agent::RouteTableType GetRouteTableType()
bool Remove(D *data)
Definition: patricia.h:96
D * FindNext(const D *data)
Definition: patricia.h:104
bool Insert(D *data)
Definition: patricia.h:92
Definition: peer.h:45
Definition: route.h:15
static const char * kInterface
Definition: vm_interface.h:371
Definition: vrf.h:90
const Peer * peer() const
Definition: agent_route.h:48
const std::string & vrf_name() const
Definition: agent_route.h:47
boost::uuids::uuid uuid