OpenSDN source code
vxlan_xmpp_routes.cc
Go to the documentation of this file.
1 #include <oper/operdb_init.h>
2 #include <oper/route_common.h>
3 #include <oper/vrf.h>
4 #include <oper/bridge_route.h>
6 #include <oper/evpn_route.h>
7 #include <oper/agent_route.h>
8 #include <oper/vn.h>
9 #include <oper/vrf.h>
12 #include <oper/tunnel_nh.h>
13 #include <oper/bgp_as_service.h>
14 
15 template<class RouteTable, class RouteEntry>
16 static const AgentPath *LocalVmExportInterface(Agent* agent,
17  RouteTable *table, RouteEntry *route);
18 
20  const IpAddress& dip, const MacAddress& dmac) const {
21 
22  const Ip4Address rtr_dip = dip.to_v4();
23 
24  const std::vector<IpAddress> nh_addresses(1, dip);
25  bool is_zero_mac = dmac.IsZero();
26 
27  MacAddress rtr_dmac;
28  if (!is_zero_mac) {
29  rtr_dmac = dmac;
30  } else {
31  rtr_dmac = NbComputeMac(rtr_dip, agent_);
32  }
33 
34  TunnelNHKey *tun_nh_key = new TunnelNHKey(agent_->fabric_vrf_name(),
35  agent_->router_id(),
36  rtr_dip,
37  false,
39  rtr_dmac);
40  return tun_nh_key;
41 }
42 
44 const int prefix_len, uint32_t vxlan_id, const std::string vrf_name,
45 const RouteParameters& params, const Peer *bgp_peer,
46 const std::vector<std::string> &peer_sources) {
47  VrfEntry* vrf = agent_->vrf_table()->FindVrfFromName(vrf_name);
48  EvpnAgentRouteTable *evpn_table =
49  dynamic_cast<EvpnAgentRouteTable*>(vrf->GetEvpnRouteTable());
50  if (evpn_table == NULL) {
51  return;
52  }
53 
54  // If route is a tunnel
55  if (agent_->router_id() != params.nh_addr_.to_v4()) {
56  XmppAdvertiseEvpnTunnel(evpn_table,
57  prefix_ip, prefix_len, vxlan_id, vrf_name, params, bgp_peer);
58  return;
59  }
60 
61  // Or this is an interface
62  XmppAdvertiseEvpnInterface(evpn_table,
63  prefix_ip, prefix_len, vxlan_id, vrf_name, params, bgp_peer, peer_sources);
64 }
65 
67  const int prefix_len, const std::string vrf_name,
68  const AgentPath* path) {
69 
70  VrfEntry* vrf = agent_->vrf_table()->FindVrfFromName(vrf_name);
71  InetUnicastAgentRouteTable *inet_table =
72  vrf->GetInetUnicastRouteTable(prefix_ip);
73 
74  if (path->nexthop() && path->nexthop()->GetType() ==
76  XmppAdvertiseInetTunnel(inet_table,
77  prefix_ip, prefix_len, vrf_name, path);
78  return;
79  }
80 
81  if (path->nexthop() &&
82  (path->nexthop()->GetType() == NextHop::INTERFACE ||
83  path->nexthop()->GetType() == NextHop::COMPOSITE)) {
85  prefix_ip, prefix_len, vrf_name, path);
86  }
87 }
88 
90  EvpnAgentRouteTable *evpn_table, const IpAddress& prefix_ip,
91  const int prefix_len, uint32_t vxlan_id, const std::string vrf_name,
92  const RouteParameters& params, const Peer *peer
93 ) {
94  const BgpPeer *bgp_peer = dynamic_cast<const BgpPeer*>(peer);
95  if (bgp_peer == NULL) {
96  return;
97  }
99  std::unique_ptr<TunnelNHKey> tun_nh_key (AllocateTunnelNextHopKey(
100  params.nh_addr_, params.nh_mac_));
101 
102  ControllerVmRoute *data =
103  ControllerVmRoute::MakeControllerVmRoute(dynamic_cast<const BgpPeer*>(bgp_peer),
105  agent_->router_id(),
106  vrf_name,
107  tun_nh_key->dip(),
109  vxlan_id,
110  tun_nh_key->rewrite_dmac(),
111  params.vn_list_,
112  params.sg_list_,
113  params.tag_list_,
114  params.path_preference_,
115  true,
116  EcmpLoadBalance(),
117  false);
118  evpn_table->AddRemoteVmRouteReq(bgp_peer,
119  vrf_name,
120  MacAddress(),
121  prefix_ip,
122  prefix_len,
123  0, // ethernet_tag is zero for Type5
124  data);
125 }
126 
128  EvpnAgentRouteTable *evpn_table, const IpAddress& prefix_ip,
129  const int prefix_len, uint32_t vxlan_id, const std::string vrf_name,
130  const RouteParameters& params, const Peer *bgp_peer, const NextHop *nh
131 ) {
132  const InterfaceNH *intf_nh = dynamic_cast<const InterfaceNH *>(nh);
133  const Interface *intf = intf_nh->GetInterface();
134  if (intf->type() != Interface::VM_INTERFACE) {
135  return;
136  }
137  const VmInterface *vm_intf = dynamic_cast<const VmInterface*>
138  (intf);
139  DBEntryBase::KeyPtr tintf_key_ptr = vm_intf->GetDBRequestKey();
140  const VmInterfaceKey* intf_key_ptr =
141  dynamic_cast<const VmInterfaceKey *>(tintf_key_ptr.get());
142 
143  LocalVmRoute *loc_rt_ptr = new LocalVmRoute(
144  *intf_key_ptr,
145  MplsTable::kInvalidLabel, // mpls_label
146  vxlan_id,
147  false,
148  params.vn_list_,
149  intf_nh->GetFlags(), // flags
150  params.sg_list_,
151  params.tag_list_,
152  params.communities_,
153  params.path_preference_,
154  Ip4Address(0),
155  params.ecmp_load_balance_,
156  false,
157  false,
158  params.sequence_number_,
159  false,
160  false); // native_encap
161  loc_rt_ptr->set_tunnel_bmap(TunnelType::VxlanType());
162 
163  {
165 
166  req.key.reset(new EvpnRouteKey(bgp_peer,
167  evpn_table->vrf_entry()->GetName(),
168  MacAddress(),
169  prefix_ip,
170  prefix_len,
171  0));
172  req.data.reset(loc_rt_ptr);
173  evpn_table->Enqueue(&req);
174  }
175 }
176 
178  EvpnAgentRouteTable *evpn_table, const IpAddress& prefix_ip,
179  const int prefix_len, uint32_t vxlan_id, const std::string vrf_name,
180  const RouteParameters& params, const Peer *bgp_peer,
181  ComponentNHKeyList &comp_nh_list ) {
183  const bool comp_nh_policy = true;
184  CompositeNHKey *new_comp_nh_key =
186  comp_nh_policy, comp_nh_list, vrf_name);
187 
188  nh_req.key.reset(new_comp_nh_key);
189  nh_req.data.reset(new CompositeNHData());
190  const BgpPeer *bgp_peer_ecmp = dynamic_cast<const BgpPeer*>(bgp_peer);
191  std::stringstream prefix_str;
192  prefix_str << prefix_ip.to_string();
193  prefix_str << "/";
194  prefix_str << prefix_len;
195 
197  bgp_peer_ecmp,
198  params.vn_list_,
199  params.ecmp_load_balance_,
200  params.tag_list_,
201  params.sg_list_,
202  params.path_preference_,
204  nh_req,
205  prefix_str.str(),
206  evpn_table->vrf_name());
207 
209  rt_data->cloned_local_path_list().begin();
210  while (iter != rt_data->cloned_local_path_list().end()) {
211  evpn_table->AddClonedLocalPathReq(bgp_peer_ecmp, vrf_name,
212  MacAddress(), prefix_ip, 0, (*iter));
213  iter++;
214  }
215 
216  evpn_table->AddRemoteVmRouteReq(bgp_peer_ecmp,
217  vrf_name, MacAddress(),
218  prefix_ip,
219  prefix_len,
220  0, // ethernet tag is 0 for VxLAN
221  rt_data);
222 }
223 
225  EvpnAgentRouteTable *evpn_table, const IpAddress& prefix_ip,
226  const int prefix_len, uint32_t vxlan_id, const std::string vrf_name,
227  const RouteParameters& params, const Peer *bgp_peer,
228  const std::vector<std::string> &peer_sources
229 ) {
230  const NextHop *first_intf_nh = nullptr;
231  NextHopKey *nh_key = nullptr;
232  // Create a new composite
233  ComponentNHKeyList new_comp_nh_list;
234  for (auto &nexthop_addr : peer_sources) {
235  IpAddress nh_ip;
236  boost::system::error_code ec;
237  int nh_ip_len;
238  if (is_ipv4_string(nexthop_addr)) {
239  nh_ip = Ip4Address::from_string(ipv4_prefix(nexthop_addr), ec);
240  nh_ip_len = ipv4_prefix_len(nexthop_addr);
241  } else if (is_ipv6_string(nexthop_addr)) {
242  nh_ip = Ip6Address::from_string(ipv6_prefix(nexthop_addr), ec);
243  nh_ip_len = ipv6_prefix_len(nexthop_addr);
244  } else {
245  LOG(ERROR, "Error in VxlanRoutingManager::AddInterfaceComponentToList"
246  << ", nexthop_addr = " << nexthop_addr
247  << " is not an IPv4 or IPv6 prefix");
248  return;
249  }
250  if (ec) {
251  continue;
252  }
253  EvpnRouteEntry *route =evpn_table->FindRoute(MacAddress(),
254  nh_ip, nh_ip_len, 0);
255  const AgentPath *loc_path =
256  LocalVmExportInterface(agent_, evpn_table, route);
257  if (loc_path == nullptr) {
258  continue;
259  }
260  if (loc_path->nexthop() == nullptr) {
261  continue;
262  }
263  if (IsBgpaasInterfaceNexthop(agent_, loc_path->nexthop())) {
264  if (first_intf_nh == NULL) {
265  first_intf_nh = loc_path->nexthop();
266  }
267  DBEntryBase::KeyPtr key = loc_path->nexthop()->
268  GetDBRequestKey();
269  nh_key = static_cast<NextHopKey *>(key.release());
270 
271  std::unique_ptr<const NextHopKey> nh_key_ptr(nh_key);
272  ComponentNHKeyPtr component_nh_key(new ComponentNHKey(
273  MplsTable::kInvalidLabel, std::move(nh_key_ptr)));
274  new_comp_nh_list.push_back(component_nh_key);
275  } else if (IsBgpaasCompositeNexthop(agent_, loc_path->nexthop())) {
276  const CompositeNH *composite_nh = dynamic_cast<const CompositeNH*>(
277  loc_path->nexthop());
278  const ComponentNHList &components = composite_nh->component_nh_list();
279  for (auto &component : components) {
280  if (component.get() &&
281  component->nh() &&
282  component->nh()->GetType() == NextHop::INTERFACE) {
283  if (first_intf_nh == nullptr) {
284  first_intf_nh = component->nh();
285  }
286  DBEntryBase::KeyPtr key = component->nh()->
287  GetDBRequestKey();
288  nh_key = static_cast<NextHopKey *>(key.release());
289 
290  std::unique_ptr<const NextHopKey> nh_key_ptr(nh_key);
291  ComponentNHKeyPtr component_nh_key(new ComponentNHKey(
292  MplsTable::kInvalidLabel, std::move(nh_key_ptr)));
293  new_comp_nh_list.push_back(component_nh_key);
294  }
295  }
296  }
297  }
298 
299  if (new_comp_nh_list.size() < 1) {
300  return;
301  } else if (new_comp_nh_list.size() == 1) {
302  XmppAdvertiseEvpnBgpaasInterface(evpn_table, prefix_ip, prefix_len,
303  vxlan_id, vrf_name, params, bgp_peer, first_intf_nh);
304  } else {
305  XmppAdvertiseEvpnBgpaasComposite(evpn_table, prefix_ip, prefix_len,
306  vxlan_id, vrf_name, params, bgp_peer, new_comp_nh_list);
307  }
308 
309 }
310 
312  EvpnAgentRouteTable *evpn_table, const IpAddress& prefix_ip,
313  const int prefix_len, uint32_t vxlan_id, const std::string vrf_name,
314  const RouteParameters& params, const Peer *bgp_peer,
315  const std::vector<std::string> &peer_sources ) {
316  EvpnRouteEntry *route = evpn_table->FindRoute(MacAddress(),
317  prefix_ip, prefix_len, 0);
318  if (RoutePrefixIsEqualTo(route, prefix_ip, prefix_len) == false) {
319  XmppAdvertiseEvpnBgpaas(evpn_table, prefix_ip, prefix_len, vxlan_id,
320  vrf_name, params, bgp_peer, peer_sources);
321  return;
322  }
323  const AgentPath * path =
324  LocalVmExportInterface(agent_, evpn_table, route);
325 
326  if (!path ) {
327  XmppAdvertiseEvpnBgpaas(evpn_table, prefix_ip, prefix_len, vxlan_id,
328  vrf_name, params, bgp_peer, peer_sources);
329  return;
330  }
331 
333  prefix_ip,
334  prefix_len,
335  bgp_peer,
336  RouteParameters(IpAddress(), // NH address, not needed here
337  MacAddress(),
338  params.vn_list_,
339  params.sg_list_,
340  params.communities_,
341  params.tag_list_,
342  params.path_preference_,
343  params.ecmp_load_balance_,
344  params.sequence_number_),
345  evpn_table);
346 }
347 
349  InetUnicastAgentRouteTable *inet_table, const IpAddress& prefix_ip,
350  const int prefix_len, const std::string vrf_name,
351  const AgentPath* path) {
352 
354  TunnelNH *tun_nh = dynamic_cast<TunnelNH*>(path->nexthop());
355 
356  TunnelNHKey *tun_nh_key = AllocateTunnelNextHopKey(*(tun_nh->GetDip()),
357  tun_nh->rewrite_dmac());
358  std::string origin_vn = "";
359 
360  nh_req.key.reset(tun_nh_key);
361  nh_req.data.reset(new TunnelNHData);
362 
363  inet_table->AddEvpnRoutingRoute(prefix_ip,
364  prefix_len,
365  inet_table->vrf_entry(),
367  path->sg_list(),
368  path->communities(),
369  path->path_preference(),
370  path->ecmp_load_balance(),
371  path->tag_list(),
372  nh_req,
373  path->vxlan_id(),
374  path->dest_vn_list(),
375  origin_vn);
376 }
377 
379  InetUnicastAgentRouteTable *inet_table, const IpAddress& prefix_ip,
380  const int prefix_len, const std::string vrf_name,
381  const AgentPath* path) {
382 
383  CopyPathToInetTable(path,
384  prefix_ip,
385  prefix_len,
388  MacAddress(),
389  path->dest_vn_list(),
390  path->sg_list(),
391  path->communities(),
392  path->tag_list(),
393  path->path_preference(),
394  path->ecmp_load_balance(),
395  path->peer_sequence_number()),
396  inet_table);
397 }
398 
399 template<class RouteTable, class RouteEntry>
401  RouteTable *table, RouteEntry *route) {
402  if (table == NULL || agent == NULL || route == NULL) {
403  return NULL;
404  }
405 
406  const AgentPath *tm_path = NULL;
407  const AgentPath *rt_path = NULL;
408 
409  for (Route::PathList::const_iterator it =
410  route->GetPathList().begin();
411  it != route->GetPathList().end(); it++) {
412  tm_path =
413  static_cast<const AgentPath *>(it.operator->());
414  if (tm_path == NULL || tm_path->peer() == NULL) {
415  continue;
416  }
417  if (tm_path->peer()->GetType() ==
418  agent->local_vm_export_peer()->GetType()) {
419  if (tm_path->nexthop() &&
420  tm_path->nexthop()->GetType() == NextHop::INTERFACE) {
421  rt_path = tm_path;
422  } else if (tm_path->nexthop() &&
423  tm_path->nexthop()->GetType() == NextHop::COMPOSITE) {
424  return tm_path;
425  }
426  }
427  }
428  return rt_path;
429 }
430 
431 //
432 //END-OF-FILE
433 //
434 
boost::asio::ip::address IpAddress
Definition: address.h:13
boost::asio::ip::address_v4 Ip4Address
Definition: address.h:14
uint64_t peer_sequence_number() const
Definition: agent_path.h:415
const VnListType & dest_vn_list() const
Definition: agent_path.h:258
NextHop * nexthop() const
Definition: agent_path.cc:87
const EcmpLoadBalance & ecmp_load_balance() const
Definition: agent_path.h:365
const PathPreference & path_preference() const
Definition: agent_path.h:329
const SecurityGroupList & sg_list() const
Definition: agent_path.h:248
uint32_t vxlan_id() const
Definition: agent_path.h:265
const Peer * peer() const
Definition: agent_path.h:263
const TagList & tag_list() const
Definition: agent_path.h:249
const CommunityList & communities() const
Definition: agent_path.h:250
const std::string & vrf_name() const
Definition: agent_route.cc:455
VrfEntry * vrf_entry() const
Definition: agent_route.cc:459
Definition: agent.h:360
VrfTable * vrf_table() const
Definition: agent.h:487
const Peer * local_vm_export_peer() const
Definition: agent.h:1042
const std::string & fabric_vrf_name() const
Definition: agent.h:905
Ip4Address router_id() const
Definition: agent.h:668
const ComponentNHList & component_nh_list() const
Definition: nexthop.h:1869
ClonedLocalPathList::iterator ClonedLocalPathListIter
ClonedLocalPathList & cloned_local_path_list()
static ControllerVmRoute * MakeControllerVmRoute(const BgpPeer *peer, const string &default_vrf, const Ip4Address &router_id, const string &vrf_name, const Ip4Address &tunnel_dest, TunnelType::TypeBmap bmap, uint32_t label, MacAddress rewrite_dmac, const VnListType &dest_vn_list, const SecurityGroupList &sg_list, const TagList &tag_list, const PathPreference &path_preference, bool ecmp_suppressed, const EcmpLoadBalance &ecmp_load_balance, bool etree_leaf)
std::unique_ptr< DBRequestKey > KeyPtr
Definition: db_entry.h:25
bool Enqueue(DBRequest *req)
Definition: db_table.cc:194
void AddClonedLocalPathReq(const Peer *peer, const string &vrf_name, const MacAddress &mac, const IpAddress &ip_addr, uint32_t ethernet_tag, ClonedLocalPath *data)
EvpnRouteEntry * FindRoute(const MacAddress &mac, const IpAddress &ip_addr, uint32_t plen, uint32_t ethernet_tag)
static void AddRemoteVmRouteReq(const Peer *peer, const std::string &vrf_name, const MacAddress &mac, const IpAddress &ip_addr, uint32_t plen, uint32_t ethernet_tag, AgentRouteData *data)
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="")
const Interface * GetInterface() const
Definition: nexthop.h:1293
uint8_t GetFlags() const
Definition: nexthop.h:1300
@ VM_INTERFACE
Definition: interface.h:35
Type type() const
Definition: interface.h:112
void set_tunnel_bmap(TunnelType::TypeBmap bmap)
Definition: agent_path.h:679
bool IsZero() const
Definition: mac_address.cc:29
static const uint32_t kInvalidLabel
Definition: mpls.h:101
@ COMPOSITE
Definition: nexthop.h:354
@ INTERFACE
Definition: nexthop.h:351
@ TUNNEL
Definition: nexthop.h:352
Type GetType() const
Definition: nexthop.h:405
Definition: peer.h:44
const Type GetType() const
Definition: peer.h:87
const Ip4Address * GetDip() const
Definition: tunnel_nh.h:37
const MacAddress & rewrite_dmac() const
Definition: tunnel_nh.h:41
static TypeBmap VxlanType()
Definition: nexthop.h:311
KeyPtr GetDBRequestKey() const
Definition: vrf.h:86
const string & GetName() const
Definition: vrf.h:100
InetUnicastAgentRouteTable * GetInetUnicastRouteTable(const IpAddress &addr) const
Definition: vrf.cc:575
AgentRouteTable * GetEvpnRouteTable() const
Definition: vrf.cc:330
VrfEntry * FindVrfFromName(const string &name)
Definition: vrf.cc:873
static void CopyInterfacePathToEvpnTable(const AgentPath *path, const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, const RouteParameters &params, EvpnAgentRouteTable *evpn_table)
Copies the path to the prefix address into the EVPN table with the given Peer. The function is used d...
static bool RoutePrefixIsEqualTo(const EvpnRouteEntry *route, const IpAddress &prefix_ip, const uint32_t prefix_len)
Determines whether route prefix in the EVPN route is equal to the given pair of prefix IP address and...
void XmppAdvertiseInetInterfaceOrComposite(InetUnicastAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, const std::string vrf_name, const AgentPath *path)
Advertises in the Inet table an interface route that arrived via XMPP channel. Must be called only fr...
friend class ControllerEcmpRoute
Allows ControllerEcmpRoute to use private members of this class.
static bool is_ipv4_string(const std::string &prefix_str)
Determines whether the address string contains an IPv4 address as substring or not.
static std::string ipv6_prefix(const std::string &prefix_str)
Extracts an IPv6 address string from the prefix string.
void XmppAdvertiseEvpnBgpaasInterface(EvpnAgentRouteTable *evpn_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer, const NextHop *nh)
void XmppAdvertiseEvpnRoute(const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer, const std::vector< std::string > &peer_sources)
Advertises an EVPN route received using XMPP channel.
void XmppAdvertiseInetTunnel(InetUnicastAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
Advertises in the Inet table a tunnel route that arrived via XMPP channel. Must be called only from X...
void XmppAdvertiseEvpnTunnel(EvpnAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
Advertises in the EVPN table a tunnel route that arrived via XMPP channel. Must be called only from X...
static const Peer * routing_vrf_vxlan_bgp_peer_
A pointer to the Peer where all BGP routes are stored.
void XmppAdvertiseEvpnBgpaasComposite(EvpnAgentRouteTable *evpn_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer, ComponentNHKeyList &comp_nh_list)
TunnelNHKey * AllocateTunnelNextHopKey(const IpAddress &dip, const MacAddress &dmac) const
XMPP Advertising functions.
static uint32_t ipv4_prefix_len(const std::string &prefix_str)
Extracts length of IPv4 subnet address from the prefix string.
static MacAddress NbComputeMac(const Ip4Address &compute_ip, const Agent *agent)
Returns the MAC address for the IP of a given neighbouring compute.
Agent * agent_
A pointer to the Agent instance.
void CopyPathToInetTable(const AgentPath *path, const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, const RouteParameters &params, InetUnicastAgentRouteTable *inet_table)
Copies the path to the prefix address into the EVPN table with the given Peer. The function is used d...
void XmppAdvertiseEvpnInterface(EvpnAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer, const std::vector< std::string > &peer_sources)
Advertises in the EVPN table an interface route that arrived via XMPP channel. Must be called only fr...
void XmppAdvertiseEvpnBgpaas(EvpnAgentRouteTable *evpn_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer, const std::vector< std::string > &peer_sources)
void XmppAdvertiseInetRoute(const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters &params, const Peer *bgp_peer)
Advertises an Inet route received using XMPP channel.
static bool is_ipv6_string(const std::string &prefix_str)
Determines whether the address string contains an IPv6 address as substring or not.
static std::string ipv4_prefix(const std::string &prefix_str)
Extracts an IPv4 address string from the prefix string.
static uint32_t ipv6_prefix_len(const std::string &prefix_str)
Extracts length of IPv6 subnet address from the prefix string.
#define LOG(_Level, _Msg)
Definition: logging.h:33
std::vector< ComponentNHPtr > ComponentNHList
Definition: nexthop.h:1637
boost::shared_ptr< const ComponentNHKey > ComponentNHKeyPtr
Definition: nexthop.h:1639
std::vector< ComponentNHKeyPtr > ComponentNHKeyList
Definition: nexthop.h:1641
@ LOCAL_ECMP
Definition: nexthop.h:1593
@ DB_ENTRY_ADD_CHANGE
Definition: db_table.h:38
std::unique_ptr< DBRequestKey > key
Definition: db_table.h:48
std::unique_ptr< DBRequestData > data
Definition: db_table.h:49
A structure to hold path parameters during the transfer (routes leaking) of data between VRF instance...
const EcmpLoadBalance & ecmp_load_balance_
A reference to EcmpLoadBalance of the path.
const MacAddress & nh_mac_
A nexthop MAC address (usually it is a MAC of the router).
const IpAddress & nh_addr_
A nexthop IP address of the tunnel. Contains first IP address of nh_addresses_ in case of a composite...
const TagList & tag_list_
A list of tags.
const PathPreference & path_preference_
A reference to the PathPreference of the path.
uint64_t sequence_number_
An ID of sequence.
const CommunityList & communities_
A list of communities.
const SecurityGroupList & sg_list_
A list of security groups.
const VnListType & vn_list_
A list of path destination virtual networks used in policy lookups.
static bool IsBgpaasCompositeNexthop(const Agent *agent, const NextHop *nh)
static bool IsBgpaasInterfaceNexthop(const Agent *agent, const NextHop *nh)
static const AgentPath * LocalVmExportInterface(Agent *agent, RouteTable *table, RouteEntry *route)