root / libcacard / vcardt.h @ 44dc0ca3
History | View | Annotate | Download (1.7 kB)
1 | 111a38b0 | Robert Relyea | /*
|
---|---|---|---|
2 | 111a38b0 | Robert Relyea | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
|
3 | 111a38b0 | Robert Relyea | * See the COPYING.LIB file in the top-level directory.
|
4 | 111a38b0 | Robert Relyea | */
|
5 | 111a38b0 | Robert Relyea | #ifndef VCARDT_H
|
6 | 111a38b0 | Robert Relyea | #define VCARDT_H 1 |
7 | 111a38b0 | Robert Relyea | |
8 | 111a38b0 | Robert Relyea | /*
|
9 | 111a38b0 | Robert Relyea | * these should come from some common spice header file
|
10 | 111a38b0 | Robert Relyea | */
|
11 | 111a38b0 | Robert Relyea | #include <assert.h> |
12 | 111a38b0 | Robert Relyea | #ifndef MIN
|
13 | 111a38b0 | Robert Relyea | #define MIN(x, y) ((x) > (y) ? (y) : (x))
|
14 | 111a38b0 | Robert Relyea | #define MAX(x, y) ((x) > (y) ? (x) : (y))
|
15 | 111a38b0 | Robert Relyea | #endif
|
16 | 111a38b0 | Robert Relyea | |
17 | 111a38b0 | Robert Relyea | typedef struct VCardStruct VCard; |
18 | 111a38b0 | Robert Relyea | typedef struct VCardAPDUStruct VCardAPDU; |
19 | 111a38b0 | Robert Relyea | typedef struct VCardResponseStruct VCardResponse; |
20 | 111a38b0 | Robert Relyea | typedef struct VCardBufferResponseStruct VCardBufferResponse; |
21 | 111a38b0 | Robert Relyea | typedef struct VCardAppletStruct VCardApplet; |
22 | 111a38b0 | Robert Relyea | typedef struct VCardAppletPrivateStruct VCardAppletPrivate; |
23 | 111a38b0 | Robert Relyea | typedef struct VCardKeyStruct VCardKey; /* opaque */ |
24 | 111a38b0 | Robert Relyea | typedef struct VCardEmulStruct VCardEmul; |
25 | 111a38b0 | Robert Relyea | |
26 | 111a38b0 | Robert Relyea | #define MAX_CHANNEL 4 |
27 | 111a38b0 | Robert Relyea | |
28 | 111a38b0 | Robert Relyea | /* create an ATR with appropriate historical bytes */
|
29 | 111a38b0 | Robert Relyea | #define VCARD_ATR_PREFIX(size) 0x3b, 0x66+(size), 0x00, 0xff, \ |
30 | 111a38b0 | Robert Relyea | 'V', 'C', 'A', 'R', 'D', '_' |
31 | 111a38b0 | Robert Relyea | |
32 | 111a38b0 | Robert Relyea | |
33 | 111a38b0 | Robert Relyea | typedef enum { |
34 | 111a38b0 | Robert Relyea | VCARD_DONE, |
35 | 111a38b0 | Robert Relyea | VCARD_NEXT, |
36 | 111a38b0 | Robert Relyea | VCARD_FAIL |
37 | 111a38b0 | Robert Relyea | } VCardStatus; |
38 | 111a38b0 | Robert Relyea | |
39 | 111a38b0 | Robert Relyea | typedef enum { |
40 | 111a38b0 | Robert Relyea | VCARD_FILE_SYSTEM, |
41 | 111a38b0 | Robert Relyea | VCARD_VM, |
42 | 111a38b0 | Robert Relyea | VCARD_DIRECT |
43 | 111a38b0 | Robert Relyea | } VCardType; |
44 | 111a38b0 | Robert Relyea | |
45 | 111a38b0 | Robert Relyea | typedef enum { |
46 | 111a38b0 | Robert Relyea | VCARD_POWER_ON, |
47 | 111a38b0 | Robert Relyea | VCARD_POWER_OFF |
48 | 111a38b0 | Robert Relyea | } VCardPower; |
49 | 111a38b0 | Robert Relyea | |
50 | 111a38b0 | Robert Relyea | typedef VCardStatus (*VCardProcessAPDU)(VCard *card, VCardAPDU *apdu,
|
51 | 111a38b0 | Robert Relyea | VCardResponse **response); |
52 | 111a38b0 | Robert Relyea | typedef VCardStatus (*VCardResetApplet)(VCard *card, int channel); |
53 | 111a38b0 | Robert Relyea | typedef void (*VCardAppletPrivateFree) (VCardAppletPrivate *); |
54 | 111a38b0 | Robert Relyea | typedef void (*VCardEmulFree) (VCardEmul *); |
55 | 111a38b0 | Robert Relyea | typedef void (*VCardGetAtr) (VCard *, unsigned char *atr, int *atr_len); |
56 | 111a38b0 | Robert Relyea | |
57 | 111a38b0 | Robert Relyea | struct VCardBufferResponseStruct {
|
58 | 111a38b0 | Robert Relyea | unsigned char *buffer; |
59 | 111a38b0 | Robert Relyea | int buffer_len;
|
60 | 111a38b0 | Robert Relyea | unsigned char *current; |
61 | 111a38b0 | Robert Relyea | int len;
|
62 | 111a38b0 | Robert Relyea | }; |
63 | 111a38b0 | Robert Relyea | |
64 | 111a38b0 | Robert Relyea | #endif |