idms-dbma-devel Mailing List for IDMS Damn Best Mail Agent
Status: Pre-Alpha
Brought to you by:
nkukard
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(21) |
Nov
|
Dec
(2) |
2005 |
Jan
(2) |
Feb
(2) |
Mar
(16) |
Apr
(12) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: <sv...@li...> - 2005-09-22 12:31:37
|
Author: nkukard Date: 2005-09-22 12:27:57 +0000 (Thu, 22 Sep 2005) New Revision: 110 Modified: branches/nonblocking_io/include/mpm.h branches/nonblocking_io/lib/mailstore.c branches/nonblocking_io/modules/mpm/c10k/c10k.c branches/nonblocking_io/modules/mpm/mpm.c branches/nonblocking_io/modules/protocols/Makefile.am branches/nonblocking_io/modules/protocols/Makefile.in branches/nonblocking_io/modules/protocols/pop3/command_lexer.h branches/nonblocking_io/modules/protocols/pop3/command_parser.y branches/nonblocking_io/modules/protocols/pop3/pop3.c branches/nonblocking_io/modules/protocols/pop3/pop3.h branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_capa.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_dele.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_list.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_noop.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_pass.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_quit.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_retr.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_rset.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_stat.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_top.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_uidl.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_user.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmds.h Log: * Intermediate update Modified: branches/nonblocking_io/include/mpm.h =================================================================== --- branches/nonblocking_io/include/mpm.h 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/include/mpm.h 2005-09-22 12:27:57 UTC (rev 110) @@ -92,7 +92,7 @@ struct mpm_module_t { char *name; - void *funcs; + struct mpm_funcs_t *funcs; }; Modified: branches/nonblocking_io/lib/mailstore.c =================================================================== --- branches/nonblocking_io/lib/mailstore.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/lib/mailstore.c 2005-09-22 12:27:57 UTC (rev 110) @@ -22,9 +22,10 @@ * */ +#include "debug.h" +#include "mailstore.h" #include "misc.h" #include "modules.h" -#include "debug.h" #include "string.h" @@ -69,12 +70,14 @@ } /* Check if we were found a module that can handle the mailstore */ +// NIO +#if 0 if (storageCmds->canOpen(mailstore)) { result = storageCmds; break; } - +#endif item = g_list_next(item); } Modified: branches/nonblocking_io/modules/mpm/c10k/c10k.c =================================================================== --- branches/nonblocking_io/modules/mpm/c10k/c10k.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/mpm/c10k/c10k.c 2005-09-22 12:27:57 UTC (rev 110) @@ -24,12 +24,21 @@ #include <errno.h> +#include <glib.h> +#include <netdb.h> #include <stdlib.h> +#include <sys/types.h> +#include <sys/socket.h> #include "debug.h" #include "mpm.h" +/* List of servers we use */ +static GList *serverList = NULL; + + + /* Function to create a connection that will be passed down to the protocol handler */ static struct client_connection_t* createConnection(struct socket_data_t *socketData, int sockfd, char* remoteHost) { @@ -63,7 +72,7 @@ free(connection); } - +#if 0 /* Start off connection */ static int handleClient(struct client_connection_t *connection) { @@ -83,8 +92,8 @@ return 0; } +#endif - static int c10k_linkProtocol(struct protocol_module_t *module, char *bindTo, int maxConns) { struct socket_data_t *socketData; @@ -108,7 +117,7 @@ break; case 2: - D_PRINT(D_NOTICE,"Override listen port for %s to %i",module->name,module->listenPort); + D_PRINT(D_NOTICE,"Override listen port for %s to %i",module->name,socketData->listenPort); break; default: @@ -175,9 +184,9 @@ /* Create socket... */ // Create the socket - if ((sock=socket(PF_INET,SOCK_STREAM,0))< 0) + if ((sock = socket(PF_INET,SOCK_STREAM,0)) < 0) { - D_PRINT(D_FATAL,strerror(errno)); + D_PRINT(D_FATAL,"Failed to create socket: %s",strerror(errno)); return D_FATAL; } // Set socket options @@ -189,7 +198,7 @@ // Bind if (bind(sock,(struct sockaddr*)&myaddr,(socklen_t) sizeof(myaddr))<0) { - D_PRINT(D_FATAL,"Error binding: %s",sys_errlist[errno]); + D_PRINT(D_FATAL,"Error binding: %s",strerror(errno)); return D_FATAL; } @@ -279,7 +288,7 @@ return D_FATAL; } /* Pass connection onto worker threads */ - handleClient(clientConnection); +// handleClient(clientConnection); } /* Check next socket */ item = g_list_next(item); Modified: branches/nonblocking_io/modules/mpm/mpm.c =================================================================== --- branches/nonblocking_io/modules/mpm/mpm.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/mpm/mpm.c 2005-09-22 12:27:57 UTC (rev 110) @@ -132,7 +132,7 @@ } /* Link protocol into MPM */ - mpm->linkProtocol(module,bindTo,maxConns); + mpm->funcs->linkProtocol(module,bindTo,maxConns); return 0; Modified: branches/nonblocking_io/modules/protocols/Makefile.am =================================================================== --- branches/nonblocking_io/modules/protocols/Makefile.am 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/Makefile.am 2005-09-22 12:27:57 UTC (rev 110) @@ -1 +1 @@ -SUBDIRS=imap4 pop3 smtp +SUBDIRS=pop3 Modified: branches/nonblocking_io/modules/protocols/Makefile.in =================================================================== --- branches/nonblocking_io/modules/protocols/Makefile.in 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/Makefile.in 2005-09-22 12:27:57 UTC (rev 110) @@ -167,7 +167,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = imap4 pop3 smtp +SUBDIRS = pop3 all: all-recursive .SUFFIXES: Modified: branches/nonblocking_io/modules/protocols/pop3/command_lexer.h =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/command_lexer.h 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/command_lexer.h 2005-09-22 12:27:57 UTC (rev 110) @@ -67,7 +67,7 @@ /* Free command structure */ void freeCommandStruct(struct pop3_command_t *cmd); /* Parse the SMTP command */ -int parseCommand(struct clientConnection_t *connection, char *str, struct pop3_command_t *cmd); +int parseCommand(struct client_connection_t *connection, char *str, struct pop3_command_t *cmd); Modified: branches/nonblocking_io/modules/protocols/pop3/command_parser.y =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/command_parser.y 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/command_parser.y 2005-09-22 12:27:57 UTC (rev 110) @@ -205,7 +205,7 @@ } /* Parse the POP3 command */ -int parseCommand(struct clientConnection_t *connection, char *str, struct pop3_command_t *cmd) +int parseCommand(struct client_connection_t *connection, char *str, struct pop3_command_t *cmd) { struct command_scanner_t *scanner = malloc(sizeof(struct command_scanner_t)); int errID; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3.c 2005-09-22 12:27:57 UTC (rev 110) @@ -33,19 +33,19 @@ #include <stdio.h> #include <string.h> #include "debug.h" +#include "networkio.h" #include "misc.h" #include "mailstore.h" #include "protocols.h" -#include "socklib.h" #include "pop3.h" #include "pop3_cmds.h" #include "command_lexer.h" /* Some proto's we need */ -static int pop3_user_input(struct clientConnection_t *connection); -static int pop3_cmd(struct clientConnection_t *connection); -static int pop3_close(struct clientConnection_t *connection); +static int pop3_user_input(struct client_connection_t *connection); +static int pop3_cmd(struct client_connection_t *connection); +static int pop3_close(struct client_connection_t *connection); /* Static command type used below */ @@ -88,8 +88,9 @@ /* Startup function */ -static int pop3_startup(struct clientConnection_t *connection) +static int pop3_startup(void *connectionData) { + struct client_connection_t *connection = (struct client_connection_t *) connectionData; struct pop3_data_t *data = malloc(sizeof(struct pop3_data_t)); @@ -133,7 +134,7 @@ /* Function to process user input */ -static int pop3_user_input(struct clientConnection_t *connection) +static int pop3_user_input(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; @@ -148,7 +149,7 @@ /* Function to process user input */ -static int pop3_cmd(struct clientConnection_t *connection) +static int pop3_cmd(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; int err; @@ -228,7 +229,7 @@ /* Connection close function */ -static int pop3_close(struct clientConnection_t *connection) +static int pop3_close(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; @@ -246,8 +247,9 @@ /* Main pop3 protocol handler */ -static int pop3_handler(struct clientConnection_t *connection) +static int pop3_handler(void *connectionData) { + struct client_connection_t *connection = (struct client_connection_t *) connectionData; struct pop3_data_t *data = connection->data; struct pop3_static_cmd_t *cmd = (struct pop3_static_cmd_t *) pop3_commands; int ioState; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3.h =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3.h 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3.h 2005-09-22 12:27:57 UTC (rev 110) @@ -33,9 +33,11 @@ #define POP3_H #include "config.h" + #include <glib.h> + #include "pop3_cmds.h" -#include "socklib.h" +#include "networkio.h" #define POP3_VERSION "0.0.1" Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_capa.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_capa.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_capa.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,7 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "networkio.h" /* List of POP3 capabilities */ @@ -76,7 +76,7 @@ /* CAPA continuation */ -int pop3_cmd_capa_cont(struct clientConnection_t *connection) +int pop3_cmd_capa_cont(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; struct pop3_cmd_capa_t *cmdState; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_dele.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_dele.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_dele.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,8 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "mailstore.h" +#include "networkio.h" /* DELE - RFC1939 page 8 */ Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_list.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_list.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_list.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,8 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "mailstore.h" +#include "networkio.h" /* LIST state */ @@ -121,7 +122,7 @@ /* LIST continuation */ -int pop3_cmd_list_cont(struct clientConnection_t *connection) +int pop3_cmd_list_cont(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; struct pop3_cmd_list_t *cmdState; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_noop.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_noop.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_noop.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,7 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "networkio.h" /* NOOP - RFC1939 page 9 */ Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_pass.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_pass.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_pass.c 2005-09-22 12:27:57 UTC (rev 110) @@ -28,13 +28,15 @@ #include "debug.h" #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "networkio.h" /* Callback from AUTH stuff */ static void pop3_auth_callback(AUTH_CALLBACK_PARAMS) { +// NIO +#if 0 struct pop3_data_t *data = authInfo->client->data; @@ -97,6 +99,7 @@ storage_msg_stats(data->msgList,STORE_ATTR_COUNT,STORE_MSG_ALL)); #endif } +#endif } Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_quit.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_quit.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_quit.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,7 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "networkio.h" /* QUIT - RFC1939 section 4 */ Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_retr.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_retr.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_retr.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,8 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "mailstore.h" +#include "networkio.h" /* RETR state stuff */ @@ -88,7 +89,9 @@ } cmdState = malloc(sizeof(struct pop3_cmd_retr_t)); - /* Open message */ + /* Open message */ +// NIO +#if 0 if ((cmdState->msgHandle = connection->storageCmds->msgOpen(data->mailboxHandle,message))) { snprintf(data->tmpBuf,data->tmpBufSize,"+OK %u octets"EOL,message->size); @@ -107,6 +110,7 @@ free(cmdState); goto end; } +#endif } else snprintf(data->tmpBuf,data->tmpBufSize, @@ -122,7 +126,7 @@ } /* RETR continuation */ -int pop3_cmd_retr_cont(struct clientConnection_t *connection) +int pop3_cmd_retr_cont(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; struct pop3_cmd_retr_t *cmdState; @@ -138,7 +142,10 @@ D_PRINT(D_DEBUG,"Entering retr_cont"); +// NIO +#if 0 res = connection->storageCmds->msgRead(cmdState->msgHandle,data->tmpBuf,data->tmpBufSize); +#endif /* If the entire message was retrieved mark it seen */ if (res == 0) { @@ -151,8 +158,11 @@ { D_PRINT(D_DEBUG,"end of file"); +// NIO +#if 0 connection->storageCmds->msgClose(cmdState->msgHandle); - +#endif + free(cmdState); data->cmdHandle = NULL; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_rset.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_rset.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_rset.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,8 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "mailstore.h" +#include "networkio.h" /* RSET - RFC1939 page 9 */ Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_stat.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_stat.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_stat.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,8 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "mailstore.h" +#include "networkio.h" /* STAT - RFC1939 page 6 */ Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_top.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_top.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_top.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,8 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "mailstore.h" +#include "networkio.h" /* TOP state stuff */ @@ -99,6 +100,8 @@ cmdState = malloc(sizeof(struct pop3_cmd_top_t)); /* Open message */ +// NIO +#if 0 if ((cmdState->msgHandle = connection->storageCmds->msgOpen(data->mailboxHandle,message))) { snprintf(data->tmpBuf,data->tmpBufSize,"+OK Top of message follows"EOL); @@ -116,7 +119,7 @@ free(cmdState); goto end; } - +#endif } else snprintf(data->tmpBuf,data->tmpBufSize, @@ -133,7 +136,7 @@ /* TOP continuation */ -int pop3_cmd_top_cont(struct clientConnection_t *connection) +int pop3_cmd_top_cont(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; struct pop3_cmd_top_t *cmdState; @@ -148,8 +151,10 @@ } D_PRINT(D_DEBUG,"Entering top_cont"); - +// NIO +#if 0 res = connection->storageCmds->msgRead(cmdState->msgHandle,data->tmpBuf,data->tmpBufSize); +#endif /* If we got data, Number of lines left will decrease */ if (res > 0) cmdState->lines--; @@ -162,8 +167,10 @@ /* Handle other results */ if (res < 1 || cmdState->lines < 0) { +// NIO +#if 0 connection->storageCmds->msgClose(cmdState->msgHandle); - +#endif free(cmdState); data->cmdHandle = NULL; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_uidl.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_uidl.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_uidl.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,8 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "mailstore.h" +#include "networkio.h" /* UIDL state stuff */ @@ -113,7 +114,7 @@ /* UIDL continuation */ -int pop3_cmd_uidl_cont(struct clientConnection_t *connection) +int pop3_cmd_uidl_cont(struct client_connection_t *connection) { struct pop3_data_t *data = connection->data; struct pop3_cmd_uidl_t *cmdState; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_user.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_user.c 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_user.c 2005-09-22 12:27:57 UTC (rev 110) @@ -26,7 +26,7 @@ #include <string.h> #include "debug.h" #include "pop3_cmds.h" -#include "socklib.h" +#include "networkio.h" /* USER - RFC1939 page 5 */ Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmds.h =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3_cmds.h 2005-09-22 05:37:44 UTC (rev 109) +++ branches/nonblocking_io/modules/protocols/pop3/pop3_cmds.h 2005-09-22 12:27:57 UTC (rev 110) @@ -27,7 +27,7 @@ #define POP3_CMDS_H #include "pop3.h" -#include "socklib.h" +#include "networkio.h" @@ -70,8 +70,8 @@ #define POP3_ERROR_NONE 0 /* POP3 Command parameter definition */ -#define POP3_CMD_PARAMS struct clientConnection_t *connection, struct pop3_command_t *cmdStruct -#define POP3_CMD_CONT_PARAMS struct clientConnection_t *connection +#define POP3_CMD_PARAMS struct client_connection_t *connection, struct pop3_command_t *cmdStruct +#define POP3_CMD_CONT_PARAMS struct client_connection_t *connection #define POP3_CMD_INIT_PARAMS /* Macros to make it easy to declare commands */ #define POP3_CMD(xxx) \ |
From: <sv...@li...> - 2005-09-22 05:41:42
|
Author: nkukard Date: 2005-09-22 05:37:44 +0000 (Thu, 22 Sep 2005) New Revision: 109 Added: branches/nonblocking_io/include/diskio.h branches/nonblocking_io/include/networkio.h branches/nonblocking_io/modules/engines/networkIO/Makefile.am branches/nonblocking_io/modules/engines/networkIO/Makefile.in branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.am branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.in Removed: branches/nonblocking_io/include/socklib.h branches/nonblocking_io/modules/engines/diskIO/diskio.h branches/nonblocking_io/modules/engines/networkIO/networkio.h Modified: branches/nonblocking_io/Makefile.am branches/nonblocking_io/Makefile.in branches/nonblocking_io/configure branches/nonblocking_io/configure.ac branches/nonblocking_io/dbma/dbmra.c branches/nonblocking_io/include/modules.h branches/nonblocking_io/include/mpm.h branches/nonblocking_io/include/protocols.h branches/nonblocking_io/modules/auth/auth.h branches/nonblocking_io/modules/auth/pgsql/pgsql.c branches/nonblocking_io/modules/engines/Makefile.am branches/nonblocking_io/modules/engines/Makefile.in branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c branches/nonblocking_io/modules/engines/networkIO/c10k/c10k.c branches/nonblocking_io/modules/engines/networkIO/networkio.c branches/nonblocking_io/modules/mpm/c10k/c10k.c branches/nonblocking_io/modules/mpm/mpm.c Log: * Intermediate changes Modified: branches/nonblocking_io/Makefile.am =================================================================== --- branches/nonblocking_io/Makefile.am 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/Makefile.am 2005-09-22 05:37:44 UTC (rev 109) @@ -1,2 +1,2 @@ SUBDIRS=modules lib dbma doc -EXTRA_DIST= include/auth.h include/debug.h include/mailstore.h include/misc.h include/modules.h include/socklib.h +#EXTRA_DIST= include/auth.h include/debug.h include/mailstore.h include/misc.h include/modules.h include/socklib.h Modified: branches/nonblocking_io/Makefile.in =================================================================== --- branches/nonblocking_io/Makefile.in 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/Makefile.in 2005-09-22 05:37:44 UTC (rev 109) @@ -184,7 +184,6 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = modules lib dbma doc -EXTRA_DIST = include/auth.h include/debug.h include/mailstore.h include/misc.h include/modules.h include/socklib.h all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -385,7 +384,6 @@ distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkdir_p) $(distdir)/include @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ @@ -620,6 +618,7 @@ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am +#EXTRA_DIST= include/auth.h include/debug.h include/mailstore.h include/misc.h include/modules.h include/socklib.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Modified: branches/nonblocking_io/configure =================================================================== --- branches/nonblocking_io/configure 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/configure 2005-09-22 05:37:44 UTC (rev 109) @@ -22890,7 +22890,7 @@ exit 1 fi - ac_config_files="$ac_config_files Makefile lib/Makefile dbma/Makefile doc/Makefile modules/Makefile modules/auth/Makefile modules/auth/pgsql/Makefile modules/protocols/Makefile modules/protocols/imap4/Makefile modules/protocols/pop3/Makefile modules/protocols/smtp/Makefile modules/storage/Makefile modules/storage/dbma/Makefile modules/engines/Makefile modules/engines/diskIO/Makefile modules/engines/diskIO/c10klocaldisk/Makefile modules/mpm/Makefile modules/mpm/c10k/Makefile" + ac_config_files="$ac_config_files Makefile lib/Makefile dbma/Makefile doc/Makefile modules/Makefile modules/auth/Makefile modules/auth/pgsql/Makefile modules/protocols/Makefile modules/protocols/imap4/Makefile modules/protocols/pop3/Makefile modules/protocols/smtp/Makefile modules/storage/Makefile modules/storage/dbma/Makefile modules/engines/Makefile modules/engines/diskIO/Makefile modules/engines/diskIO/c10klocaldisk/Makefile modules/engines/networkIO/Makefile modules/engines/networkIO/c10k/Makefile modules/mpm/Makefile modules/mpm/c10k/Makefile" cat >confcache <<\_ACEOF @@ -23465,6 +23465,8 @@ "modules/engines/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/Makefile" ;; "modules/engines/diskIO/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/diskIO/Makefile" ;; "modules/engines/diskIO/c10klocaldisk/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/diskIO/c10klocaldisk/Makefile" ;; + "modules/engines/networkIO/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/networkIO/Makefile" ;; + "modules/engines/networkIO/c10k/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/networkIO/c10k/Makefile" ;; "modules/mpm/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/mpm/Makefile" ;; "modules/mpm/c10k/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/mpm/c10k/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; Modified: branches/nonblocking_io/configure.ac =================================================================== --- branches/nonblocking_io/configure.ac 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/configure.ac 2005-09-22 05:37:44 UTC (rev 109) @@ -98,6 +98,8 @@ modules/engines/Makefile modules/engines/diskIO/Makefile modules/engines/diskIO/c10klocaldisk/Makefile + modules/engines/networkIO/Makefile + modules/engines/networkIO/c10k/Makefile modules/mpm/Makefile modules/mpm/c10k/Makefile ]) Modified: branches/nonblocking_io/dbma/dbmra.c =================================================================== --- branches/nonblocking_io/dbma/dbmra.c 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/dbma/dbmra.c 2005-09-22 05:37:44 UTC (rev 109) @@ -42,7 +42,6 @@ #include "misc.h" #include "debug.h" #include "mpm.h" -#include "socklib.h" // Application Configuration... Added: branches/nonblocking_io/include/diskio.h =================================================================== --- branches/nonblocking_io/include/diskio.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/include/diskio.h 2005-09-22 05:37:44 UTC (rev 109) @@ -0,0 +1,86 @@ +/* + * diskio.h - Disk IO Abstraction Layer Header File + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * 05/05/2005 - Nigel Kukard <nk...@lb...> + * * Initial design + * +*/ + + +#ifndef _DISKIO_H +#define _DISKIO_H + +#include <sys/types.h> + + +/* + * Res is passed back from the disk io engine, this is D_* style responses + * The system error code can be retrieved using dio_getErrno() + */ +#define DISKIO_CALLBACK_FUNC void (* callback) (struct dioFile_t *file, int res) + + +/* File handle used by the disk IO stuff */ +struct dioFile_t +{ + /* User stuff */ + void *context; // Extra data passed to callback function + /* Internal stuff */ + DISKIO_CALLBACK_FUNC; + int err; // This will be set to errno if the system encountered an error + /* Module data */ + void *cmdStruct; + void *moduleData; +}; + + +/* Disk IO commands modules must implement */ +struct dioCmds_t +{ + int (* dio_open) (struct dioFile_t *file, char *filename, int flags); + int (* dio_read) (struct dioFile_t *file, void *buf, size_t count); + int (* dio_write) (struct dioFile_t *file, const void *buf, size_t count); + int (* dio_close) (struct dioFile_t *file); +}; + + + +/* Abstraction layer open function */ +int dio_open(void *context, char *filename, int flags, DISKIO_CALLBACK_FUNC); + +/* Abstraction layer read function */ +int dio_read(struct dioFile_t *file, void *buf, size_t count, DISKIO_CALLBACK_FUNC); + +/* Abstraction layer write function */ +int dio_write(struct dioFile_t *file, const void *buf, size_t count, DISKIO_CALLBACK_FUNC); + +/* Abstraction layer close function */ +int dio_close(struct dioFile_t *file, DISKIO_CALLBACK_FUNC); + +/* Set system response code */ +inline void dio_setErrno(struct dioFile_t *file, int err); + + /* Get system response code, if one */ +inline int dio_getErrno(struct dioFile_t *file); + +/* Get private data */ +inline void *dio_getContext(struct dioFile_t *file); + + +#endif + Modified: branches/nonblocking_io/include/modules.h =================================================================== --- branches/nonblocking_io/include/modules.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/include/modules.h 2005-09-22 05:37:44 UTC (rev 109) @@ -30,7 +30,7 @@ #define _MODULES_H #include <arpa/inet.h> -#include "socklib.h" +#include "networkio.h" /* Module types */ @@ -52,20 +52,7 @@ void *moduleData; }; -/* Data structure for queuing connection to handlers, this is used as a constant in the actual server's connection structure */ -struct sockData_t -{ - // Socket server info - char* ipAddress; - unsigned short int listenPort; - int maxConnections; - // Socket communication info - int boundFD; - // Handler info - struct protocol_cmds_t *protoCmds; -}; - /* Return list of auth modules loaded */ GList *get_auth_modules(); Modified: branches/nonblocking_io/include/mpm.h =================================================================== --- branches/nonblocking_io/include/mpm.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/include/mpm.h 2005-09-22 05:37:44 UTC (rev 109) @@ -28,19 +28,71 @@ #include "protocols.h" +/* Server side per protocol data */ +struct socket_data_t +{ + // Server socket information + char* listenAddr; + unsigned short int listenPort; + int maxConnections; + // Bound socket file descriptor + int boundFD; + // Protocol module info + struct protocol_module_t *handler; +}; + + + +// FIXME: MOVE THIS TO A NETWORK IO MODULE +/* State of an io operation */ +struct iostate_t +{ + int ioType:3; /* Type of IO we doing */ + int direction:2; /* either input or output */ + char *buffer; /* buffer pointer in the case of sending, actual buffer in the case of receiving */ + size_t bufsize; /* size of buffer, size to send or max size to get */ + size_t bufpos; /* current position in buffer, internal usage */ + size_t buflen; /* actual amount of io done */ + int timeout; + long int curTimeout; + int err; + int state; +}; + + +/* A client connection structure */ +struct client_connection_t +{ + int fd; + char *hostname; /* client's hostname, at this time, his IP */ + + const struct socket_data_t *socketData; /* server socket data and protocol handling data */ + + char *recvBuffer; /* FIXME: current command buffer */ + + void *data; /* used by protocol */ + + // FIXME: Internal info - MOVE THIS TO A NETWORK MODULE OR SOMETHING + struct iostate_t ioState; +}; + + + + /* MPM command struct */ -struct mpm_cmds_t +struct mpm_funcs_t { + int (*linkProtocol) (struct protocol_module_t *module, char *bindTo, int maxConns); int (*start) (); - int (*linkProtocol) (struct protocol_module_t *module); }; + /* MPM module type */ struct mpm_module_t { char *name; - void *cmdStruct; + void *funcs; }; Added: branches/nonblocking_io/include/networkio.h =================================================================== --- branches/nonblocking_io/include/networkio.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/include/networkio.h 2005-09-22 05:37:44 UTC (rev 109) @@ -0,0 +1,84 @@ +/* + * networkIO.h - Network IO abstraction layer + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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 St, Fifth Floor, Boston, MA 02110-1301 USA + * + * + * 19/09/2005 - Nigel Kukard <nk...@lb...> + * * Initial design + * +*/ + +#ifndef _NETWORKIO_H +#define _NETWORKIO_H + +#include <glib.h> +#include "mpm.h" + + +/* Socket options */ +#define SOCK_IO_BUF_LEN 4096 +#define EOL "\r\n" + +/* Connection status */ +#define SOCK_STATE_FATAL_ERR -5 +#define SOCK_STATE_TIMEOUT -4 +#define SOCK_STATE_INTERNAL_ERR -3 /* This will prevent loops with broken code */ +#define SOCK_STATE_BUFFER_OVERFLOW -2 +#define SOCK_STATE_ERROR -1 +#define SOCK_STATE_NONE 0 +#define SOCK_STATE_PENDING 1 +#define SOCK_STATE_DONE 2 +#define SOCK_STATE_IDLE 3 + +/* IO types */ +#define SOCK_IO_TYPE_NONE 0 +#define SOCK_IO_TYPE_LINE 1 +#define SOCK_IO_TYPE_RAW 2 + +/* IO direction */ +#define SOCK_DIR_IN 0 +#define SOCK_DIR_OUT 1 + + + +/* Queue data to be sent to client */ +int queueToSend(struct client_connection_t *connection,char *buffer,size_t bufsize,int timeout); + +/* Queue data to be received */ +int queueToReceive(struct client_connection_t *connection,char *buffer,size_t bufsize,int timeout); + +/* Queue raw data to be received */ +int queueToReceiveRaw(struct client_connection_t *connection,char *buffer,size_t bufsize,int timeout); + +/* Return 1 if socket is not in STATE_ERROR */ +int isSockOK(struct client_connection_t *connection); + +/* Close client connection */ +void closeConnection(struct client_connection_t *connection); + +/* Return the io result */ +inline int getIOResult(struct client_connection_t *connection); + +/* Return the iostate bufpos, for whatever reason we need it */ +inline size_t getIOBufPos(struct client_connection_t *connection); + +/* Return the iostate buflen, for whatever reason we need it */ +inline size_t getIOBufLen(struct client_connection_t *connection); + + +#endif + Modified: branches/nonblocking_io/include/protocols.h =================================================================== --- branches/nonblocking_io/include/protocols.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/include/protocols.h 2005-09-22 05:37:44 UTC (rev 109) @@ -25,14 +25,12 @@ #ifndef _PROTOCOLS_H #define _PROTOCOLS_H -#include "socklib.h" - /* Protocol handling functions */ struct protocol_funcs_t { - int (*startup) (struct clientConnection_t *connection); - int (*handler) (struct clientConnection_t *connection); + int (*startup) (void *connectionData); /* struct client_connection_t */ + int (*handler) (void *connectionData); }; @@ -46,8 +44,6 @@ - - #endif // vim:ts=4 Deleted: branches/nonblocking_io/include/socklib.h =================================================================== --- branches/nonblocking_io/include/socklib.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/include/socklib.h 2005-09-22 05:37:44 UTC (rev 109) @@ -1,114 +0,0 @@ -/* - * socklib.h - Socket handling functions header file - * Copyright (C) 2002-2004, Linux Based Systems Design - * - * This program 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - * 23/05/2004 - Nigel Kukard <nk...@lb...> - * * Reworked network connection handling - * - * 22/01/2002 - Nigel Kukard <nk...@lb...> - * * Initial design - * -*/ - -#ifndef _SOCKLIB_H -#define _SOCKLIB_H - -#include <glib.h> -#include <grp.h> -#include <pwd.h> -#include "mailstore.h" - - -/* Socket options */ -//#define MAX_CONNECTIONS 512 -//#define IP_LEN 16 -#define SOCK_IO_BUF_LEN 4096 -#define EOL "\r\n" - -/* Connection status */ -#define SOCK_STATE_FATAL_ERR -5 -#define SOCK_STATE_TIMEOUT -4 -#define SOCK_STATE_INTERNAL_ERR -3 /* This will prevent loops with broken code */ -#define SOCK_STATE_BUFFER_OVERFLOW -2 -#define SOCK_STATE_ERROR -1 -#define SOCK_STATE_NONE 0 -#define SOCK_STATE_PENDING 1 -#define SOCK_STATE_DONE 2 -#define SOCK_STATE_IDLE 3 - -/* IO types */ -#define SOCK_IO_TYPE_NONE 0 -#define SOCK_IO_TYPE_LINE 1 -#define SOCK_IO_TYPE_RAW 2 - -/* IO direction */ -#define SOCK_DIR_IN 0 -#define SOCK_DIR_OUT 1 - -/* State of an io operation */ -struct iostate_t -{ - int ioType:3; /* Type of IO we doing */ - int direction:2; /* either input or output */ - char *buffer; /* buffer pointer in the case of sending, actual buffer in the case of receiving */ - size_t bufsize; /* size of buffer, size to send or max size to get */ - size_t bufpos; /* current position in buffer, internal usage */ - size_t buflen; /* actual amount of io done */ - int timeout; - long int curTimeout; - int err; - int state; -}; - - -/* A client connection structure */ -struct clientConnection_t -{ - int fd; - char *hostname; - char *recvBuffer; /* current command buffer */ - void *data; /* used by protocol */ - const struct sockData_t *sockData; - // Internal info - struct iostate_t ioState; - struct auth_info_t *authInfo; - struct storageCmds_t *storageCmds; /* This is not socket related, but connection related */ -}; - - -/* Tell main loop we want to send data */ -int queueToSend(struct clientConnection_t *connection,char *buffer,size_t bufsize,int timeout); -/* Tell main loop we want a line */ -int queueToReceive(struct clientConnection_t *connection,char *buffer,size_t bufsize,int timeout); -/* Tell main loop we want some raw data */ -int queueToReceiveRaw(struct clientConnection_t *connection,char *buffer,size_t bufsize,int timeout); -/* Return 1 if socket is not in STATE_ERROR */ -int isSockOK(struct clientConnection_t *connection); -/* Close client connection */ -void closeConnection(struct clientConnection_t *connection); -/* Return the io result */ -inline int getIOResult(struct clientConnection_t *connection); -/* Return the iostate bufpos, for whatever reason we need it */ -inline size_t getIOBufPos(struct clientConnection_t *connection); -/* Return the iostate buflen, for whatever reason we need it */ -inline size_t getIOBufLen(struct clientConnection_t *connection); -/* Main server accept() loop */ -int serverInit(GList *serverList); - - -#endif Modified: branches/nonblocking_io/modules/auth/auth.h =================================================================== --- branches/nonblocking_io/modules/auth/auth.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/auth/auth.h 2005-09-22 05:37:44 UTC (rev 109) @@ -29,7 +29,7 @@ #define AUTH_H #include <stdlib.h> -#include "socklib.h" +#include "networkio.h" /* Authentication result codes */ Modified: branches/nonblocking_io/modules/auth/pgsql/pgsql.c =================================================================== --- branches/nonblocking_io/modules/auth/pgsql/pgsql.c 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/auth/pgsql/pgsql.c 2005-09-22 05:37:44 UTC (rev 109) @@ -33,7 +33,7 @@ #include "debug.h" #include "../auth.h" #include "modules.h" -#include "socklib.h" +#include "networkio.h" /* Our own status codes */ Modified: branches/nonblocking_io/modules/engines/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/Makefile.am 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/Makefile.am 2005-09-22 05:37:44 UTC (rev 109) @@ -1,6 +1,6 @@ -SUBDIRS=diskIO +SUBDIRS=diskIO networkIO noinst_LTLIBRARIES=libengines.la libengines_la_SOURCES= -libengines_la_LIBADD=diskIO/libdiskio.la +libengines_la_LIBADD=diskIO/libdiskio.la networkIO/libnetworkio.la Modified: branches/nonblocking_io/modules/engines/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/Makefile.in 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/Makefile.in 2005-09-22 05:37:44 UTC (rev 109) @@ -49,7 +49,8 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libengines_la_DEPENDENCIES = diskIO/libdiskio.la +libengines_la_DEPENDENCIES = diskIO/libdiskio.la \ + networkIO/libnetworkio.la am_libengines_la_OBJECTS = libengines_la_OBJECTS = $(am_libengines_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) @@ -183,10 +184,10 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = diskIO +SUBDIRS = diskIO networkIO noinst_LTLIBRARIES = libengines.la libengines_la_SOURCES = -libengines_la_LIBADD = diskIO/libdiskio.la +libengines_la_LIBADD = diskIO/libdiskio.la networkIO/libnetworkio.la all: all-recursive .SUFFIXES: Modified: branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c 2005-09-22 05:37:44 UTC (rev 109) @@ -27,7 +27,7 @@ #include <stdlib.h> #include "debug.h" #include "modules.h" -#include "../diskio.h" +#include "diskio.h" /* Deleted: branches/nonblocking_io/modules/engines/diskIO/diskio.h =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/diskio.h 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/diskIO/diskio.h 2005-09-22 05:37:44 UTC (rev 109) @@ -1,86 +0,0 @@ -/* - * diskio.h - Disk IO Abstraction Layer Header File - * Copyright (C) 2002-2005, Linux Based Systems Design - * - * This program 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * 05/05/2005 - Nigel Kukard <nk...@lb...> - * * Initial design - * -*/ - - -#ifndef _DISKIO_H -#define _DISKIO_H - -#include <sys/types.h> - - -/* - * Res is passed back from the disk io engine, this is D_* style responses - * The system error code can be retrieved using dio_getErrno() - */ -#define DISKIO_CALLBACK_FUNC void (* callback) (struct dioFile_t *file, int res) - - -/* File handle used by the disk IO stuff */ -struct dioFile_t -{ - /* User stuff */ - void *context; // Extra data passed to callback function - /* Internal stuff */ - DISKIO_CALLBACK_FUNC; - int err; // This will be set to errno if the system encountered an error - /* Module data */ - void *cmdStruct; - void *moduleData; -}; - - -/* Disk IO commands modules must implement */ -struct dioCmds_t -{ - int (* dio_open) (struct dioFile_t *file, char *filename, int flags); - int (* dio_read) (struct dioFile_t *file, void *buf, size_t count); - int (* dio_write) (struct dioFile_t *file, const void *buf, size_t count); - int (* dio_close) (struct dioFile_t *file); -}; - - - -/* Abstraction layer open function */ -int dio_open(void *context, char *filename, int flags, DISKIO_CALLBACK_FUNC); - -/* Abstraction layer read function */ -int dio_read(struct dioFile_t *file, void *buf, size_t count, DISKIO_CALLBACK_FUNC); - -/* Abstraction layer write function */ -int dio_write(struct dioFile_t *file, const void *buf, size_t count, DISKIO_CALLBACK_FUNC); - -/* Abstraction layer close function */ -int dio_close(struct dioFile_t *file, DISKIO_CALLBACK_FUNC); - -/* Set system response code */ -inline void dio_setErrno(struct dioFile_t *file, int err); - - /* Get system response code, if one */ -inline int dio_getErrno(struct dioFile_t *file); - -/* Get private data */ -inline void *dio_getContext(struct dioFile_t *file); - - -#endif - Added: branches/nonblocking_io/modules/engines/networkIO/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/networkIO/Makefile.am 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/networkIO/Makefile.am 2005-09-22 05:37:44 UTC (rev 109) @@ -0,0 +1,10 @@ +GLIB_LIBS=@GLIB_LIBS@ +GLIB_CFLAGS=@GLIB_CFLAGS@ + +SUBDIRS=c10k + +noinst_LTLIBRARIES = libnetworkio.la +libnetworkio_la_SOURCES = networkio.c +libnetworkio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) + + Added: branches/nonblocking_io/modules/engines/networkIO/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/networkIO/Makefile.in 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/networkIO/Makefile.in 2005-09-22 05:37:44 UTC (rev 109) @@ -0,0 +1,555 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SOURCES = $(libnetworkio_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = modules/engines/networkIO +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libnetworkio_la_LIBADD = +am_libnetworkio_la_OBJECTS = libnetworkio_la-networkio.lo +libnetworkio_la_OBJECTS = $(am_libnetworkio_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libnetworkio_la_SOURCES) +DIST_SOURCES = $(libnetworkio_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = c10k +noinst_LTLIBRARIES = libnetworkio.la +libnetworkio_la_SOURCES = networkio.c +libnetworkio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/engines/networkIO/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/engines/networkIO/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnetworkio.la: $(libnetworkio_la_OBJECTS) $(libnetworkio_la_DEPENDENCIES) + $(LINK) $(libnetworkio_la_LDFLAGS) $(libnetworkio_la_OBJECTS) $(libnetworkio_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetworkio_la-networkio.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libnetworkio_la-networkio.lo: networkio.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnetworkio_la_CFLAGS) $(CFLAGS) -MT libnetworkio_la-networkio.lo -MD -MP -MF "$(DEPDIR)/libnetworkio_la-networkio.Tpo" -c -o libnetworkio_la-networkio.lo `test -f 'networkio.c' || echo '$(srcdir)/'`networkio.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libnetworkio_la-networkio.Tpo" "$(DEPDIR)/libnetworkio_la-networkio.Plo"; else rm -f "$(DEPDIR)/libnetworkio_la-networkio.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='networkio.c' object='libnetworkio_la-networkio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libnetworkio_la_CFLAGS) $(CFLAGS) -c -o libnetworkio_la-networkio.lo `test -f 'networkio.c' || echo '$(srcdir)/'`networkio.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.am 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.am 2005-09-22 05:37:44 UTC (rev 109) @@ -0,0 +1,8 @@ +GLIB_LIBS=@GLIB_LIBS@ +GLIB_CFLAGS=@GLIB_CFLAGS@ + +module_LTLIBRARIES = networkio_c10k.la +networkio_c10k_la_SOURCES = c10k.c +networkio_c10k_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +networkio_c10k_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version + Added: branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.in 2005-09-20 11:35:08 UTC (rev 108) +++ branches/nonblocking_io/modules/engines/networkIO/c10k/Makefile.in 2005-09-22 05:37:44 UTC (rev 109) @@ -0,0 +1,474 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SOURCES = $(networkio_c10k_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = modules/engines/networkIO/c10k +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(moduledir)" +moduleLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(module_LTLIBRARIES) +networkio_c10k_la_LIBADD = +am_networkio_c10k_la_OBJECTS = networkio_c10k_la-c10k.lo +networkio_c10k_la_OBJECTS = $(am_networkio_c10k_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(networkio_c10k_la_SOURCES) +DIST_SOURCES = $(networkio_c10k_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +module_LTLIBRARIES = networkio_c10k.la +networkio_c10k_la_SOURCES = c10k.c +networkio_c10k_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +networkio_c10k_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/engines/networkIO/c10k/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/engines/networkIO/c10k/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-moduleLTLIBRARIES: $(module_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(moduledir)" || $(mkdir_p) "$(DESTDIR)$(moduledir)" + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moduledir)/$$f'"; \ + $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moduledir)/$$f"; \ + else :; fi; \ + done + +uninstall-moduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(module_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$p"; \ + done + +clean-moduleLTLIBRARIES: + -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +networkio_c10k.la: $(networkio_c10k_la_OBJECTS) $(networkio_c10k_la_DEPENDENCIES) + $(LINK) -rpath $(moduledir) $(networkio_c10k_la_LDFLAGS) $(networkio_c10k_la_OBJECTS) $(networkio_c10k_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networkio_c10k_la-c10k.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +networkio_c10k_la-c10k.lo: c10k.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(networkio_c10k_la_CFLAGS) $(CFLAGS) -MT networkio_c10k_la-c10k.lo -MD -MP -MF "$(DEPDIR)/networkio_c10k_la-c10k.Tpo" -c -o networkio_c10k_la-c10k.lo `test -f 'c10k.c' || echo '$(srcdir)/'`c10k.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/networkio_c10k_la-c10k.Tpo" "$(DEPDIR)/networkio_c10k_la-c10k.Plo"; else rm -f "$(DEPDIR)/networkio_c10k_la-c10k.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='c10k.c' object='networkio_c10k_la-c10k.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(networkio_c10k_la_CFLAGS) $(CFLAGS) -c -o networkio_c10k_la-c10k.lo `test -f 'c10k.c' || echo '$(srcdir)/'`c10k.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(m... [truncated message content] |
From: <sv...@li...> - 2005-09-20 08:23:11
|
Author: nkukard Date: 2005-09-20 08:22:16 +0000 (Tue, 20 Sep 2005) New Revision: 107 Added: branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/ branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.am branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.in branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/TODO branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c Removed: branches/nonblocking_io/modules/engines/diskIO/localdisk/ Modified: branches/nonblocking_io/modules/engines/diskIO/Makefile.am branches/nonblocking_io/modules/engines/diskIO/Makefile.in Log: * Updated disk io modules Modified: branches/nonblocking_io/modules/engines/diskIO/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/Makefile.am 2005-05-09 19:55:13 UTC (rev 106) +++ branches/nonblocking_io/modules/engines/diskIO/Makefile.am 2005-09-20 08:22:16 UTC (rev 107) @@ -1,7 +1,7 @@ GLIB_LIBS=@GLIB_LIBS@ GLIB_CFLAGS=@GLIB_CFLAGS@ -SUBDIRS=localdisk +SUBDIRS=c10klocaldisk noinst_LTLIBRARIES = libdiskio.la libdiskio_la_SOURCES = diskio.c Modified: branches/nonblocking_io/modules/engines/diskIO/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/Makefile.in 2005-05-09 19:55:13 UTC (rev 106) +++ branches/nonblocking_io/modules/engines/diskIO/Makefile.in 2005-09-20 08:22:16 UTC (rev 107) @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.1 from Makefile.am. +# Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004 Free Software Foundation, Inc. +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -57,11 +57,11 @@ am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libdiskio_la_SOURCES) DIST_SOURCES = $(libdiskio_la_SOURCES) @@ -185,7 +185,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = localdisk +SUBDIRS = c10klocaldisk noinst_LTLIBRARIES = libdiskio.la libdiskio_la_SOURCES = diskio.c libdiskio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) @@ -264,11 +264,11 @@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libdiskio_la-diskio.lo: diskio.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdiskio_la_CFLAGS) $(CFLAGS) -MT libdiskio_la-diskio.lo -MD -MP -MF "$(DEPDIR)/libdiskio_la-diskio.Tpo" -c -o libdiskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c; \ +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdiskio_la_CFLAGS) $(CFLAGS) -MT libdiskio_la-diskio.lo -MD -MP -MF "$(DEPDIR)/libdiskio_la-diskio.Tpo" -c -o libdiskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libdiskio_la-diskio.Tpo" "$(DEPDIR)/libdiskio_la-diskio.Plo"; else rm -f "$(DEPDIR)/libdiskio_la-diskio.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='diskio.c' object='libdiskio_la-diskio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdiskio_la_CFLAGS) $(CFLAGS) -c -o libdiskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdiskio_la_CFLAGS) $(CFLAGS) -c -o libdiskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c mostlyclean-libtool: -rm -f *.lo @@ -287,7 +287,13 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -299,7 +305,7 @@ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -307,7 +313,13 @@ mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -328,7 +340,7 @@ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ Added: branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.am 2005-05-09 19:55:13 UTC (rev 106) +++ branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.am 2005-09-20 08:22:16 UTC (rev 107) @@ -0,0 +1,8 @@ +GLIB_LIBS=@GLIB_LIBS@ +GLIB_CFLAGS=@GLIB_CFLAGS@ + +module_LTLIBRARIES = diskio_c10klocaldisk.la +diskio_c10klocaldisk_la_SOURCES = localdisk.c +diskio_c10klocaldisk_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +diskio_c10klocaldisk_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version + Added: branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.in 2005-05-09 19:55:13 UTC (rev 106) +++ branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/Makefile.in 2005-09-20 08:22:16 UTC (rev 107) @@ -0,0 +1,476 @@ +# Makefile.in generated by automake 1.9.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SOURCES = $(diskio_c10klocaldisk_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = modules/engines/diskIO/c10klocaldisk +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(moduledir)" +moduleLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(module_LTLIBRARIES) +diskio_c10klocaldisk_la_LIBADD = +am_diskio_c10klocaldisk_la_OBJECTS = \ + diskio_c10klocaldisk_la-localdisk.lo +diskio_c10klocaldisk_la_OBJECTS = \ + $(am_diskio_c10klocaldisk_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(diskio_c10klocaldisk_la_SOURCES) +DIST_SOURCES = $(diskio_c10klocaldisk_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +module_LTLIBRARIES = diskio_c10klocaldisk.la +diskio_c10klocaldisk_la_SOURCES = localdisk.c +diskio_c10klocaldisk_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +diskio_c10klocaldisk_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/engines/diskIO/c10klocaldisk/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/engines/diskIO/c10klocaldisk/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-moduleLTLIBRARIES: $(module_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(moduledir)" || $(mkdir_p) "$(DESTDIR)$(moduledir)" + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moduledir)/$$f'"; \ + $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moduledir)/$$f"; \ + else :; fi; \ + done + +uninstall-moduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(module_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$p"; \ + done + +clean-moduleLTLIBRARIES: + -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +diskio_c10klocaldisk.la: $(diskio_c10klocaldisk_la_OBJECTS) $(diskio_c10klocaldisk_la_DEPENDENCIES) + $(LINK) -rpath $(moduledir) $(diskio_c10klocaldisk_la_LDFLAGS) $(diskio_c10klocaldisk_la_OBJECTS) $(diskio_c10klocaldisk_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskio_c10klocaldisk_la-localdisk.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +diskio_c10klocaldisk_la-localdisk.lo: localdisk.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskio_c10klocaldisk_la_CFLAGS) $(CFLAGS) -MT diskio_c10klocaldisk_la-localdisk.lo -MD -MP -MF "$(DEPDIR)/diskio_c10klocaldisk_la-localdisk.Tpo" -c -o diskio_c10klocaldisk_la-localdisk.lo `test -f 'localdisk.c' || echo '$(srcdir)/'`localdisk.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskio_c10klocaldisk_la-localdisk.Tpo" "$(DEPDIR)/diskio_c10klocaldisk_la-localdisk.Plo"; else rm -f "$(DEPDIR)/diskio_c10klocaldisk_la-localdisk.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='localdisk.c' object='diskio_c10klocaldisk_la-localdisk.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskio_c10klocaldisk_la_CFLAGS) $(CFLAGS) -c -o diskio_c10klocaldisk_la-localdisk.lo `test -f 'localdisk.c' || echo '$(srcdir)/'`localdisk.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(moduledir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-moduleLTLIBRARIES + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am uninstall-moduleLTLIBRARIES + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-moduleLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-moduleLTLIBRARIES install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-info-am \ + uninstall-moduleLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/TODO =================================================================== Added: branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c 2005-05-09 19:55:13 UTC (rev 106) +++ branches/nonblocking_io/modules/engines/diskIO/c10klocaldisk/localdisk.c 2005-09-20 08:22:16 UTC (rev 107) @@ -0,0 +1,190 @@ +/* + * c10k-localdisk.c - Local disk stuff, specific to c10k + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * 26/04/2005 - Nigel Kukard <nk...@lb...> + * * Initial design +*/ + + +#include <glib.h> +#include <errno.h> +#include <stdlib.h> +#include "debug.h" +#include "modules.h" +#include "../diskio.h" + + +/* + * Static stuff we need + */ + +static GList *ioRequests = NULL; /* Queue of io requests being processed */ + +static fd_set inputFDs; +static fd_set outputFDs; +static int noticePipe[2]; /* Notifications pipe, if this changes fsck the timeout... see whats happening */ + + + +/* Disk IO thread */ +static gpointer diskio_thread(gpointer data) +{ + struct timeval tv, tmp_tv; + unsigned char result = 1; + + + D_PRINT(D_NOTICE,"Starting C10K Local Disk IO Engine"); + pipe(noticePipe); + /* Watch our file descriptor */ + FD_ZERO(&inputFDs); + FD_ZERO(&outputFDs); + FD_SET(noticePipe[0],&inputFDs); + /* Set the timeout period */ + tv.tv_sec = 5; + tv.tv_usec = 0; + + /* Loop */ + while (result == 1) + { + fd_set tmp_wfds; + fd_set tmp_rfds; + int retVal; + GList *item; + + + /* Restore our params... */ + tmp_wfds = outputFDs; + tmp_rfds = inputFDs; + tmp_tv = tv; + + /* Do select() */ + retVal = select(FD_SETSIZE, &tmp_rfds, &tmp_wfds, NULL, &tmp_tv); + + /* And find result... */ + switch (retVal) + { + /* Something funny has happened */ + case -1: + /* Check if we've been interrupted */ + if (errno == EINTR) + { + D_PRINT(D_NOTICE,"select() interrupted by system call"); + result = D_NOTICE; + } + else + { + D_PRINT(D_ERROR,"select() error: %s",strerror(errno)); + result = D_ERROR; + } + break; + + /* Nothing changed, so process only timeout stuff */ + case 0: + /* Check for stale disk IO operations */ + D_PRINT(D_NOTICE,"idle"); + break; + + /* Something changed... process */ + default: +#if 0 + /* Check if we were triggered to process another IO operation */ + if (FD_ISSET(noticePipe[0],&tmp_rfds)) + { + char tmpBuf[SOCK_IO_BUF_LEN]; + + + D_PRINT(D_DEBUG,"Triggered request"); + + /* Clear pipe */ + read(noticePipe[0],&tmpBuf,SOCK_IO_BUF_LEN); + + // FIXME - pick IO request off queue */ + } // if (FD_ISSET(noticePipe[0],&tmp_rfds)) + + + if (FD_ISSET(dbConn->sock,&tmp_wfds) || FD_ISSET(dbConn->sock,&tmp_rfds)) + { + FD_CLR(dbConn->sock,&outputFDs); + FD_CLR(dbConn->sock,&inputFDs); + } // while (item) +#endif + break; + + } // switch (retVal) + } // while (result == 1) + + return NULL; +} + + +/* Abstraction layer open function */ +static int localdisk_open(struct dioFile_t *file, char *filename, int flags) +{ + D_PRINT(D_DEBUG,"localdisk.c: open %s",filename); + return D_OK; +} + + +#if 0 +/* Authenticate user */ +int pgsql_authenticate(struct authInfo_t *authInfo) +{ + D_PRINT(D_NOTICE,"Queuing authentication"); + + // Append & notify + authQueue = g_list_append(authQueue,authInfo); + write(noticePipe[1],"1",1); + + D_PRINT(D_NOTICE,"Authentication queued"); + + return D_OK; +} +#endif + +/* Initialize this module */ +struct module_t *module_init() +{ + struct module_t *myself = NULL; + struct dioCmds_t *dioCmds = NULL; + GThread *diskIOThread; + + + D_PRINT(D_NOTICE,"Registered C10K Local Disk IO Engine"); + + myself = malloc(sizeof(struct module_t)); + dioCmds = malloc(sizeof(struct dioCmds_t)); + + /* Start the disk IO thread */ + diskIOThread = g_thread_create(&diskio_thread,NULL,FALSE,NULL); + + /* Setup our commands */ + dioCmds->dio_open = localdisk_open; + dioCmds->dio_read = NULL; + dioCmds->dio_write = NULL; + dioCmds->dio_close = NULL; + + /* Setup module_t structure */ + myself->name = "c10k-localdisk"; + myself->type = DISKIO_MODULE; + myself->cmdStruct = dioCmds; + + return myself; +} + +// vim:ts=4 |
From: <sv...@li...> - 2005-05-09 19:55:48
|
Author: nkukard Date: 2005-05-09 19:55:13 +0000 (Mon, 09 May 2005) New Revision: 106 Modified: branches/nonblocking_io/lib/socklib.c Log: * Merged in revision 100 from trunk Modified: branches/nonblocking_io/lib/socklib.c =================================================================== --- branches/nonblocking_io/lib/socklib.c 2005-05-09 13:14:36 UTC (rev 105) +++ branches/nonblocking_io/lib/socklib.c 2005-05-09 19:55:13 UTC (rev 106) @@ -1,6 +1,6 @@ /* * socklib.c - Socket handling functions - * Copyright (C) 2002-2004, Linux Based Systems Design + * Copyright (C) 2002-2005, Linux Based Systems Design * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,28 +51,9 @@ -/* Initialize socket address */ -static int init_sockaddr(struct sockaddr_in *sin, const char *hostname, unsigned short int port) -{ - struct hostent* hostinfo; - sin->sin_family = AF_INET; - sin->sin_port = htons(port); - hostinfo = gethostbyname(hostname); - - if (!hostinfo) - { - d_printf(D_FATAL,__FUNCTION__,"Unknown host %s",hostname); - return D_FATAL; - } - sin->sin_addr = *(struct in_addr*) hostinfo->h_addr; - - return D_OK; -} - - /* FIXME - per thread data */ static GList *connectionList = NULL; fd_set outputFDs; @@ -200,7 +181,8 @@ { fd_set tmp_wfds; fd_set tmp_rfds; - + + /* Restore our params... */ tmp_wfds = outputFDs; tmp_rfds = inputFDs; @@ -274,7 +256,7 @@ /* Check if we were triggered to reload the fd's */ if (FD_ISSET(workerPipe[0],&tmp_rfds)) { - read(workerPipe[0],&tmpBuf,4096); + read(workerPipe[0],&tmpBuf,SOCK_IO_BUF_LEN); fprintf(stderr,"Triggered reload\n"); break; } @@ -440,6 +422,8 @@ } } /* if (timeout) */ } /* if (item->data) */ + else + D_PRINT(D_ERROR,"item->data is NULL"); item = g_list_next(item); } @@ -451,39 +435,8 @@ } -/* Create a socket */ -static int make_socket(struct sockaddr_in sin) -{ - int sock; - int one = 1; - int result; - // Create the socket - sock = socket(PF_INET,SOCK_STREAM,0); - if (sock < 0) - { - d_printf(D_FATAL,"make_socket()",strerror(errno)); - return D_FATAL; - } - // Set a few thingies... - result = setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&one,sizeof(one)); - if (result < 0) - { - d_printf(D_FATAL,"make_socket()","Failed to set SO_REUSEADDR"); - return D_FATAL; - } - // Bind - if (bind(sock,(struct sockaddr*)&sin,(socklen_t) sizeof(sin))<0) - { - d_printf(D_FATAL,"make_socket()",sys_errlist[errno]); - return D_FATAL; - } - // And return - return(sock); -} - - /* Function to create a connection that will be passed down to the protocol handler */ static struct clientConnection_t* createConnection(struct sockData_t *sockData, int sockfd, char* remoteHost) { @@ -494,7 +447,7 @@ aClient = (struct clientConnection_t*) malloc0(sizeof(struct clientConnection_t)); if (aClient == NULL) { - d_printf(D_FATAL,"createConnection()","Failed to allocate memory for aClient"); + D_PRINT(D_FATAL,"Failed to allocate memory for aClient"); return NULL; } @@ -669,6 +622,8 @@ struct timeval tv, tmp_tv; GList* item; GThread *thread1; + int optVal = 1; + int sock; @@ -685,34 +640,59 @@ // Check we have our data... if (!(sockData = item->data)) { - d_printf(D_FATAL,"server_init()","No socket data specified"); + D_PRINT(D_FATAL,"No socket data specified"); return D_FATAL; } - d_printf(D_FATAL,"server_init()","IP Addr: %s, Port: %i, Cons: %i", + D_PRINT(D_FATAL,"IP Addr: %s, Port: %i, Cons: %i", sockData->ipAddress, sockData->listenPort, sockData->maxConnections); /* Initialize socket address */ - if (init_sockaddr(&myaddr,sockData->ipAddress,sockData->listenPort) == D_FATAL) + struct hostent* hostinfo; + myaddr.sin_family = AF_INET; + myaddr.sin_port = htons(sockData->listenPort); + hostinfo = gethostbyname(sockData->ipAddress); + if (!hostinfo) { - d_printf(D_FATAL,"server_init()","Failed to initialize socket address"); + D_PRINT(D_FATAL,"Unknown host %s",sockData->ipAddress); return D_FATAL; } - + myaddr.sin_addr = *(struct in_addr*) hostinfo->h_addr; + /* Create socket... */ - sockData->boundFD = make_socket(myaddr); + + // Create the socket + if ((sock=socket(PF_INET,SOCK_STREAM,0))< 0) + { + D_PRINT(D_FATAL,strerror(errno)); + return D_FATAL; + } + // Set socket options + if (setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&optVal,sizeof(optVal)) < 0) + { + D_PRINT(D_FATAL,"Failed to set SO_REUSEADDR"); + return D_FATAL; + } + // Bind + if (bind(sock,(struct sockaddr*)&myaddr,(socklen_t) sizeof(myaddr))<0) + { + D_PRINT(D_FATAL,"Error binding: %s",sys_errlist[errno]); + return D_FATAL; + } + + sockData->boundFD = sock; if (sockData->boundFD == D_FATAL) { - d_printf(D_FATAL,"server_init()","Failed to create socket"); + D_PRINT(D_FATAL,"Failed to create socket"); return D_FATAL; } /* Listen for connections */ if (listen(sockData->boundFD,SOMAXCONN) == -1) { - d_printf(D_FATAL,"server_init()","Failed to listen on boundFD: %s",strerror(errno)); + D_PRINT(D_FATAL,"Failed to listen on boundFD: %s",strerror(errno)); return D_FATAL; } @@ -744,10 +724,10 @@ { case -1: // if (errno == EINTR) -// d_printf(D_DEBUG,"server_init()","Child died"); +// D_PRINT(D_DEBUG,"Child died"); // ; // else - d_printf(D_NOTICE,__FUNCTION__,"select() returned error: %s",strerror(errno)); + D_PRINT(D_NOTICE,"select() returned error: %s",strerror(errno)); break; case 0: /* Select did nothing, hit the timeout */ @@ -761,7 +741,7 @@ /* Check if there is actually data we can use */ if (!(sockData = item->data)) { - d_printf(D_FATAL,__FUNCTION__,"sockData cannot be null\n"); + D_PRINT(D_FATAL,"sockData cannot be null\n"); return D_FATAL; } @@ -780,14 +760,14 @@ remoteHost = strdup(inet_ntoa(clientAddr.sin_addr)); if (!remoteHost) { - d_printf(D_FATAL,__FUNCTION__,"Failed to allocate memory for remoteHost"); + D_PRINT(D_FATAL,"Failed to allocate memory for remoteHost"); return D_FATAL; } /* Setup the client connection */ clientConnection = createConnection(sockData,newfd,remoteHost); if (clientConnection == NULL) { - d_printf(D_FATAL,__FUNCTION__,"Failed to create client connection"); + D_PRINT(D_FATAL,"Failed to create client connection"); return D_FATAL; } /* Pass connection onto worker threads */ @@ -802,3 +782,4 @@ } } +// vim: ts=4 |
From: <sv...@li...> - 2005-05-09 13:23:38
|
Author: nkukard Date: 2005-05-09 13:14:36 +0000 (Mon, 09 May 2005) New Revision: 105 Added: branches/nonblocking_io/modules/auth/auth.c branches/nonblocking_io/modules/auth/auth.h branches/nonblocking_io/modules/engines/diskIO/diskio.c branches/nonblocking_io/modules/engines/diskIO/diskio.h branches/nonblocking_io/modules/storage/storage.c branches/nonblocking_io/modules/storage/storage.h Removed: branches/nonblocking_io/include/auth.h branches/nonblocking_io/lib/auth.c Modified: branches/nonblocking_io/Makefile.am branches/nonblocking_io/Makefile.in branches/nonblocking_io/include/modules.h branches/nonblocking_io/lib/Makefile.am branches/nonblocking_io/lib/Makefile.in branches/nonblocking_io/lib/mailstore.c branches/nonblocking_io/lib/modules.c branches/nonblocking_io/modules/Makefile.am branches/nonblocking_io/modules/Makefile.in branches/nonblocking_io/modules/auth/Makefile.am branches/nonblocking_io/modules/auth/Makefile.in branches/nonblocking_io/modules/auth/pgsql/pgsql.c branches/nonblocking_io/modules/engines/Makefile.am branches/nonblocking_io/modules/engines/Makefile.in branches/nonblocking_io/modules/engines/diskIO/Makefile.am branches/nonblocking_io/modules/engines/diskIO/Makefile.in branches/nonblocking_io/modules/engines/diskIO/localdisk/localdisk.c branches/nonblocking_io/modules/protocols/imap4/imap4.c branches/nonblocking_io/modules/protocols/imap4/imap4_cmd_login.c branches/nonblocking_io/modules/protocols/pop3/pop3.c branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_pass.c branches/nonblocking_io/modules/protocols/smtp/smtp.c branches/nonblocking_io/modules/storage/Makefile.am branches/nonblocking_io/modules/storage/Makefile.in Log: * Major intermediate change to merge the following code paths... - Protocol => authentication abstraction layer - Protocol => mailstore abstraction layer - Mailstore => disk IO abstraction layer * Lots more work will follow! Modified: branches/nonblocking_io/Makefile.am =================================================================== --- branches/nonblocking_io/Makefile.am 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/Makefile.am 2005-05-09 13:14:36 UTC (rev 105) @@ -1,2 +1,2 @@ -SUBDIRS=lib dbma doc modules +SUBDIRS=modules lib dbma doc EXTRA_DIST= include/auth.h include/debug.h include/mailstore.h include/misc.h include/modules.h include/socklib.h Modified: branches/nonblocking_io/Makefile.in =================================================================== --- branches/nonblocking_io/Makefile.in 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/Makefile.in 2005-05-09 13:14:36 UTC (rev 105) @@ -183,7 +183,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = lib dbma doc modules +SUBDIRS = modules lib dbma doc EXTRA_DIST = include/auth.h include/debug.h include/mailstore.h include/misc.h include/modules.h include/socklib.h all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive Deleted: branches/nonblocking_io/include/auth.h =================================================================== --- branches/nonblocking_io/include/auth.h 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/include/auth.h 2005-05-09 13:14:36 UTC (rev 105) @@ -1,79 +0,0 @@ -/* - * auth.h - Authentication header file - * Copyright (C) 2002-2005, Linux Based Systems Design - * - * This program 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - * 12/04/2005 - Nigel Kukard <nk...@lb...> - * * Non-blocking API - * - * 23/05/2004 - Nigel Kukard <nk...@lb...> - * * Reworked design - * -*/ - -#ifndef AUTH_H -#define AUTH_H - -#include <stdlib.h> -#include "socklib.h" - - -/* Authentication result codes */ -#define AUTH_RES_FATAL -2 -#define AUTH_RES_ERROR -1 -#define AUTH_RES_NONE 0 -#define AUTH_RES_OK 1 -#define AUTH_RES_INVALID 2 - - -/* Defines used for specifying callbacks */ -#define AUTH_CALLBACK_PARAMS struct authInfo_t *authInfo -/* Actual func used in specifying something that needs a callback func passed */ -#define AUTH_CALLBACK_FUNC void (*callback) (AUTH_CALLBACK_PARAMS) - - -/* Authentication info */ -struct authInfo_t -{ - /* This is internal so we can maintain callback */ - struct clientConnection_t *client; - AUTH_CALLBACK_FUNC; - /* This stuff is given by the requestor */ - char *username; /* username is parsed to throw off the realm */ - char *password; - /* This is returned */ - char *realm; /* deciphered from username, NULL if none */ - char *mailstore; /* path to mailstore, this must be pumped through the storage modules to find which one we need */ - unsigned int quota; /* Maximum mailstore quota, 0 if unlimited, Expressed in Kbyte */ - int result; /* Result of authentication */ -}; - - -/* Command struct populated when we register a authentication module */ -struct authCmds_t -{ - int (*authenticate) (struct authInfo_t *authInfo); -}; - - -/* Check if we can authenticate a user, return a reply if we can */ -int module_auth(struct clientConnection_t *clientConnection, AUTH_CALLBACK_FUNC, char *username, char *password); - - -#endif - -// vim:ts=4 Modified: branches/nonblocking_io/include/modules.h =================================================================== --- branches/nonblocking_io/include/modules.h 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/include/modules.h 2005-05-09 13:14:36 UTC (rev 105) @@ -30,7 +30,6 @@ #define _MODULES_H #include <arpa/inet.h> -#include "auth.h" #include "socklib.h" @@ -79,13 +78,18 @@ }; -/* Return list of auth modules loaded, USE WITH CAUTION!!! */ +/* Return list of auth modules loaded */ GList *get_auth_modules(); -/* Function to load a .so driver */ -struct module_t *load_module(char *filename); -/* Return list of storage modules loaded, USE WITH CAUTION!!! */ + +/* Return list of storage modules loaded */ GList *get_storage_modules(); +/* Return list of storage modules loaded */ +GList *get_diskio_modules(); + /* Function to load a .so driver */ +struct module_t *load_module(char *filename); + + #endif Modified: branches/nonblocking_io/lib/Makefile.am =================================================================== --- branches/nonblocking_io/lib/Makefile.am 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/lib/Makefile.am 2005-05-09 13:14:36 UTC (rev 105) @@ -2,7 +2,8 @@ GLIB_CFLAGS=@GLIB_CFLAGS@ lib_LTLIBRARIES = libdbma.la -libdbma_la_SOURCES = auth.c debug.c mailstore.c misc.c modules.c socklib.c +libdbma_la_SOURCES = debug.c mailstore.c misc.c modules.c socklib.c +libdbma_la_LIBADD = ../modules/libmodules.la libdbma_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) libdbma_la_LDFLAGS = $(GLIB_LIBS) --version-info 1:0:0 Modified: branches/nonblocking_io/lib/Makefile.in =================================================================== --- branches/nonblocking_io/lib/Makefile.in 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/lib/Makefile.in 2005-05-09 13:14:36 UTC (rev 105) @@ -57,10 +57,9 @@ am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) -libdbma_la_LIBADD = -am_libdbma_la_OBJECTS = libdbma_la-auth.lo libdbma_la-debug.lo \ - libdbma_la-mailstore.lo libdbma_la-misc.lo \ - libdbma_la-modules.lo libdbma_la-socklib.lo +libdbma_la_DEPENDENCIES = ../modules/libmodules.la +am_libdbma_la_OBJECTS = libdbma_la-debug.lo libdbma_la-mailstore.lo \ + libdbma_la-misc.lo libdbma_la-modules.lo libdbma_la-socklib.lo libdbma_la_OBJECTS = $(am_libdbma_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -189,7 +188,8 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ lib_LTLIBRARIES = libdbma.la -libdbma_la_SOURCES = auth.c debug.c mailstore.c misc.c modules.c socklib.c +libdbma_la_SOURCES = debug.c mailstore.c misc.c modules.c socklib.c +libdbma_la_LIBADD = ../modules/libmodules.la libdbma_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) libdbma_la_LDFLAGS = $(GLIB_LIBS) --version-info 1:0:0 all: all-am @@ -261,7 +261,6 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbma_la-auth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbma_la-debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbma_la-mailstore.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdbma_la-misc.Plo@am__quote@ @@ -289,13 +288,6 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -libdbma_la-auth.lo: auth.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdbma_la_CFLAGS) $(CFLAGS) -MT libdbma_la-auth.lo -MD -MP -MF "$(DEPDIR)/libdbma_la-auth.Tpo" -c -o libdbma_la-auth.lo `test -f 'auth.c' || echo '$(srcdir)/'`auth.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libdbma_la-auth.Tpo" "$(DEPDIR)/libdbma_la-auth.Plo"; else rm -f "$(DEPDIR)/libdbma_la-auth.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='libdbma_la-auth.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdbma_la_CFLAGS) $(CFLAGS) -c -o libdbma_la-auth.lo `test -f 'auth.c' || echo '$(srcdir)/'`auth.c - libdbma_la-debug.lo: debug.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdbma_la_CFLAGS) $(CFLAGS) -MT libdbma_la-debug.lo -MD -MP -MF "$(DEPDIR)/libdbma_la-debug.Tpo" -c -o libdbma_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libdbma_la-debug.Tpo" "$(DEPDIR)/libdbma_la-debug.Plo"; else rm -f "$(DEPDIR)/libdbma_la-debug.Tpo"; exit 1; fi Deleted: branches/nonblocking_io/lib/auth.c =================================================================== --- branches/nonblocking_io/lib/auth.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/lib/auth.c 2005-05-09 13:14:36 UTC (rev 105) @@ -1,143 +0,0 @@ -/* - * auth.c - Authentication handling functions - * Copyright (C) 2002-2005, Linux Based Systems Design - * - * This program 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - * 12/04/2005 - Nigel Kukard <nk...@lb...> - * * Non-blocking API - * - * 23/05/2004 - Nigel Kukard <nk...@lb...> - * * Reworked design - * -*/ - -#include "config.h" - -#include <stdio.h> -#include <string.h> -#include "auth.h" -#include "debug.h" -#include "modules.h" - - -/* Check if we can authenticate a user, return a reply if we can */ -int module_auth(struct clientConnection_t *clientConnection, AUTH_CALLBACK_FUNC, char *username, char *password) -{ - GList *authModules = get_auth_modules(); - GList *item; - char *actualUsername; /* Split off section of the username, before realm */ - char *realm; /* If anyone is wondering what this is, its the domain name */ - struct module_t *module; - struct authCmds_t *authCmds; - struct authInfo_t *authInfo; - int res; - - - /* Check if username & password are valid */ - if (!username || !password) - { - D_PRINT(D_ERROR,"Username or password is NULL"); - return D_ERROR; - } - - /* Check if the first module isn't NULL and if not, assign it to our first item */ - if (!(item = g_list_first(authModules))) - { - D_PRINT(D_ERROR,"There is no means of authentication"); - return D_ERROR; - } - -/* - * This block must eventually be moved over to something like validateModule()??? - */ - - /* Check our module is valid, before we start allocating stuff */ - if (!(module = item->data)) - { - D_PRINT(D_ERROR,"Module data is NULL"); - return D_ERROR; - } - - /* Verify we are a authentication module */ - if (module->type != AUTH_MODULE) - { - D_PRINT(D_ERROR,"Module with incorrect type detected"); - return D_ERROR; - } - - /* Again verify */ - if (!(authCmds = module->cmdStruct)) - { - D_PRINT(D_NOTICE,"module_auth()","No commands found to use in authentication module"); - } -/* - * end block - */ - - - /* Calculate realm & actualUsername */ - if (!(realm = strchr(username,'@'))) - { - if (!(actualUsername = strdup(username))) - { - D_PRINT(D_FATAL,"Failed to allocate memory"); - return D_FATAL; - } - } - else - { - /* Remember realm would of pointed to the @ */ - if (realm) - realm++; - /* strdup username & realm */ - if (!(actualUsername = strndup(username,strlen(username) - strlen(realm))) || !(realm = strdup(realm))) - { - D_PRINT(D_FATAL,"Failed to allocate memory"); - return D_FATAL; - } - } - - /* Allocate and check */ - if (!(authInfo = malloc(sizeof(struct authInfo_t)))) - { - free(actualUsername); - if (realm) - free(realm); - - D_PRINT(D_FATAL,"Failed to allocate memory"); - return D_FATAL; - } - - /* Internal stuff */ - authInfo->client = clientConnection; - authInfo->callback = callback; - /* Setup request */ - authInfo->username = actualUsername; - authInfo->password = strdup(password); - authInfo->realm = realm; - /* Stuff returned */ - authInfo->mailstore = NULL; - authInfo->quota = 0; - authInfo->result = AUTH_RES_NONE; - - D_PRINT(D_DEBUG,"Authenticating"); - res = authCmds->authenticate(authInfo); - - return res; -} - -// vim:ts=4 Modified: branches/nonblocking_io/lib/mailstore.c =================================================================== --- branches/nonblocking_io/lib/mailstore.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/lib/mailstore.c 2005-05-09 13:14:36 UTC (rev 105) @@ -24,7 +24,6 @@ #include "misc.h" #include "modules.h" -#include "auth.h" #include "debug.h" #include "string.h" Modified: branches/nonblocking_io/lib/modules.c =================================================================== --- branches/nonblocking_io/lib/modules.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/lib/modules.c 2005-05-09 13:14:36 UTC (rev 105) @@ -32,9 +32,9 @@ /* Lists of various modules */ +static GList *authModuleList = NULL; static GList *storageModuleList = NULL; static GList *protoModuleList = NULL; -static GList *authModuleList = NULL; static GList *diskIOModuleList = NULL; Modified: branches/nonblocking_io/modules/Makefile.am =================================================================== --- branches/nonblocking_io/modules/Makefile.am 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/Makefile.am 2005-05-09 13:14:36 UTC (rev 105) @@ -1 +1,5 @@ -SUBDIRS=auth protocols storage engines +SUBDIRS=auth engines protocols storage + +noinst_LTLIBRARIES=libmodules.la +libmodules_la_SOURCES= +libmodules_la_LIBADD=engines/libengines.la storage/libstorage.la Modified: branches/nonblocking_io/modules/Makefile.in =================================================================== --- branches/nonblocking_io/modules/Makefile.in 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/Makefile.in 2005-05-09 13:14:36 UTC (rev 105) @@ -13,6 +13,9 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + +SOURCES = $(libmodules_la_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -45,8 +48,22 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libmodules_la_DEPENDENCIES = engines/libengines.la \ + storage/libstorage.la +am_libmodules_la_OBJECTS = +libmodules_la_OBJECTS = $(am_libmodules_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libmodules_la_SOURCES) +DIST_SOURCES = $(libmodules_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -167,7 +184,10 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = auth protocols storage engines +SUBDIRS = auth engines protocols storage +noinst_LTLIBRARIES = libmodules.la +libmodules_la_SOURCES = +libmodules_la_LIBADD = engines/libengines.la storage/libstorage.la all: all-recursive .SUFFIXES: @@ -201,6 +221,23 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libmodules.la: $(libmodules_la_OBJECTS) $(libmodules_la_DEPENDENCIES) + $(LINK) $(libmodules_la_LDFLAGS) $(libmodules_la_OBJECTS) $(libmodules_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + mostlyclean-libtool: -rm -f *.lo @@ -375,7 +412,7 @@ done check-am: all-am check: check-recursive -all-am: Makefile +all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive @@ -404,12 +441,13 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am distclean: distclean-recursive -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags dvi: dvi-recursive @@ -437,7 +475,8 @@ mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf: pdf-recursive @@ -452,17 +491,18 @@ uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ + clean clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: branches/nonblocking_io/modules/auth/Makefile.am =================================================================== --- branches/nonblocking_io/modules/auth/Makefile.am 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/auth/Makefile.am 2005-05-09 13:14:36 UTC (rev 105) @@ -1 +1,9 @@ +GLIB_LIBS=@GLIB_LIBS@ +GLIB_CFLAGS=@GLIB_CFLAGS@ + SUBDIRS=pgsql + +noinst_LTLIBRARIES=libauth.la +libauth_la_SOURCES=auth.c +libauth_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) + Modified: branches/nonblocking_io/modules/auth/Makefile.in =================================================================== --- branches/nonblocking_io/modules/auth/Makefile.in 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/auth/Makefile.in 2005-05-09 13:14:36 UTC (rev 105) @@ -13,6 +13,9 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + +SOURCES = $(libauth_la_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -45,8 +48,23 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libauth_la_LIBADD = +am_libauth_la_OBJECTS = libauth_la-auth.lo +libauth_la_OBJECTS = $(am_libauth_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libauth_la_SOURCES) +DIST_SOURCES = $(libauth_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -168,9 +186,13 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = pgsql +noinst_LTLIBRARIES = libauth.la +libauth_la_SOURCES = auth.c +libauth_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) all: all-recursive .SUFFIXES: +.SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -201,6 +223,53 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libauth.la: $(libauth_la_OBJECTS) $(libauth_la_DEPENDENCIES) + $(LINK) $(libauth_la_LDFLAGS) $(libauth_la_OBJECTS) $(libauth_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libauth_la-auth.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libauth_la-auth.lo: auth.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libauth_la_CFLAGS) $(CFLAGS) -MT libauth_la-auth.lo -MD -MP -MF "$(DEPDIR)/libauth_la-auth.Tpo" -c -o libauth_la-auth.lo `test -f 'auth.c' || echo '$(srcdir)/'`auth.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libauth_la-auth.Tpo" "$(DEPDIR)/libauth_la-auth.Plo"; else rm -f "$(DEPDIR)/libauth_la-auth.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='auth.c' object='libauth_la-auth.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libauth_la_CFLAGS) $(CFLAGS) -c -o libauth_la-auth.lo `test -f 'auth.c' || echo '$(srcdir)/'`auth.c + mostlyclean-libtool: -rm -f *.lo @@ -375,7 +444,7 @@ done check-am: all-am check: check-recursive -all-am: Makefile +all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive @@ -404,12 +473,14 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am distclean: distclean-recursive + -rm -rf ./$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags dvi: dvi-recursive @@ -432,12 +503,14 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf: pdf-recursive @@ -452,17 +525,18 @@ uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ + clean clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Added: branches/nonblocking_io/modules/auth/auth.c =================================================================== --- branches/nonblocking_io/modules/auth/auth.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/auth/auth.c 2005-05-09 13:14:36 UTC (rev 105) @@ -0,0 +1,143 @@ +/* + * auth.c - Authentication handling functions + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * 12/04/2005 - Nigel Kukard <nk...@lb...> + * * Non-blocking API + * + * 23/05/2004 - Nigel Kukard <nk...@lb...> + * * Reworked design + * +*/ + +#include "config.h" + +#include <stdio.h> +#include <string.h> +#include "auth.h" +#include "debug.h" +#include "modules.h" + + +/* Check if we can authenticate a user, return a reply if we can */ +int module_auth(struct clientConnection_t *clientConnection, AUTH_CALLBACK_FUNC, char *username, char *password) +{ + GList *authModules = get_auth_modules(); + GList *item; + char *actualUsername; /* Split off section of the username, before realm */ + char *realm; /* If anyone is wondering what this is, its the domain name */ + struct module_t *module; + struct authCmds_t *authCmds; + struct authInfo_t *authInfo; + int res; + + + /* Check if username & password are valid */ + if (!username || !password) + { + D_PRINT(D_ERROR,"Username or password is NULL"); + return D_ERROR; + } + + /* Check if the first module isn't NULL and if not, assign it to our first item */ + if (!(item = g_list_first(authModules))) + { + D_PRINT(D_ERROR,"There is no means of authentication"); + return D_ERROR; + } + +/* + * This block must eventually be moved over to something like validateModule()??? + */ + + /* Check our module is valid, before we start allocating stuff */ + if (!(module = item->data)) + { + D_PRINT(D_ERROR,"Module data is NULL"); + return D_ERROR; + } + + /* Verify we are a authentication module */ + if (module->type != AUTH_MODULE) + { + D_PRINT(D_ERROR,"Module with incorrect type detected"); + return D_ERROR; + } + + /* Again verify */ + if (!(authCmds = module->cmdStruct)) + { + D_PRINT(D_NOTICE,"module_auth()","No commands found to use in authentication module"); + } +/* + * end block + */ + + + /* Calculate realm & actualUsername */ + if (!(realm = strchr(username,'@'))) + { + if (!(actualUsername = strdup(username))) + { + D_PRINT(D_FATAL,"Failed to allocate memory"); + return D_FATAL; + } + } + else + { + /* Remember realm would of pointed to the @ */ + if (realm) + realm++; + /* strdup username & realm */ + if (!(actualUsername = strndup(username,strlen(username) - strlen(realm))) || !(realm = strdup(realm))) + { + D_PRINT(D_FATAL,"Failed to allocate memory"); + return D_FATAL; + } + } + + /* Allocate and check */ + if (!(authInfo = malloc(sizeof(struct authInfo_t)))) + { + free(actualUsername); + if (realm) + free(realm); + + D_PRINT(D_FATAL,"Failed to allocate memory"); + return D_FATAL; + } + + /* Internal stuff */ + authInfo->client = clientConnection; + authInfo->callback = callback; + /* Setup request */ + authInfo->username = actualUsername; + authInfo->password = strdup(password); + authInfo->realm = realm; + /* Stuff returned */ + authInfo->mailstore = NULL; + authInfo->quota = 0; + authInfo->result = AUTH_RES_NONE; + + D_PRINT(D_DEBUG,"Authenticating"); + res = authCmds->authenticate(authInfo); + + return res; +} + +// vim:ts=4 Added: branches/nonblocking_io/modules/auth/auth.h =================================================================== --- branches/nonblocking_io/modules/auth/auth.h 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/auth/auth.h 2005-05-09 13:14:36 UTC (rev 105) @@ -0,0 +1,79 @@ +/* + * auth.h - Authentication header file + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * 12/04/2005 - Nigel Kukard <nk...@lb...> + * * Non-blocking API + * + * 23/05/2004 - Nigel Kukard <nk...@lb...> + * * Reworked design + * +*/ + +#ifndef AUTH_H +#define AUTH_H + +#include <stdlib.h> +#include "socklib.h" + + +/* Authentication result codes */ +#define AUTH_RES_FATAL -2 +#define AUTH_RES_ERROR -1 +#define AUTH_RES_NONE 0 +#define AUTH_RES_OK 1 +#define AUTH_RES_INVALID 2 + + +/* Defines used for specifying callbacks */ +#define AUTH_CALLBACK_PARAMS struct authInfo_t *authInfo +/* Actual func used in specifying something that needs a callback func passed */ +#define AUTH_CALLBACK_FUNC void (*callback) (AUTH_CALLBACK_PARAMS) + + +/* Authentication info */ +struct authInfo_t +{ + /* This is internal so we can maintain callback */ + struct clientConnection_t *client; + AUTH_CALLBACK_FUNC; + /* This stuff is given by the requestor */ + char *username; /* username is parsed to throw off the realm */ + char *password; + /* This is returned */ + char *realm; /* deciphered from username, NULL if none */ + char *mailstore; /* path to mailstore, this must be pumped through the storage modules to find which one we need */ + unsigned int quota; /* Maximum mailstore quota, 0 if unlimited, Expressed in Kbyte */ + int result; /* Result of authentication */ +}; + + +/* Command struct populated when we register a authentication module */ +struct authCmds_t +{ + int (*authenticate) (struct authInfo_t *authInfo); +}; + + +/* Check if we can authenticate a user, return a reply if we can */ +int module_auth(struct clientConnection_t *clientConnection, AUTH_CALLBACK_FUNC, char *username, char *password); + + +#endif + +// vim:ts=4 Modified: branches/nonblocking_io/modules/auth/pgsql/pgsql.c =================================================================== --- branches/nonblocking_io/modules/auth/pgsql/pgsql.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/auth/pgsql/pgsql.c 2005-05-09 13:14:36 UTC (rev 105) @@ -31,7 +31,7 @@ #include <pgsql/libpq-fe.h> #include <unistd.h> #include "debug.h" -#include "auth.h" +#include "../auth.h" #include "modules.h" #include "socklib.h" Modified: branches/nonblocking_io/modules/engines/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/Makefile.am 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/engines/Makefile.am 2005-05-09 13:14:36 UTC (rev 105) @@ -1 +1,6 @@ SUBDIRS=diskIO + +noinst_LTLIBRARIES=libengines.la +libengines_la_SOURCES= +libengines_la_LIBADD=diskIO/libdiskio.la + Modified: branches/nonblocking_io/modules/engines/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/Makefile.in 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/engines/Makefile.in 2005-05-09 13:14:36 UTC (rev 105) @@ -13,6 +13,9 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + +SOURCES = $(libengines_la_SOURCES) + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -45,8 +48,21 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libengines_la_DEPENDENCIES = diskIO/libdiskio.la +am_libengines_la_OBJECTS = +libengines_la_OBJECTS = $(am_libengines_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libengines_la_SOURCES) +DIST_SOURCES = $(libengines_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -168,6 +184,9 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = diskIO +noinst_LTLIBRARIES = libengines.la +libengines_la_SOURCES = +libengines_la_LIBADD = diskIO/libdiskio.la all: all-recursive .SUFFIXES: @@ -201,6 +220,23 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libengines.la: $(libengines_la_OBJECTS) $(libengines_la_DEPENDENCIES) + $(LINK) $(libengines_la_LDFLAGS) $(libengines_la_OBJECTS) $(libengines_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + mostlyclean-libtool: -rm -f *.lo @@ -375,7 +411,7 @@ done check-am: all-am check: check-recursive -all-am: Makefile +all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive @@ -404,12 +440,13 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am distclean: distclean-recursive -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags dvi: dvi-recursive @@ -437,7 +474,8 @@ mostlyclean: mostlyclean-recursive -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf: pdf-recursive @@ -452,17 +490,18 @@ uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ + clean clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-libtool \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: branches/nonblocking_io/modules/engines/diskIO/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/Makefile.am 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/engines/diskIO/Makefile.am 2005-05-09 13:14:36 UTC (rev 105) @@ -3,9 +3,8 @@ SUBDIRS=localdisk -module_LTLIBRARIES = diskio.la -diskio_la_SOURCES = diskio.c -diskio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) -diskio_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +noinst_LTLIBRARIES = libdiskio.la +libdiskio_la_SOURCES = diskio.c +libdiskio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) Modified: branches/nonblocking_io/modules/engines/diskIO/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/Makefile.in 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/engines/diskIO/Makefile.in 2005-05-09 13:14:36 UTC (rev 105) @@ -14,7 +14,7 @@ @SET_MAKE@ -SOURCES = $(diskio_la_SOURCES) +SOURCES = $(libdiskio_la_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ @@ -48,18 +48,10 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(moduledir)" -moduleLTLIBRARIES_INSTALL = $(INSTALL) -LTLIBRARIES = $(module_LTLIBRARIES) -diskio_la_LIBADD = -am_diskio_la_OBJECTS = diskio_la-diskio.lo -diskio_la_OBJECTS = $(am_diskio_la_OBJECTS) +LTLIBRARIES = $(noinst_LTLIBRARIES) +libdiskio_la_LIBADD = +am_libdiskio_la_OBJECTS = libdiskio_la-diskio.lo +libdiskio_la_OBJECTS = $(am_libdiskio_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -71,8 +63,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(diskio_la_SOURCES) -DIST_SOURCES = $(diskio_la_SOURCES) +SOURCES = $(libdiskio_la_SOURCES) +DIST_SOURCES = $(libdiskio_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ @@ -194,10 +186,9 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = localdisk -module_LTLIBRARIES = diskio.la -diskio_la_SOURCES = diskio.c -diskio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) -diskio_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +noinst_LTLIBRARIES = libdiskio.la +libdiskio_la_SOURCES = diskio.c +libdiskio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) all: all-recursive .SUFFIXES: @@ -231,35 +222,17 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-moduleLTLIBRARIES: $(module_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(moduledir)" || $(mkdir_p) "$(DESTDIR)$(moduledir)" - @list='$(module_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moduledir)/$$f'"; \ - $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moduledir)/$$f"; \ - else :; fi; \ - done -uninstall-moduleLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @set -x; list='$(module_LTLIBRARIES)'; for p in $$list; do \ - p=$(am__strip_dir) \ - echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$p'"; \ - $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$p"; \ - done - -clean-moduleLTLIBRARIES: - -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) - @list='$(module_LTLIBRARIES)'; for p in $$list; do \ +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -diskio.la: $(diskio_la_OBJECTS) $(diskio_la_DEPENDENCIES) - $(LINK) -rpath $(moduledir) $(diskio_la_LDFLAGS) $(diskio_la_OBJECTS) $(diskio_la_LIBADD) $(LIBS) +libdiskio.la: $(libdiskio_la_OBJECTS) $(libdiskio_la_DEPENDENCIES) + $(LINK) $(libdiskio_la_LDFLAGS) $(libdiskio_la_OBJECTS) $(libdiskio_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -267,7 +240,7 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskio_la-diskio.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdiskio_la-diskio.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @@ -290,12 +263,12 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -diskio_la-diskio.lo: diskio.c -@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskio_la_CFLAGS) $(CFLAGS) -MT diskio_la-diskio.lo -MD -MP -MF "$(DEPDIR)/diskio_la-diskio.Tpo" -c -o diskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskio_la-diskio.Tpo" "$(DEPDIR)/diskio_la-diskio.Plo"; else rm -f "$(DEPDIR)/diskio_la-diskio.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='diskio.c' object='diskio_la-diskio.lo' libtool=yes @AMDEPBACKSLASH@ +libdiskio_la-diskio.lo: diskio.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdiskio_la_CFLAGS) $(CFLAGS) -MT libdiskio_la-diskio.lo -MD -MP -MF "$(DEPDIR)/libdiskio_la-diskio.Tpo" -c -o libdiskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libdiskio_la-diskio.Tpo" "$(DEPDIR)/libdiskio_la-diskio.Plo"; else rm -f "$(DEPDIR)/libdiskio_la-diskio.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='diskio.c' object='libdiskio_la-diskio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskio_la_CFLAGS) $(CFLAGS) -c -o diskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdiskio_la_CFLAGS) $(CFLAGS) -c -o libdiskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c mostlyclean-libtool: -rm -f *.lo @@ -474,9 +447,6 @@ all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(moduledir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -503,7 +473,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive -clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive @@ -522,7 +492,7 @@ info-am: -install-data-am: install-moduleLTLIBRARIES +install-data-am: install-exec-am: @@ -550,24 +520,23 @@ ps-am: -uninstall-am: uninstall-info-am uninstall-moduleLTLIBRARIES +uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-libtool clean-moduleLTLIBRARIES \ + clean clean-generic clean-libtool clean-noinstLTLIBRARIES \ clean-recursive ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-moduleLTLIBRARIES \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-info-am uninstall-moduleLTLIBRARIES + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Added: branches/nonblocking_io/modules/engines/diskIO/diskio.c =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/diskio.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/engines/diskIO/diskio.c 2005-05-09 13:14:36 UTC (rev 105) @@ -0,0 +1,153 @@ +/* + * diskio.c - Disk IO Abstraction Layer + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * 05/05/2005 - Nigel Kukard <nk...@lb...> + * * Initial design + * +*/ + + +#include <glib.h> +#include "debug.h" +#include "diskio.h" +#include "modules.h" + + + +/* Abstraction layer open function */ +int dio_open(void *context, char *filename, int flags, DISKIO_CALLBACK_FUNC) +{ + GList *moduleList; + GList *item; + struct dioFile_t *diof = NULL; + + /* + * FIXME + * + * 1. This function must get a mapping of mountpoints to module names + * - eg: /mnt/nfs_server => nfsdisk + * - eg: /mnt/hdc1 => localdisk + * 2. It must then choose a module to handle a mount point + * 3. It must assign that modules cmdStruct to the dioFile_t returned struct + * + */ + + moduleList = get_diskio_modules(); + + /* Loop with disk IO modules */ + item = g_list_first(moduleList); + while (item) + { + struct module_t *module; + + + /* Check if this module's mapping matches */ + if ((module = item->data)) + { + // FIXME - hacked module match + if (!strcmp(module->name,"localdisk")) + { + /* Check for error during malloc */ + if (!(diof = malloc(sizeof(struct dioFile_t)))) + { + D_PRINT(D_ERROR,"Failed to allocate memory"); + return D_ERROR; + } + + /* Setup our own file handle */ + diof->context = context; // context passed to callback function + diof->callback = callback; // callback function + diof->err = 0; // system error - errno + diof->moduleData = NULL; // module internal data - not for us to change + diof->cmdStruct = (void *) module->cmdStruct; // List of module commands + + /* Check if backend handler support open */ + if (((struct dioCmds_t *) module->cmdStruct)->dio_open) + { + int res; + + + /* Get result and check if all is ok */ + if ((res = ((struct dioCmds_t *) module->cmdStruct)->dio_open(diof,filename,flags)) != 0) + { + D_PRINT(D_ERROR,"Error returned from backend"); + goto end; + } + + return D_OK; + } + else + { + D_PRINT(D_ERROR,"Backend IO handler does not support dio_open()"); + goto end; + } + } + } + + item = g_list_next(item); + } + +end: + if (diof) + free(diof); + + return D_ERROR; +} + + +/* Abstraction layer read function */ +int dio_read(struct dioFile_t *file, void *buf, size_t count, DISKIO_CALLBACK_FUNC) +{ +} + + +/* Abstraction layer write function */ +int dio_write(struct dioFile_t *file, const void *buf, size_t count, DISKIO_CALLBACK_FUNC) +{ +} + + +/* Abstraction layer close function */ +int dio_close(struct dioFile_t *file, DISKIO_CALLBACK_FUNC) +{ +} + + +/* Get system response code, if one */ +inline int dio_getErrno(struct dioFile_t *file) +{ + return file->err; +} + + +/* Set system response code */ +inline void dio_setErrno(struct dioFile_t *file, int err) +{ + file->err = err; +} + + +/* Get private data */ +inline void *dio_getContext(struct dioFile_t *file) +{ + return file->context; +} + + + +// vim: ts=4 Added: branches/nonblocking_io/modules/engines/diskIO/diskio.h =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/diskio.h 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/engines/diskIO/diskio.h 2005-05-09 13:14:36 UTC (rev 105) @@ -0,0 +1,86 @@ +/* + * diskio.h - Disk IO Abstraction Layer Header File + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * 05/05/2005 - Nigel Kukard <nk...@lb...> + * * Initial design + * +*/ + + +#ifndef _DISKIO_H +#define _DISKIO_H + +#include <sys/types.h> + + +/* + * Res is passed back from the disk io engine, this is D_* style responses + * The system error code can be retrieved using dio_getErrno() + */ +#define DISKIO_CALLBACK_FUNC void (* callback) (struct dioFile_t *file, int res) + + +/* File handle used by the disk IO stuff */ +struct dioFile_t +{ + /* User stuff */ + void *context; // Extra data passed to callback function + /* Internal stuff */ + DISKIO_CALLBACK_FUNC; + int err; // This will be set to errno if the system encountered an error + /* Module data */ + void *cmdStruct; + void *moduleData; +}; + + +/* Disk IO commands modules must implement */ +struct dioCmds_t +{ + int (* dio_open) (struct dioFile_t *file, char *filename, int flags); + int (* dio_read) (struct dioFile_t *file, void *buf, size_t count); + int (* dio_write) (struct dioFile_t *file, const void *buf, size_t count); + int (* dio_close) (struct dioFile_t *file); +}; + + + +/* Abstraction layer open function */ +int dio_open(void *context, char *filename, int flags, DISKIO_CALLBACK_FUNC); + +/* Abstraction layer read function */ +int dio_read(struct dioFile_t *file, void *buf, size_t count, DISKIO_CALLBACK_FUNC); + +/* Abstraction layer write function */ +int dio_write(struct dioFile_t *file, const void *buf, size_t count, DISKIO_CALLBACK_FUNC); + +/* Abstraction layer close function */ +int dio_close(struct dioFile_t *file, DISKIO_CALLBACK_FUNC); + +/* Set system response code */ +inline void dio_setErrno(struct dioFile_t *file, int err); + + /* Get system response code, if one */ +inline int dio_getErrno(struct dioFile_t *file); + +/* Get private data */ +inline void *dio_getContext(struct dioFile_t *file); + + +#endif + Modified: branches/nonblocking_io/modules/engines/diskIO/localdisk/localdisk.c =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/localdisk/localdisk.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/engines/diskIO/localdisk/localdisk.c 2005-05-09 13:14:36 UTC (rev 105) @@ -134,9 +134,10 @@ /* Abstraction layer open function */ -static struct dioFile_t* localdisk_open(void *context, char *filename, int flags) +static int localdisk_open(struct dioFile_t *file, char *filename, int flags) { - D_PRINT(D_DEBUG,"localdisk.c: open"); + D_PRINT(D_DEBUG,"localdisk.c: open %s",filename); + return D_OK; } Modified: branches/nonblocking_io/modules/protocols/imap4/imap4.c =================================================================== --- branches/nonblocking_io/modules/protocols/imap4/imap4.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/protocols/imap4/imap4.c 2005-05-09 13:14:36 UTC (rev 105) @@ -24,7 +24,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include "auth.h" #include "debug.h" #include "misc.h" #include "mailstore.h" Modified: branches/nonblocking_io/modules/protocols/imap4/imap4_cmd_login.c =================================================================== --- branches/nonblocking_io/modules/protocols/imap4/imap4_cmd_login.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/protocols/imap4/imap4_cmd_login.c 2005-05-09 13:14:36 UTC (rev 105) @@ -26,7 +26,7 @@ #include "debug.h" #include "imap4_cmds.h" #include "misc.h" -#include "auth.h" +#include "../../auth/auth.h" #include "socklib.h" Modified: branches/nonblocking_io/modules/protocols/pop3/pop3.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3.c 2005-05-09 11:12:00 UTC (rev 104) +++ branches/nonblocking_io/modules/protocols/pop3/pop3.c 2005-05-09 13:14:36 UTC (rev 105) @@ -31,7 +31,6 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include "auth.h" #include "debug.h" #include "misc.h" #include "mailstore.h" Modified: branches/nonblocking_io/modules/protocols/pop3/pop3_cmd_pass.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop... [truncated message content] |
From: <sv...@li...> - 2005-05-09 11:12:37
|
Author: nkukard Date: 2005-05-09 11:12:00 +0000 (Mon, 09 May 2005) New Revision: 104 Modified: branches/nonblocking_io/lib/modules.c Log: * Added function to return diskio module list * Added caution note Modified: branches/nonblocking_io/lib/modules.c =================================================================== --- branches/nonblocking_io/lib/modules.c 2005-05-09 10:30:50 UTC (rev 103) +++ branches/nonblocking_io/lib/modules.c 2005-05-09 11:12:00 UTC (rev 104) @@ -38,18 +38,34 @@ static GList *diskIOModuleList = NULL; -/* Return list of auth modules loaded, USE WITH CAUTION!!! */ + +/* C A U T I O N + * - These functions are meant to be used internally by idms-dbma + * - If you bugger up the module lists, expect chaos + */ + +/* Return list of auth modules loaded */ GList *get_auth_modules() { - return authModuleList; + return authModuleList; } -/* Return list of storage modules loaded, USE WITH CAUTION!!! */ +/* Return list of storage modules loaded */ GList *get_storage_modules() { - return storageModuleList; + return storageModuleList; } +/* Return list of storage modules loaded */ +GList *get_diskio_modules() +{ + return diskIOModuleList; +} + +/* E N D C A U T I O N */ + + + /* Function to load a .so driver */ struct module_t *load_module(char *filename) { @@ -106,4 +122,4 @@ return module; } - +// vim:ts=4 |
From: <sv...@li...> - 2005-05-09 10:33:05
|
Author: nkukard Date: 2005-05-09 10:30:50 +0000 (Mon, 09 May 2005) New Revision: 103 Added: branches/nonblocking_io/modules/engines/ branches/nonblocking_io/modules/engines/Makefile.am branches/nonblocking_io/modules/engines/Makefile.in branches/nonblocking_io/modules/engines/diskIO/ branches/nonblocking_io/modules/engines/diskIO/Makefile.am branches/nonblocking_io/modules/engines/diskIO/Makefile.in branches/nonblocking_io/modules/engines/diskIO/README branches/nonblocking_io/modules/engines/diskIO/localdisk/ branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.am branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.in branches/nonblocking_io/modules/engines/diskIO/localdisk/TODO branches/nonblocking_io/modules/engines/diskIO/localdisk/localdisk.c branches/nonblocking_io/modules/engines/networkIO/ branches/nonblocking_io/modules/engines/networkIO/c10k/ Modified: branches/nonblocking_io/configure branches/nonblocking_io/configure.ac branches/nonblocking_io/dbma/dbmra.c branches/nonblocking_io/doc/stamp-vti branches/nonblocking_io/doc/version.texi branches/nonblocking_io/include/modules.h branches/nonblocking_io/modules/Makefile.am branches/nonblocking_io/modules/Makefile.in branches/nonblocking_io/modules/auth/Makefile.in branches/nonblocking_io/modules/auth/pgsql/Makefile.in branches/nonblocking_io/modules/auth/pgsql/pgsql.c branches/nonblocking_io/modules/protocols/imap4/imap4.c branches/nonblocking_io/modules/protocols/pop3/pop3.c branches/nonblocking_io/modules/protocols/smtp/smtp.c branches/nonblocking_io/modules/storage/dbma/dbma.c Log: * Updates so far to disk io engine Modified: branches/nonblocking_io/configure =================================================================== --- branches/nonblocking_io/configure 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/configure 2005-05-09 10:30:50 UTC (rev 103) @@ -22824,7 +22824,7 @@ exit 1 fi - ac_config_files="$ac_config_files Makefile lib/Makefile dbma/Makefile doc/Makefile modules/Makefile modules/auth/Makefile modules/auth/pgsql/Makefile modules/protocols/Makefile modules/protocols/imap4/Makefile modules/protocols/pop3/Makefile modules/protocols/smtp/Makefile modules/storage/Makefile modules/storage/dbma/Makefile" + ac_config_files="$ac_config_files Makefile lib/Makefile dbma/Makefile doc/Makefile modules/Makefile modules/auth/Makefile modules/auth/pgsql/Makefile modules/protocols/Makefile modules/protocols/imap4/Makefile modules/protocols/pop3/Makefile modules/protocols/smtp/Makefile modules/storage/Makefile modules/storage/dbma/Makefile modules/engines/Makefile modules/engines/diskIO/Makefile modules/engines/diskIO/localdisk/Makefile" cat >confcache <<\_ACEOF @@ -23396,6 +23396,9 @@ "modules/protocols/smtp/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/protocols/smtp/Makefile" ;; "modules/storage/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/storage/Makefile" ;; "modules/storage/dbma/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/storage/dbma/Makefile" ;; + "modules/engines/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/Makefile" ;; + "modules/engines/diskIO/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/diskIO/Makefile" ;; + "modules/engines/diskIO/localdisk/Makefile" ) CONFIG_FILES="$CONFIG_FILES modules/engines/diskIO/localdisk/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 Modified: branches/nonblocking_io/configure.ac =================================================================== --- branches/nonblocking_io/configure.ac 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/configure.ac 2005-05-09 10:30:50 UTC (rev 103) @@ -95,6 +95,9 @@ modules/protocols/smtp/Makefile modules/storage/Makefile modules/storage/dbma/Makefile + modules/engines/Makefile + modules/engines/diskIO/Makefile + modules/engines/diskIO/localdisk/Makefile ]) AC_OUTPUT Modified: branches/nonblocking_io/dbma/dbmra.c =================================================================== --- branches/nonblocking_io/dbma/dbmra.c 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/dbma/dbmra.c 2005-05-09 10:30:50 UTC (rev 103) @@ -133,7 +133,7 @@ sockData->ipAddress = strdup("0.0.0.0"); // FIXME - Check if listen port is positive - sockData->listenPort = ((struct protoModule_t *) module->extraData)->listenPort; + sockData->listenPort = ((struct protoModule_t *) module->moduleData)->listenPort; sockData->boundFD = -1; /* This comes from socklib */ sockData->maxConnections = 32; // FIXME - Implement this sockData->protoCmds = (struct protoCmds_t *) module->cmdStruct; @@ -156,7 +156,7 @@ module = load_module("/tmp/idms-dbma/lib/idms-dbma/imap4.so"); sockData->ipAddress = strdup("0.0.0.0"); - sockData->listenPort = ((struct protoModule_t *) module->extraData)->listenPort; + sockData->listenPort = ((struct protoModule_t *) module->moduleData)->listenPort; sockData->boundFD = -1; /* This comes from socklib */ sockData->maxConnections = 32; // FIXME - Implement this sockData->protoCmds = (struct protoCmds_t *) module->cmdStruct; @@ -179,7 +179,7 @@ module = load_module("/tmp/idms-dbma/lib/idms-dbma/smtp.so"); sockData->ipAddress = strdup("0.0.0.0"); - sockData->listenPort = ((struct protoModule_t *) module->extraData)->listenPort; + sockData->listenPort = ((struct protoModule_t *) module->moduleData)->listenPort; sockData->boundFD = -1; /* This comes from socklib */ sockData->maxConnections = 32; // FIXME - Implement this sockData->protoCmds = (struct protoCmds_t *) module->cmdStruct; @@ -187,6 +187,7 @@ } load_module("/tmp/idms-dbma/lib/idms-dbma/dbma.so"); + load_module("/tmp/idms-dbma/lib/idms-dbma/localdisk.so"); // And start the server... become daemon if we have to Modified: branches/nonblocking_io/doc/stamp-vti =================================================================== --- branches/nonblocking_io/doc/stamp-vti 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/doc/stamp-vti 2005-05-09 10:30:50 UTC (rev 103) @@ -1,4 +1,4 @@ -@set UPDATED 4 April 2005 +@set UPDATED 21 April 2005 @set UPDATED-MONTH April 2005 @set EDITION 1.0.0 @set VERSION 1.0.0 Modified: branches/nonblocking_io/doc/version.texi =================================================================== --- branches/nonblocking_io/doc/version.texi 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/doc/version.texi 2005-05-09 10:30:50 UTC (rev 103) @@ -1,4 +1,4 @@ -@set UPDATED 4 April 2005 +@set UPDATED 21 April 2005 @set UPDATED-MONTH April 2005 @set EDITION 1.0.0 @set VERSION 1.0.0 Modified: branches/nonblocking_io/include/modules.h =================================================================== --- branches/nonblocking_io/include/modules.h 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/include/modules.h 2005-05-09 10:30:50 UTC (rev 103) @@ -45,6 +45,7 @@ /* Generic module type */ struct module_t { + char *name; unsigned int type; void *cmdStruct; void *moduleData; Modified: branches/nonblocking_io/modules/Makefile.am =================================================================== --- branches/nonblocking_io/modules/Makefile.am 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/Makefile.am 2005-05-09 10:30:50 UTC (rev 103) @@ -1 +1 @@ -SUBDIRS=auth protocols storage +SUBDIRS=auth protocols storage engines Modified: branches/nonblocking_io/modules/Makefile.in =================================================================== --- branches/nonblocking_io/modules/Makefile.in 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/Makefile.in 2005-05-09 10:30:50 UTC (rev 103) @@ -167,7 +167,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -SUBDIRS = auth protocols storage +SUBDIRS = auth protocols storage engines all: all-recursive .SUFFIXES: Modified: branches/nonblocking_io/modules/auth/Makefile.in =================================================================== --- branches/nonblocking_io/modules/auth/Makefile.in 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/auth/Makefile.in 2005-05-09 10:30:50 UTC (rev 103) @@ -36,7 +36,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = modules/auth -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac Modified: branches/nonblocking_io/modules/auth/pgsql/Makefile.in =================================================================== --- branches/nonblocking_io/modules/auth/pgsql/Makefile.in 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/auth/pgsql/Makefile.in 2005-05-09 10:30:50 UTC (rev 103) @@ -39,7 +39,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = modules/auth/pgsql -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac Modified: branches/nonblocking_io/modules/auth/pgsql/pgsql.c =================================================================== --- branches/nonblocking_io/modules/auth/pgsql/pgsql.c 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/auth/pgsql/pgsql.c 2005-05-09 10:30:50 UTC (rev 103) @@ -698,6 +698,7 @@ authThread = g_thread_create(&pgsql_auth_thread,NULL,FALSE,NULL); /* Setup module_t structure */ + myself->name = "pgsql"; myself->type = AUTH_MODULE; myself->cmdStruct = authCmds; /* Assign our authentication function */ Added: branches/nonblocking_io/modules/engines/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/Makefile.am 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/engines/Makefile.am 2005-05-09 10:30:50 UTC (rev 103) @@ -0,0 +1 @@ +SUBDIRS=diskIO Added: branches/nonblocking_io/modules/engines/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/Makefile.in 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/engines/Makefile.in 2005-05-09 10:30:50 UTC (rev 103) @@ -0,0 +1,469 @@ +# Makefile.in generated by automake 1.9.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = modules/engines +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = diskIO +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/engines/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/engines/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-libtool \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: branches/nonblocking_io/modules/engines/diskIO/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/Makefile.am 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/engines/diskIO/Makefile.am 2005-05-09 10:30:50 UTC (rev 103) @@ -0,0 +1,11 @@ +GLIB_LIBS=@GLIB_LIBS@ +GLIB_CFLAGS=@GLIB_CFLAGS@ + +SUBDIRS=localdisk + +module_LTLIBRARIES = diskio.la +diskio_la_SOURCES = diskio.c +diskio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +diskio_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version + + Added: branches/nonblocking_io/modules/engines/diskIO/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/Makefile.in 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/engines/diskIO/Makefile.in 2005-05-09 10:30:50 UTC (rev 103) @@ -0,0 +1,574 @@ +# Makefile.in generated by automake 1.9.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SOURCES = $(diskio_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = modules/engines/diskIO +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(moduledir)" +moduleLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(module_LTLIBRARIES) +diskio_la_LIBADD = +am_diskio_la_OBJECTS = diskio_la-diskio.lo +diskio_la_OBJECTS = $(am_diskio_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(diskio_la_SOURCES) +DIST_SOURCES = $(diskio_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = localdisk +module_LTLIBRARIES = diskio.la +diskio_la_SOURCES = diskio.c +diskio_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +diskio_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/engines/diskIO/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/engines/diskIO/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-moduleLTLIBRARIES: $(module_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(moduledir)" || $(mkdir_p) "$(DESTDIR)$(moduledir)" + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moduledir)/$$f'"; \ + $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moduledir)/$$f"; \ + else :; fi; \ + done + +uninstall-moduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(module_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$p"; \ + done + +clean-moduleLTLIBRARIES: + -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +diskio.la: $(diskio_la_OBJECTS) $(diskio_la_DEPENDENCIES) + $(LINK) -rpath $(moduledir) $(diskio_la_LDFLAGS) $(diskio_la_OBJECTS) $(diskio_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskio_la-diskio.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +diskio_la-diskio.lo: diskio.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskio_la_CFLAGS) $(CFLAGS) -MT diskio_la-diskio.lo -MD -MP -MF "$(DEPDIR)/diskio_la-diskio.Tpo" -c -o diskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/diskio_la-diskio.Tpo" "$(DEPDIR)/diskio_la-diskio.Plo"; else rm -f "$(DEPDIR)/diskio_la-diskio.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='diskio.c' object='diskio_la-diskio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskio_la_CFLAGS) $(CFLAGS) -c -o diskio_la-diskio.lo `test -f 'diskio.c' || echo '$(srcdir)/'`diskio.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(moduledir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-moduleLTLIBRARIES + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am uninstall-moduleLTLIBRARIES + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ + clean clean-generic clean-libtool clean-moduleLTLIBRARIES \ + clean-recursive ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-moduleLTLIBRARIES \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-moduleLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: Added: branches/nonblocking_io/modules/engines/diskIO/README =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/README 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/engines/diskIO/README 2005-05-09 10:30:50 UTC (rev 103) @@ -0,0 +1,34 @@ +Disk IO Engines Abstraction Layer +--------------------------------- + +Goals: +* To provide a means for handling different filesystems, both local and remotely in the best possible way +* Providing a means of abstraction so storage modules need not worry if IO is being done locally or remotely +* Interception of IO operations and redirection to the handling module + + +API Functions: + + +#define CALLBACK_FUNC void (callback *) (void *context, int res) + - Callback function wil lbe called back with the result of the IO operation + +struct dioFile_t* dio_open(void *context, char *filename, int flags) + - File will be opened by the backend in 64-bit, non-blocking mode + - Flags: O_CREAT, O_EXCL, O_TRUNC, O_APPEND + +int dio_read(struct dioFile_t *file, void *buf, size_t count, CALLBACK_FUNC) + - Returns 0, -1 if err, returns to CALLBACK_FUNC when operation complete + +int dio_write(struct dioFile_t *file, const void *buf, size_t count, CALLBACK_FUNC) + - Returns 0, -1 if err, returns to CALLBACK_FUNC when operation complete + +int dio_close(struct dioFile_t *file) + - Returns 0, -1 if err + + +Direct network <-> disk IO functions: + + + + Added: branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.am =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.am 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.am 2005-05-09 10:30:50 UTC (rev 103) @@ -0,0 +1,8 @@ +GLIB_LIBS=@GLIB_LIBS@ +GLIB_CFLAGS=@GLIB_CFLAGS@ + +module_LTLIBRARIES = localdisk.la +localdisk_la_SOURCES = localdisk.c +localdisk_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +localdisk_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version + Added: branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.in =================================================================== --- branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.in 2005-05-08 13:42:44 UTC (rev 102) +++ branches/nonblocking_io/modules/engines/diskIO/localdisk/Makefile.in 2005-05-09 10:30:50 UTC (rev 103) @@ -0,0 +1,474 @@ +# Makefile.in generated by automake 1.9.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +SOURCES = $(localdisk_la_SOURCES) + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../../.. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = modules/engines/diskIO/localdisk +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(moduledir)" +moduleLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(module_LTLIBRARIES) +localdisk_la_LIBADD = +am_localdisk_la_OBJECTS = localdisk_la-localdisk.lo +localdisk_la_OBJECTS = $(am_localdisk_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(localdisk_la_SOURCES) +DIST_SOURCES = $(localdisk_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML2_CONFIG = @XML2_CONFIG@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +module_LTLIBRARIES = localdisk.la +localdisk_la_SOURCES = localdisk.c +localdisk_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) +localdisk_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu modules/engines/diskIO/localdisk/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu modules/engines/diskIO/localdisk/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-moduleLTLIBRARIES: $(module_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(moduledir)" || $(mkdir_p) "$(DESTDIR)$(moduledir)" + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(moduledir)/$$f'"; \ + $(LIBTOOL) --mode=install $(moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(moduledir)/$$f"; \ + else :; fi; \ + done + +uninstall-moduleLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @set -x; list='$(module_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$p"; \ + done + +clean-moduleLTLIBRARIES: + -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) + @list='$(module_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +localdisk.la: $(localdisk_la_OBJECTS) $(localdisk_la_DEPENDENCIES) + $(LINK) -rpath $(moduledir) $(localdisk_la_LDFLAGS) $(localdisk_la_OBJECTS) $(localdisk_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localdisk_la-localdisk.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +localdisk_la-localdisk.lo: localdisk.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(localdisk_la_CFLAGS) $(CFLAGS) -MT localdisk_la-localdisk.lo -MD -MP -MF "$(DEPDIR)/localdisk_la-localdisk.Tpo" -c -o localdisk_la-localdisk.lo `test -f 'localdisk.c' || echo '$(srcdir)/'`localdisk.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/localdisk_la-localdisk.Tpo" "$(DEPDIR)/localdisk_la-localdisk.Plo"; else rm -f "$(DEPDIR)/localdisk_la-localdisk.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='localdisk.c' object='localdisk_la-localdisk.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(localdisk_la_CFLAGS) $(CFLAGS) -c -o localdisk_la-localdisk.lo `test -f 'localdisk.c' || echo '$(srcdir)/'`localdisk.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)';... [truncated message content] |
From: <sv...@li...> - 2005-05-08 16:00:59
|
Author: nkukard Date: 2005-05-08 13:42:44 +0000 (Sun, 08 May 2005) New Revision: 102 Modified: trunk/include/modules.h trunk/modules/auth/pgsql/pgsql.c trunk/modules/protocols/imap4/imap4.c trunk/modules/protocols/pop3/pop3.c trunk/modules/protocols/smtp/smtp.c trunk/modules/storage/dbma/dbma.c Log: * Added module->name field Modified: trunk/include/modules.h =================================================================== --- trunk/include/modules.h 2005-05-05 10:17:58 UTC (rev 101) +++ trunk/include/modules.h 2005-05-08 13:42:44 UTC (rev 102) @@ -44,6 +44,7 @@ /* Generic module type */ struct module_t { + char *name; unsigned int type; void *cmdStruct; void *extraData; Modified: trunk/modules/auth/pgsql/pgsql.c =================================================================== --- trunk/modules/auth/pgsql/pgsql.c 2005-05-05 10:17:58 UTC (rev 101) +++ trunk/modules/auth/pgsql/pgsql.c 2005-05-08 13:42:44 UTC (rev 102) @@ -52,6 +52,7 @@ authCmds = malloc(sizeof(struct authCmds_t)); + myself->name = "pgsql"; myself->type = AUTH_MODULE; myself->cmdStruct = authCmds; Modified: trunk/modules/protocols/imap4/imap4.c =================================================================== --- trunk/modules/protocols/imap4/imap4.c 2005-05-05 10:17:58 UTC (rev 101) +++ trunk/modules/protocols/imap4/imap4.c 2005-05-08 13:42:44 UTC (rev 102) @@ -373,6 +373,7 @@ protoModule = malloc(sizeof(struct protoModule_t)); myself->type = PROTOCOL_MODULE; + myself->name = "imap4"; myself->cmdStruct = protoCmds; myself->extraData = protoModule; Modified: trunk/modules/protocols/pop3/pop3.c =================================================================== --- trunk/modules/protocols/pop3/pop3.c 2005-05-05 10:17:58 UTC (rev 101) +++ trunk/modules/protocols/pop3/pop3.c 2005-05-08 13:42:44 UTC (rev 102) @@ -345,6 +345,7 @@ protoModule = malloc(sizeof(struct protoModule_t)); myself->type = PROTOCOL_MODULE; + myself->name = "pop3"; myself->cmdStruct = protoCmds; myself->extraData = protoModule; Modified: trunk/modules/protocols/smtp/smtp.c =================================================================== --- trunk/modules/protocols/smtp/smtp.c 2005-05-05 10:17:58 UTC (rev 101) +++ trunk/modules/protocols/smtp/smtp.c 2005-05-08 13:42:44 UTC (rev 102) @@ -401,6 +401,7 @@ protoModule = malloc(sizeof(struct protoModule_t)); myself->type = PROTOCOL_MODULE; + myself->name = "smtp"; myself->cmdStruct = protoCmds; myself->extraData = protoModule; Modified: trunk/modules/storage/dbma/dbma.c =================================================================== --- trunk/modules/storage/dbma/dbma.c 2005-05-05 10:17:58 UTC (rev 101) +++ trunk/modules/storage/dbma/dbma.c 2005-05-08 13:42:44 UTC (rev 102) @@ -1245,6 +1245,7 @@ myself->type = STORAGE_MODULE; + myself->name = "dbma"; myself->cmdStruct = storageCmds; storageCmds->canOpen = dbma_can_open; |
From: <sv...@li...> - 2005-05-05 10:18:55
|
Author: nkukard Date: 2005-05-05 10:17:58 +0000 (Thu, 05 May 2005) New Revision: 101 Modified: branches/nonblocking_io/include/modules.h branches/nonblocking_io/lib/modules.c branches/nonblocking_io/modules/protocols/imap4/imap4.c branches/nonblocking_io/modules/protocols/pop3/pop3.c branches/nonblocking_io/modules/protocols/smtp/smtp.c Log: * Minor changes in some naming in modules Modified: branches/nonblocking_io/include/modules.h =================================================================== --- branches/nonblocking_io/include/modules.h 2005-04-28 18:07:52 UTC (rev 100) +++ branches/nonblocking_io/include/modules.h 2005-05-05 10:17:58 UTC (rev 101) @@ -38,6 +38,7 @@ #define PROTOCOL_MODULE 1 #define AUTH_MODULE 2 #define STORAGE_MODULE 3 +#define DISKIO_MODULE 4 @@ -46,15 +47,16 @@ { unsigned int type; void *cmdStruct; - void *extraData; + void *moduleData; }; +/* Protocol module stuff */ struct protoModule_t { unsigned short int listenPort; }; -/* Protocol driver type */ +/* Protocol handling functions */ struct protoCmds_t { int (*startup) (struct clientConnection_t *connection); Modified: branches/nonblocking_io/lib/modules.c =================================================================== --- branches/nonblocking_io/lib/modules.c 2005-04-28 18:07:52 UTC (rev 100) +++ branches/nonblocking_io/lib/modules.c 2005-05-05 10:17:58 UTC (rev 101) @@ -1,6 +1,6 @@ /* * modules.c - IDMS DBMA Module handling - * Copyright (C) 2002-2004, Linux Based Systems Design + * Copyright (C) 2002-2005, Linux Based Systems Design * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ static GList *storageModuleList = NULL; static GList *protoModuleList = NULL; static GList *authModuleList = NULL; +static GList *diskIOModuleList = NULL; /* Return list of auth modules loaded, USE WITH CAUTION!!! */ @@ -54,9 +55,10 @@ { void *dlHandle; struct module_t *(*module_init)(); - struct module_t *moduleData; + struct module_t *module; char *error; + /* Open .so & check */ //dlHandle = dlopen(filename,RTLD_LAZY); dlHandle = dlopen(filename,RTLD_NOW); @@ -74,31 +76,34 @@ } /* Inialize driver */ - if (!(moduleData = module_init())) + if (!(module = module_init())) { d_printf(D_FATAL,"load_module()","Cannot initalize driver"); return NULL; } /* Decide what module we are and add it to that list */ - switch (moduleData->type) + switch (module->type) { case PROTOCOL_MODULE: - protoModuleList = g_list_append(protoModuleList,moduleData); + protoModuleList = g_list_append(protoModuleList,module); break; case AUTH_MODULE: - authModuleList = g_list_append(authModuleList,moduleData); + authModuleList = g_list_append(authModuleList,module); break; case STORAGE_MODULE: - storageModuleList = g_list_append(storageModuleList,moduleData); + storageModuleList = g_list_append(storageModuleList,module); break; + case DISKIO_MODULE: + diskIOModuleList = g_list_append(diskIOModuleList,module); + break; default: d_printf(D_NOTICE,"load_module()","Module type not recognized"); break; } /* Return module */ - return moduleData; + return module; } Modified: branches/nonblocking_io/modules/protocols/imap4/imap4.c =================================================================== --- branches/nonblocking_io/modules/protocols/imap4/imap4.c 2005-04-28 18:07:52 UTC (rev 100) +++ branches/nonblocking_io/modules/protocols/imap4/imap4.c 2005-05-05 10:17:58 UTC (rev 101) @@ -374,7 +374,7 @@ myself->type = PROTOCOL_MODULE; myself->cmdStruct = protoCmds; - myself->extraData = protoModule; + myself->moduleData = protoModule; protoCmds->startup = imap4_startup; protoCmds->handler = imap4_handler; Modified: branches/nonblocking_io/modules/protocols/pop3/pop3.c =================================================================== --- branches/nonblocking_io/modules/protocols/pop3/pop3.c 2005-04-28 18:07:52 UTC (rev 100) +++ branches/nonblocking_io/modules/protocols/pop3/pop3.c 2005-05-05 10:17:58 UTC (rev 101) @@ -346,7 +346,7 @@ myself->type = PROTOCOL_MODULE; myself->cmdStruct = protoCmds; - myself->extraData = protoModule; + myself->moduleData = protoModule; protoCmds->startup = pop3_startup; protoCmds->handler = pop3_handler; Modified: branches/nonblocking_io/modules/protocols/smtp/smtp.c =================================================================== --- branches/nonblocking_io/modules/protocols/smtp/smtp.c 2005-04-28 18:07:52 UTC (rev 100) +++ branches/nonblocking_io/modules/protocols/smtp/smtp.c 2005-05-05 10:17:58 UTC (rev 101) @@ -402,7 +402,7 @@ myself->type = PROTOCOL_MODULE; myself->cmdStruct = protoCmds; - myself->extraData = protoModule; + myself->moduleData = protoModule; protoCmds->startup = smtp_startup; protoCmds->handler = smtp_handler; |
From: <sv...@li...> - 2005-04-28 18:08:24
|
Author: nkukard Date: 2005-04-28 18:07:52 +0000 (Thu, 28 Apr 2005) New Revision: 100 Modified: trunk/lib/socklib.c Log: * Fixup of functions by Anand Chugh <ana...@ya...> * Modified debug functions to call macro * Fixed buffer size to use constant instead of hard coded value Modified: trunk/lib/socklib.c =================================================================== --- trunk/lib/socklib.c 2005-04-21 12:45:25 UTC (rev 99) +++ trunk/lib/socklib.c 2005-04-28 18:07:52 UTC (rev 100) @@ -1,6 +1,6 @@ /* * socklib.c - Socket handling functions - * Copyright (C) 2002-2004, Linux Based Systems Design + * Copyright (C) 2002-2005, Linux Based Systems Design * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,28 +51,9 @@ -/* Initialize socket address */ -static int init_sockaddr(struct sockaddr_in *sin, const char *hostname, unsigned short int port) -{ - struct hostent* hostinfo; - sin->sin_family = AF_INET; - sin->sin_port = htons(port); - hostinfo = gethostbyname(hostname); - - if (!hostinfo) - { - d_printf(D_FATAL,__FUNCTION__,"Unknown host %s",hostname); - return D_FATAL; - } - sin->sin_addr = *(struct in_addr*) hostinfo->h_addr; - - return D_OK; -} - - /* FIXME - per thread data */ static GList *connectionList = NULL; fd_set outputFDs; @@ -200,7 +181,8 @@ { fd_set tmp_wfds; fd_set tmp_rfds; - + + /* Restore our params... */ tmp_wfds = outputFDs; tmp_rfds = inputFDs; @@ -274,7 +256,7 @@ /* Check if we were triggered to reload the fd's */ if (FD_ISSET(workerPipe[0],&tmp_rfds)) { - read(workerPipe[0],&tmpBuf,4096); + read(workerPipe[0],&tmpBuf,SOCK_IO_BUF_LEN); fprintf(stderr,"Triggered reload\n"); break; } @@ -440,6 +422,8 @@ } } /* if (timeout) */ } /* if (item->data) */ + else + D_PRINT(D_ERROR,"item->data is NULL"); item = g_list_next(item); } @@ -451,39 +435,8 @@ } -/* Create a socket */ -static int make_socket(struct sockaddr_in sin) -{ - int sock; - int one = 1; - int result; - // Create the socket - sock = socket(PF_INET,SOCK_STREAM,0); - if (sock < 0) - { - d_printf(D_FATAL,"make_socket()",strerror(errno)); - return D_FATAL; - } - // Set a few thingies... - result = setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&one,sizeof(one)); - if (result < 0) - { - d_printf(D_FATAL,"make_socket()","Failed to set SO_REUSEADDR"); - return D_FATAL; - } - // Bind - if (bind(sock,(struct sockaddr*)&sin,(socklen_t) sizeof(sin))<0) - { - d_printf(D_FATAL,"make_socket()",sys_errlist[errno]); - return D_FATAL; - } - // And return - return(sock); -} - - /* Function to create a connection that will be passed down to the protocol handler */ static struct clientConnection_t* createConnection(struct sockData_t *sockData, int sockfd, char* remoteHost) { @@ -494,7 +447,7 @@ aClient = (struct clientConnection_t*) malloc0(sizeof(struct clientConnection_t)); if (aClient == NULL) { - d_printf(D_FATAL,"createConnection()","Failed to allocate memory for aClient"); + D_PRINT(D_FATAL,"Failed to allocate memory for aClient"); return NULL; } @@ -669,6 +622,8 @@ struct timeval tv, tmp_tv; GList* item; GThread *thread1; + int optVal = 1; + int sock; @@ -685,34 +640,59 @@ // Check we have our data... if (!(sockData = item->data)) { - d_printf(D_FATAL,"server_init()","No socket data specified"); + D_PRINT(D_FATAL,"No socket data specified"); return D_FATAL; } - d_printf(D_FATAL,"server_init()","IP Addr: %s, Port: %i, Cons: %i", + D_PRINT(D_FATAL,"IP Addr: %s, Port: %i, Cons: %i", sockData->ipAddress, sockData->listenPort, sockData->maxConnections); /* Initialize socket address */ - if (init_sockaddr(&myaddr,sockData->ipAddress,sockData->listenPort) == D_FATAL) + struct hostent* hostinfo; + myaddr.sin_family = AF_INET; + myaddr.sin_port = htons(sockData->listenPort); + hostinfo = gethostbyname(sockData->ipAddress); + if (!hostinfo) { - d_printf(D_FATAL,"server_init()","Failed to initialize socket address"); + D_PRINT(D_FATAL,"Unknown host %s",sockData->ipAddress); return D_FATAL; } - + myaddr.sin_addr = *(struct in_addr*) hostinfo->h_addr; + /* Create socket... */ - sockData->boundFD = make_socket(myaddr); + + // Create the socket + if ((sock=socket(PF_INET,SOCK_STREAM,0))< 0) + { + D_PRINT(D_FATAL,strerror(errno)); + return D_FATAL; + } + // Set socket options + if (setsockopt(sock,SOL_SOCKET,SO_REUSEADDR,&optVal,sizeof(optVal)) < 0) + { + D_PRINT(D_FATAL,"Failed to set SO_REUSEADDR"); + return D_FATAL; + } + // Bind + if (bind(sock,(struct sockaddr*)&myaddr,(socklen_t) sizeof(myaddr))<0) + { + D_PRINT(D_FATAL,"Error binding: %s",sys_errlist[errno]); + return D_FATAL; + } + + sockData->boundFD = sock; if (sockData->boundFD == D_FATAL) { - d_printf(D_FATAL,"server_init()","Failed to create socket"); + D_PRINT(D_FATAL,"Failed to create socket"); return D_FATAL; } /* Listen for connections */ if (listen(sockData->boundFD,SOMAXCONN) == -1) { - d_printf(D_FATAL,"server_init()","Failed to listen on boundFD: %s",strerror(errno)); + D_PRINT(D_FATAL,"Failed to listen on boundFD: %s",strerror(errno)); return D_FATAL; } @@ -744,10 +724,10 @@ { case -1: // if (errno == EINTR) -// d_printf(D_DEBUG,"server_init()","Child died"); +// D_PRINT(D_DEBUG,"Child died"); // ; // else - d_printf(D_NOTICE,__FUNCTION__,"select() returned error: %s",strerror(errno)); + D_PRINT(D_NOTICE,"select() returned error: %s",strerror(errno)); break; case 0: /* Select did nothing, hit the timeout */ @@ -761,7 +741,7 @@ /* Check if there is actually data we can use */ if (!(sockData = item->data)) { - d_printf(D_FATAL,__FUNCTION__,"sockData cannot be null\n"); + D_PRINT(D_FATAL,"sockData cannot be null\n"); return D_FATAL; } @@ -780,14 +760,14 @@ remoteHost = strdup(inet_ntoa(clientAddr.sin_addr)); if (!remoteHost) { - d_printf(D_FATAL,__FUNCTION__,"Failed to allocate memory for remoteHost"); + D_PRINT(D_FATAL,"Failed to allocate memory for remoteHost"); return D_FATAL; } /* Setup the client connection */ clientConnection = createConnection(sockData,newfd,remoteHost); if (clientConnection == NULL) { - d_printf(D_FATAL,__FUNCTION__,"Failed to create client connection"); + D_PRINT(D_FATAL,"Failed to create client connection"); return D_FATAL; } /* Pass connection onto worker threads */ @@ -802,3 +782,4 @@ } } +// vim: ts=4 |
From: anand c. <ana...@gm...> - 2005-04-26 11:53:19
|
Hi I am still working on socklib.c , it will require few days more(hopefully 2-3 days) . Still have some quries,will contat u on messenger.. Anand On 4/26/05, Nigel Kukard <nk...@lb...> wrote: > Hi Guys, >=20 > I propose the following changes to achieve our goals... >=20 > Goals: > 1. Our server package must beable to use the networking technologies, > select(), poll(), epoll() ... etc > 2. Our server package must also beable to use either pre-forking, > threading or the current c10k design > 3. Our server package must beable to use both local disk and NFS to > store and retrieve data, remembering an open() on NFS CAN block no > matter what >=20 > Changes to be made for the above points: > 1. The only way we can implement different notificatoin systems is to > have an abstraction API. > 2. Different connection handling technologies will be implemented as > different modules, also with an abstraction API. This will allow us to > support the best means of handling notifications under systems like bsd, > solaris, linux ... etc. > 3. Handling disk IO will be done the same, an abstraction API and > modules... this will allow us to intercept all NFS disk IO to a specific > path location and direct it to the module which can handle it in a sane w= ay. >=20 > None of the above points have to be implemented anytime soon, I'm going > to start work on implementing the diskIO engine which will handle local > disk IO and the abstraction layer therefore. The location of this will > be in modules/diskIO/localdisk/. The abastraction layer will be created > in modules/diskIO/. >=20 > Anand, when you finished with socklib.c we must speak about moving that > thread function I told you about into modules/networkIO/c10k... don't > worry about it now. This will allow us to keep only socket related stuff > in socklib.c. >=20 > If anyone has any suggestions, plz let me know. >=20 > -Nigel >=20 > -- > Nigel Kukard, PhD CompSc > (Chief Executive Officer) > Linux Based Systems Design > Web: www.lbsd.net Email: nk...@lb... > Tel: (+27) 023 349 8000 Cell: (+27) 082 333 3723 > Fax: (+27) 023 349 1395 Support: 086 747 7600 > Address: LIGT House, 2 Klipdrift Rd, Rawsonville > Linux Systems Design & Technology Solutions >=20 > The best language to use is the language that was designed for > what you want to use it for. >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Disclaimer > ---------- > The contents of this message and any attachments are intended > solely for the addressee's use and may be legally privileged and/or > confidential information. This message may not be retained, > distributed, copied or used if you are not he addressee of this > message. If this message was sent to you in error, please notify > the sender immediately by reply e-mail and then destroy the message > and any copies thereof. >=20 > Opinions, conclusions and other information in this message may be > personal to the sender and is not that of Linux Based Systems Design, > LinuxRulz or any of it's subsideries, associated companies or > principals and is therefore not endorsed by Linux Based Systems > Design or LinuxRulz. Due to e-maill communication being insecure, > Linux Based Systems Design and LinuxRulz do not guarantee > confidentiality, security, accuracy or performance of the e-mail. > Any liability for viruses is excluded to the fullest extent. >=20 >=20 > |
From: Nigel K. <nk...@lb...> - 2005-04-26 06:57:51
|
Hi Guys, I propose the following changes to achieve our goals... Goals: 1. Our server package must beable to use the networking technologies, select(), poll(), epoll() ... etc 2. Our server package must also beable to use either pre-forking, threading or the current c10k design 3. Our server package must beable to use both local disk and NFS to store and retrieve data, remembering an open() on NFS CAN block no matter what Changes to be made for the above points: 1. The only way we can implement different notificatoin systems is to have an abstraction API. 2. Different connection handling technologies will be implemented as different modules, also with an abstraction API. This will allow us to support the best means of handling notifications under systems like bsd, solaris, linux ... etc. 3. Handling disk IO will be done the same, an abstraction API and modules... this will allow us to intercept all NFS disk IO to a specific path location and direct it to the module which can handle it in a sane way. None of the above points have to be implemented anytime soon, I'm going to start work on implementing the diskIO engine which will handle local disk IO and the abstraction layer therefore. The location of this will be in modules/diskIO/localdisk/. The abastraction layer will be created in modules/diskIO/. Anand, when you finished with socklib.c we must speak about moving that thread function I told you about into modules/networkIO/c10k... don't worry about it now. This will allow us to keep only socket related stuff in socklib.c. If anyone has any suggestions, plz let me know. -Nigel -- Nigel Kukard, PhD CompSc (Chief Executive Officer) Linux Based Systems Design Web: www.lbsd.net Email: nk...@lb... Tel: (+27) 023 349 8000 Cell: (+27) 082 333 3723 Fax: (+27) 023 349 1395 Support: 086 747 7600 Address: LIGT House, 2 Klipdrift Rd, Rawsonville Linux Systems Design & Technology Solutions The best language to use is the language that was designed for what you want to use it for. ===================================================================== Disclaimer ---------- The contents of this message and any attachments are intended solely for the addressee's use and may be legally privileged and/or confidential information. This message may not be retained, distributed, copied or used if you are not he addressee of this message. If this message was sent to you in error, please notify the sender immediately by reply e-mail and then destroy the message and any copies thereof. Opinions, conclusions and other information in this message may be personal to the sender and is not that of Linux Based Systems Design, LinuxRulz or any of it's subsideries, associated companies or principals and is therefore not endorsed by Linux Based Systems Design or LinuxRulz. Due to e-maill communication being insecure, Linux Based Systems Design and LinuxRulz do not guarantee confidentiality, security, accuracy or performance of the e-mail. Any liability for viruses is excluded to the fullest extent. |
From: <sv...@li...> - 2005-04-21 12:45:55
|
Author: nkukard Date: 2005-04-21 12:45:25 +0000 (Thu, 21 Apr 2005) New Revision: 99 Added: branches/nonblocking_io/ Log: * Copy over nonblocking_auth tree to nonblocking_io, this will allow the development of the nonblocking IO engine Copied: branches/nonblocking_io (from rev 98, branches/nonblocking_auth) |
From: <sv...@li...> - 2005-04-21 12:22:30
|
Author: nkukard Date: 2005-04-21 12:21:58 +0000 (Thu, 21 Apr 2005) New Revision: 98 Modified: branches/nonblocking_auth/modules/auth/pgsql/pgsql.c branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c Log: * Intermediate check-in of non-blocking authentication Modified: branches/nonblocking_auth/modules/auth/pgsql/pgsql.c =================================================================== --- branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-21 12:06:17 UTC (rev 97) +++ branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-21 12:21:58 UTC (rev 98) @@ -221,6 +221,178 @@ +/* Process database results & try authenticate, return 0 on pass, 1 on success, 2 on failure, and -1 on error*/ +static int authAgainstDB(struct dbConnection_t *dbConn, PGresult *pgres) +{ + ExecStatusType pgresStatus; + int usernameCol = -1, passwordCol = -1, mailstoreCol = -1, realmCol = -1, quotaCol = -1, activeCol = -1; + int numResults = -1; + int i; + int actives = 0; + + + /* Check we got the right response */ + if ((pgresStatus = PQresultStatus(pgres)) != PGRES_TUPLES_OK) + { + D_PRINT(D_ERROR,"Database error occured: %s",PQresultErrorMessage(pgres)); + return -1; + } + + /* Verify data returned from query */ + numResults = PQntuples(pgres); + + /* If we have no results just return 0 */ + if (numResults < 1) + return 0; + + D_PRINT(D_NOTICE,"We got %i results back", numResults); + + /* Check that we have the columns we need */ + if ((usernameCol = PQfnumber(pgres,"username")) < 0) + { + D_PRINT(D_ERROR,"No username column returned from database query"); + return -1; + } + + if ((passwordCol = PQfnumber(pgres,"password")) < 0) + { + D_PRINT(D_ERROR,"No password column returned from database query"); + return -1; + } + + if ((mailstoreCol = PQfnumber(pgres,"mailstore")) < 0) + { + D_PRINT(D_ERROR,"No mailstore column returned from database query"); + return -1; + } + + if ((realmCol = PQfnumber(pgres,"realm")) < 0) + D_PRINT(D_NOTICE,"No realm column returned from database query, ignoring realm"); + + if ((quotaCol = PQfnumber(pgres,"quota")) < 0) + D_PRINT(D_NOTICE,"No quota column returned from database query, ignoring quota"); + + if ((activeCol = PQfnumber(pgres,"active")) < 0) + D_PRINT(D_NOTICE,"No active column returned from database query, assuming all active"); + + /* + * Loop with results, it could be someone else had an email address, was cancelled and someone else + * signed up in this case we must take first one that authenticates, verify that only 1 active + * address exists + */ + for (i = 0; i < numResults; i++) + { + char *username = NULL, *password = NULL, *mailstore = NULL; + char *realm = NULL; + + + /* First of all check if this entry is active, ignore it otherwise */ + if (activeCol >= 0) + { + char *active = NULL; + + + active = PQgetvalue(pgres,i,activeCol); + /* If entry is not active, continue to find one that is */ + if (strcmp(active,"true") != 0) + { + D_PRINT(D_NOTICE,"User \"%s\" on realm \"%s\" is deactivated, ignoring", + dbConn->authInfo->username, dbConn->authInfo->realm); + continue; + } + } + + /* Pull out username, and make sure everything matches */ + username = PQgetvalue(pgres,i,usernameCol); + if (strcmp(username,dbConn->authInfo->username) != 0) + { + D_PRINT(D_ERROR,"Returned username result \"%s\" does not match authentication username \"%s\", ignoring", + username,dbConn->authInfo->username); + continue; + } + + /* We are obviously active... if we got this far */ + actives++; + + /* Only 1 address can match and be active */ + if (actives > 1) + { + D_PRINT(D_ERROR,"Too many active usernames which match \"%s\", ignoring results",dbConn->authInfo->username); + continue; + } + + /* Pull out password & check if it actually contains something */ + password = PQgetvalue(pgres,i,passwordCol); + if (strlen(password) == 0) + { + D_PRINT(D_ERROR,"Zero length password returned, ignoring"); + continue; + } + + /* Pull out mailstore and check if it also contains something */ + mailstore = PQgetvalue(pgres,i,mailstoreCol); + if (strlen(mailstore) == 0) + { + D_PRINT(D_ERROR,"Zero length mailstore returned, ignoring"); + continue; + } + + /* Check if we have a realm column */ + if (realmCol >= 0) + { + + /* Get result from database if we do */ + realm = PQgetvalue(pgres,i,realmCol); + /* If we were provided a realm for authenticating, verify we have the right data */ + if (dbConn->authInfo->realm) + { + /* Compare and throw us an error if realms don't match */ + if (strcmp(realm,dbConn->authInfo->realm) != 0) + { + D_PRINT(D_ERROR,"Returned realm result \"%s\" does not match authentication realm \"%s\", ignoring", + realm,dbConn->authInfo->realm); + continue; + } + } + } + + /* Check if we have a quota column */ + if (quotaCol >= 0) + { + unsigned int quotaVal; + char *quota; + + + /* Get string representation from database */ + quota = PQgetvalue(pgres,i,quotaCol); + /* Convert to long int which is compat with unsigned int */ + quotaVal = atol(quota); + } + + /* Finally verify password */ + if (strcmp(password,dbConn->authInfo->password) == 0) + { + /* Set mailstore */ + dbConn->authInfo->mailstore = mailstore; + + /* Set realm if it was not set but returned */ + if (realm && !dbConn->authInfo->realm) + dbConn->authInfo->realm = strdup(realm); + + return 1; + } + else + { + D_PRINT(D_NOTICE,"User \"%s\" on realm \"%s\", access denied",dbConn->authInfo->username, + dbConn->authInfo->realm ? dbConn->authInfo->realm : realm); + return 2; + } + } + + return 0; +} + + /* PGSQL authentication thread */ static gpointer pgsql_auth_thread(gpointer data) { @@ -304,145 +476,183 @@ /* Check if all is well */ - if ((dbConn = item->data)) + if (!(dbConn = item->data)) { - D_PRINT(D_DEBUG,"Processing active connection"); - /* Poll connection process to database */ - if (dbConn->state == PGSQL_STATE_CONN) + D_PRINT(D_ERROR,"Error, item->data is NULL, ignoring..."); + /* Advance and continue past this entry */ + item = g_list_next(item); + continue; + } + + /* Poll connection process to database */ + if (dbConn->state == PGSQL_STATE_CONN) + { + D_PRINT(D_DEBUG,"Connection is in the state of connecting"); + /* Check if our FD is in the set of changed FD's */ + if (FD_ISSET(dbConn->sock,&tmp_wfds) || FD_ISSET(dbConn->sock,&tmp_rfds)) { - int isset_wfd = FD_ISSET(dbConn->sock,&tmp_wfds), isset_rfd = FD_ISSET(dbConn->sock,&tmp_rfds); + PostgresPollingStatusType pollRes; + - D_PRINT(D_DEBUG,"Connection is in the state of connecting"); - /* Check if our FD is in the set of changed FD's */ - if (isset_wfd || isset_rfd) - { - PostgresPollingStatusType pollRes; + D_PRINT(D_DEBUG,"Something changed on the pgsql connection"); - - D_PRINT(D_DEBUG,"Something changed on the pgsql connection"); + pollRes = PQconnectPoll(dbConn->pgConn); - pollRes = PQconnectPoll(dbConn->pgConn); - - if (pollRes == PGRES_POLLING_READING) + if (pollRes == PGRES_POLLING_READING) + { + D_PRINT(D_NOTICE,"Polling read"); + /* We now want input */ + FD_CLR(dbConn->sock,&outputFDs); + FD_SET(dbConn->sock,&inputFDs); + } + else if (pollRes == PGRES_POLLING_WRITING) + { + D_PRINT(D_NOTICE,"Polling write"); + /* We now want output */ + FD_CLR(dbConn->sock,&inputFDs); + FD_SET(dbConn->sock,&outputFDs); + } + else if (pollRes == PGRES_POLLING_OK) + { + D_PRINT(D_NOTICE,"Connected"); + /* Connection is established */ + FD_CLR(dbConn->sock,&outputFDs); + FD_CLR(dbConn->sock,&inputFDs); + /* State is now idle */ + if (dbConn->authInfo) + dbConn->state = PGSQL_STATE_AUTH; + else { - D_PRINT(D_NOTICE,"Polling read"); - /* Make sure we checking for the right IO */ - if (isset_wfd) - { - FD_CLR(dbConn->sock,&outputFDs); - FD_SET(dbConn->sock,&inputFDs); - } + activeConns = g_list_remove(activeConns,dbConn); + idleConns = g_list_append(idleConns,dbConn); } - else if (pollRes == PGRES_POLLING_WRITING) - { - D_PRINT(D_NOTICE,"Polling write"); - /* Make sure we checking for the right IO */ - if (isset_rfd) - { - FD_CLR(dbConn->sock,&inputFDs); - FD_SET(dbConn->sock,&outputFDs); - } - } - else if (pollRes == PGRES_POLLING_OK) - { - D_PRINT(D_NOTICE,"Connected"); - if (isset_wfd) - FD_CLR(dbConn->sock,&outputFDs); - if (isset_rfd) - FD_CLR(dbConn->sock,&inputFDs); - /* State is now idle */ - if (dbConn->authInfo) - dbConn->state = PGSQL_STATE_AUTH; - else - { - activeConns = g_list_remove(activeConns,dbConn); - idleConns = g_list_append(idleConns,dbConn); - } + } + else if (pollRes == PGRES_POLLING_FAILED) + { + D_PRINT(D_ERROR,"Failed to connect to database"); + /* Remove from being watched */ + FD_CLR(dbConn->sock,&outputFDs); + FD_CLR(dbConn->sock,&inputFDs); + + /* Cleanup pgsql stuff */ + PQfinish(dbConn->pgConn); - } - else if (pollRes == PGRES_POLLING_FAILED) + // Throw error at callback... we were originally called from, remove from active connections aswell + if (dbConn->authInfo) { - D_PRINT(D_ERROR,"Failed to connect to database"); - if (isset_wfd) - FD_CLR(dbConn->sock,&outputFDs); - if (isset_rfd) - FD_CLR(dbConn->sock,&inputFDs); - - if (dbConn->authInfo) - { - returnCallback(dbConn->authInfo,AUTH_RES_ERROR); - } - else - { - // FIXME - CLEANUP!! - this would be if we pre-spawned connections - } + activeConns = g_list_remove(activeConns,dbConn); + /* We can't destroy here, we must wait for callback function to call disposal routine */ + returnCallback(dbConn->authInfo,AUTH_RES_ERROR); } - else - { - D_PRINT(D_FATAL,"Unknown result from PQconnectPoll(): %i",pollRes); - } + else /* If we pre-spawned we can destroy here */ + /* Free our connection info */ + free(dbConn); } else - D_PRINT(D_DEBUG,"Nothing changed on the pgsql connection"); + { + D_PRINT(D_FATAL,"Unknown result from PQconnectPoll(): %i",pollRes); + } } - /* Check if we need to dispatch a query */ - else if (dbConn->state == PGSQL_STATE_AUTH) + else + D_PRINT(D_DEBUG,"Nothing changed on the pgsql connection"); + } + + /* Check if we need to dispatch a query */ + if (dbConn->state == PGSQL_STATE_AUTH) + { + int res; + + D_PRINT(D_DEBUG,"Connection is in the state of authentication"); + // FIXME - add check if the connection is still ok + // macros... + // - %username + // - %password + // - %realm + // + // must return... + // - username + // - password + // - mailstore + // + // optional return... + // - realm + // - quota + // - active + // + if ((res = PQsendQuery(dbConn->pgConn,"SELECT username, password, mailstore FROM test")) == 1) { - int res; + D_PRINT(D_NOTICE,"Query dispatched successfully"); + dbConn->state = PGSQL_STATE_AUTH_WAIT; + FD_SET(dbConn->sock,&inputFDs); + } + else + { + // FIXME, queue to call again? or will we infact do this by not doing anything above? + D_PRINT(D_DEBUG,"Failed to dispatch query.... blocking???"); + } + } + /* If we have already dispatched a query, check if we have results */ + else if (dbConn->state == PGSQL_STATE_AUTH_WAIT) + { + int res; - D_PRINT(D_DEBUG,"Connection is in the state of authentication"); - // FIXME - add check if the connection is still ok - if ((res = PQsendQuery(dbConn->pgConn,"SELECT username, password FROM test")) == 1) + D_PRINT(D_DEBUG,"Connection is waiting for authentication information"); + /* Check if our FD is in the set of changed FD's */ + if (FD_ISSET(dbConn->sock,&tmp_rfds)) + { + D_PRINT(D_DEBUG,"Authentication information available"); + /* Eat up whateva is available */ + if ((res = PQconsumeInput(dbConn->pgConn)) == 1) { - D_PRINT(D_NOTICE,"Query dispatched successfully"); - dbConn->state = PGSQL_STATE_AUTH_WAIT; + D_PRINT(D_NOTICE,"We consumed something"); } - } - /* If we have already dispatched a query, check if we have results */ - else if (dbConn->state == PGSQL_STATE_AUTH_WAIT) - { - int res; + /* If we not busy, we can call PQgetResult */ + while (PQisBusy(dbConn->pgConn) == 0) + { + PGresult *pgres; + int authRes = 0; + struct authInfo_t *tmpAuthInfo; - D_PRINT(D_DEBUG,"Connection is waiting for authentication information"); - /* Check if our FD is in the set of changed FD's */ - if (FD_ISSET(dbConn->sock,&tmp_rfds)) - { - D_PRINT(D_DEBUG,"Authentication information available"); - /* Eat up whateva is available */ - if ((res = PQconsumeInput(dbConn->pgConn)) == 1) + + D_PRINT(D_NOTICE,"We have results"); + /* If PQgetResult returns NULL, we at the end of our query */ + while ((pgres = PQgetResult(dbConn->pgConn)) && !authRes) { - D_PRINT(D_NOTICE,"We consumed something"); + authRes = authAgainstDB(dbConn,pgres); + PQclear(pgres); } - /* If we not busy, we can call PQgetResult */ - if ((res = PQisBusy(dbConn->pgConn)) == 0) + /* Save our authInfo to pass back via callback */ + tmpAuthInfo = dbConn->authInfo; + dbConn->authInfo = NULL; + /* Re-label database connection as idle */ + activeConns = g_list_remove(activeConns,dbConn); + idleConns = g_list_append(idleConns,dbConn); + /* Don't need to watch connection anymore */ + FD_CLR(dbConn->sock,&outputFDs); + FD_CLR(dbConn->sock,&inputFDs); + /* Notify ourselves we might beable to process the queue of auth requests */ + write(noticePipe[1],"1",1); + + D_PRINT(D_NOTICE,"Calling back"); + /* We can't destroy here, we must wait for callback function to call disposal routine */ + if (authRes == 1) { - PGresult *pgres; - - D_PRINT(D_NOTICE,"connection is not busy"); - /* If PQgetResult returns NULL, we at the end of our query */ - if (!(pgres = PQgetResult(dbConn->pgConn))) - { - D_PRINT(D_NOTICE,"We got something back"); - /* Return changes back to original caller */ - } + D_PRINT(D_NOTICE,"Auth ok"); + returnCallback(tmpAuthInfo,AUTH_RES_OK); } else { - D_PRINT(D_NOTICE,"connection is busy"); + D_PRINT(D_NOTICE,"Auth failed"); + returnCallback(tmpAuthInfo,AUTH_RES_INVALID); } - } - - } - else - { - D_PRINT(D_FATAL,"Invalid state"); - } - } - else - D_PRINT(D_FATAL,"item->data is NULL"); + + break; + } // while (PQisBusy(dbConn->pgConn) == 0) + } // if (FD_ISSET(dbConn->sock,&tmp_rfds)) + } // else if (dbConn->state == PGSQL_STATE_AUTH_WAIT) item = g_list_next(item); } // while (item) Modified: branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c =================================================================== --- branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c 2005-04-21 12:06:17 UTC (rev 97) +++ branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c 2005-04-21 12:21:58 UTC (rev 98) @@ -37,15 +37,22 @@ struct pop3_data_t *data = authInfo->client->data; - if (authInfo->result == AUTH_RES_ERROR || authInfo->result == AUTH_RES_INVALID) + D_PRINT(D_NOTICE,"Callback"); + + if (authInfo->result == AUTH_RES_OK) { + snprintf(data->tmpBuf,data->tmpBufSize,"+OK"EOL); + + data->position = POP3_POS_USER_INPUT; + queueToSend(authInfo->client,data->tmpBuf,strlen(data->tmpBuf),POP3_IO_TIMEOUT); + } + else + { D_PRINT(D_ERROR,"Some sort of authentication error occured"); snprintf(data->tmpBuf,data->tmpBufSize,"-ERR Permission denied"EOL); data->position = POP3_POS_USER_INPUT; queueToSend(authInfo->client,data->tmpBuf,strlen(data->tmpBuf),POP3_IO_TIMEOUT); - } else if (authInfo->result == AUTH_RES_OK)\ - { #if 0 /* Get our mailstore handler commands */ if (!(connection->storageCmds = get_mailstore_handler(connection->authInfo->mailstore))) |
From: <sv...@li...> - 2005-04-21 12:06:37
|
Author: nkukard Date: 2005-04-21 12:06:17 +0000 (Thu, 21 Apr 2005) New Revision: 97 Modified: trunk/dbma/dbmra.c Log: * Cleanup of dbmra.c by: Anand Chugh <ana...@ya...> Modified: trunk/dbma/dbmra.c =================================================================== --- trunk/dbma/dbmra.c 2005-04-21 12:04:47 UTC (rev 96) +++ trunk/dbma/dbmra.c 2005-04-21 12:06:17 UTC (rev 97) @@ -64,16 +64,23 @@ // if i need to comment this u need to go back to pre-school int main(int argc, char** argv) { - // Stuff - int c; - int i; - int option_index = 0; - // Socket server... - struct sockData_t* sockData; + + int option_index=0; + int i=0; + struct sockData_t* sockData; // Socket server + struct module_t *module; // module GList *serverList = NULL; // Perms uid_t userID = 0; gid_t groupID = 0; + // Module names + char* moduleFileName[5]={ + "/tmp/idms-dbma/lib/idms-dbma/pop3.so", + "/tmp/idms-dbma/lib/idms-dbma/imap4.so", + "/tmp/idms-dbma/lib/idms-dbma/smtp.so", + "/tmp/idms-dbma/lib/idms-dbma/pgsql.so", + "/tmp/idms-dbma/lib/idms-dbma/dbma.so", + }; /* Initialize glib threading support */ @@ -83,8 +90,9 @@ // Loop wiff our arguments for (;;) { - c = getopt_long(argc,argv,"c:d",long_options,&option_index); + int c = getopt_long(argc,argv,"c:d",long_options,&option_index); + // Check if its the end... if (c == -1) break; @@ -113,13 +121,9 @@ d_setLevel(logLevel); -// initproctitle(argc, argv); - - // Setup socket data... + /* Loop with modules and load, protocol modules */ + for (i=0;i<=2;i++) { - struct module_t *module; - - // Allocate memory for our socket data stuff... sockData = (struct sockData_t*) malloc0(sizeof(struct sockData_t)); if (sockData == NULL) @@ -127,73 +131,26 @@ d_printf(D_FATAL,"main()","Failed to allocate memory for socket data"); exit(D_FATAL); } - /* FIXME - error check */ - module = load_module("/tmp/idms-dbma/lib/idms-dbma/pop3.so"); - sockData->ipAddress = strdup("0.0.0.0"); - // FIXME - Check if listen port is positive - sockData->listenPort = ((struct protoModule_t *) module->extraData)->listenPort; - sockData->boundFD = -1; /* This comes from socklib */ - sockData->maxConnections = 32; // FIXME - Implement this - sockData->protoCmds = (struct protoCmds_t *) module->cmdStruct; - serverList = g_list_append(serverList,sockData); - } - - { - struct module_t *module; - - - // Allocate memory for our socket data stuff... - sockData = (struct sockData_t*) malloc0(sizeof(struct sockData_t)); - if (sockData == NULL) - { - d_printf(D_FATAL,"main()","Failed to allocate memory for socket data"); - exit(D_FATAL); - } - - /* FIXME - error check */ - module = load_module("/tmp/idms-dbma/lib/idms-dbma/imap4.so"); + // Load module + module = load_module(moduleFileName[i]); sockData->ipAddress = strdup("0.0.0.0"); sockData->listenPort = ((struct protoModule_t *) module->extraData)->listenPort; sockData->boundFD = -1; /* This comes from socklib */ - sockData->maxConnections = 32; // FIXME - Implement this + sockData->maxConnections = 32; sockData->protoCmds = (struct protoCmds_t *) module->cmdStruct; serverList = g_list_append(serverList,sockData); - } - - { - struct module_t *module; - - - // Allocate memory for our socket data stuff... - sockData = (struct sockData_t*) malloc0(sizeof(struct sockData_t)); - if (sockData == NULL) - { - d_printf(D_FATAL,"main()","Failed to allocate memory for socket data"); - exit(D_FATAL); - } - /* FIXME - error check */ - module = load_module("/tmp/idms-dbma/lib/idms-dbma/smtp.so"); - - sockData->ipAddress = strdup("0.0.0.0"); - sockData->listenPort = ((struct protoModule_t *) module->extraData)->listenPort; - sockData->boundFD = -1; /* This comes from socklib */ - sockData->maxConnections = 32; // FIXME - Implement this - sockData->protoCmds = (struct protoCmds_t *) module->cmdStruct; - serverList = g_list_append(serverList,sockData); } + /* Load other modules */ + load_module(moduleFileName[3]); + load_module(moduleFileName[4]); - load_module("/tmp/idms-dbma/lib/idms-dbma/pgsql.so"); - load_module("/tmp/idms-dbma/lib/idms-dbma/dbma.so"); - - // And start the server... become daemon if we have to -// if (becomeDaemon == 1) -// daemon(0,0); i = serverInit(serverList); - // check what went wrong + + // check for error switch(i) { case D_FATAL: @@ -217,10 +174,6 @@ break; } } - - // Clean up drivers & return -// free(sockData); -// destroy_drivers(); return i; } |
From: <sv...@li...> - 2005-04-21 12:05:20
|
Author: nkukard Date: 2005-04-21 12:04:47 +0000 (Thu, 21 Apr 2005) New Revision: 96 Modified: trunk/AUTHORS Log: * Welcome to the team Anand Chugh! Modified: trunk/AUTHORS =================================================================== --- trunk/AUTHORS 2005-04-13 20:08:55 UTC (rev 95) +++ trunk/AUTHORS 2005-04-21 12:04:47 UTC (rev 96) @@ -1,3 +1,9 @@ -Project Leader & Programmer +Project Leaders --------------------------- Nigel Kukard <nk...@lb...> + + +Programmers +--------------------------- +Anand Chugh <ana...@ya...> + |
From: <sv...@li...> - 2005-04-13 20:11:29
|
Author: nkukard Date: 2005-04-13 20:08:55 +0000 (Wed, 13 Apr 2005) New Revision: 95 Added: branches/nonblocking_auth/modules/auth/TODO branches/nonblocking_auth/modules/auth/pgsql/TODO Modified: branches/nonblocking_auth/dbma/dbmra.c branches/nonblocking_auth/doc/stamp-vti branches/nonblocking_auth/doc/version.texi branches/nonblocking_auth/include/auth.h branches/nonblocking_auth/lib/auth.c branches/nonblocking_auth/modules/auth/pgsql/Makefile.am branches/nonblocking_auth/modules/auth/pgsql/Makefile.in branches/nonblocking_auth/modules/auth/pgsql/pgsql.c branches/nonblocking_auth/modules/protocols/imap4/imap4_cmd_login.c branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c Log: * Another intermediate update * Few TODO's added Modified: branches/nonblocking_auth/dbma/dbmra.c =================================================================== --- branches/nonblocking_auth/dbma/dbmra.c 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/dbma/dbmra.c 2005-04-13 20:08:55 UTC (rev 95) @@ -114,6 +114,7 @@ // initproctitle(argc, argv); + load_module("/tmp/idms-dbma/lib/idms-dbma/pgsql.so"); // Setup socket data... { @@ -185,7 +186,6 @@ serverList = g_list_append(serverList,sockData); } - load_module("/tmp/idms-dbma/lib/idms-dbma/pgsql.so"); load_module("/tmp/idms-dbma/lib/idms-dbma/dbma.so"); Modified: branches/nonblocking_auth/doc/stamp-vti =================================================================== --- branches/nonblocking_auth/doc/stamp-vti 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/doc/stamp-vti 2005-04-13 20:08:55 UTC (rev 95) @@ -1,4 +1,4 @@ -@set UPDATED 31 March 2005 -@set UPDATED-MONTH March 2005 +@set UPDATED 4 April 2005 +@set UPDATED-MONTH April 2005 @set EDITION 1.0.0 @set VERSION 1.0.0 Modified: branches/nonblocking_auth/doc/version.texi =================================================================== --- branches/nonblocking_auth/doc/version.texi 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/doc/version.texi 2005-04-13 20:08:55 UTC (rev 95) @@ -1,4 +1,4 @@ -@set UPDATED 31 March 2005 -@set UPDATED-MONTH March 2005 +@set UPDATED 4 April 2005 +@set UPDATED-MONTH April 2005 @set EDITION 1.0.0 @set VERSION 1.0.0 Modified: branches/nonblocking_auth/include/auth.h =================================================================== --- branches/nonblocking_auth/include/auth.h 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/include/auth.h 2005-04-13 20:08:55 UTC (rev 95) @@ -1,6 +1,6 @@ /* * auth.h - Authentication header file - * Copyright (C) 2002-2004, Linux Based Systems Design + * Copyright (C) 2002-2005, Linux Based Systems Design * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * + * 12/04/2005 - Nigel Kukard <nk...@lb...> + * * Non-blocking API + * * 23/05/2004 - Nigel Kukard <nk...@lb...> * * Reworked design * @@ -26,22 +29,51 @@ #define AUTH_H #include <stdlib.h> +#include "socklib.h" -struct authCmds_t -{ - struct auth_info_t * (*authenticate) (char *hostname, char *realm, char *username, char *password); -}; - + +/* Authentication result codes */ +#define AUTH_RES_FATAL -2 +#define AUTH_RES_ERROR -1 +#define AUTH_RES_NONE 0 +#define AUTH_RES_OK 1 +#define AUTH_RES_INVALID 2 + + +/* Defines used for specifying callbacks */ +#define AUTH_CALLBACK_PARAMS struct authInfo_t *authInfo +/* Actual func used in specifying something that needs a callback func passed */ +#define AUTH_CALLBACK_FUNC void (*callback) (AUTH_CALLBACK_PARAMS) + + /* Authentication info */ -struct auth_info_t +struct authInfo_t { - ssize_t maxQuota; /* Maximum mailstore quota, -1 if unlimited. Expressed in Kbyte */ + /* This is internal so we can maintain callback */ + struct clientConnection_t *client; + AUTH_CALLBACK_FUNC; + /* This stuff is given by the requestor */ + char *username; /* username is parsed to throw off the realm */ + char *password; + /* This is returned */ + char *realm; /* deciphered from username, NULL if none */ char *mailstore; /* path to mailstore, this must be pumped through the storage modules to find which one we need */ + unsigned int quota; /* Maximum mailstore quota, 0 if unlimited, Expressed in Kbyte */ + int result; /* Result of authentication */ }; +/* Command struct populated when we register a authentication module */ +struct authCmds_t +{ + int (*authenticate) (struct authInfo_t *authInfo); +}; + + /* Check if we can authenticate a user, return a reply if we can */ -struct auth_info_t *module_auth(char *hostname, char *username, char *password); +int module_auth(struct clientConnection_t *clientConnection, AUTH_CALLBACK_FUNC, char *username, char *password); + #endif +// vim:ts=4 Modified: branches/nonblocking_auth/lib/auth.c =================================================================== --- branches/nonblocking_auth/lib/auth.c 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/lib/auth.c 2005-04-13 20:08:55 UTC (rev 95) @@ -1,6 +1,6 @@ /* * auth.c - Authentication handling functions - * Copyright (C) 2002-2004, Linux Based Systems Design + * Copyright (C) 2002-2005, Linux Based Systems Design * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * + * 12/04/2005 - Nigel Kukard <nk...@lb...> + * * Non-blocking API + * * 23/05/2004 - Nigel Kukard <nk...@lb...> * * Reworked design * @@ -31,81 +34,110 @@ #include "modules.h" - /* Check if we can authenticate a user, return a reply if we can */ -struct auth_info_t *module_auth(char *hostname, char *username, char *password) +int module_auth(struct clientConnection_t *clientConnection, AUTH_CALLBACK_FUNC, char *username, char *password) { GList *authModules = get_auth_modules(); GList *item; char *actualUsername; /* Split off section of the username, before realm */ char *realm; /* If anyone is wondering what this is, its the domain name */ - struct auth_info_t *result = NULL; + struct module_t *module; + struct authCmds_t *authCmds; + struct authInfo_t *authInfo; + int res; - /* Check if hostname, username & password are valid */ - if (!hostname || !username || !password) + /* Check if username & password are valid */ + if (!username || !password) { - D_PRINT(D_NOTICE,"Hostname, username or password is NULL"); - return NULL; + D_PRINT(D_ERROR,"Username or password is NULL"); + return D_ERROR; } /* Check if the first module isn't NULL and if not, assign it to our first item */ if (!(item = g_list_first(authModules))) { - D_PRINT(D_NOTICE,"There are no means of authentication"); - return NULL; + D_PRINT(D_ERROR,"There is no means of authentication"); + return D_ERROR; } - /* Calculate realm & actualUsername */ - if (!(realm = strchr(username,'@'))) - actualUsername = strdup(username); - else - actualUsername = strndup(username,strlen(username) - strlen(realm)); +/* + * This block must eventually be moved over to something like validateModule()??? + */ - /* Remember realm would of pointed to the @ */ - if (realm) - realm++; + /* Check our module is valid, before we start allocating stuff */ + if (!(module = item->data)) + { + D_PRINT(D_ERROR,"Module data is NULL"); + return D_ERROR; + } - /* Loop with authentication modules */ - while (item) + /* Verify we are a authentication module */ + if (module->type != AUTH_MODULE) { - struct module_t *module; - struct authCmds_t *authCmds; + D_PRINT(D_ERROR,"Module with incorrect type detected"); + return D_ERROR; + } - - /* If its blank, advance to next one */ - if (!(module = item->data)) - continue; - - /* Verify we are a authentication module */ - if (module->type != AUTH_MODULE) + /* Again verify */ + if (!(authCmds = module->cmdStruct)) + { + D_PRINT(D_NOTICE,"module_auth()","No commands found to use in authentication module"); + } +/* + * end block + */ + + + /* Calculate realm & actualUsername */ + if (!(realm = strchr(username,'@'))) + { + if (!(actualUsername = strdup(username))) { - D_PRINT(D_NOTICE,"Module with incorrect type detected"); - continue; + D_PRINT(D_FATAL,"Failed to allocate memory"); + return D_FATAL; } - - /* Again verify */ - if (!(authCmds = module->cmdStruct)) + } + else + { + /* Remember realm would of pointed to the @ */ + if (realm) + realm++; + /* strdup username & realm */ + if (!(actualUsername = strndup(username,strlen(username) - strlen(realm))) || !(realm = strdup(realm))) { - d_printf(D_NOTICE,"module_auth()","No commands found to use in authentication module"); - continue; + D_PRINT(D_FATAL,"Failed to allocate memory"); + return D_FATAL; } + } + + /* Allocate and check */ + if (!(authInfo = malloc(sizeof(struct authInfo_t)))) + { + free(actualUsername); + if (realm) + free(realm); - /* Check if we were authenticated */ - if ((result = authCmds->authenticate(hostname,realm,actualUsername,password))) - break; - - item = g_list_next(item); + D_PRINT(D_FATAL,"Failed to allocate memory"); + return D_FATAL; } - /* Tell admin if we can't open it */ - if (!result) - D_PRINT(D_NOTICE,"No module to authenticate user: %s",username); - - /* Free actual username */ - free(actualUsername); - - return result; + /* Internal stuff */ + authInfo->client = clientConnection; + authInfo->callback = callback; + /* Setup request */ + authInfo->username = actualUsername; + authInfo->password = strdup(password); + authInfo->realm = realm; + /* Stuff returned */ + authInfo->mailstore = NULL; + authInfo->quota = 0; + authInfo->result = AUTH_RES_NONE; + + D_PRINT(D_DEBUG,"Authenticating"); + res = authCmds->authenticate(authInfo); + + return res; } - +// vim:ts=4 Added: branches/nonblocking_auth/modules/auth/TODO =================================================================== --- branches/nonblocking_auth/modules/auth/TODO 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/modules/auth/TODO 2005-04-13 20:08:55 UTC (rev 95) @@ -0,0 +1,11 @@ +* Failover databases, incase first one is down + +* Caching of authentication requests, configurable TTL + - plugin interface? would save us having a cache in each plugin + +* Daemon'able authentication.... + - maybe use the plugin interface, and a simple daemon wrapper (would work for all auth agents) + - we would have to have a client interface, so it would make authsd and authsc.so plugin? + +* auth.c currently only uses first authentication mechanism, fix this + Modified: branches/nonblocking_auth/modules/auth/pgsql/Makefile.am =================================================================== --- branches/nonblocking_auth/modules/auth/pgsql/Makefile.am 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/modules/auth/pgsql/Makefile.am 2005-04-13 20:08:55 UTC (rev 95) @@ -1,8 +1,9 @@ GLIB_LIBS=@GLIB_LIBS@ GLIB_CFLAGS=@GLIB_CFLAGS@ +PGSQL_LIBS=-lpq module_LTLIBRARIES = pgsql.la pgsql_la_SOURCES = pgsql.c pgsql_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) -pgsql_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +pgsql_la_LDFLAGS = $(GLIB_LIBS) $(PGSQL_LIBS) -module -avoid-version Modified: branches/nonblocking_auth/modules/auth/pgsql/Makefile.in =================================================================== --- branches/nonblocking_auth/modules/auth/pgsql/Makefile.in 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/modules/auth/pgsql/Makefile.in 2005-04-13 20:08:55 UTC (rev 95) @@ -186,10 +186,11 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +PGSQL_LIBS = -lpq module_LTLIBRARIES = pgsql.la pgsql_la_SOURCES = pgsql.c pgsql_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) -pgsql_la_LDFLAGS = $(GLIB_LIBS) -module -avoid-version +pgsql_la_LDFLAGS = $(GLIB_LIBS) $(PGSQL_LIBS) -module -avoid-version all: all-am .SUFFIXES: Added: branches/nonblocking_auth/modules/auth/pgsql/TODO =================================================================== --- branches/nonblocking_auth/modules/auth/pgsql/TODO 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/modules/auth/pgsql/TODO 2005-04-13 20:08:55 UTC (rev 95) @@ -0,0 +1 @@ +* Improve error handling and reporting when creating connection ... etc Modified: branches/nonblocking_auth/modules/auth/pgsql/pgsql.c =================================================================== --- branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-13 20:08:55 UTC (rev 95) @@ -28,16 +28,20 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <pgsql/libpq-fe.h> +#include <unistd.h> #include "debug.h" +#include "auth.h" #include "modules.h" +#include "socklib.h" -#define PGSQL_STATE_CONN 1 -#define PGSQL_STATE_IDLE 2 -#define PGSQL_STATE_AUTH 3 +/* Our own status codes */ +#define PGSQL_STATE_CONN 1 /* We in the process of connecting */ +#define PGSQL_STATE_IDLE 2 /* We are idle, connection is waiting to be used */ +#define PGSQL_STATE_AUTH 3 /* We about to send authentication request */ +#define PGSQL_STATE_AUTH_WAIT 4 /* We waiting for a authentication reply */ -#define PGSQL_IODIR_WRITE 1 -#define PGSQL_IODIR_READ 2 /* Database connection structure */ struct dbConnection_t @@ -45,14 +49,15 @@ PGconn *pgConn; /* Actual pgsql connection struct */ int sock; /* Socket descriptor of connection */ int state; /* State of connection - to us */ + struct authInfo_t *authInfo; /* Our authentication request */ }; /* User definable vars */ unsigned int maxDBConns = 5; +char *dbConnectString = "dbname=test user=postgres"; - /* * Static stuff we need */ @@ -64,10 +69,158 @@ static fd_set inputFDs; static fd_set outputFDs; -static int workerPipe[2]; -static int pipeStatus; +static int noticePipe[2]; /* Notifications pipe, if this changes fsck the timeout... see whats happening */ + +static void returnCallback(struct authInfo_t *authInfo, int res) +{ + authInfo->result = res; + authInfo->callback(authInfo); +} + + +/* Process the auth queue */ +static void processAuthQueue() +{ + GList *authItem; + struct authInfo_t *authInfo; + struct dbConnection_t *dbConn = NULL; /* this is the connection we will use at the end */ + + + /* Grab first authentication request, if nothing, just return */ + if (!(authItem = g_list_first(authQueue))) + { + D_PRINT(D_ERROR,"No items in the queue, why were we called?"); + return; + } + + /* Check if our data is valid */ + if (!(authInfo = authItem->data)) + { + D_PRINT(D_ERROR,"authItem->data is NULL, ignoring"); + return; + } + + /* If we have idle connections, use one... */ + if (g_list_length(idleConns) > 0) + { + GList *connItem; + + + D_PRINT(D_DEBUG,"We have idle connections, finding one..."); + + /* Grab first idle connection */ + connItem = g_list_first(idleConns); + while (connItem && !dbConn) + { + struct dbConnection_t *tmpConn; + + + /* Check if we have data */ + if ((tmpConn = (struct dbConnection_t *) connItem->data)) + { + /* Check if connection is ok */ + if (PQstatus(tmpConn->pgConn) == CONNECTION_OK) + { + dbConn = tmpConn; + /* Setup connection state - we already connected, so jump straight to auth */ + dbConn->state = PGSQL_STATE_AUTH; + /* Remove link from idle connections */ + idleConns = g_list_remove(idleConns,tmpConn); + /* Note: we added to activeConns below */ + } + else /* Connection is bad, dispose */ + { + D_PRINT(D_NOTICE,"Freeing stale connection: %s",PQerrorMessage(tmpConn->pgConn)); + /* Remove link from idle connections */ + idleConns = g_list_remove(idleConns,tmpConn); + /* Cleanup pgsql stuff */ + PQfinish(tmpConn->pgConn); + /* Free our connection info */ + free(tmpConn); + } + } + else + D_PRINT(D_ERROR,"Error, connItem->data is NULL, ignoring..."); + + connItem = g_list_next(connItem); + } + } + + /* If we didn't get anything above, and we can still make new connections, do it */ + if (!dbConn && g_list_length(activeConns) < maxDBConns) + { + struct dbConnection_t *tmpConn; + int res; + + + D_PRINT(D_DEBUG,"There are no idle connection, creating another connection..."); + + /* Allocate some memory for our tmpConnection info */ + if (!(tmpConn = malloc(sizeof(struct dbConnection_t)))) + { + D_PRINT(D_FATAL,"Failed to allocate memory"); + authQueue = g_list_remove(authQueue,authInfo); + returnCallback(authInfo,AUTH_RES_FATAL); + return; + } + + /* Connect to database */ + if (!(tmpConn->pgConn = PQconnectStart(dbConnectString))) + { + D_PRINT(D_ERROR,"Failed to connect to database: %s",PQerrorMessage(tmpConn->pgConn)); + PQfinish(tmpConn->pgConn); + free(tmpConn); + authQueue = g_list_remove(authQueue,authInfo); + returnCallback(authInfo,AUTH_RES_ERROR); + return; + } + + /* Check if we tmpConnected OK */ + if (PQstatus(tmpConn->pgConn) == CONNECTION_BAD) + { + D_PRINT(D_ERROR,"Database returned CONNECTION_BAD: %s",PQerrorMessage(tmpConn->pgConn)); + PQfinish(tmpConn->pgConn); + free(tmpConn); + authQueue = g_list_remove(authQueue,authInfo); + returnCallback(authInfo,AUTH_RES_ERROR); + return; + } + + /* Set full non-blocking */ + if ((res = PQsetnonblocking(tmpConn->pgConn,1)) != 0) + { + D_PRINT(D_ERROR,"WARNING: Error setting full non-blocking on pgsql tmpConneciton: %i",res); + } + + /* Grab database socket & set state to connecting */ + tmpConn->sock = PQsocket(tmpConn->pgConn); + tmpConn->state = PGSQL_STATE_CONN; + /* Watch this FD, this is more part of the connecting stuff, so we don't use dbConn ... looks better */ + FD_SET(tmpConn->sock,&outputFDs); + + dbConn = tmpConn; + } + + /* If we got a connection.... assign our request to it */ + if (dbConn) + { + D_PRINT(D_NOTICE,"We have a connection!!"); + + /* Setup connection */ + dbConn->authInfo = authInfo; + /* Remove auth request from queue, add connection to active list */ + authQueue = g_list_remove(authQueue,authInfo); + activeConns = g_list_append(activeConns,dbConn); + } + /* We are probably overloaded */ + else + D_PRINT(D_NOTICE,"We are overloaded???, cannot authenticate atm... waiting..."); +} + + + /* PGSQL authentication thread */ static gpointer pgsql_auth_thread(gpointer data) { @@ -75,12 +228,12 @@ unsigned char result = 1; - fprintf(stderr,"Starting authentication pipe()\n"); - pipe(workerPipe); + D_PRINT(D_NOTICE,"Starting authentication engine"); + pipe(noticePipe); /* Watch our file descriptor */ FD_ZERO(&inputFDs); FD_ZERO(&outputFDs); - FD_SET(workerPipe[0],&inputFDs); + FD_SET(noticePipe[0],&inputFDs); /* Set the timeout period, we use this so we can detect closed connections easily */ tv.tv_sec = 5; tv.tv_usec = 0; @@ -105,6 +258,7 @@ /* And find result... */ switch (retVal) { + /* Something funny has happened */ case -1: /* Check if we've been interrupted */ if (errno == EINTR) @@ -122,182 +276,163 @@ /* Nothing changed, so process only timeout stuff */ case 0: // FIXME - close OLD pgsql connections which we havn't used - D_PRINT(D_NOTICE,"select() timeout"); + D_PRINT(D_NOTICE,"idle"); break; - - /* Something changed... process */ default: /* Check if we were triggered to process another auth request */ - if (FD_ISSET(workerPipe[0],&tmp_rfds)) + if (FD_ISSET(noticePipe[0],&tmp_rfds)) { char tmpBuf[SOCK_IO_BUF_LEN]; - read(workerPipe[0],&tmpBuf,SOCK_IO_BUF_LEN); D_PRINT(D_DEBUG,"Triggered request"); + + /* Clear pipe */ + read(noticePipe[0],&tmpBuf,SOCK_IO_BUF_LEN); + + processAuthQueue(); + } // if (FD_ISSET(noticePipe[0],&tmp_rfds)) - /* Check if we have a active free pgsql connection */ - if (g_list_length(idleConns) > 0) + + /* Check what changed */ + item = g_list_first(activeConns); + while (item) + { + struct dbConnection_t *dbConn; + + + /* Check if all is well */ + if ((dbConn = item->data)) { - GList *item; + D_PRINT(D_DEBUG,"Processing active connection"); + /* Poll connection process to database */ + if (dbConn->state == PGSQL_STATE_CONN) + { + int isset_wfd = FD_ISSET(dbConn->sock,&tmp_wfds), isset_rfd = FD_ISSET(dbConn->sock,&tmp_rfds); + + D_PRINT(D_DEBUG,"Connection is in the state of connecting"); + /* Check if our FD is in the set of changed FD's */ + if (isset_wfd || isset_rfd) + { + PostgresPollingStatusType pollRes; - /* Grab first idle connection */ - item = g_list_first(idleConns); - /* Check if its ok */ - if ((dbConn = (struct dbConnection_t) item->data)) - { - // FIXME - find an available connection that is OK - if (PQstatus(dbConn->pgConn) == CONNECTION_OK) + + D_PRINT(D_DEBUG,"Something changed on the pgsql connection"); + + pollRes = PQconnectPoll(dbConn->pgConn); + + if (pollRes == PGRES_POLLING_READING) + { + D_PRINT(D_NOTICE,"Polling read"); + /* Make sure we checking for the right IO */ + if (isset_wfd) { + FD_CLR(dbConn->sock,&outputFDs); + FD_SET(dbConn->sock,&inputFDs); + } + } + else if (pollRes == PGRES_POLLING_WRITING) + { + D_PRINT(D_NOTICE,"Polling write"); + /* Make sure we checking for the right IO */ + if (isset_rfd) + { + FD_CLR(dbConn->sock,&inputFDs); + FD_SET(dbConn->sock,&outputFDs); + } + } + else if (pollRes == PGRES_POLLING_OK) + { + D_PRINT(D_NOTICE,"Connected"); + if (isset_wfd) + FD_CLR(dbConn->sock,&outputFDs); + if (isset_rfd) + FD_CLR(dbConn->sock,&inputFDs); + /* State is now idle */ + if (dbConn->authInfo) dbConn->state = PGSQL_STATE_AUTH; - dbConn->authRequest = authReq; - } else { - D_PRINT(D_ERROR,"Connection bad"); - PQfinish(dbConn->pgConn); + activeConns = g_list_remove(activeConns,dbConn); + idleConns = g_list_append(idleConns,dbConn); } - } - else - D_PRINT(D_FATAL,"item->data is NULL"); - } - /* We can establish another connection */ - else if (g_list_length(activeConns) < maxDBConns) - { - /* Allocate some memory for our connection info */ - if ((dbConn = malloc(sizeof(struct dbConnection_t)))) - { - /* Connect to database */ - if ((dbConn->pgConn = PQconnectStart("connection_info_string"))) + + } + else if (pollRes == PGRES_POLLING_FAILED) { - int status; - - - /* Check if we connected OK */ - if ((status = PQstatus(dbConn->pgConn)) != CONNECTION_BAD) + D_PRINT(D_ERROR,"Failed to connect to database"); + if (isset_wfd) + FD_CLR(dbConn->sock,&outputFDs); + if (isset_rfd) + FD_CLR(dbConn->sock,&inputFDs); + + if (dbConn->authInfo) { - int res; - - - /* Set full non-blocking */ - if ((res = PQsetnonblocking(dbConn->pgConn,1)) != 0) - { - // FIXME - proper error handling? - D_PRINT(D_ERROR,"Error setting full non-blocking on pgsql conneciton: %i",res); - } - - /* Grab database socket & set state to connecting */ - dbConn->sock = PQsocket(dbConn->pgConn); - dbConn->state = PGSQL_STATE_CONN; - dbConn->ioDir = PGSQL_IODIR_WRITE; - - /* Assign auth request to DB connection */ - dbConn->authRequest = authReq; - - /* Add to active list */ - activeConns = g_list_append(activeConns,dbConn); - - /* Treat situation as PGRES_POLLING_WRITING */ - FD_SET(dbConn->pgConn, &outputFDs); + returnCallback(dbConn->authInfo,AUTH_RES_ERROR); } - /* If not throw an error */ else { - PQfinish(dbConn->pgConn); - - D_PRINT(D_ERROR,"Failed to connect to database"); + // FIXME - CLEANUP!! - this would be if we pre-spawned connections } - - { + } else { - free(dbConn); - - D_PRINT(D_ERROR,"Failed to connect to database server"); + D_PRINT(D_FATAL,"Unknown result from PQconnectPoll(): %i",pollRes); } - } - else - { - /* We are overloaded, keep in queue */ - D_PRINT(D_NOTICE,"We are overloaded"); - } + } + else + D_PRINT(D_DEBUG,"Nothing changed on the pgsql connection"); + } + /* Check if we need to dispatch a query */ + else if (dbConn->state == PGSQL_STATE_AUTH) + { + int res; - break; - } - - /* Check what changed */ - item = g_list_first(activeQueue); - while (item) - { - struct dbConnection_t *dbConn; - - - /* Check if all is well */ - if ((dbConn = item->data)) - { - /* Poll connection process to database */ - if (dbConn->state == PGSQL_STATE_CONN) - { - /* Check if our FD is in the set of changed FD's */ - if (FD_ISSET(dbConn->fd,&tmp_wfds) || FD_ISSET(dbConn->fd,&tmp_rfds)) + D_PRINT(D_DEBUG,"Connection is in the state of authentication"); + // FIXME - add check if the connection is still ok + if ((res = PQsendQuery(dbConn->pgConn,"SELECT username, password FROM test")) == 1) { - D_PRINT(D_DEBUG,"Something changed on the pgsql connection"); - - pgres = PQconnectPoll(dbConn->pgConn); - - if (pgres == PGRES_POLLING_READING) - { - FD_CLR(dbConn->fd,outputFDs); - dbConn->ioDir = PGSQL_IODIR_READ; - } - else if (pgres = PGRES_POLLING_WRITING) - { - dbConn->ioDir = PGSQL_IODIR_WRITE; - } - else if (pgres = PGRES_POLLING_OK) - { - D_PRINT(D_NOTICE,"Connected"); - dbConn->state = PGSQL_STATE_AUTH; - } - else if (pgres = PGRES_POLLING_FAILED) - { - D_PRINT(D_FATAL,"Failed to connect"); - } - else - { - D_PRINT(D_FATAL,"Unknown result from PQconnectPoll(): %i",pgres); - } - } + D_PRINT(D_NOTICE,"Query dispatched successfully"); + dbConn->state = PGSQL_STATE_AUTH_WAIT; } } - /* If we in the authentication state... continue */ - else if (dbConn->state == PGSQL_STATE_AUTH) + /* If we have already dispatched a query, check if we have results */ + else if (dbConn->state == PGSQL_STATE_AUTH_WAIT) { - /* Firstly check if we need to dispatch a query */ - // FIXME - add check if the connection is still ok - res = PQsendQuery(conn,"query") == 1 - query dispatched successfully + int res; - - /* If we have already dispatched a query, check if we have results */ + + D_PRINT(D_DEBUG,"Connection is waiting for authentication information"); /* Check if our FD is in the set of changed FD's */ - if (FD_ISSET(dbConn->fd,&tmp_rfds)) + if (FD_ISSET(dbConn->sock,&tmp_rfds)) { - res = PQconsumeInput(conn) == 1 - no error + D_PRINT(D_DEBUG,"Authentication information available"); + /* Eat up whateva is available */ + if ((res = PQconsumeInput(dbConn->pgConn)) == 1) + { + D_PRINT(D_NOTICE,"We consumed something"); + } /* If we not busy, we can call PQgetResult */ - if ((res = PQisBusy(conn)) == 0) + if ((res = PQisBusy(dbConn->pgConn)) == 0) { PGresult *pgres; + D_PRINT(D_NOTICE,"connection is not busy"); /* If PQgetResult returns NULL, we at the end of our query */ - if (!(pgres = PQgetResult(conn))) + if (!(pgres = PQgetResult(dbConn->pgConn))) { - /* Return changes back to original caller */ + D_PRINT(D_NOTICE,"We got something back"); + /* Return changes back to original caller */ } } + else + { + D_PRINT(D_NOTICE,"connection is busy"); + } } } @@ -310,34 +445,29 @@ D_PRINT(D_FATAL,"item->data is NULL"); item = g_list_next(item); - } + } // while (item) + break; - } - } + } // switch (retVal) + } // while (result == 1) + return NULL; } -/* Queue authentication to be handled by PGSQL */ -void pgsql_queue_auth() -{ -} - - - - /* Authenticate user */ -struct auth_info_t *pgsql_authenticate(char *hostname, char *realm, char *username, char *password) +int pgsql_authenticate(struct authInfo_t *authInfo) { - struct auth_info_t *authInfo = malloc(sizeof(struct auth_info_t)); + D_PRINT(D_NOTICE,"Queuing authentication"); + // Append & notify + authQueue = g_list_append(authQueue,authInfo); + write(noticePipe[1],"1",1); - D_PRINT(D_NOTICE,"Authenticated %s:%s in realm %s here",username,password,realm); - authInfo->maxQuota = 0; - authInfo->mailstore = strdup("dbma,dir:/tmp/mailtest"); + D_PRINT(D_NOTICE,"Authentication queued"); - return authInfo; + return D_OK; } @@ -346,17 +476,23 @@ { struct module_t *myself = NULL; struct authCmds_t *authCmds = NULL; + GThread *authThread; - + + D_PRINT(D_NOTICE,"Registered PostgreSQL authentication module"); + myself = malloc(sizeof(struct module_t)); authCmds = malloc(sizeof(struct authCmds_t)); + /* Start the authentication thread */ + authThread = g_thread_create(&pgsql_auth_thread,NULL,FALSE,NULL); + /* Setup module_t structure */ myself->type = AUTH_MODULE; myself->cmdStruct = authCmds; + /* Assign our authentication function */ + authCmds->authenticate = &pgsql_authenticate; - authCmds->authenticate = pgsql_authenticate; - return myself; } Modified: branches/nonblocking_auth/modules/protocols/imap4/imap4_cmd_login.c =================================================================== --- branches/nonblocking_auth/modules/protocols/imap4/imap4_cmd_login.c 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/modules/protocols/imap4/imap4_cmd_login.c 2005-04-13 20:08:55 UTC (rev 95) @@ -54,6 +54,7 @@ username = TEXT_PARAM(0); password = TEXT_PARAM(1); D_PRINT(D_DEBUG,"username = \"%s\", password = \"%s\"",username,password); +#if 0 /* Authenticate user against authentication modules */ if (!(connection->authInfo = module_auth(connection->hostname,username,password))) { @@ -83,6 +84,12 @@ /* Return success */ snprintf(data->tmpBuf,data->tmpBufSize,"%s OK LOGIN Completed"EOL,cmdStruct->tag); data->state = IMAP4_STATE_AUTHED; +#else + snprintf(data->tmpBuf,data->tmpBufSize,"%s NO LOGIN Permission denied"EOL, + cmdStruct->tag); + goto end; +#endif + } else return IMAP4_ERROR_STATE; Modified: branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c =================================================================== --- branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c 2005-04-12 10:04:16 UTC (rev 94) +++ branches/nonblocking_auth/modules/protocols/pop3/pop3_cmd_pass.c 2005-04-13 20:08:55 UTC (rev 95) @@ -30,38 +30,23 @@ #include "socklib.h" -/* PASS - RFC1939 page 14 */ -int pop3_cmd_pass(POP3_CMD_PARAMS) + +/* Callback from AUTH stuff */ +static void pop3_auth_callback(AUTH_CALLBACK_PARAMS) { - struct pop3_data_t *data = connection->data; + struct pop3_data_t *data = authInfo->client->data; - /* Check if we in the correct state */ - if (data->state == POP3_STATE_AUTH) + if (authInfo->result == AUTH_RES_ERROR || authInfo->result == AUTH_RES_INVALID) { - /* Check our params are ok */ - if (cmdNumParams(cmdStruct->params,POP3_PARAM_TEXT) != 1) - { - D_PRINT(D_FATAL,"Wrong number of params"); - return POP3_ERROR_FATAL; - } - - /* Make sure we have a username */ - if (data->username) - { - /* If we already have a password, free it */ - if (data->password) - free(data->password); - /* Dup the password */ - data->password = strdup(cmdGetParamData(cmdStruct->params,POP3_PARAM_TEXT,0)); - - /* Authenticate user against authentication modules */ - if (!(connection->authInfo = module_auth(connection->hostname,data->username,data->password))) - { - snprintf(data->tmpBuf,data->tmpBufSize,"-ERR Permission denied"EOL); - goto end; - } - + D_PRINT(D_ERROR,"Some sort of authentication error occured"); + snprintf(data->tmpBuf,data->tmpBufSize,"-ERR Permission denied"EOL); + + data->position = POP3_POS_USER_INPUT; + queueToSend(authInfo->client,data->tmpBuf,strlen(data->tmpBuf),POP3_IO_TIMEOUT); + } else if (authInfo->result == AUTH_RES_OK)\ + { +#if 0 /* Get our mailstore handler commands */ if (!(connection->storageCmds = get_mailstore_handler(connection->authInfo->mailstore))) { @@ -100,19 +85,62 @@ /* Set output to client */ snprintf(data->tmpBuf,data->tmpBufSize,"+OK Mailbox open, %u messages"EOL, storage_msg_stats(data->msgList,STORE_ATTR_COUNT,STORE_MSG_ALL)); - } - else - snprintf(data->tmpBuf,data->tmpBufSize,"-ERR Username must be specified first"EOL); +#endif } - else +} + + +/* PASS - RFC1939 page 14 */ +int pop3_cmd_pass(POP3_CMD_PARAMS) +{ + struct pop3_data_t *data = connection->data; + int res; + + + /* Check if we in the correct state */ + if (data->state != POP3_STATE_AUTH) + { snprintf(data->tmpBuf,data->tmpBufSize,"-ERR This command is only valid in AUTHENTICATION state"EOL); + goto end; + } + /* Check our params are ok */ + if (cmdNumParams(cmdStruct->params,POP3_PARAM_TEXT) != 1) + { + D_PRINT(D_FATAL,"Wrong number of params"); + return POP3_ERROR_FATAL; + } + + /* Make sure we have a username */ + if (!data->username) + { + snprintf(data->tmpBuf,data->tmpBufSize,"-ERR Username must be specified first"EOL); + goto end; + } + + /* If we already have a password, free it */ + if (data->password) + free(data->password); + /* Dup the password */ + data->password = strdup(cmdGetParamData(cmdStruct->params,POP3_PARAM_TEXT,0)); + + /* Authenticate user, and return to callback function above */ + if ((res = module_auth(connection,&pop3_auth_callback,data->username,data->password)) != D_OK) + { + D_PRINT(D_ERROR,"Error queueing authentication"); + snprintf(data->tmpBuf,data->tmpBufSize,"-ERR Permission denied"EOL); + } + else /* Return - we will be called back by auth mechanism */ + goto very_end; + end: data->position = POP3_POS_USER_INPUT; queueToSend(connection,data->tmpBuf,strlen(data->tmpBuf),POP3_IO_TIMEOUT); +very_end: return POP3_ERROR_NONE; } + // vim:ts=4 |
From: <sv...@li...> - 2005-04-12 10:05:16
|
Author: nkukard Date: 2005-04-12 10:04:16 +0000 (Tue, 12 Apr 2005) New Revision: 94 Modified: trunk/doc/design.texi Log: * Fixed bug where older version of tetex cannot build our design doc Modified: trunk/doc/design.texi =================================================================== --- trunk/doc/design.texi 2005-04-04 09:26:42 UTC (rev 93) +++ trunk/doc/design.texi 2005-04-12 10:04:16 UTC (rev 94) @@ -5,29 +5,11 @@ @settitle Damn Best Mail Agent - Design @setchapternewpage on @setcontentsaftertitlepage -@firstparagraphindent none @syncodeindex pg cp @comment %**end of header -@copying -This manual is for developers of Damn Best Mail Agent -(version @value{VERSION}, @value{UPDATED}) -Copyright @copyright{} 2002-2005 Linux Based Systems Design. - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 -or any later version published by the Free Software Foundation; -with no Invariant Sections, no Front-Cover Texts, and no Back-Cover -Texts. A copy of the license is included in the section entitled ``GNU -Free Documentation License''. -@end quotation -@end copying - - - @titlepage @title Damn Best Mail Agent @subtitle for version @value{VERSION}, @value{UPDATED} |
From: <sv...@li...> - 2005-04-04 09:27:03
|
Author: nkukard Date: 2005-04-04 09:26:42 +0000 (Mon, 04 Apr 2005) New Revision: 93 Modified: branches/nonblocking_auth/modules/auth/pgsql/pgsql.c Log: * Intermediate commit on pgsql non-block query result retrieval Modified: branches/nonblocking_auth/modules/auth/pgsql/pgsql.c =================================================================== --- branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-04 08:53:07 UTC (rev 92) +++ branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-04 09:26:42 UTC (rev 93) @@ -273,9 +273,37 @@ } } } + /* If we in the authentication state... continue */ + else if (dbConn->state == PGSQL_STATE_AUTH) + { + /* Firstly check if we need to dispatch a query */ + // FIXME - add check if the connection is still ok + res = PQsendQuery(conn,"query") == 1 - query dispatched successfully + + + /* If we have already dispatched a query, check if we have results */ + /* Check if our FD is in the set of changed FD's */ + if (FD_ISSET(dbConn->fd,&tmp_rfds)) + { + res = PQconsumeInput(conn) == 1 - no error + + /* If we not busy, we can call PQgetResult */ + if ((res = PQisBusy(conn)) == 0) + { + PGresult *pgres; + + /* If PQgetResult returns NULL, we at the end of our query */ + if (!(pgres = PQgetResult(conn))) + { + /* Return changes back to original caller */ + } + } + } + + } else { - D_PRINT(D_FATAL,"Invalid IO direction"); + D_PRINT(D_FATAL,"Invalid state"); } } else @@ -332,4 +360,4 @@ return myself; } - +// vim:ts=4 |
From: <sv...@li...> - 2005-04-04 08:53:28
|
Author: nkukard Date: 2005-04-04 08:53:07 +0000 (Mon, 04 Apr 2005) New Revision: 92 Modified: branches/nonblocking_auth/modules/auth/pgsql/pgsql.c Log: * Current work on the non-blocking authentication * THIS CODE DOES NOT BUILD! Modified: branches/nonblocking_auth/modules/auth/pgsql/pgsql.c =================================================================== --- branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-04 08:45:54 UTC (rev 91) +++ branches/nonblocking_auth/modules/auth/pgsql/pgsql.c 2005-04-04 08:53:07 UTC (rev 92) @@ -1,6 +1,6 @@ /* * pgsql.c - PostgreSQL Database Authentication Module - * Copyright (C) 2002-2004, Linux Based Systems Design + * Copyright (C) 2002-2005, Linux Based Systems Design * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,16 +17,288 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * + * 29/03/2005 - Nigel Kukard <nk...@lb...> + * * Non-blocking queueable authentication added + * * 24/05/2004 - Nigel Kukard <nk...@lb...> * * Reworked design */ +#include <errno.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include "debug.h" #include "modules.h" +#define PGSQL_STATE_CONN 1 +#define PGSQL_STATE_IDLE 2 +#define PGSQL_STATE_AUTH 3 + +#define PGSQL_IODIR_WRITE 1 +#define PGSQL_IODIR_READ 2 + +/* Database connection structure */ +struct dbConnection_t +{ + PGconn *pgConn; /* Actual pgsql connection struct */ + int sock; /* Socket descriptor of connection */ + int state; /* State of connection - to us */ +}; + + +/* User definable vars */ +unsigned int maxDBConns = 5; + + + +/* + * Static stuff we need + */ + +static GList *authQueue = NULL; /* Queue of auth requests waiting to be processed */ + +static GList *idleConns = NULL; /* Currently idle database connections */ +static GList *activeConns = NULL; /* Connections currently processing an auth request */ + +static fd_set inputFDs; +static fd_set outputFDs; +static int workerPipe[2]; +static int pipeStatus; + + +/* PGSQL authentication thread */ +static gpointer pgsql_auth_thread(gpointer data) +{ + struct timeval tv, tmp_tv; + unsigned char result = 1; + + + fprintf(stderr,"Starting authentication pipe()\n"); + pipe(workerPipe); + /* Watch our file descriptor */ + FD_ZERO(&inputFDs); + FD_ZERO(&outputFDs); + FD_SET(workerPipe[0],&inputFDs); + /* Set the timeout period, we use this so we can detect closed connections easily */ + tv.tv_sec = 5; + tv.tv_usec = 0; + + /* Loop for all our partial output */ + while (result == 1) + { + fd_set tmp_wfds; + fd_set tmp_rfds; + int retVal; + GList *item; + + + /* Restore our params... */ + tmp_wfds = outputFDs; + tmp_rfds = inputFDs; + tmp_tv = tv; + + /* Do select() */ + retVal = select(FD_SETSIZE, &tmp_rfds, &tmp_wfds, NULL, &tmp_tv); + + /* And find result... */ + switch (retVal) + { + case -1: + /* Check if we've been interrupted */ + if (errno == EINTR) + { + D_PRINT(D_NOTICE,"select() interrupted by system call"); + result = D_NOTICE; + } + else + { + D_PRINT(D_ERROR,"select() error: %s",strerror(errno)); + result = D_ERROR; + } + break; + + /* Nothing changed, so process only timeout stuff */ + case 0: + // FIXME - close OLD pgsql connections which we havn't used + D_PRINT(D_NOTICE,"select() timeout"); + break; + + + + /* Something changed... process */ + default: + /* Check if we were triggered to process another auth request */ + if (FD_ISSET(workerPipe[0],&tmp_rfds)) + { + char tmpBuf[SOCK_IO_BUF_LEN]; + + + read(workerPipe[0],&tmpBuf,SOCK_IO_BUF_LEN); + D_PRINT(D_DEBUG,"Triggered request"); + + /* Check if we have a active free pgsql connection */ + if (g_list_length(idleConns) > 0) + { + GList *item; + + /* Grab first idle connection */ + item = g_list_first(idleConns); + /* Check if its ok */ + if ((dbConn = (struct dbConnection_t) item->data)) + { + // FIXME - find an available connection that is OK + if (PQstatus(dbConn->pgConn) == CONNECTION_OK) + { + dbConn->state = PGSQL_STATE_AUTH; + dbConn->authRequest = authReq; + } + else + { + D_PRINT(D_ERROR,"Connection bad"); + PQfinish(dbConn->pgConn); + } + } + else + D_PRINT(D_FATAL,"item->data is NULL"); + } + /* We can establish another connection */ + else if (g_list_length(activeConns) < maxDBConns) + { + /* Allocate some memory for our connection info */ + if ((dbConn = malloc(sizeof(struct dbConnection_t)))) + { + /* Connect to database */ + if ((dbConn->pgConn = PQconnectStart("connection_info_string"))) + { + int status; + + + /* Check if we connected OK */ + if ((status = PQstatus(dbConn->pgConn)) != CONNECTION_BAD) + { + int res; + + + /* Set full non-blocking */ + if ((res = PQsetnonblocking(dbConn->pgConn,1)) != 0) + { + // FIXME - proper error handling? + D_PRINT(D_ERROR,"Error setting full non-blocking on pgsql conneciton: %i",res); + } + + /* Grab database socket & set state to connecting */ + dbConn->sock = PQsocket(dbConn->pgConn); + dbConn->state = PGSQL_STATE_CONN; + dbConn->ioDir = PGSQL_IODIR_WRITE; + + /* Assign auth request to DB connection */ + dbConn->authRequest = authReq; + + /* Add to active list */ + activeConns = g_list_append(activeConns,dbConn); + + /* Treat situation as PGRES_POLLING_WRITING */ + FD_SET(dbConn->pgConn, &outputFDs); + } + /* If not throw an error */ + else + { + PQfinish(dbConn->pgConn); + + D_PRINT(D_ERROR,"Failed to connect to database"); + } + + { + else + { + free(dbConn); + + D_PRINT(D_ERROR,"Failed to connect to database server"); + } + } + else + { + /* We are overloaded, keep in queue */ + D_PRINT(D_NOTICE,"We are overloaded"); + } + + + break; + } + + /* Check what changed */ + item = g_list_first(activeQueue); + while (item) + { + struct dbConnection_t *dbConn; + + + /* Check if all is well */ + if ((dbConn = item->data)) + { + /* Poll connection process to database */ + if (dbConn->state == PGSQL_STATE_CONN) + { + /* Check if our FD is in the set of changed FD's */ + if (FD_ISSET(dbConn->fd,&tmp_wfds) || FD_ISSET(dbConn->fd,&tmp_rfds)) + { + D_PRINT(D_DEBUG,"Something changed on the pgsql connection"); + + pgres = PQconnectPoll(dbConn->pgConn); + + if (pgres == PGRES_POLLING_READING) + { + FD_CLR(dbConn->fd,outputFDs); + dbConn->ioDir = PGSQL_IODIR_READ; + } + else if (pgres = PGRES_POLLING_WRITING) + { + dbConn->ioDir = PGSQL_IODIR_WRITE; + } + else if (pgres = PGRES_POLLING_OK) + { + D_PRINT(D_NOTICE,"Connected"); + dbConn->state = PGSQL_STATE_AUTH; + } + else if (pgres = PGRES_POLLING_FAILED) + { + D_PRINT(D_FATAL,"Failed to connect"); + } + else + { + D_PRINT(D_FATAL,"Unknown result from PQconnectPoll(): %i",pgres); + } + } + } + } + else + { + D_PRINT(D_FATAL,"Invalid IO direction"); + } + } + else + D_PRINT(D_FATAL,"item->data is NULL"); + + item = g_list_next(item); + } + break; + } + } + + return NULL; +} + + +/* Queue authentication to be handled by PGSQL */ +void pgsql_queue_auth() +{ +} + + + + /* Authenticate user */ struct auth_info_t *pgsql_authenticate(char *hostname, char *realm, char *username, char *password) { |
From: <sv...@li...> - 2005-04-04 08:46:36
|
Author: nkukard Date: 2005-04-04 08:45:54 +0000 (Mon, 04 Apr 2005) New Revision: 91 Added: branches/nonblocking_auth/ Log: * forked off branch to handle development of nonblocking authentication Copied: branches/nonblocking_auth (from rev 90, trunk) |
From: <sv...@li...> - 2005-03-24 13:56:25
|
Author: nkukard Date: 2005-03-24 13:55:25 +0000 (Thu, 24 Mar 2005) New Revision: 89 Modified: trunk/modules/protocols/smtp/TODO Log: * Small TODO update Modified: trunk/modules/protocols/smtp/TODO =================================================================== --- trunk/modules/protocols/smtp/TODO 2005-03-22 15:53:50 UTC (rev 88) +++ trunk/modules/protocols/smtp/TODO 2005-03-24 13:55:25 UTC (rev 89) @@ -8,6 +8,7 @@ - rfc1891/4 - check for valid recipients? - do we need a plugin API for this to support sql, passwd ... etc? + - parser message headers and find last Received From: line, match this against access tables - relaying - plain domain.com to anywhere the MX resolves to - relay domain.com => server ip[, server ip] (if one fails try next one) |
From: <sv...@li...> - 2005-03-22 15:54:45
|
Author: nkukard Date: 2005-03-22 15:53:50 +0000 (Tue, 22 Mar 2005) New Revision: 88 Modified: trunk/modules/protocols/pop3/TODO trunk/modules/protocols/pop3/pop3.c trunk/modules/protocols/pop3/pop3_cmd_capa.c trunk/modules/protocols/pop3/pop3_cmd_top.c trunk/modules/protocols/pop3/pop3_cmd_uidl.c trunk/modules/protocols/pop3/pop3_cmd_user.c trunk/modules/protocols/pop3/pop3_cmds.h Log: * Added dynamic recognition of POP3 capabilities Modified: trunk/modules/protocols/pop3/TODO =================================================================== --- trunk/modules/protocols/pop3/TODO 2005-03-22 10:23:03 UTC (rev 87) +++ trunk/modules/protocols/pop3/TODO 2005-03-22 15:53:50 UTC (rev 88) @@ -7,3 +7,8 @@ * Implement EXPIRE (RFC 2449 Section 6.7) - min time a READ email will be maintained after being downloaded or read + +* Implement RFC 3206 + +* AUTH & TRANS state capabilities? + Modified: trunk/modules/protocols/pop3/pop3.c =================================================================== --- trunk/modules/protocols/pop3/pop3.c 2005-03-22 10:23:03 UTC (rev 87) +++ trunk/modules/protocols/pop3/pop3.c 2005-03-22 15:53:50 UTC (rev 88) @@ -55,30 +55,31 @@ int contID; int (*cmdFunc) (POP3_CMD_PARAMS); int (*contFunc) (POP3_CMD_CONT_PARAMS); + int (*initFunc) (POP3_CMD_INIT_PARAMS); }; /* List of commands this protocol supports */ static const struct pop3_static_cmd_t pop3_commands[] = { - {-1,POP3_POS_USER_INPUT,NULL,&pop3_user_input}, - {-1,POP3_POS_CMD,NULL,&pop3_cmd}, - {-1,POP3_POS_CLOSE,NULL,&pop3_close}, + {-1,POP3_POS_USER_INPUT,NULL,&pop3_user_input,NULL}, + {-1,POP3_POS_CMD,NULL,&pop3_cmd,NULL}, + {-1,POP3_POS_CLOSE,NULL,&pop3_close,NULL}, /* RFC 1939 */ - {POP3_CMD_QUIT,-1,&pop3_cmd_quit,NULL}, - {POP3_CMD_STAT,-1,&pop3_cmd_stat,NULL}, - {POP3_CMD_LIST,POP3_POS_CMD_LIST,&pop3_cmd_list,&pop3_cmd_list_cont}, - {POP3_CMD_RETR,POP3_POS_CMD_RETR,&pop3_cmd_retr,&pop3_cmd_retr_cont}, - {POP3_CMD_DELE,-1,&pop3_cmd_dele,NULL}, - {POP3_CMD_NOOP,-1,&pop3_cmd_noop,NULL}, - {POP3_CMD_RSET,-1,&pop3_cmd_rset,NULL}, - {POP3_CMD_TOP,POP3_POS_CMD_TOP,&pop3_cmd_top,&pop3_cmd_top_cont}, - {POP3_CMD_UIDL,POP3_POS_CMD_UIDL,&pop3_cmd_uidl,&pop3_cmd_uidl_cont}, - {POP3_CMD_USER,-1,&pop3_cmd_user,NULL}, - {POP3_CMD_PASS,-1,&pop3_cmd_pass,NULL}, + {POP3_CMD_QUIT,-1,&pop3_cmd_quit,NULL,NULL}, + {POP3_CMD_STAT,-1,&pop3_cmd_stat,NULL,NULL}, + {POP3_CMD_LIST,POP3_POS_CMD_LIST,&pop3_cmd_list,&pop3_cmd_list_cont,NULL}, + {POP3_CMD_RETR,POP3_POS_CMD_RETR,&pop3_cmd_retr,&pop3_cmd_retr_cont,NULL}, + {POP3_CMD_DELE,-1,&pop3_cmd_dele,NULL,NULL}, + {POP3_CMD_NOOP,-1,&pop3_cmd_noop,NULL,NULL}, + {POP3_CMD_RSET,-1,&pop3_cmd_rset,NULL,NULL}, + {POP3_CMD_TOP,POP3_POS_CMD_TOP,&pop3_cmd_top,&pop3_cmd_top_cont,&pop3_cmd_top_init}, + {POP3_CMD_UIDL,POP3_POS_CMD_UIDL,&pop3_cmd_uidl,&pop3_cmd_uidl_cont,&pop3_cmd_uidl_init}, + {POP3_CMD_USER,-1,&pop3_cmd_user,NULL,&pop3_cmd_user_init}, + {POP3_CMD_PASS,-1,&pop3_cmd_pass,NULL,NULL}, /* RFC 2449 */ - {POP3_CMD_CAPA,POP3_POS_CMD_CAPA,&pop3_cmd_capa,&pop3_cmd_capa_cont}, - {POP3_CMD_NONE,-1,NULL,NULL} + {POP3_CMD_CAPA,POP3_POS_CMD_CAPA,&pop3_cmd_capa,&pop3_cmd_capa_cont,NULL}, + {POP3_CMD_NONE,-1,NULL,NULL,NULL} }; @@ -336,6 +337,7 @@ struct module_t *myself = NULL; struct protoCmds_t *protoCmds = NULL; struct protoModule_t *protoModule = NULL; + struct pop3_static_cmd_t *pop3_cmd = (struct pop3_static_cmd_t *) pop3_commands; myself = malloc(sizeof(struct module_t)); @@ -350,6 +352,20 @@ protoCmds->handler = pop3_handler; protoModule->listenPort = 1110; + /* Initialize commands */ + while (pop3_cmd->cmdID != POP3_CMD_NONE) + { + /* If we must init, init */ + if (pop3_cmd->initFunc) + pop3_cmd->initFunc(); + pop3_cmd++; + } + + /* Register core capabilities */ + register_capability("PIPELINING"); + register_capability("EXPIRE " POP3_EXPIRE_DELAY); + register_capability("IMPLEMENTATION Damn-Best-Mail-Agent-v"POP3_VERSION); + return myself; } Modified: trunk/modules/protocols/pop3/pop3_cmd_capa.c =================================================================== --- trunk/modules/protocols/pop3/pop3_cmd_capa.c 2005-03-22 10:23:03 UTC (rev 87) +++ trunk/modules/protocols/pop3/pop3_cmd_capa.c 2005-03-22 15:53:50 UTC (rev 88) @@ -29,25 +29,14 @@ #include "socklib.h" -/* POP3 capabilities as per RFC2449 */ -static const char *pop3_capabilities [] = -{ - "TOP", - "USER", -// "RESP-CODES", -// "LOGIN-DELAY " POP3_LOGIN_DELAY, - "PIPELINING", - "EXPIRE " POP3_EXPIRE_DELAY, - "UIDL", - "IMPLEMENTATION Damn-Best-Mail-Agent-v"POP3_VERSION, - NULL -}; +/* List of POP3 capabilities */ +static GList *pop3_capabilities = NULL; -/* CAPA handle */ +/* CAPA stuff */ struct pop3_cmd_capa_t { - char **cur; + GList *cur; }; @@ -64,7 +53,7 @@ /* Set command state so we can be processed as a command continuation request below */ - cmdState->cur = (char **) pop3_capabilities; + cmdState->cur = g_list_first(pop3_capabilities); data->cmdHandle = cmdState; data->position = POP3_POS_CMD_CAPA; @@ -103,7 +92,7 @@ D_PRINT(D_DEBUG,"Entering capa_cont"); /* Handle other results */ - if (!*cmdState->cur) + if (!cmdState->cur) { free(cmdState); data->cmdHandle = NULL; @@ -115,8 +104,11 @@ } else { - snprintf(data->tmpBuf,data->tmpBufSize,"%s"EOL,*cmdState->cur); - cmdState->cur++; + char *capability = (char *) cmdState->cur->data; + + + snprintf(data->tmpBuf,data->tmpBufSize,"%s"EOL,capability); + cmdState->cur = g_list_next(cmdState->cur); } @@ -126,4 +118,10 @@ } +/* Function to register POP3 capability */ +void register_capability(char *capability) +{ + pop3_capabilities = g_list_append(pop3_capabilities,capability); +} + // vim:ts=4 Modified: trunk/modules/protocols/pop3/pop3_cmd_top.c =================================================================== --- trunk/modules/protocols/pop3/pop3_cmd_top.c 2005-03-22 10:23:03 UTC (rev 87) +++ trunk/modules/protocols/pop3/pop3_cmd_top.c 2005-03-22 15:53:50 UTC (rev 88) @@ -176,4 +176,12 @@ return POP3_ERROR_NONE; } + +/* TOP command init */ +int pop3_cmd_top_init(POP3_CMD_INIT_PARAMS) +{ + register_capability("TOP"); +} + + // vim:ts=4 Modified: trunk/modules/protocols/pop3/pop3_cmd_uidl.c =================================================================== --- trunk/modules/protocols/pop3/pop3_cmd_uidl.c 2005-03-22 10:23:03 UTC (rev 87) +++ trunk/modules/protocols/pop3/pop3_cmd_uidl.c 2005-03-22 15:53:50 UTC (rev 88) @@ -170,4 +170,12 @@ return POP3_ERROR_NONE; } + +/* UIDL command init */ +int pop3_cmd_uidl_init(POP3_CMD_INIT_PARAMS) +{ + register_capability("UIDL"); +} + + // vim:ts=4 Modified: trunk/modules/protocols/pop3/pop3_cmd_user.c =================================================================== --- trunk/modules/protocols/pop3/pop3_cmd_user.c 2005-03-22 10:23:03 UTC (rev 87) +++ trunk/modules/protocols/pop3/pop3_cmd_user.c 2005-03-22 15:53:50 UTC (rev 88) @@ -66,4 +66,11 @@ } +/* USER command init */ +int pop3_cmd_user_init(POP3_CMD_INIT_PARAMS) +{ + register_capability("USER"); +} + + // vim:ts=4 Modified: trunk/modules/protocols/pop3/pop3_cmds.h =================================================================== --- trunk/modules/protocols/pop3/pop3_cmds.h 2005-03-22 10:23:03 UTC (rev 87) +++ trunk/modules/protocols/pop3/pop3_cmds.h 2005-03-22 15:53:50 UTC (rev 88) @@ -72,11 +72,14 @@ /* POP3 Command parameter definition */ #define POP3_CMD_PARAMS struct clientConnection_t *connection, struct pop3_command_t *cmdStruct #define POP3_CMD_CONT_PARAMS struct clientConnection_t *connection +#define POP3_CMD_INIT_PARAMS /* Macros to make it easy to declare commands */ #define POP3_CMD(xxx) \ int pop3_cmd_ ## xxx(POP3_CMD_PARAMS) #define POP3_CMD_CONT(xxx) \ - int pop3_cmd_ ## xxx ## _cont(struct clientConnection_t *connection) + int pop3_cmd_ ## xxx ## _cont(POP3_CMD_CONT_PARAMS) +#define POP3_CMD_INIT(xxx) \ + int pop3_cmd_ ## xxx ## _init(POP3_CMD_INIT_PARAMS) /* Param types */ #define POP3_PARAM_TEXT 1 @@ -116,11 +119,14 @@ /* TOP - page 11 */ POP3_CMD(top); POP3_CMD_CONT(top); +POP3_CMD_INIT(top); /* UIDL - page 12 */ POP3_CMD(uidl); POP3_CMD_CONT(uidl); +POP3_CMD_INIT(uidl); /* USER - page 9 */ POP3_CMD(user); +POP3_CMD_INIT(user); /* PASS - page 14 */ POP3_CMD(pass); @@ -130,6 +136,8 @@ /* CAPA - RFC2449 Section 5 */ POP3_CMD(capa); POP3_CMD_CONT(capa); +/* Capability registration */ +void register_capability(char *capability); |
From: <sv...@li...> - 2005-03-22 10:24:07
|
Author: nkukard Date: 2005-03-22 10:23:03 +0000 (Tue, 22 Mar 2005) New Revision: 87 Added: trunk/modules/protocols/pop3/pop3_cmd_capa.c Modified: trunk/modules/protocols/pop3/Makefile.am trunk/modules/protocols/pop3/Makefile.in trunk/modules/protocols/pop3/TODO trunk/modules/protocols/pop3/command_lexer.l trunk/modules/protocols/pop3/command_parser.y trunk/modules/protocols/pop3/pop3.c trunk/modules/protocols/pop3/pop3.h trunk/modules/protocols/pop3/pop3_cmds.h Log: * Fixed bug where pop3.c was left out of Makefile.am * Preliminary support for CAPA command Modified: trunk/modules/protocols/pop3/Makefile.am =================================================================== --- trunk/modules/protocols/pop3/Makefile.am 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/Makefile.am 2005-03-22 10:23:03 UTC (rev 87) @@ -7,10 +7,16 @@ AM_YFLAGS = -d module_LTLIBRARIES = pop3.la -pop3_la_SOURCES = command_lexer.l command_parser.y pop3_cmds.c +pop3_la_SOURCES = command_lexer.l command_parser.y pop3_cmds.c pop3.c + +# RFC 1939 pop3_la_SOURCES += pop3_cmd_quit.c pop3_la_SOURCES += pop3_cmd_stat.c pop3_cmd_list.c pop3_cmd_retr.c pop3_cmd_dele.c pop3_cmd_noop.c pop3_cmd_rset.c pop3_la_SOURCES += pop3_cmd_top.c pop3_cmd_uidl.c pop3_cmd_user.c pop3_cmd_pass.c + +#RFC 2449 +pop3_la_SOURCES += pop3_cmd_capa.c + pop3_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) pop3_la_LDFLAGS = $(GLIB_LIBS) -module -no-undefined -avoid-version Modified: trunk/modules/protocols/pop3/Makefile.in =================================================================== --- trunk/modules/protocols/pop3/Makefile.in 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/Makefile.in 2005-03-22 10:23:03 UTC (rev 87) @@ -60,13 +60,13 @@ LTLIBRARIES = $(module_LTLIBRARIES) pop3_la_LIBADD = am_pop3_la_OBJECTS = pop3_la-command_lexer.lo \ - pop3_la-command_parser.lo pop3_la-pop3_cmds.lo \ + pop3_la-command_parser.lo pop3_la-pop3_cmds.lo pop3_la-pop3.lo \ pop3_la-pop3_cmd_quit.lo pop3_la-pop3_cmd_stat.lo \ pop3_la-pop3_cmd_list.lo pop3_la-pop3_cmd_retr.lo \ pop3_la-pop3_cmd_dele.lo pop3_la-pop3_cmd_noop.lo \ pop3_la-pop3_cmd_rset.lo pop3_la-pop3_cmd_top.lo \ pop3_la-pop3_cmd_uidl.lo pop3_la-pop3_cmd_user.lo \ - pop3_la-pop3_cmd_pass.lo + pop3_la-pop3_cmd_pass.lo pop3_la-pop3_cmd_capa.lo pop3_la_OBJECTS = $(am_pop3_la_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -203,11 +203,15 @@ BUILT_SOURCES = command_parser.h AM_YFLAGS = -d module_LTLIBRARIES = pop3.la -pop3_la_SOURCES = command_lexer.l command_parser.y pop3_cmds.c \ + +# RFC 1939 + +#RFC 2449 +pop3_la_SOURCES = command_lexer.l command_parser.y pop3_cmds.c pop3.c \ pop3_cmd_quit.c pop3_cmd_stat.c pop3_cmd_list.c \ pop3_cmd_retr.c pop3_cmd_dele.c pop3_cmd_noop.c \ pop3_cmd_rset.c pop3_cmd_top.c pop3_cmd_uidl.c pop3_cmd_user.c \ - pop3_cmd_pass.c + pop3_cmd_pass.c pop3_cmd_capa.c pop3_la_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(AM_CFLAGS) pop3_la_LDFLAGS = $(GLIB_LIBS) -module -no-undefined -avoid-version all: $(BUILT_SOURCES) @@ -287,6 +291,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_la-command_lexer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_la-command_parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_la-pop3.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_la-pop3_cmd_capa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_la-pop3_cmd_dele.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_la-pop3_cmd_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pop3_la-pop3_cmd_noop.Plo@am__quote@ @@ -342,6 +348,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pop3_la_CFLAGS) $(CFLAGS) -c -o pop3_la-pop3_cmds.lo `test -f 'pop3_cmds.c' || echo '$(srcdir)/'`pop3_cmds.c +pop3_la-pop3.lo: pop3.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pop3_la_CFLAGS) $(CFLAGS) -MT pop3_la-pop3.lo -MD -MP -MF "$(DEPDIR)/pop3_la-pop3.Tpo" -c -o pop3_la-pop3.lo `test -f 'pop3.c' || echo '$(srcdir)/'`pop3.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pop3_la-pop3.Tpo" "$(DEPDIR)/pop3_la-pop3.Plo"; else rm -f "$(DEPDIR)/pop3_la-pop3.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pop3.c' object='pop3_la-pop3.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pop3_la_CFLAGS) $(CFLAGS) -c -o pop3_la-pop3.lo `test -f 'pop3.c' || echo '$(srcdir)/'`pop3.c + pop3_la-pop3_cmd_quit.lo: pop3_cmd_quit.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pop3_la_CFLAGS) $(CFLAGS) -MT pop3_la-pop3_cmd_quit.lo -MD -MP -MF "$(DEPDIR)/pop3_la-pop3_cmd_quit.Tpo" -c -o pop3_la-pop3_cmd_quit.lo `test -f 'pop3_cmd_quit.c' || echo '$(srcdir)/'`pop3_cmd_quit.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pop3_la-pop3_cmd_quit.Tpo" "$(DEPDIR)/pop3_la-pop3_cmd_quit.Plo"; else rm -f "$(DEPDIR)/pop3_la-pop3_cmd_quit.Tpo"; exit 1; fi @@ -419,6 +432,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pop3_la_CFLAGS) $(CFLAGS) -c -o pop3_la-pop3_cmd_pass.lo `test -f 'pop3_cmd_pass.c' || echo '$(srcdir)/'`pop3_cmd_pass.c +pop3_la-pop3_cmd_capa.lo: pop3_cmd_capa.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pop3_la_CFLAGS) $(CFLAGS) -MT pop3_la-pop3_cmd_capa.lo -MD -MP -MF "$(DEPDIR)/pop3_la-pop3_cmd_capa.Tpo" -c -o pop3_la-pop3_cmd_capa.lo `test -f 'pop3_cmd_capa.c' || echo '$(srcdir)/'`pop3_cmd_capa.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/pop3_la-pop3_cmd_capa.Tpo" "$(DEPDIR)/pop3_la-pop3_cmd_capa.Plo"; else rm -f "$(DEPDIR)/pop3_la-pop3_cmd_capa.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pop3_cmd_capa.c' object='pop3_la-pop3_cmd_capa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pop3_la_CFLAGS) $(CFLAGS) -c -o pop3_la-pop3_cmd_capa.lo `test -f 'pop3_cmd_capa.c' || echo '$(srcdir)/'`pop3_cmd_capa.c + .l.c: $(LEXCOMPILE) $< sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ Modified: trunk/modules/protocols/pop3/TODO =================================================================== --- trunk/modules/protocols/pop3/TODO 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/TODO 2005-03-22 10:23:03 UTC (rev 87) @@ -1,2 +1,9 @@ -* Implement RFC 2449 - - Especially section 4 page 4 - Parameter and response lengths +* Implement LOGIN-DELAY (RFC 2449 Section 6.5) + - delay between logins + +* Implement RESP-CODES (RFC 2449 Section 6.4) + - IN-USE if locked + - LOGIN-DELAY if too quick login + +* Implement EXPIRE (RFC 2449 Section 6.7) + - min time a READ email will be maintained after being downloaded or read Modified: trunk/modules/protocols/pop3/command_lexer.l =================================================================== --- trunk/modules/protocols/pop3/command_lexer.l 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/command_lexer.l 2005-03-22 10:23:03 UTC (rev 87) @@ -226,6 +226,7 @@ c_uidl [Uu][Ii][Dd][Ll] c_user [Uu][Ss][Ee][Rr] c_pass [Pp][Aa][Ss]{2} +c_capa [Cc][Aa][Pp][Aa] /* Generic */ @@ -385,6 +386,13 @@ } +{c_capa} { + printf("Line %i\n",__LINE__); + BEGIN(P_END); + END_COMMAND(CAPA); + } + + {eol} { printf("Line %i\n",__LINE__); return END; Modified: trunk/modules/protocols/pop3/command_parser.y =================================================================== --- trunk/modules/protocols/pop3/command_parser.y 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/command_parser.y 2005-03-22 10:23:03 UTC (rev 87) @@ -48,6 +48,8 @@ %pure_parser /* Actual command tokens */ + +/* RFC 1939 */ %token QUIT %token STAT %token LIST @@ -59,16 +61,19 @@ %token UIDL %token USER %token PASS - /* TOP command tokens */ %token TOP_NUMLINES - /* USER command tokens */ %token USER_USERNAME - /* PASS command tokens */ %token PASS_PASSWORD +/* RFC 2449 */ +%token CAPA + + + + /* Shared command tokens */ %token MSGID @@ -152,6 +157,10 @@ printf("pass command\n"); } + | CAPA { + printf("capa command\n"); + } + ; possible_msg_id: Modified: trunk/modules/protocols/pop3/pop3.c =================================================================== --- trunk/modules/protocols/pop3/pop3.c 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/pop3.c 2005-03-22 10:23:03 UTC (rev 87) @@ -64,6 +64,7 @@ {-1,POP3_POS_USER_INPUT,NULL,&pop3_user_input}, {-1,POP3_POS_CMD,NULL,&pop3_cmd}, {-1,POP3_POS_CLOSE,NULL,&pop3_close}, + /* RFC 1939 */ {POP3_CMD_QUIT,-1,&pop3_cmd_quit,NULL}, {POP3_CMD_STAT,-1,&pop3_cmd_stat,NULL}, {POP3_CMD_LIST,POP3_POS_CMD_LIST,&pop3_cmd_list,&pop3_cmd_list_cont}, @@ -75,6 +76,8 @@ {POP3_CMD_UIDL,POP3_POS_CMD_UIDL,&pop3_cmd_uidl,&pop3_cmd_uidl_cont}, {POP3_CMD_USER,-1,&pop3_cmd_user,NULL}, {POP3_CMD_PASS,-1,&pop3_cmd_pass,NULL}, + /* RFC 2449 */ + {POP3_CMD_CAPA,POP3_POS_CMD_CAPA,&pop3_cmd_capa,&pop3_cmd_capa_cont}, {POP3_CMD_NONE,-1,NULL,NULL} }; Modified: trunk/modules/protocols/pop3/pop3.h =================================================================== --- trunk/modules/protocols/pop3/pop3.h 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/pop3.h 2005-03-22 10:23:03 UTC (rev 87) @@ -61,7 +61,7 @@ #define POP3_LOGIN_DELAY "90" /* Delay that MUST expire between logins of same user */ /* Expire delay can be set to x USER (indicating per-user values) or NEVER (life long) or 0 (no mail to be left on server) */ -#define POP3_EXPIRE_DELAY "60" /* Server guarenteed minimum retention days, or NEVER */ +#define POP3_EXPIRE_DELAY "NEVER" /* Server guarenteed minimum retention days, or NEVER */ /* This is basically the pop3 implementations' handle to the client connection */ Added: trunk/modules/protocols/pop3/pop3_cmd_capa.c =================================================================== --- trunk/modules/protocols/pop3/pop3_cmd_capa.c 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/pop3_cmd_capa.c 2005-03-22 10:23:03 UTC (rev 87) @@ -0,0 +1,129 @@ +/* + * pop3_cmd_capa.c - POP3 Implementation - CAPA + * Copyright (C) 2002-2005, Linux Based Systems Design + * + * This program 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * 22/03/2005 - Nigel Kukard <nk...@lb...> + * * Initial design for lexical & gramatical analyser + * +*/ + +#include <stdio.h> +#include <string.h> +#include "debug.h" +#include "pop3_cmds.h" +#include "socklib.h" + + +/* POP3 capabilities as per RFC2449 */ +static const char *pop3_capabilities [] = +{ + "TOP", + "USER", +// "RESP-CODES", +// "LOGIN-DELAY " POP3_LOGIN_DELAY, + "PIPELINING", + "EXPIRE " POP3_EXPIRE_DELAY, + "UIDL", + "IMPLEMENTATION Damn-Best-Mail-Agent-v"POP3_VERSION, + NULL +}; + + +/* CAPA handle */ +struct pop3_cmd_capa_t +{ + char **cur; +}; + + +/* CAPA - RFC2449 Section 5 */ +int pop3_cmd_capa(POP3_CMD_PARAMS) +{ + struct pop3_data_t *data = connection->data; + + + /* Check if we in the correct state */ + if (data->state == POP3_STATE_AUTH || data->state == POP3_STATE_TRANS) + { + struct pop3_cmd_capa_t *cmdState = malloc(sizeof(struct pop3_cmd_capa_t)); + + + /* Set command state so we can be processed as a command continuation request below */ + cmdState->cur = (char **) pop3_capabilities; + data->cmdHandle = cmdState; + + data->position = POP3_POS_CMD_CAPA; + snprintf(data->tmpBuf,data->tmpBufSize,"+OK Capability list follows"EOL); + + goto very_end; + } + else + snprintf(data->tmpBuf,data->tmpBufSize, + "-ERR This command is only valid in TRANSACTION state"EOL); + +end: + data->position = POP3_POS_USER_INPUT; + +very_end: + queueToSend(connection,data->tmpBuf,strlen(data->tmpBuf),POP3_IO_TIMEOUT); + + return POP3_ERROR_NONE; +} + + +/* CAPA continuation */ +int pop3_cmd_capa_cont(struct clientConnection_t *connection) +{ + struct pop3_data_t *data = connection->data; + struct pop3_cmd_capa_t *cmdState; + + + /* Verify our state is not NULL */ + if (!(cmdState = data->cmdHandle)) + { + D_PRINT(D_FATAL,"cmdState is NULL"); + return POP3_ERROR_FATAL; + } + + D_PRINT(D_DEBUG,"Entering capa_cont"); + + /* Handle other results */ + if (!*cmdState->cur) + { + free(cmdState); + data->cmdHandle = NULL; + + /* Accept user input again */ + data->position = POP3_POS_USER_INPUT; + + snprintf(data->tmpBuf,data->tmpBufSize,"."EOL); + } + else + { + snprintf(data->tmpBuf,data->tmpBufSize,"%s"EOL,*cmdState->cur); + cmdState->cur++; + } + + + queueToSend(connection,data->tmpBuf,strlen(data->tmpBuf),POP3_IO_TIMEOUT); + + return POP3_ERROR_NONE; +} + + +// vim:ts=4 Modified: trunk/modules/protocols/pop3/pop3_cmds.h =================================================================== --- trunk/modules/protocols/pop3/pop3_cmds.h 2005-03-22 09:17:20 UTC (rev 86) +++ trunk/modules/protocols/pop3/pop3_cmds.h 2005-03-22 10:23:03 UTC (rev 87) @@ -35,30 +35,36 @@ #define POP3_CMD_ERROR_STATE -2 #define POP3_CMD_ERROR -1 #define POP3_CMD_NONE 0 -#define POP3_CMD_USER 1 -#define POP3_CMD_PASS 2 -#define POP3_CMD_STAT 3 -#define POP3_CMD_LIST 4 -#define POP3_CMD_RETR 5 -#define POP3_CMD_DELE 6 -#define POP3_CMD_NOOP 7 -#define POP3_CMD_RSET 8 -#define POP3_CMD_UIDL 9 -#define POP3_CMD_TOP 10 -#define POP3_CMD_CAPA 11 -#define POP3_CMD_QUIT 12 +/* RFC 1939 */ +#define POP3_CMD_QUIT 1 +#define POP3_CMD_USER 2 +#define POP3_CMD_PASS 3 +#define POP3_CMD_STAT 4 +#define POP3_CMD_LIST 5 +#define POP3_CMD_RETR 6 +#define POP3_CMD_DELE 7 +#define POP3_CMD_NOOP 8 +#define POP3_CMD_RSET 9 +#define POP3_CMD_UIDL 10 +#define POP3_CMD_TOP 11 +/* RFC 2449 */ +#define POP3_CMD_CAPA 12 + /* Command states ... used for continuation of commands */ #define POP3_POS_USER_INPUT 0 /* require user input */ #define POP3_POS_CMD 1 /* process command */ #define POP3_POS_CLOSE 2 /* must close connection */ #define POP3_POS_START 3 +/* RFC 1939 */ #define POP3_POS_CMD_LIST 4 #define POP3_POS_CMD_RETR 5 #define POP3_POS_CMD_UIDL 6 #define POP3_POS_CMD_TOP 7 +/* RFC 2449 */ #define POP3_POS_CMD_CAPA 8 + /* Error codes we can get */ #define POP3_ERROR_FATAL -1 #define POP3_ERROR_NONE 0 @@ -88,44 +94,45 @@ char *cmdText; }; -/* QUIT - RFC1939 page 5 */ + +/* RFC 1939 */ + +/* QUIT - page 5 */ POP3_CMD(quit); - -/* STAT - RFC1939 page 6 */ +/* STAT - page 6 */ POP3_CMD(stat); - -/* LIST - RFC1939 page 6 */ +/* LIST - page 6 */ POP3_CMD(list); POP3_CMD_CONT(list); - -/* RETR - RFC1939 page 8 */ +/* RETR - page 8 */ POP3_CMD(retr); POP3_CMD_CONT(retr); - -/* DELE - RFC1939 page 8 */ +/* DELE - page 8 */ POP3_CMD(dele); - -/* NOOP - RFC1939 page 9 */ +/* NOOP - page 9 */ POP3_CMD(noop); - -/* RSET - RFC1939 page 9 */ +/* RSET - page 9 */ POP3_CMD(rset); - -/* TOP - RFC1939 page 11 */ +/* TOP - page 11 */ POP3_CMD(top); POP3_CMD_CONT(top); - -/* UIDL - RFC1939 page 12 */ +/* UIDL - page 12 */ POP3_CMD(uidl); POP3_CMD_CONT(uidl); - -/* USER - RFC1939 page 9 */ +/* USER - page 9 */ POP3_CMD(user); - -/* PASS - RFC1939 page 14 */ +/* PASS - page 14 */ POP3_CMD(pass); +/* RFC 2449 */ + +/* CAPA - RFC2449 Section 5 */ +POP3_CMD(capa); +POP3_CMD_CONT(capa); + + + /* Simple param */ struct pop3_command_param_t { |
From: <sv...@li...> - 2005-03-22 09:17:48
|
Author: nkukard Date: 2005-03-22 09:17:20 +0000 (Tue, 22 Mar 2005) New Revision: 86 Modified: trunk/aclocal.m4 trunk/configure trunk/configure.ac Log: * Clarified what versions of glib & libxml are required Modified: trunk/aclocal.m4 =================================================================== --- trunk/aclocal.m4 2005-03-22 09:00:31 UTC (rev 85) +++ trunk/aclocal.m4 2005-03-22 09:17:20 UTC (rev 86) @@ -32,6 +32,9 @@ gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; + gmodule-no-export) + pkg_config_args="$pkg_config_args gmodule-no-export-2.0" + ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; Modified: trunk/configure =================================================================== --- trunk/configure 2005-03-22 09:00:31 UTC (rev 85) +++ trunk/configure 2005-03-22 09:17:20 UTC (rev 86) @@ -22197,6 +22197,9 @@ gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; + gmodule-no-export) + pkg_config_args="$pkg_config_args gmodule-no-export-2.0" + ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; @@ -22261,7 +22264,7 @@ no_glib=yes fi - min_glib_version=2.0.0 + min_glib_version=2.4.0 echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6 @@ -22503,7 +22506,9 @@ if test x"$have_glib" = x"no" then - echo "ERROR: GLib >= 2.0.0 required" + echo + echo "* - ERROR -" + echo "* glib >= 2.4.0 required, this includes the development libraries and headers" exit 1 fi @@ -22585,7 +22590,7 @@ echo "${ECHO_T}no" >&6 fi - min_xml_version=2.0.0 + min_xml_version=2.6.0 echo "$as_me:$LINENO: checking for libxml - version >= $min_xml_version" >&5 echo $ECHO_N "checking for libxml - version >= $min_xml_version... $ECHO_C" >&6 no_xml="" @@ -22813,7 +22818,9 @@ if test x"$have_xml" = x"no" then - echo "ERROR: libXML >= 2.0.0 required" + echo + echo "* - ERROR -" + echo "* libxml >= 2.6.0 required, this includes the development libraries and headers" exit 1 fi Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2005-03-22 09:00:31 UTC (rev 85) +++ trunk/configure.ac 2005-03-22 09:17:20 UTC (rev 86) @@ -63,17 +63,21 @@ AC_CHECK_FLEX_VER(2.5.27) -AM_PATH_GLIB_2_0(2.0.0,have_glib=yes,have_glib=no,gthread) +AM_PATH_GLIB_2_0(2.4.0,have_glib=yes,have_glib=no,gthread) if test x"$have_glib" = x"no" then - echo "ERROR: GLib >= 2.0.0 required" + echo + echo "* - ERROR -" + echo "* glib >= 2.4.0 required, this includes the development libraries and headers" exit 1 fi -AM_PATH_XML2(2.0.0,have_xml=yes,have_xml=no) +AM_PATH_XML2(2.6.0,have_xml=yes,have_xml=no) if test x"$have_xml" = x"no" then - echo "ERROR: libXML >= 2.0.0 required" + echo + echo "* - ERROR -" + echo "* libxml >= 2.6.0 required, this includes the development libraries and headers" exit 1 fi |