ike_eap.h File Reference

EAP authentication. More...

#include "ike/ike.h"

Go to the source code of this file.

Enumerations

enum  IkeEapCode { IKE_EAP_CODE_REQUEST = 1, IKE_EAP_CODE_RESPONSE = 2, IKE_EAP_CODE_SUCCESS = 3, IKE_EAP_CODE_FAILURE = 4 }
 EAP codes. More...
 
enum  IkeEapMethodType {
  IKE_EAP_METHOD_TYPE_NONE = 0, IKE_EAP_METHOD_TYPE_IDENTITY = 1, IKE_EAP_METHOD_TYPE_NOTIFICATION = 2, IKE_EAP_METHOD_TYPE_NAK = 3,
  IKE_EAP_METHOD_TYPE_MD5_CHALLENGE = 4, IKE_EAP_METHOD_TYPE_OTP = 5, IKE_EAP_METHOD_TYPE_GTC = 6, IKE_EAP_METHOD_TYPE_TLS = 13,
  IKE_EAP_METHOD_TYPE_TTLS = 21, IKE_EAP_METHOD_TYPE_PEAP = 25, IKE_EAP_METHOD_TYPE_MSCHAPV2 = 26, IKE_EAP_METHOD_TYPE_EXPANDED_NAK = 254
}
 EAP method types. More...
 

Functions

error_t ikeProcessEapPacket (IkeSaEntry *sa, const IkeEapPacket *packet, size_t length)
 Process EAP packet. More...
 
error_t ikeProcessEapRequest (IkeSaEntry *sa, const IkeEapRequest *request, size_t length)
 Process EAP request. More...
 
error_t ikeProcessEapIdentityRequest (IkeSaEntry *sa, const IkeEapRequest *request, size_t length)
 Process EAP Identity request. More...
 
error_t ikeProcessEapSuccess (IkeSaEntry *sa, const IkeEapPacket *packet, size_t length)
 Process EAP success packet. More...
 
error_t ikeProcessEapFailure (IkeSaEntry *sa, const IkeEapPacket *packet, size_t length)
 Process EAP failure packet. More...
 
error_t ikeFormatEapPacket (IkeSaEntry *sa, uint8_t *p, size_t *written)
 Format EAP packet. More...
 
error_t ikeFormatEapIdentityResponse (IkeSaEntry *sa, uint8_t *p, size_t *written)
 Format EAP Identity response. More...
 
error_t ikeFormatEapNakResponse (IkeSaEntry *sa, uint8_t *p, size_t *written)
 Format EAP Nak response. More...
 

Variables

typedef __packed_struct
 EAP packet. More...
 
uint8_t identifier
 
uint16_t length
 
uint8_t data []
 
 IkeEapPacket
 
uint8_t type
 
 IkeEapRequest
 
 IkeEapResponse
 

Detailed Description

EAP authentication.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2022-2026 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneIPSEC 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.6.8

Definition in file ike_eap.h.

Enumeration Type Documentation

◆ IkeEapCode

enum IkeEapCode

EAP codes.

Enumerator
IKE_EAP_CODE_REQUEST 

Request.

IKE_EAP_CODE_RESPONSE 

Response.

IKE_EAP_CODE_SUCCESS 

Success.

IKE_EAP_CODE_FAILURE 

Failure.

Definition at line 47 of file ike_eap.h.

◆ IkeEapMethodType

EAP method types.

Enumerator
IKE_EAP_METHOD_TYPE_NONE 

None.

IKE_EAP_METHOD_TYPE_IDENTITY 

Identity.

IKE_EAP_METHOD_TYPE_NOTIFICATION 

Notification.

IKE_EAP_METHOD_TYPE_NAK 

Legacy Nak.

IKE_EAP_METHOD_TYPE_MD5_CHALLENGE 

MD5-Challenge.

IKE_EAP_METHOD_TYPE_OTP 

One-Time Password (OTP)

IKE_EAP_METHOD_TYPE_GTC 

Generic Token Card (GTC)

IKE_EAP_METHOD_TYPE_TLS 

EAP-TLS.

IKE_EAP_METHOD_TYPE_TTLS 

EAP-TTLS.

IKE_EAP_METHOD_TYPE_PEAP 

PEAP.

IKE_EAP_METHOD_TYPE_MSCHAPV2 

MS-CHAP-V2.

