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

ipcmessagelayer.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: ipcmessagelayer.h,v $
00003                              -------------------
00004     cvs         : $Id: ipcmessagelayer.h,v 1.5 2003/05/08 12:26:38 aquamaniac Exp $
00005     begin       : Wed Nov 06 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 CHAMELEON_IPCMESSAGELAYER_H
00030 #define CHAMELEON_IPCMESSAGELAYER_H "$Id"
00031 
00032 #include <chameleon/ipctransportlayer.h>
00033 #include <chameleon/ipcmessage.h>
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 CHIPCARD_API typedef struct IPCMESSAGELAYERSTRUCT IPCMESSAGELAYER;
00040 CHIPCARD_API typedef ERRORCODE (*IPCMESSAGELAYER_FREEPTR)(IPCMESSAGELAYER *ml);
00041 
00042 
00043 CHIPCARD_API typedef enum {
00044   StateIdle=0,
00045   StateConnecting,
00046   StateListening,
00047   StateReading,
00048   StateWriting,
00049   StateDisconnected,
00050   StateUnreachable
00051 } IPCMESSAGELAYERSTATE;
00052 
00053 
00054 CHIPCARD_API struct IPCMESSAGELAYERSTRUCT {
00055   int id;
00056   IPCTRANSPORTLAYERTABLE *transportLayer;
00057   IPCMESSAGELAYERSTATE status;
00058   IPCMESSAGE *outQueue;
00059   IPCMESSAGE *inQueue;
00060   char headerBuffer[IPCMESSAGE_HEADERSIZE];
00061   int readingHeader;
00062   int currentBytesLeft;
00063   char *currentPointer;
00064   int currentReadMessageSize;
00065   char *currentReadBuffer;
00066   IPCMESSAGE *currentWriteMessage;
00067   unsigned int msgReadCount;  
00068   unsigned int msgReadBytes;  
00069   unsigned int msgWriteCount; 
00070   unsigned int msgWriteBytes; 
00071   void *userData;
00072   int useEncryption;
00073   int persistent;
00074   int mark;
00075   IPCMESSAGELAYER_FREEPTR freeUserData_cb; 
00076   IPCMESSAGELAYER *next;
00077 };
00078 
00079 
00080 
00081 CHIPCARD_API IPCMESSAGELAYER *IPCMessageLayer_new();
00082 CHIPCARD_API void IPCMessageLayer_free(IPCMESSAGELAYER *m);
00083 
00084 
00085 CHIPCARD_API IPCTRANSPORTLAYERTABLE *IPCMessageLayer_GetTransportLayer(IPCMESSAGELAYER *m);
00086 CHIPCARD_API void IPCMessageLayer_SetTransportLayer(IPCMESSAGELAYER *m,
00087                                                     IPCTRANSPORTLAYERTABLE *tl);
00088 CHIPCARD_API int IPCMessageLayer_GetId(IPCMESSAGELAYER *m);
00089 CHIPCARD_API void IPCMessageLayer_SetId(IPCMESSAGELAYER *m, int id);
00090 
00091 CHIPCARD_API IPCMESSAGELAYERSTATE IPCMessageLayer_GetStatus(IPCMESSAGELAYER *m);
00092 CHIPCARD_API void IPCMessageLayer_SetStatus(IPCMESSAGELAYER *m,
00093                                             IPCMESSAGELAYERSTATE s);
00094 ERRORCODE IPCMessageLayer_SendMessage(IPCMESSAGELAYER *m,
00095                                       IPCMESSAGE *msg);
00096 CHIPCARD_API IPCMESSAGE *IPCMessageLayer_NextMessage(IPCMESSAGELAYER *m);
00097 CHIPCARD_API ERRORCODE IPCMessageLayer_Work(IPCMESSAGELAYER *m);
00098 
00099 CHIPCARD_API void IPCMessageLayer_ResetStats(IPCMESSAGELAYER *m);
00100 CHIPCARD_API unsigned int IPCMessageLayer_GetMessageReadCount(IPCMESSAGELAYER *m);
00101 CHIPCARD_API unsigned int IPCMessageLayer_GetMessageWriteCount(IPCMESSAGELAYER *m);
00102 CHIPCARD_API unsigned int IPCMessageLayer_GetMessageReadBytes(IPCMESSAGELAYER *m);
00103 CHIPCARD_API unsigned int IPCMessageLayer_GetMessageWriteBytes(IPCMESSAGELAYER *m);
00104 
00105 CHIPCARD_API int IPCMessageLayer_GetAutoRemove(IPCMESSAGELAYER *m);
00106 CHIPCARD_API void IPCMessageLayer_SetAutoRemove(IPCMESSAGELAYER *m, int b);
00107 
00108 CHIPCARD_API void *IPCMessageLayer_GetUserData(IPCMESSAGELAYER *m);
00109 CHIPCARD_API void IPCMessageLayer_SetUserData(IPCMESSAGELAYER *m, void* u);
00110 
00111 CHIPCARD_API ERRORCODE IPCMessageLayer_ShutDown(IPCMESSAGELAYER *m);
00112 
00113 CHIPCARD_API void IPCMessageLayer_SetFreeUserDataCallback(IPCMESSAGELAYER *m,
00114                                                           IPCMESSAGELAYER_FREEPTR p);
00115 
00116 CHIPCARD_API ERRORCODE IPCMessageLayer_IdleCheck(IPCMESSAGELAYER *m);
00117 
00118 CHIPCARD_API TransportLayerType IPCMessageLayer_GetType(IPCMESSAGELAYER *m);
00119 
00120 CHIPCARD_API int IPCMessageLayer_UsesEncryption(IPCMESSAGELAYER *m);
00121 CHIPCARD_API void IPCMessageLayer_UseEncryption(IPCMESSAGELAYER *m,
00122                                                 int b);
00123 CHIPCARD_API void IPCMessageLayer_SetPersistence(IPCMESSAGELAYER *m,
00124                                                   int p);
00125 CHIPCARD_API int IPCMessageLayer_IsPersistent(IPCMESSAGELAYER *m);
00126 
00127 CHIPCARD_API void IPCMessageLayer_SetMark(IPCMESSAGELAYER *m,
00128                                            int mark);
00129 CHIPCARD_API int IPCMessageLayer_GetMark(IPCMESSAGELAYER *m);
00130 
00131 
00132 #ifdef __cplusplus
00133 }
00134 #endif
00135 
00136 #endif /* CHAMELEON_IPCMESSAGELAYER_H */
00137 
00138 

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