]> git.proxmox.com Git - qemu.git/blame - libcacard/vcardt.h
vfio-pci: Fix multifunction=on
[qemu.git] / libcacard / vcardt.h
CommitLineData
111a38b0
RR
1/*
2 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
3 * See the COPYING.LIB file in the top-level directory.
4 */
5#ifndef VCARDT_H
6#define VCARDT_H 1
7
8/*
9 * these should come from some common spice header file
10 */
11#include <assert.h>
12#ifndef MIN
13#define MIN(x, y) ((x) > (y) ? (y) : (x))
14#define MAX(x, y) ((x) > (y) ? (x) : (y))
15#endif
16
17typedef struct VCardStruct VCard;
18typedef struct VCardAPDUStruct VCardAPDU;
19typedef struct VCardResponseStruct VCardResponse;
20typedef struct VCardBufferResponseStruct VCardBufferResponse;
21typedef struct VCardAppletStruct VCardApplet;
22typedef struct VCardAppletPrivateStruct VCardAppletPrivate;
23typedef struct VCardKeyStruct VCardKey; /* opaque */
24typedef struct VCardEmulStruct VCardEmul;
25
26#define MAX_CHANNEL 4
27
111a38b0
RR
28typedef enum {
29 VCARD_DONE,
30 VCARD_NEXT,
31 VCARD_FAIL
32} VCardStatus;
33
34typedef enum {
35 VCARD_FILE_SYSTEM,
36 VCARD_VM,
37 VCARD_DIRECT
38} VCardType;
39
40typedef enum {
41 VCARD_POWER_ON,
42 VCARD_POWER_OFF
43} VCardPower;
44
45typedef VCardStatus (*VCardProcessAPDU)(VCard *card, VCardAPDU *apdu,
46 VCardResponse **response);
47typedef VCardStatus (*VCardResetApplet)(VCard *card, int channel);
48typedef void (*VCardAppletPrivateFree) (VCardAppletPrivate *);
49typedef void (*VCardEmulFree) (VCardEmul *);
50typedef void (*VCardGetAtr) (VCard *, unsigned char *atr, int *atr_len);
51
52struct VCardBufferResponseStruct {
53 unsigned char *buffer;
54 int buffer_len;
55 unsigned char *current;
56 int len;
57};
58
59#endif