pcsc-lite 1.9.9
|
This demarshalls functions over the message queue and keeps track of clients and their handles. More...
#include "config.h"
#include <time.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <stdbool.h>
#include "pcscd.h"
#include "winscard.h"
#include "debuglog.h"
#include "winscard_msg.h"
#include "winscard_svc.h"
#include "sys_generic.h"
#include "utils.h"
#include "readerfactory.h"
#include "eventhandler.h"
#include "simclist.h"
#include "auth.h"
Go to the source code of this file.
Data Structures | |
struct | _psContext |
Macros | |
#define | READ_BODY(v) |
#define | WRITE_BODY(v) WRITE_BODY_WITH_COMMAND(CommandsText[header.command], v) |
#define | WRITE_BODY_WITH_COMMAND(command, v) |
Typedefs | |
typedef struct _psContext | SCONTEXT |
Functions | |
static LONG | MSGCheckHandleAssociation (SCARDHANDLE, SCONTEXT *) |
static LONG | MSGAddContext (SCARDCONTEXT, SCONTEXT *) |
static LONG | MSGRemoveContext (SCARDCONTEXT, SCONTEXT *) |
static LONG | MSGAddHandle (SCARDCONTEXT, SCARDHANDLE, SCONTEXT *) |
static LONG | MSGRemoveHandle (SCARDHANDLE, SCONTEXT *) |
static void | MSGCleanupClient (SCONTEXT *) |
static void * | ContextThread (LPVOID pdwIndex) |
static int | contextsListhContext_seeker (const void *el, const void *key) |
LONG | ContextsInitialize (int customMaxThreadCounter, int customMaxThreadCardHandles) |
void | ContextsDeinitialize (void) |
LONG | CreateContextThread (uint32_t *pdwClientID) |
Creates threads to handle messages received from Clients. | |
LONG | MSGSignalClient (uint32_t filedes, LONG rv) |
LONG | MSGSendReaderStates (uint32_t filedes) |
Variables | |
bool | AutoExit |
Represents an Application Context on the Server side. | |
static int | contextMaxThreadCounter = PCSC_MAX_CONTEXT_THREADS |
static int | contextMaxCardHandles = PCSC_MAX_CONTEXT_CARD_HANDLES |
static list_t | contextsList |
Context tracking list. | |
pthread_mutex_t | contextsList_lock |
lock for the above list | |
READER_STATE | readerStates [PCSCLITE_MAX_READERS_CONTEXTS] |
static const char * | CommandsText [] |
Handles messages received from Clients. | |
This demarshalls functions over the message queue and keeps track of clients and their handles.
Each Client message is deald by creating a thread (CreateContextThread
). The thread establishes reands and demarshalls the message and calls the appropriate function to threat it.
Definition in file winscard_svc.c.
Definition at line 310 of file winscard_svc.c.
#define WRITE_BODY | ( | v | ) | WRITE_BODY_WITH_COMMAND(CommandsText[header.command], v) |
Definition at line 321 of file winscard_svc.c.
Definition at line 323 of file winscard_svc.c.
Definition at line 90 of file winscard_svc.c.
Definition at line 149 of file winscard_svc.c.
Definition at line 119 of file winscard_svc.c.
Definition at line 103 of file winscard_svc.c.
Definition at line 329 of file winscard_svc.c.
LONG CreateContextThread | ( | uint32_t * | pdwClientID | ) |
Creates threads to handle messages received from Clients.
[in] | pdwClientID | Connection ID used to reference the Client. |
SCARD_S_SUCCESS | Success. |
SCARD_F_INTERNAL_ERROR | Exceeded the maximum number of simultaneous Application Contexts. |
SCARD_E_NO_MEMORY | Error creating the Context Thread. |
Definition at line 172 of file winscard_svc.c.
|
static |
Definition at line 851 of file winscard_svc.c.
|
static |
Definition at line 959 of file winscard_svc.c.
|
static |
Definition at line 1027 of file winscard_svc.c.
Definition at line 1057 of file winscard_svc.c.
|
static |
Definition at line 857 of file winscard_svc.c.
|
static |
Definition at line 1010 of file winscard_svc.c.
LONG MSGSendReaderStates | ( | uint32_t | filedes | ) |
Definition at line 839 of file winscard_svc.c.
LONG MSGSignalClient | ( | uint32_t | filedes, |
LONG | rv | ||
) |
Definition at line 822 of file winscard_svc.c.
|
extern |
Represents an Application Context on the Server side.
An Application Context contains Channels (hCard
).
Definition at line 76 of file pcscdaemon.c.
Handles messages received from Clients.
For each Client message a new instance of this thread is created.
[in] | dwIndex | Index of an available Application Context slot in SCONTEXT *. |
Definition at line 284 of file winscard_svc.c.
|
static |
Definition at line 77 of file winscard_svc.c.
|
static |
Definition at line 76 of file winscard_svc.c.
|
static |
Context tracking list.
Definition at line 79 of file winscard_svc.c.
pthread_mutex_t contextsList_lock |
lock for the above list
Definition at line 80 of file winscard_svc.c.
|
extern |
Definition at line 71 of file readerfactory.c.