OSDN Git Service

内部向け3.x shamshelのコードスタブ追加
authornakai <nakai@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Thu, 11 Dec 2008 10:24:38 +0000 (10:24 +0000)
committernakai <nakai@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Thu, 11 Dec 2008 10:24:38 +0000 (10:24 +0000)
git-svn-id: http://10.144.169.20/repos/um/sdy/src/3.x-shamshel@4977 1ed66053-1c2d-0410-8867-f7571e6e31d3

Makefile.am [new file with mode: 0644]
include/l7command.h [new file with mode: 0644]
include/l7vs_command_reciver.h [new file with mode: 0644]
include/l7vs_command_session.h [new file with mode: 0644]
include/l7vs_realserver_element.h [new file with mode: 0644]
include/l7vs_virtualservice_command_element.h [new file with mode: 0644]
include/l7vsadm.h [new file with mode: 0644]
include/l7vsd.h [new file with mode: 0644]
src/l7vsadm.cpp [new file with mode: 0644]

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..18f8741
--- /dev/null
@@ -0,0 +1,2 @@
+SUBDIR = src module
+AUTOMAKE_OPTIONS = foreign
diff --git a/include/l7command.h b/include/l7command.h
new file mode 100644 (file)
index 0000000..b7f8862
--- /dev/null
@@ -0,0 +1,122 @@
+//
+//     @file   l7vscommand.h
+//     @brief  l7vsadm and l7vsd connection data prototype
+//
+//     copyright (c) sdy corporation. 2008
+//     mail: n dot nakai at sdy dot co dot jp
+//
+//     Distributed under the Boost Software License, Version 1.0.(See accompanying
+//     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
+//
+
+#ifndef        L7COMMAND_H
+#define        L7COMMAND_H
+
+#include <boost/serialization/string.hpp>
+#include <boost/serialization/vector.hpp>
+#include <boost/asio.hpp>
+#include <vector>
+#include <logger_enum.h>
+#include <parameter_enum.h>
+#include "l7vs_realserver_element.h"
+#include "l7vs_virtualservice_command_element.h"
+
+
+namespace l7vsd{
+//
+//     l7vsadm -> l7vsd request data class
+//     
+//
+class  l7vsadm_request{
+public:
+       // command lists
+       enum    COMMAND_CODE_TAG{
+               CMD_NONE = 0,
+               CMD_LIST,               //!< List command(-l,--list)
+               CMD_LIST_VERBOSE,       //!< Verbose list command(-V,--verbose)
+               CMD_LIST_KEY,           //!< Key list command(-K, --key)
+               CMD_ADD_VS,             //!< Add VirtualService command(-A,--add-service)
+               CMD_DEL_VS,             //!< Delete VirtualService command(-D, --delete-service)
+               CMD_EDIT_VS,            //!< Edit VirtualService command(-E, --edit-service)
+               CMD_FLUSH_VS,           //!< Flush VirtualService command(-C, --flush)
+               CMD_ADD_RS,             //!< Add RealServer command(-a, --add-server)
+               CMD_DEL_RS,             //!< Delete RealServer command(-d, --delete-server)
+               CMD_EDIT_RS,            //!< Edit RealServer command(-e.--edit-server)
+               CMD_REPLICATION,        //!< Replication command(-R, --replication)
+               CMD_LOG,                //!< Logger command(-L, -log)
+               CMD_SNMP,               //!< SNMPAgent command(-S, --snmp)
+               CMD_PARAMETER,          //!< Parameter command(-P, --parameter)
+               CMD_HELP,               //!< Help command(-h, --help)
+       };
+
+       COMMAND_CODE_TAG                        command;
+       bool                                            list_numeric_flag;
+       virtualservice_element  vs_element;
+       LOG_CATEGORY_TAG                        log_category;
+       LOG_LEVEL_TAG                           log_level;
+       bool                                            category_all_flag;
+       bool                                            start_replication_flag;
+       PARAMETER_COMPONENT_TAG reload_param;
+       l7vsadm_request() :             command( CMD_NONE ),
+                                                               list_numeric_flag( false ),
+                                                               category_all_flag( false ),
+                                                               start_replication_flag( false ){}
+private:
+       friend class    boost::serialization::access;
+       template <class Archive > void serialize( Archive& ar, const unsigned int version ){
+               ar & command;
+               ar & list_numeric_flag;
+               ar & vs_element;
+               ar & log_category;
+               ar & log_level;
+               ar & category_all_flag;
+               ar & start_replication_flag;
+               ar & reload_param;
+       }
+};
+
+class  l7vsd_response{
+public:
+       enum    COMMAND_RESPONSE_CODE{
+               RESPONSE_OK = 0,
+               RESPONSE_LIST_ERROR,
+               RESPONSE_LIST_VERBOSE_ERROR,
+               RESPONSE_LIST_KEY_ERROR,
+               RESPONSE_ADD_VS_ERROR,
+               RESPONSE_DEL_VS_ERROR,
+               RESPONSE_EDIT_VS_ERROR,
+               RESPONSE_FLUSH_VS_ERROR,
+               RESPONSE_ADD_RS_ERROR,
+               RESPONSE_DEL_RS_ERROR,
+               RESPONSE_EDIT_RS_ERROR,
+               RESPONSE_REPLICATION_ERROR,
+               RESPONSE_LOG_ERROR,
+               RESPONSE_SNMP_ERROR,
+               RESPONSE_PARAMETER_ERROR,
+               RESPONSE_HELP_ERROR
+       };
+       l7vsadm_request::COMMAND_CODE_TAG       code;
+       bool                                    status;
+       unsigned long long      total_bps;
+       unsigned long long      total_client_recv_byte;
+       unsigned long long      total_client_send_byte;
+       unsigned long long      total_realserver_recv_byte;
+       unsigned long long      total_realserver_send_byte;
+       std::vector<virtualservice_element>
+                                                       virtualservice_vec;     
+private:
+       friend class    boost::serialization::access;
+       template <class Archive > void serialize( Archive& ar, const unsigned int version ){
+               ar & status;
+               ar & total_bps;
+               ar & total_client_recv_byte;
+               ar & total_client_send_byte;
+               ar & total_realserver_recv_byte;
+               ar & total_realserver_send_byte;
+               ar & virtualservice_vec;
+       }
+};
+
+
+}      // namespase l7vsd
+#endif //L7COMMAND_H
diff --git a/include/l7vs_command_reciver.h b/include/l7vs_command_reciver.h
new file mode 100644 (file)
index 0000000..8c5f6bf
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef        L7VS_COMMAND_RECIVER_H
+#define        L7VS_COMMAND_RECIVER_H
+
+#include "l7vs_command_session.h"
+
+namespace l7vsd{
+
+class  command_reciver{
+protected:
+       command_reciver(){}
+       // l7vsd_mainthread                                                                             main_thread;
+       boost::asio::io_service&                                                                dispatcher;
+       boost::asio::local::stream_protocol::acceptor           acceptor_;
+       void    handle_accept( boost::shared_ptr<l7vs_command_session>, const boost::system::error_code& );
+public:
+       command_reciver(        boost::asio::io_service& io_service, const std::string& file ) 
+               :       dispatcher( io_service ),
+                       acceprot_( io_service, boost::asio::local::stream_protocol::endpoint( file ) );
+       ~command_reciver();
+};
+
+};     //namespace l7vsd
+#endif //L7VS_COMMAND_RECIVER_H
diff --git a/include/l7vs_command_session.h b/include/l7vs_command_session.h
new file mode 100644 (file)
index 0000000..580fb9d
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef        L7VS_COMMAND_SESSION_H
+#define        L7VS_COMMAND_SESSION_H
+
+#ifndef        MAX_BUFFER_SIZE
+       #define MAX_BUFFER_SIZE (65535)
+#endif
+
+#include <boost/array.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/asio.hpp>
+
+namespace l7vsd{
+
+class  l7vs_command_session : public boost::enable_shared_from_this<session>{
+protected:
+       //l7vsd_main_thread                                                             main_thread;
+       boost::asio:local::stream_protocol::socket      unixsocket;
+       boost::array<char, MAX_BUFFER_SIZE>                     command_buffer;
+       boost::array<char, MAX_BUFFER_SIZE>                     response_buffer;
+       l7vs_command_session(){}
+       void    handle_read( const boost::system::error_code&, size_t );
+       void    handle_write( const boost::system::error_code& );
+public:
+       l7vs_command_session( boost::asio::io_service& io_service ) : unixsocket( io_service );
+       boost::asio::local::stream_protocol::socket&    socket(){ return unixsocket; }
+       void    start();
+};
+
+};//namespace l7vsd
+#endif         //L7VS_COMMAND_SESSION_H
diff --git a/include/l7vs_realserver_element.h b/include/l7vs_realserver_element.h
new file mode 100644 (file)
index 0000000..94958c1
--- /dev/null
@@ -0,0 +1,54 @@
+//
+//     @file   l7vs_realserver_element.h
+//     @brief  realserver data prototype
+//
+//     copyright (c) sdy corporation. 2008
+//     mail: n dot nakai at sdy dot co dot jp
+//
+//     Distributed under the Boost Software License, Version 1.0.(See accompanying
+//     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
+//
+#ifndef        L7VS_REALSERVER_ELEMENT_H
+#define        L7VS_REALSERVER_ELEMENT_H
+#include <boost/asio.hpp>
+
+namespace l7vsd{
+
+class  realserver_element{
+protected:
+       friend class boost::serialization::access;
+public:
+       boost::asio::ip::tcp::endpoint  tcp_endpoint;
+       boost::asio::ip::udp::endpoint  udp_endpoint;
+       int                                                             weight;
+       realserver_element() : weight(-1){}
+       realserver_element( const realserver_element& in ) : tcp_endpoint( in.tcp_endpoint ) ,
+                                                                                                                        udp_endpoint( in.udp_endpoint ) ,
+                                                                                                                        weight( in.weight ){}
+       realserver_element& operator=( const realserver_element& elem ){
+               tcp_endpoint = elem.tcp_endpoint;
+               udp_endpoint = elem.udp_endpoint;
+               weight = elem.weight;
+               return *this;
+       }
+       friend  bool    operator==( const realserver_element& rselem1, const realserver_element& rselem2 ){
+               return rselem1.tcp_endpoint == rselem2.tcp_endpoint &&
+                               rselem1.udp_endpoint == rselem2.udp_endpoint &&
+                               rselem1.weight == rselem2.weight;
+       }
+       
+       friend bool     operator!=( const realserver_element& rselem1, const realserver_element& rselem2 ){
+               return rselem1.tcp_endpoint != rselem2.tcp_endpoint ||
+                               rselem1.udp_endpoint != rselem2.udp_endpoint ||
+                               rselem1.weight != rselem2.weight;
+       }
+       
+       friend bool     operator<( const realserver_element& rselem1, const realserver_element& rselem2 ){
+               if( rselem1.tcp_endpoint < rselem2.tcp_endpoint ) return true;
+               if( rselem1.tcp_endpoint != rselem2.tcp_endpoint ) return false;
+               return rselem1.weight < rselem2.weight;
+       }
+};
+
+};     //namespace l7vsd
+#endif //L7VS_REALSERVER_ELEMENT
diff --git a/include/l7vs_virtualservice_command_element.h b/include/l7vs_virtualservice_command_element.h
new file mode 100644 (file)
index 0000000..7ff06b2
--- /dev/null
@@ -0,0 +1,143 @@
+//
+//     @file   l7vs_virtualservice_command_element
+//     @brief  use l7vscommand virtualservice_data prototype
+//
+//     copyright (c) sdy corporation. 2008
+//     mail: n dot nakai at sdy dot co dot jp
+//
+//     Distributed under the Boost Software License, Version 1.0.(See accompanying
+//     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
+//
+
+#ifndef        L7VS_VIRTUALSERVICE_COMMAND_ELEMENT
+#define        L7VS_VIRTUALSERVICE_COMMAND_ELEMENT
+
+#include <vector>
+#include <string>
+#include <boost/asio.hpp>
+#include <boost/foreach.hpp>
+#include "l7vs_realserver_element.h"
+
+namespace l7vsd{
+
+// virtual service element includes.
+class  virtualservice_element{
+public:
+       bool                                    udpmode;
+       boost::asio::ip::tcp::endpoint
+                                                       tcp_accept_endpoint;
+       boost::asio::ip::udp::endpoint
+                                                       udp_recv_endpoint;
+       std::vector<realserver_element>
+                                                       realserver_vector;
+       std::string
+                                                       protocol_module_name;
+       std::string
+                                                       schedule_module_name;
+       std::vector<std::string>
+                                                       protocol_args;
+       long long                               sorry_maxconnection;
+       boost::asio::ip::tcp::endpoint
+                                                       sorry_endpoint;
+       std::string                     sorry_uri;
+       unsigned long long      qos_service;
+       unsigned long long      qos_client;
+       
+       virtualservice_element() :      udpmode(false),
+                               qos_service(0LL),
+                               qos_client(0LL),
+                               sorry_maxconnection(0LL){}
+                               
+       virtualservice_element( const virtualservice_element& in )
+                       :       udpmode( in.udpmode ),
+                               tcp_accept_endpoint( in.tcp_accept_endpoint ),
+                               udp_recv_endpoint( in.udp_recv_endpoint ),
+                               protocol_module_name( in.protocol_module_name ),
+                               schedule_module_name( in.schedule_module_name ),
+                               sorry_maxconnection( in.sorry_maxconnection ),
+                               sorry_endpoint( in.sorry_endpoint ),
+                               sorry_uri( in.sorry_uri ),
+                               qos_service( in.qos_service ),
+                               qos_client( in.qos_client ){
+               realserver_vector.clear();
+               BOOST_FOREACH( std::string str, in.protocol_args ){
+                       protocol_args.push_back( str );
+               }
+               BOOST_FOREACH( realserver_element elem, in.realserver_vector ){
+                       realserver_vector.push_back( elem );
+               }
+       }
+       
+       virtualservice_element& operator=( const virtualservice_element& in ){
+               udpmode = in.udpmode;
+               tcp_accept_endpoint = in.tcp_accept_endpoint;
+               udp_recv_endpoint = in.udp_recv_endpoint;
+               protocol_module_name = in.protocol_module_name;
+               schedule_module_name = in.schedule_module_name;
+               sorry_maxconnection = in.sorry_maxconnection;
+               sorry_endpoint = in.sorry_endpoint;
+               sorry_uri = in.sorry_uri;
+               qos_service = in.qos_service;
+               qos_client = in.qos_client;
+               
+               realserver_vector.clear();
+               BOOST_FOREACH( std::string str, in.protocol_args ){
+                       protocol_args.push_back( str );
+               }
+               BOOST_FOREACH( realserver_element elem, in.realserver_vector ){
+                       realserver_vector.push_back( elem );
+               }
+               return *this;
+       }
+       
+       friend  bool operator==( const virtualservice_element& elem1, const virtualservice_element& elem2 ){
+               if(     elem1.udpmode == elem2.udpmode &&
+                               elem1.tcp_accept_endpoint == elem2.tcp_accept_endpoint &&
+                               elem1.udp_recv_endpoint == elem2.udp_recv_endpoint &&
+                               elem1.protocol_module_name == elem2.protocol_module_name &&
+                               elem1.sorry_maxconnection == elem2.sorry_maxconnection &&
+                               elem1.sorry_uri == elem2.sorry_uri &&
+                               elem1.qos_service == elem2.qos_service &&
+                               elem1.qos_client == elem2.qos_client ){
+                               if( elem1.realserver_vector.size() != elem2.realserver_vector.size() ) return false;
+                               for( unsigned int i = 0; i < elem1.realserver_vector.size(); ++i ){
+                                       if( elem1.realserver_vector[i] != elem2.realserver_vector[i] ) return false;    
+                               }
+                               return true;
+               }
+               return false;
+       }
+       
+       friend bool operator!=( const virtualservice_element& elem1, const virtualservice_element& elem2 ){
+               if( elem1.udpmode != elem2.udpmode ||
+                               elem1.tcp_accept_endpoint != elem2.tcp_accept_endpoint ||
+                               elem1.udp_recv_endpoint != elem2.udp_recv_endpoint ||
+                               elem1.protocol_module_name != elem2.protocol_module_name ||
+                               elem1.sorry_maxconnection != elem2.sorry_maxconnection ||
+                               elem1.sorry_uri != elem2.sorry_uri ||
+                               elem1.qos_service != elem2.qos_service ||
+                               elem1.qos_client != elem2.qos_client ){
+                               if( elem1.realserver_vector.size() == elem2.realserver_vector.size() ){
+                                       for( unsigned int i = 0; i < elem1.realserver_vector.size(); ++i ){
+                                               if( elem1.realserver_vector[i] == elem2.realserver_vector[i] ) return false;
+                                       }
+                               }
+                               return true;
+               }
+               return false;
+       }
+       friend bool operator<( const virtualservice_element& elem1, const virtualservice_element& elem2 ){
+               if( !elem1.udpmode && !elem2.udpmode ){
+                       return elem1.tcp_accept_endpoint < elem2.tcp_accept_endpoint;
+               }
+               else if( elem1.udpmode && elem2.udpmode ){
+                       return elem1.udp_recv_endpoint < elem2.udp_recv_endpoint;
+               }
+               return false;
+       }
+};
+
+
+
+};                     //namespace l7vsd
+#endif         //L7VS_VIRTUALSERVICE_COMMAND_ELEMENT
diff --git a/include/l7vsadm.h b/include/l7vsadm.h
new file mode 100644 (file)
index 0000000..3f16cbc
--- /dev/null
@@ -0,0 +1,59 @@
+//
+//     @file   l7vsadm
+//     @brief  main module of l7vsadm
+//
+//     l7vsadm : virtual server administration program for l7vsd
+//     copyright(c) sdy corporation.2008
+//     mail: n.nakai at sdy.co.jp
+//     Copyright (c) 2008 norihisa nakai (n dot nakai at sdy dot co do jp)
+//
+//     Distributed under the Boost Software License, Version 1.0. (See accompanying
+//     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+#ifndef        L7VSADM_H
+#define        L7VSADM_H
+
+#include <map>
+#include <cstdio.h>
+#include <cstdlib.h>
+#include <boost/function.hpp>
+#include <boost/bind.hpp>
+#include <boost/array.hpp>
+#include "l7command.h"
+
+#ifndef        MAXBUFFER_SIZE
+       #define MAXBUFFER_SIZE (65535)
+#endif
+
+namespace l7vsd{
+
+class  l7vsadm{
+protected:
+       std::map<std::string, boost::function<void (l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] )> >    command_dic;
+       std::set
+       
+       boost::array<char, MAXBUFFER_SIZE>      send_data;
+       boost::array<char, MAXBUFFER_SIZE>      send_data;
+       l7vsadm_request                                         request;
+       l7vsadm_response                                                response;
+       void    cmd_list_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] );
+       void    cmd_vs_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] );
+       void    cmd_rs_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] );
+       void    cmd_replicaton_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] );
+       void    cmd_log_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] );
+       void    cmd_snmp_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] );
+       void    cmd_paramter_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int, const char*[] );
+       void    cmd_help_parse( const l7vsadm_request::COMMAND_CODE_TAG, const int ,const char*[] );
+
+       bool    request_send();
+       bool    response_recv();
+       void    usage(FILE* fp);
+       bool    pase_command( int argc, char* argv[] );
+public:
+       l7vsadm();
+       ~l7vsadm();
+};
+
+};//namespace l7vsd
+       
+#endif //L7VSADM_H
diff --git a/include/l7vsd.h b/include/l7vsd.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/l7vsadm.cpp b/src/l7vsadm.cpp
new file mode 100644 (file)
index 0000000..9ea1eb6
--- /dev/null
@@ -0,0 +1,179 @@
+//
+//     @file   l7vsadm
+//     @brief  main module of l7vsadm
+//
+//     l7vsadm : virtual server administration program for l7vsd
+//     copyright(c) sdy corporation.2008
+//     mail: n.nakai at sdy.co.jp
+//     Copyright (c) 2008 norihisa nakai (n dot nakai at sdy dot co do jp)
+//
+//     Distributed under the Boost Software License, Version 1.0. (See accompanying
+//     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include "l7vsadm.h"
+
+namespace l7vsd{
+
+
+//
+// l7vsadm class constractor.
+//
+l7vsadm::l7vsadm(){
+               command_dic["-l"]
+                       = boost::bind( &l7vsadm::cmd_list_parse, this, l7vsadm_request::CMD_LIST, _2, _3 );
+               command_dic["--list"]
+                       = boost::bind( &l7vsadm::cmd_list_parse, this, l7vsadm_request::CMD_LIST, _2, _3 );
+               command_dic["-V"]
+                       = boost::bind( &l7vsadm::cmd_list_parse, this, l7vsadm_request::CMD_LIST_VERBOSE, _2, _3 );
+               command_dic["--list-verbose"]
+                       = boost::bind( &l7vsadm::cmd_list_parse, this, l7vsadm_request::CMD_LIST_VERBOSE, _2, _3 );
+               command_dic["-K"]
+                       = boost::bind( &l7vsadm::cmd_list_parse, this, l7vsadm_request::CMD_LIST_KEY, _2, _3 );
+               command_dic["--list-ley"]
+                       = boost::bind( &l7vsadm::cmd_list_parse, this, l7vsadm_request::CMD_LIST_KEY, _2, _3 );
+               command_dic["-A"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_ADD_VS, _2, _3 );
+               command_dic["--add-virtualservice"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_ADD_VS, _2, _3 );
+               command_dic["-D"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_DEL_VS, _2, _3 );
+               command_dic["--del-virtualservice"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_DEL_VS, _2, _3 );
+               command_dic["-E"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_EDIT_VS, _2, _3 );
+               command_dic["--edit-virutalservice"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_EDIT_VS, _2, _3 );
+               command_dic["-C"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_FLUSH_VS, _2, _3 );
+               command_dic["--flash-virtualservice"]
+                       = boost::bind( &l7vsadm::cmd_vs_parse, this, l7vsadm_request::CMD_FLUSH_VS, _2, _3 );
+               command_dic["-a"]
+                       = boost::bind( &l7vsadm::cmd_rs_parse, this, l7vsadm_request::CMD_ADD_RS, _2, _3 );
+               command_dic["--add-realserver"]
+                       = boost::bind( &l7vsadm::cmd_rs_parse, this, l7vsadm_request::CMD_ADD_RS, _2, _3 );
+               command_dic["-d"]
+                       = boost::bind( &l7vsadm::cmd_rs_parse, this, l7vsadm_request::CMD_DEL_RS, _2, _3 );
+               command_dic["--delete-realserver"]
+                       = boost::bind( &l7vsadm::cmd_rs_parse, this, l7vsadm_request::CMD_DEL_RS, _2, _3 );
+               command_dic["-e"]
+                       = boost::bind( &l7vsadm::cmd_rs_parse, this, l7vsadm_request::CMD_EDIT_RS, _2, _3 );
+               command_dic["--edit-realserver"]
+                       = boost::bind( &l7vsadm::cmd_rs_parse, this, l7vsadm_request::CMD_EDIT_RS, _2, _3 );
+               command_dic["-R"]
+                       = boost::bind( &l7vsadm::cmd_replicaton_parse, this, l7vsadm_request::CMD_REPLICATION, _2, _3 );
+               command_dic["--replication"]
+                       = boost::bind( &l7vsadm::cmd_replicaton_parse, this, l7vsadm_request::CMD_REPLICATION, _2, _3 );
+               command_dic["-L"]
+                       = boost::bind( &l7vsadm::cmd_log_parse, this, l7vsadm_request::CMD_LOG, _2 , _3 );
+               command_dic["--logger"]
+                       = boost::bind( &l7vsadm::cmd_log_parse, this, l7vsadm_request::CMD_LOG, _2 , _3 );
+               command_dic["-S"]
+                       = boost::bind( &l7vsadm::cmd_snmp_parse, this, l7vsadm_request::CMD_SNMP, _2, _3 );
+               command_dic["--snmp"]
+                       = boost::bind( &l7vsadm::cmd_snmp_parse, this, l7vsadm_request::CMD_SNMP, _2, _3 );
+               command_dic["-P"]
+                       = boost::bind( &l7vsadm::cmd_paramter_parse, this, l7vsadm_request::CMD_PARAMETER, _2, _3 );
+               command_dic["--parameter"]
+                       = boost::bind( &l7vsadm::cmd_paramter_parse, this, l7vsadm_request::CMD_PARAMETER, _2, _3 );
+               command_dic["-h"]
+                       = boost::bind( &l7vsadm::cmd_help_parse, this, l7vsadm_request::CMD_HELP, _2, _3 );
+               command_dic["--help"]
+                       = boost::bind( &l7vsadm::cmd_help_parse, this, l7vsadm_request::CMD_HELP, _2, _3 );
+}
+
+//
+//
+//
+void   l7vsadm::cmd_list_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc , const char* argv[] ){
+       
+
+}
+
+//
+//
+//
+void   l7vsadm::cmd_vs_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc, const char* argv[]){
+}
+
+//
+//
+//
+void   l7vsadm::cmd_rs_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc, const char* argv[]){
+}
+
+//
+//
+//
+void   l7vsadm::cmd_replicaton_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc, const char* argv[] ){
+}
+
+//
+//
+//
+void   l7vsadm::cmd_log_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc, const char* argv[] ){
+}
+
+//
+//
+//
+void   l7vsadm::cmd_snmp_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc, const char* argv[] ){
+}
+
+//
+//
+//
+void   l7vsadm::cmd_paramter_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc, const char* argv[] ){
+}
+
+//
+//
+//
+void   l7vsadm::cmd_help_parse( const l7vsadm_request::COMMAND_CODE_TAG cmd, const int argc, const char* argv[] ){
+}
+
+
+void   l7vsadm::usage( FILE *p ){
+       std::fprintf( p,
+       "Usage: \n"
+       "  l7vsadm -A|E -t service-address -m proto-module [module-args]\n"
+       "          [-s scheduler] [-u connection-count] [-b sorry-server]\n"
+       "          [-f sorry-flag] [-Q QoSval-up] [-q QoSval-down]\n"
+       "  l7vsadm -D -t service-address -m proto-module [module-args]\n"
+       "  l7vsadm -C\n"
+       "  l7vsadm -a|e -t service-address -m proto-module [module-args]\n"
+       "          -r server-address [-w weight]\n"
+       "  l7vsadm -d -t service-address -m proto-module [module-args]\n"
+       "          -r server-address\n"
+       "  l7vsadm -R -s replication-switch\n"
+       "  l7vsadm -R -f\n"
+       "  l7vsadm -R -d\n"
+       "  l7vsadm -L -c log-category -l log-level\n"
+       "  l7vsadm -S -c log-category -l log-level\n"
+       "  l7vsadm -P -r reload-parameter\n"
+       "  l7vsadm -l [-n]\n"
+       "  l7vsadm -V [-n]\n"
+       "  l7vsadm -K [-n]\n"
+       "  l7vsadm -h\n"
+       "\n");
+
+}
+
+};// namespace l7vsd
+
+
+#ifndef        TEST_CASE
+int main( int argc, char* argv[] ){
+       try{
+
+       }
+       catch( ... ){
+
+       }
+       return 0;
+}
+#else
+int main(){ return 0;}
+#endif //TEST_CASE
+
+}//namespace l7vsd