Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

sw.h

Go to the documentation of this file.
00001 /*
00002     Simple Operating System for Smartcard Education
00003     Copyright (C) 2002  Matthias Bruestle <m@mbsks.franken.de>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00028 #ifndef SOSSE_ERRNO_H
00029 #define SOSSE_ERRNO_H
00030 
00031 #include <types.h>
00032 
00033 #if CONF_WITH_RETCODEMGR==1
00034 
00039 typedef enum {
00040     SW_COUNTER=0x00,
00041     SW_ACCESS_DENIED=0x10,
00042     SW_AUTH_BLOCKED,
00043     SW_AVAILABLE,
00044     SW_CHANGE_MEMORY_ERROR, // Unused
00045     SW_EOD, // Unused
00046     SW_FILE_EXISTS,
00047     SW_FILE_FILLED, // Unused
00048     SW_FILE_NOT_FOUND,
00049     SW_FILE_TO_SHORT,
00050     SW_INCOMPATIBLE_FILE,
00051     SW_LC_INCONSISTEND_WITH_P1P2,   // Unused
00052     SW_NOT_ALLOWED,
00053     SW_NOT_SUPPORTED,   // Unused
00054     SW_OK,
00055     SW_OTHER,
00056     SW_REF_DATA_INVALID,
00057     SW_REF_DATA_NOT_FOUND,
00058     SW_VERIFCATION_FAILED,  // Unused
00059     SW_WRONG_CLA,
00060     SW_WRONG_CONDITION,
00061     SW_WRONG_DATA,
00062     SW_WRONG_INS,
00063     SW_WRONG_LE,
00064     SW_WRONG_LEN,
00065     SW_WRONG_P1P2,
00066     SW_WRONG_REFERENCE,
00067 } SW;
00068 #else /* CONF_WITH_RETCODEMGR!=1 */
00069 
00074 typedef enum {
00075     SW_ACCESS_DENIED=0x6982,
00076     SW_AUTH_BLOCKED=0x6983,
00077     SW_AVAILABLE=0x6100,
00078     SW_CHANGE_MEMORY_ERROR=0x6581,  // Unused
00079     SW_COUNTER=0x63C0,
00080     SW_EOD=0x6282,  // Unused
00081     SW_FILE_EXISTS=0x6A89,
00082     SW_FILE_FILLED=0x6381,  // Unused
00083     SW_FILE_NOT_FOUND=0x6A82,
00084     SW_FILE_TO_SHORT=0x6A84,
00085     SW_INCOMPATIBLE_FILE=0x6981,
00086     SW_LC_INCONSISTEND_WITH_P1P2=0x6A87,    // Unused
00087     SW_NOT_ALLOWED=0x6986,
00088     SW_NOT_SUPPORTED=0x6A81,    // Unused
00089     SW_OK=0x9000,
00090     SW_OTHER=0x6F00,
00091     SW_REF_DATA_INVALID=0x6984,
00092     SW_REF_DATA_NOT_FOUND=0x6A88,
00093     SW_VERIFCATION_FAILED=0x6300,   // Unused
00094     SW_WRONG_CLA=0x6E00,
00095     SW_WRONG_CONDITION=0x6985,
00096     SW_WRONG_DATA=0x6A80,
00097     SW_WRONG_INS=0x6D00,
00098     SW_WRONG_LE=0x6C00,
00099     SW_WRONG_LEN=0x6700,
00100     SW_WRONG_P1P2=0x6A86,
00101     SW_WRONG_REFERENCE=0x6B00,
00102 } SW;
00103 #endif /* CONF_WITH_RETCODEMGR!=1 */
00104 
00113 #if CONF_WITH_RETCODEMGR==1
00114 extern iu8 sw;
00115 #else /* CONF_WITH_RETCODEMGR!=1 */
00116 extern iu16 sw;
00117 #endif /* CONF_WITH_RETCODEMGR!=1 */
00118 
00123 #if CONF_WITH_RETCODEMGR==1
00124 void sw_set( iu8 value );
00125 #else /* CONF_WITH_RETCODEMGR!=1 */
00126 void sw_set( iu16 value );
00127 #endif /* CONF_WITH_RETCODEMGR!=1 */
00128 
00129 #if CONF_WITH_RETCODEMGR==1
00130 
00137 iu16 sw_get( void );
00138 #else
00139 #define sw_get() sw
00140 #endif /* CONF_WITH_RETCODEMGR==1 */
00141 
00142 #endif /* SOSSE_ERRNO_H */
00143 

Copyright 2002 by Matthias Bruestle. This is licensed under the GNU General Public License.