[Xorp-hackers] error in setting bidir flag per node !!!

Ashish Karpe ashishkarpe at gmail.com
Sat Feb 17 07:04:03 PST 2007


hi ,

     Due to previous discussion now we have decided to implement
enable_bidir flag per PIMSM node !! For this purpose we used same
ip_router_alert_option_check as reference !! Before this we had
successfully  managed to enable_bidir  per Vif  ( gmake worked :) ) ......
But now we tried to make it for Per PIMSM node (changes were made as per
node  ) but there is error !! Also

 we made the following changes in the file pim.xif to configure the
pim_bidir flag
per node.

=============================================================
IN pim.xif
---------------


get_pim_bidir?     pim_bidir_name:txt -> enabled:bool
set_pim_bidir    ?  pim_bidir_name:txt & enable:bool
reset_pim_bidir    ?  pim_bidir_name:txt


=============================================================



=============================================================================
IN xorp/etc/templates/pimsm4.tp
-------------------------------

protocols {
    pimsm4 {
    targetname:            txt = "PIMSM_4";
    disable:            toggle = false;
    enabled:            bool;        /* %deprecated */


    enable-pim-bidir:    bool = false;


    interface @: txt {
        vif @: txt {
        disable:        toggle = false;
        enabled:        bool;        /* %deprecated */
        enable-ip-router-alert-option-check:    bool = false;
        dr-priority:        u32 = 1;
        hello-period:        u32 = 30;
        hello-triggered-delay:    u32 = 5;
        alternative-subnet @: ipv4net {
        }
        }
    }





}

protocols {
    pimsm4 {

    -----
    -----
    -----


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

---------------
---------------
---------------
}
===============================================================================

we also wrote the required functions in the xrl_pim_node.cc &.hh files.
also the changes are made in file pim_node.cc by referring flag
_ip_router_flag_check.but we take in the consideration that this flag is per
node the changes are as follows.


IN file xrl_pim_node.cc
*-----------------------------------------------------*/
/*Modification for pim bidir*/


XrlCmdError
XrlPimNode::pim_0_1_get_pim_bidir(
    // Input values,
    const string&    pim_bidir_name,
    // Output values,
    bool&    enabled)
{
    string error_msg;

    bool v;
    if (PimNode::get_pim_bidir(pim_bidir_name, v, error_msg)
    != XORP_OK) {
    return XrlCmdError::COMMAND_FAILED(error_msg);
    }

    enabled = v;
    return XrlCmdError::OKAY();
}

XrlCmdError
XrlPimNode::pim_0_1_set_pim_bidir(
    // Input values,
    const string&    pim_bidir_name,
    const bool&        enable)
{
    string error_msg;

    if (PimNode::set_pim_bidir(pim_bidir_name, enable,
                              error_msg)
    != XORP_OK) {
    return XrlCmdError::COMMAND_FAILED(error_msg);
    }

    return XrlCmdError::OKAY();
}

XrlCmdError
XrlPimNode::pim_0_1_reset_pim_bidir(
    // Input values,
    const string&    pim_bidir_name)
{
    string error_msg;

    if (PimNode::reset_pim_bidir(pim_bidir_name, error_msg)
    != XORP_OK) {
    return XrlCmdError::COMMAND_FAILED(error_msg);
    }

    return XrlCmdError::OKAY();
}


/*-----------------------------------------------------*/

IN file pim_node.cc

PimNode::PimNode(int family, xorp_module_id module_id,
         EventLoop& eventloop)
    : ProtoNode<PimVif>(family, module_id, eventloop),

      _pim_mrt(*this),
      _pim_mrib_table(*this),
      _rp_table(*this),
      _pim_bidir(false),
      _pim_scope_zone_table(*this),
      _pim_bsr(*this),
      _is_switch_to_spt_enabled(false),    // XXX: disabled by defailt

      _switch_to_spt_threshold_interval_sec(0),
      _switch_to_spt_threshold_bytes(0),
      _is_log_trace(false)
..
..
..

IN file pim_node.hh

/*------------------------------------------------------*/
/*modification for pim bidir*/

int        get_pim_bidir(const string& pim_bidir_name,
                             bool& enabled,
                             string& error_msg);



int        set_pim_bidir(const string& pim_bidir_name,
                             bool enable,
                             string& error_msg);



int        reset_pim_bidir(const string& pim_bidir_name,
                               string& error_msg);

/*------------------------------------------------------*/


Error after gmake :-
------------------------------------------------
/.libs/libpim.a(xrl_pim_node.o): In function
`XrlPimNode::pim_0_1_reset_pim_bidir(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
/home/xorp/Desktop/project/bidir-enable/xorp-1.3/pim/xrl_pim_node.cc:5200:
undefined reference to `PimNode::reset_pim_bidir(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
./.libs/libpim.a(xrl_pim_node.o): In function
`XrlPimNode::pim_0_1_set_pim_bidir(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool const&)':
/home/xorp/Desktop/project/bidir-enable/xorp-1.3/pim/xrl_pim_node.cc:5184:
undefined reference to `PimNode::set_pim_bidir(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
./.libs/libpim.a(xrl_pim_node.o): In function
`XrlPimNode::pim_0_1_get_pim_bidir(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool&)':
/home/xorp/Desktop/project/bidir-enable/xorp-1.3/pim/xrl_pim_node.cc:5167:
undefined reference to `PimNode::get_pim_bidir(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool&,
std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
collect2: ld returned 1 exit status
gmake[2]: *** [xorp_pimsm4] Error 1
gmake[2]: Leaving directory `/home/xorp/Desktop/project/bidir-enable/xorp-
1.3/pim'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/xorp/Desktop/project/bidir-enable/xorp-
1.3'
gmake: *** [all] Error 2


can anyone let us know where might be the problem? !!!  : )

Also which flag we should we use as refrence for  per PIMSM node flags
instead of ip_router_flag_check which is per Vif.



Thank you,
Ashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/xorp-hackers/attachments/20070217/a5096858/attachment-0001.html 


More information about the Xorp-hackers mailing list