[Xorp-users] error with XRLs

Pavlin Radoslavov pavlin@icir.org
Wed, 02 Feb 2005 15:37:09 -0800


> > 1. Add a rtrmgr template to etc/templates/your_protocol.tp that will
> >    contain the rtrmgr template how to configure your protocol, the
> >    XRLs sent to your protocol to configure it, etc.
> >    Then, when you run xorp_rtrmgr, it will start the XORP finder,
> >    your protocol, etc and everything else that is needed.
> > 
> > 2. Start libxipc/xorp_finder by hand before starting your protocol.
> 
> I went with option #1 since I can't have more than one finder on the same
> machine.  I wrote a ${Xorp}/etc/templates/bgp_beacon.tp file that looks
> like this:
> 
> protocols {
>  bgp_beacon {
>   targetname: txt = "bgp_beacon";
> 
>   import: txt;
>   export: txt;
>  }
> }
> 
> protocols {
>  bgp_beacon {
>   %modinfo: provides bgp_beacon;
>   %modinfo: depends bgp;
>   %modinfo: path "bgp_beacon/bgp_beacon";
>   %modinfo: default_targetname "bgp_beacon";
>  }
> }
> 
> I copied and modified the bgp.tp file.  My program, bgp_beacon, doesn't
> need to do much.  All I want it to do is make a few XRL calls on
> XrlBgpV0p2Client.  I give my program all of the necessary data it needs
> when I start it up from the command line.
> 
> I still get the same error.

In your first email you said that you have declared inside your
bgp_beacon.hh file the variable

EventLoop _eventloop;

One thing that comes to mind is that you may have end-up with more
than one eventloop. Inside your program you cannot have more than
one. Hence, I'd recommend that you declare the eventloop inside the
main program, and then pass it as a reference to the BgpBeacon
constructor.

> Questions:
> 1) Was adding this .tp file supposed to tell Xorp to start my program up
> automatically?  When I run xorp_rtrmgr, I see that it runs module
> interfaces, then module fea, then module rib, then module bgp.  Do I have
> to somehow have it run module bgp_beacon next?

XORP will start your program if either:
(a) Another module needs to be started by XORP, and that module
depends on bgp_beacon.

and/or

(b) you have explicit configuration section about your program in
    your confir file. In your case it may be sufficient to add
    a config statement like:

protocols {
    bgp_beacon {
    }
}

> 2) If it is ok to just start my program from a different shell, what else
> do I need to do?

Can you be more specific what you mean by this.

> 
> 3) Any hints on the .tp file?  I took my best guess when deciding what to
> keep/modify from the bgp.tp file.

In your template file you may want to add the following after
the last %modinfo statement:

        %mandatory:     targetname;

        targetname {
            %help:      short "Set the target name";
            %set:;
        }

Also, you don't seem to use/define the "import" and "export"
declarations, so you may want to remove them.

Regards,
Pavlin