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

Re: [ns] new rtmodule



1) check rtmodule.cc was compiled during ur make
2) check you are indeed invoking the ns that you compiled (which ns or
invoking ns with explicit path)

if both passed I don't see any reason it does not work.

On Thu, 3 May 2001, Ricciato Fabio wrote:

> Hi,
> I'm really a beginner in ns world: it's my first message...so hello to all
> of you
> I'd like to have a new rtmodule for a node of my network (for the moment
> doing the same thing of Base one).
> I did the following changes:
>
> in ns-rtmodule.tcl...
>
> RtModule/My instproc register { node } {
> 	$self next $node
>
> 	# Create classifier
> 	$self instvar classifier_
> 	set classifier_ [new Classifier/Hash/Dest 32]
> 	$classifier_ set mask_ [AddrParams NodeMask 1]
> 	$classifier_ set shift_ [AddrParams NodeShift 1]
> 	$node install-entry $self $classifier_
> }
>
> in rtmodule.cc...
>
> static class MyRoutingModuleClass : public TclClass {
> public:
> 	MyRoutingModuleClass() : TclClass("RtModule/My") {}
> 	TclObject* create(int, const char*const*) {
> 		return (new MyRoutingModule);
> 	}
> } class_my_routing_module;
>
> in rtmodule.h...
>
> class MyRoutingModule : public RoutingModule {
> public:
> 	MyRoutingModule() : RoutingModule() {}
> 	virtual const char* module_name() const { return "My"; }
> };
>
> then I did
>
> make depend
> make
>
> but calling in my script
>
> $n(7) register-module [new RtModule/My]
>
> I gathered the following result:
>
> invalid command name "RtModule/My"
>     while executing
> "RtModule/My create _o50 "
>     invoked from within
> "catch "$className create $o $args" msg"
>     (procedure "new" line 3)
>     invoked from within
> "new RtModule/My"
>     invoked from within
> "$n(7) register-module [new RtModule/My]"
>     (file "myclassifier.tcl" line 73)
>
> I use ns 2.1b7a on Solaris
>
> Have you any idea about my mistakes or misses ? Do I have to register the
> class somewhere as for packets in tutorial example?
> I can't find out anything in the documentation.
> Thanks a lot
>
> F
>
>