[Xorp-hackers] (no subject)

Pavlin Radoslavov pavlin at icir.org
Thu Mar 29 10:43:10 PDT 2007


> 1.olist(G) =
>        RPF_interface(RPA(G)) (+) joins(G) (+) pim_include(G)
> 
> code:
> const Mifset&
> PimMre::bidir_olist_wc() const
> {
>     static Mifset mifs;
> 
>     if (! (is_wc() ) {
>     mifs.reset();
>     return (mifs);
>     }
> 
>     mifs = joins_wc_bidir();
>     mifs |= pim_include_wc_bidir();
> 
> 
>    //    TODO : here we have to get  rpf_interface(RPA(G))..can we use the
> PimMre::rpf_interface_rp() to return RPF_interface(RP(G)) i.e rpf interface
> for that group .????
> 
> 
>     return (mifs);
> }

Yes, this looks right.
For calculating the RPF_interface(RPA(G)) you can use
PimMre::rpf_interface_rp(), but make sure that you validate it
first. E.g.,

    uint32_t rpf_interface = rpf_interface_rp();

    if (rpf_interface != Vif::VIF_INDEX_INVALID) {
        mifs.set(rpf_interface);
    }

> 2.pim_include(G) =
>        { all interfaces I such that:
>          I_am_DF(RPA(G),I) AND  local_receiver_include(G,I) }
> 
> 
> //todo: here we want to return a static DF(hard-coded IP address) which will
> be  used for the time being.Could you suggest how it can be done??
> 
> 
> code:
> const Mifset&
> PimMre::pim_include_wc_bidir() const
> {
>     static Mifset mifs;
> 
>     mifs = i_am_df();
>     mifs &= local_receiver_include_wc();
> 
>     return (mifs);
> }

This also looks right. If however it is suppose to be called only
for (*,G) entries, then it will be safer it you test this as in the
first example. E.g.:

    if (! (is_wc() ) {
        mifs.reset();
        return (mifs);
    }


> 3.joins(G) =
>        { all interfaces I such that
>          I_am_DF(RPA(G),I) AND
>          DownstreamJPState(G,I) is either Joined or PrunePending }
> 
> code:
> const Mifset&
> PimMre::joins_wc_bidir() const
> {
>     static Mifset mifs;
>     const PimMre *pim_mre_wc;
> 
>     if (is_wc()) {
>     pim_mre_wc = this;
>     } else {
>     pim_mre_wc = wc_entry();
>     if (pim_mre_wc == NULL) {
>         mifs.reset();
>         return (mifs);
>     }
>     }

This one seems unfinished. It looks like you have mastered the art
of translating the Bidir spec macros into real code so you should be
able to complete it on your own :)
As a hint, you can use methods PimMre::downstream_join_state() and
PimMre::downstream_prune_pending_state() to get the set of
interfaces that are in Joined and PrunePending state respectively.

Regards,
Pavlin


> Please validate us,
> 
> Thanking you in anticipation,
> Ashish Karpe
> Chintamani Wandhre
> Shamita Pisal
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers



More information about the Xorp-hackers mailing list