~ubuntu-branches/ubuntu/jaunty/pcsc-lite/jaunty-security

« back to all changes in this revision

Viewing changes to src/atrhandler.h

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Rousseau
  • Date: 2005-11-27 18:04:59 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127180459-qrex2gzpq9d8jexd
Tags: 1.2.9-beta9-1
* New upstream version
* debian/compat: change from 3 to 4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * MUSCLE SmartCard Development ( http://www.linuxnet.com )
 
3
 *
 
4
 * Copyright (C) 1999
 
5
 *  David Corcoran <corcoran@linuxnet.com>
 
6
 *
 
7
 * $Id: atrhandler.h 1421 2005-04-12 12:09:21Z rousseau $
 
8
 */
 
9
 
 
10
/**
 
11
 * @file
 
12
 * @brief This keeps track of smartcard protocols, timing issues
 
13
 * and Answer to Reset ATR handling.
 
14
 */
 
15
 
 
16
#ifndef __atrhandler_h__
 
17
#define __atrhandler_h__
 
18
 
 
19
#ifdef __cplusplus
 
20
extern "C"
 
21
{
 
22
#endif
 
23
 
 
24
#define SCARD_CONVENTION_DIRECT  0x0001
 
25
#define SCARD_CONVENTION_INVERSE 0x0002
 
26
 
 
27
        typedef struct _SMARTCARD_EXTENSION
 
28
        {
 
29
 
 
30
                struct _ATR
 
31
                {
 
32
                        DWORD Length;
 
33
                        UCHAR Value[MAX_ATR_SIZE];
 
34
                        DWORD HistoryLength;
 
35
                        UCHAR HistoryValue[MAX_ATR_SIZE];
 
36
                }
 
37
                ATR;
 
38
 
 
39
                DWORD ReadTimeout;
 
40
 
 
41
                struct _CardCapabilities
 
42
                {
 
43
                        UCHAR AvailableProtocols;
 
44
                        UCHAR CurrentProtocol;
 
45
                        UCHAR Convention;
 
46
                        USHORT ETU;
 
47
 
 
48
                        struct _PtsData
 
49
                        {
 
50
                                UCHAR F1;
 
51
                                UCHAR D1;
 
52
                                UCHAR I1;
 
53
                                UCHAR P1;
 
54
                                UCHAR N1;
 
55
                        }
 
56
                        PtsData;
 
57
 
 
58
                        struct _T1
 
59
                        {
 
60
                                USHORT BGT;
 
61
                                USHORT BWT;
 
62
                                USHORT CWT;
 
63
                                USHORT CGT;
 
64
                                USHORT WT;
 
65
                        }
 
66
                        T1;
 
67
 
 
68
                        struct _T0
 
69
                        {
 
70
                                USHORT BGT;
 
71
                                USHORT BWT;
 
72
                                USHORT CWT;
 
73
                                USHORT CGT;
 
74
                                USHORT WT;
 
75
                        }
 
76
                        T0;
 
77
 
 
78
                }
 
79
                CardCapabilities;
 
80
 
 
81
                /*
 
82
                 * PREADER_CONNECTION psReaderConnection; 
 
83
                 */
 
84
 
 
85
        }
 
86
        SMARTCARD_EXTENSION, *PSMARTCARD_EXTENSION;
 
87
 
 
88
        /*
 
89
         * Decodes the ATR and fills the structure 
 
90
         */
 
91
 
 
92
        short ATRDecodeAtr(PSMARTCARD_EXTENSION psExtension,
 
93
                PUCHAR pucAtr, DWORD dwLength);
 
94
 
 
95
#ifdef __cplusplus
 
96
}
 
97
#endif
 
98
 
 
99
#endif                                                  /* __atrhandler_h__ */