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