2003-04-30 15:43:51 +00:00
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* SmartKey Multilan Driver
|
|
|
|
* Copyright EUTRON 2003
|
|
|
|
*/
|
2004-03-18 11:29:31 +00:00
|
|
|
|
2006-12-13 16:22:33 +00:00
|
|
|
#ifndef __SKEYLINK_H
|
|
|
|
#define __SKEYLINK_H
|
2004-03-16 07:46:44 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2003-04-30 15:43:51 +00:00
|
|
|
#define MAKE_KEY_CODE(low,high) (((unsigned short)(low)) | (((unsigned short)(high)) << 8))
|
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Commands
|
|
|
|
*/
|
|
|
|
#define SCRAMBLING_MODE 's'
|
|
|
|
#define READING_MODE 'r'
|
|
|
|
#define WRITING_MODE 'w'
|
|
|
|
#define FIXING_MODE 'f'
|
|
|
|
#define LOCATING_MODE 'l'
|
|
|
|
#define COMPARING_MODE 'c'
|
|
|
|
#define PROGRAMMING_MODE 'p'
|
|
|
|
#define MODEL_READING_MODE 'm'
|
|
|
|
#define ENCRYPTING_MODE 'e'
|
|
|
|
#define BLOCK_READING_MODE MAKE_KEY_CODE('b','r')
|
|
|
|
#define BLOCK_WRITING_MODE MAKE_KEY_CODE('b','w')
|
2003-04-30 15:43:51 +00:00
|
|
|
#define SERIAL_NUMBER_READING_MODE 'n'
|
2006-12-13 16:22:33 +00:00
|
|
|
#define FIX_READING_MODE 'x'
|
|
|
|
#define EXT_MODEL_READING_MODE 'h'
|
|
|
|
#define FAIL_COUNTER_READING_MODE 'a'
|
|
|
|
#define AES_SET_MODE 'g'
|
|
|
|
#define AES_SCRAMBLE_MODE 'o'
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Models
|
|
|
|
*/
|
|
|
|
#define SKEY_FX '1' /* Model FX */
|
|
|
|
#define SKEY_PR '2' /* Model PR */
|
|
|
|
#define SKEY_EP '3' /* Model EP */
|
|
|
|
#define SKEY_SP '9' /* Model SP */
|
2007-09-18 09:32:06 +00:00
|
|
|
#define SKEY_XM 'D' /* Model XM */
|
2006-12-13 16:22:33 +00:00
|
|
|
#define SKEY_NET 'A' /* Model NET */
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Memory sizes
|
|
|
|
*/
|
|
|
|
#define SKEY_MEMORY_NONE '0' /* No memory */
|
|
|
|
#define SKEY_MEMORY_64 '1' /* 64 bytes of memory */
|
|
|
|
#define SKEY_MEMORY_128 '2' /* 128 bytes of memory */
|
|
|
|
#define SKEY_MEMORY_416 '3' /* 416 bytes of memory */
|
|
|
|
#define SKEY_MEMORY_896 '4' /* 896 bytes of memory */
|
2007-09-18 09:32:06 +00:00
|
|
|
#define SKEY_MEMORY_8192 '8' /* 8192 bytes of memory */
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Return codes
|
|
|
|
*/
|
|
|
|
#define ST_OK 0 /* No errors */
|
|
|
|
#define ST_NONE_KEY -1 /* No Smartkey present */
|
|
|
|
#define ST_SYNT_ERR -2 /* Syntax error */
|
|
|
|
#define ST_LABEL_FAILED -3 /* Uncorrect label */
|
|
|
|
#define ST_PW_DATA_FAILED -4 /* Uncorrect password or data */
|
|
|
|
#define ST_EXEC_ERROR -16 /* Max executions reached */
|
|
|
|
#define ST_HW_FAILURE -20 /* Hardware error */
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Field length
|
|
|
|
*/
|
|
|
|
#define LABEL_LENGTH 16
|
|
|
|
#define PASSWORD_LENGTH 16
|
|
|
|
#define DATA_LENGTH 64
|
|
|
|
#define EXTENDED_DATA_LENGTH 352
|
|
|
|
#define SCRAMBLE_LENGTH 8
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Net modes
|
|
|
|
*/
|
|
|
|
#define NET_KEY_OPEN 'O'
|
|
|
|
#define NET_KEY_ACCESS 'A'
|
|
|
|
#define NET_KEY_CLOSE 'C'
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Net commands
|
|
|
|
*/
|
|
|
|
#define USER_NUMBER_MODE 'U'
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Net return codes
|
|
|
|
*/
|
|
|
|
#define ST_NET_ERROR -5 /* Lan error */
|
|
|
|
#define ST_CLOSE_ERROR -6 /* Attempting to CLOSE without OPENing */
|
|
|
|
#define ST_ACCESS_ERROR -7 /* Attempting to ACCESS without OPENing */
|
|
|
|
#define ST_USER_ERROR -8 /* Max user reached */
|
|
|
|
#define ST_NET_PWD_ERR -9 /* Net password wrong */
|
|
|
|
#define ST_INIT_ERROR -11 /* Initialization error */
|
|
|
|
#define ST_TOO_MANY_OPEN_KEY -14 /* Too many open SmartKey */
|
|
|
|
#define ST_NET_PASS_INVALID -15 /* Invalid net password */
|
|
|
|
#define ST_NET_CONF_ERROR -21 /* Configuration error in INI/Registry/Environment */
|
|
|
|
#define ST_NET_ANP_INIT_ERROR -22 /* Error inizializing the ANP protocol */
|
|
|
|
#define ST_NET_TCPIP_INIT_ERROR -23 /* Error inizializing the TCPIP protocol */
|
2003-04-30 15:43:51 +00:00
|
|
|
#define ST_NET_NOVELL_INIT_ERROR -24 /* Error inizializing the Novell protocol */
|
2006-12-13 16:22:33 +00:00
|
|
|
#define ST_NET_LOCAL_INIT_ERROR -25 /* Error inizializing the Local protocol */
|
|
|
|
#define ST_NET_KEY_NOT_MAP -26 /* Not MAP programmed key found when MAP is requested */
|
2003-04-30 15:43:51 +00:00
|
|
|
|
2006-12-13 16:22:33 +00:00
|
|
|
/*
|
|
|
|
* Code returned in data[0] after NET_OPEN
|
|
|
|
*/
|
|
|
|
#define NET_TYPE_LOCAL 0
|
|
|
|
#define NET_TYPE_IPX 1
|
|
|
|
#define NET_TYPE_ANP 2
|
|
|
|
#define NET_TYPE_TCPIP 3
|
2003-04-30 15:43:51 +00:00
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Net command structure
|
|
|
|
*/
|
2003-04-30 15:43:51 +00:00
|
|
|
#pragma pack(push,1)
|
|
|
|
|
|
|
|
typedef struct __KEY_NET {
|
2006-12-13 16:22:33 +00:00
|
|
|
short net_command;
|
|
|
|
unsigned long net_password;
|
|
|
|
short lpt;
|
|
|
|
short command;
|
|
|
|
unsigned char label[LABEL_LENGTH];
|
|
|
|
unsigned char password[PASSWORD_LENGTH];
|
|
|
|
unsigned char data[DATA_LENGTH];
|
|
|
|
short fail_counter;
|
|
|
|
short status;
|
|
|
|
unsigned char ext_data[EXTENDED_DATA_LENGTH];
|
2003-04-30 15:43:51 +00:00
|
|
|
} KEY_NET;
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
|
|
/*
|
2006-12-13 16:22:33 +00:00
|
|
|
* Command function.
|
|
|
|
* It executes the command and returns key->status code.
|
|
|
|
*
|
|
|
|
* short smartlink(KEY_NET* key)
|
|
|
|
*/
|
2003-04-30 15:43:51 +00:00
|
|
|
short __cdecl smartlink(KEY_NET*);
|
2006-12-13 16:22:33 +00:00
|
|
|
|
2004-03-16 07:46:44 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|