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