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

Re: [ns] adding a new protocol




Apart from whatever you have done below, you must also
add the OTcl stubs in .cc to be able to generate and use
Tcl instances.  To give you an example here is how droptail
adds it.

static class DropTailClass : public TclClass {
 public:
        DropTailClass() : TclClass("Queue/DropTail") {}
        TclObject* create(int, const char*const*) {
                return (new DropTail);
        }
} class_drop_tail;

int
DropTail::command(int argc, const char*const* argv) {

        if (argc == 3) {
                if (!strcmp(argv[1], "packetqueue-attach")) {
                        delete q_;
                        if (!(q_ = (PacketQueue*)
TclObject::lookup(argv[2])))
                                return (TCL_ERROR);
                        else {
                                pq_ = q_;
                                return (TCL_OK);
                        }
                }
        }
        return Queue::command(argc, argv);
}

If you have already done the above, can you send the exact
error message occuring when you run your script.

Sowmya.


On Wed, 7 Nov 2001, bindumadhavi ramavarjula wrote:

> hi,
> i have tried to add a new protocol.i did the
> following:
> 1.added code DG_Agent.cc,DG_Agent.h
> 2.Then i changed the packet.h to incorporate new
> packet types
> 3.then i added DG_Agent.o to the object code list in
> Makefile.
> then i did a make depend
> it gets stuck at this point:
> tclAppInit.cc tkAppInit.cc
> then i do a make which runs fine.
> then when i run the tcl script for my protocol it says
> it does not reconise the SplitObject.
> could someone tell me what i am doing wrong?
> bindu
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
> 
>