11 #ifndef CHIPCARD_CHIPCARD_H
12 #define CHIPCARD_CHIPCARD_H
14 #define CHIPCARD_SYS_IS_WINDOWS 0
17 #ifdef LCC_IS_SUBPROJECT
19 # define CHIPCARD_EXPORT
20 # define CHIPCARD_NOEXPORT
22 # ifdef BUILDING_CHIPCARD
24 # if CHIPCARD_SYS_IS_WINDOWS
27 # define CHIPCARD_API __declspec (dllexport)
33 # ifdef GCC_WITH_VISIBILITY_ATTRIBUTE
34 # define CHIPCARD_API __attribute__((visibility("default")))
41 # if CHIPCARD_SYS_IS_WINDOWS
44 # define CHIPCARD_API __declspec (dllimport)
54 # ifdef GCC_WITH_VISIBILITY_ATTRIBUTE
55 # define CHIPCARD_EXPORT __attribute__((visibility("default")))
56 # define CHIPCARD_NOEXPORT __attribute__((visibility("hidden")))
58 # define CHIPCARD_EXPORT
59 # define CHIPCARD_NOEXPORT
64 #if CHIPCARD_SYS_IS_WINDOWS
65 # define CHIPCARD_CB __stdcall
71 #ifndef CHIPCARD_NOWARN_DEPRECATED
73 # define CHIPCARD_DEPRECATED __attribute((__deprecated__))
75 # define CHIPCARD_DEPRECATED
78 # define CHIPCARD_DEPRECATED
81 #include <gwenhywfar/db.h>
82 #include <gwenhywfar/xml.h>
87 #define LC_DEFAULT_PORT 7392
88 #define LC_DEFAULT_UDS_SOCK "/var/run/chipcard.comm"
92 #define LC_ERROR_NONE 0x00000000
93 #define LC_ERROR_GENERIC 0x00000001
94 #define LC_ERROR_INVALID 0x00000002
95 #define LC_ERROR_CARD_REMOVED 0x00000003
96 #define LC_ERROR_CARD_NOT_OWNED 0x00000004
97 #define LC_ERROR_NOT_SUPPORTED 0x00000005
98 #define LC_ERROR_SETUP 0x00000006
99 #define LC_ERROR_NO_DATA 0x00000007
100 #define LC_ERROR_LOCKED_BY_OTHER 0x00000008
101 #define LC_ERROR_NOT_LOCKED 0x00000009
103 #define LC_ERROR_BAD_RESPONSE 0x0000000a
104 #define LC_ERROR_NO_SLOTS_CONNECTED 0x0000000b
105 #define LC_ERROR_NO_SLOTS_DISCONNECTED 0x0000000c
106 #define LC_ERROR_NO_SLOTS_AVAILABLE 0x0000000d
107 #define LC_ERROR_BAD_PIN 0x0000000e
108 #define LC_ERROR_USER_ABORTED 0x0000000f
109 #define LC_ERROR_CARD_DESTROYED 0x00000010
110 #define LC_ERROR_READER_REMOVED 0x00000011
111 #define LC_ERROR_TIMEOUT 0x00000012
112 #define LC_ERROR_IPC 0x00000013
113 #define LC_ERROR_BUFFER_OVERFLOW 0x00000014
118 #define LC_LOGDOMAIN "ccclient"
122 #define LC_READER_FLAGS_KEYPAD 0x00010000
123 #define LC_READER_FLAGS_DISPLAY 0x00020000
124 #define LC_READER_FLAGS_NOINFO 0x00040000
125 #define LC_READER_FLAGS_REMOTE 0x00080000
126 #define LC_READER_FLAGS_AUTO 0x00100000
127 #define LC_READER_FLAGS_SUSPENDED_CHECKS 0x00200000
128 #define LC_READER_FLAGS_DRIVER_HAS_VERIFY 0x00400000
129 #define LC_READER_FLAGS_KEEP_RUNNING 0x00800000
130 #define LC_READER_FLAGS_LOW_WRITE_BOUNDARY 0x01000000
131 #define LC_READER_FLAGS_NO_MEMORY_SW 0x02000000
143 #define LC_DRIVER_FLAGS_RUNTIME_MASK 0xffff0000
144 #define LC_DRIVER_FLAGS_AUTO 0x00010000
145 #define LC_DRIVER_FLAGS_REMOTE 0x00020000
146 #define LC_DRIVER_FLAGS_CONFIG 0x00040000
148 #define LC_DRIVER_FLAGS_HAS_VERIFY_FN 0x00000001
149 #define LC_DRIVER_FLAGS_HAS_MODIFY_FN 0x00000002
161 #define LC_SERVICE_FLAGS_RUNTIME_MASK (\
162 LC_SERVICE_FLAGS_CLIENT \
164 #define LC_SERVICE_FLAGS_CLIENT 0x00000001
165 #define LC_SERVICE_FLAGS_AUTOLOAD 0x00000002
166 #define LC_SERVICE_FLAGS_SILENT 0x00000004
177 #define LC_NOTIFY_FLAGS_DRIVER_MASK 0x0000003f
178 #define LC_NOTIFY_FLAGS_DRIVER_START 0x00000001
179 #define LC_NOTIFY_FLAGS_DRIVER_UP 0x00000002
180 #define LC_NOTIFY_FLAGS_DRIVER_DOWN 0x00000004
181 #define LC_NOTIFY_FLAGS_DRIVER_ERROR 0x00000008
182 #define LC_NOTIFY_FLAGS_DRIVER_ADD 0x00000010
183 #define LC_NOTIFY_FLAGS_DRIVER_DEL 0x00000020
185 #define LC_NOTIFY_FLAGS_READER_MASK 0x00000fc0
186 #define LC_NOTIFY_FLAGS_READER_START 0x00000040
187 #define LC_NOTIFY_FLAGS_READER_UP 0x00000080
188 #define LC_NOTIFY_FLAGS_READER_DOWN 0x00000100
189 #define LC_NOTIFY_FLAGS_READER_ERROR 0x00000200
190 #define LC_NOTIFY_FLAGS_READER_ADD 0x00000400
191 #define LC_NOTIFY_FLAGS_READER_DEL 0x00000800
193 #define LC_NOTIFY_FLAGS_SERVICE_MASK 0x0000f000
194 #define LC_NOTIFY_FLAGS_SERVICE_START 0x00001000
195 #define LC_NOTIFY_FLAGS_SERVICE_UP 0x00002000
196 #define LC_NOTIFY_FLAGS_SERVICE_DOWN 0x00004000
197 #define LC_NOTIFY_FLAGS_SERVICE_ERROR 0x00008000
199 #define LC_NOTIFY_FLAGS_CARD_MASK 0x000f0000
200 #define LC_NOTIFY_FLAGS_CARD_INSERTED 0x00010000
201 #define LC_NOTIFY_FLAGS_CARD_REMOVED 0x00020000
202 #define LC_NOTIFY_FLAGS_CARD_RFU1 0x00040000
203 #define LC_NOTIFY_FLAGS_CARD_RFU2 0x00080000
205 #define LC_NOTIFY_FLAGS_CLIENT_MASK 0xfff00000
206 #define LC_NOTIFY_FLAGS_CLIENT_UP 0x00100000
207 #define LC_NOTIFY_FLAGS_CLIENT_DOWN 0x00200000
208 #define LC_NOTIFY_FLAGS_CLIENT_STARTWAIT 0x00400000
209 #define LC_NOTIFY_FLAGS_CLIENT_STOPWAIT 0x00800000
210 #define LC_NOTIFY_FLAGS_CLIENT_TAKECARD 0x01000000
211 #define LC_NOTIFY_FLAGS_CLIENT_GOTCARD 0x02000000
213 #define LC_NOTIFY_FLAGS_CLIENT_CMDSEND 0x04000000
214 #define LC_NOTIFY_FLAGS_CLIENT_CMDRECV 0x08000000
216 #define LC_NOTIFY_FLAGS_SINGLESHOT 0x80000000
218 #define LC_NOTIFY_FLAGS_PRIVILEGED (\
219 LC_NOTIFY_FLAGS_CLIENT_CMDSEND |\
220 LC_NOTIFY_FLAGS_CLIENT_CMDRECV)
237 #define LC_NOTIFY_TYPE_DRIVER "driver"
238 #define LC_NOTIFY_CODE_DRIVER_START "start"
239 #define LC_NOTIFY_CODE_DRIVER_UP "up"
240 #define LC_NOTIFY_CODE_DRIVER_DOWN "down"
241 #define LC_NOTIFY_CODE_DRIVER_ERROR "error"
242 #define LC_NOTIFY_CODE_DRIVER_ADD "add"
243 #define LC_NOTIFY_CODE_DRIVER_DEL "del"
245 #define LC_NOTIFY_TYPE_READER "reader"
246 #define LC_NOTIFY_CODE_READER_START "start"
247 #define LC_NOTIFY_CODE_READER_UP "up"
248 #define LC_NOTIFY_CODE_READER_DOWN "down"
249 #define LC_NOTIFY_CODE_READER_ERROR "error"
250 #define LC_NOTIFY_CODE_READER_ADD "add"
251 #define LC_NOTIFY_CODE_READER_DEL "del"
253 #define LC_NOTIFY_TYPE_SERVICE "service"
254 #define LC_NOTIFY_CODE_SERVICE_START "start"
255 #define LC_NOTIFY_CODE_SERVICE_UP "up"
256 #define LC_NOTIFY_CODE_SERVICE_DOWN "down"
257 #define LC_NOTIFY_CODE_SERVICE_ERROR "error"
259 #define LC_NOTIFY_TYPE_CARD "card"
260 #define LC_NOTIFY_CODE_CARD_INSERTED "inserted"
261 #define LC_NOTIFY_CODE_CARD_REMOVED "removed"
262 #define LC_NOTIFY_CODE_CARD_RFU1 "rfu1"
263 #define LC_NOTIFY_CODE_CARD_RFU2 "rfu2"
265 #define LC_NOTIFY_TYPE_CLIENT "client"
266 #define LC_NOTIFY_CODE_CLIENT_UP "up"
267 #define LC_NOTIFY_CODE_CLIENT_DOWN "down"
268 #define LC_NOTIFY_CODE_CLIENT_STARTWAIT "startwait"
269 #define LC_NOTIFY_CODE_CLIENT_STOPWAIT "stopwait"
270 #define LC_NOTIFY_CODE_CLIENT_TAKECARD "takecard"
271 #define LC_NOTIFY_CODE_CLIENT_GOTCARD "gotcard"
273 #define LC_NOTIFY_CODE_CLIENT_CMDSEND "cmdsend"
274 #define LC_NOTIFY_CODE_CLIENT_CMDRECV "cmdrecv"
CHIPCARD_API void LC_NotifyFlags_toDb(GWEN_DB_NODE *db, const char *name, uint32_t fl)
Definition: chipcard.h:314
Definition: chipcard.h:284
Definition: chipcard.h:322
LC_READER_STATUS
Definition: chipcard.h:295
Definition: chipcard.h:302
Definition: chipcard.h:303
LC_CARD_TYPE
Definition: chipcard.h:338
Definition: chipcard.h:301
CHIPCARD_API LC_SERVICE_STATUS LC_ServiceStatus_fromString(const char *s)
CHIPCARD_API LC_DRIVER_STATUS LC_DriverStatus_fromString(const char *s)
Definition: chipcard.h:330
LC_SERVICE_STATUS
Definition: chipcard.h:313
Definition: chipcard.h:332
Definition: chipcard.h:306
Definition: chipcard.h:318
Definition: chipcard.h:331
Definition: chipcard.h:281
CHIPCARD_API void LC_ReaderFlags_toDb(GWEN_DB_NODE *db, const char *name, uint32_t fl)
const char * LC_Error_toString(uint32_t err)
CHIPCARD_API uint32_t LC_DriverFlags_fromDb(GWEN_DB_NODE *db, const char *name)
Definition: chipcard.h:319
Definition: chipcard.h:285
Definition: chipcard.h:317
#define CHIPCARD_API
Definition: chipcard.h:50
Definition: chipcard.h:316
Definition: chipcard.h:341
Definition: chipcard.h:339
Definition: chipcard.h:296
CHIPCARD_API uint32_t LC_NotifyFlags_fromDb(GWEN_DB_NODE *db, const char *name)
CHIPCARD_API const char * LC_ServiceStatus_toString(LC_SERVICE_STATUS st)
Definition: chipcard.h:340
CHIPCARD_API uint32_t LC_ServiceFlags_fromDb(GWEN_DB_NODE *db, const char *name)
Definition: chipcard.h:283
Definition: chipcard.h:315
Definition: chipcard.h:305
CHIPCARD_API const char * LC_ReaderStatus_toString(LC_READER_STATUS rst)
Definition: chipcard.h:299
CHIPCARD_API uint32_t LC_ReaderFlags_fromXml(GWEN_XMLNODE *node, const char *name)
CHIPCARD_API void LC_ServiceFlags_toDb(GWEN_DB_NODE *db, const char *name, uint32_t fl)
Definition: chipcard.h:321
Definition: chipcard.h:304
Definition: chipcard.h:300
CHIPCARD_API int LC_DriverFlags_toDb(GWEN_DB_NODE *db, const char *name, uint32_t flags)
CHIPCARD_API const char * LC_DriverStatus_toString(LC_DRIVER_STATUS dst)
Definition: chipcard.h:287
CHIPCARD_API LC_READER_STATUS LC_ReaderStatus_fromString(const char *s)
Definition: chipcard.h:282
CHIPCARD_API uint32_t LC_ReaderFlags_fromDb(GWEN_DB_NODE *db, const char *name)
Definition: chipcard.h:298
Definition: chipcard.h:288
LC_CARD_STATUS
Definition: chipcard.h:329
Definition: chipcard.h:297
Definition: chipcard.h:320
LC_DRIVER_STATUS
Definition: chipcard.h:280
Definition: chipcard.h:286
Definition: chipcard.h:334