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

ipctransportlayer.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: ipctransportlayer.h,v $
00003                              -------------------
00004     cvs         : $Id: ipctransportlayer.h,v 1.7 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 #ifndef IPCTRANSPORTLAYER_H
00029 #define IPCTRANSPORTLAYER_H "$Id: ipctransportlayer.h,v 1.7 2003/05/08 12:26:38 aquamaniac Exp $"
00030 
00031 
00032 #include <chameleon/error.h>
00033 #include <chameleon/inetaddr.h>
00034 #include <chameleon/inetsocket.h>
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 
00041 typedef enum {
00042   TransportLayerTypeTCP=0,
00043   TransportLayerTypeUnix
00044 } TransportLayerType;
00045 
00046 
00047 CHIPCARD_API struct IPCTRANSPORTLAYERTABLESTRUCT;
00048 CHIPCARD_API typedef struct IPCTRANSPORTLAYERTABLESTRUCT IPCTRANSPORTLAYERTABLE;
00049 
00050 
00051 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_STARTCONNECTPTR)(IPCTRANSPORTLAYERTABLE *tl);
00052 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_FINISHCONNECTPTR)(IPCTRANSPORTLAYERTABLE *tl);
00053 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_LISTENPTR)(IPCTRANSPORTLAYERTABLE *tl);
00054 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_ACCEPTPTR)(IPCTRANSPORTLAYERTABLE *tl,
00055                                                      struct IPCTRANSPORTLAYERTABLESTRUCT **t);
00056 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_DISCONNECTPTR)(IPCTRANSPORTLAYERTABLE *tl);
00057 CHIPCARD_API typedef struct SOCKETSTRUCT* (*IPCTRANS_GETSOCKETPTR)(IPCTRANSPORTLAYERTABLE *tl);
00058 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_READPTR)(IPCTRANSPORTLAYERTABLE *tl,
00059                                                    char *buffer,
00060                                                    int *bsize);
00061 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_WRITEPTR)(IPCTRANSPORTLAYERTABLE *tl,
00062                                                     const char *buffer,
00063                                                     int *bsize);
00064 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_CANREADPTR)(IPCTRANSPORTLAYERTABLE *tl);
00065 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_CANWRITEPTR)(IPCTRANSPORTLAYERTABLE *tl);
00066 CHIPCARD_API typedef ERRORCODE (*IPCTRANS_GETADDRPTR)(IPCTRANSPORTLAYERTABLE *tl,
00067                                          char *buffer,
00068                                          int bsize);
00069 CHIPCARD_API typedef int (*IPCTRANS_GETPORTPTR)(IPCTRANSPORTLAYERTABLE *tl);
00070 CHIPCARD_API typedef void (*IPCTRANS_FREEPTR)(IPCTRANSPORTLAYERTABLE *tl);
00071 
00072 
00073 CHIPCARD_API struct IPCTRANSPORTLAYERTABLESTRUCT {
00074   IPCTRANS_STARTCONNECTPTR startConnect;
00075   IPCTRANS_FINISHCONNECTPTR finishConnect;
00076   IPCTRANS_LISTENPTR listen;
00077   IPCTRANS_ACCEPTPTR accept;
00078   IPCTRANS_DISCONNECTPTR disconnect;
00079   IPCTRANS_READPTR read;
00080   IPCTRANS_WRITEPTR write;
00081   IPCTRANS_CANREADPTR canRead;
00082   IPCTRANS_CANWRITEPTR canWrite;
00083   IPCTRANS_GETSOCKETPTR getSocket;
00084   IPCTRANS_GETADDRPTR getPeerAddress;
00085   IPCTRANS_GETPORTPTR getPeerPort;
00086   IPCTRANS_FREEPTR free;
00087   char address[128];
00088   int port;
00089   void *privateData;
00090   TransportLayerType type;
00091 };
00092 
00093 
00094 
00095 
00096 CHIPCARD_API IPCTRANSPORTLAYERTABLE *IPC_TransportLayerTCP_new();
00097 
00098 CHIPCARD_API IPCTRANSPORTLAYERTABLE *IPC_TransportLayerUnix_new();
00099 
00100 ERRORCODE IPC_TransportLayer_GetAddress(IPCTRANSPORTLAYERTABLE *tl,
00101                                         char *buffer,
00102                                         int bsize);
00103 ERRORCODE IPC_TransportLayer_SetAddress(IPCTRANSPORTLAYERTABLE *tl,
00104                                         const char *buffer);
00105 int IPC_TransportLayer_GetPort(IPCTRANSPORTLAYERTABLE *tl);
00106 void IPC_TransportLayer_SetPort(IPCTRANSPORTLAYERTABLE *tl, int port);
00107 TransportLayerType IPC_TransportLayer_GetType(IPCTRANSPORTLAYERTABLE *tl);
00108 
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112 
00113 
00114 #endif /* IPCTRANSPORTLAYER_H */
00115 

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