LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dsr code implimantation (https://www.linuxquestions.org/questions/linux-newbie-8/dsr-code-implimantation-4175457615/)

harshil00022 04-10-2013 04:29 AM

dsr code implimantation
 
hello sir
i harshil student of M.E.
I WANT TO MODIFICATION OF dsr ROUTING PROTOCOL IN dsragent.CC FILE BY USING THIS CODE .but some error is created so please help me.urgent

void MDSRAgent::getRouteForPacket(SRPacket &p, bool retry)
{
Entry *e = request_table.getEntry(p.dest);
Time time = Scheduler::instance().clock();
if snooze==1&&recv.ACK==1
SRPacket rrp = p;
rrp.pkt = p.pkt->copy();
hdr_sr *srh = hdr_sr::access(rrp.pkt);
hdr_ip *iph = hdr_ip::access(rrp.pkt);
hdr_cmn *cmh = hdr_cmn::access(rrp.pkt);
iph>daddr()=Address::instance().create_ipaddr(p.dest.getNSAddr_t(),RT_PORT);
iph->dport() = RT_PORT;
iph>saddr()=Address::instance().create_ipaddr(net_id.getNSAddr_t(),RT_PORT);
iph->sport() = RT_PORT;
cmnh->ptype() = PT_DSR;
cmnh->size() = size_;
cmnh->num_forwards() = 0;
}#endif

gdejonge 04-11-2013 08:29 AM

It would much easier to help you if you told us what error message you are getting instead of just showing a code snippet.
And please do use code tags if you are posting code.

Cheers

TB0ne 04-11-2013 11:18 AM

Quote:

Originally Posted by harshil00022 (Post 4928775)
hello sir
i harshil student of M.E. I WANT TO MODIFICATION OF dsr ROUTING PROTOCOL IN dsragent.CC FILE BY USING THIS CODE .but some error is created so please help me.urgent

If you're a university student, you should know by now how to ask a question...and you should also know that this is NOT URGENT for ANYONE here. Unless you tell us WHAT error(s) you're getting, and where you're getting them, it's pointless to say "some error is created".

harshil00022 04-11-2013 10:38 PM

dsr routing protocol modification
 
hello sir ,
when i modification in dsr routing protocol in ns-2.34 by adding this code in dsragent.cc file then creat this type of error.

Quote:

void MDSRAgent::getRouteForPacket(SRPacket &p, bool retry)
{
Entry *e = request_table.getEntry(p.dest);
Time time = Scheduler::instance().clock();
if snooze==1&&recv.ACK==1
SRPacket rrp = p;
rrp.pkt = p.pkt->copy();
hdr_sr *srh = hdr_sr::access(rrp.pkt);
hdr_ip *iph = hdr_ip::access(rrp.pkt);
hdr_cmn *cmh = hdr_cmn::access(rrp.pkt);
iph>daddr()=Address::instance().create_ipaddr(p.dest.getNSAddr_t(),RT_PORT);
iph->dport() = RT_PORT;
iph>saddr()=Address::instance().create_ipaddr(net_id.getNSAddr_t(),RT_PORT);
iph->sport() = RT_PORT;
cmnh->ptype() = PT_DSR;
cmnh->size() = size_;
cmnh->num_forwards() = 0;
}#endif
ERROR:

[dsr/dsragent.cc:1483:5: error: ‘((DSRAgent*)this)->DSRAgent::recv’ does not have class type
dsr/dsragent.cc:1484:22: error: ‘((DSRAgent*)this)->DSRAgent::recv’ does not have class type
dsr/dsragent.cc:1502:3: error: ‘cmnh’ was not declared in this scope
dsr/dsragent.cc:1493:11: warning: unused variable ‘srh’ [-Wunused-variable]
dsr/dsragent.cc:1495:12: warning: unused variable ‘cmh’ [-Wunused-variable]
dsr/dsragent.cc:1523:3: error: ‘endif’ was not declared in this scope
dsr/dsragent.cc:1525:3: error: expected ‘;’ before ‘srh’
dsr/dsragent.cc:1512:11: warning: unused variable ‘srh’ [-Wunused-variable]
dsr/dsragent.cc: In member function ‘void DSRAgent::undeliverablePkt(Packet*, int)’:
dsr/dsragent.cc:2390:48: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
make: *** [dsr/dsragent.o] Error 1]

harshil00022 04-11-2013 11:59 PM

Quote:

Originally Posted by harshil00022 (Post 4930111)
hello sir ,
when i modification in dsr routing protocol in ns-2.34 by adding this code in dsragent.cc file then creat this type of error.



ERROR:

[dsr/dsragent.cc:1483:5: error: ‘((DSRAgent*)this)->DSRAgent::recv’ does not have class type
dsr/dsragent.cc:1484:22: error: ‘((DSRAgent*)this)->DSRAgent::recv’ does not have class type
dsr/dsragent.cc:1502:3: error: ‘cmnh’ was not declared in this scope
dsr/dsragent.cc:1493:11: warning: unused variable ‘srh’ [-Wunused-variable]
dsr/dsragent.cc:1495:12: warning: unused variable ‘cmh’ [-Wunused-variable]
dsr/dsragent.cc:1523:3: error: ‘endif’ was not declared in this scope
dsr/dsragent.cc:1525:3: error: expected ‘;’ before ‘srh’
dsr/dsragent.cc:1512:11: warning: unused variable ‘srh’ [-Wunused-variable]
dsr/dsragent.cc: In member function ‘void DSRAgent::undeliverablePkt(Packet*, int)’:
dsr/dsragent.cc:2390:48: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
make: *** [dsr/dsragent.o] Error 1]

hello sir

i want to modified dsragent.cc file in ns-2.34 by according this document. In this document giveen, how to improve performance of dsr routinfg protocol by using ack path reply? so modification code is also avialable in this document.
so please give me step for modification
thank you for previous good response

harshil00022 04-12-2013 12:13 AM

dsr routing protocol modification
 
Quote:

Originally Posted by harshil00022 (Post 4930144)


hello sir

i want to modified dsragent.cc file in ns-2.34 by according this document. In this document giveen, how to improve performance of dsr routinfg protocol by using ack path reply? so modification code is also avialable in this document.
so please give me step for modification
thank you for previous good response

pdf document:USING ACK REPLY TO IMPROVE PERFORMANCE OF DYNAMIC SOURCE ROUTING PROTOCOL FOR MOBILE AD HOC NETWORKS

site:http://dspace.fsktm.um.edu.my/bitstr...20NETWORKS.pdf

harshil00022 05-01-2013 04:39 AM

Quote:

Originally Posted by harshil00022 (Post 4930150)
pdf document:USING ACK REPLY TO IMPROVE PERFORMANCE OF DYNAMIC SOURCE ROUTING PROTOCOL FOR MOBILE AD HOC NETWORKS

site:http://dspace.fsktm.um.edu.my/bitstr...20NETWORKS.pdf

hello sir,
i want to reduce end to end delay in dsr routing protocol. which modification needed in dsragent or dsr header file

TB0ne 05-01-2013 02:36 PM

Quote:

Originally Posted by harshil00022 (Post 4942477)
hello sir,
i want to reduce end to end delay in dsr routing protocol. which modification needed in dsragent or dsr header file

Yes, we know what you want...posting it over and over doesn't get folks to answer any sooner.

And did you read what you posted? Did you understand it?
Code:

dsr/dsragent.cc:1483:5: error: ‘((DSRAgent*)this)->DSRAgent::recv’ does not have class type
dsr/dsragent.cc:1484:22: error: ‘((DSRAgent*)this)->DSRAgent::recv’ does not have class type
dsr/dsragent.cc:1502:3: error: ‘cmnh’ was not declared in this scope
dsr/dsragent.cc:1493:11: warning: unused variable ‘srh’ [-Wunused-variable]
dsr/dsragent.cc:1495:12: warning: unused variable ‘cmh’ [-Wunused-variable]
dsr/dsragent.cc:1523:3: error: ‘endif’ was not declared in this scope
dsr/dsragent.cc:1525:3: error: expected ‘;’ before ‘srh’
dsr/dsragent.cc:1512:11: warning: unused variable ‘srh’ [-Wunused-variable]
dsr/dsragent.cc: In member function ‘void DSRAgent::undeliverablePkt(Packet*, int)’:
dsr/dsragent.cc:2390:48: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]

It's telling you what lines the errors are on, and what the errors ARE. So:
  • Define a class type for DSRAgent::recv (lines 1483 and 1484)
  • Remover reference to cmnh or declare it (line 1502)
  • srh and cmh are unused (warnings: either use them or ignore messages for 1493 and 1495)
  • Put inthe appropriate endif (1523)
Again, if you're a student and you're doing this for a project, shouldn't your instructor be able to help you? Have you not progressed ANY since your post over two weeks ago?


All times are GMT -5. The time now is 08:33 PM.