[j-sim-users] how to define different interface types in tcl

Hung-ying Tyan tyanh at ieee.org
Fri Oct 20 10:59:46 CDT 2006


Ling:

How do you build the nodes?  If you use nodeBuilder, hello should be
in n0/csl/.  Can you share your script?

HT

On 10/20/06, ling shi <shiling18 at hotmail.com> wrote:
>
>
>
> Hei,
> I copied the "numberOfIfaces" row first then the other three rows, and
> copied from different nodes, which caused the mixing of "n1" and "n0", sorry
> about that.
>
> The hello's service interface is connected to the router(ospf)'s service
> interface.
> mkdir drcl.inet.core.Hello    hello
> connect ospf/.service_if@ -and hello/.service_if@
> connect hello/.service_id@ -and id/.service_id@
>
> The n1/csl/hello does not exit, therefore I made a little modification on
> your test script by changing from n1/csl/hello/.service_if@  to
> n1/hello/.service_if@
>
> The result of the testing script shows also that the type is 0.
> type:0, local:<1,-8>, peers:<null>, timeouts:<null_double[]>,
> MTU=2147483647, BW=-1.0, buffer=-1
>
> Regards,
> ling
>
>
>
>
>  ________________________________
>
> From:  "Hung-ying Tyan" <tyanh at ieee.org>
> To:  "ling shi" <shiling18 at hotmail.com>
> CC:  j-sim-users at cs.uiuc.edu
> Subject:  Re: [j-sim-users] how to define different interface types in tcl
> Date:  Fri, 20 Oct 2006 18:23:54 +0800
>
> >Ling:
> >
> >Which method is your code in?  Why is it mixed with "n1"?
> >
> >Meanwhile, you may try the following script before starting the
> >simulation:
> >
> >mkdir drcl.comp.Component test
> >connect -c test/h@ -and n1/csl/hello/.service_if@
> >set ii [java::call drcl.inet.contract.IFQuery getInterfaceInfos [!
> >test/h@]]
> >puts [[$ii get 0] toString]
> >
> >Check if the interface type is correct.
> >
> >HT
> >
> >On 10/20/06, ling shi <shiling18 at hotmail.com> wrote:
> >>
> >>
> >>
> >>Hei,
> >>
> >>I'm making an extention to the existing OSPF codes. Here is the
> >>code I used
> >>to check the interface info.
> >>
> >>   int numberOfIfaces=IFQuery.getNumOfInterfaces(ifport);
> >>   drcl.inet.data.InterfaceInfo[] ifs =
> >>IFQuery.getInterfaceInfos(ifport);
> >>
> >>   debug("numberOfIfaces:"+numberOfIfaces);
> >>   for (int i=0;i<numberOfIfaces;i++){
> >>    if(ifs[i]!=null){
> >>     debug("interface "+ i+" type: "+ifs[i].getType());
> >>    }else debug("interface "+i+" is null");
> >>   }
> >>
> >>
> >>The result is as follows:
> >>DEBUG| 1.0| /example/n1/ospf/| numberOfIfaces:3
> >>DEBUG| 1.0| /example/n0/ospf/| interface 0 type: 0
> >>DEBUG| 1.0| /example/n0/ospf/| interface 1 is null
> >>DEBUG| 1.0| /example/n0/ospf/| interface 2 is null
> >>
> >>There are actually two things I don't understand of the result. 1)
> >>Why the
> >>interface type is 0 although I've set it to be 5 in the tcl script.
> >>   2) Why
> >>the number of interfaces is 3 although I've only added one
> >>interface in the
> >>script.
> >>
> >>regards,
> >>ling
> >>
> >>  ________________________________
> >>
> >>From:  "Hung-ying Tyan" <tyanh at ieee.org>
> >>To:  "ling shi" <shiling18 at hotmail.com>
> >>CC:  j-sim-users at cs.uiuc.edu
> >>Subject:  Re: [j-sim-users] how to define different interface types
> >>in tcl
> >>Date:  Fri, 20 Oct 2006 11:43:05 +0800
> >>
> >> >Ling:
> >> >
> >> >Can you be more specific?  The script looks fine.  What do you do
> >>to
> >> >check the interface info and it still returns type 0?
> >> >
> >> >HT
> >> >
> >> >On 10/19/06, ling shi <shiling18 at hotmail.com> wrote:
> >> >>
> >> >>Hei,
> >> >>I'm coding a routing protocol with multiple interface types. The
> >> >>following
> >> >>line returns the default interface type 0.
> >> >>
> >> >>! hello _setInterfaceInfo 1 [java::new
> >>drcl.inet.data.InterfaceInfo
> >> >>0 -8]
> >> >>
> >> >>I then changed the script and hope that the returning interface
> >> >>type will be
> >> >>5, but it remains to be 0.
> >> >>
> >> >>set iinfo [java::new drcl.inet.data.InterfaceInfo 5 0 -8 -1 -1
> >>-1]
> >> >>! hello _setInterfaceInfo 0 $iinfo
> >> >>
> >> >>What am I missing here?
> >> >>
> >> >>B.R.
> >> >>ling
> >> >>________________________________
> >> >>Express yourself instantly with MSN Messenger! MSN Messenger
> >> >>Download today
> >> >>it's FREE!
> >> >>_______________________________________________
> >> >>j-sim-users mailing list
> >> >>j-sim-users at cs.uiuc.edu
> >> >>http://lists.cs.uiuc.edu/mailman/listinfo/j-sim-users
> >> >>
> >> >>
> >> >>
> >>
> >>________________________________
> >>FREE pop-up blocking with the new MSN Toolbar MSN Toolbar Get it
> >>now!
> >>_______________________________________________
> >>j-sim-users mailing list
> >>j-sim-users at cs.uiuc.edu
> >>http://lists.cs.uiuc.edu/mailman/listinfo/j-sim-users
> >>
> >>
> >>
>
> ________________________________
> Express yourself instantly with MSN Messenger! MSN Messenger Download today
> it's FREE!
> _______________________________________________
> j-sim-users mailing list
> j-sim-users at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/j-sim-users
>
>
>


More information about the j-sim-users mailing list