From noreply at github.com Mon Jul 2 22:11:57 2012 From: noreply at github.com (GitHub) Date: Mon, 02 Jul 2012 22:11:57 -0700 Subject: [Xorp-hackers] [greearb/xorp.ct] 32d7b9: xorp: rib: Key for saving resolved route entries i... Message-ID: <4ff27f1d5139_5bb71b45af42009a0@sh3.rs.github.com.mail> Branch: refs/heads/master Home: https://github.com/greearb/xorp.ct Commit: 32d7b974021ba9608e1ca46c2c632398cfe3c46c https://github.com/greearb/xorp.ct/commit/32d7b974021ba9608e1ca46c2c632398cfe3c46c Author: Igor Maravic Date: 2012-07-02 (Mon, 02 Jul 2012) Changed paths: M xorp/rib/route.hh M xorp/rib/rt_tab_extint.cc M xorp/rib/rt_tab_extint.hh Log Message: ----------- xorp: rib: Key for saving resolved route entries isn't pointer to IPRouteEntry any more, it's IPNet When the connected route is deleted, it's first deleted in PolicyConnectedTable and then after that it's propagated (as different pointer) to other tables. If the external route is resolved to connected nexthop, and the connected nexthop is deleted, problem occures because we can't delete the resolved nexthop, because we're searching with different pointer. Passed all BGP and RIB tests. Signed-off-by: Igor Maravic From greearb at candelatech.com Thu Jul 5 07:36:44 2012 From: greearb at candelatech.com (Ben Greear) Date: Thu, 05 Jul 2012 07:36:44 -0700 Subject: [Xorp-hackers] Fix BGP test fail In-Reply-To: References: Message-ID: <4FF5A67C.8020002@candelatech.com> On 06/29/2012 11:40 AM, Igor Maravi? wrote: > Hi Ben, > I've send the patch. Problem wasn't with my patches, but my patches > just uncovered existing problem. :) > BR > Igor > Thanks..I pushed that a few days ago and the tests look good again. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From igorm at etf.rs Thu Jul 5 07:41:50 2012 From: igorm at etf.rs (=?ISO-8859-2?Q?Igor_Maravi=E6?=) Date: Thu, 5 Jul 2012 16:41:50 +0200 Subject: [Xorp-hackers] Fix BGP test fail In-Reply-To: <4FF5A67C.8020002@candelatech.com> References: <4FF5A67C.8020002@candelatech.com> Message-ID: No problem. But as far as I'm concerned, that test revealed a BUG. When you're resolving BGP route to the direct next hop it's resolved as IPRouteEntry with PeerNextHop. But if the the interface is added to the system, and it can resolve some BGP unresolved route, that's sitting in RIB, BGP route is resolved as external IPRouteEntry... BR Igor 2012/7/5 Ben Greear : > On 06/29/2012 11:40 AM, Igor Maravi? wrote: >> >> Hi Ben, >> I've send the patch. Problem wasn't with my patches, but my patches >> just uncovered existing problem. :) >> BR >> Igor >> > > Thanks..I pushed that a few days ago and the tests look good > again. > > Ben > > -- > Ben Greear > Candela Technologies Inc http://www.candelatech.com > > > From greearb at candelatech.com Mon Jul 9 12:04:16 2012 From: greearb at candelatech.com (greearb at candelatech.com) Date: Mon, 9 Jul 2012 12:04:16 -0700 Subject: [Xorp-hackers] [RFC 1/3] static-mcast: Support multicast address distances. Message-ID: <1341860658-12217-1-git-send-email-greearb@candelatech.com> From: Ben Greear Add RIB-like behaviour for multicast addresses in the MFEA logic. This will allow static multicast routes to over-ride dynamic routes, for instance. PIM currently always uses distance of 1, so if static uses 0, it will win. Signed-off-by: Ben Greear --- xorp/fea/mfea_node.cc | 280 +++++++++++++++++++++++++++++++--- xorp/fea/mfea_node.hh | 74 ++++++++-- xorp/fea/xrl_fea_node.hh | 5 - xorp/fea/xrl_mfea_node.cc | 107 ++++++++----- xorp/fea/xrl_mfea_node.hh | 23 ++- xorp/pim/xrl_pim_node.cc | 2 + xorp/xrl/interfaces/mfea.xif | 27 +++- xorp/xrl/interfaces/mfea_client.xif | 1 - xorp/xrl/interfaces/pim.xif | 2 - 9 files changed, 423 insertions(+), 98 deletions(-) diff --git a/xorp/fea/mfea_node.cc b/xorp/fea/mfea_node.cc index ea65ede..a54de56 100644 --- a/xorp/fea/mfea_node.cc +++ b/xorp/fea/mfea_node.cc @@ -42,6 +42,29 @@ #include "mfea_vif.hh" +MfeaRouteStorage::MfeaRouteStorage(uint32_t d, const string module_name, const IPvX& _source, + const IPvX& _group, const string& _iif_name, const string& _oif_names) : + distance(d), is_binary(false), module_instance_name(module_name), source(_source), + group(_group), iif_name(_iif_name), oif_names(_oif_names) { } + +MfeaRouteStorage::MfeaRouteStorage(uint32_t d, const string module_name, const IPvX& _source, + const IPvX& _group, uint32_t iif_vif_idx, + const Mifset& _oiflist, const Mifset& _oif_disable_wrongvif, + uint32_t max_vifs, const IPvX& _rp_addr) : + distance(d), is_binary(true), module_instance_name(module_name), source(_source), + group(_group), iif_vif_index(iif_vif_idx), oiflist(_oiflist), + oiflist_disable_wrongvif(_oif_disable_wrongvif), max_vifs_oiflist(max_vifs), + rp_addr(_rp_addr) { } + +MfeaRouteStorage::MfeaRouteStorage(const MfeaRouteStorage& o) : + distance(o.distance), is_binary(true), module_instance_name(o.module_instance_name), + source(o.source), group(o.group), iif_name(o.iif_name), + oif_names(o.oif_names), iif_vif_index(o.iif_vif_index), + oiflist(o.oiflist), oiflist_disable_wrongvif(o.oiflist_disable_wrongvif), + max_vifs_oiflist(o.max_vifs_oiflist), rp_addr(o.rp_addr) { } + +MfeaRouteStorage::MfeaRouteStorage() : distance(0), is_binary(false), max_vifs_oiflist(0) { } + /** * MfeaNode::MfeaNode: * @fea_node: The corresponding FeaNode. @@ -1816,10 +1839,106 @@ MfeaNode::signal_dataflow_message_recv(const IPvX& source, const IPvX& group, return (XORP_OK); } +int MfeaNode::add_mfc_str(const string& module_instance_name, + const IPvX& source, + const IPvX& group, + const string& iif_name, + const string& oif_names, + uint32_t distance, + string& error_msg, bool check_stored_routes) { + int rv; + uint32_t iif_vif_index; + + XLOG_INFO("MFEA add_mfc_str, module: %s source: %s group: %s check-stored-routes: %i distance: %u", + module_instance_name.c_str(), source.str().c_str(), + group.str().c_str(), (int)(check_stored_routes), distance); + + if (distance >= MAX_MFEA_DISTANCE) { + error_msg += c_format("distance is above maximimum: %u >= %u\n", + distance, MAX_MFEA_DISTANCE); + return XORP_ERROR; + } + + if (check_stored_routes) { + MfeaRouteStorage mrs(distance, module_instance_name, source, + group, iif_name, oif_names); + routes[mrs.distance][mrs.getHash()] = mrs; + + // If any lower distance routes are already in place, do nothing and + // return. + if (mrs.distance > 0) { + for (unsigned int i = mrs.distance - 1; i > 0; i--) { + map::const_iterator iter = routes[i].find(mrs.getHash()); + if (iter != routes[i].end()) { + XLOG_INFO("Lower-distance mfea route exists, distance: %i source: %s group: %s", + i, source.str().c_str(), group.str().c_str()); + return XORP_OK; + } + } + } + + // If any higher distance routes are already in place, remove them from kernel. + for (unsigned int i = mrs.distance + 1; i::const_iterator iter = routes[i].find(mrs.getHash()); + if (iter != routes[i].end()) { + XLOG_INFO("Removing higher-distance mfea route, distance: %i source: %s group: %s", + i, source.str().c_str(), group.str().c_str()); + delete_mfc(iter->second.module_instance_name, iter->second.source, + iter->second.group, error_msg, false); + break; + } + } + } + + // Convert strings to mfc binary stuff and pass to + // add_mfc() + MfeaVif *mfea_vif = vif_find_by_name(iif_name); + if (!mfea_vif) { + error_msg = "Could not find iif-interface: " + iif_name; + return XORP_ERROR; + } + iif_vif_index = mfea_vif->vif_index(); + + Mifset oiflist; + Mifset oiflist_disable_wrongvif; + istringstream iss(oif_names); + string t; + while (!(iss.eof() || iss.fail())) { + iss >> t; + if (t.size() == 0) + break; + mfea_vif = vif_find_by_name(t); + if (!mfea_vif) { + error_msg = "Could not find oif-interface: " + t; + return XORP_ERROR; + } + uint32_t vi = mfea_vif->vif_index(); + if (vi < MAX_VIFS) { + oiflist.set(vi); + } + else { + error_msg = c_format("Vif %s has invalid vif_index: %u", + mfea_vif->ifname().c_str(), vi); + return XORP_ERROR; + } + } + + IPvX rp_addr; + + rv = add_mfc(module_instance_name, source, group, + iif_vif_index, oiflist, + oiflist_disable_wrongvif, + MAX_VIFS, rp_addr, distance, error_msg, false); + if (rv != XORP_OK) { + error_msg = "call to add_mfc failed"; + } + return rv; +} + /** * MfeaNode::add_mfc: * @module_instance_name: The module instance name of the protocol that adds - * the MFC. + * the MFC. * @source: The source address. * @group: The group address. * @iif_vif_index: The vif index of the incoming interface. @@ -1827,7 +1946,7 @@ MfeaNode::signal_dataflow_message_recv(const IPvX& source, const IPvX& group, * @oiflist_disable_wrongvif: The bitset with the outgoing interfaces to * disable the WRONGVIF signal. * @max_vifs_oiflist: The number of vifs covered by @oiflist - * or @oiflist_disable_wrongvif. + * or @oiflist_disable_wrongvif. * @rp_addr: The RP address. * * Add Multicast Forwarding Cache (MFC) to the kernel. @@ -1835,24 +1954,78 @@ MfeaNode::signal_dataflow_message_recv(const IPvX& source, const IPvX& group, * Return value: %XORP_OK on success, otherwise %XORP_ERROR. **/ int -MfeaNode::add_mfc(const string& , // module_instance_name, +MfeaNode::add_mfc(const string& module_instance_name, const IPvX& source, const IPvX& group, uint32_t iif_vif_index, const Mifset& oiflist, const Mifset& oiflist_disable_wrongvif, uint32_t max_vifs_oiflist, - const IPvX& rp_addr) + const IPvX& rp_addr, uint32_t distance, + string& error_msg, + bool check_stored_routes) { uint8_t oifs_ttl[MAX_VIFS]; uint8_t oifs_flags[MAX_VIFS]; - - if (max_vifs_oiflist > MAX_VIFS) - return (XORP_ERROR); + + XLOG_INFO("MFEA add_mfc, module: %s source: %s group: %s check-stored-routes: %i distance: %u", + module_instance_name.c_str(), source.str().c_str(), + group.str().c_str(), (int)(check_stored_routes), distance); + + if (distance >= MAX_MFEA_DISTANCE) { + error_msg += c_format("distance is above maximimum: %u >= %u\n", + distance, MAX_MFEA_DISTANCE); + return XORP_ERROR; + } + + if (max_vifs_oiflist > MAX_VIFS) { + error_msg += c_format("max-vifs-oiflist: %u > MAX_VIFS: %u\n", + max_vifs_oiflist, MAX_VIFS); + return XORP_ERROR; + } // Check the iif - if (iif_vif_index == Vif::VIF_INDEX_INVALID) - return (XORP_ERROR); - if (iif_vif_index >= max_vifs_oiflist) - return (XORP_ERROR); + if (iif_vif_index == Vif::VIF_INDEX_INVALID) { + error_msg += "iif_vif_index is VIF_INDEX_INVALID\n"; + return XORP_ERROR; + } + + if (iif_vif_index >= max_vifs_oiflist) { + error_msg += c_format("iif_vif_index: %u >= max-vifs-oiflist: %u\n", + iif_vif_index, max_vifs_oiflist); + return XORP_ERROR; + } + + if (check_stored_routes) { + MfeaRouteStorage mrs(distance, module_instance_name, source, + group, iif_vif_index, oiflist, + oiflist_disable_wrongvif, max_vifs_oiflist, + rp_addr); + routes[mrs.distance][mrs.getHash()] = mrs; + + // If any lower distance routes are already in place, do nothing and + // return. + if (mrs.distance > 0) { + for (unsigned int i = mrs.distance - 1; i > 0; i--) { + map::const_iterator iter = routes[i].find(mrs.getHash()); + if (iter != routes[i].end()) { + XLOG_INFO("Lower-distance mfea route exists, distance: %i source: %s group: %s", + i, source.str().c_str(), group.str().c_str()); + return XORP_OK; + } + } + } + + // If any higher distance routes are already in place, remove them from kernel. + for (unsigned int i = mrs.distance + 1; i::const_iterator iter = routes[i].find(mrs.getHash()); + if (iter != routes[i].end()) { + XLOG_INFO("Removing higher-distance mfea route, distance: %i source: %s group: %s", + i, source.str().c_str(), group.str().c_str()); + delete_mfc(iter->second.module_instance_name, iter->second.source, + iter->second.group, error_msg, false); + break; + } + } + } // // Reset the initial values @@ -1889,9 +2062,10 @@ MfeaNode::add_mfc(const string& , // module_instance_name, case AF_INET6: { #ifndef HAVE_IPV6_MULTICAST_ROUTING - XLOG_ERROR("add_mfc() failed: " - "IPv6 multicast routing not supported"); - return (XORP_ERROR); + string em = "add_mfc() failed: IPv6 multicast routing not supported\n"; + error_msg += em; + XLOG_ERROR(em); + return XORP_ERROR; #else #if defined(MRT6_MFC_FLAGS_DISABLE_WRONGVIF) && defined(ENABLE_ADVANCED_MULTICAST_API) oifs_flags[i] |= MRT6_MFC_FLAGS_DISABLE_WRONGVIF; @@ -1911,10 +2085,11 @@ MfeaNode::add_mfc(const string& , // module_instance_name, if (_mfea_mrouter.add_mfc(source, group, iif_vif_index, oifs_ttl, oifs_flags, rp_addr) != XORP_OK) { - return (XORP_ERROR); + error_msg += "mfea_mrouter add_mfc failed.\n"; + return XORP_ERROR; } - return (XORP_OK); + return XORP_OK; } /** @@ -1930,19 +2105,74 @@ MfeaNode::add_mfc(const string& , // module_instance_name, * Return value: %XORP_OK on success, otherwise %XORP_ERROR. **/ int -MfeaNode::delete_mfc(const string& , // module_instance_name, - const IPvX& source, const IPvX& group) +MfeaNode::delete_mfc(const string& module_instance_name, + const IPvX& source, const IPvX& group, + string& error_msg, bool check_stored_routes) { - if (_mfea_mrouter.delete_mfc(source, group) != XORP_OK) { - return (XORP_ERROR); + bool do_rem_route = true; + int rv; + string hash = source.str() + ":" + group.str(); + + XLOG_INFO("delete-mfc, module: %s source: %s group: %s check-stored-routes: %i\n", + module_instance_name.c_str(), source.str().c_str(), + group.str().c_str(), (int)(check_stored_routes)); + + if (check_stored_routes) { + // find existing route by instance-name. + for (unsigned int i = 0; i::iterator iter = routes[i].find(hash); + if (iter != routes[i].end()) { + // Found something to delete..see if it belongs to us? + if (iter->second.module_instance_name == module_instance_name) { + // Yep, that's us. + routes[i].erase(hash); + goto check_remove_route; + } + else { + // was some other protocol's route. Don't mess with this, + // and don't remove anything from the kernel. + do_rem_route = false; + } + } + } } + + check_remove_route: + + if (! do_rem_route) { + return XORP_OK; + } + + rv = _mfea_mrouter.delete_mfc(source, group); - // - // XXX: Remove all corresponding dataflow entries - // + // Remove all corresponding dataflow entries mfea_dft().delete_entry(source, group); - - return (XORP_OK); + + if (check_stored_routes) { + // Now, see if we have any higher-distance routes to add. + for (unsigned int i = 0; i::iterator iter = routes[i].find(hash); + if (iter != routes[i].end()) { + if (iter->second.isBinary()) { + rv = add_mfc(iter->second.module_instance_name, + iter->second.source, iter->second.group, + iter->second.iif_vif_index, + iter->second.oiflist, iter->second.oiflist_disable_wrongvif, + iter->second.max_vifs_oiflist, iter->second.rp_addr, + iter->second.distance, error_msg, false); + } + else { + rv = add_mfc_str(iter->second.module_instance_name, + iter->second.source, iter->second.group, + iter->second.iif_name, iter->second.oif_names, + iter->second.distance, error_msg, false); + } + break; + } + } + } + + return rv; } /** diff --git a/xorp/fea/mfea_node.hh b/xorp/fea/mfea_node.hh index b698a7e..39f08d7 100644 --- a/xorp/fea/mfea_node.hh +++ b/xorp/fea/mfea_node.hh @@ -17,8 +17,6 @@ // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA; // http://xorp.net -// $XORP: xorp/fea/mfea_node.hh,v 1.51 2008/10/02 21:56:49 bms Exp $ - #ifndef __FEA_MFEA_NODE_HH__ #define __FEA_MFEA_NODE_HH__ @@ -48,6 +46,44 @@ class MfeaVif; class SgCount; class VifCount; + +class MfeaRouteStorage { +public: + uint32_t distance; // lower is higer priority. + bool is_binary; + + string module_instance_name; + IPvX source; + IPvX group; + + // String based route + string iif_name; + string oif_names; + + // Binary based route + uint32_t iif_vif_index; + Mifset oiflist; + Mifset oiflist_disable_wrongvif; + uint32_t max_vifs_oiflist; + IPvX rp_addr; + + MfeaRouteStorage(uint32_t d, const string module_name, const IPvX& _source, + const IPvX& _group, const string& _iif_name, const string& _oif_names); + + MfeaRouteStorage(uint32_t d, const string module_name, const IPvX& _source, + const IPvX& _group, uint32_t iif_vif_idx, + const Mifset& _oiflist, const Mifset& _oif_disable_wrongvif, + uint32_t max_vifs, const IPvX& _rp_addr); + + MfeaRouteStorage(const MfeaRouteStorage& o); + MfeaRouteStorage(); + + bool isBinary() const { return is_binary; } + + string getHash() { return source.str() + ":" + group.str(); } +}; + + /** * @short The MFEA node class. * @@ -580,12 +616,22 @@ public: * * @return XORP_OK on success, otherwise XORP_ERROR. */ - int add_mfc(const string& module_instance_name, - const IPvX& source, const IPvX& group, - uint32_t iif_vif_index, const Mifset& oiflist, - const Mifset& oiflist_disable_wrongvif, - uint32_t max_vifs_oiflist, - const IPvX& rp_addr); + int add_mfc(const string& module_instance_name, + const IPvX& source, const IPvX& group, + uint32_t iif_vif_index, const Mifset& oiflist, + const Mifset& oiflist_disable_wrongvif, + uint32_t max_vifs_oiflist, + const IPvX& rp_addr, uint32_t distance, + string& error_msg, + bool check_stored_routes); + + int add_mfc_str(const string& module_instance_name, + const IPvX& source, + const IPvX& group, + const string& iif_name, + const string& oif_names, + uint32_t distance, + string& error_msg, bool check_stored_routes); /** * Delete Multicast Forwarding Cache (MFC) from the kernel. @@ -601,8 +647,9 @@ public: * * @return XORP_OK on success, otherwise XORP_ERROR. */ - int delete_mfc(const string& module_instance_name, - const IPvX& source, const IPvX& group); + int delete_mfc(const string& module_instance_name, + const IPvX& source, const IPvX& group, + string& error_msg, bool check_stored_routes); /** * Add a dataflow monitor entry. @@ -854,6 +901,13 @@ private: IfTree _mfea_iftree; IfConfigUpdateReplicator _mfea_iftree_update_replicator; + // Store desired routes. This is a cheap way of doing some of the + // RIB logic, but for mcast routes. + // Lower distance means higher priority. + // key is: source:group, ie: 192.168.1.1:226.0.0.1 +#define MAX_MFEA_DISTANCE 8 + map routes[MAX_MFEA_DISTANCE]; + // // Debug and test-related state // diff --git a/xorp/fea/xrl_fea_node.hh b/xorp/fea/xrl_fea_node.hh index 0096d30..31831f3 100644 --- a/xorp/fea/xrl_fea_node.hh +++ b/xorp/fea/xrl_fea_node.hh @@ -17,9 +17,6 @@ // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA; // http://xorp.net -// $XORP: xorp/fea/xrl_fea_node.hh,v 1.15 2008/10/02 21:56:50 bms Exp $ - - #ifndef __FEA_XRL_FEA_NODE_HH__ #define __FEA_XRL_FEA_NODE_HH__ @@ -29,9 +26,7 @@ // #include "libxorp/xorp.h" - #include "libxipc/xrl_std_router.hh" - #include "cli/xrl_cli_node.hh" #include "fea_node.hh" diff --git a/xorp/fea/xrl_mfea_node.cc b/xorp/fea/xrl_mfea_node.cc index a3db058..2eb10c1 100644 --- a/xorp/fea/xrl_mfea_node.cc +++ b/xorp/fea/xrl_mfea_node.cc @@ -895,7 +895,8 @@ XrlMfeaNode::mfea_0_1_add_mfc6( const vector& oiflist, const vector& oiflist_disable_wrongvif, const uint32_t& max_vifs_oiflist, - const IPv6& rp_address) + const IPv6& rp_address, + const uint32_t& distance) { string error_msg; Mifset mifset; @@ -930,21 +931,17 @@ XrlMfeaNode::mfea_0_1_add_mfc6( IPvX(source_address), IPvX(group_address), iif_vif_index, mifset, mifset_disable_wrongvif, max_vifs_oiflist, - IPvX(rp_address)) + IPvX(rp_address), distance, error_msg, true) != XORP_OK) { - // TODO: must find-out and return the reason for failure - error_msg = c_format("Cannot add MFC for " - "source %s and group %s " - "with iif_vif_index = %u", - source_address.str().c_str(), - group_address.str().c_str(), - XORP_UINT_CAST(iif_vif_index)); + error_msg += c_format("Cannot add MFC for " + "source %s and group %s " + "with iif_vif_index = %u", + source_address.str().c_str(), + group_address.str().c_str(), + XORP_UINT_CAST(iif_vif_index)); return XrlCmdError::COMMAND_FAILED(error_msg); } - // - // Success - // return XrlCmdError::OKAY(); } @@ -967,19 +964,16 @@ XrlMfeaNode::mfea_0_1_delete_mfc6( } if (MfeaNode::delete_mfc(xrl_sender_name, - IPvX(source_address), IPvX(group_address)) + IPvX(source_address), IPvX(group_address), + error_msg, true) != XORP_OK) { - // TODO: must find-out and return the reason for failure - error_msg = c_format("Cannot delete MFC for " - "source %s and group %s", - source_address.str().c_str(), - group_address.str().c_str()); + error_msg += c_format("Cannot delete MFC for " + "source %s and group %s", + source_address.str().c_str(), + group_address.str().c_str()); return XrlCmdError::COMMAND_FAILED(error_msg); } - // - // Success - // return XrlCmdError::OKAY(); } @@ -1190,7 +1184,8 @@ XrlMfeaNode::mfea_0_1_add_mfc4( const vector& oiflist, const vector& oiflist_disable_wrongvif, const uint32_t& max_vifs_oiflist, - const IPv4& rp_address) + const IPv4& rp_address, + const uint32_t& distance) { string error_msg; Mifset mifset; @@ -1225,21 +1220,53 @@ XrlMfeaNode::mfea_0_1_add_mfc4( IPvX(source_address), IPvX(group_address), iif_vif_index, mifset, mifset_disable_wrongvif, max_vifs_oiflist, - IPvX(rp_address)) + IPvX(rp_address), distance, error_msg, true) != XORP_OK) { - // TODO: must find-out and return the reason for failure - error_msg = c_format("Cannot add MFC for " - "source %s and group %s " - "with iif_vif_index = %u", - source_address.str().c_str(), - group_address.str().c_str(), - XORP_UINT_CAST(iif_vif_index)); + error_msg += c_format("Cannot add MFC for " + "source %s and group %s " + "with iif_vif_index = %u", + source_address.str().c_str(), + group_address.str().c_str(), + XORP_UINT_CAST(iif_vif_index)); return XrlCmdError::COMMAND_FAILED(error_msg); } + return XrlCmdError::OKAY(); +} + +XrlCmdError +XrlMfeaNode::mfea_0_1_add_mfc4_str( + // Input values, + const string& xrl_sender_name, + const IPv4& source_address, + const IPv4& group_address, + const string& iif_ifname, + const string& oif_ifnames, + const uint32_t& distance) +{ + string error_msg; + + XLOG_INFO("received mfea add-mfc command, sender-name: %s input: %s mcast-addr: %s ifname: %s output_ifs: %s\n", + xrl_sender_name.c_str(), + source_address.str().c_str(), + group_address.str().c_str(), + iif_ifname.c_str(), + oif_ifnames.c_str()); // - // Success + // Verify the address family // + if (! MfeaNode::is_ipv4()) { + error_msg = c_format("Received protocol message with " + "invalid address family: IPv4"); + return XrlCmdError::COMMAND_FAILED(error_msg); + } + + if (MfeaNode::add_mfc_str(xrl_sender_name, + IPvX(source_address), IPvX(group_address), + iif_ifname, oif_ifnames, distance, error_msg, true) != XORP_OK) { + return XrlCmdError::COMMAND_FAILED(error_msg); + } + return XrlCmdError::OKAY(); } @@ -1262,19 +1289,16 @@ XrlMfeaNode::mfea_0_1_delete_mfc4( } if (MfeaNode::delete_mfc(xrl_sender_name, - IPvX(source_address), IPvX(group_address)) + IPvX(source_address), IPvX(group_address), + error_msg, true) != XORP_OK) { - // TODO: must find-out and return the reason for failure - error_msg = c_format("Cannot delete MFC for " - "source %s and group %s", - source_address.str().c_str(), - group_address.str().c_str()); + error_msg += c_format("Cannot delete MFC for " + "source %s and group %s", + source_address.str().c_str(), + group_address.str().c_str()); return XrlCmdError::COMMAND_FAILED(error_msg); } - // - // Success - // return XrlCmdError::OKAY(); } @@ -1435,8 +1459,9 @@ XrlMfeaNode::mfea_0_1_start_vif( { string error_msg; - if (MfeaNode::start_vif(vif_name, error_msg) != XORP_OK) + if (MfeaNode::start_vif(vif_name, error_msg) != XORP_OK) { return XrlCmdError::COMMAND_FAILED(error_msg); + } return XrlCmdError::OKAY(); } diff --git a/xorp/fea/xrl_mfea_node.hh b/xorp/fea/xrl_mfea_node.hh index 11efb40..ed9367d 100644 --- a/xorp/fea/xrl_mfea_node.hh +++ b/xorp/fea/xrl_mfea_node.hh @@ -269,7 +269,8 @@ protected: const vector& oiflist, const vector& oiflist_disable_wrongvif, const uint32_t& max_vifs_oiflist, - const IPv6& rp_address); + const IPv6& rp_address, + const uint32_t& distance); XrlCmdError mfea_0_1_delete_mfc6( // Input values, @@ -359,13 +360,23 @@ protected: const IPv4& source_address, const IPv4& group_address, const uint32_t& iif_vif_index, - const vector& oiflist, - const vector& oiflist_disable_wrongvif, - const uint32_t& max_vifs_oiflist, - const IPv4& rp_address); + const vector& oiflist, + const vector& oiflist_disable_wrongvif, + const uint32_t& max_vifs_oiflist, + const IPv4& rp_address, + const uint32_t& distance); + + XrlCmdError mfea_0_1_add_mfc4_str( + // Input values, + const string& xrl_sender_name, + const IPv4& source_address, + const IPv4& group_address, + const string& iif_ifname, + const string& oif_ifnames, + const uint32_t& distance); XrlCmdError mfea_0_1_delete_mfc4( - // Input values, + // Input values, const string& xrl_sender_name, const IPv4& source_address, const IPv4& group_address); diff --git a/xorp/pim/xrl_pim_node.cc b/xorp/pim/xrl_pim_node.cc index d5db99a..07a32eb 100644 --- a/xorp/pim/xrl_pim_node.cc +++ b/xorp/pim/xrl_pim_node.cc @@ -1656,6 +1656,7 @@ XrlPimNode::send_add_delete_mfc() oiflist_disable_wrongvif_vector, max_vifs_oiflist, rp_addr.get_ipv4(), + 1, /* default distance is 1 for PIM */ callback(this, &XrlPimNode::mfea_client_send_add_delete_mfc_cb)); if (success) return; @@ -1673,6 +1674,7 @@ XrlPimNode::send_add_delete_mfc() oiflist_disable_wrongvif_vector, max_vifs_oiflist, rp_addr.get_ipv6(), + 1, /* default distance is 1 for PIM */ callback(this, &XrlPimNode::mfea_client_send_add_delete_mfc_cb)); if (success) return; diff --git a/xorp/xrl/interfaces/mfea.xif b/xorp/xrl/interfaces/mfea.xif index 00fd6b1..3f778c5 100644 --- a/xorp/xrl/interfaces/mfea.xif +++ b/xorp/xrl/interfaces/mfea.xif @@ -1,4 +1,3 @@ -/* $XORP: xorp/xrl/interfaces/mfea.xif,v 1.9 2007/05/19 01:52:48 pavlin Exp $ */ #include @@ -41,9 +40,9 @@ interface mfea/0.1 { * * @param xrl_sender_name the XRL name of the originator of this XRL. * @param if_name the name of the interface to unregister for the - * particular protocol. + * particular protocol. * @param vif_name the name of the vif to unregister for the - * particular protocol. + * particular protocol. */ unregister_protocol4 ? xrl_sender_name:txt \ & if_name:txt & vif_name:txt; @@ -55,12 +54,12 @@ interface mfea/0.1 { * @param source_address the source address of the MFC to add/delete. * @param group_address the group address of the MFC to add/delete. * @param iif_vif_index the index of the vif that is the incoming - * interface. + * interface. * @param oiflist the bit-vector with the set of outgoing interfaces. * @param oiflist_disable_wrongvif the bit-vector with the set of - * outgoing interfaces to disable WRONGVIF kernel signal. + * outgoing interfaces to disable WRONGVIF kernel signal. * @param max_vifs_oiflist the number of vifs covered - * by oiflist or oiflist_disable_wrongvif . + * by oiflist or oiflist_disable_wrongvif . * @param rp_address the RP address of the MFC to add. */ add_mfc4 ? xrl_sender_name:txt \ @@ -69,9 +68,20 @@ interface mfea/0.1 { & oiflist:binary \ & oiflist_disable_wrongvif:binary \ & max_vifs_oiflist:u32 \ - & rp_address:ipv4; + & rp_address:ipv4 \ + & distance:u32; delete_mfc4 ? xrl_sender_name:txt \ & source_address:ipv4 & group_address:ipv4; + + /** + * Use strings instead of indexes. Let mfea do the mapping. + */ + add_mfc4_str ? xrl_sender_name:txt \ + & source_address:ipv4 \ + & group_address:ipv4 \ + & iif_name:txt \ + & oif_names:txt \ + & distance:u32; /** * Add/delete a dataflow monitor with the MFEA. @@ -193,7 +203,8 @@ interface mfea/0.1 { & oiflist:binary \ & oiflist_disable_wrongvif:binary \ & max_vifs_oiflist:u32 \ - & rp_address:ipv6; + & rp_address:ipv6 \ + & distance:u32; delete_mfc6 ? xrl_sender_name:txt \ & source_address:ipv6 & group_address:ipv6; add_dataflow_monitor6 ? xrl_sender_name:txt \ diff --git a/xorp/xrl/interfaces/mfea_client.xif b/xorp/xrl/interfaces/mfea_client.xif index 8cecda3..4100190 100644 --- a/xorp/xrl/interfaces/mfea_client.xif +++ b/xorp/xrl/interfaces/mfea_client.xif @@ -1,4 +1,3 @@ -/* $XORP: xorp/xrl/interfaces/mfea_client.xif,v 1.11 2007/05/19 01:52:48 pavlin Exp $ */ #include diff --git a/xorp/xrl/interfaces/pim.xif b/xorp/xrl/interfaces/pim.xif index e38806d..617b3e2 100644 --- a/xorp/xrl/interfaces/pim.xif +++ b/xorp/xrl/interfaces/pim.xif @@ -1,5 +1,3 @@ -/* $XORP: xorp/xrl/interfaces/pim.xif,v 1.24 2007/07/12 21:35:29 pavlin Exp $ */ - /* * Protocol Independent Multicast XRL interface. */ -- 1.7.7.6 From greearb at candelatech.com Mon Jul 9 12:04:17 2012 From: greearb at candelatech.com (greearb at candelatech.com) Date: Mon, 9 Jul 2012 12:04:17 -0700 Subject: [Xorp-hackers] [RFC 2/3] Whitespace cleanup. In-Reply-To: <1341860658-12217-1-git-send-email-greearb@candelatech.com> References: <1341860658-12217-1-git-send-email-greearb@candelatech.com> Message-ID: <1341860658-12217-2-git-send-email-greearb@candelatech.com> From: Ben Greear --- xorp/libproto/proto_node.hh | 3 --- xorp/rib/rib_manager.hh | 2 -- 2 files changed, 0 insertions(+), 5 deletions(-) diff --git a/xorp/libproto/proto_node.hh b/xorp/libproto/proto_node.hh index e6f1055..58253e6 100644 --- a/xorp/libproto/proto_node.hh +++ b/xorp/libproto/proto_node.hh @@ -24,9 +24,6 @@ #define __LIBPROTO_PROTO_NODE_HH__ - - - #include "libxorp/xorp.h" #include "libxorp/xlog.h" #include "libxorp/callback.hh" diff --git a/xorp/rib/rib_manager.hh b/xorp/rib/rib_manager.hh index a74180b..f80c331 100644 --- a/xorp/rib/rib_manager.hh +++ b/xorp/rib/rib_manager.hh @@ -18,8 +18,6 @@ // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA; // http://xorp.net -// $XORP: xorp/rib/rib_manager.hh,v 1.39 2008/10/02 21:58:11 bms Exp $ - #ifndef __RIB_RIB_MANAGER_HH__ #define __RIB_RIB_MANAGER_HH__ -- 1.7.7.6 From greearb at candelatech.com Mon Jul 9 12:04:18 2012 From: greearb at candelatech.com (greearb at candelatech.com) Date: Mon, 9 Jul 2012 12:04:18 -0700 Subject: [Xorp-hackers] [RFC 3/3] static-mcast: Add support for static multicast routes. In-Reply-To: <1341860658-12217-1-git-send-email-greearb@candelatech.com> References: <1341860658-12217-1-git-send-email-greearb@candelatech.com> Message-ID: <1341860658-12217-3-git-send-email-greearb@candelatech.com> From: Ben Greear This adds the ability to configure static multicast routes using the static-route module. Example config file looks like: interfaces { interface "p3p1" { disable: false default-system-config } interface "wlan0" { disable: false default-system-config } } fea { unicast-forwarding4 { disable: false } } protocols { static { route 10.2.46.91/16 { next-hop: 10.2.46.20 metric: 1 } mrib-route 10.2.46.0/16 { next-hop: 10.2.46.30 metric: 1 } mcast-route 226.0.0.1 { input_if: "p3p1" input_ip: 192.168.9.11 output_ifs: "wlan0" distance: 2 } } } plumbing { mfea4 { disable: false interface "p3p1" { vif "p3p1" { disable: false } } interface "wlan0" { vif "wlan0" { disable: false } } interface "register_vif" { vif "register_vif" { disable: false } } } /* mfea4 */ } /* plumbing */ Signed-off-by: Ben Greear --- xorp/etc/templates/static_routes.tp | 39 +++- xorp/static_routes/SConscript | 1 + xorp/static_routes/static_routes_node.cc | 185 +++++++++++ xorp/static_routes/static_routes_node.hh | 214 ++++++++----- xorp/static_routes/xorp_static_routes.cc | 5 +- xorp/static_routes/xrl_static_routes_node.cc | 459 +++++++++++++++++++++++++- xorp/static_routes/xrl_static_routes_node.hh | 131 +++++++- xorp/xrl/interfaces/static_routes.xif | 8 +- xorp/xrl/targets/static_routes.tgt | 3 +- 9 files changed, 956 insertions(+), 89 deletions(-) diff --git a/xorp/etc/templates/static_routes.tp b/xorp/etc/templates/static_routes.tp index f8359d0..9f69c54 100644 --- a/xorp/etc/templates/static_routes.tp +++ b/xorp/etc/templates/static_routes.tp @@ -1,4 +1,3 @@ -/* $XORP: xorp/etc/templates/static_routes.tp,v 1.43 2008/08/06 08:23:24 abittau Exp $ */ protocols { static { @@ -26,6 +25,13 @@ protocols { } } + mcast-route @: ipv4 { + input_if: txt; + input_ip: ipv4; + output_ifs: txt; + distance: u32 = 0; + } + route4 @: ipv4net { /* %deprecated */ next-hop: ipv4; nexthop: ipv4; /* %deprecated */ @@ -284,6 +290,37 @@ protocols { } } + mcast-route @: ipv4 { + %help: short "Configure a static Multicast route"; + %mandatory: $(@.input_if), $(@.input_ip), $(@.output_ifs); + + %create: xrl "$(static.targetname)/static_routes/0.1/add_mcast_route4?mcast_addr:ipv4=$(@)&input_if:txt=$(@.input_if)&input_ip:ipv4=$(@.input_ip)&output_ifs:txt=$(@.output_ifs)&distance:u32=$(@.distance)"; + %update: xrl "$(static.targetname)/static_routes/0.1/replace_mcast_route4?mcast_addr:ipv4=$(@)&input_if:txt=$(@.input_if)&input_ip:ipv4=$(@.input_ip)&output_ifs:txt=$(@.output_ifs))&distance:u32=$(@.distance)"; + %delete: xrl "$(static.targetname)/static_routes/0.1/delete_mcast_route4?mcast_addr:ipv4=$(@)&input_ip:ipv4=$(@.input_ip)"; + + input_if { + %help: short "Configure the input interface"; + %set:; + } + + input_ip { + %help: short "Configure the input IP address"; + %set:; + } + + output_ifs { + %help: short "Configure the input output interface(s)"; + %set:; + } + + distance { + %help: short "Configure the routing distance. Lower value wins"; + %allow-range: $(@) "0" "7" %help: "The routing distance"; + %set:; + } + } + + route4 @: ipv4net { %deprecated: "Statement 'route4' is replaced with 'route'"; %help: short "Configure an IPv4 static route"; diff --git a/xorp/static_routes/SConscript b/xorp/static_routes/SConscript index 583432a..5b69ef9 100644 --- a/xorp/static_routes/SConscript +++ b/xorp/static_routes/SConscript @@ -51,6 +51,7 @@ env.AppendUnique(LIBS = [ 'xst_fea_ifmgr_mirror', 'xst_static_routes', 'xif_rib', + 'xif_mfea', 'xif_finder_event_notifier', 'xorp_policy_backend', 'xorp_policy_common', diff --git a/xorp/static_routes/static_routes_node.cc b/xorp/static_routes/static_routes_node.cc index 06a8a9f..f8934ad 100644 --- a/xorp/static_routes/static_routes_node.cc +++ b/xorp/static_routes/static_routes_node.cc @@ -121,6 +121,9 @@ StaticRoutesNode::shutdown() // rib_register_shutdown(); + // De-register with the MFEA + rib_register_shutdown(); + // // De-register with the FEA // @@ -306,6 +309,7 @@ StaticRoutesNode::updates_made() StaticRoutesNode::Table::iterator route_iter; list add_routes, replace_routes, delete_routes; list::iterator pending_iter; + list::iterator mpending_iter; for (route_iter = _static_routes.begin(); route_iter != _static_routes.end(); @@ -395,6 +399,80 @@ StaticRoutesNode::updates_made() } } + // Deal with mcast-routes + list add_mroutes, replace_mroutes, delete_mroutes; + map::iterator mroute_iter; + for (mroute_iter = _mcast_routes.begin(); + mroute_iter != _mcast_routes.end(); + ++mroute_iter) { + McastRoute& static_route = mroute_iter->second; + bool is_old_up = false; + bool is_new_up = false; + string old_ifname, old_vifname, new_ifname, new_vifname; + + // + // Calculate whether the interface was UP before and now. + // + const IfMgrIfAtom* if_atom; + const IfMgrVifAtom* vif_atom; + + if_atom = _iftree.find_interface(static_route.ifname()); + vif_atom = _iftree.find_vif(static_route.ifname(), + static_route.vifname()); + if ((if_atom != NULL) && (if_atom->enabled()) + && (! if_atom->no_carrier()) + && (vif_atom != NULL) && (vif_atom->enabled())) { + is_old_up = true; + } + + if_atom = ifmgr_iftree().find_interface(static_route.ifname()); + vif_atom = ifmgr_iftree().find_vif(static_route.ifname(), + static_route.vifname()); + if ((if_atom != NULL) && (if_atom->enabled()) + && (! if_atom->no_carrier()) + && (vif_atom != NULL) && (vif_atom->enabled())) { + is_new_up = true; + } + + if ((is_old_up == is_new_up) + && (old_ifname == new_ifname) + && (old_vifname == new_vifname)) { + continue; // Nothing changed + } + + if ((! is_old_up) && (! is_new_up)) { + // + // The interface is still down, so nothing to do + // + continue; + } + if ((! is_old_up) && (is_new_up)) { + // + // The interface is now up, hence add the route + // + add_mroutes.push_back(&static_route); + continue; + } + if ((is_old_up) && (! is_new_up)) { + // + // The interface went down, hence cancel all pending requests, + // and withdraw the route. + // + delete_mroutes.push_back(&static_route); + continue; + } + if (is_old_up && is_new_up) { + // + // The interface remains up, hence probably the interface or + // the vif name has changed. + // Delete the route and then add it again so the information + // in the RIB will be updated. + // + replace_mroutes.push_back(&static_route); + continue; + } + } + // // Update the local copy of the interface tree // @@ -444,6 +522,44 @@ StaticRoutesNode::updates_made() copy_route.set_delete_route(); inform_rib(copy_route); } + + + // + // Process all pending "add mroute" requests + // + for (mpending_iter = add_mroutes.begin(); + mpending_iter != add_mroutes.end(); + ++pending_iter) { + McastRoute& orig_route = *(*mpending_iter); + McastRoute copy_route = orig_route; + copy_route.set_add_route(); + inform_mfea(copy_route); + } + + // + // Process all pending "replace mroute" requests + // + for (mpending_iter = replace_mroutes.begin(); + mpending_iter != replace_mroutes.end(); + ++mpending_iter) { + McastRoute& orig_route = *(*mpending_iter); + McastRoute copy_route = orig_route; + copy_route.set_replace_route(); + inform_mfea(copy_route); + } + + // + // Process all pending "delete mroute" requests + // + for (mpending_iter = delete_mroutes.begin(); + mpending_iter != delete_mroutes.end(); + ++mpending_iter) { + McastRoute& orig_route = *(*mpending_iter); + cancel_mfea_mfc_change(orig_route); + McastRoute copy_route = orig_route; + copy_route.set_delete_route(); + inform_mfea(copy_route); + } } /** @@ -670,6 +786,65 @@ StaticRoutesNode::delete_route6(bool unicast, bool multicast, return (delete_route(static_route, error_msg)); } +int StaticRoutesNode::add_mcast_route4(const IPv4& mcast_addr, const string& input_if, + const IPv4& input_ip, const string& output_ifs, + uint32_t distance, string& error_msg) { + map::const_iterator iter = _mcast_routes.find(mcast_addr); + if (iter == _mcast_routes.end()) { + McastRoute mr(mcast_addr, input_if, input_ip, output_ifs, distance); + _mcast_routes[mcast_addr] = mr; + McastRoute copy_route = mr; + copy_route.set_add_route(); + inform_mfea(copy_route); + } + else { + error_msg.append("Mcast-Route: " + mcast_addr.str() + " already exists!\n"); + return XORP_ERROR; + } + return XORP_OK; +} + +int StaticRoutesNode::replace_mcast_route4(const IPv4& mcast_addr, const string& input_if, + const IPv4& input_ip, const string& output_ifs, + uint32_t distance, string& error_msg) { + UNUSED(error_msg); + + McastRoute mr(mcast_addr, input_if, input_ip, output_ifs, distance); + map::const_iterator iter = _mcast_routes.find(mcast_addr); + if (iter == _mcast_routes.end()) { + if (iter->second == mr) { + // no changes + return XORP_OK; + } + } + _mcast_routes.erase(mcast_addr); + _mcast_routes[mcast_addr] = mr; + + McastRoute copy_route = mr; + copy_route.set_replace_route(); + inform_mfea(copy_route); + + return XORP_OK; +} + + +int StaticRoutesNode::delete_mcast_route4(const IPv4& mcast_addr, const IPv4& input_ip, + string& error_msg) { + UNUSED(error_msg); + + map::const_iterator iter = _mcast_routes.find(mcast_addr); + if (iter != _mcast_routes.end()) { + _mcast_routes.erase(mcast_addr); + + McastRoute mr(mcast_addr, input_ip); + mr.set_delete_route(); + inform_mfea(mr); + } + + return XORP_OK; +} + + /** * Find a route from the routing table. * @@ -1296,6 +1471,16 @@ StaticRoutesNode::inform_rib(const StaticRoute& route) inform_rib_route_change(modified_route); } + +void +StaticRoutesNode::inform_mfea(const McastRoute& route) +{ + if (! is_enabled()) + return; + + inform_mfea_mfc_change(route); +} + /** * Update a route received from the user configuration. * diff --git a/xorp/static_routes/static_routes_node.hh b/xorp/static_routes/static_routes_node.hh index 907dbeb..53106be 100644 --- a/xorp/static_routes/static_routes_node.hh +++ b/xorp/static_routes/static_routes_node.hh @@ -18,8 +18,6 @@ // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA; // http://xorp.net -// $XORP: xorp/static_routes/static_routes_node.hh,v 1.32 2008/10/02 21:58:29 bms Exp $ - #ifndef __STATIC_ROUTES_STATIC_ROUTES_NODE_HH__ #define __STATIC_ROUTES_STATIC_ROUTES_NODE_HH__ @@ -29,23 +27,91 @@ // - #include "libxorp/service.hh" #include "libxorp/status_codes.h" - #include "libfeaclient/ifmgr_xrl_mirror.hh" - #include "policy/backend/policytags.hh" #include "policy/backend/policy_filters.hh" class EventLoop; + +class StaticRouteBase { +protected: + enum RouteType { IDLE_ROUTE, ADD_ROUTE, REPLACE_ROUTE, DELETE_ROUTE }; + RouteType _route_type; + bool _is_ignored; // True if the route is to be ignored + +public: + + StaticRouteBase() : _route_type(IDLE_ROUTE), _is_ignored(false) { } + virtual ~StaticRouteBase() { } + + /** + * Test if this is a route to add. + * + * @return true if this is a route to add, otherwise false. + */ + bool is_add_route() const { return (_route_type == ADD_ROUTE); } + + /** + * Test if this is a replacement route. + * + * @return true if this is a replacement route, otherwise false. + */ + bool is_replace_route() const { return (_route_type == REPLACE_ROUTE); } + + /** + * Test if this is a route to delete. + * + * @return true if this is a route to delete, otherwise false. + */ + bool is_delete_route() const { return (_route_type == DELETE_ROUTE); } + + /** + * Set the type of this route to "a route to add". + */ + void set_add_route() { _route_type = ADD_ROUTE; } + + /** + * Set the type of this route to "a replacement route". + */ + void set_replace_route() { _route_type = REPLACE_ROUTE; } + + /** + * Set the type of this route to "a route to delete". + */ + void set_delete_route() { _route_type = DELETE_ROUTE; } + + + /** + * Test if the route is to be ignored. + * + * This method is used only for internal purpose when passing the route + * around. + * + * @return true if the route is to be ignored, otherwise false. + */ + bool is_ignored() const { return _is_ignored; } + + /** + * Set whether the route is to be ignored. + * + * This method is used only for internal purpose when passing the route + * around. + * + * @param v true if the route is to be ignored, otherwise false. + */ + void set_ignored(bool v) { _is_ignored = v; } + +}; + /** * @short A StaticRoute helper class. * * This class is used to store a routing entry. */ -class StaticRoute { +class StaticRoute : public StaticRouteBase { public: /** * Constructor for a given IPv4 static route. @@ -68,12 +134,11 @@ public: const IPv4Net& network, const IPv4& nexthop, const string& ifname, const string& vifname, uint32_t metric, bool is_backup_route) - : _unicast(unicast), _multicast(multicast), - _network(network), _nexthop(nexthop), - _ifname(ifname), _vifname(vifname), - _metric(metric), _is_backup_route(is_backup_route), - _route_type(IDLE_ROUTE), _is_ignored(false), - _is_filtered(false), _is_accepted_by_nexthop(false) {} + : _unicast(unicast), _multicast(multicast), + _network(network), _nexthop(nexthop), + _ifname(ifname), _vifname(vifname), + _metric(metric), _is_backup_route(is_backup_route), + _is_filtered(false), _is_accepted_by_nexthop(false) {} #ifdef XORP_USE_USTL StaticRoute() { } @@ -100,12 +165,11 @@ public: const IPv6Net& network, const IPv6& nexthop, const string& ifname, const string& vifname, uint32_t metric, bool is_backup_route) - : _unicast(unicast), _multicast(multicast), - _network(network), _nexthop(nexthop), - _ifname(ifname), _vifname(vifname), - _metric(metric), _is_backup_route(is_backup_route), - _route_type(IDLE_ROUTE), _is_ignored(false), - _is_filtered(false), _is_accepted_by_nexthop(false) {} + : _unicast(unicast), _multicast(multicast), + _network(network), _nexthop(nexthop), + _ifname(ifname), _vifname(vifname), + _metric(metric), _is_backup_route(is_backup_route), + _is_filtered(false), _is_accepted_by_nexthop(false) {} /** * Equality Operator @@ -231,42 +295,6 @@ public: bool is_backup_route() const { return _is_backup_route; } /** - * Test if this is a route to add. - * - * @return true if this is a route to add, otherwise false. - */ - bool is_add_route() const { return (_route_type == ADD_ROUTE); } - - /** - * Test if this is a replacement route. - * - * @return true if this is a replacement route, otherwise false. - */ - bool is_replace_route() const { return (_route_type == REPLACE_ROUTE); } - - /** - * Test if this is a route to delete. - * - * @return true if this is a route to delete, otherwise false. - */ - bool is_delete_route() const { return (_route_type == DELETE_ROUTE); } - - /** - * Set the type of this route to "a route to add". - */ - void set_add_route() { _route_type = ADD_ROUTE; } - - /** - * Set the type of this route to "a replacement route". - */ - void set_replace_route() { _route_type = REPLACE_ROUTE; } - - /** - * Set the type of this route to "a route to delete". - */ - void set_delete_route() { _route_type = DELETE_ROUTE; } - - /** * Test if the route is interface-specific (e.g., if the interface * is explicitly specified). * @@ -284,26 +312,6 @@ public: bool is_valid_entry(string& error_msg) const; /** - * Test if the route is to be ignored. - * - * This method is used only for internal purpose when passing the route - * around. - * - * @return true if the route is to be ignored, otherwise false. - */ - bool is_ignored() const { return _is_ignored; } - - /** - * Set whether the route is to be ignored. - * - * This method is used only for internal purpose when passing the route - * around. - * - * @param v true if the route is to be ignored, otherwise false. - */ - void set_ignored(bool v) { _is_ignored = v; } - - /** * @return policy-tags for this route. */ PolicyTags& policytags() { return _policytags; } @@ -359,15 +367,48 @@ private: string _vifname; uint32_t _metric; bool _is_backup_route; - enum RouteType { IDLE_ROUTE, ADD_ROUTE, REPLACE_ROUTE, DELETE_ROUTE }; - RouteType _route_type; - bool _is_ignored; // True if the route is to be ignored bool _is_filtered; // True if rejected by a policy filter bool _is_accepted_by_nexthop; // True if the route is accepted based on its next-hop information PolicyTags _policytags; }; +class McastRoute : public StaticRouteBase { +protected: + IPvX _mcast_addr; + string _ifname; // assume vifname == ifname + IPvX _input_ip; + string _output_ifs; // assume vifname == ifname + uint32_t _distance; + +public: + McastRoute() { }; + McastRoute(const IPvX& addr, const string& ifname, const IPvX& input_ip, + const string& output_ifs, uint32_t distance) : + _mcast_addr(addr), _ifname(ifname), _input_ip(input_ip), + _output_ifs(output_ifs), _distance(distance) { } + + McastRoute(const IPvX& addr, const IPvX& input_ip) : + _mcast_addr(addr), _input_ip(input_ip) { } + + bool operator==(const McastRoute& other) const { + if (this == &other) + return true; + return (_mcast_addr == other._mcast_addr && + _ifname == other._ifname && + _input_ip == other._input_ip && + _output_ifs == other._output_ifs && + _distance == other._distance); + } + + const IPvX& mcast_addr() const { return _mcast_addr; } + const string& ifname() const { return _ifname; } + const string& vifname() const { return ifname(); } + const IPvX& input_ip() const { return _input_ip; } + const string& output_ifs() const { return _output_ifs; } + const uint32_t& distance() const { return _distance; } +}; + /** * @short The StaticRoutes node class. * @@ -597,6 +638,19 @@ public: const string& vifname, bool is_backup_route, string& error_msg); + + int add_mcast_route4(const IPv4& mcast_addr, const string& input_if, + const IPv4& input_ip, const string& output_ifs, + uint32_t distance, string& error_msg); + + int replace_mcast_route4(const IPv4& mcast_addr, const string& input_if, + const IPv4& input_ip, const string& output_ifs, + uint32_t distance, string& error_msg); + + int delete_mcast_route4(const IPv4& mcast_addr, const IPv4& input_ip, + string& error_msg); + + /** * Find a route from the routing table. * @@ -814,6 +868,10 @@ private: */ virtual void cancel_rib_route_change(const StaticRoute& static_route) = 0; + virtual void inform_mfea_mfc_change(const McastRoute& static_route) = 0; + virtual void cancel_mfea_mfc_change(const McastRoute& static_route) = 0; + void inform_mfea(const McastRoute& route); + /** * Update a route received from the user configuration. * @@ -873,6 +931,8 @@ private: map _winning_routes_unicast; map _winning_routes_multicast; + map _mcast_routes; + // // Status-related state // diff --git a/xorp/static_routes/xorp_static_routes.cc b/xorp/static_routes/xorp_static_routes.cc index dcf3b67..cce5ee4 100644 --- a/xorp/static_routes/xorp_static_routes.cc +++ b/xorp/static_routes/xorp_static_routes.cc @@ -31,7 +31,7 @@ #include "libxorp/callback.hh" #include "libxorp/eventloop.hh" #include "libxorp/exceptions.hh" - +#include "libproto/proto_unit.hh" #include "xrl_static_routes_node.hh" #ifdef HAVE_GETOPT_H @@ -106,7 +106,8 @@ static_routes_main(const string& finder_hostname, uint16_t finder_port) { finder_port, "finder", "fea", - "rib"); + "rib", + xorp_module_name(AF_INET, XORP_MODULE_MFEA)); wait_until_xrl_router_is_ready(eventloop, xrl_static_routes_node.xrl_router()); diff --git a/xorp/static_routes/xrl_static_routes_node.cc b/xorp/static_routes/xrl_static_routes_node.cc index a3a4079..c9551a7 100644 --- a/xorp/static_routes/xrl_static_routes_node.cc +++ b/xorp/static_routes/xrl_static_routes_node.cc @@ -39,16 +39,19 @@ XrlStaticRoutesNode::XrlStaticRoutesNode(EventLoop& eventloop, uint16_t finder_port, const string& finder_target, const string& fea_target, - const string& rib_target) + const string& rib_target, + const string& mfea_target) : StaticRoutesNode(eventloop), XrlStdRouter(eventloop, class_name.c_str(), finder_hostname.c_str(), finder_port), XrlStaticRoutesTargetBase(&xrl_router()), _eventloop(eventloop), _xrl_rib_client(&xrl_router()), + _xrl_mfea_client(&xrl_router()), _finder_target(finder_target), _fea_target(fea_target), _rib_target(rib_target), + _mfea_target(mfea_target), _ifmgr(eventloop, fea_target.c_str(), xrl_router().finder_address(), xrl_router().finder_port()), _xrl_finder_client(&xrl_router()), @@ -61,7 +64,9 @@ XrlStaticRoutesNode::XrlStaticRoutesNode(EventLoop& eventloop, _is_rib_registered(false), _is_rib_registering(false), _is_rib_deregistering(false), - _is_rib_igp_table4_registered(false) + _is_rib_igp_table4_registered(false), + _is_mfea_alive(false), + _is_mfea_registered(false) #ifdef HAVE_IPV6 , _is_rib_igp_table6_registered(false) #endif @@ -222,6 +227,208 @@ XrlStaticRoutesNode::finder_register_interest_fea_cb(const XrlError& xrl_error) } } + +// +// Register with the MFEA +// +void +XrlStaticRoutesNode::mfea_register_startup() +{ + bool success; + + _mfea_register_startup_timer.unschedule(); + _mfea_register_shutdown_timer.unschedule(); + + if (! _is_finder_alive) + return; // The Finder is dead + + if (_is_mfea_registered) + return; // Already registered + + _is_fea_registering = true; + + // + // Register interest in the FEA with the Finder + // + success = _xrl_finder_client.send_register_class_event_interest( + _finder_target.c_str(), xrl_router().instance_name(), _mfea_target, + callback(this, &XrlStaticRoutesNode::finder_register_interest_mfea_cb)); + + if (! success) { + // + // If an error, then start a timer to try again. + // + _mfea_register_startup_timer = _eventloop.new_oneoff_after( + RETRY_TIMEVAL, + callback(this, &XrlStaticRoutesNode::mfea_register_startup)); + return; + } +} + +void +XrlStaticRoutesNode::finder_register_interest_mfea_cb(const XrlError& xrl_error) +{ + switch (xrl_error.error_code()) { + case OKAY: + _is_mfea_registering = false; + _is_mfea_registered = true; + break; + + case COMMAND_FAILED: + // + // If a command failed because the other side rejected it, this is + // fatal. + // + XLOG_FATAL("Cannot register interest in Finder events: %s", + xrl_error.str().c_str()); + break; + + case NO_FINDER: + case RESOLVE_FAILED: + case SEND_FAILED: + // + // A communication error that should have been caught elsewhere + // (e.g., by tracking the status of the Finder and the other targets). + // Probably we caught it here because of event reordering. + // In some cases we print an error. In other cases our job is done. + // + XLOG_ERROR("XRL communication error: %s", xrl_error.str().c_str()); + break; + + case BAD_ARGS: + case NO_SUCH_METHOD: + case INTERNAL_ERROR: + // + // An error that should happen only if there is something unusual: + // e.g., there is XRL mismatch, no enough internal resources, etc. + // We don't try to recover from such errors, hence this is fatal. + // + XLOG_FATAL("Fatal XRL error: %s", xrl_error.str().c_str()); + break; + + case REPLY_TIMED_OUT: + case SEND_FAILED_TRANSIENT: + // + // If a transient error, then start a timer to try again + // (unless the timer is already running). + // + if (! _mfea_register_startup_timer.scheduled()) { + XLOG_ERROR("Failed to register interest in Finder events: %s. " + "Will try again.", + xrl_error.str().c_str()); + _mfea_register_startup_timer = _eventloop.new_oneoff_after( + RETRY_TIMEVAL, + callback(this, &XrlStaticRoutesNode::mfea_register_startup)); + } + break; + } +} + +// +// De-register with the RIB +// +void +XrlStaticRoutesNode::mfea_register_shutdown() +{ + bool success; + + _mfea_register_startup_timer.unschedule(); + _mfea_register_shutdown_timer.unschedule(); + + if (! _is_finder_alive) + return; // The Finder is dead + + if (! _is_mfea_alive) + return; // The MFEA is not there anymore + + if (! _is_mfea_registered) + return; // Not registered + + if (! _is_mfea_deregistering) { + StaticRoutesNode::incr_shutdown_requests_n(); + _is_mfea_deregistering = true; + } + + success = _xrl_finder_client.send_deregister_class_event_interest( + _finder_target.c_str(), xrl_router().instance_name(), _mfea_target, + callback(this, &XrlStaticRoutesNode::finder_deregister_interest_mfea_cb)); + + if (! success) { + // + // If an error, then start a timer to try again. + // + _mfea_register_shutdown_timer = _eventloop.new_oneoff_after( + RETRY_TIMEVAL, + callback(this, &XrlStaticRoutesNode::mfea_register_shutdown)); + return; + } +} + +void +XrlStaticRoutesNode::finder_deregister_interest_mfea_cb( + const XrlError& xrl_error) +{ + switch (xrl_error.error_code()) { + case OKAY: + // + // If success, then we are done + // + _is_mfea_deregistering = false; + _is_mfea_registered = false; + break; + + case COMMAND_FAILED: + // + // If a command failed because the other side rejected it, this is + // fatal. + // + XLOG_FATAL("Cannot deregister interest in Finder events: %s", + xrl_error.str().c_str()); + break; + + case NO_FINDER: + case RESOLVE_FAILED: + case SEND_FAILED: + // + // A communication error that should have been caught elsewhere + // (e.g., by tracking the status of the Finder and the other targets). + // Probably we caught it here because of event reordering. + // In some cases we print an error. In other cases our job is done. + // + _is_mfea_deregistering = false; + _is_mfea_registered = false; + break; + + case BAD_ARGS: + case NO_SUCH_METHOD: + case INTERNAL_ERROR: + // + // An error that should happen only if there is something unusual: + // e.g., there is XRL mismatch, no enough internal resources, etc. + // We don't try to recover from such errors, hence this is fatal. + // + XLOG_FATAL("Fatal XRL error: %s", xrl_error.str().c_str()); + break; + + case REPLY_TIMED_OUT: + case SEND_FAILED_TRANSIENT: + // + // If a transient error, then start a timer to try again + // (unless the timer is already running). + // + if (! _mfea_register_shutdown_timer.scheduled()) { + XLOG_ERROR("Failed to deregister interest in Finder events: %s. " + "Will try again.", + xrl_error.str().c_str()); + _mfea_register_shutdown_timer = _eventloop.new_oneoff_after( + RETRY_TIMEVAL, + callback(this, &XrlStaticRoutesNode::mfea_register_shutdown)); + } + break; + } +} + + // // De-register with the FEA // @@ -445,6 +652,7 @@ XrlStaticRoutesNode::finder_register_interest_rib_cb(const XrlError& xrl_error) } } + // // De-register with the RIB // @@ -1036,6 +1244,10 @@ XrlStaticRoutesNode::finder_event_observer_0_1_xrl_target_birth( send_rib_add_tables(); } + if (target_class == _mfea_target) { + _is_mfea_alive = true; + } + return XrlCmdError::OKAY(); UNUSED(target_instance); } @@ -1070,6 +1282,16 @@ XrlStaticRoutesNode::finder_event_observer_0_1_xrl_target_death( do_shutdown = true; } + if (target_class == _mfea_target) { + // If it was never started (by us), then ignore. + if (_is_mfea_alive) { + XLOG_ERROR("MFEA (instance %s) has died, shutting down.", + target_instance.c_str()); + do_shutdown = true; + _is_mfea_alive = false; + } + } + if (do_shutdown) StaticRoutesNode::shutdown(); @@ -1251,6 +1473,51 @@ XrlStaticRoutesNode::static_routes_0_1_delete_route6( return XrlCmdError::OKAY(); } +XrlCmdError XrlStaticRoutesNode::static_routes_0_1_add_mcast_route4( + // Input values, + const IPv4& mcast_addr, + const string& input_if, + const IPv4& input_ip, + const string& output_ifs, + const uint32_t& distance) +{ + string error_msg; + if (StaticRoutesNode::add_mcast_route4(mcast_addr, input_if, input_ip, output_ifs, distance, error_msg) != XORP_OK) { + return XrlCmdError::COMMAND_FAILED(error_msg); + } + return XrlCmdError::OKAY(); +} + +XrlCmdError XrlStaticRoutesNode::static_routes_0_1_replace_mcast_route4( + // Input values, + const IPv4& mcast_addr, + const string& input_if, + const IPv4& input_ip, + const string& output_ifs, + const uint32_t& distance) +{ + string error_msg; + if (StaticRoutesNode::replace_mcast_route4(mcast_addr, input_if, input_ip, output_ifs, distance, error_msg) != XORP_OK) { + return XrlCmdError::COMMAND_FAILED(error_msg); + } + return XrlCmdError::OKAY(); +} + + +XrlCmdError XrlStaticRoutesNode::static_routes_0_1_delete_mcast_route4( + // Input values, + const IPv4& mcast_addr, + const IPv4& input_ip) +{ + string error_msg; + if (StaticRoutesNode::delete_mcast_route4(mcast_addr, input_ip, error_msg) != XORP_OK) { + return XrlCmdError::COMMAND_FAILED(error_msg); + } + return XrlCmdError::OKAY(); +} + + + /** * Add/replace/delete a backup static route. * @@ -1757,6 +2024,33 @@ XrlStaticRoutesNode::inform_rib_route_change(const StaticRoute& static_route) } } +void +XrlStaticRoutesNode::inform_mfea_mfc_change(const McastRoute& static_route) +{ + // Add the request to the queue + _inform_mfea_queue.push_back(static_route); + + // If the queue was empty before, start sending the routes + if (_inform_mfea_queue.size() == 1) { + send_mfea_mfc_change(); + } +} + +void +XrlStaticRoutesNode::cancel_mfea_mfc_change(const McastRoute& static_route) +{ + list::iterator iter; + + for (iter = _inform_mfea_queue.begin(); + iter != _inform_mfea_queue.end(); + ++iter) { + McastRoute& tmp_static_route = *iter; + if (tmp_static_route == static_route) + tmp_static_route.set_ignored(true); + } +} + + /** * Cancel a pending request to inform the RIB about a route change. * @@ -1995,6 +2289,167 @@ XrlStaticRoutesNode::send_rib_route_change() } } + +void +XrlStaticRoutesNode::send_mfea_mfc_change() +{ + bool success = true; + + if (! _is_finder_alive) + return; // The Finder is dead + + do { + // Pop-up all routes that are to be ignored + if (_inform_mfea_queue.empty()) + return; // No more route changes to send + + McastRoute& tmp_static_route = _inform_mfea_queue.front(); + if (tmp_static_route.is_ignored()) { + _inform_mfea_queue.pop_front(); + continue; + } + break; + } while (true); + + McastRoute& static_route = _inform_mfea_queue.front(); + + // + // Check whether we have already registered with the MFEA + // + if (! _is_mfea_registered) { + mfea_register_startup(); + success = false; + goto start_timer_label; + } + + // + // Send the appropriate XRL + // + if (static_route.is_add_route() || static_route.is_replace_route()) { + XLOG_INFO("sending mfea add-mfc command, input: %s mcast-addr: %s ifname: %s output_ifs: %s\n", + static_route.input_ip().str().c_str(), + static_route.mcast_addr().str().c_str(), + static_route.ifname().c_str(), + static_route.output_ifs().c_str()); + success = _xrl_mfea_client.send_add_mfc4_str( + _mfea_target.c_str(), + StaticRoutesNode::protocol_name(), + static_route.input_ip().get_ipv4(), + static_route.mcast_addr().get_ipv4(), + static_route.ifname(), + static_route.output_ifs(), + static_route.distance(), + callback(this, &XrlStaticRoutesNode::send_mfea_mfc_change_cb)); + if (success) + return; + } + + if (static_route.is_delete_route()) { + success = _xrl_mfea_client.send_delete_mfc4( + _mfea_target.c_str(), + StaticRoutesNode::protocol_name(), + static_route.input_ip().get_ipv4(), + static_route.mcast_addr().get_ipv4(), + callback(this, &XrlStaticRoutesNode::send_mfea_mfc_change_cb)); + if (success) + return; + } + + if (! success) { + // + // If an error, then start a timer to try again. + // + XLOG_ERROR("Failed to %s mcast-route for %s with the RIB. " + "Will try again.", + (static_route.is_add_route())? "add" + : (static_route.is_replace_route())? "replace" + : "delete", + static_route.mcast_addr().str().c_str()); + start_timer_label: + _inform_mfea_queue_timer = _eventloop.new_oneoff_after( + RETRY_TIMEVAL, + callback(this, &XrlStaticRoutesNode::send_mfea_mfc_change)); + } +} + +void +XrlStaticRoutesNode::send_mfea_mfc_change_cb(const XrlError& xrl_error) +{ + switch (xrl_error.error_code()) { + case OKAY: + // + // If success, then send the next route change + // + _inform_mfea_queue.pop_front(); + send_mfea_mfc_change(); + break; + + case COMMAND_FAILED: + // + // If a command failed because the other side rejected it, + // then print an error and send the next one. + // + XLOG_ERROR("Cannot %s an mcast-routing entry with the MFEA: %s", + (_inform_mfea_queue.front().is_add_route())? "add" + : (_inform_mfea_queue.front().is_replace_route())? "replace" + : "delete", + xrl_error.str().c_str()); + _inform_mfea_queue.pop_front(); + send_mfea_mfc_change(); + break; + + case NO_FINDER: + case RESOLVE_FAILED: + case SEND_FAILED: + // + // A communication error that should have been caught elsewhere + // (e.g., by tracking the status of the Finder and the other targets). + // Probably we caught it here because of event reordering. + // In some cases we print an error. In other cases our job is done. + // + XLOG_ERROR("Cannot %s an mcast-routing entry with the MFEA: %s", + (_inform_mfea_queue.front().is_add_route())? "add" + : (_inform_mfea_queue.front().is_replace_route())? "replace" + : "delete", + xrl_error.str().c_str()); + _inform_mfea_queue.pop_front(); + send_mfea_mfc_change(); + break; + + case BAD_ARGS: + case NO_SUCH_METHOD: + case INTERNAL_ERROR: + // + // An error that should happen only if there is something unusual: + // e.g., there is XRL mismatch, no enough internal resources, etc. + // We don't try to recover from such errors, hence this is fatal. + // + XLOG_FATAL("Fatal XRL error: %s", xrl_error.str().c_str()); + break; + + case REPLY_TIMED_OUT: + case SEND_FAILED_TRANSIENT: + // + // If a transient error, then start a timer to try again + // (unless the timer is already running). + // + if (! _inform_mfea_queue_timer.scheduled()) { + XLOG_ERROR("Failed to %s an mcast-routing entry with the RIB: %s. " + "Will try again.", + (_inform_mfea_queue.front().is_add_route())? "add" + : (_inform_mfea_queue.front().is_replace_route())? "replace" + : "delete", + xrl_error.str().c_str()); + _inform_mfea_queue_timer = _eventloop.new_oneoff_after( + RETRY_TIMEVAL, + callback(this, &XrlStaticRoutesNode::send_mfea_mfc_change)); + } + break; + } +} + + + void XrlStaticRoutesNode::send_rib_route_change_cb(const XrlError& xrl_error) { diff --git a/xorp/static_routes/xrl_static_routes_node.hh b/xorp/static_routes/xrl_static_routes_node.hh index 905d2ac..aff1585 100644 --- a/xorp/static_routes/xrl_static_routes_node.hh +++ b/xorp/static_routes/xrl_static_routes_node.hh @@ -18,7 +18,6 @@ // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA; // http://xorp.net -// $XORP: xorp/static_routes/xrl_static_routes_node.hh,v 1.26 2008/10/02 21:58:29 bms Exp $ #ifndef __STATIC_ROUTES_XRL_STATIC_ROUTES_NODE_HH__ #define __STATIC_ROUTES_XRL_STATIC_ROUTES_NODE_HH__ @@ -29,11 +28,10 @@ // #include "libxipc/xrl_std_router.hh" - #include "libfeaclient/ifmgr_xrl_mirror.hh" - #include "xrl/interfaces/finder_event_notifier_xif.hh" #include "xrl/interfaces/rib_xif.hh" +#include "xrl/interfaces/mfea_xif.hh" #include "xrl/targets/static_routes_base.hh" #include "static_routes_node.hh" @@ -52,8 +50,9 @@ public: uint16_t finder_port, const string& finder_target, const string& fea_target, - const string& rib_target); - ~XrlStaticRoutesNode(); + const string& rib_target, + const string& mfea_target); + virtual ~XrlStaticRoutesNode(); /** * Startup the node operation. @@ -210,6 +209,37 @@ protected: const IPv6& nexthop); /** + * Add/replace/delete multicast routes (not MRIB) + * + * @param mcast_addr Multicast-address to be routed. + * + * @param input_if Input interface name. + * + * @param input_ip Input interface IP address. + * + * @param output_ifs Output interface name(s). Space-separated list. + */ + XrlCmdError static_routes_0_1_add_mcast_route4( + // Input values, + const IPv4& mcast_addr, + const string& input_if, + const IPv4& input_ip, + const string& output_ifs, + const uint32_t& distance); + + XrlCmdError static_routes_0_1_replace_mcast_route4( + // Input values, + const IPv4& mcast_addr, + const string& input_if, + const IPv4& input_ip, + const string& output_ifs, + const uint32_t& distance); + XrlCmdError static_routes_0_1_delete_mcast_route4( + // Input values, + const IPv4& mcast_addr, + const IPv4& input_ip); + + /** * Add/replace/delete a backup static route. * * @param unicast if true, then the route would be used for unicast @@ -442,6 +472,73 @@ protected: // Input values, const bool& enable); + XrlCmdError mfea_client_0_1_recv_kernel_signal_message4( + // Input values, + const string&, + const uint32_t&, + const string&, + const uint32_t&, + const IPv4&, + const IPv4&, + const vector&) { + return XrlCmdError::OKAY(); + } + + XrlCmdError mfea_client_0_1_recv_dataflow_signal4( + // Input values, + const string&, + const IPv4&, + const IPv4&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const bool&, + const bool&, + const bool&, + const bool&) { + return XrlCmdError::OKAY(); + } + + +#ifdef HAVE_IPV6 + XrlCmdError mfea_client_0_1_recv_kernel_signal_message6( + // Input values, + const string&, + const uint32_t&, + const string&, + const uint32_t&, + const IPv6&, + const IPv6&, + const vector&) { + return XrlCmdError::OKAY(); + } + + XrlCmdError mfea_client_0_1_recv_dataflow_signal6( + // Input values, + const string&, + const IPv6&, + const IPv6&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const uint32_t&, + const bool&, + const bool&, + const bool&, + const bool&) { + return XrlCmdError::OKAY(); + } +#endif + /** * Configure a policy filter. * @@ -493,6 +590,11 @@ private: void fea_register_shutdown(); void finder_deregister_interest_fea_cb(const XrlError& xrl_error); + void mfea_register_startup(); + void finder_register_interest_mfea_cb(const XrlError& xrl_error); + void mfea_register_shutdown(); + void finder_deregister_interest_mfea_cb(const XrlError& xrl_error); + void rib_register_startup(); void finder_register_interest_rib_cb(const XrlError& xrl_error); void rib_register_shutdown(); @@ -515,6 +617,7 @@ private: */ void inform_rib_route_change(const StaticRoute& static_route); + /** * Cancel a pending request to inform the RIB about a route change. * @@ -522,18 +625,28 @@ private: */ void cancel_rib_route_change(const StaticRoute& static_route); + void inform_mfea_mfc_change(const McastRoute& static_route); + void cancel_mfea_mfc_change(const McastRoute& static_route); + void send_rib_route_change(); void send_rib_route_change_cb(const XrlError& xrl_error); + void send_mfea_mfc_change(); + void send_mfea_mfc_change_cb(const XrlError& xrl_error); + EventLoop& _eventloop; XrlRibV0p1Client _xrl_rib_client; + XrlMfeaV0p1Client _xrl_mfea_client; const string _finder_target; const string _fea_target; const string _rib_target; + const string _mfea_target; IfMgrXrlMirror _ifmgr; list _inform_rib_queue; XorpTimer _inform_rib_queue_timer; + list _inform_mfea_queue; + XorpTimer _inform_mfea_queue_timer; XrlFinderEventNotifierV0p1Client _xrl_finder_client; static const TimeVal RETRY_TIMEVAL; @@ -552,6 +665,14 @@ private: bool _is_rib_registering; bool _is_rib_deregistering; bool _is_rib_igp_table4_registered; + + bool _is_mfea_alive; + bool _is_mfea_registered; + bool _is_mfea_registering; + bool _is_mfea_deregistering; + XorpTimer _mfea_register_startup_timer; + XorpTimer _mfea_register_shutdown_timer; + #ifdef HAVE_IPV6 bool _is_rib_igp_table6_registered; #endif diff --git a/xorp/xrl/interfaces/static_routes.xif b/xorp/xrl/interfaces/static_routes.xif index f6da4f8..38a1622 100644 --- a/xorp/xrl/interfaces/static_routes.xif +++ b/xorp/xrl/interfaces/static_routes.xif @@ -1,4 +1,3 @@ -/* $XORP: xorp/xrl/interfaces/static_routes.xif,v 1.4 2007/01/23 01:57:38 pavlin Exp $ */ /* * Static Routes XRL interface. @@ -48,6 +47,13 @@ interface static_routes/0.1 { & nexthop:ipv6; /** + * Add/replace/delete multicast routes + */ + add_mcast_route4 ? mcast_addr:ipv4 & input_if:txt & input_ip:ipv4 & output_ifs:txt & distance:u32; + replace_mcast_route4 ? mcast_addr:ipv4 & input_if:txt & input_ip:ipv4 & output_ifs:txt & distance:u32; + delete_mcast_route4 ? mcast_addr:ipv4 & input_ip:ipv4; + + /** * Add/replace/delete a backup static route. * * @param unicast if true, then the route would be used for unicast diff --git a/xorp/xrl/targets/static_routes.tgt b/xorp/xrl/targets/static_routes.tgt index 1bf764f..54e6396 100644 --- a/xorp/xrl/targets/static_routes.tgt +++ b/xorp/xrl/targets/static_routes.tgt @@ -1,11 +1,12 @@ -/* $XORP: xorp/xrl/targets/static_routes.tgt,v 1.4 2007/05/31 19:02:28 pavlin Exp $ */ #include "common.xif" #include "finder_event_observer.xif" #include "policy_backend.xif" #include "static_routes.xif" +#include "mfea_client.xif" target static_routes implements common/0.1, \ finder_event_observer/0.1, \ policy_backend/0.1, \ + mfea_client/0.1, \ static_routes/0.1; -- 1.7.7.6 From noreply at github.com Fri Jul 13 16:18:56 2012 From: noreply at github.com (GitHub) Date: Fri, 13 Jul 2012 16:18:56 -0700 Subject: [Xorp-hackers] [greearb/xorp.ct] 5d2311: static: Add 'mcast-route' framework. Message-ID: <5000ace0d2b20_1680e71ae4121569@sh3.rs.github.com.mail> Branch: refs/heads/master Home: https://github.com/greearb/xorp.ct Commit: 5d2311adc5256cf25b08cc3400b2be62863c779a https://github.com/greearb/xorp.ct/commit/5d2311adc5256cf25b08cc3400b2be62863c779a Author: Ben Greear Date: 2012-06-20 (Wed, 20 Jun 2012) Changed paths: M xorp/etc/templates/static_routes.tp M xorp/static_routes/static_routes_node.cc M xorp/static_routes/static_routes_node.hh M xorp/static_routes/xrl_static_routes_node.cc M xorp/static_routes/xrl_static_routes_node.hh M xorp/xrl/interfaces/mfea.xif M xorp/xrl/interfaces/static_routes.xif M xorp/xrl/targets/static_routes.tgt Log Message: ----------- static: Add 'mcast-route' framework. Signed-off-by: Ben Greear Commit: 2651a0dc575c2f06c2e87b5632f70331d396ef37 https://github.com/greearb/xorp.ct/commit/2651a0dc575c2f06c2e87b5632f70331d396ef37 Author: Ben Greear Date: 2012-06-20 (Wed, 20 Jun 2012) Changed paths: M xorp/rib/rib_manager.hh M xorp/rib/xrl_target.cc M xorp/rib/xrl_target.hh M xorp/static_routes/static_routes_node.cc M xorp/static_routes/static_routes_node.hh M xorp/static_routes/xrl_static_routes_node.cc M xorp/static_routes/xrl_static_routes_node.hh M xorp/xrl/interfaces/rib.xif M xorp/xrl/interfaces/rib_client.xif Log Message: ----------- static/mcast: Add much of the mcast-route logic to the static protocol. fea logic is just dummied out at this point, and probably everything needs more work. Commit: b6db4f0b2a6218ef9fbaf28c94d45c97ad99bd9a https://github.com/greearb/xorp.ct/commit/b6db4f0b2a6218ef9fbaf28c94d45c97ad99bd9a Author: Ben Greear Date: 2012-06-20 (Wed, 20 Jun 2012) Changed paths: M xorp/fea/mfea_node.cc M xorp/fea/mfea_node.hh M xorp/fea/xrl_fea_node.hh M xorp/fea/xrl_mfea_node.cc M xorp/fea/xrl_mfea_node.hh M xorp/static_routes/SConscript M xorp/static_routes/static_routes_node.cc M xorp/static_routes/xorp_static_routes.cc M xorp/static_routes/xrl_static_routes_node.cc M xorp/static_routes/xrl_static_routes_node.hh M xorp/xrl/interfaces/mfea.xif M xorp/xrl/interfaces/mfea_client.xif M xorp/xrl/interfaces/pim.xif M xorp/xrl/interfaces/rib.xif M xorp/xrl/targets/static_routes.tgt Log Message: ----------- static/mfea: Have static module call directly to MFEA Instead of previous idea to push this all through the RIB. Commit: 48998f1bc99b6c27b44c924ac27f460dadefd25a https://github.com/greearb/xorp.ct/commit/48998f1bc99b6c27b44c924ac27f460dadefd25a Author: Ben Greear Date: 2012-06-20 (Wed, 20 Jun 2012) Changed paths: M xorp/static_routes/static_routes_node.cc M xorp/static_routes/static_routes_node.hh M xorp/static_routes/xrl_static_routes_node.cc M xorp/static_routes/xrl_static_routes_node.hh Log Message: ----------- static/mfea: Rename rib -> mfea That better describes what is actually happening. Commit: 521eab57cc2edc1b3c197e1d2e9d1b174dd4c9a4 https://github.com/greearb/xorp.ct/commit/521eab57cc2edc1b3c197e1d2e9d1b174dd4c9a4 Author: Ben Greear Date: 2012-06-20 (Wed, 20 Jun 2012) Changed paths: M xorp/etc/templates/static_routes.tp M xorp/fea/mfea_node.cc M xorp/fea/xrl_mfea_node.cc M xorp/libproto/proto_node.hh M xorp/static_routes/xrl_static_routes_node.cc Log Message: ----------- static/mfea: Fix up some bugs Template file issues, etc. Commit: 65667793a73ecc5523343d9697e29cd96375c738 https://github.com/greearb/xorp.ct/commit/65667793a73ecc5523343d9697e29cd96375c738 Author: Ben Greear Date: 2012-06-20 (Wed, 20 Jun 2012) Changed paths: M xorp/fea/mfea_node.cc M xorp/fea/mfea_node.hh M xorp/fea/xrl_mfea_node.cc Log Message: ----------- static/mcast: Support multiple mcast routes of different distances. This allows static routes to over-ride ones created by PIM. Route distance is currently fixed: static == 0, pim == 1. Lower distance wins. Signed-off-by: Ben Greear Commit: 8462aa7ca32dba39488717b9169f79215ce580c0 https://github.com/greearb/xorp.ct/commit/8462aa7ca32dba39488717b9169f79215ce580c0 Author: Ben Greear Date: 2012-06-20 (Wed, 20 Jun 2012) Changed paths: M xorp/etc/templates/static_routes.tp M xorp/fea/mfea_node.cc M xorp/fea/mfea_node.hh M xorp/fea/xrl_mfea_node.cc M xorp/fea/xrl_mfea_node.hh M xorp/pim/xrl_pim_node.cc M xorp/static_routes/static_routes_node.cc M xorp/static_routes/static_routes_node.hh M xorp/static_routes/xrl_static_routes_node.cc M xorp/static_routes/xrl_static_routes_node.hh M xorp/xrl/interfaces/mfea.xif M xorp/xrl/interfaces/static_routes.xif Log Message: ----------- static/mcast: Support per-route distance configurable. Default distance is 0 for static, 1 for PIM. Static supports over-rides, but PIM does not at this time. Signed-off-by: Ben Greear Commit: 3f22693c1f2471d73f1ec770d8ee57c9d70d377d https://github.com/greearb/xorp.ct/commit/3f22693c1f2471d73f1ec770d8ee57c9d70d377d Author: Ben Greear Date: 2012-07-09 (Mon, 09 Jul 2012) Changed paths: M xorp/fea/mfea_node.cc M xorp/fea/mfea_node.hh M xorp/fea/xrl_fea_node.hh M xorp/fea/xrl_mfea_node.cc M xorp/fea/xrl_mfea_node.hh M xorp/pim/xrl_pim_node.cc M xorp/xrl/interfaces/mfea.xif M xorp/xrl/interfaces/mfea_client.xif M xorp/xrl/interfaces/pim.xif Log Message: ----------- static-mcast: Support multicast address distances. Add RIB-like behaviour for multicast addresses in the MFEA logic. This will allow static multicast routes to over-ride dynamic routes, for instance. PIM currently always uses distance of 1, so if static uses 0, it will win. Signed-off-by: Ben Greear Commit: 5eb6be022efaea8db937e0b721e9c73c80026838 https://github.com/greearb/xorp.ct/commit/5eb6be022efaea8db937e0b721e9c73c80026838 Author: Ben Greear Date: 2012-07-09 (Mon, 09 Jul 2012) Changed paths: M xorp/libproto/proto_node.hh M xorp/rib/rib_manager.hh Log Message: ----------- Whitespace cleanup. Commit: d7ecee95044437b8a097fdb0a3d9884677a72f44 https://github.com/greearb/xorp.ct/commit/d7ecee95044437b8a097fdb0a3d9884677a72f44 Author: Ben Greear Date: 2012-07-09 (Mon, 09 Jul 2012) Changed paths: M xorp/etc/templates/static_routes.tp M xorp/static_routes/SConscript M xorp/static_routes/static_routes_node.cc M xorp/static_routes/static_routes_node.hh M xorp/static_routes/xorp_static_routes.cc M xorp/static_routes/xrl_static_routes_node.cc M xorp/static_routes/xrl_static_routes_node.hh M xorp/xrl/interfaces/static_routes.xif M xorp/xrl/targets/static_routes.tgt Log Message: ----------- static-mcast: Add support for static multicast routes. This adds the ability to configure static multicast routes using the static-route module. Example config file looks like: interfaces { interface "p3p1" { disable: false default-system-config } interface "wlan0" { disable: false default-system-config } } fea { unicast-forwarding4 { disable: false } } protocols { static { route 10.2.46.91/16 { next-hop: 10.2.46.20 metric: 1 } mrib-route 10.2.46.0/16 { next-hop: 10.2.46.30 metric: 1 } mcast-route 226.0.0.1 { input_if: "p3p1" input_ip: 192.168.9.11 output_ifs: "wlan0" distance: 2 } } } plumbing { mfea4 { disable: false interface "p3p1" { vif "p3p1" { disable: false } } interface "wlan0" { vif "wlan0" { disable: false } } interface "register_vif" { vif "register_vif" { disable: false } } } /* mfea4 */ } /* plumbing */ Signed-off-by: Ben Greear Commit: 765193bfb7889610475d6cdce6444d8c15b1cea0 https://github.com/greearb/xorp.ct/commit/765193bfb7889610475d6cdce6444d8c15b1cea0 Author: Ben Greear Date: 2012-07-09 (Mon, 09 Jul 2012) Changed paths: M xorp/rib/xrl_target.cc M xorp/rib/xrl_target.hh M xorp/xrl/interfaces/rib.xif M xorp/xrl/interfaces/rib_client.xif Log Message: ----------- Merge branch 'master' of dmz2:/pub/scm/xorp.ct.ben Compare: https://github.com/greearb/xorp.ct/compare/32d7b974021b...765193bfb788 From noreply at github.com Mon Jul 16 08:05:05 2012 From: noreply at github.com (GitHub) Date: Mon, 16 Jul 2012 08:05:05 -0700 Subject: [Xorp-hackers] [greearb/xorp.ct] 2ff484: fea: Fix compile error when no ipv6 mcast routing ... Message-ID: <50042da1dc994_3bcb1726af421841d@sh3.rs.github.com.mail> Branch: refs/heads/master Home: https://github.com/greearb/xorp.ct Commit: 2ff484cef67b36b1c62939c7f49a7c8a158c4016 https://github.com/greearb/xorp.ct/commit/2ff484cef67b36b1c62939c7f49a7c8a158c4016 Author: Ben Greear Date: 2012-07-16 (Mon, 16 Jul 2012) Changed paths: M xorp/fea/mfea_node.cc Log Message: ----------- fea: Fix compile error when no ipv6 mcast routing support. Signed-off-by: Ben Greear From mwinter at opensourcerouting.org Mon Jul 23 02:16:11 2012 From: mwinter at opensourcerouting.org (Martin Winter) Date: Mon, 23 Jul 2012 02:16:11 -0700 Subject: [Xorp-hackers] Open Source Routing BoF at next RIPE meeting Message-ID: <7867A5AA-CD68-47A5-89E1-63717EE4EF52@opensourcerouting.org> Hi everyone, first, sorry for the interruption on the code discussion.. I'm running a Open Source Routing BoF at the next RIPE meeting (https://ripe65.ripe.net/) at the end of September in Amsterdam. I would really love to get someone (or more) working on XORP to join in some form at the meeting and give a (very short, ie 5..10 min) talk on the highlights of XORP, where to use it, strengths etc. We had a quite successful roundtable at the last RIPE meeting, but unfortunately only with people working on Quagga and Bird. The goal for this meeting is to see if there is potentially enough interest to start a Open Source Working Group at RIPE and have regular updates and interaction with the ISP to promote an open source alternative in the ISP community (Not necessarly restricted to Routing software, but at least a heavy focus on it). Any chance for anyone to join the next RIPE meeting? Or if not, then maybe someone is willing to "donate" a few short slides to explain the goals and where XORP is used? I'm a Quagga person and really don't know enough about XORP to speak about it. Here is the (current version) of the abstract of the BoF session: > Abstract: > This roundtable is planned as an interactive session on open source software in the community. We will begin with an update on Quagga and Bird and then have an open discussion on issues, suggestions and visions related to the projects. If you maintain any other Open Source software relevant for the RIPE community and want to make a quick presentation as well, then please contact the presenters. We would be happy trying to include additional projects I'm happy to change the abstract to officially include XORP if someone wants to join. Regards, Martin Winter From noreply at github.com Thu Jul 26 12:06:24 2012 From: noreply at github.com (GitHub) Date: Thu, 26 Jul 2012 12:06:24 -0700 Subject: [Xorp-hackers] [greearb/xorp.ct] 1382f5: libproto: Make configured_vif_find_by_name non-con... Message-ID: <501195308ed0_7df6174bae859299@sh3.rs.github.com.mail> Branch: refs/heads/master Home: https://github.com/greearb/xorp.ct Commit: 1382f58ed0db7907742ba339ad492c024bac6689 https://github.com/greearb/xorp.ct/commit/1382f58ed0db7907742ba339ad492c024bac6689 Author: Ben Greear Date: 2012-07-26 (Thu, 26 Jul 2012) Changed paths: M xorp/libproto/proto_node.hh Log Message: ----------- libproto: Make configured_vif_find_by_name non-const. We need to be able to modify the returned vif to deal with MFEA interfaces coming and going. Signed-off-by: Ben Greear Commit: 87bf2b958fa9ca53970d4dbbc7e521fc240173ea https://github.com/greearb/xorp.ct/commit/87bf2b958fa9ca53970d4dbbc7e521fc240173ea Author: Ben Greear Date: 2012-07-26 (Thu, 26 Jul 2012) Changed paths: M xorp/fea/mfea_node.cc M xorp/fea/xrl_mfea_node.cc Log Message: ----------- fea: Fix assert when MFEA interfaces come and go. And try to fix up the VIF index as needed. Signed-off-by: Ben Greear Commit: abada553eb777ec356f65ed577c4f9918b4eac5f https://github.com/greearb/xorp.ct/commit/abada553eb777ec356f65ed577c4f9918b4eac5f Author: Ben Greear Date: 2012-07-26 (Thu, 26 Jul 2012) Changed paths: M xorp/static_routes/static_routes_node.cc M xorp/static_routes/static_routes_node.hh M xorp/static_routes/xrl_static_routes_node.cc M xorp/static_routes/xrl_static_routes_node.hh Log Message: ----------- static-routes: Fix endless spin for mcast-routes. The root cause was a typo that caused an endless loop. I left in the debugging info (much of it commented out) in case there are more problems in this area. Signed-off-by: Ben Greear Compare: https://github.com/greearb/xorp.ct/compare/2ff484cef67b...abada553eb77 From noreply at github.com Fri Jul 27 09:25:32 2012 From: noreply at github.com (GitHub) Date: Fri, 27 Jul 2012 09:25:32 -0700 Subject: [Xorp-hackers] [greearb/xorp.ct] a0bba5: igmp: Allow igmp to start with phantom interfaces. Message-ID: <5012c0fc18630_70ae1bbbaec91292@sh2.rs.github.com.mail> Branch: refs/heads/master Home: https://github.com/greearb/xorp.ct Commit: a0bba5692c583d32b4cdeaeb2db16aa3b81ce16e https://github.com/greearb/xorp.ct/commit/a0bba5692c583d32b4cdeaeb2db16aa3b81ce16e Author: Ben Greear Date: 2012-07-27 (Fri, 27 Jul 2012) Changed paths: M xorp/libproto/proto_node.hh M xorp/libxorp/vif.cc M xorp/libxorp/vif.hh M xorp/mld6igmp/mld6igmp_node.cc M xorp/mld6igmp/mld6igmp_node.hh Log Message: ----------- igmp: Allow igmp to start with phantom interfaces. Basic idea is to dummy out the interface if it doesn't exist, creating a fake if-index as needed. Add logic to hopefully deal with this properly if/when the interface appears. Signed-off-by: Ben Greear Commit: 33599913b8f874f371c8c3475b43f91b7c7e7560 https://github.com/greearb/xorp.ct/commit/33599913b8f874f371c8c3475b43f91b7c7e7560 Author: Ben Greear Date: 2012-07-27 (Fri, 27 Jul 2012) Changed paths: M xorp/pim/pim_node.cc M xorp/pim/pim_node.hh Log Message: ----------- pim: Allow pim to start with phantom interfaces. Basic idea is to dummy out the interface if it doesn't exist, creating a fake if-index as needed. Add logic to hopefully deal with this properly if/when the interface appears. This is basically cut-and-paste of the same logic that was just created for igmp. Signed-off-by: Ben Greear Compare: https://github.com/greearb/xorp.ct/compare/abada553eb77...33599913b8f8 From igorm at etf.rs Mon Jul 30 04:22:03 2012 From: igorm at etf.rs (=?ISO-8859-2?Q?Igor_Maravi=E6?=) Date: Mon, 30 Jul 2012 13:22:03 +0200 Subject: [Xorp-hackers] XORP Presentation - need HELP Message-ID: Dear Xorp users/developers, I volunteered to help Martin Winter, from OpenSourceRouting, to prepare Xorp slides for RIPE/APNIC conferences. As a part of the presentation we should put who is using Xorp and how. Currently I don't know much about that and I REALLY NEED YOUR HELP! If you are using Xorp, please tell me for which company/customers are you working and how are you using Xorp! I think it's really essential to tell me this stuff, so we could show the world that Xorp is alive. Since RIPE is gathering a large number of operators, we can attract them to use Xorp in future. Martin would put names of your company and/or customers on his slides, which would be a good advertisement for you and them! Please don't be shy! XORP DEPENDS ON YOU! BR Igor From igorm at etf.rs Mon Jul 30 04:25:24 2012 From: igorm at etf.rs (=?ISO-8859-2?Q?Igor_Maravi=E6?=) Date: Mon, 30 Jul 2012 13:25:24 +0200 Subject: [Xorp-hackers] XORP Presentation - need HELP Message-ID: Dear Xorp users/developers, I volunteered to help Martin Winter, from OpenSourceRouting, to prepare Xorp slides for RIPE/APNIC conferences. As a part of the presentation we should put who is using Xorp and how. Currently I don't know much about that and I REALLY NEED YOUR HELP! If you are using Xorp, please tell me for which company/customers are you working and how are you using Xorp! I think it's really essential to tell me this stuff, so we could show the world that Xorp is alive. Since RIPE is gathering a large number of operators, we can attract them to use Xorp in future. Martin would put names of your company and/or customers on his slides, which would be a good advertisement for you and them! Please don't be shy! XORP DEPENDS ON YOU! BR Igor From greearb at candelatech.com Mon Jul 30 09:03:23 2012 From: greearb at candelatech.com (Ben Greear) Date: Mon, 30 Jul 2012 09:03:23 -0700 Subject: [Xorp-hackers] [Xorp-users] XORP Presentation - need HELP In-Reply-To: References: Message-ID: <5016B04B.1010701@candelatech.com> On 07/30/2012 04:25 AM, Igor Maravi? wrote: > Dear Xorp users/developers, > I volunteered to help Martin Winter, from OpenSourceRouting, to > prepare Xorp slides for RIPE/APNIC conferences. > > As a part of the presentation we should put who is using Xorp and how. > Currently I don't know much about that and I REALLY NEED YOUR HELP! > > If you are using Xorp, please tell me for which company/customers are > you working and how are you using Xorp! > > I think it's really essential to tell me this stuff, so we could show > the world that Xorp is alive. Since RIPE is gathering a large number > of operators, we can attract them to use Xorp in future. Martin would > put names of your company and/or customers on his slides, which would > be a good advertisement for you and them! > > Please don't be shy! XORP DEPENDS ON YOU! We use it for our virtual-router feature in our LANforge product (network emulator, network traffic generator products). http://www.candelatech.com/ice_ex9_vrouters.php In particular, xorp is the routing brains behind the WISER product: http://www.candelatech.com/wiser50_product.php I do a bit of consulting related to xorp as well. One customer is using Xorp on windows and Linux to implement a multiple data-center redundancy. Another is using it for something that may be similar to our WISER product...I'll ask them to post some details if they are willing. How are you using Xorp? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From igorm at etf.rs Tue Jul 31 01:15:53 2012 From: igorm at etf.rs (=?ISO-8859-2?Q?Igor_Maravi=E6?=) Date: Tue, 31 Jul 2012 10:15:53 +0200 Subject: [Xorp-hackers] [Xorp-users] XORP Presentation - need HELP In-Reply-To: References: <5016B04B.1010701@candelatech.com> Message-ID: Thank you Achmad and Ben! :) We're research group of School of Electrical Engineering of Belgrade University, Serbia. As a part of our research we're building internet router. Our data plane is almost finished, and we needed solution for our control plane. This is where Xorp fits in. :) We still didn't put it on our board, so currently we're just improving it and we're developing MPLS part. Of course, we're going to push our code back to the Xorp, as soon as it becomes operational. Is there anybody else who is using Xorp? BR Igor From noreply at github.com Tue Jul 31 16:25:44 2012 From: noreply at github.com (GitHub) Date: Tue, 31 Jul 2012 16:25:44 -0700 Subject: [Xorp-hackers] [greearb/xorp.ct] 28428c: libproto: Start fake VIF index search at 1. Message-ID: <501869788f07b_c46f4caf41231aa@sh2.rs.github.com.mail> Branch: refs/heads/master Home: https://github.com/greearb/xorp.ct Commit: 28428cacc2187f45473bfdc314725f548062c037 https://github.com/greearb/xorp.ct/commit/28428cacc2187f45473bfdc314725f548062c037 Author: Ben Greear Date: 2012-07-31 (Tue, 31 Jul 2012) Changed paths: M xorp/libproto/proto_node.hh Log Message: ----------- libproto: Start fake VIF index search at 1. I think that PIM vif index of > 32 might be invalid, and no good reason to start higher than 1 anyway. Commit: cdbead114f1e6dd14d174c42a5b96c4fbab4810b https://github.com/greearb/xorp.ct/commit/cdbead114f1e6dd14d174c42a5b96c4fbab4810b Author: Ben Greear Date: 2012-07-31 (Tue, 31 Jul 2012) Changed paths: M xorp/pim/pim_node.cc M xorp/pim/xorp_pimsm4.cc Log Message: ----------- pim: Deal better with fake VIFs. Let fea tell us the vif index, and make the change in the vifs-updated logic. Add some debug logic for pim shutdown paths. Signed-off-by: Ben Greear Commit: 093cab6fd6def01e2bc84cbf614d6499358600ca https://github.com/greearb/xorp.ct/commit/093cab6fd6def01e2bc84cbf614d6499358600ca Author: Ben Greear Date: 2012-07-31 (Tue, 31 Jul 2012) Changed paths: M xorp/mld6igmp/mld6igmp_node.cc M xorp/pim/pim_node.cc Log Message: ----------- pim/igmp: Fix another case of fake-vif at 100. And make igmp use similar logic to pim. Compare: https://github.com/greearb/xorp.ct/compare/33599913b8f8...093cab6fd6de