14 template<
class RouteTable,
class RouteEntry>
23 const std::vector<IpAddress> nh_addresses(1, dip);
24 bool is_zero_mac = dmac.
IsZero();
43 const int prefix_len, uint32_t vxlan_id,
const std::string vrf_name,
48 if (evpn_table == NULL) {
55 prefix_ip, prefix_len, vxlan_id, vrf_name, params, bgp_peer);
61 prefix_ip, prefix_len, vxlan_id, vrf_name, params, bgp_peer);
65 const int prefix_len,
const std::string vrf_name,
75 prefix_ip, prefix_len, vrf_name, path);
83 prefix_ip, prefix_len, vrf_name, path);
89 const int prefix_len, uint32_t vxlan_id,
const std::string vrf_name,
93 if (bgp_peer == NULL) {
108 tun_nh_key->rewrite_dmac(),
127 const int prefix_len, uint32_t vxlan_id,
const std::string vrf_name,
131 prefix_ip, prefix_len, 0);
156 const int prefix_len,
const std::string vrf_name,
164 std::string origin_vn =
"";
166 nh_req.
key.reset(tun_nh_key);
186 const int prefix_len,
const std::string vrf_name,
205 template<
class RouteTable,
class RouteEntry>
208 if (table == NULL || agent == NULL || route == NULL) {
215 for (Route::PathList::const_iterator it =
216 route->GetPathList().begin();
217 it != route->GetPathList().end(); it++) {
219 static_cast<const AgentPath *
>(it.operator->());
220 if (tm_path == NULL || tm_path->
peer() == NULL) {
228 }
else if (tm_path->
nexthop() &&
void XmppAdvertiseEvpnTunnel(EvpnAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters ¶ms, const Peer *bgp_peer)
Advertises in the EVPN table a tunnel route that arrived via XMPP channel. Must be called only from X...
EvpnRouteEntry * FindRoute(const MacAddress &mac, const IpAddress &ip_addr, uint32_t plen, uint32_t ethernet_tag)
const TagList & tag_list_
A list of tags.
const VnListType & dest_vn_list() const
const Peer * local_vm_export_peer() const
const TagList & tag_list() const
const PathPreference & path_preference() const
AgentRouteTable * GetEvpnRouteTable() const
VrfEntry * FindVrfFromName(const string &name)
static MacAddress NbComputeMac(const Ip4Address &compute_ip, const Agent *agent)
Returns the MAC address for the IP of a given neighbouring compute.
boost::asio::ip::address IpAddress
std::unique_ptr< DBRequestData > data
const Ip4Address * GetDip() const
A structure to hold path parameters during the transfer (routes leaking) of data between VRF instance...
uint64_t sequence_number_
An ID of sequence.
const SecurityGroupList & sg_list_
A list of security groups.
void XmppAdvertiseInetTunnel(InetUnicastAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters ¶ms, const Peer *bgp_peer)
Advertises in the Inet table a tunnel route that arrived via XMPP channel. Must be called only from X...
const std::string & fabric_vrf_name() const
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...
const Type GetType() const
void CopyPathToInetTable(const AgentPath *path, const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, const RouteParameters ¶ms, InetUnicastAgentRouteTable *inet_table)
Copies the path to the prefix address into the EVPN table with the given Peer. The function is used d...
NextHop * nexthop() const
VrfEntry * vrf_entry() const
Agent * agent_
A pointer to the Agent instance.
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 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)
const VnListType & vn_list_
A list of path destination virtual networks used in policy lookups.
InetUnicastAgentRouteTable * GetInetUnicastRouteTable(const IpAddress &addr) const
Ip4Address router_id() const
std::unique_ptr< DBRequestKey > key
const Peer * peer() const
const IpAddress & nh_addr_
A nexthop IP address of the tunnel. Contains first IP address of nh_addresses_ in case of a composite...
void XmppAdvertiseEvpnInterface(EvpnAgentRouteTable *inet_table, const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters ¶ms, const Peer *bgp_peer)
Advertises in the EVPN table an interface route that arrived via XMPP channel. Must be called only fr...
static const AgentPath * LocalVmExportInterface(Agent *agent, RouteTable *table, RouteEntry *route)
uint64_t peer_sequence_number() const
const MacAddress & rewrite_dmac() const
boost::asio::ip::address_v4 Ip4Address
const PathPreference & path_preference_
A reference to the PathPreference of the path.
VrfTable * vrf_table() const
static void CopyInterfacePathToEvpnTable(const AgentPath *path, const IpAddress &prefix_ip, const uint32_t plen, const Peer *peer, const RouteParameters ¶ms, EvpnAgentRouteTable *evpn_table)
Copies the path to the prefix address into the EVPN table with the given Peer. The function is used d...
const MacAddress & nh_mac_
A nexthop MAC address (usually it is a MAC of the router).
const CommunityList & communities_
A list of communities.
void XmppAdvertiseEvpnRoute(const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters ¶ms, const Peer *bgp_peer)
Advertises an EVPN route received using XMPP channel.
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...
const CommunityList & communities() const
const EcmpLoadBalance & ecmp_load_balance_
A reference to EcmpLoadBalance of the path.
TunnelNHKey * AllocateTunnelNextHopKey(const IpAddress &dip, const MacAddress &dmac) const
XMPP Advertising functions.
static const Peer * routing_vrf_vxlan_bgp_peer_
A pointer to the Peer where all BGP routes are stored.
static TypeBmap VxlanType()
void XmppAdvertiseInetRoute(const IpAddress &prefix_ip, const int prefix_len, uint32_t vxlan_id, const std::string vrf_name, const RouteParameters ¶ms, const Peer *bgp_peer)
Advertises an Inet route received using XMPP channel.
const SecurityGroupList & sg_list() const
uint32_t vxlan_id() const
const EcmpLoadBalance & ecmp_load_balance() const
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)