By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,194 Members | 859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,194 IT Pros & Developers. It's quick & easy.

Lulea Algorithm

P: 4
Any body who implemented Lulea Algorithm in C/C++...
How to read the routing table from file in the dotted form and create the data structure (example: 153.124.0.0/16 3) where 153.124.0.0/16 is the next hop address and 3 is the interface number.

I am new in C/C++ and need some help to proceed.

Thanks,
Sadik.
Mar 13 '07 #1
Share this Question
Share on Google+
11 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
Any body who implemented Lulea Algorithm in C/C++...
How to read the routing table from file in the dotted form and create the data structure (example: 153.124.0.0/16 3) where 153.124.0.0/16 is the next hop address and 3 is the interface number.

I am new in C/C++ and need some help to proceed.

Thanks,
Sadik.
I think yoru first step is to decide if you are going to use C or C++. From there, you just read in each line as a string, and parse them looking for the . (period) as a delimiter.

Once you decide a language, you should research file io in that language to be able to read the file.
Mar 13 '07 #2

P: 4
Thanks Sicarie for the advise. I decided to use C++. As I am new, I would apreciate any hint, sample code to start.

Sadik.
Mar 14 '07 #3

sicarie
Expert Mod 2.5K+
P: 4,677
Thanks Sicarie for the advise. I decided to use C++. As I am new, I would apreciate any hint, sample code to start.

Sadik.
Yeah, good call - check out the strtok() function. I recommend cplusplus.com - good tutorials, explanations, and code examples.
Mar 14 '07 #4

Expert 100+
P: 1,510
Thanks Sicarie for the advise. I decided to use C++. As I am new, I would apreciate any hint, sample code to start.

Sadik.
also have a look at
http://www.thescripts.com/forum/thread570797.html
Mar 14 '07 #5

P: 4
Hi All,

I have tried several staff as suggested by some of you but still stack.
Any sample code may be helpfull. I am using C++ and I wand to read data from file in the format ( 1.1.1.1/16 4) and extract the digit to perform data mainpulation.

Thanks
Mar 17 '07 #6

Expert 100+
P: 1,510
Hi All,

I have tried several staff as suggested by some of you but still stack.
Any sample code may be helpfull. I am using C++ and I wand to read data from file in the format ( 1.1.1.1/16 4) and extract the digit to perform data mainpulation.

Thanks
have a look at examples of strtok()
http://www.thescripts.com/forum/thread607870.html
Mar 17 '07 #7

sicarie
Expert Mod 2.5K+
P: 4,677
Hi All,

I have tried several staff as suggested by some of you but still stack.
Any sample code may be helpfull. I am using C++ and I wand to read data from file in the format ( 1.1.1.1/16 4) and extract the digit to perform data mainpulation.

Thanks
What manipulation are you trying to do them? It will probably be easiest to use strtok() to parse for the periods, and then parse each octet separately, but maybe not - depending on what you're trying to do.
Mar 18 '07 #8

P: 4
Hi Sicarie,

I want to read the IP (1.1.1.1/16 ) and save its binary equivalent into an array.
I need to end up with a two dimentional array[][] one column holding the binary equivalent of (1.1.1.1/16 ) and the second column holding the port number say 4.

Thanks.
Sadik.
Mar 18 '07 #9

sicarie
Expert Mod 2.5K+
P: 4,677
Hi Sicarie,

I want to read the IP (1.1.1.1/16 ) and save its binary equivalent into an array.
I need to end up with a two dimentional array[][] one column holding the binary equivalent of (1.1.1.1/16 ) and the second column holding the port number say 4.

Thanks.
Sadik.
Then what horace1 said is completely accurate - you can use strtok() to break it apart, and then put it in the array place you want.
Mar 19 '07 #10

P: 1
Hi everybody,
i am doin some project on lulea algorithm... so i want to get an idea how to start it... if it possible can anyone tell me from where can i get sample code even if its binary trie....
Apr 11 '11 #11

Expert 100+
P: 2,402
You attached your comment to a thread that has been quiet for 4 years. You might get better results by starting a new thread.

The Lulea Algorithm is patented. Are you sure you can legitimately use it? No problem is this is simply a class assignment; but you may want to reconsider if your intention is to include it within a product.
Apr 12 '11 #12

Post your reply

Sign in to post your reply or Sign up for a free account.