From fd2532624ac6bdc6a7f478c39411bafb2c7c11cc Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 6 Apr 2004 06:20:39 +0000 Subject: [PATCH] ecore_ipc now supports ssl too SVN revision: 9620 --- legacy/ecore/configure.in | 5 +++- legacy/ecore/src/lib/ecore_con/Makefile.am | 6 +++-- .../ecore_ipc/{Ecore_Ipc.h => Ecore_Ipc.h.in} | 11 ++++++++- legacy/ecore/src/lib/ecore_ipc/Makefile.am | 8 ++++--- legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c | 23 +++++++++++++++---- 5 files changed, 42 insertions(+), 11 deletions(-) rename legacy/ecore/src/lib/ecore_ipc/{Ecore_Ipc.h => Ecore_Ipc.h.in} (94%) diff --git a/legacy/ecore/configure.in b/legacy/ecore/configure.in index 6f5b3faee0..fa76a3faf7 100644 --- a/legacy/ecore/configure.in +++ b/legacy/ecore/configure.in @@ -622,6 +622,8 @@ AC_SUBST(PERL) AC_SUBST(ecore_config_cflags) AC_SUBST(ecore_config_libs) +AC_SUBST(USE_OPENSSL) + AC_OUTPUT([ Makefile ecore-config @@ -636,6 +638,7 @@ src/lib/ecore_evas/Ecore_Evas.h src/lib/ecore_evas/Makefile src/lib/ecore_con/Ecore_Con.h src/lib/ecore_con/Makefile +src/lib/ecore_ipc/Ecore_Ipc.h src/lib/ecore_ipc/Makefile src/lib/ecore_txt/Makefile src/lib/ecore_config/Makefile @@ -658,7 +661,7 @@ echo " Ecore_FB................: $have_ecore_fb" echo " Ecore_Evas..............: $have_ecore_evas" echo " Ecore_Evas GL Support...: $have_ecore_evas_gl" echo " Ecore_Evas FB Support...: $have_ecore_evas_fb" -echo " Ecore_Ipc...............: $have_ecore_ipc" +echo " Ecore_Ipc...............: $have_ecore_ipc (OpenSSL: $use_openssl)" echo " Ecore_Config............: $have_ecore_config" echo echo "Now type 'make' ('gmake' on some systems) to compile $PACKAGE." diff --git a/legacy/ecore/src/lib/ecore_con/Makefile.am b/legacy/ecore/src/lib/ecore_con/Makefile.am index 28e23cf51e..1e90a6c9b6 100644 --- a/legacy/ecore/src/lib/ecore_con/Makefile.am +++ b/legacy/ecore/src/lib/ecore_con/Makefile.am @@ -1,7 +1,8 @@ ## Process this file with automake to produce Makefile.in INCLUDES = \ --I$(top_srcdir)/src/lib/ecore @SSL_CFLAGS@ +-I$(top_srcdir)/src/lib/ecore \ +@SSL_CFLAGS@ libecore_con_la_LDFLAGS = -version-info 1:0:0 \ -L$(top_builddir)/src/lib/ecore/.libs @@ -17,7 +18,8 @@ ecore_con.c \ ecore_con_private.h libecore_con_la_LIBADD = \ -$(top_builddir)/src/lib/ecore/libecore.la @SSL_LIBS@ +$(top_builddir)/src/lib/ecore/libecore.la \ +@SSL_LIBS@ libecore_con_la_DEPENDENCIES = \ $(top_builddir)/src/lib/ecore/libecore.la diff --git a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h.in similarity index 94% rename from legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h rename to legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h.in index 9c01e26de6..ede65fde08 100644 --- a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h +++ b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h.in @@ -1,6 +1,12 @@ #ifndef _ECORE_IPC_H #define _ECORE_IPC_H +#define HAVE_ECORE_IPC_OPENSSL @USE_OPENSSL@ + +#if HAVE_ECORE_IPC_OPENSSL +#include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -14,7 +20,10 @@ extern "C" { { ECORE_IPC_LOCAL_USER, ECORE_IPC_LOCAL_SYSTEM, - ECORE_IPC_REMOTE_SYSTEM, + ECORE_IPC_REMOTE_SYSTEM +#if HAVE_ECORE_IPC_OPENSSL + ,ECORE_IPC_USE_SSL = 16 +#endif } Ecore_Ipc_Type; typedef struct _Ecore_Ipc_Event_Client_Add Ecore_Ipc_Event_Client_Add; diff --git a/legacy/ecore/src/lib/ecore_ipc/Makefile.am b/legacy/ecore/src/lib/ecore_ipc/Makefile.am index c84b9d32e5..404c4943e2 100644 --- a/legacy/ecore/src/lib/ecore_ipc/Makefile.am +++ b/legacy/ecore/src/lib/ecore_ipc/Makefile.am @@ -2,7 +2,8 @@ INCLUDES = \ -I$(top_srcdir)/src/lib/ecore \ --I$(top_srcdir)/src/lib/ecore_con +-I$(top_srcdir)/src/lib/ecore_con \ +@SSL_CFLAGS@ libecore_ipc_la_LDFLAGS = -version-info 1:0:0 \ -L$(top_builddir)/src/lib/ecore/.libs \ @@ -20,7 +21,8 @@ ecore_ipc_private.h libecore_ipc_la_LIBADD = \ $(top_builddir)/src/lib/ecore/libecore.la \ -$(top_builddir)/src/lib/ecore_con/libecore_con.la +$(top_builddir)/src/lib/ecore_con/libecore_con.la \ +@SSL_LIBS@ libecore_ipc_la_DEPENDENCIES = \ $(top_builddir)/src/lib/ecore/libecore.la \ @@ -29,6 +31,6 @@ $(top_builddir)/src/lib/ecore_con/libecore_con.la endif EXTRA_DIST = \ -Ecore_Ipc.h \ +Ecore_Ipc.h.in \ ecore_ipc.c \ ecore_ipc_private.h diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c index b7eda60105..09889c5846 100644 --- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c +++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c @@ -1,4 +1,5 @@ #include "Ecore.h" +#include "config.h" #include "Ecore_Con.h" #include "ecore_private.h" #include "ecore_ipc_private.h" @@ -93,12 +94,19 @@ ecore_ipc_shutdown(void) * FIXME: To be fixed. */ Ecore_Ipc_Server * -ecore_ipc_server_add(Ecore_Ipc_Type type, char *name, int port, const void *data) +ecore_ipc_server_add(Ecore_Ipc_Type compl_type, char *name, int port, const void *data) { Ecore_Ipc_Server *svr; + Ecore_Ipc_Type type; + Ecore_Con_Type extra = 0; svr = calloc(1, sizeof(Ecore_Ipc_Server)); if (!svr) return NULL; + type = compl_type; +#if USE_OPENSSL + type &= ~ECORE_IPC_USE_SSL; + if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; +#endif switch (type) { case ECORE_IPC_LOCAL_USER: @@ -108,7 +116,7 @@ ecore_ipc_server_add(Ecore_Ipc_Type type, char *name, int port, const void *data svr->server = ecore_con_server_add(ECORE_CON_LOCAL_SYSTEM, name, port, svr); break; case ECORE_IPC_REMOTE_SYSTEM: - svr->server = ecore_con_server_add(ECORE_CON_REMOTE_SYSTEM, name, port, svr); + svr->server = ecore_con_server_add(ECORE_CON_REMOTE_SYSTEM | extra, name, port, svr); break; default: free(svr); @@ -131,12 +139,19 @@ ecore_ipc_server_add(Ecore_Ipc_Type type, char *name, int port, const void *data * FIXME: To be fixed. */ Ecore_Ipc_Server * -ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *data) +ecore_ipc_server_connect(Ecore_Ipc_Type compl_type, char *name, int port, const void *data) { Ecore_Ipc_Server *svr; + Ecore_Ipc_Type type; + Ecore_Con_Type extra = 0; svr = calloc(1, sizeof(Ecore_Ipc_Server)); if (!svr) return NULL; + type = compl_type; +#if USE_OPENSSL + type &= ~ECORE_IPC_USE_SSL; + if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; +#endif switch (type) { case ECORE_IPC_LOCAL_USER: @@ -146,7 +161,7 @@ ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void * svr->server = ecore_con_server_connect(ECORE_CON_LOCAL_SYSTEM, name, port, svr); break; case ECORE_IPC_REMOTE_SYSTEM: - svr->server = ecore_con_server_connect(ECORE_CON_REMOTE_SYSTEM, name, port, svr); + svr->server = ecore_con_server_connect(ECORE_CON_REMOTE_SYSTEM | extra, name, port, svr); break; default: free(svr); -- 2.34.1