~drizzle-trunk/drizzle/development

1812.3.1 by Brian Aker
This patch encapsulates the MySQL protocol around the Drizzle port so that we have access even in the event of MySQL being installed and running.
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1812.3.1 by Brian Aker
This patch encapsulates the MySQL protocol around the Drizzle port so that we have access even in the event of MySQL being installed and running.
4
 *  Copyright (C) 2010 Brian Aker
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
1812.3.1 by Brian Aker
This patch encapsulates the MySQL protocol around the Drizzle port so that we have access even in the event of MySQL being installed and running.
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
1 by brian
clean slate
20
1812.3.1 by Brian Aker
This patch encapsulates the MySQL protocol around the Drizzle port so that we have access even in the event of MySQL being installed and running.
21
1333 by Brian Aker
Fix naming issue.
22
#ifndef PLUGIN_DRIZZLE_PROTOCOL_DRIZZLE_PROTOCOL_H
23
#define PLUGIN_DRIZZLE_PROTOCOL_DRIZZLE_PROTOCOL_H
1 by brian
clean slate
24
971.6.7 by Eric Day
Reworked listen interface to not require binding of TCP ports.
25
#include <drizzled/plugin/listen_tcp.h>
971.6.1 by Eric Day
Renamed Protocol to Client, cleaned up some unnecessary methods along the way.
26
#include <drizzled/plugin/client.h>
1726.3.6 by LinuxJedi
Add data_dictionary table for drizzle protocol status
27
#include <drizzled/atomics.h>
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
28
#include <drizzled/plugin/table_function.h>
971.3.16 by Eric Day
Cleaned up Protocol plugin interface (now a class factory) and moved libdrizzlclient to oldlibdrizzle to be clear.
29
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
30
#include <plugin/mysql_protocol/mysql_protocol.h>
584.1.14 by Monty Taylor
Removed field.h from common_includes.
31
1964.2.9 by Monty Taylor
All protocol stuff except for the buffer_length. WTF?
32
namespace drizzle_plugin
33
{
1300.5.1 by Monty Taylor
Put drizzle_protocol plugin in to its own namespace so that symbols won't
34
namespace drizzle_protocol
35
{
36
1812.3.1 by Brian Aker
This patch encapsulates the MySQL protocol around the Drizzle port so that we have access even in the event of MySQL being installed and running.
37
class ListenDrizzleProtocol: public ListenMySQLProtocol
971.3.48 by Eric Day
New Listen interface about done, not quite compiling yet, but need a backup.
38
{
39
public:
1964.2.9 by Monty Taylor
All protocol stuff except for the buffer_length. WTF?
40
  ListenDrizzleProtocol(std::string name, 
41
                        const std::string &bind_address,
42
                        bool using_mysql41_protocol):
43
    ListenMySQLProtocol(name, bind_address, using_mysql41_protocol)
1130.2.3 by Monty Taylor
Made Listen into a Plugin.
44
  { }
1812.3.1 by Brian Aker
This patch encapsulates the MySQL protocol around the Drizzle port so that we have access even in the event of MySQL being installed and running.
45
46
  ~ListenDrizzleProtocol();
47
  in_port_t getPort(void) const;
1953.2.6 by Andrew Hutchings
Completely redo max-connections so it is independant per-protocol. Also make counters independant
48
  static ProtocolCounters *drizzle_counters;
49
  virtual ProtocolCounters *getCounters(void) const { return drizzle_counters; }
1960.2.6 by Andrew Hutchings
Add ip address limitation for admin connections
50
  drizzled::plugin::Client *getClient(int fd);
51
};
52
53
class ClientDrizzleProtocol: public ClientMySQLProtocol
54
{
55
public:
56
  ClientDrizzleProtocol(int fd, ProtocolCounters *set_counters): ClientMySQLProtocol(fd, true, set_counters) {}
57
58
  static std::vector<std::string> drizzle_admin_ip_addresses;
59
  static void drizzle_compose_ip_addresses(std::vector<std::string> options);
60
  bool isAdminAllowed(void);
61
};
1 by brian
clean slate
62
1320.2.1 by Monty Taylor
Merged in drizzle_protocol namespace change.
63
} /* namespace drizzle_protocol */
1964.2.9 by Monty Taylor
All protocol stuff except for the buffer_length. WTF?
64
} /* namespace drizzle_plugin */
65
 
1333 by Brian Aker
Fix naming issue.
66
#endif /* PLUGIN_DRIZZLE_PROTOCOL_DRIZZLE_PROTOCOL_H */