Drizzled Public API Documentation

drizzle_protocol.h
00001 /* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2010 Brian Aker
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 
00022 #pragma once
00023 
00024 #include <drizzled/plugin/listen_tcp.h>
00025 #include <drizzled/plugin/client.h>
00026 #include <drizzled/atomics.h>
00027 #include <drizzled/plugin/table_function.h>
00028 
00029 #include <plugin/mysql_protocol/mysql_protocol.h>
00030 
00031 namespace drizzle_plugin
00032 {
00033 namespace drizzle_protocol
00034 {
00035 
00036 class ListenDrizzleProtocol: public ListenMySQLProtocol
00037 {
00038 public:
00039   ListenDrizzleProtocol(std::string name, 
00040                         const std::string &bind_address,
00041                         bool using_mysql41_protocol):
00042     ListenMySQLProtocol(name, bind_address, using_mysql41_protocol)
00043   { }
00044 
00045   ~ListenDrizzleProtocol();
00046   in_port_t getPort(void) const;
00047   static ProtocolCounters *drizzle_counters;
00048   virtual ProtocolCounters *getCounters(void) const { return drizzle_counters; }
00049   drizzled::plugin::Client *getClient(int fd);
00050 };
00051 
00052 class ClientDrizzleProtocol: public ClientMySQLProtocol
00053 {
00054 public:
00055   ClientDrizzleProtocol(int fd, ProtocolCounters *set_counters): ClientMySQLProtocol(fd, true, set_counters) {}
00056 
00057   static std::vector<std::string> drizzle_admin_ip_addresses;
00058   static void drizzle_compose_ip_addresses(std::vector<std::string> options);
00059   bool isAdminAllowed(void);
00060 };
00061 
00062 } /* namespace drizzle_protocol */
00063 } /* namespace drizzle_plugin */
00064