5 #ifndef vnsw_inet_unicast_route_hpp
6 #define vnsw_inet_unicast_route_hpp
74 virtual std::string
ToString()
const;
100 Ip4Address::bytes_type addr_bytes;
102 char res =
static_cast<char>(addr_bytes[i]);
105 Ip6Address::bytes_type addr_bytes;
107 volatile char res =
static_cast<char>(addr_bytes[i]);
159 return "Inet4UnicastAgentRouteTable";
162 return "Inet4MplsAgentRouteTable";
165 return "Inet6UnicastAgentRouteTable";
173 tree_.
Insert(static_cast<InetUnicastRouteEntry *>(rt));
176 tree_.
Remove(static_cast<InetUnicastRouteEntry *>(rt));
179 const std::string &context);
209 const std::string &dest_vn_name,
227 bool is_health_check_service,
229 const std::string &intf_name =
"",
230 bool is_learnt_route =
false);
243 bool is_local,
bool is_health_check_service,
244 const std::string &intf_name,
247 bool is_learnt_route =
false);
259 uint32_t label,
const VnListType &dest_vn_list,
266 uint32_t label,
const VnListType &dest_vn_list,
287 static void AddArpReq(
const string &route_vrf_name,
289 const string &nh_vrf_name,
296 const string &route_vrf_name,
299 const string &nh_vrf_name,
308 const string &route_vrf_name,
311 const string &nh_vrf_name,
323 const uint32_t label,
bool policy,
324 const std::string &vn_name,
332 const string &interface,
339 const string &vn_name,
bool policy,
341 bool ipam_host_route =
true);
345 const string &vn_name,
bool policy,
350 const string &vn_name,
bool policy,
355 const std::string &vn_name,
361 const string &vn_name);
403 uint8_t plen,
const std::string &vn_name);
410 const std::string &vn_name);
421 uint16_t plen)
const;
435 const std::string& origin_vn =
"");
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
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)
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)
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.
Agent::RouteTableType type_
AgentRoute * AllocRouteEntry(VrfEntry *vrf, bool is_multicast) const
boost::asio::ip::address IpAddress
DISALLOW_COPY_AND_ASSIGN(InetMplsUnicastRouteKey)
InetUnicastRouteKey(const Peer *peer, const string &vrf_name, const IpAddress &dip, uint8_t plen)
std::vector< int > SecurityGroupList
bool is_multicast() const
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)
InetUnicastRouteEntry * FindRoute(const IpAddress &ip)
virtual ~InetUnicastRouteEntry()
uint8_t prefix_length_
The prefix length.
virtual bool ReComputePathDeletion(AgentPath *path)
std::unique_ptr< DBRequestKey > KeyPtr
Base class for all Route entries in agent.
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)
DBTableWalker::WalkId walkid_
void AddVrouterSubnetRoute(const IpAddress &dst_addr, uint8_t plen)
virtual ~InetUnicastAgentRouteTable()
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.
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)
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)
bool ipam_host_route() const
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
const std::string & name() const
std::vector< std::string > CommunityList
std::vector< Ip4Address > AddressList
void TraverseHostRoutesInSubnet(InetUnicastRouteEntry *rt, const Peer *peer)
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
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)
boost::asio::ip::address_v4 Ip4Address
D * FindNext(const D *data)
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
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
const std::string & vrf_name() const
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)
virtual ~InetMplsUnicastRouteKey()
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)
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
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)
virtual ~InetUnicastRouteKey()
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...
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