#include "config.h"
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/un.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include "misc.h"
#include "pcsclite.h"
#include "winscard.h"
#include "debug.h"
#include "winscard_msg.h"
#include "sys_generic.h"
Go to the source code of this file.
Functions | |
INTERNAL int | SHMClientRead (psharedSegmentMsg msgStruct, DWORD dwClientID, int blockamount) |
Wrapper for the SHMMessageReceive() function. | |
INTERNAL int | SHMClientSetupSession (PDWORD pdwClientID) |
Prepares a communication channel for the client to talk to the server. | |
INTERNAL int | SHMClientCloseSession (DWORD dwClientID) |
Closes the socket used by the client to communicate with the server. | |
INTERNAL int | SHMMessageSend (void *buffer_void, size_t buffer_size, int filedes, int blockAmount) |
Sends a menssage from client to server or vice-versa. | |
INTERNAL int | SHMMessageReceive (void *buffer_void, size_t buffer_size, int filedes, int blockAmount) |
Called by the Client to get the reponse from the server or vice-versa. | |
INTERNAL int | WrapSHMWrite (unsigned int command, DWORD dwClientID, unsigned int size, unsigned int blockAmount, void *data_void) |
Wrapper for the SHMMessageSend() function. | |
INTERNAL void | SHMCleanupSharedSegment (int sockValue, const char *pcFilePath) |
Closes the communications channel used by the server to talk to the clients. |
A file based socket (commonSocket
) is used to send/receive only messages among clients and server.
The messages' data are passed throw a memory mapped file: sharedSegmentMsg
.
Definition in file winscard_msg.c.
|
Closes the communications channel used by the server to talk to the clients. The socket used is closed and the file it is bound to is removed.
Definition at line 449 of file winscard_msg.c. References SYS_CloseFile(). Referenced by SHMInitializeCommonSegment(). |
|
Closes the socket used by the client to communicate with the server.
Definition at line 121 of file winscard_msg.c. References SYS_CloseFile(). Referenced by SCardRemoveContext(). |
|
Wrapper for the SHMMessageReceive() function. Called by clients to read the server responses.
Definition at line 56 of file winscard_msg.c. References psharedSegmentMsg, and SHMMessageReceive(). Referenced by SCardBeginTransaction(), SCardCancelTransaction(), SCardConnect(), SCardControl(), SCardDisconnect(), SCardEndTransaction(), SCardEstablishContextTH(), SCardReconnect(), SCardReleaseContext(), SCardStatus(), and SCardTransmit(). |
|
Prepares a communication channel for the client to talk to the server.
This is called by the application to create a socket for local IPC with the server. The socket is associated to the file
Definition at line 74 of file winscard_msg.c. References SYS_CloseFile(). Referenced by SCardEstablishContextTH(). |
|
Called by the Client to get the reponse from the server or vice-versa.
Reads the message from the file
Definition at line 267 of file winscard_msg.c. Referenced by MSGFunctionDemarshall(), SCardControl(), SCardEstablishContextTH(), SCardTransmit(), SHMClientRead(), and SHMProcessEventsContext(). |
|
Sends a menssage from client to server or vice-versa.
Writes the message in the shared file
Definition at line 142 of file winscard_msg.c. Referenced by ContextThread(), MSGFunctionDemarshall(), SCardEstablishContextTH(), and WrapSHMWrite(). |
|
Wrapper for the SHMMessageSend() function.
Called by clients to send messages to the server. The parameters
Definition at line 392 of file winscard_msg.c. References PCSCLITE_MAX_MESSAGE_SIZE, sharedSegmentMsg, and SHMMessageSend(). Referenced by SCardBeginTransaction(), SCardCancelTransaction(), SCardConnect(), SCardControl(), SCardDisconnect(), SCardEndTransaction(), SCardEstablishContextTH(), SCardReconnect(), SCardReleaseContext(), SCardStatus(), and SCardTransmit(). |