802.1X supplicant More...
#include "eap/eap.h"
#include "eap/eap_peer_fsm.h"
#include "supplicant/supplicant_pae_fsm.h"
#include "supplicant/supplicant_backend_fsm.h"
#include "core/crypto.h"
#include "tls.h"
Go to the source code of this file.
Data Structures | |
struct | SupplicantSettings |
802.1X supplicant settings More... | |
struct | _SupplicantContext |
802.1X supplicant context More... | |
Macros | |
#define | SupplicantContext struct _SupplicantContext |
#define | SUPPLICANT_SUPPORT ENABLED |
#define | SUPPLICANT_STACK_SIZE 750 |
#define | SUPPLICANT_PRIORITY OS_TASK_PRIORITY_NORMAL |
#define | SUPPLICANT_TICK_INTERVAL 1000 |
#define | SUPPLICANT_TX_BUFFER_SIZE 3000 |
#define | SUPPLICANT_RX_BUFFER_SIZE 1500 |
#define | SUPPLICANT_MAX_USERNAME_LEN 64 |
#define | SUPPLICANT_MAX_PASSWORD_LEN 64 |
#define | SUPPLICANT_DEFAULT_HELD_PERIOD 60 |
#define | SUPPLICANT_DEFAULT_AUTH_PERIOD 30 |
#define | SUPPLICANT_DEFAULT_START_PERIOD 30 |
#define | SUPPLICANT_DEFAULT_MAX_START 3 |
Typedefs | |
typedef error_t(* | SupplicantTlsInitCallback) (SupplicantContext *context, TlsContext *tlsContext) |
TLS negotiation initialization callback function. More... | |
typedef void(* | SupplicantTlsCompleteCallback) (SupplicantContext *context, TlsContext *tlsContext, error_t error) |
TLS negotiation completion callback function. More... | |
typedef void(* | SupplicantPaeStateChangeCallback) (SupplicantContext *context, SupplicantPaeState state) |
Supplicant PAE state change callback function. More... | |
typedef void(* | SupplicantBackendStateChangeCallback) (SupplicantContext *context, SupplicantBackendState state) |
Supplicant backend state change callback function. More... | |
typedef void(* | EapPeerStateChangeCallback) (SupplicantContext *context, EapPeerState state) |
EAP peer state change callback function. More... | |
typedef void(* | SupplicantTickCallback) (SupplicantContext *context) |
Tick callback function. More... | |
Functions | |
void | supplicantGetDefaultSettings (SupplicantSettings *settings) |
Initialize settings with default values. More... | |
error_t | supplicantInit (SupplicantContext *context, const SupplicantSettings *settings) |
Initialize 802.1X supplicant context. More... | |
error_t | supplicantSetUsername (SupplicantContext *context, const char_t *username) |
Set user name. More... | |
error_t | supplicantSetPassword (SupplicantContext *context, const char_t *password) |
Set password. More... | |
error_t | supplicantSetHeldPeriod (SupplicantContext *context, uint_t heldPeriod) |
Set the value of the heldPeriod parameter. More... | |
error_t | supplicantSetAuthPeriod (SupplicantContext *context, uint_t authPeriod) |
Set the value of the authPeriod parameter. More... | |
error_t | supplicantSetStartPeriod (SupplicantContext *context, uint_t startPeriod) |
Set the value of the startPeriod parameter. More... | |
error_t | supplicantSetMaxStart (SupplicantContext *context, uint_t maxStart) |
Set the value of the maxStart parameter. More... | |
error_t | supplicantSetClientTimeout (SupplicantContext *context, uint_t clientTimeout) |
Set the value of the clientTimeout parameter. More... | |
error_t | supplicantSetPortControl (SupplicantContext *context, SupplicantPortMode portControl) |
Set the value of the portControl variable. More... | |
error_t | supplicantLogOn (SupplicantContext *context) |
Perform user logon. More... | |
error_t | supplicantLogOff (SupplicantContext *context) |
Perform user logoff. More... | |
error_t | supplicantStart (SupplicantContext *context) |
Start 802.1X supplicant. More... | |
error_t | supplicantStop (SupplicantContext *context) |
Stop 802.1X supplicant. More... | |
void | supplicantTask (SupplicantContext *context) |
802.1X supplicant task More... | |
void | supplicantDeinit (SupplicantContext *context) |
Release 802.1X supplicant context. More... | |
Detailed Description
802.1X supplicant
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneEAP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file supplicant.h.
Macro Definition Documentation
◆ SUPPLICANT_DEFAULT_AUTH_PERIOD
#define SUPPLICANT_DEFAULT_AUTH_PERIOD 30 |
Definition at line 107 of file supplicant.h.
◆ SUPPLICANT_DEFAULT_HELD_PERIOD
#define SUPPLICANT_DEFAULT_HELD_PERIOD 60 |
Definition at line 100 of file supplicant.h.
◆ SUPPLICANT_DEFAULT_MAX_START
#define SUPPLICANT_DEFAULT_MAX_START 3 |
Definition at line 121 of file supplicant.h.
◆ SUPPLICANT_DEFAULT_START_PERIOD
#define SUPPLICANT_DEFAULT_START_PERIOD 30 |
Definition at line 114 of file supplicant.h.
◆ SUPPLICANT_MAX_PASSWORD_LEN
#define SUPPLICANT_MAX_PASSWORD_LEN 64 |
Definition at line 93 of file supplicant.h.
◆ SUPPLICANT_MAX_USERNAME_LEN
#define SUPPLICANT_MAX_USERNAME_LEN 64 |
Definition at line 86 of file supplicant.h.
◆ SUPPLICANT_PRIORITY
#define SUPPLICANT_PRIORITY OS_TASK_PRIORITY_NORMAL |
Definition at line 60 of file supplicant.h.
◆ SUPPLICANT_RX_BUFFER_SIZE
#define SUPPLICANT_RX_BUFFER_SIZE 1500 |
Definition at line 79 of file supplicant.h.
◆ SUPPLICANT_STACK_SIZE
#define SUPPLICANT_STACK_SIZE 750 |
Definition at line 53 of file supplicant.h.
◆ SUPPLICANT_SUPPORT
#define SUPPLICANT_SUPPORT ENABLED |
Definition at line 46 of file supplicant.h.
◆ SUPPLICANT_TICK_INTERVAL
#define SUPPLICANT_TICK_INTERVAL 1000 |
Definition at line 65 of file supplicant.h.
◆ SUPPLICANT_TX_BUFFER_SIZE
#define SUPPLICANT_TX_BUFFER_SIZE 3000 |
Definition at line 72 of file supplicant.h.
◆ SupplicantContext
#define SupplicantContext struct _SupplicantContext |
Definition at line 36 of file supplicant.h.
Typedef Documentation
◆ EapPeerStateChangeCallback
typedef void(* EapPeerStateChangeCallback) (SupplicantContext *context, EapPeerState state) |
EAP peer state change callback function.
Definition at line 177 of file supplicant.h.
◆ SupplicantBackendStateChangeCallback
typedef void(* SupplicantBackendStateChangeCallback) (SupplicantContext *context, SupplicantBackendState state) |
Supplicant backend state change callback function.
Definition at line 169 of file supplicant.h.
◆ SupplicantPaeStateChangeCallback
typedef void(* SupplicantPaeStateChangeCallback) (SupplicantContext *context, SupplicantPaeState state) |
Supplicant PAE state change callback function.
Definition at line 161 of file supplicant.h.
◆ SupplicantTickCallback
typedef void(* SupplicantTickCallback) (SupplicantContext *context) |
Tick callback function.
Definition at line 185 of file supplicant.h.
◆ SupplicantTlsCompleteCallback
typedef void(* SupplicantTlsCompleteCallback) (SupplicantContext *context, TlsContext *tlsContext, error_t error) |
TLS negotiation completion callback function.
Definition at line 151 of file supplicant.h.
◆ SupplicantTlsInitCallback
typedef error_t(* SupplicantTlsInitCallback) (SupplicantContext *context, TlsContext *tlsContext) |
TLS negotiation initialization callback function.
Definition at line 144 of file supplicant.h.
Function Documentation
◆ supplicantDeinit()
void supplicantDeinit | ( | SupplicantContext * | context | ) |
Release 802.1X supplicant context.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context
Definition at line 699 of file supplicant.c.
◆ supplicantGetDefaultSettings()
void supplicantGetDefaultSettings | ( | SupplicantSettings * | settings | ) |
Initialize settings with default values.
- Parameters
-
[out] settings Structure that contains 802.1X supplicant settings
Definition at line 49 of file supplicant.c.
◆ supplicantInit()
error_t supplicantInit | ( | SupplicantContext * | context, |
const SupplicantSettings * | settings | ||
) |
Initialize 802.1X supplicant context.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] settings 802.1X supplicant specific settings
- Returns
- Error code
Definition at line 86 of file supplicant.c.
◆ supplicantLogOff()
error_t supplicantLogOff | ( | SupplicantContext * | context | ) |
Perform user logoff.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context
- Returns
- Error code
Definition at line 439 of file supplicant.c.
◆ supplicantLogOn()
error_t supplicantLogOn | ( | SupplicantContext * | context | ) |
Perform user logon.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context
- Returns
- Error code
Definition at line 405 of file supplicant.c.
◆ supplicantSetAuthPeriod()
error_t supplicantSetAuthPeriod | ( | SupplicantContext * | context, |
uint_t | authPeriod | ||
) |
Set the value of the authPeriod parameter.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] authPeriod Value of the authPeriod parameter
- Returns
- Error code
Definition at line 262 of file supplicant.c.
◆ supplicantSetClientTimeout()
error_t supplicantSetClientTimeout | ( | SupplicantContext * | context, |
uint_t | clientTimeout | ||
) |
Set the value of the clientTimeout parameter.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] clientTimeout Value of the clientTimeout parameter
- Returns
- Error code
Definition at line 345 of file supplicant.c.
◆ supplicantSetHeldPeriod()
error_t supplicantSetHeldPeriod | ( | SupplicantContext * | context, |
uint_t | heldPeriod | ||
) |
Set the value of the heldPeriod parameter.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] heldPeriod Value of the heldPeriod parameter
- Returns
- Error code
Definition at line 237 of file supplicant.c.
◆ supplicantSetMaxStart()
error_t supplicantSetMaxStart | ( | SupplicantContext * | context, |
uint_t | maxStart | ||
) |
Set the value of the maxStart parameter.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] maxStart Value of the maxStart parameter
- Returns
- Error code
Definition at line 312 of file supplicant.c.
◆ supplicantSetPassword()
error_t supplicantSetPassword | ( | SupplicantContext * | context, |
const char_t * | password | ||
) |
Set password.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] password NULL-terminated string containing the password
- Returns
- Error code
Definition at line 206 of file supplicant.c.
◆ supplicantSetPortControl()
error_t supplicantSetPortControl | ( | SupplicantContext * | context, |
SupplicantPortMode | portControl | ||
) |
Set the value of the portControl variable.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] portControl Value of the portControl variable
- Returns
- Error code
Definition at line 371 of file supplicant.c.
◆ supplicantSetStartPeriod()
error_t supplicantSetStartPeriod | ( | SupplicantContext * | context, |
uint_t | startPeriod | ||
) |
Set the value of the startPeriod parameter.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] startPeriod Value of the startPeriod parameter
- Returns
- Error code
Definition at line 287 of file supplicant.c.
◆ supplicantSetUsername()
error_t supplicantSetUsername | ( | SupplicantContext * | context, |
const char_t * | username | ||
) |
Set user name.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context [in] username NULL-terminated string containing the user name
- Returns
- Error code
Definition at line 180 of file supplicant.c.
◆ supplicantStart()
error_t supplicantStart | ( | SupplicantContext * | context | ) |
Start 802.1X supplicant.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context
- Returns
- Error code
Definition at line 473 of file supplicant.c.
◆ supplicantStop()
error_t supplicantStop | ( | SupplicantContext * | context | ) |
Stop 802.1X supplicant.
- Parameters
-
[in] context Pointer to the 802.1X supplicant context
- Returns
- Error code
Definition at line 571 of file supplicant.c.
◆ supplicantTask()
void supplicantTask | ( | SupplicantContext * | context | ) |
802.1X supplicant task
- Parameters
-
[in] context Pointer to the 802.1X supplicant context
Definition at line 614 of file supplicant.c.