[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Problem between TCL and C++



Hello,

I have some trouble to use correctly ns-2. 

I am writing a ad hoc algorithm. I have writed the command function with a
parameter called "david-start":

--------------------------------------------------
  if (argc == 2) {

    if (strcmp (argv[1], "david-start") == 0) {
      startup();
      return (TCL_OK);
    }
--------------------------------------------------

But, when i use my program: i have the following result:

---------------------------------------------------
ns: _o14 david-start: 
    (_o14 cmd line 1)
    invoked from within
"_o14 cmd david-start"
    invoked from within
"catch "$self cmd $args" ret"
    (procedure "_o14" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o14 david-start"
-----------------------------------------------------

So, when i use some classical parameters like tracetraget i have no
problem: the programm use the command version in my C++ code. But when i
use some other parameters like:

$ns at 0.1 "$node_(0) david-start"

My C++ can take this call in command function because TCL refuses to
transmit.

-> Does anyone know how to do ?

-> It exists a flag for debugging TCL or i must use the TCL debug library
? 

-> Does anyone have a HOWTO about create ad'hoc routing mechanism into
NS... It's hard to use only the sources already present (like AODV, DSDV,
TORA or DSR).

P.S:I have already modified ns-default.tcl  ns-lib.tcl  ns-packet.tcl
packet.h to extend ns with my own algorithm.

------------------------------------------------------------------
CARTIGNY Julien
These d'informatique dans l'equipe RD2P  a l'universite de Lille 1
(Phd of Computer Science at the University of Lille 1 / France)

"Rosebud" - Citizen Kane/Orson Wells