49#include <sys/socket.h>
59#ifdef HAVE_SYS_FILIO_H
83#define member_size(type, member) sizeof(((type *)0)->member)
87static void SocketName_init(
void)
96 strncpy(SocketName, PCSCLITE_CSOCK_NAME,
sizeof SocketName);
99 SocketName[
sizeof SocketName -1] =
'\0';
102char *getSocketName(
void)
104 pthread_once(&SocketName_init_control, SocketName_init);
131 Log2(PCSC_LOG_CRITICAL,
"Error: create on client socket: %s",
144 Log3(PCSC_LOG_CRITICAL,
"Error: connect to client socket %s: %s",
153 Log3(PCSC_LOG_CRITICAL,
"Error: cannot retrieve socket %s flags: %s",
161 Log3(PCSC_LOG_CRITICAL,
"Error: cannot set socket %s nonblocking: %s",
277 retval = SCardCheckDaemonAvailability();
290 Log2(PCSC_LOG_INFO,
"Command 0x%X not yet finished", command);
296 Log2(PCSC_LOG_ERROR,
"select returns with failure: %s",
433 Log2(PCSC_LOG_ERROR,
"select returns with failure: %s",
524 Log2(PCSC_LOG_ERROR,
"select returns with failure: %s",
#define SCARD_W_SECURITY_VIOLATION
Access was denied because of a security violation.
#define SCARD_S_SUCCESS
No error was encountered.
#define SCARD_F_COMM_ERROR
An internal communications error has been detected.
#define SCARD_E_TIMEOUT
The user-specified timeout value has expired.
#define SCARD_E_NO_SERVICE
The Smart card resource manager is not running.
This keeps a list of defines for pcsc-lite.
@ POWER_STATE_POWERED
powered
This handles abstract system level calls.
const char * SYS_GetEnv(const char *name)
(More) secure version of getenv(3)
long int time_sub(struct timeval *a, struct timeval *b)
return the difference (as long int) in µs between 2 struct timeval r = a - b
This handles smart card reader communications.
INTERNAL int ClientSetupSession(uint32_t *pdwClientID)
Prepares a communication channel for the client to talk to the server.
INTERNAL LONG MessageReceiveTimeout(uint32_t command, void *buffer_void, uint64_t buffer_size, int32_t filedes, long timeOut)
Called by the Client to get the response from the server or vice-versa.
INTERNAL LONG MessageSendWithHeader(uint32_t command, uint32_t dwClientID, uint64_t size, void *data_void)
Wrapper for the MessageSend() function.
INTERNAL LONG MessageSend(void *buffer_void, uint64_t buffer_size, int32_t filedes)
Sends a menssage from client to server or vice-versa.
INTERNAL void ClientCloseSession(uint32_t dwClientID)
Closes the socket used by the client to communicate with the server.
INTERNAL LONG MessageReceive(void *buffer_void, uint64_t buffer_size, int32_t filedes)
Called by the Client to get the response from the server or vice-versa.
This defines some structures and #defines to be used over the transport layer.