-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMCEClientAuth.h
More file actions
152 lines (127 loc) · 5.14 KB
/
MCEClientAuth.h
File metadata and controls
152 lines (127 loc) · 5.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*///////////////////////////////////////////////////////////////////
//MCEClientAuth.h
/////////////////////////////////////////////////////////////////////
// Written by Jeffrey Counts 20th April 2006
// Motion Control Engineering, inc.
// 11380 White Rock Rd.
// Rancho Cordova, CA 95742
// 1-800-444-7442
// www.mceinc.com
//
// Version: 0.0.2
// Modified 9/07/06 : 11:46 AM
// Copyright (c) 2006 Motion Control Engineering
///////////////////////////////////////////////////////////////////*/
#ifndef MCE_CLIENT_AUTHENTICATION_H
#define MCE_CLIENT_AUTHENTICATION_H
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/*///////////////////////////////////////////////////////////////
//initializeEncryption
/////////////////////////////////////////////////////////////////
//Used to initialize encryption tables
// to an iController.
//Arguments:
// none
*/
void initEncryption(void);
/*///////////////////////////////////////////////////////////////
//encryptLogonAuth
/////////////////////////////////////////////////////////////////
//Used to encrypt the data sent to authenticate the client
// to an iController.
//Arguments:
// sessionID: 32 bit integer obtained at run time from
// controller by sending the Logon command.
// vendorID: 32 bit integer obtained pre build time from
// MCE for the Client's Company
// productID: 32 bit integer obtained pre build time from
// MCE for the Client's Application
// bigEndian 32 bit for changeing byte order from little
// endian to big endian. Set to 0 if connecting
// to a PC iCue or 1 if connecting to controller
// (simplex, dispatcher running on IMP board).
// outBuff: char* pointer to a 16 byte buffer that
// will be over written with the encrypted data.
//Returns int: 1 if successfull, 0 if unsuccessfull
*/
int encryptLogonAuth( unsigned int sessionID,
unsigned int vendorID,
unsigned int productID,
unsigned int bigEndian,
char* outBuff);
/*///////////////////////////////////////////////////////////////
//encryptPassword
/////////////////////////////////////////////////////////////////
//Used to encrypt the data sent to authenticate the client
// to an iController.
//Arguments:
// sessionID: 32 bit integer obtained at run time from
// controller by sending the Logon command.
// vendorID: 32 bit integer obtained pre build time from
// MCE for the Client's Company
// productID: 32 bit integer obtained pre build time from
// MCE for the Client's Application
// bigEndian 32 bit for changeing byte order from little
// endian to big endian. Set to 0 if connecting
// to a PC iCue or 1 if connecting to controller
// (simplex, dispatcher running on IMP board).
// password: char* pointer to a 16 byte Ascii char array.
// important, this is not necessarily a null
// terminated string. The password "pswd" must be
// padded with nulls to look like:
// {'p','s','w','d','\0','\0','\0','\0',
// '\0','\0','\0','\0','\0','\0','\0','\0'}
//Returns int: 1 if successfull, 0 if unsuccessfull
//Side Effect: password buffer is overwritten with 16 bytes of
// encrypted data
*/
int encryptPassword( unsigned int sessionID,
unsigned int vendorID,
unsigned int productID,
unsigned int bigEndian,
char* password);
/*///////////////////////////////////////////////////////////////
//encryptSetPasswordData
/////////////////////////////////////////////////////////////////
//Used before sending a new security password to iControl
//This method will take in a 16 char password along with
// the client's information and fill a 128 byte buffer with
// the encrypted data to be sent to the iControl.
//Arguments:
// sessionID: 32 bit integer obtained at run time from
// controller by sending the xxx command.
// vendorID: 32 bit integer obtained pre build time from
// MCE for the Client's Company
// productID: 32 bit integer obtained pre build time from
// MCE for the Client's Application
// securityAccount: 32 bit integer Technician = 0, Manager = 1
// bigEndian 32 bit for changeing byte order from little
// endian to big endian. Set to 0 if connecting
// to a PC iCue or 1 if connecting to controller
// (simplex, dispatcher running on IMP board).
// password: char* pointer to a 16 byte Ascii char array.
// important, this is not necessarily a null
// terminated string. The password "pswd" must be
// padded with nulls to look like:
// {'p','s','w','d','\0','\0','\0','\0',
// '\0','\0','\0','\0','\0','\0','\0','\0'}
// outBuff: char* pointer to a 32 byte buffer that
// will be over written with the encrypted data.
//Returns int: 1 if successfull, 0 if unsuccessfull
//Side Effect: outBuff buffer is overwritten with 32 bytes of
// encrypted data
*/
int encryptSetPassword( unsigned int sessionID,
unsigned int vendorID,
unsigned int productID,
unsigned int securityAccount,
unsigned int bigEndian,
char* password,
char* outBuff);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* MCE_CLIENT_AUTHENTICATION_H */