IKE_EAP_METHOD_TYPE_EXPANDED_NAK 

Expanded NAK.

Definition at line 60 of file ike_eap.h.

Function Documentation

◆ ikeFormatEapIdentityResponse()

error_t ikeFormatEapIdentityResponse ( IkeSaEntry *  sa,
uint8_t *  p,
size_t *  written 
)

Format EAP Identity response.

Parameters
[in]saPointer to the IKE SA
[out]pBuffer where to format the EAP Identity response
[out]writtenLength of the resulting EAP Identity response
Returns
Error code

Definition at line 312 of file ike_eap.c.

◆ ikeFormatEapNakResponse()

error_t ikeFormatEapNakResponse ( IkeSaEntry *  sa,
uint8_t *  p,
size_t *  written 
)

Format EAP Nak response.

Parameters
[in]saPointer to the IKE SA
[out]pBuffer where to format the EAP Nak response
[out]writtenLength of the resulting EAP Nak response
Returns
Error code

Definition at line 354 of file ike_eap.c.

◆ ikeFormatEapPacket()

error_t ikeFormatEapPacket ( IkeSaEntry *  sa,
uint8_t *  p,
size_t *  written 
)

Format EAP packet.

Parameters
[in]saPointer to the IKE SA
[out]pBuffer where to format the EAP packet
[out]writtenLength of the resulting EAP packet
Returns
Error code

Definition at line 254 of file ike_eap.c.

◆ ikeProcessEapFailure()

error_t ikeProcessEapFailure ( IkeSaEntry *  sa,
const IkeEapPacket *  packet,
size_t  length 
)

Process EAP failure packet.

Parameters
[in]saPointer to the IKE SA
[in]packetPointer to the EAP failure packet
[in]lengthLength of the EAP failure packet, in bytes
Returns
Error code

Definition at line 234 of file ike_eap.c.

◆ ikeProcessEapIdentityRequest()

error_t ikeProcessEapIdentityRequest ( IkeSaEntry *  sa,
const IkeEapRequest *  request,
size_t  length 
)

Process EAP Identity request.

Parameters
[in]saPointer to the IKE SA
[in]packetPointer to the EAP Identity request
[in]lengthLength of the EAP Identity request, in bytes
Returns
Error code

Definition at line 177 of file ike_eap.c.

◆ ikeProcessEapPacket()

error_t ikeProcessEapPacket ( IkeSaEntry *  sa,
const IkeEapPacket *  packet,
size_t  length 
)

Process EAP packet.

Parameters
[in]saPointer to the IKE SA
[in]packetPointer to the EAP packet
[in]lengthLength of the EAP packet, in bytes
Returns
Error code

Definition at line 53 of file ike_eap.c.

◆ ikeProcessEapRequest()

error_t ikeProcessEapRequest ( IkeSaEntry *  sa,
const IkeEapRequest *  request,
size_t  length 
)

Process EAP request.

Parameters
[in]saPointer to the IKE SA
[in]packetPointer to the EAP request
[in]lengthLength of the EAP request, in bytes
Returns
Error code

Definition at line 118 of file ike_eap.c.

◆ ikeProcessEapSuccess()

error_t ikeProcessEapSuccess ( IkeSaEntry *  sa,
const IkeEapPacket *  packet,
size_t  length 
)

Process EAP success packet.

Parameters
[in]saPointer to the IKE SA
[in]packetPointer to the EAP success packet
[in]lengthLength of the EAP success packet, in bytes
Returns
Error code

Definition at line 205 of file ike_eap.c.

Variable Documentation

◆ __packed_struct

typedef __packed_struct
Initial value:
{
uint8_t code

EAP packet.

EAP response.

EAP request.

Definition at line 89 of file ike_eap.h.

◆ data

uint8_t data[]

Definition at line 94 of file ike_eap.h.

◆ identifier

uint8_t identifier

Definition at line 92 of file ike_eap.h.

◆ IkeEapPacket

IkeEapPacket

Definition at line 95 of file ike_eap.h.

◆ IkeEapRequest

IkeEapRequest

Definition at line 109 of file ike_eap.h.

◆ IkeEapResponse

IkeEapResponse

Definition at line 123 of file ike_eap.h.

◆ length

uint16_t length

Definition at line 93 of file ike_eap.h.

◆ type

uint8_t type

Definition at line 107 of file ike_eap.h.

uint8_t code
Definition: coap_common.h:179