Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

ctserver.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: ctserver.h,v $
00003  -------------------
00004  cvs         : $Id: ctserver.h,v 1.6 2003/05/08 12:26:39 aquamaniac Exp $
00005  begin       : Thu Nov 28 2002
00006  copyright   : (C) 2002 by Martin Preuss
00007  email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 
00029 #ifndef CTSERVER_H
00030 #define CTSERVER_H "$Id: ctserver.h,v 1.6 2003/05/08 12:26:39 aquamaniac Exp $"
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00036 
00037 #include <chameleon/error.h>
00038 #include <chameleon/ipcservicelayer.h>
00039 #include <chameleon/cryp.h>
00040 #include <chameleon/conf.h>
00041 #include <ctservice.h>
00042 
00043 typedef struct CTSERVERDATASTRUCT CTSERVERDATA;
00044 
00050 typedef ERRORCODE (*CTSERVER_HANDLEREQUESTPTR)(CTSERVERDATA *sd,
00051                                                IPCMESSAGELAYER *ml,
00052                                                IPCMESSAGE *msg);
00053 
00054 typedef ERRORCODE (*CTSERVER_CLIENTUPPTR)(CTSERVERDATA *sd,
00055                                           IPCMESSAGELAYER *ml);
00056 typedef ERRORCODE (*CTSERVER_CLIENTDOWNPTR)(CTSERVERDATA *sd,
00057                                             IPCMESSAGELAYER *ml);
00058 
00059 
00060 
00061 struct CTSERVERDATASTRUCT {
00062   IPCSERVICELAYER *service;
00063   CTSERVER_CLIENTUPPTR clientUp;
00064   CTSERVER_CLIENTDOWNPTR clientDown;
00065   CTSERVER_HANDLEREQUESTPTR handleRequest;
00066   const char *serverPipe;
00067   int nextMessageId;
00068   void *privateData;
00069   int mark;
00070   char *address;
00071   int port;
00072 };
00073 
00074 
00075 
00076 CTSERVERDATA* CTServer_new();
00077 void CTServer_free(CTSERVERDATA *sd);
00078 
00079 
00080 ERRORCODE CTServer_Init(CTSERVERDATA *sd,
00081                         CONFIGGROUP *root);
00082 ERRORCODE CTServer_Fini(CTSERVERDATA *sd);
00083 
00084 ERRORCODE CTServer_Work(CTSERVERDATA *sd,
00085                         int timeout,
00086                         int maxmsg);
00087 
00088 ERRORCODE CTServer_SendResponse(CTSERVERDATA *sd,
00089                                 IPCMESSAGELAYER *ml,
00090                                 IPCMESSAGE *msg);
00091 
00092 ERRORCODE CTServer_SendErrorMessage(CTSERVERDATA *sd,
00093                                     IPCMESSAGELAYER *ml,
00094                                     IPCMESSAGE *req,
00095                                     ERRORCODE errcode);
00096 
00097 
00098 void CTServer_RemoveDisconnected(CTSERVERDATA *sd);
00099 
00100 void CTServer_SetRequestHandler(CTSERVERDATA *sd,
00101                                 CTSERVER_HANDLEREQUESTPTR p);
00102 
00103 void CTServer_SetClientUpHandler(CTSERVERDATA *sd,
00104                                  CTSERVER_CLIENTUPPTR p);
00105 void CTServer_SetClientDownHandler(CTSERVERDATA *sd,
00106                                    CTSERVER_CLIENTDOWNPTR p);
00107 
00108 void CTServer_SetPrivateData(CTSERVERDATA *sd,
00109                              void *p);
00110 void *CTServer_GetPrivateData(CTSERVERDATA *sd);
00111 
00112 
00113 #ifdef __cplusplus
00114 }
00115 #endif
00116 
00117 
00118 #endif /* CTSERVER_H */
00119 
00120 

Generated on Mon Jun 6 18:17:40 2005 for libchipcard by  doxygen 1.4.2