authenticator.c File Reference

802.1X authenticator More...

Go to the source code of this file.

Macros

#define TRACE_LEVEL   AUTHENTICATOR_TRACE_LEVEL
 

Functions

void authenticatorGetDefaultSettings (AuthenticatorSettings *settings)
 Initialize settings with default values. More...
 
error_t authenticatorInit (AuthenticatorContext *context, const AuthenticatorSettings *settings)
 Initialize 802.1X authenticator context. More...
 
error_t authenticatorSetServerAddr (AuthenticatorContext *context, const IpAddr *serverIpAddr, uint16_t serverPort)
 Specify the IP address of the RADIUS server. More...
 
error_t authenticatorSetServerKey (AuthenticatorContext *context, const uint8_t *key, size_t keyLen)
 Set RADIUS server's key. More...
 
error_t authenticatorInitPort (AuthenticatorContext *context, uint_t portIndex)
 Reinitialize the specified port. More...
 
error_t authenticatorReauthenticate (AuthenticatorContext *context, uint_t portIndex)
 Force the authenticator to reauthenticate the supplicant. More...
 
error_t authenticatorSetPortControl (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPortMode portControl)
 Set the value of the AuthControlledPortControl parameter. More...
 
error_t authenticatorSetQuietPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t quietPeriod)
 Set the value of the quietPeriod parameter. More...
 
error_t authenticatorSetServerTimeout (AuthenticatorContext *context, uint_t portIndex, uint_t serverTimeout)
 Set the value of the serverTimeout parameter. More...
 
error_t authenticatorSetReAuthEnabled (AuthenticatorContext *context, uint_t portIndex, bool_t reAuthEnabled)
 Set the value of the reAuthEnabled parameter. More...
 
error_t authenticatorSetReAuthPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t reAuthPeriod)
 Set the value of the reAuthPeriod parameter. More...
 
error_t authenticatorGetPortControl (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPortMode *portControl)
 Get the current value of the AuthControlledPortControl parameter. More...
 
error_t authenticatorGetQuietPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t *quietPeriod)
 Get the current value of the quietPeriod parameter. More...
 
error_t authenticatorGetServerTimeout (AuthenticatorContext *context, uint_t portIndex, uint_t *serverTimeout)
 Get the current value of the serverTimeout parameter. More...
 
error_t authenticatorGetReAuthEnabled (AuthenticatorContext *context, uint_t portIndex, bool_t *reAuthEnabled)
 Get the current value of the reAuthEnabled parameter. More...
 
error_t authenticatorGetReAuthPeriod (AuthenticatorContext *context, uint_t portIndex, uint_t *reAuthPeriod)
 Get the current value of the reAuthPeriod parameter. More...
 
error_t authenticatorGetPortStatus (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPortStatus *portStatus)
 Get the current value of the AuthControlledPortStatus variable. More...
 
error_t authenticatorGetPaeState (AuthenticatorContext *context, uint_t portIndex, AuthenticatorPaeState *paeState)
 Get the current state of the authenticator PAE state state machine. More...
 
error_t authenticatorGetBackendState (AuthenticatorContext *context, uint_t portIndex, AuthenticatorBackendState *backendState)
 Get the current state of the backend authentication state machine. More...
 
error_t authenticatorGetReauthTimerState (AuthenticatorContext *context, uint_t portIndex, AuthenticatorReauthTimerState *reauthTimerState)
 Get the current state of the reauthentication timer state machine. More...
 
error_t authenticatorGetEapFullAuthState (AuthenticatorContext *context, uint_t portIndex, EapFullAuthState *eapFullAuthState)
 Get the current state of the EAP full authenticator state machine. More...
 
error_t authenticatorStart (AuthenticatorContext *context)
 Start 802.1X authenticator. More...
 
error_t authenticatorStop (AuthenticatorContext *context)
 Stop 802.1X authenticator. More...
 
void authenticatorTask (AuthenticatorContext *context)
 802.1X authenticator task More...
 
void authenticatorDeinit (AuthenticatorContext *context)
 Release 802.1X authenticator context. More...
 

Detailed Description

802.1X authenticator

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file authenticator.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   AUTHENTICATOR_TRACE_LEVEL

