Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hai,
How can I find all the nexthops in a
Path using aomdv protocol.When i call
path->nexthop,I am getting the first hop of that path..How can I access further hops.Is there any way to increment nexthops...please help....
Hai,
How can I find all the nexthops in a Path using aomdv protocol.When i call path->nexthop,I am getting the first hop of that path..How can I access further hops.Is there any way to increment nexthops...please help....
Yes, you have to modify your code to do so. We will be happy to help you, so post your code and show us what you've done/tried so far, and we'll be glad to assist. See the "Question Guidelines".
for (; path; path = path->path_link.le_next){
int nexthop = path->nexthop;
int path_count = path->hopcount;
while(resi_energy[nexthop]>=max){
ap1==true; ///here I want to check this condition for all nexthops in the path
}
if(ap1==true){
forward(rt, p, NO_AOMDV_DELAY);
}
if(rt->rt_flags == RTF_UP) {
double max = 5.0;
assert(rt->rt_hops != INFINITY2);
AOMDV_Path *path = rt->path_find();
for (; path; path = path->path_link.le_next){
int nexthop = path->nexthop;
int path_count = path->hopcount;
while(resi_energy[nexthop]>=max){
ap1==true; ///here I want to check this condition for all nexthops in the path
}
if(ap1==true){
forward(rt, p, NO_AOMDV_DELAY);
}
}
}
Post code in CODE tags, and again, read the "Question Guidelines". You've posted a VERY small piece of code, with no context, error messages, or told us what you've done/tried. What do you expect us to be able to do with this???
I am attaching aomdv.cc code here in text format.I am using ns2.35.I want to forward packets through the paths in which all nodes have an energy level higher than 5(threshold).So I made changes in AOMDV::rt_resolve(Packet *p) function.(Line 512-552). In line 544 I added a while loop for checking all nexthops in the path.But I dont know how to increment the nexthop to the remaining hops in the path. While running this code the while loop is not terminating bcz the nexthop condition is not changing .It only check first hop in the path.So how can I access further nexthops ?
No, you didn't attach the file, and before you do that please (AGAIN) read the "Question Guidelines". Don't just post the code you downloaded in a file, and expect people to download it and run it. We volunteer our time to try to help...post the code HERE (in CODE tags), and most importantly, SHOW US WHAT YOU HAVE DONE/TRIED SO FAR.
Again, we are happy to help, but we aren't going to make your code changes for you. You have to show your own efforts.
I am attaching aomdv.cc code here in text format.I am using ns2.35.I want to forward packets through the paths in which all nodes have an energy level higher than 5(threshold).So I made changes in AOMDV::rt_resolve(Packet *p) function.(Line 512-552). In line 544 I added a while loop for checking all nexthops in the path.But I dont know how to increment the nexthop to the remaining hops in the path. While running this code the while loop is not terminating bcz the nexthop condition is not changing .It only check first hop in the path.So how can I access further nexthops ?
Don't edit your posts; AGAIN, read the "Question Guidelines" and the LQ Rules. You added a great deal to this post, as well as attaching a file to it. And when you were asked to post the code, you still only posted a small bit.
The actual file you posted has an example on line 302 of how to implement a counter to loop through things.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.