source: trunk/csctapi/t1_block.h@ 1

Last change on this file since 1 was 1, checked in by root, 14 years ago

initial import

File size: 2.6 KB
Line 
1/*
2 t1_block.h
3 T=1 block abstract data type definitions
4
5 This file is part of the Unix driver for Towitoko smartcard readers
6 Copyright (C) 2000 Carlos Prados <cprados@yahoo.com>
7
8 This version is modified by doz21 to work in a special manner ;)
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23*/
24
25#ifndef _T1_BLOCK_
26#define _T1_BLOCK_
27
28#include "defines.h"
29
30/*
31 * Exported constants definition
32 */
33
34/* Buffer sizes */
35#define T1_BLOCK_MAX_SIZE 259
36#define T1_BLOCK_INF_MAX_SIZE 254
37
38/* Types of block */
39#define T1_BLOCK_I 0x00
40#define T1_BLOCK_R_OK 0x80
41#define T1_BLOCK_R_EDC_ERR 0x81
42#define T1_BLOCK_R_OTHER_ERR 0x82
43#define T1_BLOCK_S_RESYNCH_REQ 0xC0
44#define T1_BLOCK_S_RESYNCH_RES 0xE0
45#define T1_BLOCK_S_IFS_REQ 0xC1
46#define T1_BLOCK_S_IFS_RES 0xE1
47#define T1_BLOCK_S_ABORT_REQ 0xC2
48#define T1_BLOCK_S_ABORT_RES 0xE2
49#define T1_BLOCK_S_WTX_REQ 0xC3
50#define T1_BLOCK_S_WTX_RES 0xE3
51#define T1_BLOCK_S_VPP_ERR 0xE4
52
53/*
54 * Exported data types definition
55 */
56
57typedef struct
58{
59 BYTE * data;
60 unsigned length;
61}
62T1_Block;
63
64/*
65 * Exported functions declaration
66 */
67
68extern T1_Block *
69T1_Block_New (BYTE * buffer, unsigned length);
70
71extern T1_Block *
72T1_Block_NewIBlock (BYTE len, BYTE * inf, BYTE ns, bool more);
73
74extern T1_Block *
75T1_Block_NewRBlock (BYTE type, BYTE nr);
76
77extern T1_Block *
78T1_Block_NewSBlock (BYTE type, BYTE len, BYTE * inf);
79
80extern BYTE
81T1_Block_GetType (T1_Block * block);
82
83extern BYTE
84T1_Block_GetNS (T1_Block * block);
85
86extern bool
87T1_Block_GetMore (T1_Block * block);
88
89extern BYTE
90T1_Block_GetNR (T1_Block * block);
91
92extern BYTE
93T1_Block_GetLen (T1_Block * block);
94
95extern BYTE *
96T1_Block_GetInf (T1_Block * block);
97
98extern BYTE *
99T1_Block_Raw (T1_Block * block);
100
101extern unsigned
102T1_Block_RawLen (T1_Block * block);
103
104extern void
105T1_Block_Delete (T1_Block * block);
106
107#endif /* _T1_BLOCK_ */
108
Note: See TracBrowser for help on using the repository browser.