[Xorp-hackers] PIM-Bidir - PIM-SM

Pavlin Radoslavov pavlin at icir.org
Tue Feb 13 12:44:17 PST 2007


> On 2/12/07, Pavlin Radoslavov <pavlin at icir.org> wrote:
> > >  Thanks for your precious guidance. we have one more doubt- how do we
> > > enable-bidir in config file ?
> > >
> > > 1) We are planning to add pimbidir(enable) flag in
> > > /xorp/etc/template/pimsm4.tp & commands in /xorp/etc/template/pim.cmd
> > > 2) we are not able to find out how we can catch this enable flag in the
> > > pimsm module?
> > >     so that we can achieve switching in between modules!!!
> > >     Will you please how it works in the pimsm node!!
> > >     we have gone through the documentation of adding process to Xorp but
> > > still we  did not get the pin-pointed information in this regard.
> >
> > Check how a flag like enable-ip-router-alert-option-check has been
> > implemented. Of course, you need to add a new XRL to enable/disable
> > the Bidir functionality.
> >
>        We tried to find enable-ip-router-alert-option-check has been
> implemented but we are not able to get it exactly. We even tried
> debuging using DDD(degugger). We placed break points in
> /xorp/rtrmgr/main_rtrmgr.cc in  try{} where it reads config file !!
> But couldn't understand how actually it reads
> xorp/etc/templets/pimsm.tp file to crate MasterTempalteTree ( tt ) and
> compare/manipulate it _mct(Master Config Tree ) i.e we are not able to
> get mechnasim of how it gets enable-ip-router-alert-option-check flag
> from config file and pass it on to pimsm module !!
>        It will be very helpfull if someone clears us about this flow &
> also how should be our approach in achieving it !!

You don't need to do all this to implement a new rtrmgr template
option. The rtrmgr is generic when it comes to the content of the
template files. All it does is parses the template nodes in the
configuration tree and associates action with each node: e.g., XRL
to send when this configuration node is created or modified, etc.

All you need to do is add something like the following to pimsm4.tp:

protocols {
    pimsm4 {
        /* .... */
        enable-bidir: bool = false;
        /* ... */
    }
}

protocols {
    pimsm4 {
        /* .... */
        enable-bidir {
            %help: short "Enable PIM-Bidir";
            %create: xrl "$(pimsm4.targetname)/pim/0.1/enable_bidir?enable:bool=$(@)";
            %set: xrl "$(pimsm4.targetname)/pim/0.1/enable_bidir?enable:bool=$(@)";
            %delete: xrl "$(pimsm4.targetname)/pim/0.1/enable_bidir?enable:bool=$(DEFAULT)";
        }
        /* ... */
    }
}

This adds a single enable-bidir flag per PIM-SM instance. If you
want the flag to be per vif, then you need to move the flag inside
the pimsm4/interface/vif node (and of course to modify the XRL
arguments). Again, see how it is done with the
enable-ip-router-alert-option-check flag.

Of course, you also need to specify and implement the new
pim/0.1/enable_bidir XRL.

FYI, If you want to see all XRLs that are generated (including the XRLs
like the one above that are used for configuration), then you need
to set the XRLTRACE environmental variable before starting
xorp_rtrmgr. Though, this might generate lots of output so you need
to save it to a file before analyzing it.

Regards,
Pavlin



More information about the Xorp-hackers mailing list