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
This commit is contained in:
parent
876af46cdd
commit
1300c5d089
10
Makefile
10
Makefile
@ -17,6 +17,8 @@
|
||||
# Revision History
|
||||
# Date Who Description
|
||||
# 14/06/13 Mark Riddoch Initial implementation
|
||||
# 17/06/13 Mark Riddoch Addition of documentation and depend
|
||||
# targets
|
||||
|
||||
all:
|
||||
(cd core; make)
|
||||
@ -24,6 +26,14 @@ all:
|
||||
(cd modules/protocol; make)
|
||||
|
||||
clean:
|
||||
(cd Documentation; rm -rf html)
|
||||
(cd core; make clean)
|
||||
(cd modules/routing; make clean)
|
||||
(cd modules/protocol; make clean)
|
||||
|
||||
depend:
|
||||
(cd core; make depend)
|
||||
(cd modules/routing; make depend)
|
||||
|
||||
documentation:
|
||||
doxygen doxygate
|
||||
|
@ -18,6 +18,7 @@
|
||||
# Date Who Description
|
||||
# 13/06/13 Mark Riddoch Addition of -rdynamic to allow libraries
|
||||
# to resolve symbols in the main executable
|
||||
# 17/06/13 Mark Riddoch Addition of dependency generation
|
||||
|
||||
CC=cc
|
||||
CFLAGS=-c -I/usr/include -I../include
|
||||
@ -42,3 +43,11 @@ clean:
|
||||
|
||||
tags:
|
||||
ctags $(SRCS) $(HDRS)
|
||||
|
||||
depend: depend.mk
|
||||
|
||||
depend.mk: $(SRCS)
|
||||
@rm -f depend.mk
|
||||
cc -M $(CFLAGS) $(SRCS) > depend.mk
|
||||
|
||||
include depend.mk
|
||||
|
@ -16,17 +16,19 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* atomic.c - Implementation of atomic opertions for the gateway
|
||||
/**
|
||||
* @file atomic.c - Implementation of atomic opertions for the gateway
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 10/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* Implementation of an atomic add operation for the X86 processor.
|
||||
* Adds a value to the contents of a location pointed to by the first parameter.
|
||||
* The add operation is atomic and the return value is the value stored in the location
|
||||
|
@ -16,20 +16,27 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* buffer.h - The Gateway buffer management functions
|
||||
/**
|
||||
* @file buffer.h - The Gateway buffer management functions
|
||||
*
|
||||
* The buffer management is based on the principle of a linked list
|
||||
* of variable size buffer, the intention beign to allow longer
|
||||
* content to be buffered in a list and minimise any need to copy
|
||||
* data between buffers.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 10/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <buffer.h>
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Allocate a new gateway buffer structure of size bytes.
|
||||
*
|
||||
* For now we allocate memory directly from malloc for buffer the management
|
||||
@ -64,7 +71,7 @@ GWBUF *rval;
|
||||
return rval;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Free a gateway buffer
|
||||
*
|
||||
* @param buf The buffer to free
|
||||
@ -76,7 +83,7 @@ gwbuf_free(GWBUF *buf)
|
||||
free(buf);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Append a buffer onto a linked list of buffer structures.
|
||||
*
|
||||
* This call should be made with the caller holding the lock for the linked
|
||||
@ -101,7 +108,7 @@ GWBUF *ptr = head;
|
||||
return head;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Consume data from a buffer in the linked list. The assumption is to consume
|
||||
* n bytes from the buffer chain.
|
||||
*
|
||||
@ -131,7 +138,7 @@ GWBUF *rval = head;
|
||||
return rval;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Return the number of bytes of data in the linked list.
|
||||
*
|
||||
* @param head The current head of the linked list
|
||||
|
29
core/dcb.c
29
core/dcb.c
@ -16,14 +16,22 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* dcb.c - Descriptor Control Block generic functions
|
||||
/**
|
||||
* @file dcb.c - Descriptor Control Block generic functions
|
||||
*
|
||||
* Descriptor control blocks provide the key mechanism for the interface
|
||||
* with the non-blocking socket polling routines. The descriptor control
|
||||
* block is the user data that is handled by the epoll system and contains
|
||||
* the state data and pointers to other components that relate to the
|
||||
* use of a file descriptor.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 12/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
@ -33,11 +41,12 @@
|
||||
#include <spinlock.h>
|
||||
#include <server.h>
|
||||
#include <session.h>
|
||||
#include <modules.h>
|
||||
|
||||
static DCB *allDCBs = NULL; /* Diagnotics need a list of DCBs */
|
||||
static SPINLOCK *dcbspin = NULL;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Allocate a new DCB.
|
||||
*
|
||||
* This routine performs the generic initialisation on the DCB before returning
|
||||
@ -80,7 +89,7 @@ DCB *rval;
|
||||
return rval;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Free a DCB and remove it from the chain of all DCBs
|
||||
*
|
||||
* @param dcb THe DCB to free
|
||||
@ -107,7 +116,7 @@ free_dcb(DCB *dcb)
|
||||
free(dcb);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Connect to a server
|
||||
*
|
||||
* @param server The server to connect to
|
||||
@ -125,7 +134,7 @@ int epollfd = -1; // Need to work out how to get this
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if ((funcs = load_module(protocol, "Protocol")) == NULL)
|
||||
if ((funcs = (GWPROTOCOL *)load_module(protocol, "Protocol")) == NULL)
|
||||
{
|
||||
free(dcb);
|
||||
return NULL;
|
||||
@ -146,7 +155,7 @@ int epollfd = -1; // Need to work out how to get this
|
||||
return dcb;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Diagnostic to print a DCB
|
||||
*
|
||||
* @param dcb The DCB to print
|
||||
@ -165,7 +174,7 @@ printDCB(DCB *dcb)
|
||||
(void)printf("\t\tNo. of Accepts: %d\n", dcb->stats.n_accepts);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Diagnostic to print all DCB allocated in the system
|
||||
*
|
||||
*/
|
||||
@ -189,7 +198,7 @@ DCB *dcb;
|
||||
spinlock_release(dcbspin);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Return a string representation of a DCB state.
|
||||
*
|
||||
* @param state The DCB state
|
||||
@ -218,7 +227,7 @@ gw_dcb_state2string (int state) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* A DCB based wrapper for printf. Allows formattign printing to
|
||||
* a descritor control block.
|
||||
*
|
||||
|
260
core/depend.mk
Normal file
260
core/depend.mk
Normal file
@ -0,0 +1,260 @@
|
||||
atomic.o: atomic.c
|
||||
buffer.o: buffer.c /usr/include/stdlib.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/sys/types.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/alloca.h ../include/buffer.h
|
||||
spinlock.o: spinlock.c ../include/spinlock.h ../include/thread.h \
|
||||
/usr/include/pthread.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/sched.h /usr/include/bits/types.h \
|
||||
/usr/include/bits/typesizes.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/time.h /usr/include/bits/sched.h /usr/include/bits/time.h \
|
||||
/usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/bits/setjmp.h ../include/atomic.h
|
||||
gateway.o: gateway.c ../include/gw.h /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \
|
||||
/usr/include/bits/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
|
||||
/usr/include/asm-generic/errno-base.h /usr/include/netdb.h \
|
||||
/usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wchar.h /usr/include/sys/socket.h \
|
||||
/usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/bits/uio.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/asm-generic/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \
|
||||
/usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/environments.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \
|
||||
/usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \
|
||||
/usr/include/string.h /usr/include/stdlib.h \
|
||||
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
|
||||
/usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
/usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \
|
||||
/usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \
|
||||
/usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \
|
||||
/usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdbool.h \
|
||||
../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \
|
||||
../include/thread.h /usr/include/pthread.h /usr/include/sched.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \
|
||||
../include/mysql_protocol.h ../include/dcb.h ../include/session.h
|
||||
gateway_mysql_protocol.o: gateway_mysql_protocol.c ../include/gw.h \
|
||||
/usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \
|
||||
/usr/include/bits/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
|
||||
/usr/include/asm-generic/errno-base.h /usr/include/netdb.h \
|
||||
/usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wchar.h /usr/include/sys/socket.h \
|
||||
/usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/bits/uio.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/asm-generic/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \
|
||||
/usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/environments.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \
|
||||
/usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \
|
||||
/usr/include/string.h /usr/include/stdlib.h \
|
||||
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
|
||||
/usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
/usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \
|
||||
/usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \
|
||||
/usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \
|
||||
/usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdbool.h \
|
||||
../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \
|
||||
../include/thread.h /usr/include/pthread.h /usr/include/sched.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \
|
||||
../include/mysql_protocol.h ../include/dcb.h ../include/session.h \
|
||||
/usr/include/openssl/sha.h /usr/include/openssl/e_os2.h \
|
||||
/usr/include/openssl/opensslconf.h \
|
||||
/usr/include/openssl/opensslconf-x86_64.h
|
||||
gw_utils.o: gw_utils.c ../include/gw.h /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \
|
||||
/usr/include/bits/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
|
||||
/usr/include/asm-generic/errno-base.h /usr/include/netdb.h \
|
||||
/usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wchar.h /usr/include/sys/socket.h \
|
||||
/usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/bits/uio.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/asm-generic/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \
|
||||
/usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/environments.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \
|
||||
/usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \
|
||||
/usr/include/string.h /usr/include/stdlib.h \
|
||||
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
|
||||
/usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
/usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \
|
||||
/usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \
|
||||
/usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \
|
||||
/usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdbool.h \
|
||||
../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \
|
||||
../include/thread.h /usr/include/pthread.h /usr/include/sched.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \
|
||||
../include/mysql_protocol.h ../include/dcb.h ../include/session.h
|
||||
utils.o: utils.c ../include/gw.h /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/xlocale.h /usr/include/errno.h \
|
||||
/usr/include/bits/errno.h /usr/include/linux/errno.h \
|
||||
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
|
||||
/usr/include/asm-generic/errno-base.h /usr/include/netdb.h \
|
||||
/usr/include/netinet/in.h /usr/include/stdint.h \
|
||||
/usr/include/bits/wchar.h /usr/include/sys/socket.h \
|
||||
/usr/include/sys/uio.h /usr/include/sys/types.h /usr/include/time.h \
|
||||
/usr/include/sys/select.h /usr/include/bits/select.h \
|
||||
/usr/include/bits/sigset.h /usr/include/bits/time.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/bits/uio.h /usr/include/bits/socket.h \
|
||||
/usr/include/bits/sockaddr.h /usr/include/asm/socket.h \
|
||||
/usr/include/asm-generic/socket.h /usr/include/asm/sockios.h \
|
||||
/usr/include/asm-generic/sockios.h /usr/include/bits/in.h \
|
||||
/usr/include/rpc/netdb.h /usr/include/bits/netdb.h /usr/include/fcntl.h \
|
||||
/usr/include/bits/fcntl.h /usr/include/bits/stat.h /usr/include/unistd.h \
|
||||
/usr/include/bits/posix_opt.h /usr/include/bits/environments.h \
|
||||
/usr/include/bits/confname.h /usr/include/getopt.h /usr/include/syslog.h \
|
||||
/usr/include/sys/syslog.h /usr/include/bits/syslog-path.h \
|
||||
/usr/include/string.h /usr/include/stdlib.h \
|
||||
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
|
||||
/usr/include/alloca.h /usr/include/pwd.h /usr/include/sys/epoll.h \
|
||||
/usr/include/signal.h /usr/include/bits/signum.h \
|
||||
/usr/include/bits/siginfo.h /usr/include/bits/sigaction.h \
|
||||
/usr/include/bits/sigcontext.h /usr/include/bits/sigstack.h \
|
||||
/usr/include/sys/ucontext.h /usr/include/bits/sigthread.h \
|
||||
/usr/include/sys/ioctl.h /usr/include/bits/ioctls.h \
|
||||
/usr/include/asm/ioctls.h /usr/include/asm-generic/ioctls.h \
|
||||
/usr/include/linux/ioctl.h /usr/include/asm/ioctl.h \
|
||||
/usr/include/asm-generic/ioctl.h /usr/include/bits/ioctl-types.h \
|
||||
/usr/include/sys/ttydefaults.h /usr/include/arpa/inet.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdbool.h \
|
||||
../include/gateway_mysql.h ../include/dcb.h ../include/spinlock.h \
|
||||
../include/thread.h /usr/include/pthread.h /usr/include/sched.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/setjmp.h ../include/buffer.h \
|
||||
../include/mysql_protocol.h ../include/dcb.h ../include/session.h \
|
||||
../include/mysql_protocol.h /usr/include/openssl/sha.h \
|
||||
/usr/include/openssl/e_os2.h /usr/include/openssl/opensslconf.h \
|
||||
/usr/include/openssl/opensslconf-x86_64.h
|
||||
dcb.o: dcb.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
|
||||
/usr/include/bits/waitstatus.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
|
||||
/usr/include/string.h /usr/include/xlocale.h ../include/dcb.h \
|
||||
../include/spinlock.h ../include/thread.h /usr/include/pthread.h \
|
||||
/usr/include/sched.h /usr/include/bits/sched.h \
|
||||
/usr/include/bits/setjmp.h ../include/buffer.h ../include/server.h \
|
||||
../include/session.h ../include/modules.h
|
||||
load_utils.o: load_utils.c /usr/include/sys/param.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/limits.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/syslimits.h \
|
||||
/usr/include/limits.h /usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h /usr/include/bits/posix1_lim.h \
|
||||
/usr/include/bits/local_lim.h /usr/include/linux/limits.h \
|
||||
/usr/include/bits/posix2_lim.h /usr/include/linux/param.h \
|
||||
/usr/include/asm/param.h /usr/include/asm-generic/param.h \
|
||||
/usr/include/sys/types.h /usr/include/bits/types.h \
|
||||
/usr/include/bits/typesizes.h /usr/include/time.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/stdio.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
|
||||
/usr/include/bits/waitstatus.h /usr/include/alloca.h \
|
||||
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
|
||||
/usr/include/bits/environments.h /usr/include/bits/confname.h \
|
||||
/usr/include/getopt.h /usr/include/string.h /usr/include/xlocale.h \
|
||||
/usr/include/dlfcn.h /usr/include/bits/dlfcn.h ../include/modules.h
|
@ -17,7 +17,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file Gateway.c - The gateway entry point.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
@ -26,6 +29,7 @@
|
||||
* listening port
|
||||
* and bind addr is 0.0.0.0
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
#include <gw.h>
|
||||
|
@ -17,7 +17,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
*
|
||||
* gw_utils.c - A set if utility functions useful within the context
|
||||
* of the gateway.
|
||||
*
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
@ -258,7 +262,7 @@ int gw_read_gwbuff(DCB *dcb, GWBUF **head, int b) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Create a new MySQL backend connection.
|
||||
*
|
||||
* This routine performs the MySQL connection to the backend and fills the session->backends of the callier dcb
|
||||
|
@ -16,10 +16,11 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* load_utils.c Utility functions to aid the loading of dynamic modules
|
||||
/**
|
||||
* @file load_utils.c Utility functions to aid the loading of dynamic modules
|
||||
* into the gateway
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
@ -28,6 +29,7 @@
|
||||
* in the loaded module.
|
||||
* Also updated to call fixed GetModuleObject
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
@ -43,7 +45,7 @@ static MODULES *find_module(const char *module);
|
||||
static void register_module(const char *module, const char *type, void *dlhandle, char *version, void *modobj);
|
||||
static void unregister_module(const char *module);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Load the dynamic library related to a gateway module. The routine
|
||||
* will look for library files in the current directory,
|
||||
* $GATEWAY_HOME/modules and /usr/local/skysql/gateway/modules.
|
||||
@ -130,7 +132,7 @@ MODULES *mod;
|
||||
return modobj;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Unload a module.
|
||||
*
|
||||
* No errors are returned since it is not clear that much can be done
|
||||
@ -151,7 +153,7 @@ void *handle;
|
||||
dlclose(handle);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Find a module that has been previously loaded and return the handle for that
|
||||
* library
|
||||
*
|
||||
@ -171,7 +173,7 @@ MODULES *ptr = registered;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Register a newly loaded module. The registration allows for single copies
|
||||
* to be loaded and cached entry point information to be return.
|
||||
*
|
||||
@ -197,7 +199,7 @@ MODULES *mod;
|
||||
registered = mod;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Unregister a module
|
||||
*
|
||||
* @param module The name of the module to remove
|
||||
@ -229,7 +231,7 @@ MODULES *ptr;
|
||||
free(mod);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Print Modules
|
||||
*
|
||||
* Diagnostic routine to display all the loaded modules
|
||||
|
@ -16,20 +16,22 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* spinlock.c - Spinlock operations for the SkySQL Gateway
|
||||
/**
|
||||
* @file spinlock.c - Spinlock operations for the SkySQL Gateway
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 10/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
#include <spinlock.h>
|
||||
#include <atomic.h>
|
||||
|
||||
/*
|
||||
/**
|
||||
* Initialise a spinlock.
|
||||
*
|
||||
* @param lock The spinlock to initialise.
|
||||
@ -44,7 +46,7 @@ spinlock_init(SPINLOCK *lock)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Acquire a spinlock.
|
||||
*
|
||||
* @param lock The spinlock to acquire
|
||||
@ -65,7 +67,7 @@ spinlock_acquire(SPINLOCK *lock)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Acquire a spinlock if it is not already locked.
|
||||
*
|
||||
* @param lock The spinlock to acquire
|
||||
|
@ -17,7 +17,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file utils.c - General utility functions
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
@ -27,6 +30,7 @@
|
||||
* 13-06-2013 Massimiliano Pinto Gateway local authentication
|
||||
* basics
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
|
||||
@ -111,7 +115,7 @@ int gw_read_backend_event(DCB *dcb, int epfd) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Write function for client DCB
|
||||
*
|
||||
* @param dcb The DCB of the client
|
||||
|
@ -18,14 +18,16 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* The atomic operations used within the gateway
|
||||
/**
|
||||
* @file atomic.h The atomic operations used within the gateway
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 10/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
extern int atomic_add(int *variable, int value);
|
||||
|
@ -18,8 +18,9 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions relating the gateway buffer manipulation facilities.
|
||||
/**
|
||||
* @file buffer.h Definitions relating the gateway buffer manipulation facilities.
|
||||
*
|
||||
* These are used to store all data coming in form or going out to the client and the
|
||||
* backend structures.
|
||||
*
|
||||
@ -30,17 +31,19 @@
|
||||
* last valid byte. This allows data to be consumed from either end of the buffer whilst
|
||||
* still allowing for the copy free semantics of the buffering system.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 10/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
typedef struct gwbuf {
|
||||
struct gwbuf *next; // Next buffer in a linked chain of buffers
|
||||
void *start; // Start of the valid data
|
||||
void *end; // First byte after the valid data
|
||||
unsigned char *data; // Physical memory that was allocated
|
||||
struct gwbuf *next; /**< Next buffer in a linked chain of buffers */
|
||||
void *start; /**< Start of the valid data */
|
||||
void *end; /**< First byte after the valid data */
|
||||
unsigned char *data; /**< Physical memory that was allocated */
|
||||
} GWBUF;
|
||||
|
||||
/*
|
||||
|
@ -23,10 +23,13 @@
|
||||
struct session;
|
||||
struct server;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file dcb.h The Descriptor Control Block
|
||||
*
|
||||
* The function pointer table used by descriptors to call relevant functions
|
||||
* within the protocol specific code.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
@ -34,12 +37,13 @@ struct server;
|
||||
* 11/06/13 Mark Riddoch Updated GWPROTOCOL structure with new
|
||||
* entry points
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
struct dcb;
|
||||
|
||||
typedef struct gw_protocol {
|
||||
/*
|
||||
/**
|
||||
* @verbatim
|
||||
* The operations that can be performed on the descriptor
|
||||
*
|
||||
* read EPOLLIN handler for the socket
|
||||
@ -52,7 +56,9 @@ typedef struct gw_protocol {
|
||||
* connect Create a connection to the specified server
|
||||
* for the session pased in
|
||||
* close Gateway close entry point for the socket
|
||||
* @endverbatim
|
||||
*/
|
||||
typedef struct gw_protocol {
|
||||
int (*read)(struct dcb *, int);
|
||||
int (*write)(struct dcb *, GWBUF *);
|
||||
int (*write_ready)(struct dcb *, int);
|
||||
@ -64,27 +70,27 @@ typedef struct gw_protocol {
|
||||
} GWPROTOCOL;
|
||||
|
||||
typedef struct dcbstats {
|
||||
int n_reads; /* Number of reads on this descriptor */
|
||||
int n_writes; /* Number of writes on this descriptor */
|
||||
int n_accepts; /* Number of accepts on this descriptor */
|
||||
int n_buffered; /* Number of buffered writes */
|
||||
int n_reads; /**< Number of reads on this descriptor */
|
||||
int n_writes; /**< Number of writes on this descriptor */
|
||||
int n_accepts; /**< Number of accepts on this descriptor */
|
||||
int n_buffered; /**< Number of buffered writes */
|
||||
} DCBSTATS;
|
||||
/*
|
||||
* Descriptor Control Block
|
||||
*/
|
||||
typedef struct dcb {
|
||||
int fd; /* The descriptor */
|
||||
int state; /* Current descriptor state */
|
||||
void *protocol; /* The protocol specific state */
|
||||
struct session *session; /* The owning session */
|
||||
GWPROTOCOL func; /* The functions for this descrioptor */
|
||||
int fd; /**< The descriptor */
|
||||
int state; /**< Current descriptor state */
|
||||
void *protocol; /**< The protocol specific state */
|
||||
struct session *session; /**< The owning session */
|
||||
GWPROTOCOL func; /**< The functions for this descrioptor */
|
||||
|
||||
SPINLOCK writeqlock; /* Write Queue spinlock */
|
||||
GWBUF *writeq; /* Write Data Queue */
|
||||
SPINLOCK writeqlock; /**< Write Queue spinlock */
|
||||
GWBUF *writeq; /**< Write Data Queue */
|
||||
|
||||
DCBSTATS stats; /* DCB related statistics */
|
||||
DCBSTATS stats; /**< DCB related statistics */
|
||||
|
||||
struct dcb *next; /* Next DCB in the chain of allocated DCB's */
|
||||
struct dcb *next; /**< Next DCB in the chain of allocated DCB's */
|
||||
} DCB;
|
||||
|
||||
/* DCB states */
|
||||
|
@ -18,24 +18,27 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file modules.h Utilities for loading modules
|
||||
*
|
||||
* The module interface used within the gateway
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 13/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
typedef struct modules {
|
||||
char *module; /* The name of the module */
|
||||
char *type; /* The module type */
|
||||
char *version; /* Module version */
|
||||
void *handle; /* The handle returned by dlopen */
|
||||
void *modobj; /* The module "object" this is the set of entry points */
|
||||
char *module; /**< The name of the module */
|
||||
char *type; /**< The module type */
|
||||
char *version; /**< Module version */
|
||||
void *handle; /**< The handle returned by dlopen */
|
||||
void *modobj; /**< The module "object" this is the set of entry points */
|
||||
struct modules
|
||||
*next; /* Next module in the linked list */
|
||||
*next; /**< Next module in the linked list */
|
||||
} MODULES;
|
||||
|
||||
extern void *load_module(const char *module, const char *type);
|
||||
|
@ -18,8 +18,8 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* The query router interface mechanisms
|
||||
/**
|
||||
* @file router.h - The query router interface mechanisms
|
||||
*
|
||||
* Revision History
|
||||
*
|
||||
@ -38,7 +38,8 @@
|
||||
typedef void *ROUTER;
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* @verbatim
|
||||
* The "module object" structure for a query router module
|
||||
*
|
||||
* The entry points are:
|
||||
@ -49,6 +50,7 @@ typedef void *ROUTER;
|
||||
* closeSession Called when a session is closed
|
||||
* routeQuery Called on each query that requires
|
||||
* routing
|
||||
* @endverbatim
|
||||
*/
|
||||
typedef struct {
|
||||
ROUTER *(*createInstance)(SERVICE *service);
|
||||
|
@ -18,19 +18,23 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file server.h
|
||||
*
|
||||
* The server level definitions within the gateway
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 14/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
typedef struct server {
|
||||
char *name; /* Server name/IP address*/
|
||||
int port; /* Port to listen on */
|
||||
char *protocol; /* Protocol module to use */
|
||||
struct server *next; /* Next server */
|
||||
char *name; /**< Server name/IP address*/
|
||||
int port; /**< Port to listen on */
|
||||
char *protocol; /**< Protocol module to use */
|
||||
struct server *next; /**< Next server */
|
||||
} SERVER;
|
||||
#endif
|
||||
|
@ -18,33 +18,37 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file sevice.h
|
||||
*
|
||||
* The service level definitions within the gateway
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 14/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
struct server;
|
||||
struct router;
|
||||
|
||||
typedef struct servprotocol {
|
||||
char *protocol; /* Protocol module to load */
|
||||
short port; /* Port to listen on */
|
||||
char *protocol; /**< Protocol module to load */
|
||||
short port; /**< Port to listen on */
|
||||
struct servprotocol
|
||||
*next; /* Next service protocol */
|
||||
*next; /**< Next service protocol */
|
||||
} SERV_PROTOCOL;
|
||||
|
||||
typedef struct service {
|
||||
char *name; /* The service name */
|
||||
SERV_PROTOCOL *servers; /* Linked list of ports and protocols
|
||||
char *name; /**< The service name */
|
||||
SERV_PROTOCOL *servers; /**< Linked list of ports and protocols
|
||||
* that this service will listen on.
|
||||
*/
|
||||
char *routerModule; /* Name of router module to use */
|
||||
struct router *router; /* The router we are using */
|
||||
struct server *databases; /* The set of servers in the backend */
|
||||
char *routerModule; /**< Name of router module to use */
|
||||
struct router *router; /**< The router we are using */
|
||||
struct server *databases; /**< The set of servers in the backend */
|
||||
} SERVICE;
|
||||
|
||||
#endif
|
||||
|
@ -18,13 +18,17 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file session.h
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 01-06-2013 Mark Riddoch Initial implementation
|
||||
* 14-06-2013 Massimiliano Pinto Added void *data to session
|
||||
* for session specific data
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
struct dcb;
|
||||
@ -33,10 +37,10 @@ struct dcb;
|
||||
* The session status block
|
||||
*/
|
||||
typedef struct session {
|
||||
int state; /* Current descriptor state */
|
||||
struct dcb *client; /* The client connection */
|
||||
struct dcb *backends; /* The set of backend servers */
|
||||
void *data; /* The session data */
|
||||
int state; /**< Current descriptor state */
|
||||
struct dcb *client; /**< The client connection */
|
||||
struct dcb *backends; /**< The set of backend servers */
|
||||
void *data; /**< The session data */
|
||||
} SESSION;
|
||||
|
||||
#define SESSION_STATE_ALLOC 0
|
||||
|
@ -18,7 +18,9 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file spinlock.h
|
||||
*
|
||||
* Spinlock implementation for ther gateway.
|
||||
*
|
||||
* Spinlocks are cheap locks that can be used to protect short code blocks, they are
|
||||
|
@ -18,46 +18,48 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* The read connection balancing query module heder file
|
||||
/**
|
||||
* @file readconnection.h - The read connection balancing query module heder file
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 14/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
#include <dcb.h>
|
||||
|
||||
/*
|
||||
/**
|
||||
* Internal structure used to define the set of backend servers we are routing
|
||||
* connections to.
|
||||
*/
|
||||
typedef struct backend {
|
||||
char *hostname; /* Server hostname */
|
||||
unsigned short port; /* Port on which the server listens */
|
||||
char *protocol; /* Protocol to use to connect to the server */
|
||||
int count; /* Number of connections to the server */
|
||||
char *hostname; /**< Server hostname */
|
||||
unsigned short port; /**< Port on which the server listens */
|
||||
char *protocol; /**< Protocol to use to connect to the server */
|
||||
int count; /**< Number of connections to the server */
|
||||
} BACKEND;
|
||||
|
||||
/*
|
||||
/**
|
||||
* The client session structure used within this router.
|
||||
*/
|
||||
typedef struct client_session {
|
||||
BACKEND *backend; /* Backend used by the client session */
|
||||
DCB *dcb; /* DCB Connection to the backend */
|
||||
BACKEND *backend; /**< Backend used by the client session */
|
||||
DCB *dcb; /**< DCB Connection to the backend */
|
||||
struct client_session
|
||||
*next;
|
||||
} CLIENT_SESSION;
|
||||
|
||||
/*
|
||||
/**
|
||||
* The per instance data for the router.
|
||||
*/
|
||||
typedef struct instance {
|
||||
SERVICE *service; /* Pointer to the service using this router */
|
||||
CLIENT_SESSION *connections; /* Link list of all the client connections */
|
||||
SPINLOCK lock; /* Spinlock for the instance data */
|
||||
BACKEND **servers; /* The set of backend servers for this instance */
|
||||
SERVICE *service; /**< Pointer to the service using this router */
|
||||
CLIENT_SESSION *connections; /**< Link list of all the client connections */
|
||||
SPINLOCK lock; /**< Spinlock for the instance data */
|
||||
BACKEND **servers; /**< The set of backend servers for this instance */
|
||||
struct instance *next;
|
||||
} INSTANCE;
|
||||
#endif
|
||||
|
@ -45,3 +45,11 @@ clean:
|
||||
|
||||
tags:
|
||||
ctags $(SRCS) $(HDRS)
|
||||
|
||||
depend: depend.mk
|
||||
|
||||
depend.mk: $(SRCS)
|
||||
@rm -f depend.mk
|
||||
cc -M $(CFLAGS) $(SRCS) > depend.mk
|
||||
|
||||
include depend.mk
|
||||
|
30
modules/protocol/depend.mk
Normal file
30
modules/protocol/depend.mk
Normal file
@ -0,0 +1,30 @@
|
||||
mysql_client.o: mysql_client.c /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
../../include/dcb.h ../../include/spinlock.h ../../include/thread.h \
|
||||
/usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/time.h \
|
||||
/usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/bits/setjmp.h ../../include/buffer.h
|
||||
mysql_backend.o: mysql_backend.c /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
../../include/dcb.h ../../include/spinlock.h ../../include/thread.h \
|
||||
/usr/include/pthread.h /usr/include/endian.h /usr/include/bits/endian.h \
|
||||
/usr/include/bits/byteswap.h /usr/include/sched.h /usr/include/time.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/time.h \
|
||||
/usr/include/xlocale.h /usr/include/bits/pthreadtypes.h \
|
||||
/usr/include/bits/setjmp.h ../../include/buffer.h
|
@ -19,13 +19,18 @@
|
||||
#include <dcb.h>
|
||||
#include <buffer.h>
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file mysql_backend.c - protcol module to connect to a backend MySQL database
|
||||
*
|
||||
* MySQL Protocol module for handling the protocol between the gateway
|
||||
* and the backend MySQL database.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
* Date Who Description
|
||||
* 14/06/2013 Mark Riddoch Initial version
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
static char *version_str = "V1.0.0";
|
||||
@ -35,18 +40,21 @@ extern int gw_write_backend_event(DCB *dcb, int epfd);
|
||||
extern int MySQLWrite(DCB *dcb, GWBUF *queue);
|
||||
extern int handle_event_errors_backend(DCB *dcb, int event);
|
||||
|
||||
/**
|
||||
* The module object that defines the entry points to the protocol module.
|
||||
*/
|
||||
static GWPROTOCOL MyObject = {
|
||||
gw_read_backend_event, /* Read - EPOLLIN handler */
|
||||
MySQLWrite, /* Write - data from gateway */
|
||||
gw_write_backend_event, /* WriteReady - EPOLLOUT handler */
|
||||
handle_event_errors_backend, /* Error - EPOLLERR handler */
|
||||
NULL, /* HangUp - EPOLLHUP handler */
|
||||
NULL, /* Accept */
|
||||
NULL, /* Connect */
|
||||
NULL /* Close */
|
||||
gw_read_backend_event, /**< Read - EPOLLIN handler */
|
||||
MySQLWrite, /**< Write - data from gateway */
|
||||
gw_write_backend_event, /**< WriteReady - EPOLLOUT handler */
|
||||
handle_event_errors_backend, /**< Error - EPOLLERR handler */
|
||||
NULL, /**< HangUp - EPOLLHUP handler */
|
||||
NULL, /**< Accept */
|
||||
NULL, /**< Connect */
|
||||
NULL /**< Close */
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* Implementation of the mandatory version entry point
|
||||
*
|
||||
* @return version string of the module
|
||||
@ -57,7 +65,7 @@ version()
|
||||
return version_str;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module initialisation routine, called when the module
|
||||
* is first loaded.
|
||||
*/
|
||||
@ -67,7 +75,7 @@ ModuleInit()
|
||||
fprintf(stderr, "Initial MySQL Client Protcol module.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
* "module object", this is a structure with the set of
|
||||
|
@ -19,13 +19,18 @@
|
||||
#include <dcb.h>
|
||||
#include <buffer.h>
|
||||
|
||||
/*
|
||||
/**
|
||||
* @file mysql_client.c - the protcol module for clients connecting to the gateway
|
||||
*
|
||||
* MySQL Protocol module for handling the protocol between the gateway
|
||||
* and the client.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
* Date Who Description
|
||||
* 14/06/2013 Mark Riddoch Initial version
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
static char *version_str = "V1.0.0";
|
||||
@ -35,18 +40,21 @@ extern int gw_handle_write_event(DCB *dcb, int epfd);
|
||||
extern int MySQLWrite(DCB *dcb, GWBUF *queue);
|
||||
extern int handle_event_errors(DCB *dcb, int event);
|
||||
|
||||
/**
|
||||
* The "module object" that defines the entry points to the protocol module
|
||||
*/
|
||||
static GWPROTOCOL MyObject = {
|
||||
gw_route_read_event, /* Read - EPOLLIN handler */
|
||||
MySQLWrite, /* Write - data from gateway */
|
||||
gw_handle_write_event, /* WriteReady - EPOLLOUT handler */
|
||||
handle_event_errors, /* Error - EPOLLERR handler */
|
||||
NULL, /* HangUp - EPOLLHUP handler */
|
||||
NULL, /* Accept */
|
||||
NULL, /* Connect */
|
||||
gw_route_read_event, /**< Read - EPOLLIN handler */
|
||||
MySQLWrite, /**< Write - data from gateway */
|
||||
gw_handle_write_event, /**< WriteReady - EPOLLOUT handler */
|
||||
handle_event_errors, /**< Error - EPOLLERR handler */
|
||||
NULL, /**< HangUp - EPOLLHUP handler */
|
||||
NULL, /**< Accept */
|
||||
NULL, /**< Connect */
|
||||
NULL /* Close */
|
||||
};
|
||||
|
||||
/*
|
||||
/**
|
||||
* Implementation of the mandatory version entry point
|
||||
*
|
||||
* @return version string of the module
|
||||
@ -57,7 +65,7 @@ version()
|
||||
return version_str;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module initialisation routine, called when the module
|
||||
* is first loaded.
|
||||
*/
|
||||
@ -67,7 +75,7 @@ ModuleInit()
|
||||
fprintf(stderr, "Initial MySQL Client Protcol module.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
* "module object", this is a structure with the set of
|
||||
|
177
modules/protocol/telnetd.c
Normal file
177
modules/protocol/telnetd.c
Normal file
@ -0,0 +1,177 @@
|
||||
/*
|
||||
* This file is distributed as part of the SkySQL Gateway. It is free
|
||||
* software: you can redistribute it and/or modify it under the terms of the
|
||||
* GNU General Public License as published by the Free Software Foundation,
|
||||
* version 2.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <dcb.h>
|
||||
#include <buffer.h>
|
||||
|
||||
/**
|
||||
* @file telnetd - telnet daemon protocol module
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
* Date Who Description
|
||||
* 17/06/2013 Mark Riddoch Initial version
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
static char *version_str = "V1.0.0";
|
||||
|
||||
static int telnetd_read_event(DCB* dcb, int epfd);
|
||||
static int telnetd_write_event(DCB *dcb, int epfd);
|
||||
static int telnetd_write(DCB *dcb, GWBUF *queue);
|
||||
static int telnetd_error(DCB *dcb, int event);
|
||||
static int telnetd_hangup(DCB *dcb, int event);
|
||||
static int telnetd_accept(DCB *dcb, int event);
|
||||
static int telnetd_close(DCB *dcb, int event);
|
||||
|
||||
/**
|
||||
* The "module object" for the telnetd protocol module.
|
||||
*/
|
||||
static GWPROTOCOL MyObject = {
|
||||
telnetd_read_event, /**< Read - EPOLLIN handler */
|
||||
telnetd_write, /**< Write - data from gateway */
|
||||
telnetd_write_event, /**< WriteReady - EPOLLOUT handler */
|
||||
telnetd_error, /**< Error - EPOLLERR handler */
|
||||
telnetd_hangup, /**< HangUp - EPOLLHUP handler */
|
||||
telnetd_accept, /**< Accept */
|
||||
NULL, /**< Connect */
|
||||
telnetd_close /**< Close */
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of the mandatory version entry point
|
||||
*
|
||||
* @return version string of the module
|
||||
*/
|
||||
char *
|
||||
version()
|
||||
{
|
||||
return version_str;
|
||||
}
|
||||
|
||||
/**
|
||||
* The module initialisation routine, called when the module
|
||||
* is first loaded.
|
||||
*/
|
||||
void
|
||||
ModuleInit()
|
||||
{
|
||||
fprintf(stderr, "Initialise Telnetd Protcol module.\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
* "module object", this is a structure with the set of
|
||||
* external entry points for this module.
|
||||
*
|
||||
* @return The module object
|
||||
*/
|
||||
GWPROTOCOL *
|
||||
GetModuleObject()
|
||||
{
|
||||
return &MyObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read event for EPOLLIN on the telnetd protocol module.
|
||||
*
|
||||
* @param dcb The descriptor control block
|
||||
* @param epfd The epoll descriptor
|
||||
* @return
|
||||
*/
|
||||
static int
|
||||
telnetd_read_event(DCB* dcb, int epfd)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* EPOLLOUT handler for the telnetd protocol module.
|
||||
*
|
||||
* @param dcb The descriptor control block
|
||||
* @param epfd The epoll descriptor
|
||||
* @return
|
||||
*/
|
||||
static int
|
||||
telnetd_write_event(DCB *dcb, int epfd)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Write routine for the telnetd protocol module.
|
||||
*
|
||||
* Writes the content of the buffer queue to the socket
|
||||
* observing the non-blocking principles of the gateway.
|
||||
*
|
||||
* @param dcb Descriptor Control Block for the socket
|
||||
* @param queue Linked list of buffes to write
|
||||
*/
|
||||
static int
|
||||
telnetd_write(DCB *dcb, GWBUF *queue)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for the EPOLLERR event.
|
||||
*
|
||||
* @param dcb The descriptor control block
|
||||
* @param epfd The epoll descriptor
|
||||
*/
|
||||
static int
|
||||
telnetd_error(DCB *dcb, int event)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for the EPOLLHUP event.
|
||||
*
|
||||
* @param dcb The descriptor control block
|
||||
* @param epfd The epoll descriptor
|
||||
*/
|
||||
static int
|
||||
telnetd_hangup(DCB *dcb, int event)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handler for the EPOLLIN event when the DCB refers to the listening
|
||||
* socket for the protocol.
|
||||
*
|
||||
* @param dcb The descriptor control block
|
||||
* @param epfd The epoll descriptor
|
||||
*/
|
||||
static int
|
||||
telnetd_accept(DCB *dcb, int event)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* The close handler for the descriptor. Called by the gateway to
|
||||
* explicitly close a connection.
|
||||
*
|
||||
* @param dcb The descriptor control block
|
||||
* @param epfd The epoll descriptor
|
||||
*/
|
||||
|
||||
static int
|
||||
telnetd_close(DCB *dcb, int event)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -45,3 +45,11 @@ clean:
|
||||
|
||||
tags:
|
||||
ctags $(SRCS) $(HDRS)
|
||||
|
||||
depend: depend.mk
|
||||
|
||||
depend.mk: $(SRCS)
|
||||
@rm -f depend.mk
|
||||
cc -M $(CFLAGS) $(SRCS) > depend.mk
|
||||
|
||||
include depend.mk
|
||||
|
32
modules/routing/depend.mk
Normal file
32
modules/routing/depend.mk
Normal file
@ -0,0 +1,32 @@
|
||||
testroute.o: testroute.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
|
||||
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
../../include/router.h ../../include/service.h ../../include/session.h \
|
||||
../../include/buffer.h
|
||||
readconnroute.o: readconnroute.c /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
/usr/include/gnu/stubs-64.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stddef.h \
|
||||
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
/usr/include/stdlib.h /usr/include/bits/waitflags.h \
|
||||
/usr/include/bits/waitstatus.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
|
||||
/usr/include/bits/select.h /usr/include/bits/sigset.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
|
||||
/usr/include/string.h /usr/include/xlocale.h ../../include/service.h \
|
||||
../../include/server.h ../../include/router.h ../../include/session.h \
|
||||
../../include/buffer.h ../../include/atomic.h ../../include/spinlock.h \
|
||||
../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/setjmp.h \
|
||||
../include/readconnection.h ../../include/dcb.h
|
@ -16,8 +16,8 @@
|
||||
* Copyright SkySQL Ab 2013
|
||||
*/
|
||||
|
||||
/*
|
||||
* readconnroute.c - Read Connection Load Balancing Query Router
|
||||
/**
|
||||
* @file readconnroute.c - Read Connection Load Balancing Query Router
|
||||
*
|
||||
* This is the implementation of a simple query router that balances
|
||||
* read connections. It assumes the service is configured with a set
|
||||
@ -28,11 +28,13 @@
|
||||
* number of connections by keeping a count for each server of how
|
||||
* many connections the query router has made to the server.
|
||||
*
|
||||
* @verbatim
|
||||
* Revision History
|
||||
*
|
||||
* Date Who Description
|
||||
* 14/06/13 Mark Riddoch Initial implementation
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -53,13 +55,13 @@ static void *newSession(ROUTER *instance, SESSION *session);
|
||||
static void closeSession(ROUTER *instance, void *router_session);
|
||||
static int routeQuery(ROUTER *instance, void *router_session, GWBUF *queue);
|
||||
|
||||
/* The module object definition */
|
||||
/** The module object definition */
|
||||
static ROUTER_OBJECT MyObject = { createInstance, newSession, closeSession, routeQuery };
|
||||
|
||||
static SPINLOCK instlock;
|
||||
static INSTANCE *instances;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Implementation of the mandatory version entry point
|
||||
*
|
||||
* @return version string of the module
|
||||
@ -70,7 +72,7 @@ version()
|
||||
return version_str;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module initialisation routine, called when the module
|
||||
* is first loaded.
|
||||
*/
|
||||
@ -82,7 +84,7 @@ ModuleInit()
|
||||
instances = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
* "module object", this is a structure with the set of
|
||||
@ -97,7 +99,7 @@ GetModuleObject()
|
||||
return &MyObject;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Create an instance of the router for a particular service
|
||||
* within the gateway.
|
||||
*
|
||||
@ -164,7 +166,7 @@ int i, n;
|
||||
return (ROUTER *)inst;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Associate a new session with this instance of the router.
|
||||
*
|
||||
* @param instance The router instance data
|
||||
@ -217,7 +219,7 @@ int i;
|
||||
return (void *)client;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Close a session with the router, this is the mechanism
|
||||
* by which a router may cleanup data structure etc.
|
||||
*
|
||||
@ -257,7 +259,7 @@ CLIENT_SESSION *session = (CLIENT_SESSION *)router_session;
|
||||
free(session);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* We have data from the client, we must route it to the backend.
|
||||
* This is simply a case of sending it to the connection that was
|
||||
* chosen when we started the client session.
|
||||
|
@ -27,7 +27,7 @@ static int routeQuery(ROUTER *instance, void *session, GWBUF *queue);
|
||||
|
||||
static ROUTER_OBJECT MyObject = { createInstance, newSession, closeSession, routeQuery };
|
||||
|
||||
/*
|
||||
/**
|
||||
* Implementation of the mandatory version entry point
|
||||
*
|
||||
* @return version string of the module
|
||||
@ -38,7 +38,7 @@ version()
|
||||
return version_str;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module initialisation routine, called when the module
|
||||
* is first loaded.
|
||||
*/
|
||||
@ -48,7 +48,7 @@ ModuleInit()
|
||||
fprintf(stderr, "Initial test router module.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
* "module object", this is a structure with the set of
|
||||
@ -63,7 +63,7 @@ GetModuleObject()
|
||||
return &MyObject;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Create an instance of the router for a particular service
|
||||
* within the gateway.
|
||||
*
|
||||
@ -76,7 +76,7 @@ createInstance(SERVICE *service)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Associate a new session with this instance of the router.
|
||||
*
|
||||
* @param instance The router instance data
|
||||
@ -88,7 +88,7 @@ newSession(ROUTER *instance, SESSION *session)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Close a session with the router, this is the mechanism
|
||||
* by which a router may cleanup data structure etc.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user