xorp

xrl_fea_node.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 
00003 // Copyright (c) 2007-2009 XORP, Inc.
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, Version 2, June
00007 // 1991 as published by the Free Software Foundation. Redistribution
00008 // and/or modification of this program under the terms of any other
00009 // version of the GNU General Public License is not permitted.
00010 // 
00011 // This program is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00014 // see the GNU General Public License, Version 2, a copy of which can be
00015 // found in the XORP LICENSE.gpl file.
00016 // 
00017 // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00018 // http://xorp.net
00019 
00020 // $XORP: xorp/fea/xrl_fea_node.hh,v 1.15 2008/10/02 21:56:50 bms Exp $
00021 
00022 
00023 #ifndef __FEA_XRL_FEA_NODE_HH__
00024 #define __FEA_XRL_FEA_NODE_HH__
00025 
00026 
00027 //
00028 // FEA (Forwarding Engine Abstraction) with XRL front-end node implementation.
00029 //
00030 
00031 #include "libxorp/xorp.h"
00032 
00033 #include "libxipc/xrl_std_router.hh"
00034 
00035 #include "cli/xrl_cli_node.hh"
00036 
00037 #include "fea_node.hh"
00038 #include "libfeaclient_bridge.hh"
00039 #include "xrl_fea_io.hh"
00040 #include "xrl_fea_target.hh"
00041 #include "xrl_io_link_manager.hh"
00042 #include "xrl_io_ip_manager.hh"
00043 #include "xrl_io_tcpudp_manager.hh"
00044 #include "xrl_mfea_node.hh"
00045 
00046 class EventLoop;
00047 
00053 class XrlFeaNode {
00054 public:
00065     XrlFeaNode(EventLoop& eventloop, const string& xrl_fea_targetname,
00066            const string& xrl_finder_targetname,
00067            const string& finder_hostname, uint16_t finder_port,
00068            bool is_dummy);
00069 
00073     virtual ~XrlFeaNode();
00074 
00080     int     startup();
00081 
00089     int     shutdown();
00090 
00096     bool    is_running() const;
00097 
00103     bool    is_shutdown_received() const;
00104 
00110     EventLoop&  eventloop() { return (_eventloop); }
00111 
00117     XrlStdRouter& xrl_router() { return (_xrl_router); }
00118 
00124     XrlFeaIo&   xrl_fea_io() { return (_xrl_fea_io); }
00125 
00131     FeaNode&    fea_node() { return (_fea_node); }
00132 
00138     XrlFeaTarget& xrl_fea_target() { return (_xrl_fea_target); }
00139 
00145     const string& xrl_finder_targetname() const { return (_xrl_finder_targetname); }
00146 
00147 private:
00148     EventLoop&      _eventloop; // The event loop to use
00149     XrlStdRouter    _xrl_router;    // The standard XRL send/recv point
00150     XrlFeaIo        _xrl_fea_io;    // The FEA I/O XRL instance
00151     FeaNode     _fea_node;  // The FEA node
00152     LibFeaClientBridge  _lib_fea_client_bridge;
00153 
00154     XrlFibClientManager _xrl_fib_client_manager; // The FIB client manager
00155     XrlIoLinkManager    _xrl_io_link_manager;   // Link raw I/O manager
00156     XrlIoIpManager  _xrl_io_ip_manager; // IP raw I/O manager
00157     XrlIoTcpUdpManager  _xrl_io_tcpudp_manager; // TCP/UDP I/O manager
00158 
00159     // MFEA-related stuff
00160     // TODO: XXX: This should be refactored and better integrated with the FEA.
00161     // TODO: XXX: For now we don't have a dummy MFEA
00162 
00163     //
00164     // XXX: TODO: The CLI stuff is temporary needed (and used) by the
00165     // multicast modules.
00166     //
00167     CliNode     _cli_node4;
00168     XrlCliNode      _xrl_cli_node;
00169     XrlMfeaNode     _xrl_mfea_node4;    // The IPv4 MFEA
00170 #ifdef HAVE_IPV6_MULTICAST
00171     XrlMfeaNode     _xrl_mfea_node6;    // The IPv6 MFEA
00172 #endif
00173 
00174     XrlFeaTarget    _xrl_fea_target;    // The FEA XRL target
00175 
00176     const string    _xrl_finder_targetname; // The Finder target name
00177 };
00178 
00179 #endif // __FEA_XRL_FEA_NODE_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations