[ns] bind variables

juan manuel gomez garcia juanmagoga at hotmail.com
Thu Jan 24 10:14:28 PST 2008


Hello:
I want to bind two variables in TCL with two variables in C++. I realize the following thing:

In TCL script:

  set zigbee [new Agent/ZIGBEE]
  $zigbee set DestinoPaqID 79
  $zigbee set OrigenPaqID 2

In lib/ns-default.tcl:

  Agent/ZIGBEE set OrigenPaqID 1
  Agent/ZIGBEE set DestinoPaqID 1

In C++:
   In constructor function:
             bind("OrigenPaqID",&OrigenPaqID);
             bind("DestinoPaqID",&DestinoPaqID);

The problem is that if I execute the following sentence inside one C++ function, for example recv():

fprintf(stdout,"OrigenID=%d\n\n",OrigenPaqID);
fprintf(stdout,"DestinoID=%d.\n\n",DestinoPaqID);

I always obtain:

OrigenID=1
DestinoID=1

How I can see OrigenID=2 and DestinoID=79? What is the problem? Why I always obtain the same thing? 

Thank you.




_________________________________________________________________
Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para estar siempre a la última
Guapos y guapas, clips musicales y estrenos de cine. 



More information about the Ns-users mailing list