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

[ns] add a function to



hi...

I add a public data member "int test" to drop-tail class.
(drop-tail.h)

And then, add following codes to drop-tail.cc
First, at DropTail::command function:
        if (argc == 3) {
                if (strcmp(argv[1], "my_function")==0) {
                  printf("%d",test);
                }
             }
Second, at DropTail::enque function
       test = 10;

Now, every enque action will make test to be 10.
And then, whenever I invoke "$drop-tail-q1 my_function"
in my ns script, it should print out 10.
But this doesn't work.
It seems that test at enque and command functions are different instance.
Why?
and how to get enque function's data within command function?

thanks a lot... :)

                 Jay...