LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Error!! str2addr:Address 35 outside range of address field length 1 !!! (https://www.linuxquestions.org/questions/linux-networking-3/error-str2addr-address-35-outside-range-of-address-field-length-1-a-880264/)

MounaRM 05-12-2011 04:03 AM

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 :cry:. Actually , I don't now whether the problem is generated by the tcl code or the c++ code :confused:
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 :hattip:

paulsm4 05-12-2011 11:32 PM

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        }


amita_s12 07-28-2015 11:51 PM

hello sir,
same changes i have already done. but still giving the same error.


All times are GMT -5. The time now is 06:56 AM.