971.7.10
by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port. |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 Sun Microsystems
|
|
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
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
19 |
||
1337.4.1
by Eric Day
Removed unused functions and extra complexity in MySQL module. Not rewriting any code here (yet?), just reshuffling to make it easier to manage. |
20 |
#ifndef PLUGIN_MYSQL_PROTOCOL_MYSQL_PROTOCOL_H
|
21 |
#define PLUGIN_MYSQL_PROTOCOL_MYSQL_PROTOCOL_H
|
|
971.7.10
by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port. |
22 |
|
23 |
#include <drizzled/plugin/listen_tcp.h> |
|
24 |
#include <drizzled/plugin/client.h> |
|
25 |
||
26 |
#include "net_serv.h" |
|
27 |
||
28 |
class ListenMySQLProtocol: public drizzled::plugin::ListenTcp |
|
29 |
{
|
|
30 |
private: |
|
31 |
bool using_mysql41_protocol; |
|
32 |
||
33 |
public: |
|
34 |
ListenMySQLProtocol(std::string name_arg, bool using_mysql41_protocol_arg): |
|
35 |
drizzled::plugin::ListenTcp(name_arg), |
|
36 |
using_mysql41_protocol(using_mysql41_protocol_arg) |
|
37 |
{ } |
|
38 |
virtual const char* getHost(void) const; |
|
39 |
virtual in_port_t getPort(void) const; |
|
40 |
virtual drizzled::plugin::Client *getClient(int fd); |
|
41 |
};
|
|
42 |
||
43 |
class ClientMySQLProtocol: public drizzled::plugin::Client |
|
44 |
{
|
|
45 |
private: |
|
46 |
NET net; |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
47 |
drizzled::String packet; |
971.7.10
by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port. |
48 |
uint32_t client_capabilities; |
49 |
bool using_mysql41_protocol; |
|
50 |
||
51 |
bool checkConnection(void); |
|
52 |
bool netStoreData(const unsigned char *from, size_t length); |
|
53 |
void writeEOFPacket(uint32_t server_status, uint32_t total_warn_count); |
|
1337.4.1
by Eric Day
Removed unused functions and extra complexity in MySQL module. Not rewriting any code here (yet?), just reshuffling to make it easier to manage. |
54 |
unsigned char *storeLength(unsigned char *packet, uint64_t length); |
1337.4.5
by Eric Day
Added MySQL password hash support. |
55 |
void makeScramble(char *scramble); |
971.7.10
by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port. |
56 |
|
57 |
public: |
|
58 |
ClientMySQLProtocol(int fd, bool using_mysql41_protocol_arg); |
|
59 |
virtual ~ClientMySQLProtocol(); |
|
60 |
||
61 |
virtual int getFileDescriptor(void); |
|
62 |
virtual bool isConnected(); |
|
63 |
virtual bool isReading(void); |
|
64 |
virtual bool isWriting(void); |
|
65 |
virtual bool flush(void); |
|
66 |
virtual void close(void); |
|
67 |
||
68 |
virtual bool authenticate(void); |
|
69 |
virtual bool readCommand(char **packet, uint32_t *packet_length); |
|
70 |
||
71 |
virtual void sendOK(void); |
|
72 |
virtual void sendEOF(void); |
|
73 |
virtual void sendError(uint32_t sql_errno, const char *err); |
|
74 |
||
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
75 |
virtual bool sendFields(drizzled::List<drizzled::Item> *list); |
971.7.10
by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port. |
76 |
|
77 |
using Client::store; |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
78 |
virtual bool store(drizzled::Field *from); |
971.7.10
by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port. |
79 |
virtual bool store(void); |
80 |
virtual bool store(int32_t from); |
|
81 |
virtual bool store(uint32_t from); |
|
82 |
virtual bool store(int64_t from); |
|
83 |
virtual bool store(uint64_t from); |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
84 |
virtual bool store(double from, uint32_t decimals, drizzled::String *buffer); |
971.7.10
by Eric Day
Duplicated oldlibdrizzle module, one for Drizzle protocol and one for MySQL, per Brian's request from merge proposal. Port options are now --drizzle-protocol-port and --mysql-protocol-port. |
85 |
virtual bool store(const char *from, size_t length); |
86 |
||
87 |
virtual bool haveError(void); |
|
88 |
virtual bool haveMoreData(void); |
|
89 |
virtual bool wasAborted(void); |
|
90 |
};
|
|
91 |
||
1337.4.1
by Eric Day
Removed unused functions and extra complexity in MySQL module. Not rewriting any code here (yet?), just reshuffling to make it easier to manage. |
92 |
#endif /* PLUGIN_MYSQL_PROTOCOL_MYSQL_PROTOCOL_H */ |