[ns] Answer to your question regarding packet header
Mubashir Rehmani
mshrehmani at gmail.com
Mon Sep 15 01:05:28 PDT 2008
Hi Tatinana
To collect the information from each incoming packet, you need to work on
the recv() function, where these packets are being received.
First in the recv() function, you will declare the receiving packet's header
like this:
struct hdr_cmn *ch = HDR_CMN(p);
struct hdr_ip *ih = HDR_IP(p);
struct hdr_aodv_msp *msp = HDR_AODV_MSP(p); //This is the customized
header which you can change as per your requirement.
Then can you makes changes in Common Header, IP Header, or your customized
Header. As i did
ih->saddr() = ih->daddr();
msp->msp_src = ih->daddr();
ih->daddr() = msp_neighbour_node;
msp->msp_dst = msp_neighbour_node;
Regards
--
Mubashir Husain Rehmani
Mobile : 00 33 (0)6 32 00 89 35
More information about the Ns-users
mailing list