I have a question for routing.
Now I'm try to modify destination on aodv.
So I add "SetDestination".
But it isn's work.
Thank you.
bool
RoutingProtocol::RouteInput (Ptr<const Packet> p, const Ipv4Header &header,
Ptr<const NetDevice> idev, UnicastForwardCallback ucb,
MulticastForwardCallback mcb, LocalDeliverCallback lcb, ErrorCallback ecb)
{
NS_LOG_FUNCTION (this << p->GetUid () << header.GetDestination () << idev->GetAddress ());
if (m_socketAddresses.empty ())
{
NS_LOG_LOGIC ("No aodv interfaces");
return false;
}
NS_ASSERT (m_ipv4 != 0);
NS_ASSERT (p != 0);
// Check if input device supports IP
NS_ASSERT (m_ipv4->GetInterfaceForDevice (idev) >= 0);
int32_t iif = m_ipv4->GetInterfaceForDevice (idev);
Ipv4Address dst = header.GetDestination ();
Ipv4Address origin = header.GetSource ();
// Deferred route request
if (idev == m_lo)
{
DeferredRouteOutputTag tag;
if (p->PeekPacketTag (tag))
{
//Add
header.SetDestination ("10.1.1.4");
DeferredRouteOutput (p, header, ucb, ecb);
return true;
}
}
../src/aodv/model/aodv-routing-protocol.cc:471:9: error: 'this' argument to member function 'SetDestination' has type 'const ns3::Ipv4Header', but function is not marked const
header.SetDestination ("10.1.1.4");
^~~~~~
./ns3/ipv4-header.h:160:8: note: 'SetDestination' declared here
void SetDestination (Ipv4Address destination);
^
1 warning and 1 error generated.