5 #ifndef vnsw_agent_icmpv6_proto_h
6 #define vnsw_agent_icmpv6_proto_h
12 #define ICMP_PKT_SIZE 1024
13 #define IPV6_ALL_NODES_ADDRESS "FF02::1"
14 #define IPV6_ALL_ROUTERS_ADDRESS "FF02::2"
15 #define PKT0_LINKLOCAL_ADDRESS "FE80::5E00:0100"
17 #define NDP_TRACE(obj, ...) \
19 Ndp##obj::TraceMsg(Icmpv6TraceBuf, __FILE__, __LINE__, ##__VA_ARGS__); \
22 #define ICMPV6_TRACE(obj, arg) \
24 std::ostringstream _str; \
26 Icmpv6##obj::TraceMsg(Icmpv6TraceBuf, __FILE__, __LINE__, _str.str()); \
100 boost::asio::io_context &
io);
334 typedef boost::intrusive_ptr<Icmpv6PathPreferenceState>
boost::asio::ip::address_v6 Ip6Address
boost::asio::ip::address IpAddress
boost::intrusive_ptr< const Interface > InterfaceConstRef
Agent supports multiple route tables - Inet-unicast (IPv4/IPv6), Inet-multicast, bridge,...
Base class for all Route entries in agent.
boost::intrusive_ptr< DBTableWalk > DBTableWalkRef
tbb::atomic< int > refcount_
static const uint32_t kTimeoutMultiplier
Icmpv6PathPreferenceState(Icmpv6VrfState *vrf_state, uint32_t vrf_id, IpAddress vm_ip_addr, uint8_t plen)
friend void intrusive_ptr_release(Icmpv6PathPreferenceState *ps)
MacAddress mac(void) const
WaitForTrafficIntfMap l3_wait_for_traffic_map_
std::map< uint32_t, InterfaceIcmpv6PathPreferenceInfo > WaitForTrafficIntfMap
friend void intrusive_ptr_add_ref(Icmpv6PathPreferenceState *ps)
Icmpv6VrfState * vrf_state_
bool IntfPresentInEvpnMap(uint32_t id)
~Icmpv6PathPreferenceState()
static const uint32_t kNSTryCount
const IpAddress & ip() const
WaitForTrafficIntfMap evpn_wait_for_traffic_map_
uint32_t IntfRetryCountInIpMap(uint32_t id)
void HandleNA(uint32_t itf)
bool SendNeighborSolicit()
bool IntfPresentInIpMap(uint32_t id)
static const uint32_t kTimeout
void SendNeighborSolicitForAllIntf(const AgentRoute *route)
uint32_t IntfRetryCountInEvpnMap(uint32_t id)
std::set< uint32_t > NDTransmittedIntfMap
static const uint32_t kMaxRetry
Icmpv6VrfState * vrf_state()
void DeleteUnsolNaEntry(NdpEntry *entry)
std::map< NdpKey, NdpEntry * >::iterator NdpIterator
DBTableBase::ListenerId vrf_table_listener_id() const
std::pair< NdpKey, NdpEntrySet > UnsolNaCachePair
Interface * ip_fabric_interface_
VmInterfaceMap vm_interfaces_
uint32_t ip_fabric_interface_index() const
void VrfNotify(DBTablePartBase *part, DBEntryBase *entry)
Icmpv6Proto(Agent *agent, boost::asio::io_context &io)
static const uint16_t kMaxRetries
DISALLOW_COPY_AND_ASSIGN(Icmpv6Proto)
InterfaceNdpMap interface_ndp_map_
void IncrementStatsRouterSolicit(VmInterface *vmi)
Icmpv6Stats * VmiToIcmpv6Stats(VmInterface *i)
std::map< uint32_t, InterfaceNdpInfo > InterfaceNdpMap
boost::scoped_ptr< Icmpv6Handler > icmpv6_handler_
static const uint32_t kRetryTimeout
Icmpv6VrfState * CreateAndSetVrfState(VrfEntry *vrf)
void IncrementStatsNeighborAdvertUnSolicited(VmInterface *vmi)
const InterfaceNdpMap & interface_ndp_map()
bool ValidateAndClearVrfState(VrfEntry *vrf, Icmpv6VrfState *state)
std::pair< NdpKey, NdpEntry * > NdpCachePair
Icmpv6Proto::UnsolNaIterator UnsolNaEntryIterator(const NdpKey &key, bool *key_valid)
bool DeleteNdpEntry(NdpEntry *entry)
NdpEntry * FindNdpEntry(const NdpKey &key)
const UnsolNaCache & unsol_na_cache()
std::map< NdpKey, NdpEntrySet >::iterator UnsolNaIterator
void IncrementStatsPingResponse(VmInterface *vmi)
void IncrementStatsRouterAdvert(VmInterface *vmi)
ProtoHandler * AllocProtoHandler(boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
NdpEntry * UnsolNaEntry(const NdpKey &key, const Interface *intf)
DBTableBase::ListenerId vrf_table_listener_id_
std::set< NdpEntry * > NdpEntrySet
DBTableBase::ListenerId nexthop_listener_id_
void SendIcmpv6Ipc(Icmpv6Proto::Icmpv6MsgType type, Ip6Address ip, const VrfEntry *vrf, InterfaceConstRef itf)
void IncrementStatsPingRequest(VmInterface *vmi)
std::map< NdpKey, NdpEntry * > NdpCache
DBTableBase::ListenerId interface_listener_id_
static const uint32_t kAgingTimeout
void IncrementStatsDrop()
void IncrementStatsNeighborAdvertSolicited(VmInterface *vmi)
std::map< NdpKey, NdpEntrySet > UnsolNaCache
std::pair< uint32_t, InterfaceNdpInfo > InterfaceNdpPair
bool AddNdpEntry(NdpEntry *entry)
void VnNotify(DBEntryBase *entry)
void set_ip_fabric_interface(Interface *itf)
void AddUnsolNaEntry(NdpKey &key)
const NdpCache & ndp_cache()
MacAddress ip_fabric_interface_mac_
std::pair< VmInterface *, Icmpv6Stats > VmInterfacePair
const MacAddress & ip_fabric_interface_mac() const
Interface * ip_fabric_interface() const
void set_ip_fabric_interface_index(uint32_t ind)
void InterfaceNotify(DBEntryBase *entry)
NdpEntry * FindUnsolNaEntry(NdpKey &key)
void set_ip_fabric_interface_mac(const MacAddress &mac)
UnsolNaCache unsol_na_cache_
void HandlePathPreferenceNA(const VrfEntry *, uint32_t, IpAddress)
static const uint32_t kRouterAdvertTimeout
std::set< NdpKey > NdpKeySet
uint32_t ip_fabric_interface_index_
void IncrementStatsNeighborSolicited(VmInterface *vmi)
std::map< VmInterface *, Icmpv6Stats > VmInterfaceMap
const VmInterfaceMap & vm_interfaces()
void NexthopNotify(DBEntryBase *entry)
void IncrementStatsNeighborSolicit(VmInterface *vmi)
DBTableBase::ListenerId vn_table_listener_id_
const Icmpv6Stats & GetStats() const
std::size_t GetNdpCacheSize()
Icmpv6RouteState(Icmpv6VrfState *vrf_state, uint32_t vrf_id, IpAddress vm_ip_addr, uint8_t plen)
void SendNeighborSolicitForAllIntf(const AgentRoute *route)
Icmpv6PathPreferenceStatePtr icmpv6_path_preference_state_
Icmpv6PathPreferenceState * Get(const IpAddress ip)
DBTable::DBTableWalkRef evpn_walk_ref_
DISALLOW_COPY_AND_ASSIGN(Icmpv6VrfState)
static void WalkDone(DBTableBase *partition, Icmpv6VrfState *state)
void Erase(const IpAddress &ip)
bool PreWalkDone(DBTableBase *partition)
bool default_routes_added() const
LifetimeRef< Icmpv6VrfState > table_delete_ref_
Icmpv6PathPreferenceStateMap icmpv6_path_preference_map_
void set_route_table_listener_id(const DBTableBase::ListenerId &id)
AgentRouteTable * rt_table_
void set_evpn_route_table_listener_id(const DBTableBase::ListenerId &id)
DBTable::DBTableWalkRef managed_delete_walk_ref_
bool default_routes_added_
DBTable::DBTableWalkRef evpn_walk_ref()
DBTable::DBTableWalkRef managed_delete_walk_ref()
std::pair< const IpAddress, Icmpv6PathPreferenceState * > Icmpv6PathPreferenceStatePair
Icmpv6PathPreferenceState * Locate(const IpAddress &ip)
Icmpv6VrfState(Agent *agent, Icmpv6Proto *proto, VrfEntry *vrf, AgentRouteTable *table, AgentRouteTable *evpn_table)
AgentRouteTable * evpn_rt_table_
Icmpv6Proto * icmp_proto_
bool DeleteEvpnRouteState(DBTablePartBase *part, DBEntryBase *entry)
void RouteUpdate(DBTablePartBase *part, DBEntryBase *entry)
bool DeleteRouteState(DBTablePartBase *part, DBEntryBase *entry)
bool evpn_walk_completed_
std::map< const IpAddress, Icmpv6PathPreferenceState * > Icmpv6PathPreferenceStateMap
Icmpv6Proto * icmp_proto() const
void set_default_routes_added(bool value)
void EvpnRouteUpdate(DBTablePartBase *part, DBEntryBase *entry)
LifetimeRef< Icmpv6VrfState > evpn_table_delete_ref_
DBTableBase::ListenerId evpn_route_table_listener_id_
bool l3_walk_completed() const
DBTableBase::ListenerId route_table_listener_id_
bool evpn_walk_completed() const
void intrusive_ptr_release(Icmpv6PathPreferenceState *ps)
void intrusive_ptr_add_ref(Icmpv6PathPreferenceState *ps)
boost::intrusive_ptr< Icmpv6PathPreferenceState > Icmpv6PathPreferenceStatePtr
Icmpv6Ipc(Icmpv6Proto::Icmpv6MsgType msg, NdpKey &akey, InterfaceConstRef itf)
InterfaceConstRef interface_
Icmpv6Ipc(Icmpv6Proto::Icmpv6MsgType msg, Ip6Address ip, const VrfEntry *vrf, InterfaceConstRef itf)
uint32_t icmpv6_neighbor_advert_solicited_
uint32_t icmpv6_neighbor_solicited_
uint32_t icmpv6_router_solicit_
uint32_t icmpv6_neighbor_solicit_
uint32_t icmpv6_ping_response_
uint32_t icmpv6_router_advert_
uint32_t icmpv6_neighbor_advert_unsolicited_
uint32_t icmpv6_ping_request_
InterfaceIcmpv6PathPreferenceInfo()