📄 static_routes_base.cc
字号:
xa_inputs.get_ipv4("nexthop"), xa_inputs.get_string("ifname"), xa_inputs.get_string("vifname"), xa_inputs.get_uint32("metric")); if (e != XrlCmdError::OKAY()) { XLOG_WARNING("Handling method for %s failed: %s", "static_routes/0.1/replace_backup_interface_route4", e.str().c_str()); return e; } } catch (const XrlArgs::XrlAtomNotFound& e) { XLOG_ERROR("Argument not found"); return XrlCmdError::BAD_ARGS(); } return XrlCmdError::OKAY();}const XrlCmdErrorXrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_backup_interface_route6(const XrlArgs& xa_inputs, XrlArgs* /* pxa_outputs */){ if (xa_inputs.size() != 7) { XLOG_ERROR("Wrong number of arguments (%u != %u) handling %s", XORP_UINT_CAST(7), XORP_UINT_CAST(xa_inputs.size()), "static_routes/0.1/replace_backup_interface_route6"); return XrlCmdError::BAD_ARGS(); } /* Return value declarations */ try { XrlCmdError e = static_routes_0_1_replace_backup_interface_route6( xa_inputs.get_bool("unicast"), xa_inputs.get_bool("multicast"), xa_inputs.get_ipv6net("network"), xa_inputs.get_ipv6("nexthop"), xa_inputs.get_string("ifname"), xa_inputs.get_string("vifname"), xa_inputs.get_uint32("metric")); if (e != XrlCmdError::OKAY()) { XLOG_WARNING("Handling method for %s failed: %s", "static_routes/0.1/replace_backup_interface_route6", e.str().c_str()); return e; } } catch (const XrlArgs::XrlAtomNotFound& e) { XLOG_ERROR("Argument not found"); return XrlCmdError::BAD_ARGS(); } return XrlCmdError::OKAY();}const XrlCmdErrorXrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_backup_interface_route4(const XrlArgs& xa_inputs, XrlArgs* /* pxa_outputs */){ if (xa_inputs.size() != 6) { XLOG_ERROR("Wrong number of arguments (%u != %u) handling %s", XORP_UINT_CAST(6), XORP_UINT_CAST(xa_inputs.size()), "static_routes/0.1/delete_backup_interface_route4"); return XrlCmdError::BAD_ARGS(); } /* Return value declarations */ try { XrlCmdError e = static_routes_0_1_delete_backup_interface_route4( xa_inputs.get_bool("unicast"), xa_inputs.get_bool("multicast"), xa_inputs.get_ipv4net("network"), xa_inputs.get_ipv4("nexthop"), xa_inputs.get_string("ifname"), xa_inputs.get_string("vifname")); if (e != XrlCmdError::OKAY()) { XLOG_WARNING("Handling method for %s failed: %s", "static_routes/0.1/delete_backup_interface_route4", e.str().c_str()); return e; } } catch (const XrlArgs::XrlAtomNotFound& e) { XLOG_ERROR("Argument not found"); return XrlCmdError::BAD_ARGS(); } return XrlCmdError::OKAY();}const XrlCmdErrorXrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_backup_interface_route6(const XrlArgs& xa_inputs, XrlArgs* /* pxa_outputs */){ if (xa_inputs.size() != 6) { XLOG_ERROR("Wrong number of arguments (%u != %u) handling %s", XORP_UINT_CAST(6), XORP_UINT_CAST(xa_inputs.size()), "static_routes/0.1/delete_backup_interface_route6"); return XrlCmdError::BAD_ARGS(); } /* Return value declarations */ try { XrlCmdError e = static_routes_0_1_delete_backup_interface_route6( xa_inputs.get_bool("unicast"), xa_inputs.get_bool("multicast"), xa_inputs.get_ipv6net("network"), xa_inputs.get_ipv6("nexthop"), xa_inputs.get_string("ifname"), xa_inputs.get_string("vifname")); if (e != XrlCmdError::OKAY()) { XLOG_WARNING("Handling method for %s failed: %s", "static_routes/0.1/delete_backup_interface_route6", e.str().c_str()); return e; } } catch (const XrlArgs::XrlAtomNotFound& e) { XLOG_ERROR("Argument not found"); return XrlCmdError::BAD_ARGS(); } return XrlCmdError::OKAY();}const XrlCmdErrorXrlStaticRoutesTargetBase::handle_static_routes_0_1_enable_log_trace_all(const XrlArgs& xa_inputs, XrlArgs* /* pxa_outputs */){ if (xa_inputs.size() != 1) { XLOG_ERROR("Wrong number of arguments (%u != %u) handling %s", XORP_UINT_CAST(1), XORP_UINT_CAST(xa_inputs.size()), "static_routes/0.1/enable_log_trace_all"); return XrlCmdError::BAD_ARGS(); } /* Return value declarations */ try { XrlCmdError e = static_routes_0_1_enable_log_trace_all( xa_inputs.get_bool("enable")); if (e != XrlCmdError::OKAY()) { XLOG_WARNING("Handling method for %s failed: %s", "static_routes/0.1/enable_log_trace_all", e.str().c_str()); return e; } } catch (const XrlArgs::XrlAtomNotFound& e) { XLOG_ERROR("Argument not found"); return XrlCmdError::BAD_ARGS(); } return XrlCmdError::OKAY();}voidXrlStaticRoutesTargetBase::add_handlers(){ if (_cmds->add_handler("common/0.1/get_target_name", callback(this, &XrlStaticRoutesTargetBase::handle_common_0_1_get_target_name)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "common/0.1/get_target_name"); } if (_cmds->add_handler("common/0.1/get_version", callback(this, &XrlStaticRoutesTargetBase::handle_common_0_1_get_version)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "common/0.1/get_version"); } if (_cmds->add_handler("common/0.1/get_status", callback(this, &XrlStaticRoutesTargetBase::handle_common_0_1_get_status)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "common/0.1/get_status"); } if (_cmds->add_handler("common/0.1/shutdown", callback(this, &XrlStaticRoutesTargetBase::handle_common_0_1_shutdown)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "common/0.1/shutdown"); } if (_cmds->add_handler("finder_event_observer/0.1/xrl_target_birth", callback(this, &XrlStaticRoutesTargetBase::handle_finder_event_observer_0_1_xrl_target_birth)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "finder_event_observer/0.1/xrl_target_birth"); } if (_cmds->add_handler("finder_event_observer/0.1/xrl_target_death", callback(this, &XrlStaticRoutesTargetBase::handle_finder_event_observer_0_1_xrl_target_death)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "finder_event_observer/0.1/xrl_target_death"); } if (_cmds->add_handler("policy_backend/0.1/configure", callback(this, &XrlStaticRoutesTargetBase::handle_policy_backend_0_1_configure)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "policy_backend/0.1/configure"); } if (_cmds->add_handler("policy_backend/0.1/reset", callback(this, &XrlStaticRoutesTargetBase::handle_policy_backend_0_1_reset)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "policy_backend/0.1/reset"); } if (_cmds->add_handler("policy_backend/0.1/push_routes", callback(this, &XrlStaticRoutesTargetBase::handle_policy_backend_0_1_push_routes)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "policy_backend/0.1/push_routes"); } if (_cmds->add_handler("static_routes/0.1/enable_static_routes", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_enable_static_routes)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/enable_static_routes"); } if (_cmds->add_handler("static_routes/0.1/start_static_routes", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_start_static_routes)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/start_static_routes"); } if (_cmds->add_handler("static_routes/0.1/stop_static_routes", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_stop_static_routes)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/stop_static_routes"); } if (_cmds->add_handler("static_routes/0.1/add_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_route4"); } if (_cmds->add_handler("static_routes/0.1/add_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_route6"); } if (_cmds->add_handler("static_routes/0.1/replace_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_route4"); } if (_cmds->add_handler("static_routes/0.1/replace_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_route6"); } if (_cmds->add_handler("static_routes/0.1/delete_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_route4"); } if (_cmds->add_handler("static_routes/0.1/delete_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_route6"); } if (_cmds->add_handler("static_routes/0.1/add_backup_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_backup_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_backup_route4"); } if (_cmds->add_handler("static_routes/0.1/add_backup_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_backup_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_backup_route6"); } if (_cmds->add_handler("static_routes/0.1/replace_backup_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_backup_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_backup_route4"); } if (_cmds->add_handler("static_routes/0.1/replace_backup_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_backup_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_backup_route6"); } if (_cmds->add_handler("static_routes/0.1/delete_backup_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_backup_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_backup_route4"); } if (_cmds->add_handler("static_routes/0.1/delete_backup_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_backup_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_backup_route6"); } if (_cmds->add_handler("static_routes/0.1/add_interface_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_interface_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_interface_route4"); } if (_cmds->add_handler("static_routes/0.1/add_interface_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_interface_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_interface_route6"); } if (_cmds->add_handler("static_routes/0.1/replace_interface_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_interface_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_interface_route4"); } if (_cmds->add_handler("static_routes/0.1/replace_interface_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_interface_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_interface_route6"); } if (_cmds->add_handler("static_routes/0.1/delete_interface_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_interface_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_interface_route4"); } if (_cmds->add_handler("static_routes/0.1/delete_interface_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_interface_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_interface_route6"); } if (_cmds->add_handler("static_routes/0.1/add_backup_interface_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_backup_interface_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_backup_interface_route4"); } if (_cmds->add_handler("static_routes/0.1/add_backup_interface_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_add_backup_interface_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/add_backup_interface_route6"); } if (_cmds->add_handler("static_routes/0.1/replace_backup_interface_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_backup_interface_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_backup_interface_route4"); } if (_cmds->add_handler("static_routes/0.1/replace_backup_interface_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_replace_backup_interface_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/replace_backup_interface_route6"); } if (_cmds->add_handler("static_routes/0.1/delete_backup_interface_route4", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_backup_interface_route4)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_backup_interface_route4"); } if (_cmds->add_handler("static_routes/0.1/delete_backup_interface_route6", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_delete_backup_interface_route6)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/delete_backup_interface_route6"); } if (_cmds->add_handler("static_routes/0.1/enable_log_trace_all", callback(this, &XrlStaticRoutesTargetBase::handle_static_routes_0_1_enable_log_trace_all)) == false) { XLOG_ERROR("Failed to xrl handler finder://%s/%s", "static_routes", "static_routes/0.1/enable_log_trace_all"); } _cmds->finalize();}voidXrlStaticRoutesTargetBase::remove_handlers(){ _cmds->remove_handler("common/0.1/get_target_name"); _cmds->remove_handler("common/0.1/get_version"); _cmds->remove_handler("common/0.1/get_status"); _cmds->remove_handler("common/0.1/shutdown"); _cmds->remove_handler("finder_event_observer/0.1/xrl_target_birth"); _cmds->remove_handler("finder_event_observer/0.1/xrl_target_death"); _cmds->remove_handler("policy_backend/0.1/configure"); _cmds->remove_handler("policy_backend/0.1/reset"); _cmds->remove_handler("policy_backend/0.1/push_routes"); _cmds->remove_handler("static_routes/0.1/enable_static_routes"); _cmds->remove_handler("static_routes/0.1/start_static_routes"); _cmds->remove_handler("static_routes/0.1/stop_static_routes"); _cmds->remove_handler("static_routes/0.1/add_route4"); _cmds->remove_handler("static_routes/0.1/add_route6"); _cmds->remove_handler("static_routes/0.1/replace_route4"); _cmds->remove_handler("static_routes/0.1/replace_route6"); _cmds->remove_handler("static_routes/0.1/delete_route4"); _cmds->remove_handler("static_routes/0.1/delete_route6"); _cmds->remove_handler("static_routes/0.1/add_backup_route4"); _cmds->remove_handler("static_routes/0.1/add_backup_route6"); _cmds->remove_handler("static_routes/0.1/replace_backup_route4"); _cmds->remove_handler("static_routes/0.1/replace_backup_route6"); _cmds->remove_handler("static_routes/0.1/delete_backup_route4"); _cmds->remove_handler("static_routes/0.1/delete_backup_route6"); _cmds->remove_handler("static_routes/0.1/add_interface_route4"); _cmds->remove_handler("static_routes/0.1/add_interface_route6"); _cmds->remove_handler("static_routes/0.1/replace_interface_route4"); _cmds->remove_handler("static_routes/0.1/replace_interface_route6"); _cmds->remove_handler("static_routes/0.1/delete_interface_route4"); _cmds->remove_handler("static_routes/0.1/delete_interface_route6"); _cmds->remove_handler("static_routes/0.1/add_backup_interface_route4"); _cmds->remove_handler("static_routes/0.1/add_backup_interface_route6"); _cmds->remove_handler("static_routes/0.1/replace_backup_interface_route4"); _cmds->remove_handler("static_routes/0.1/replace_backup_interface_route6"); _cmds->remove_handler("static_routes/0.1/delete_backup_interface_route4"); _cmds->remove_handler("static_routes/0.1/delete_backup_interface_route6"); _cmds->remove_handler("static_routes/0.1/enable_log_trace_all");}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -