75 Commits

Author SHA1 Message Date
Massimiliano Pinto
dcc6071ddd Fixed bug in for(), newSession 2013-06-21 16:28:53 +02:00
Massimiliano Pinto
e767c70acb Added backend connections via session_alloc called after AUTH_OK
the newSession calls connect_dcb and then the connect() in mysql_backend.c

The selected backend is always the last  one ath the moment.

For the transparent Authentication dcb->data is used to store MySQL session data before starting the session.

This could be revisited.


Please note the COM_QUIT in mysql_client.c has the close functionalities but they are now disabled for testing/debug
2013-06-21 13:05:51 +02:00
Massimiliano Pinto
ccf658d905 Added 3 includes, service, router, poll 2013-06-21 12:49:42 +02:00
Massimiliano Pinto
d2fbc42b3a alloc_dcb now has rval->next = NULL; 2013-06-21 12:35:01 +02:00
Mark Riddoch
cb26490a06 Addition of server status flags
Addition of dcb role API
2013-06-21 10:45:39 +02:00
Massimiliano Pinto
237a311dda In newSession (readconnroute.c) connect_dcb will create backend connection via backend_dcb->func.connect()
session_alloc will not start a newSession for the LISTENING socket

In dcb.h void *data was added to keep protocol session data if the session is not started in accept(9 but later.
2013-06-20 19:06:16 +02:00
Mark Riddoch
088b3473bc Improved to diagnostic routines and documentation for the debug cli interpreter 2013-06-20 15:03:55 +02:00
Mark Riddoch
e55631e60f Improved debug CLI command interpreter to allow for commands with arguments 2013-06-20 13:21:37 +02:00
Mark Riddoch
fc852eaada Changed readconnroute backend structure to simply maintain a pointer to the server rather than
include the hostname and port in the backend structure

Fix to makefile for routing modules
2013-06-20 10:18:14 +02:00
Mark Riddoch
78c371e92f Changes to connect infrastructure 2013-06-19 19:11:35 +02:00
Mark Riddoch
39c8695819 Misc fixes 2013-06-19 18:46:24 +02:00
Mark Riddoch
0fc2f9dda3 Removed the passing of epoll fd and isolated epoll functionality to
a signle file

Addition of show epoll debug CLI command
2013-06-19 16:29:52 +02:00
Mark Riddoch
c2b24884fd Updates for the debug cli interface 2013-06-19 13:21:37 +02:00
Mark Riddoch
53b6bc0a25 A number of updates to do with service startup
Telnet protocol support

Debug cli
2013-06-19 12:31:40 +02:00
Massimiliano Pinto
461dc31578 Fixed:
if (strcmp(registered->module, module) == 0)

in find_module
2013-06-19 11:32:53 +02:00
Mark Riddoch
ec688e6222 Addition of the service, server, serv_protocol and session structure needed to tie the elements together.
Improvements to the protocol module support

Documentation improvements

Addition of make install target
2013-06-18 16:59:01 +02:00
Massimiliano Pinto
4d5215e267 mysql_client_server_protocol.h, new file name that avoids conflicts with previous one 2013-06-17 22:47:14 +02:00
Massimiliano Pinto
f4711f5980 Added 2013-06-17 21:25:15 +02:00
Massimiliano Pinto
aa517205b7 Added mysql_common.c for mysql common routines
First attempt to split MySQL routines in client and backend libraries.
Compiled on Centos but not tested

mysql_protocol.h header file is coming soon.
2013-06-17 16:25:22 +02:00
Mark Riddoch
6afc2e432b Addition of -Wall to CFLAGS
Cleanup warnings produced by above with the exception of those files requiring reorganisation
2013-06-17 14:25:32 +02:00
Mark Riddoch
1300c5d089 Addition of dependencies to the makefile
New make target of "make depend"
Addition of doxygen building ability
Cleanup of docygen comment blocks
Initial telnetd protocol module structure
2013-06-17 14:03:05 +02:00
Massimiliano Pinto
876af46cdd Added 3 func defs 2013-06-17 09:33:07 +02:00
Mark Riddoch
939d2bf46c Addition of a version of printf that can print to a DCB 2013-06-15 12:12:21 +01:00
Massimiliano Pinto
fad37adfbf Added comments for gw_mysql_do_authentication 2013-06-14 18:39:42 +02:00
Massimiliano Pinto
eef179e6d4 Added 2013-06-14 18:32:51 +02:00
Mark Riddoch
0a5becbe81 Added skeletons for the two MySQL protocol modules. The actual code still needs to be moved into the modules 2013-06-14 18:29:08 +02:00
Mark Riddoch
cc448f4bb9 Updated testroute after modification to entry point definition 2013-06-14 18:28:34 +02:00
Massimiliano Pinto
aa006a9406 gw_mysql_do_authentication puts user, db, and client_sha1 in the (MYSQL_session *) session->data of client DCB.
gw_mysql_connect can now access this session->data for transparent authentication
2013-06-14 18:27:43 +02:00
Massimiliano Pinto
936ccfeda3 Merged 2013-06-14 18:13:23 +02:00
Massimiliano Pinto
1239420be1 create_backend_connection added.
This routine calls the gw_mysql_connect passing the MySQL_session data available
2013-06-14 18:05:29 +02:00
Mark Riddoch
34372fbc5d Addition of connect function to dcb functions and added dcb_connect routine 2013-06-14 17:55:31 +02:00
Massimiliano Pinto
ebbe4bf035 Fixed a space at the beginning of comment 2013-06-14 17:50:13 +02:00
Massimiliano Pinto
e8d6289ca2 Added void *data for generic session data
Added MySQL_session for specifc mysql data in session: user, sha1_cleient_passowrd, database_name
2013-06-14 17:46:44 +02:00
Massimiliano Pinto
6071f89b4f Commit, again bzr merge 2013-06-14 17:36:31 +02:00
Massimiliano Pinto
438ba42f0a Commit these files, fixing bzr merge message 2013-06-14 17:35:14 +02:00
Mark Riddoch
cf6b18a4fe A slight rejig of the server/service setup for the backend databases. Also including the protocol
module names.
2013-06-14 17:05:00 +02:00
Mark Riddoch
2260bf7587 Addition of Read Connection Balancer for Query Routing 2013-06-14 16:26:22 +02:00
Massimiliano Pinto
6690320542 Commiting these files 2013-06-14 14:27:43 +02:00
Mark Riddoch
3b86c93adf Addition of global Makefile
First example external module, testroute, has been added. This serves more as an example than a real router
Updated module loading to used fixed GetModuleObject route and addition of ModuleInit routine
2013-06-14 11:51:54 +02:00
Massimiliano Pinto
748230a7bb Merge commit 2013-06-13 18:44:29 +02:00
Massimiliano Pinto
a5e1441cb8 Some fprintf removed.
Fixed an if statement without brackets
2013-06-13 18:38:03 +02:00
Mark Riddoch
61cf0c6187 Addition of interface for loading external modules as shared library objects 2013-06-13 18:30:15 +02:00
Massimiliano Pinto
269bef8280 Authentication FAILED triggers client and backend connection close.
mysqlslap tests show some memory is nod deallocated, probably some gwbuffer incorrect use or the error handling is not triggering any consume action on buffers.
2013-06-13 18:09:14 +02:00
Massimiliano Pinto
a89c2bc1c0 Added gw_mysql_do_authentication() for checking authentication.
I uses the mysql protocol 4.1 authentication method.

The actual implementation requires the password is excatly equal to the username.

The client sends user: "user" and the password must be "user"

The gateway converts "user" in SHA1(SHA1("user") and then using the algorithm check all the data.

if the clients sends anything else than "user" the password algorithm check will fail.

IN the next release we must load into memory the content of mysql.user table, with fields user and password in memory.

The gateway will then find the HEX(SHA1(SHA1(real_password))) fro tahta table and check the incoming data.

Please note that real_password is not stored in any place: not in mysql db nor in the gateway.
2013-06-13 14:34:37 +02:00
Massimiliano Pinto
732ff1732f Added username detection ofr authentication 2013-06-13 10:32:42 +02:00
Massimiliano Pinto
bf36f01c33 Initial work on client flags(comprtess, client connect with db), next is authentication check 2013-06-13 10:13:43 +02:00
Massimiliano Pinto
e31957f2d1 Initial work on local authentication 2013-06-13 10:12:50 +02:00
Massimiliano Pinto
84ec7ffd51 Some fprintf has been removed 2013-06-13 00:31:35 +02:00
Massimiliano Pinto
368ce2d8b7 New funcion for reading and store data in gwbuff, and its use in reading from client 2013-06-12 23:58:41 +02:00
Massimiliano Pinto
2a9e0b06ef New version 2013-06-12 22:23:09 +02:00