[Xorp-hackers] error in setting bidir flag per node !!!
Pavlin Radoslavov
pavlin at icir.org
Sat Feb 17 08:09:49 PST 2007
> 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.
What is the purpose of the "pim_bidir_name" argument?
In your rtrmgr template file you set it to the value of the
enable-pim-bidir flag, which is clearly wrong because pim_bidir_name
has type "txt", while the value has boolean type.
You don't need that argument, so you should remove it from
everywhere.
Regarding your gmake compilation/linkage error: did you implement
the get/set/reset_pim_bidir methods inside PimNode?
Regards,
Pavlin
> =============================================================
> 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
> _______________________________________________
> 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