14 : io_(io), key_(key), nh_vrf_(vrf), state_(state), retry_count_(0),
15 handler_(handler), arp_timer_(NULL), interface_(itf) {
94 if (retry_count_ < arp_proto->max_retries()) {
98 std::vector<Ip4Address> gateway_list =
99 handler_->agent()->vhost_default_gateway();
101 if (std::find(gateway_list.begin(), gateway_list.end(), ip) !=
102 gateway_list.end()) {
125 ArpNHKey nh_key(vrf_name, ip,
false);
127 FindActiveEntry(&nh_key));
150 if (!gw_ip.is_unspecified() && gw_ip.is_v4()) {
151 handler_->SendArp(ARPOP_REQUEST, smac,
152 gw_ip.to_v4().to_ulong(),
153 smac, vmi->
vm_mac(), gw_ip.to_v4().to_ulong(),
156 if (!dns_ip.is_unspecified() && dns_ip.is_v4() &&
158 handler_->SendArp(ARPOP_REQUEST, smac,
159 dns_ip.to_v4().to_ulong(),
160 smac, vmi->
vm_mac(), dns_ip.to_v4().to_ulong(),
217 if (agent->
is_l3mh() ==
true) {
232 handler_->SendArp(ARPOP_REQUEST, smac, ip.to_ulong(),
250 FindActiveEntry(&nh_key));
253 if (arp_nh && arp_nh->GetResolveState() &&
261 handler_->agent()->local_peer(), vrf_name, ip, 32);
263 FindActiveEntry(rt_key);
280 if (entry && (anh = entry->GetActiveNextHop()) != NULL) {
282 sg = entry->GetActivePath()->sg_list();
283 tag = entry->GetActivePath()->tag_list();
284 vn_list = entry->GetActivePath()->dest_vn_list();
295 for (InterfaceList::size_type i = 0; i != vintf->
parent_list().size(); i++) {
297 handler_->agent()->fabric_inet4_unicast_table()->ArpRoute(
306 handler_->agent()->fabric_inet4_unicast_table()->ArpRoute(
321 FindActiveEntry(&nh_key));
334 handler_->agent()->fabric_inet4_unicast_table()->ArpRoute(
348 handler_->agent()->fabric_inet4_unicast_table()->ArpRoute(
351 32, policy, vnlist, sg, tag);
uint32_t ip_fabric_interface_index() const
IpAddress GetDnsFromIpam(const IpAddress &ip) const
const MacAddress & vm_mac() const
void HandleArpReply(const MacAddress &)
void StartTimer(uint32_t timeout, uint32_t mtype)
InetUnicastRouteEntry * FindLPM(const IpAddress &ip)
const ArpKey & key() const
void Resync(bool policy, const VnListType &vnlist, const SecurityGroupList &sg, const TagList &tag)
VrfEntry * FindVrfFromName(const string &name)
const uint32_t id() const
bool AddArpEntry(ArpEntry *entry)
boost::asio::ip::address IpAddress
const MacAddress & GetVifMac(const Agent *) const
std::vector< int > SecurityGroupList
InetUnicastAgentRouteTable * GetInet4UnicastRouteTable() const
const string & GetName() const
boost::asio::io_context & io_
IpAddress GetServiceIp(const IpAddress &ip) const
ArpProto * GetArpProto() const
Base class for all Route entries in agent.
AddressList ip_fabric_intf_addr_list() const
std::string ToString() const
void IncrementStatsResolved()
void AddArpRoute(bool resolved)
const std::string & fabric_vrf_name() const
ArpEntry(boost::asio::io_context &io, ArpHandler *handler, ArpKey &key, const VrfEntry *vrf, State state, const Interface *itf)
static void Delete(const Peer *peer, const string &vrf_name, const IpAddress &addr, uint8_t plen)
static TaskScheduler * GetInstance()
Ip4Address router_id() const
int CompareTo(const MacAddress &rhs, int len=0) const
void IncrementStatsMaxRetries()
uint32_t aging_timeout() const
boost::intrusive_ptr< ArpHandler > handler_
ArpEntry * FindArpEntry(const ArpKey &key)
static const MacAddress & BroadcastMac()
static const std::set< std::string > & NullStringList()
const uint32_t vrf_id() const
std::set< std::string > VnListType
static Timer * CreateTimer(boost::asio::io_context &service, const std::string &name, int task_id=Timer::GetTimerTaskId(), int task_instance=Timer::GetTimerInstanceId(), bool delete_on_completion=false)
boost::asio::ip::address_v4 Ip4Address
bool TimerExpiry(ArpKey &key, uint32_t timer_type, const Interface *itf)
VrfTable * vrf_table() const
bool router_id_configured()
#define ARP_TRACE(obj,...)
VmInterface::VmiType vmi_type() const
bool Start(int time, Handler handler, ErrorHandler error_handler=NULL)
static const uint32_t kInvalidIndex
uint32_t retry_timeout() const
bool PolicyEnabled() const
void HandleDerivedArpRequest()
const MacAddress & mac_address() const
InterfaceList parent_list() const
static const uint32_t kGratRetryTimeout
const Interface * parent() const
const MacAddress & ip_fabric_interface_mac() const
IpAddress GetGatewayFromIpam(const IpAddress &ip) const
static bool DeleteTimer(Timer *Timer)
std::vector< int > TagList
InterfaceConstRef interface_