LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-12-2011, 04:03 AM   #1
MounaRM
Member
 
Registered: Nov 2010
Posts: 35

Rep: Reputation: 14
Error!! str2addr:Address 35 outside range of address field length 1 !!!


hello every one ,

I am working on implementing a protocol on NS2.34 .
I really need help to solve this problem . Actually , I don't now whether the problem is generated by the tcl code or the c++ code
when I run the simulation, I get this result :
Code:
num_nodes is set 64
INITIALIZE THE LIST xListHead
34
45
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
 envoie une fourmis au noeud 45
lauching packet at 10
one second later
15
20
30
40
printing tables (95)
Error!!
str2addr:Address 38 outside range of address field length 1
thanks in advance
 
Old 05-12-2011, 11:32 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Here is the problem:
Quote:
http://mailman.isi.edu/pipermail/ns-...er/045243.html

>Hola,
>That is because you are using a hierarchical configuration by defining a
>number of domines, clusters and nodes inside the network, but afterwards you
>generate more nodes or you don't assign correctly some address to the nodes
>of your script. For example, you write in your script that some cluster has
>4 nodes but afterwards you have 5 nodes.
>
>i hope this helps to you
>
>Elvira
And here is the NS2 code that's generating the error:
Code:
http://linear.engmath.dal.ca/ns-2/doxygen/html/address_8cc-source.html

00067 int Address::command(int argc, const char*const* argv)
00068 {
00069         int i, c, temp=0;
00070 
00071         Tcl& tcl = Tcl::instance();
00072         if ((instance_ == 0) || (instance_ != this))
00073                 instance_ = this;
00074         if (argc == 3) {
00075                 if (strcmp(argv[1], "str2addr") == 0) {
00076                         tcl.resultf("%d", str2addr(argv[2]));
00077                         return (TCL_OK);
00078                 }
00079         }
...
00269 // Convert address in string format to binary format (int). 
00270 int Address::str2addr(const char *str) const
00271 {
00272         
00273         if (levels_ < 2) {
00274                 int tmp = atoi(str);            
00275                 if (tmp < 0)     
00276                         return (tmp);
00277                 u_int uitmp = (u_int) tmp;
00278                 if (uitmp > ((unsigned long)(1 << bpl_[1])) ) {
00279                         fprintf(stderr, "Error!!\nstr2addr:Address %u outside range of address field length %lu\n", 
00280                                 uitmp, ((unsigned long)(1<< bpl_[1])));
00281                         exit(1);
00282                 }
00283                 return tmp;
00284         }
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do I get the prefix length of an IPv6 address programatically in AIX? the_pilgrim AIX 1 09-30-2010 01:39 PM
IP Address Range JC695 Linux - Networking 1 09-28-2010 12:51 AM
Cant store ip address to bash field Mangled Programming 10 10-10-2007 01:32 PM
Icon in address field Kanon Linux - Networking 2 03-22-2005 12:42 AM
dhclient ip address disagrees length shpung Linux - Wireless Networking 2 02-27-2005 12:12 PM


All times are GMT -5. The time now is 01:41 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration