eap_peer_fsm.h
Go to the documentation of this file.
1 /**
2  * @file eap_peer_fsm.h
3  * @brief EAP peer state machine
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.4
29  **/
30 
31 #ifndef _EAP_PEER_FSM_H
32 #define _EAP_PEER_FSM_H
33 
34 //Dependencies
35 #include <limits.h>
36 #include "eap/eap.h"
37 #include "supplicant/supplicant.h"
38 
39 //Invalid identifier
40 #define EAP_LAST_ID_NONE UINT_MAX
41 
42 //C++ guard
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 
48 /**
49  * @brief EAP peer states
50  **/
51 
52 typedef enum
53 {
68 
69 
70 /**
71  * @brief EAP method states
72  **/
73 
74 typedef enum
75 {
82 
83 
84 /**
85  * @brief Decisions
86  **/
87 
88 typedef enum
89 {
94 
95 
96 //Supplicant related functions
97 void eapPeerInitFsm(SupplicantContext *context);
98 void eapPeerFsm(SupplicantContext *context);
99 
101  EapPeerState newState);
102 
103 //C++ guard
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif
@ EAP_PEER_STATE_IDENTITY
Definition: eap_peer_fsm.h:60
802.1X supplicant
#define SupplicantContext
Definition: supplicant.h:36
@ EAP_PEER_STATE_RECEIVED
Definition: eap_peer_fsm.h:57
EapMethodState
EAP method states.
Definition: eap_peer_fsm.h:75
@ EAP_PEER_STATE_DISABLED
Definition: eap_peer_fsm.h:54
@ EAP_METHOD_STATE_INIT
Definition: eap_peer_fsm.h:77
@ EAP_PEER_STATE_FAILURE
Definition: eap_peer_fsm.h:66
@ EAP_PEER_STATE_IDLE
Definition: eap_peer_fsm.h:56
@ EAP_PEER_STATE_DISCARD
Definition: eap_peer_fsm.h:63
@ EAP_PEER_STATE_NOTIFICATION
Definition: eap_peer_fsm.h:61
void eapPeerFsm(SupplicantContext *context)
EAP peer state machine implementation.
Definition: eap_peer_fsm.c:82
@ EAP_PEER_STATE_GET_METHOD
Definition: eap_peer_fsm.h:59
void eapPeerChangeState(SupplicantContext *context, EapPeerState newState)
Update EAP peer state.
Definition: eap_peer_fsm.c:335
@ EAP_DECISION_UNCOND_SUCC
Definition: eap_peer_fsm.h:92
@ EAP_PEER_STATE_INITIALIZE
Definition: eap_peer_fsm.h:55
@ EAP_PEER_STATE_SUCCESS
Definition: eap_peer_fsm.h:65
@ EAP_METHOD_STATE_CONT
Definition: eap_peer_fsm.h:78
@ EAP_PEER_STATE_RETRANSMIT
Definition: eap_peer_fsm.h:62
EapDecision
Decisions.
Definition: eap_peer_fsm.h:89
@ EAP_DECISION_FAIL
Definition: eap_peer_fsm.h:90
@ EAP_PEER_STATE_METHOD
Definition: eap_peer_fsm.h:58
@ EAP_METHOD_STATE_DONE
Definition: eap_peer_fsm.h:80
@ EAP_DECISION_COND_SUCC
Definition: eap_peer_fsm.h:91
@ EAP_METHOD_STATE_MAY_CONT
Definition: eap_peer_fsm.h:79
EAP (Extensible Authentication Protocol)
void eapPeerInitFsm(SupplicantContext *context)
EAP peer state machine initialization.
Definition: eap_peer_fsm.c:70
@ EAP_METHOD_STATE_NONE
Definition: eap_peer_fsm.h:76
@ EAP_PEER_STATE_SEND_RESPONSE
Definition: eap_peer_fsm.h:64
EapPeerState
EAP peer states.
Definition: eap_peer_fsm.h:53