Definition at line 32 of file authenticator.c.

Function Documentation

◆ authenticatorDeinit()

void authenticatorDeinit ( AuthenticatorContext context)

Release 802.1X authenticator context.

Parameters
[in]contextPointer to the 802.1X authenticator context

Definition at line 1149 of file authenticator.c.

◆ authenticatorGetBackendState()

error_t authenticatorGetBackendState ( AuthenticatorContext context,
uint_t  portIndex,
AuthenticatorBackendState backendState 
)

Get the current state of the backend authentication state machine.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]backendStateCurrent state of the backend authentication state machine
Returns
Error code

Definition at line 780 of file authenticator.c.

◆ authenticatorGetDefaultSettings()

void authenticatorGetDefaultSettings ( AuthenticatorSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure that contains 802.1X authenticator settings

Definition at line 51 of file authenticator.c.

◆ authenticatorGetEapFullAuthState()

error_t authenticatorGetEapFullAuthState ( AuthenticatorContext context,
uint_t  portIndex,
EapFullAuthState eapFullAuthState 
)

Get the current state of the EAP full authenticator state machine.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]eapFullAuthStateCurrent state of the EAP full authenticator state machine
Returns
Error code

Definition at line 844 of file authenticator.c.

◆ authenticatorGetPaeState()

error_t authenticatorGetPaeState ( AuthenticatorContext context,
uint_t  portIndex,
AuthenticatorPaeState paeState 
)

Get the current state of the authenticator PAE state state machine.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]paeStateCurrent state of the authenticator PAE state machine
Returns
Error code

Definition at line 748 of file authenticator.c.

◆ authenticatorGetPortControl()

error_t authenticatorGetPortControl ( AuthenticatorContext context,
uint_t  portIndex,
AuthenticatorPortMode portControl 
)

Get the current value of the AuthControlledPortControl parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]portControlvalue of the AuthControlledPortControl parameter
Returns
Error code

Definition at line 562 of file authenticator.c.

◆ authenticatorGetPortStatus()

error_t authenticatorGetPortStatus ( AuthenticatorContext context,
uint_t  portIndex,
AuthenticatorPortStatus portStatus 
)

Get the current value of the AuthControlledPortStatus variable.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]portStatusCurrent value of the AuthControlledPortStatus variable
Returns
Error code

Definition at line 717 of file authenticator.c.

◆ authenticatorGetQuietPeriod()

error_t authenticatorGetQuietPeriod ( AuthenticatorContext context,
uint_t  portIndex,
uint_t quietPeriod 
)

Get the current value of the quietPeriod parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]quietPeriodvalue of the quietPeriod parameter
Returns
Error code

Definition at line 593 of file authenticator.c.

◆ authenticatorGetReAuthEnabled()

error_t authenticatorGetReAuthEnabled ( AuthenticatorContext context,
uint_t  portIndex,
bool_t reAuthEnabled 
)

Get the current value of the reAuthEnabled parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]reAuthEnabledvalue of the reAuthEnabled parameter
Returns
Error code

Definition at line 655 of file authenticator.c.

◆ authenticatorGetReAuthPeriod()

error_t authenticatorGetReAuthPeriod ( AuthenticatorContext context,
uint_t  portIndex,
uint_t reAuthPeriod 
)

Get the current value of the reAuthPeriod parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]reAuthPeriodvalue of the reAuthPeriod parameter
Returns
Error code

Definition at line 686 of file authenticator.c.

◆ authenticatorGetReauthTimerState()

error_t authenticatorGetReauthTimerState ( AuthenticatorContext context,
uint_t  portIndex,
AuthenticatorReauthTimerState reauthTimerState 
)

Get the current state of the reauthentication timer state machine.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]reauthTimerStateCurrent state of the reauthentication timer state machine
Returns
Error code

Definition at line 812 of file authenticator.c.

◆ authenticatorGetServerTimeout()

error_t authenticatorGetServerTimeout ( AuthenticatorContext context,
uint_t  portIndex,
uint_t serverTimeout 
)

Get the current value of the serverTimeout parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[out]serverTimeoutvalue of the serverTimeout parameter
Returns
Error code

