xorp

pim_node_cli.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 
00003 // Copyright (c) 2001-2011 XORP, Inc and Others
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/pim/pim_node_cli.hh,v 1.15 2008/10/02 21:57:54 bms Exp $
00021 
00022 
00023 #ifndef __PIM_PIM_NODE_CLI_HH__
00024 #define __PIM_PIM_NODE_CLI_HH__
00025 
00026 
00027 //
00028 // PIM protocol CLI
00029 //
00030 
00031 
00032 
00033 
00034 #include "libproto/proto_node_cli.hh"
00035 
00036 
00037 //
00038 // Constants definitions
00039 //
00040 
00041 //
00042 // Structures/classes, typedefs and macros
00043 //
00044 
00045 // PIM protocol CLI class
00046 
00047 class PimNode;
00048 
00049 class PimNodeCli : public ProtoNodeCli {
00050 public:
00051     PimNodeCli(PimNode& pim_node);
00052     virtual ~PimNodeCli();
00053 
00059     int     start();
00060 
00066     int     stop();
00067 
00073     void    enable();
00074     
00081     void    disable();
00082 
00083     int     add_all_cli_commands();
00084     
00085 private:
00086     
00087     PimNode& pim_node() const { return (_pim_node); }
00088     PimNode& _pim_node;
00089 
00090     //
00091     // Misc. other methods
00092     //
00093     string  mifset_str(const Mifset& mifset) const {
00094     string res;
00095     for (uint32_t i = 0; i < _pim_node.maxvifs(); i++) {
00096         if (mifset.test(i))
00097         res += "O";
00098         else
00099         res += ".";
00100     }
00101     return res;
00102     }
00103     
00104     //
00105     // PIM CLI commands
00106     //
00107     int     cli_show_pim_bootstrap(const vector<string>& argv);
00108     int     cli_show_pim_bootstrap_rps(const vector<string>& argv);
00109     int     cli_show_pim_interface(const vector<string>& argv);
00110     int     cli_show_pim_interface_address(const vector<string>& argv);
00111     int     cli_show_pim_join(const vector<string>& argv);
00112     int     cli_show_pim_join_all(const vector<string>& argv);
00113     int     cli_show_pim_mfc(const vector<string>& argv);
00114     int     cli_show_pim_neighbors(const vector<string>& argv);
00115     int     cli_show_pim_mrib(const vector<string>& argv);
00116     int     cli_show_pim_rps(const vector<string>& argv);
00117     int     cli_show_pim_scope(const vector<string>& argv);
00118     
00119     //
00120     // Methods used by the PIM CLI commands
00121     //
00122     void    cli_print_pim_mre_entries(const IPvXNet& group_range,
00123                       bool is_print_all);
00124     void    cli_print_pim_mfc_entries(const IPvXNet& group_range);
00125     void    cli_print_pim_mre(const PimMre *pim_mre);
00126     void    cli_print_pim_mfc(const PimMfc *pim_mfc);
00127 };
00128 
00129 //
00130 // Global variables
00131 //
00132 
00133 //
00134 // Global functions prototypes
00135 //
00136 
00137 #endif // __PIM_PIM_NODE_CLI_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations