Skip to content

Commit

Permalink
static/mfea: Have static module call directly to MFEA
Browse files Browse the repository at this point in the history
Instead of previous idea to push this all through the RIB.
  • Loading branch information
greearb committed Jun 20, 2012
1 parent 2651a0d commit b6db4f0
Show file tree
Hide file tree
Showing 15 changed files with 407 additions and 212 deletions.
21 changes: 19 additions & 2 deletions xorp/fea/mfea_node.cc
Expand Up @@ -1816,18 +1816,35 @@ 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,
string& error_msg) {
// TODO: Convert strings to mfc binary stuff and pass to
// add_mfc()
UNUSED(module_instance_name);
UNUSED(source);
UNUSED(group);
UNUSED(iif_name);
UNUSED(oif_names);
UNUSED(error_msg);
return XORP_OK;
}

/**
* 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.
* @oiflist: The bitset with the outgoing interfaces.
* @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.
Expand Down
9 changes: 7 additions & 2 deletions xorp/fea/mfea_node.hh
Expand Up @@ -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__
Expand Down Expand Up @@ -586,6 +584,13 @@ public:
const Mifset& oiflist_disable_wrongvif,
uint32_t max_vifs_oiflist,
const IPvX& rp_addr);

int add_mfc_str(const string& module_instance_name,
const IPvX& source,
const IPvX& group,
const string& iif_name,
const string& oif_names,
string& error_msg);

/**
* Delete Multicast Forwarding Cache (MFC) from the kernel.
Expand Down
5 changes: 0 additions & 5 deletions xorp/fea/xrl_fea_node.hh
Expand Up @@ -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__

Expand All @@ -29,9 +26,7 @@
//

#include "libxorp/xorp.h"

#include "libxipc/xrl_std_router.hh"

#include "cli/xrl_cli_node.hh"

#include "fea_node.hh"
Expand Down
32 changes: 32 additions & 0 deletions xorp/fea/xrl_mfea_node.cc
Expand Up @@ -1243,6 +1243,38 @@ XrlMfeaNode::mfea_0_1_add_mfc4(
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)
{
string error_msg;

//
// 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, error_msg) != XORP_OK) {
return XrlCmdError::COMMAND_FAILED(error_msg);
}

//
// Success
//
return XrlCmdError::OKAY();
}

XrlCmdError
XrlMfeaNode::mfea_0_1_delete_mfc4(
// Input values,
Expand Down
8 changes: 8 additions & 0 deletions xorp/fea/xrl_mfea_node.hh
Expand Up @@ -364,6 +364,14 @@ protected:
const uint32_t& max_vifs_oiflist,
const IPv4& rp_address);

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);

XrlCmdError mfea_0_1_delete_mfc4(
// Input values,
const string& xrl_sender_name,
Expand Down
1 change: 1 addition & 0 deletions xorp/static_routes/SConscript
Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions xorp/static_routes/static_routes_node.cc
Expand Up @@ -121,6 +121,9 @@ StaticRoutesNode::shutdown()
//
rib_register_shutdown();

// De-register with the MFEA
rib_register_shutdown();

//
// De-register with the FEA
//
Expand Down
5 changes: 3 additions & 2 deletions xorp/static_routes/xorp_static_routes.cc
Expand Up @@ -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
Expand Down Expand Up @@ -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());

Expand Down

0 comments on commit b6db4f0

Please sign in to comment.