LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-10-2013, 04:29 AM   #1
harshil00022
LQ Newbie
 
Registered: Apr 2013
Posts: 6

Rep: Reputation: Disabled
Lightbulb 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
 
Old 04-11-2013, 08:29 AM   #2
gdejonge
Member
 
Registered: Aug 2010
Location: Netherlands
Distribution: Kubuntu, Debian, Suse, Slackware
Posts: 317

Rep: Reputation: 73
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
 
2 members found this post helpful.
Old 04-11-2013, 11:18 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by harshil00022 View Post
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".
 
1 members found this post helpful.
Old 04-11-2013, 10:38 PM   #4
harshil00022
LQ Newbie
 
Registered: Apr 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Smile 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]
 
Old 04-11-2013, 11:59 PM   #5
harshil00022
LQ Newbie
 
Registered: Apr 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by harshil00022 View Post
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
 
Old 04-12-2013, 12:13 AM   #6
harshil00022
LQ Newbie
 
Registered: Apr 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
dsr routing protocol modification

Quote:
Originally Posted by harshil00022 View Post


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
 
Old 05-01-2013, 04:39 AM   #7
harshil00022
LQ Newbie
 
Registered: Apr 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by harshil00022 View Post
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
 
Old 05-01-2013, 02:36 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by harshil00022 View Post
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP DSR-UU 0.2 installing binasmile Linux - Networking 0 06-06-2012 06:20 AM
implementing DSR in NS2 ritoban87 Linux - Networking 3 05-24-2012 05:15 AM
AODV and DSR armelle Linux - Networking 0 03-27-2010 03:11 AM
cannot install dsr-uu wahaha Linux - Software 7 12-19-2006 02:43 AM
Dsr-uu wahaha Linux - Networking 3 12-11-2006 04:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration