Hi,
To add an entry to the ARP cache in AODV, one can use AddArpCache which gets the pointer to the ArpCache of corresponding Ipv4Interface. Now to do the same functionality in Ipv6interface, i added a function: AddNdiscCache.
AddNdiscCache (Ptr<NdiscCache> a)
{
m_ndCache.push_back (a);
}
So basically, when passing the arguments, I need to pass a pointer to the NdiscCache (please correct me if i am wrong).
Now, in the object NotifyInterfaceUp, I have to perform the function of adding an entry to the NdiscCache. In ipv4, there is this part of a functionality
if (l3->GetInterface (i)->GetArpCache ())
{
m_nb.AddArpCache (l3->GetInterface (i)->GetArpCache ());
}
As i understand, the l3 is layer3 protocol, i is an index using which one can obtain an interface.
Summary: for the l3 protocol get an interface and get its corresponding arp cache and add an entry to the cache. (please correct me if i am wrong).
So for similar functionality i added,
if (l3->GetInterface (i)->GetNdiscCache ())
{
m_nb.AddNdiscCache (l3->GetInterface (i)->GetNdiscCache ());
}
Now when i do this i get an error stating
Description Resource Path Location Type
cannot convert ‘ns3::Ipv6Interface*’ to ‘ns3::NdiscCache*’ in initialization ptr.h /AODV/build/ns3 line 746 C/C++ Problem
In my understanding, it is unable to obtain a ptr to NdiscCache, and the definition in ptr.h has a different type or/and size i.e. it is because of difference in type of arpcache and ndisccahe.
It would be of great help if someone can point out a solution to this, or if my understanding is wrong then please correct me and point me to right direction.
Thanks in advance
Regards
Shashidhar B.L