00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
00115