[ns] [HELP]How to print out [DSR route in CMUpriQueue class?
Cammy Yongzhen Zhuang
cszyz at ust.hk
Tue Nov 16 05:36:02 PST 2004
Who can tell me any methord that can print out the route for a given packet
p in CMUPriQueue::enqueue().
I have a severe problem to do it. I am using DSR and CMUPriQueue. I want to
obtain the routing path in CMUPriQueue::enqueue().
So I use (p is in type of Packet*)
struct hdr_cmn *ch = HDR_CMN(p);
hdr_sr *srh = hdr_sr::access(p);
SRPacket srp(p, srh);
printf("uid: %d, path: %s \n", ch->uid(), srp.route.dump());
I send 10 packets along node 0 -> node 2 -> node 3 -> node 1.
But it turns out that the first few packets can print out their path. The
remaining packets have their paths be "[<empty path>] ".
uid: 0, path: [0 2 (3) 1 ]
uid: 0, path: [0 2 3 (1) ]
uid: 5, path: [0 2 (3) 1 ]
uid: 5, path: [0 2 3 (1) ]
uid: 6, path: [0 2 (3) 1 ]
uid: 6, path: [0 2 3 (1) ]
uid: 7, path: [<empty path>]
uid: 7, path: [<empty path>]
uid: 8, path: [<empty path>]
uid: 8, path: [<empty path>]
uid: 9, path: [<empty path>]
uid: 9, path: [<empty path>]
uid: 10, path: [<empty path>]
uid: 10, path: [<empty path>]
uid: 11, path: [<empty path>]
uid: 11, path: [<empty path>]
uid: 12, path: [<empty path>]
uid: 12, path: [<empty path>]
uid: 13, path: [<empty path>]
uid: 13, path: [<empty path>]
Then, I hope there is another method. I got the a point to the mobilenode in
CMUPriQueue::enqueue() by using
"p->txinfo_.getNode()". I want to access the FlowTable (in dsr/flowstruct.h
and dsr/dlowstruct.cc) to get the route. But I don't know how to do it.
Anyway, any methord that can print out the route for a given packet in
CMUPriQueue::enqueue() is fine for me!
Please help me with it..... I have been puzzled for a long long time!
Thanks,
Cammy
More information about the Ns-users
mailing list