Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

winscard_msg.h File Reference

This defines some structures and #defines to be used over the transport layer. More...

Go to the source code of this file.

Data Structures

struct  begin_struct
 contained in SCARD_BEGIN_TRANSACTION Messages. More...

struct  cancel_struct
 contained in SCARD_CANCEL Messages. More...

struct  client_struct
struct  connect_struct
 contained in SCARD_CONNECT Messages. More...

struct  control_struct
 contained in SCARD_CONTROL Messages. More...

struct  control_struct_extended
 contained in SCARD_CONTROL_EXTENDED Messages. More...

struct  disconnect_struct
 contained in SCARD_DISCONNECT Messages. More...

struct  end_struct
 contained in SCARD_END_TRANSACTION Messages. More...

struct  establish_struct
 Information contained in SCARD_ESTABLISH_CONTEXT Messages. More...

struct  getset_struct
 contained in SCARD_GET_ATTRIB and Messages. More...

struct  reconnect_struct
 contained in SCARD_RECONNECT Messages. More...

struct  release_struct
 Information contained in SCARD_RELEASE_CONTEXT Messages. More...

struct  rxSharedSegment
 General structure for client/serve message data exchange. More...

struct  status_struct
 contained in SCARD_STATUS Messages. More...

struct  transmit_struct
 contained in SCARD_TRANSMIT Messages. More...

struct  transmit_struct_extended
 contained in SCARD_TRANSMIT_EXTENDED Messages. More...

struct  version_struct
 Information transmitted in CMD_VERSION Messages. More...


Defines

#define PROTOCOL_VERSION_MAJOR   2
 Major version of the current message protocol.

#define PROTOCOL_VERSION_MINOR   2
 Minor version of the current message protocol.


Typedefs

typedef rxSharedSegment sharedSegmentMsg
 General structure for client/serve message data exchange. More...

typedef rxSharedSegmentpsharedSegmentMsg
 General structure for client/serve message data exchange. More...

typedef version_struct version_struct
typedef client_struct client_struct
typedef establish_struct establish_struct
typedef release_struct release_struct
typedef connect_struct connect_struct
typedef reconnect_struct reconnect_struct
typedef disconnect_struct disconnect_struct
typedef begin_struct begin_struct
typedef end_struct end_struct
typedef cancel_struct cancel_struct
typedef status_struct status_struct
typedef transmit_struct transmit_struct
typedef transmit_struct_extended transmit_struct_extended
typedef control_struct control_struct
typedef control_struct_extended control_struct_extended
typedef getset_struct getset_struct

Enumerations

enum  pcsc_adm_commands {
  CMD_FUNCTION = 0xF1, CMD_FAILED = 0xF2, CMD_SERVER_DIED = 0xF3, CMD_CLIENT_DIED = 0xF4,
  CMD_READER_EVENT = 0xF5, CMD_SYN = 0xF6, CMD_ACK = 0xF7, CMD_VERSION = 0xF8
}
 Command types available to use in the field sharedSegmentMsg.mtype.

enum  pcsc_msg_commands {
  SCARD_ESTABLISH_CONTEXT = 0x01, SCARD_RELEASE_CONTEXT = 0x02, SCARD_LIST_READERS = 0x03, SCARD_CONNECT = 0x04,
  SCARD_RECONNECT = 0x05, SCARD_DISCONNECT = 0x06, SCARD_BEGIN_TRANSACTION = 0x07, SCARD_END_TRANSACTION = 0x08,
  SCARD_TRANSMIT = 0x09, SCARD_CONTROL = 0x0A, SCARD_STATUS = 0x0B, SCARD_GET_STATUS_CHANGE = 0x0C,
  SCARD_CANCEL = 0x0D, SCARD_CANCEL_TRANSACTION = 0x0E, SCARD_GET_ATTRIB = 0x0F, SCARD_SET_ATTRIB = 0x10,
  SCARD_TRANSMIT_EXTENDED = 0x11, SCARD_CONTROL_EXTENDED = 0x12
}
 Commands available to use in the field sharedSegmentMsg.command.


Functions

int SHMClientRead (psharedSegmentMsg, DWORD, int)
int SHMClientSetupSession (PDWORD)
int SHMClientCloseSession (DWORD)
int SHMInitializeCommonSegment (void)
 Prepares the communication channel used by the server to talk to the clients. More...

int SHMProcessEventsContext (PDWORD, psharedSegmentMsg, int)
 @brief. More...

int SHMProcessEventsServer (PDWORD, int)
 Looks for messages sent by clients. More...

int SHMMessageSend (void *buffer, size_t buffer_size, int filedes, int blockAmount)
int SHMMessageReceive (void *buffer, size_t buffer_size, int filedes, int blockAmount)
int WrapSHMWrite (unsigned int command, DWORD dwClientID, unsigned int size, unsigned int blockAmount, void *data)
void SHMCleanupSharedSegment (int, const char *)


Detailed Description

This defines some structures and #defines to be used over the transport layer.

Definition in file winscard_msg.h.


Typedef Documentation

typedef struct rxSharedSegment * psharedSegmentMsg
 

General structure for client/serve message data exchange.

It is used in the calls of SHMMessageSend and SHMMessageReceive. The field data is interpreted according to the values of the fields mtype and command. The possible structs the data field can represent are: version_struct client_struct establish_struct release_struct connect_struct reconnect_struct disconnect_struct begin_struct end_struct cancel_struct status_struct transmit_struct control_struct getset_struct

typedef struct rxSharedSegment sharedSegmentMsg
 

General structure for client/serve message data exchange.

It is used in the calls of SHMMessageSend and SHMMessageReceive. The field data is interpreted according to the values of the fields mtype and command. The possible structs the data field can represent are: version_struct client_struct establish_struct release_struct connect_struct reconnect_struct disconnect_struct begin_struct end_struct cancel_struct status_struct transmit_struct control_struct getset_struct


Function Documentation

int SHMInitializeCommonSegment void   
 

Prepares the communication channel used by the server to talk to the clients.

This is called by the server to create a socket for local IPC with the clients. The socket is associated to the file PCSCLITE_CSOCK_NAME. Each client will open a connection to this socket.

Returns:
Error code.
Return values:
0  Success
-1  Can not create the socket.
-1  Can not bind the socket to the file PCSCLITE_CSOCK_NAME.
-1  Can not put the socket in listen mode.

Definition at line 110 of file winscard_msg_srv.c.

Referenced by SVCServiceRunLoop.

int SHMProcessEventsContext PDWORD    pdwClientID,
psharedSegmentMsg    msgStruct,
int    blocktime
 

@brief.

Called by ContextThread().

Definition at line 220 of file winscard_msg_srv.c.

int SHMProcessEventsServer PDWORD    pdwClientID,
int    blocktime
 

Looks for messages sent by clients.

This is called by the Server's function SVCServiceRunLoop().

am[out] pdwClientID Connection ID used to reference the Client.
am[in] blocktime Timeout (not used).
Returns:
Error code.
Return values:
0  Success.
-1  Error accessing the communication channel.
-1  Can not set the connection to non-blocking mode.
2  Timeout.

Definition at line 168 of file winscard_msg_srv.c.


Generated on Wed Apr 2 02:15:04 2008 for pcsc-lite by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002