supplicant.h
Go to the documentation of this file.
1 /**
2  * @file supplicant.h
3  * @brief 802.1X supplicant
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneEAP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.0
29  **/
30 
31 #ifndef _SUPPLICANT_H
32 #define _SUPPLICANT_H
33 
34 //Forward declaration of SupplicantContext structure
35 struct _SupplicantContext;
36 #define SupplicantContext struct _SupplicantContext
37 
38 //Dependencies
39 #include "eap/eap.h"
40 #include "eap/eap_peer_fsm.h"
43 
44 //802.1X supplicant support
45 #ifndef SUPPLICANT_SUPPORT
46  #define SUPPLICANT_SUPPORT ENABLED
47 #elif (SUPPLICANT_SUPPORT != ENABLED && SUPPLICANT_SUPPORT != DISABLED)
48  #error SUPPLICANT_SUPPORT parameter is not valid
49 #endif
50 
51 //Stack size required to run the 802.1X supplicant
52 #ifndef SUPPLICANT_STACK_SIZE
53  #define SUPPLICANT_STACK_SIZE 750
54 #elif (SUPPLICANT_STACK_SIZE < 1)
55  #error SUPPLICANT_STACK_SIZE parameter is not valid
56 #endif
57 
58 //Priority at which the 802.1X supplicant should run
59 #ifndef SUPPLICANT_PRIORITY
60  #define SUPPLICANT_PRIORITY OS_TASK_PRIORITY_NORMAL
61 #endif
62 
63 //802.1X supplicant tick interval (in milliseconds)
64 #ifndef SUPPLICANT_TICK_INTERVAL
65  #define SUPPLICANT_TICK_INTERVAL 1000
66 #elif (SUPPLICANT_TICK_INTERVAL < 10)
67  #error SUPPLICANT_TICK_INTERVAL parameter is not valid
68 #endif
69 
70 //Size of the transmission buffer
71 #ifndef SUPPLICANT_TX_BUFFER_SIZE
72  #define SUPPLICANT_TX_BUFFER_SIZE 3000
73 #elif (SUPPLICANT_TX_BUFFER_SIZE < 1)
74  #error SUPPLICANT_TX_BUFFER_SIZE parameter is not valid
75 #endif
76 
77 //Size of the reception buffer
78 #ifndef SUPPLICANT_RX_BUFFER_SIZE
79  #define SUPPLICANT_RX_BUFFER_SIZE 1500
80 #elif (SUPPLICANT_RX_BUFFER_SIZE < 1)
81  #error SUPPLICANT_RX_BUFFER_SIZE parameter is not valid
82 #endif
83 
84 //Maximum length of user name
85 #ifndef SUPPLICANT_MAX_USERNAME_LEN
86  #define SUPPLICANT_MAX_USERNAME_LEN 64
87 #elif (SUPPLICANT_MAX_USERNAME_LEN < 1)
88  #error SUPPLICANT_MAX_USERNAME_LEN parameter is not valid
89 #endif
90 
91 //Maximum length of password
92 #ifndef SUPPLICANT_MAX_PASSWORD_LEN
93  #define SUPPLICANT_MAX_PASSWORD_LEN 64
94 #elif (SUPPLICANT_MAX_PASSWORD_LEN < 1)
95  #error SUPPLICANT_MAX_PASSWORD_LEN parameter is not valid
96 #endif
97 
98 //Initialization value used for the heldWhile timer
99 #ifndef SUPPLICANT_DEFAULT_HELD_PERIOD
100  #define SUPPLICANT_DEFAULT_HELD_PERIOD 60
101 #elif (SUPPLICANT_DEFAULT_HELD_PERIOD < 0)
102  #error SUPPLICANT_DEFAULT_HELD_PERIOD parameter is not valid
103 #endif
104 
105 //Initialization value used for the startWhen timer
106 #ifndef SUPPLICANT_DEFAULT_START_PERIOD
107  #define SUPPLICANT_DEFAULT_START_PERIOD 30
108 #elif (SUPPLICANT_DEFAULT_START_PERIOD < 0)
109  #error SUPPLICANT_DEFAULT_START_PERIOD parameter is not valid
110 #endif
111 
112 //Maximum number of successive EAPOL-Start messages
113 #ifndef SUPPLICANT_DEFAULT_MAX_START
114  #define SUPPLICANT_DEFAULT_MAX_START 3
115 #elif (SUPPLICANT_DEFAULT_MAX_START < 0)
116  #error SUPPLICANT_DEFAULT_MAX_START parameter is not valid
117 #endif
118 
119 //Initialization value used for the authWhile timer
120 #ifndef SUPPLICANT_DEFAULT_AUTH_PERIOD
121  #define SUPPLICANT_DEFAULT_AUTH_PERIOD 30
122 #elif (SUPPLICANT_DEFAULT_AUTH_PERIOD < 0)
123  #error SUPPLICANT_DEFAULT_AUTH_PERIOD parameter is not valid
124 #endif
125 
126 //EAP-TLS supported?
127 #if (EAP_TLS_SUPPORT == ENABLED)
128  #include "core/crypto.h"
129  #include "tls.h"
130 #endif
131 
132 //C++ guard
133 #ifdef __cplusplus
134 extern "C" {
135 #endif
136 
137 //EAP-TLS supported?
138 #if (EAP_TLS_SUPPORT == ENABLED)
139 
140 /**
141  * @brief TLS initialization callback function
142  **/
143 
146 
147 #endif
148 
149 
150 /**
151  * @brief Supplicant PAE state change callback function
152  **/
153 
155  SupplicantPaeState state);
156 
157 
158 /**
159  * @brief Supplicant backend state change callback function
160  **/
161 
163  SupplicantBackendState state);
164 
165 
166 /**
167  * @brief EAP peer state change callback function
168  **/
169 
171  EapPeerState state);
172 
173 
174 /**
175  * @brief Tick callback function
176  **/
177 
178 typedef void (*SupplicantTickCallback)(SupplicantContext *context);
179 
180 
181 /**
182  * @brief 802.1X supplicant settings
183  **/
184 
185 typedef struct
186 {
187  OsTaskParameters task; ///<Task parameters
188  NetInterface *interface; ///<Underlying network interface
189  uint_t portIndex; ///<Port index
190 #if (EAP_TLS_SUPPORT == ENABLED)
191  SupplicantTlsInitCallback tlsInitCallback; ///<TLS initialization callback function
192 #endif
193  SupplicantPaeStateChangeCallback paeStateChangeCallback; ///<Supplicant PAE state change callback function
194  SupplicantBackendStateChangeCallback backendStateChangeCallback; ///<Supplicant backend state change callback function
195  EapPeerStateChangeCallback eapPeerStateChangeCallback; ///<EAP peer state change callback function
196  SupplicantTickCallback tickCallback; ///<Tick callback function
198 
199 
200 /**
201  * @brief 802.1X supplicant context
202  **/
203 
205 {
206  bool_t running; ///<Operational state of the supplicant
207  bool_t stop; ///<Stop request
208  OsEvent event; ///<Event object used to poll the sockets
209  OsTaskParameters taskParams; ///<Task parameters
210  OsTaskId taskId; ///<Task identifier
211  NetInterface *interface; ///<Underlying network interface
212  uint_t portIndex; ///<Port index
213  Socket *socket; ///<Underlying socket
215 #if (EAP_MD5_SUPPORT == ENABLED)
217  uint8_t digest[MD5_DIGEST_SIZE]; ///<Calculated hash value
218 #endif
219 #if (EAP_TLS_SUPPORT == ENABLED)
220  TlsContext *tlsContext; ///<TLS context
221  TlsSessionState tlsSession; ///<TLS session state
222  SupplicantTlsInitCallback tlsInitCallback; ///<TLS initialization callback function
223 #endif
224  SupplicantPaeStateChangeCallback paeStateChangeCallback; ///<Supplicant PAE state change callback function
225  SupplicantBackendStateChangeCallback backendStateChangeCallback; ///<Supplicant backend state change callback function
226  EapPeerStateChangeCallback eapPeerStateChangeCallback; ///<EAP peer state change callback function
227  SupplicantTickCallback tickCallback; ///<Tick callback function
228  systime_t timestamp; ///<Timestamp to manage timeout
229 
230  uint8_t txBuffer[SUPPLICANT_TX_BUFFER_SIZE]; ///<Transmission buffer
233  size_t txBufferLen;
234  uint8_t rxBuffer[SUPPLICANT_TX_BUFFER_SIZE]; ///<Reception buffer
235  size_t rxBufferPos;
236  size_t rxBufferLen;
237 
238  SupplicantPaeState suppPaeState; ///<Supplicant PAE state
239  SupplicantBackendState suppBackendState; ///<Supplicant backend state
240 
241  uint_t authWhile; ///<Timer used by the supplicant backend state machine (8.2.2.1 a)
242  uint_t heldWhile; ///<Timer used by the supplicant PAE state machine (8.2.2.1 c)
243  uint_t startWhen; ///<Timer used by the supplicant PAE state machine (8.2.2.1 f)
244 
245  bool_t eapFail; ///<The authentication has failed (8.2.2.2 g)
246  bool_t eapolEap; ///<EAPOL PDU carrying a packet Type of EAP-Packet is received (8.2.2.2 h)
247  bool_t eapSuccess; ///<The authentication process succeeds (8.2.2.2 i)
248  bool_t initialize; ///<Forces all EAPOL state machines to their initial state (8.2.2.2 k)
249  bool_t keyDone; ///<Variable set by the key machine (8.2.2.2 m)
250  bool_t keyRun; ///<Variable set by the PACP machine (8.2.2.2 n)
251  SupplicantPortMode portControl; ///<Port control (8.2.2.2 p)
252  bool_t portEnabled; ///<Operational state of the port (8.2.2.2 q)
253  bool_t portValid; ///<The value of this variable is set externally (8.2.2.2 s)
254  bool_t suppAbort; ///<Aborts an authentication sequence (8.2.2.2 u)
255  bool_t suppFail; ///<Unsuccessful authentication sequence (8.2.2.2 v)
256  SupplicantPortStatus suppPortStatus; ///<Current authorization state of the supplicant PAE state machine (8.2.2.2 w)
257  bool_t suppStart; ///<Start an authentication sequence (8.2.2.2 x)
258  bool_t suppSuccess; ///<Successful authentication sequence (8.2.2.2 y)
259  bool_t suppTimeout; ///<The authentication sequence has timed out (8.2.2.2 z)
260 
261  bool_t eapRestart; ///<The higher layer is ready to establish an authentication session (8.2.11.1.1 a)
262  bool_t logoffSent; ///<An EAPOL-Logoff message has been sent (8.2.11.1.1 b)
263  SupplicantPortMode sPortMode; ///<Used to switch between the auto and non-auto modes of operation (8.2.11.1.1 c)
264  uint_t startCount; ///<Number of EAPOL-Start messages that have been sent (8.2.11.1.1 d)
265  bool_t userLogoff; ///<The user is logged off (8.2.11.1.1 e)
266 
267  uint_t heldPeriod; ///<Initialization value used for the heldWhile timer (8.2.11.1.2 a)
268  uint_t startPeriod; ///<Initialization value used for the startWhen timer (8.2.11.1.2 b)
269  uint_t maxStart; ///<Maximum number of successive EAPOL-Start messages that will be sent (8.2.11.1.2 c)
270 
271  bool_t eapNoResp; ///<No EAP Response for the last EAP frame delivered to EAP (8.2.12.1.1 a)
272  bool_t eapReq; ///<An EAP frame is available for processing by EAP (8.2.12.1.1 b)
273  bool_t eapResp; ///<An EAP frame available for transmission to authenticator (8.2.12.1.1 c)
274 
275  uint_t authPeriod; ///<Initialization value used for the authWhile timer (8.2.12.1.2 a)
276 
277  EapPeerState eapPeerState; ///<EAP peer state
278 
280  const uint8_t *eapReqData; ///<Contents of the EAP request (4.1.1)
281  size_t eapReqDataLen; ///<Length of the EAP request
282  uint_t idleWhile; ///<Timer (4.1.1)
283  bool_t altAccept; ///<Alternate indication of success (4.1.1)
284  bool_t altReject; ///<Alternate indication of failure (4.1.1)
285  uint8_t *eapRespData; ///<EAP response to send (4.1.2)
286  size_t eapRespDataLen; ///<Length of the EAP response
287  uint8_t *eapKeyData; ///<EAP key (4.1.2)
288  bool_t eapKeyAvailable; ///<Keying material is available (4.1.2)
289  uint_t clientTimeout; ///<Time to wait for a valid request before aborting (4.1.3)
290 
291  EapMethodType selectedMethod; ///<The method currently in progress (4.3.1)
292  EapMethodState methodState; ///<Method state (4.3.1)
293  uint_t lastId; ///<EAP identifier value of the last request (4.3.1)
294  uint8_t *lastRespData; ///<Last EAP packet sent from the peer (4.3.1)
295  size_t lastRespDataLen; ///<Length of the last EAP response
296  EapDecision decision; ///<Decision (4.3.1)
297 
298  bool_t rxReq; ///<The current received packet is an EAP Request (4.3.2)
299  bool_t rxSuccess; ///<The current received packet is an EAP Success (4.3.2)
300  bool_t rxFailure; ///<The current received packet is an EAP Failure (4.3.2)
301  uint_t reqId; ///<Identifier value associated with the current EAP request (4.3.2)
302  EapMethodType reqMethod; ///<Method type of the current EAP request (4.3.2)
303  bool_t ignore; ///<Drop the current packet (4.3.2)
304 
305  bool_t allowCanned; ///<Allow canned EAP Success and Failure packets
306  bool_t busy; ///<Busy flag
307 };
308 
309 
310 //Supplicant related functions
312 
314  const SupplicantSettings *settings);
315 
317  const char_t *username);
318 
320  const char_t *password);
321 
324 
325 void supplicantTask(SupplicantContext *context);
326 
327 void supplicantDeinit(SupplicantContext *context);
328 
329 //C++ guard
330 #ifdef __cplusplus
331 }
332 #endif
333 
334 #endif
unsigned int uint_t
Definition: compiler_port.h:50
char char_t
Definition: compiler_port.h:48
int bool_t
Definition: compiler_port.h:53
General definitions for cryptographic algorithms.
EAP (Extensible Authentication Protocol)
EapMethodType
EAP method types.
Definition: eap.h:164
EapMethodState
EAP method states.
EapDecision
Decisions.
EAP peer state machine.
EapPeerState
EAP peer states.
Definition: eap_peer_fsm.h:53
error_t
Error codes.
Definition: error.h:43
#define MD5_DIGEST_SIZE
Definition: md5.h:45
#define NetInterface
Definition: net.h:36
uint32_t systime_t
System time.
thread_t * OsTaskId
Task identifier.
#define Socket
Definition: socket.h:36
802.1X supplicant context
Definition: supplicant.h:205
bool_t suppFail
Unsuccessful authentication sequence (8.2.2.2 v)
Definition: supplicant.h:255
bool_t portValid
The value of this variable is set externally (8.2.2.2 s)
Definition: supplicant.h:253
systime_t timestamp
Timestamp to manage timeout.
Definition: supplicant.h:228
size_t eapRespDataLen
Length of the EAP response.
Definition: supplicant.h:286
SupplicantPortMode portControl
Port control (8.2.2.2 p)
Definition: supplicant.h:251
SupplicantPortMode sPortMode
Used to switch between the auto and non-auto modes of operation (8.2.11.1.1 c)
Definition: supplicant.h:263
EapDecision decision
Decision (4.3.1)
Definition: supplicant.h:296
SupplicantPortStatus suppPortStatus
Current authorization state of the supplicant PAE state machine (8.2.2.2 w)
Definition: supplicant.h:256
bool_t eapRestart
The higher layer is ready to establish an authentication session (8.2.11.1.1 a)
Definition: supplicant.h:261
size_t eapReqDataLen
Length of the EAP request.
Definition: supplicant.h:281
uint_t reqId
Identifier value associated with the current EAP request (4.3.2)
Definition: supplicant.h:301
bool_t stop
Stop request.
Definition: supplicant.h:207
bool_t ignore
Drop the current packet (4.3.2)
Definition: supplicant.h:303
bool_t eapReq
An EAP frame is available for processing by EAP (8.2.12.1.1 b)
Definition: supplicant.h:272
uint_t heldPeriod
Initialization value used for the heldWhile timer (8.2.11.1.2 a)
Definition: supplicant.h:267
uint_t lastId
EAP identifier value of the last request (4.3.1)
Definition: supplicant.h:293
uint8_t txBuffer[SUPPLICANT_TX_BUFFER_SIZE]
Transmission buffer.
Definition: supplicant.h:230
bool_t eapResp
An EAP frame available for transmission to authenticator (8.2.12.1.1 c)
Definition: supplicant.h:273
char_t username[SUPPLICANT_MAX_USERNAME_LEN]
User name.
Definition: supplicant.h:214
bool_t keyRun
Variable set by the PACP machine (8.2.2.2 n)
Definition: supplicant.h:250
uint_t maxStart
Maximum number of successive EAPOL-Start messages that will be sent (8.2.11.1.2 c)
Definition: supplicant.h:269
EapMethodState methodState
Method state (4.3.1)
Definition: supplicant.h:292
char_t password[SUPPLICANT_MAX_PASSWORD_LEN]
Password.
Definition: supplicant.h:216
TlsContext * tlsContext
TLS context.
Definition: supplicant.h:220
uint_t startCount
Number of EAPOL-Start messages that have been sent (8.2.11.1.1 d)
Definition: supplicant.h:264
bool_t logoffSent
An EAPOL-Logoff message has been sent (8.2.11.1.1 b)
Definition: supplicant.h:262
uint8_t * eapKeyData
EAP key (4.1.2)
Definition: supplicant.h:287
uint8_t * lastRespData
Last EAP packet sent from the peer (4.3.1)
Definition: supplicant.h:294
bool_t suppStart
Start an authentication sequence (8.2.2.2 x)
Definition: supplicant.h:257
OsTaskId taskId
Task identifier.
Definition: supplicant.h:210
uint_t clientTimeout
Time to wait for a valid request before aborting (4.1.3)
Definition: supplicant.h:289
SupplicantTlsInitCallback tlsInitCallback
TLS initialization callback function.
Definition: supplicant.h:222
uint_t authWhile
Timer used by the supplicant backend state machine (8.2.2.1 a)
Definition: supplicant.h:241
bool_t eapKeyAvailable
Keying material is available (4.1.2)
Definition: supplicant.h:288
bool_t eapFail
The authentication has failed (8.2.2.2 g)
Definition: supplicant.h:245
bool_t eapSuccess
The authentication process succeeds (8.2.2.2 i)
Definition: supplicant.h:247
EapMethodType reqMethod
Method type of the current EAP request (4.3.2)
Definition: supplicant.h:302
bool_t running
Operational state of the supplicant.
Definition: supplicant.h:206
bool_t altAccept
Alternate indication of success (4.1.1)
Definition: supplicant.h:283
bool_t allowCanned
Allow canned EAP Success and Failure packets.
Definition: supplicant.h:305
bool_t busy
Busy flag.
Definition: supplicant.h:306
EapMethodType selectedMethod
The method currently in progress (4.3.1)
Definition: supplicant.h:291
uint_t startWhen
Timer used by the supplicant PAE state machine (8.2.2.1 f)
Definition: supplicant.h:243
OsTaskParameters taskParams
Task parameters.
Definition: supplicant.h:209
bool_t eapolEap
EAPOL PDU carrying a packet Type of EAP-Packet is received (8.2.2.2 h)
Definition: supplicant.h:246
bool_t suppAbort
Aborts an authentication sequence (8.2.2.2 u)
Definition: supplicant.h:254
bool_t keyDone
Variable set by the key machine (8.2.2.2 m)
Definition: supplicant.h:249
uint_t idleWhile
Timer (4.1.1)
Definition: supplicant.h:282
bool_t rxFailure
The current received packet is an EAP Failure (4.3.2)
Definition: supplicant.h:300
bool_t eapNoResp
No EAP Response for the last EAP frame delivered to EAP (8.2.12.1.1 a)
Definition: supplicant.h:271
uint8_t digest[MD5_DIGEST_SIZE]
Calculated hash value.
Definition: supplicant.h:217
bool_t allowNotifications
Definition: supplicant.h:279
const uint8_t * eapReqData
Contents of the EAP request (4.1.1)
Definition: supplicant.h:280
uint8_t rxBuffer[SUPPLICANT_TX_BUFFER_SIZE]
Reception buffer.
Definition: supplicant.h:234
bool_t userLogoff
The user is logged off (8.2.11.1.1 e)
Definition: supplicant.h:265
bool_t rxReq
The current received packet is an EAP Request (4.3.2)
Definition: supplicant.h:298
uint_t startPeriod
Initialization value used for the startWhen timer (8.2.11.1.2 b)
Definition: supplicant.h:268
SupplicantPaeState suppPaeState
Supplicant PAE state.
Definition: supplicant.h:238
size_t txBufferReadPos
Definition: supplicant.h:232
bool_t initialize
Forces all EAPOL state machines to their initial state (8.2.2.2 k)
Definition: supplicant.h:248
Socket * socket
Underlying socket.
Definition: supplicant.h:213
SupplicantBackendState suppBackendState
Supplicant backend state.
Definition: supplicant.h:239
bool_t rxSuccess
The current received packet is an EAP Success (4.3.2)
Definition: supplicant.h:299
OsEvent event
Event object used to poll the sockets.
Definition: supplicant.h:208
SupplicantTickCallback tickCallback
Tick callback function.
Definition: supplicant.h:227
TlsSessionState tlsSession
TLS session state.
Definition: supplicant.h:221
bool_t altReject
Alternate indication of failure (4.1.1)
Definition: supplicant.h:284
uint_t authPeriod
Initialization value used for the authWhile timer (8.2.12.1.2 a)
Definition: supplicant.h:275
size_t lastRespDataLen
Length of the last EAP response.
Definition: supplicant.h:295
SupplicantPaeStateChangeCallback paeStateChangeCallback
Supplicant PAE state change callback function.
Definition: supplicant.h:224
size_t txBufferWritePos
Definition: supplicant.h:231
uint_t portIndex
Port index.
Definition: supplicant.h:212
EapPeerState eapPeerState
EAP peer state.
Definition: supplicant.h:277
bool_t suppSuccess
Successful authentication sequence (8.2.2.2 y)
Definition: supplicant.h:258
bool_t portEnabled
Operational state of the port (8.2.2.2 q)
Definition: supplicant.h:252
uint8_t * eapRespData
EAP response to send (4.1.2)
Definition: supplicant.h:285
NetInterface * interface
Underlying network interface.
Definition: supplicant.h:211
uint_t heldWhile
Timer used by the supplicant PAE state machine (8.2.2.1 c)
Definition: supplicant.h:242
EapPeerStateChangeCallback eapPeerStateChangeCallback
EAP peer state change callback function.
Definition: supplicant.h:226
SupplicantBackendStateChangeCallback backendStateChangeCallback
Supplicant backend state change callback function.
Definition: supplicant.h:225
bool_t suppTimeout
The authentication sequence has timed out (8.2.2.2 z)
Definition: supplicant.h:259
Event object.
Task parameters.
802.1X supplicant settings
Definition: supplicant.h:186
OsTaskParameters task
Task parameters.
Definition: supplicant.h:187
SupplicantTlsInitCallback tlsInitCallback
TLS initialization callback function.
Definition: supplicant.h:191
SupplicantTickCallback tickCallback
Tick callback function.
Definition: supplicant.h:196
SupplicantPaeStateChangeCallback paeStateChangeCallback
Supplicant PAE state change callback function.
Definition: supplicant.h:193
uint_t portIndex
Port index.
Definition: supplicant.h:189
NetInterface * interface
Underlying network interface.
Definition: supplicant.h:188
EapPeerStateChangeCallback eapPeerStateChangeCallback
EAP peer state change callback function.
Definition: supplicant.h:195
SupplicantBackendStateChangeCallback backendStateChangeCallback
Supplicant backend state change callback function.
Definition: supplicant.h:194
TLS session state.
Definition: tls.h:2021
error_t supplicantSetPassword(SupplicantContext *context, const char_t *password)
Set password.
Definition: supplicant.c:174
#define SUPPLICANT_MAX_USERNAME_LEN
Definition: supplicant.h:86
void(* SupplicantBackendStateChangeCallback)(SupplicantContext *context, SupplicantBackendState state)
Supplicant backend state change callback function.
Definition: supplicant.h:162
#define SupplicantContext
Definition: supplicant.h:36
error_t supplicantSetUsername(SupplicantContext *context, const char_t *username)
Set user name.
Definition: supplicant.c:148
#define SUPPLICANT_MAX_PASSWORD_LEN
Definition: supplicant.h:93
error_t supplicantStop(SupplicantContext *context)
Stop 802.1X supplicant.
Definition: supplicant.c:302
void(* SupplicantPaeStateChangeCallback)(SupplicantContext *context, SupplicantPaeState state)
Supplicant PAE state change callback function.
Definition: supplicant.h:154
void supplicantGetDefaultSettings(SupplicantSettings *settings)
Initialize settings with default values.
Definition: supplicant.c:49
void supplicantTask(SupplicantContext *context)
802.1X supplicant task
Definition: supplicant.c:343
#define SUPPLICANT_TX_BUFFER_SIZE
Definition: supplicant.h:72
void(* SupplicantTickCallback)(SupplicantContext *context)
Tick callback function.
Definition: supplicant.h:178
void(* EapPeerStateChangeCallback)(SupplicantContext *context, EapPeerState state)
EAP peer state change callback function.
Definition: supplicant.h:170
error_t supplicantInit(SupplicantContext *context, const SupplicantSettings *settings)
Initialize 802.1X supplicant context.
Definition: supplicant.c:84
error_t supplicantStart(SupplicantContext *context)
Start 802.1X supplicant.
Definition: supplicant.c:204
error_t(* SupplicantTlsInitCallback)(SupplicantContext *context, TlsContext *tlsContext)
TLS initialization callback function.
Definition: supplicant.h:144
void supplicantDeinit(SupplicantContext *context)
Release 802.1X supplicant context.
Definition: supplicant.c:424
Supplicant backend state machine.
SupplicantBackendState
Supplicant backend states.
Supplicant PAE state machine.
SupplicantPortStatus
Port status.
SupplicantPaeState
Supplicant PAE states.
SupplicantPortMode
Port modes.
TLS (Transport Layer Security)
#define TlsContext
Definition: tls.h:36