jdk/src/java.smartcardio/unix/native/libj2pcsc/MUSCLE/pcsclite.h
author chegar
Sun, 17 Aug 2014 15:54:13 +0100
changeset 25859 3317bb8137f4
parent 25175 jdk/src/solaris/native/sun/security/smartcardio/MUSCLE/pcsclite.h@a97b521192b6
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * This keeps a list of defines for pcsc-lite.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * MUSCLE SmartCard Development ( http://www.linuxnet.com )
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * Copyright (C) 1999-2004
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 *  David Corcoran <corcoran@linuxnet.com>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *  Ludovic Rousseau <ludovic.rousseau@free.fr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * $Id: pcsclite.h.in,v 1.47 2004/08/24 21:46:57 rousseau Exp $
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
#ifndef __pcsclite_h__
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
#define __pcsclite_h__
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#ifndef __sun_jdk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
#include <wintypes.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
#include <sys/types.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#include <inttypes.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
#ifdef BYTE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
#error BYTE is already defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
  typedef unsigned char BYTE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
#endif /* End BYTE */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
        typedef unsigned char UCHAR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
        typedef unsigned char *PUCHAR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
        typedef unsigned short USHORT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
        typedef unsigned long ULONG;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
        typedef void *LPVOID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
        typedef short BOOL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
        typedef unsigned long *PULONG;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
        typedef const void *LPCVOID;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
        typedef unsigned long DWORD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
        typedef unsigned long *PDWORD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
        typedef unsigned short WORD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
        typedef long LONG;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
        typedef long RESPONSECODE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
        typedef const char *LPCTSTR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        typedef const BYTE *LPCBYTE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
        typedef BYTE *LPBYTE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        typedef DWORD *LPDWORD;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        typedef char *LPTSTR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
extern "C"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
#ifdef WIN32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#include <winscard.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
typedef long SCARDCONTEXT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
typedef SCARDCONTEXT *PSCARDCONTEXT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
typedef SCARDCONTEXT *LPSCARDCONTEXT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
typedef long SCARDHANDLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
typedef SCARDHANDLE *PSCARDHANDLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
typedef SCARDHANDLE *LPSCARDHANDLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#define MAX_ATR_SIZE                    33      /* Maximum ATR size */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
24502
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    65
#ifndef __APPLE__
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    66
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
typedef struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        const char *szReader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        void *pvUserData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        unsigned long dwCurrentState;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        unsigned long dwEventState;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        unsigned long cbAtr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        unsigned char rgbAtr[MAX_ATR_SIZE];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
SCARD_READERSTATE_A;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
25175
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    78
typedef struct _SCARD_IO_REQUEST
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    79
{
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    80
        unsigned long dwProtocol;       /* Protocol identifier */
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    81
        unsigned long cbPciLength;      /* Protocol Control Inf Length */
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    82
}
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    83
SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    84
24502
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    85
#else // __APPLE__
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    86
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    87
#pragma pack(1)
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    88
typedef struct
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    89
{
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    90
        const char *szReader;
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    91
        void *pvUserData;
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    92
        uint32_t dwCurrentState;
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    93
        uint32_t dwEventState;
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    94
        uint32_t cbAtr;
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    95
        unsigned char rgbAtr[MAX_ATR_SIZE];
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    96
}
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
    97
SCARD_READERSTATE_A;
25175
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    98
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
    99
typedef struct _SCARD_IO_REQUEST
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
   100
{
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
   101
        uint32_t dwProtocol;            /* Protocol identifier */
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
   102
        uint32_t cbPciLength;           /* Protocol Control Inf Length */
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
   103
}
a97b521192b6 8048080: (smartcardio) javax.smartcardio.Card.openLogicalChannel() dosn't work on MacOSX
igerasim
parents: 24502
diff changeset
   104
SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;
24502
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
   105
#pragma pack()
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
   106
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
   107
#endif // __APPLE__
7e0b521daf48 7195480: javax.smartcardio does not detect cards on Mac OS X
igerasim
parents: 21278
diff changeset
   108
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
typedef SCARD_READERSTATE_A SCARD_READERSTATE, *PSCARD_READERSTATE_A,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        *LPSCARD_READERSTATE_A;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
extern SCARD_IO_REQUEST g_rgSCardT0Pci, g_rgSCardT1Pci,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        g_rgSCardRawPci;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#define SCARD_PCI_T0    (&g_rgSCardT0Pci)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#define SCARD_PCI_T1    (&g_rgSCardT1Pci)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
#define SCARD_PCI_RAW   (&g_rgSCardRawPci)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
#define SCARD_S_SUCCESS                 0x00000000
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
#define SCARD_E_CANCELLED               0x80100002
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
#define SCARD_E_CANT_DISPOSE            0x8010000E
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#define SCARD_E_INSUFFICIENT_BUFFER     0x80100008
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
#define SCARD_E_INVALID_ATR             0x80100015
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#define SCARD_E_INVALID_HANDLE          0x80100003
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
#define SCARD_E_INVALID_PARAMETER       0x80100004
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#define SCARD_E_INVALID_TARGET          0x80100005
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#define SCARD_E_INVALID_VALUE           0x80100011
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#define SCARD_E_NO_MEMORY               0x80100006
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#define SCARD_F_COMM_ERROR              0x80100013
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#define SCARD_F_INTERNAL_ERROR          0x80100001
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#define SCARD_F_UNKNOWN_ERROR           0x80100014
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#define SCARD_F_WAITED_TOO_LONG         0x80100007
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#define SCARD_E_UNKNOWN_READER          0x80100009
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#define SCARD_E_TIMEOUT                 0x8010000A
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
#define SCARD_E_SHARING_VIOLATION       0x8010000B
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
#define SCARD_E_NO_SMARTCARD            0x8010000C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
#define SCARD_E_UNKNOWN_CARD            0x8010000D
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#define SCARD_E_PROTO_MISMATCH          0x8010000F
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#define SCARD_E_NOT_READY               0x80100010
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
#define SCARD_E_SYSTEM_CANCELLED        0x80100012
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
#define SCARD_E_NOT_TRANSACTED          0x80100016
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
#define SCARD_E_READER_UNAVAILABLE      0x80100017
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
#define SCARD_W_UNSUPPORTED_CARD        0x80100065
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
#define SCARD_W_UNRESPONSIVE_CARD       0x80100066
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
#define SCARD_W_UNPOWERED_CARD          0x80100067
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
#define SCARD_W_RESET_CARD              0x80100068
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
#define SCARD_W_REMOVED_CARD            0x80100069
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
#define SCARD_E_PCI_TOO_SMALL           0x80100019
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#define SCARD_E_READER_UNSUPPORTED      0x8010001A
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
#define SCARD_E_DUPLICATE_READER        0x8010001B
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
#define SCARD_E_CARD_UNSUPPORTED        0x8010001C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
#define SCARD_E_NO_SERVICE              0x8010001D
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
#define SCARD_E_SERVICE_STOPPED         0x8010001E
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
#define SCARD_SCOPE_USER                0x0000  /* Scope in user space */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
#define SCARD_SCOPE_TERMINAL            0x0001  /* Scope in terminal */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
#define SCARD_SCOPE_SYSTEM              0x0002  /* Scope in system */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
#define SCARD_PROTOCOL_UNSET            0x0000  /* protocol not set */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
#define SCARD_PROTOCOL_T0               0x0001  /* T=0 active protocol. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
#define SCARD_PROTOCOL_T1               0x0002  /* T=1 active protocol. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
#define SCARD_PROTOCOL_RAW              0x0004  /* Raw active protocol. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
#define SCARD_PROTOCOL_T15              0x0008  /* T=15 protocol. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#define SCARD_PROTOCOL_ANY              (SCARD_PROTOCOL_T0|SCARD_PROTOCOL_T1)   /* IFD determines prot. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
#define SCARD_SHARE_EXCLUSIVE           0x0001  /* Exclusive mode only */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
#define SCARD_SHARE_SHARED              0x0002  /* Shared mode only */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
#define SCARD_SHARE_DIRECT              0x0003  /* Raw mode only */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
#define SCARD_LEAVE_CARD                0x0000  /* Do nothing on close */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
#define SCARD_RESET_CARD                0x0001  /* Reset on close */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
#define SCARD_UNPOWER_CARD              0x0002  /* Power down on close */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
#define SCARD_EJECT_CARD                0x0003  /* Eject on close */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
#define SCARD_UNKNOWN                   0x0001  /* Unknown state */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#define SCARD_ABSENT                    0x0002  /* Card is absent */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
#define SCARD_PRESENT                   0x0004  /* Card is present */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
#define SCARD_SWALLOWED                 0x0008  /* Card not powered */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
#define SCARD_POWERED                   0x0010  /* Card is powered */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
#define SCARD_NEGOTIABLE                0x0020  /* Ready for PTS */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
#define SCARD_SPECIFIC                  0x0040  /* PTS has been set */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
#define SCARD_STATE_UNAWARE             0x0000  /* App wants status */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
#define SCARD_STATE_IGNORE              0x0001  /* Ignore this reader */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
#define SCARD_STATE_CHANGED             0x0002  /* State has changed */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
#define SCARD_STATE_UNKNOWN             0x0004  /* Reader unknown */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
#define SCARD_STATE_UNAVAILABLE         0x0008  /* Status unavailable */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
#define SCARD_STATE_EMPTY               0x0010  /* Card removed */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
#define SCARD_STATE_PRESENT             0x0020  /* Card inserted */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
#define SCARD_STATE_ATRMATCH            0x0040  /* ATR matches card */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
#define SCARD_STATE_EXCLUSIVE           0x0080  /* Exclusive Mode */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
#define SCARD_STATE_INUSE               0x0100  /* Shared Mode */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
#define SCARD_STATE_MUTE                0x0200  /* Unresponsive card */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
#define SCARD_STATE_UNPOWERED           0x0400  /* Unpowered card */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
 * Tags for requesting card and reader attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
#define SCARD_ATTR_VALUE(Class, Tag) ((((ULONG)(Class)) << 16) | ((ULONG)(Tag)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
#define SCARD_CLASS_VENDOR_INFO     1   /* Vendor information definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
#define SCARD_CLASS_COMMUNICATIONS  2   /* Communication definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
#define SCARD_CLASS_PROTOCOL        3   /* Protocol definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
#define SCARD_CLASS_POWER_MGMT      4   /* Power Management definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
#define SCARD_CLASS_SECURITY        5   /* Security Assurance definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
#define SCARD_CLASS_MECHANICAL      6   /* Mechanical characteristic definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
#define SCARD_CLASS_VENDOR_DEFINED  7   /* Vendor specific definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
#define SCARD_CLASS_IFD_PROTOCOL    8   /* Interface Device Protocol options */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
#define SCARD_CLASS_ICC_STATE       9   /* ICC State specific definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
#define SCARD_CLASS_SYSTEM     0x7fff   /* System-specific definitions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
#define SCARD_ATTR_VENDOR_NAME SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0100)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
#define SCARD_ATTR_VENDOR_IFD_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0101)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
#define SCARD_ATTR_VENDOR_IFD_VERSION SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0102)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
#define SCARD_ATTR_VENDOR_IFD_SERIAL_NO SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0103)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
#define SCARD_ATTR_CHANNEL_ID SCARD_ATTR_VALUE(SCARD_CLASS_COMMUNICATIONS, 0x0110)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
#define SCARD_ATTR_ASYNC_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0120)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
#define SCARD_ATTR_DEFAULT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0121)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
#define SCARD_ATTR_MAX_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0122)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
#define SCARD_ATTR_DEFAULT_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0123)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
#define SCARD_ATTR_MAX_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0124)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
#define SCARD_ATTR_MAX_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0125)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
#define SCARD_ATTR_SYNC_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0126)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
#define SCARD_ATTR_POWER_MGMT_SUPPORT SCARD_ATTR_VALUE(SCARD_CLASS_POWER_MGMT, 0x0131)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
#define SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0140)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
#define SCARD_ATTR_USER_AUTH_INPUT_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0142)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
#define SCARD_ATTR_CHARACTERISTICS SCARD_ATTR_VALUE(SCARD_CLASS_MECHANICAL, 0x0150)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
#define SCARD_ATTR_CURRENT_PROTOCOL_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0201)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
#define SCARD_ATTR_CURRENT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0202)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
#define SCARD_ATTR_CURRENT_F SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0203)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
#define SCARD_ATTR_CURRENT_D SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0204)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
#define SCARD_ATTR_CURRENT_N SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0205)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
#define SCARD_ATTR_CURRENT_W SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0206)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
#define SCARD_ATTR_CURRENT_IFSC SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0207)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
#define SCARD_ATTR_CURRENT_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0208)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
#define SCARD_ATTR_CURRENT_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0209)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
#define SCARD_ATTR_CURRENT_CWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020a)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
#define SCARD_ATTR_CURRENT_EBC_ENCODING SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020b)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
#define SCARD_ATTR_EXTENDED_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020c)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
#define SCARD_ATTR_ICC_PRESENCE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0300)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
#define SCARD_ATTR_ICC_INTERFACE_STATUS SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0301)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
#define SCARD_ATTR_CURRENT_IO_STATE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0302)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
#define SCARD_ATTR_ATR_STRING SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0303)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
#define SCARD_ATTR_ICC_TYPE_PER_ATR SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0304)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
#define SCARD_ATTR_ESC_RESET SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA000)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
#define SCARD_ATTR_ESC_CANCEL SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA003)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
#define SCARD_ATTR_ESC_AUTHREQUEST SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA005)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
#define SCARD_ATTR_MAXINPUT SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA007)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
#define SCARD_ATTR_DEVICE_UNIT SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0001)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
#define SCARD_ATTR_DEVICE_IN_USE SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0002)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0003)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
#define SCARD_ATTR_DEVICE_SYSTEM_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0004)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0005)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
#define SCARD_ATTR_DEVICE_SYSTEM_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0006)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
#define SCARD_ATTR_SUPRESS_T1_IFS_REQUEST SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0007)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
#ifdef UNICODE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_W
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_W
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_A
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_A
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
/* PC/SC Lite specific extensions */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
#define SCARD_W_INSERTED_CARD           0x8010006A
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
#define SCARD_E_UNSUPPORTED_FEATURE     0x8010001F
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
#define SCARD_SCOPE_GLOBAL              0x0003  /* Scope is global */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
#define SCARD_RESET                     0x0001  /* Card was reset */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
#define SCARD_INSERTED                  0x0002  /* Card was inserted */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
#define SCARD_REMOVED                   0x0004  /* Card was removed */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
#define BLOCK_STATUS_RESUME             0x00FF  /* Normal resume */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
#define BLOCK_STATUS_BLOCKING           0x00FA  /* Function is blocking */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
#define PCSCLITE_CONFIG_DIR             "/etc"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
#ifndef USE_IPCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
#define PCSCLITE_IPC_DIR                "/var/run"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
#define PCSCLITE_IPC_DIR                USE_IPCDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
#define PCSCLITE_READER_CONFIG          PCSCLITE_CONFIG_DIR "/reader.conf"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
#define PCSCLITE_PUBSHM_FILE            PCSCLITE_IPC_DIR "/pcscd.pub"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
#define PCSCLITE_CSOCK_NAME             PCSCLITE_IPC_DIR "/pcscd.comm"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
#define PCSCLITE_SVC_IDENTITY           0x01030000      /* Service ID */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
#ifndef INFINITE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
#define INFINITE                        0xFFFFFFFF      /* Infinite timeout */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
#define PCSCLITE_INFINITE_TIMEOUT       4320000         /* 50 day infinite t/o */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
#define PCSCLITE_VERSION_NUMBER         "1.2.9-beta7"   /* Current version */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
#define PCSCLITE_CLIENT_ATTEMPTS        120             /* Attempts to reach sv */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
#define PCSCLITE_MCLIENT_ATTEMPTS       20              /* Attempts to reach sv */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
#define PCSCLITE_STATUS_POLL_RATE       400000          /* Status polling rate */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
#define PCSCLITE_MSG_KEY_LEN            16              /* App ID key length */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
#define PCSCLITE_RW_ATTEMPTS            100             /* Attempts to rd/wrt */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
/* Maximum applications */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
#define PCSCLITE_MAX_APPLICATIONS                       16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
/* Maximum contexts by application */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
#define PCSCLITE_MAX_APPLICATION_CONTEXTS               16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
/* Maximum of applications contexts that pcscd can accept */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
#define PCSCLITE_MAX_APPLICATIONS_CONTEXTS \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
        PCSCLITE_MAX_APPLICATIONS * PCSCLITE_MAX_APPLICATION_CONTEXTS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
/* Maximum channels on a reader context */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
#define PCSCLITE_MAX_READER_CONTEXT_CHANNELS            16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
/* Maximum channels on an application context */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
#define PCSCLITE_MAX_APPLICATION_CONTEXT_CHANNELS       16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
/* Maximum readers context (a slot is count as a reader) */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
#define PCSCLITE_MAX_READERS_CONTEXTS                   16
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
/* PCSCLITE_MAX_READERS is deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
 * use PCSCLITE_MAX_READERS_CONTEXTS instead */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
/* extern int PCSCLITE_MAX_READERS __attribute__ ((deprecated)); */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
#define PCSCLITE_MAX_THREADS            16      /* Stat change threads */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
#define PCSCLITE_STATUS_WAIT            200000  /* Status Change Sleep */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
#define PCSCLITE_TRANSACTION_TIMEOUT    40      /* Transaction timeout */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
#define MAX_READERNAME                  52
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
#define MAX_LIBNAME                     100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
#define MAX_DEVICENAME          255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
#ifndef SCARD_ATR_LENGTH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
#define SCARD_ATR_LENGTH                MAX_ATR_SIZE    /* Maximum ATR size */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
/*
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 2
diff changeset
   346
 * Enhanced messaging has been added to accommodate newer devices which have
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 2
diff changeset
   347
 * more advanced capabilities, such as dedicated secure co-processors which
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
 * can stream and encrypt data over USB. In order to used enhanced messaging
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
 * you must define PCSCLITE_ENHANCED_MESSAGING in the framework(library),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
 * the daemon, and your application
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
#undef PCSCLITE_ENHANCED_MESSAGING
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
#ifndef PCSCLITE_ENHANCED_MESSAGING
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
#define PCSCLITE_MAX_MESSAGE_SIZE       2048    /* Transport msg len */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
#define MAX_BUFFER_SIZE                 264     /* Maximum Tx/Rx Buffer */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
#define PCSCLITE_SERVER_ATTEMPTS        5       /* Attempts to reach cl */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
#else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
 * The message and buffer sizes must be multiples of 16.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
 * The max message size must be at least large enough
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 2
diff changeset
   361
 * to accommodate the transmit_struct
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
#define PCSCLITE_MAX_MESSAGE_SIZE       (1<<17) /* enhanced (128K) msg len */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
#define MAX_BUFFER_SIZE                 (1<<15) /* enhanced (32K) Tx/Rx Buffer */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
#define PCSCLITE_SERVER_ATTEMPTS        200     /* To allow larger data reads/writes */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
 * Gets a stringified error response
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
char *pcsc_stringify_error(long);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
#ifdef __cplusplus
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
#endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
#endif