Definition at line 624 of file authenticator.c.

◆ authenticatorInit()

error_t authenticatorInit ( AuthenticatorContext context,
const AuthenticatorSettings settings 
)

Initialize 802.1X authenticator context.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]settings802.1X authenticator specific settings
Returns
Error code

Definition at line 100 of file authenticator.c.

◆ authenticatorInitPort()

error_t authenticatorInitPort ( AuthenticatorContext context,
uint_t  portIndex 
)

Reinitialize the specified port.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
Returns
Error code

Definition at line 304 of file authenticator.c.

◆ authenticatorReauthenticate()

error_t authenticatorReauthenticate ( AuthenticatorContext context,
uint_t  portIndex 
)

Force the authenticator to reauthenticate the supplicant.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
Returns
Error code

Definition at line 340 of file authenticator.c.

◆ authenticatorSetPortControl()

error_t authenticatorSetPortControl ( AuthenticatorContext context,
uint_t  portIndex,
AuthenticatorPortMode  portControl 
)

Set the value of the AuthControlledPortControl parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[in]portControlValue of the AuthControlledPortControl parameter
Returns
Error code

Definition at line 377 of file authenticator.c.

◆ authenticatorSetQuietPeriod()

error_t authenticatorSetQuietPeriod ( AuthenticatorContext context,
uint_t  portIndex,
uint_t  quietPeriod 
)

Set the value of the quietPeriod parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[in]quietPeriodValue of the quietPeriod parameter
Returns
Error code

Definition at line 414 of file authenticator.c.

◆ authenticatorSetReAuthEnabled()

error_t authenticatorSetReAuthEnabled ( AuthenticatorContext context,
uint_t  portIndex,
bool_t  reAuthEnabled 
)

Set the value of the reAuthEnabled parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[in]reAuthEnabledValue of the reAuthEnabled parameter
Returns
Error code

Definition at line 488 of file authenticator.c.

◆ authenticatorSetReAuthPeriod()

error_t authenticatorSetReAuthPeriod ( AuthenticatorContext context,
uint_t  portIndex,
uint_t  reAuthPeriod 
)

Set the value of the reAuthPeriod parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[in]reAuthPeriodValue of the reAuthPeriod parameter
Returns
Error code

Definition at line 525 of file authenticator.c.

◆ authenticatorSetServerAddr()

error_t authenticatorSetServerAddr ( AuthenticatorContext context,
const IpAddr serverIpAddr,
uint16_t  serverPort 
)

Specify the IP address of the RADIUS server.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]serverIpAddrIP address of the RADIUS server
[in]serverPortPort number
Returns
Error code

Definition at line 236 of file authenticator.c.

◆ authenticatorSetServerKey()

error_t authenticatorSetServerKey ( AuthenticatorContext context,
const uint8_t *  key,
size_t  keyLen 
)

Set RADIUS server's key.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]keyPointer to the key
[in]keyLenLength of the key, in bytes
Returns
Error code

Definition at line 266 of file authenticator.c.

◆ authenticatorSetServerTimeout()

error_t authenticatorSetServerTimeout ( AuthenticatorContext context,
uint_t  portIndex,
uint_t  serverTimeout 
)

Set the value of the serverTimeout parameter.

Parameters
[in]contextPointer to the 802.1X authenticator context
[in]portIndexPort index
[in]serverTimeoutValue of the serverTimeout parameter
Returns
Error code

Definition at line 451 of file authenticator.c.

◆ authenticatorStart()

error_t authenticatorStart ( AuthenticatorContext context)

Start 802.1X authenticator.

Parameters
[in]contextPointer to the 802.1X authenticator context
Returns
Error code

Definition at line 873 of file authenticator.c.

◆ authenticatorStop()

error_t authenticatorStop ( AuthenticatorContext context)

Stop 802.1X authenticator.

Parameters
[in]contextPointer to the 802.1X authenticator context
Returns
Error code

Definition at line 1005 of file authenticator.c.

◆ authenticatorTask()

void authenticatorTask ( AuthenticatorContext context)

802.1X authenticator task

Parameters
[in]contextPointer to the 802.1X authenticator context

Definition at line 1050 of file authenticator.c.