00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 <boost/filesystem.hpp>
00030
00031 #include <plugin/mysql_protocol/mysql_protocol.h>
00032
00033 namespace drizzle_plugin
00034 {
00035 namespace mysql_unix_socket_protocol
00036 {
00037
00038 class Protocol: public ListenMySQLProtocol
00039 {
00040 const boost::filesystem::path _unix_socket_path;
00041 public:
00042 Protocol(std::string name,
00043 bool using_mysql41_protocol,
00044 const boost::filesystem::path &unix_socket_path) :
00045 ListenMySQLProtocol(name, unix_socket_path.file_string(),
00046 using_mysql41_protocol),
00047 _unix_socket_path(unix_socket_path)
00048 { }
00049
00050 ~Protocol();
00051 bool getFileDescriptors(std::vector<int> &fds);
00052
00053 in_port_t getPort(void) const;
00054 static ProtocolCounters *mysql_unix_counters;
00055 virtual ProtocolCounters *getCounters(void) const {return mysql_unix_counters; }
00056 drizzled::plugin::Client *getClient(int fd);
00057 };
00058
00059 class ClientMySQLUnixSocketProtocol: public ClientMySQLProtocol
00060 {
00061 public:
00062 ClientMySQLUnixSocketProtocol(int fd, bool __using_mysql41_protocol, ProtocolCounters *set_counters): ClientMySQLProtocol(fd, __using_mysql41_protocol, set_counters) {}
00063
00064
00065 bool isAdminAllowed(void) { return false; }
00066 };
00067
00068
00069 }
00070 }
00071