ipsec.c File Reference

IPsec (IP security) More...

#include "ipsec/ipsec.h"
#include "ipsec/ipsec_misc.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   IPSEC_TRACE_LEVEL
 

Functions

void ipsecGetDefaultSettings (IpsecSettings *settings)
 Initialize settings with default values. More...
 
error_t ipsecInit (IpsecContext *context, const IpsecSettings *settings)
 IPsec service initialization. More...
 
error_t ipsecSetSpdEntry (IpsecContext *context, uint_t index, IpsecSpdEntry *params)
 Set entry at specified index in SPD database. More...
 
error_t ipsecClearSpdEntry (IpsecContext *context, uint_t index)
 Clear entry at specified index in SPD database. More...
 
error_t ipsecSetSadEntry (IpsecContext *context, uint_t index, IpsecSadEntry *params)
 Set entry at specified index in SAD database. More...
 
error_t ipsecClearSadEntry (IpsecContext *context, uint_t index)
 Clear entry at specified index in SAD database. More...
 
error_t ipsecSetPadEntry (IpsecContext *context, uint_t index, IpsecPadEntry *params)
 Set entry at specified index in PAD database. More...
 
error_t ipsecClearPadEntry (IpsecContext *context, uint_t index)
 Clear entry at specified index in PAD database. More...
 

Detailed Description

IPsec (IP security)

License

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

Copyright (C) 2022-2024 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.4.0

Definition in file ipsec.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   IPSEC_TRACE_LEVEL

Definition at line 32 of file ipsec.c.

Function Documentation

◆ ipsecClearPadEntry()

error_t ipsecClearPadEntry ( IpsecContext context,
uint_t  index 
)

Clear entry at specified index in PAD database.

Parameters
[in]contextPointer to the IPsec context
[in]indexID type Zero-based index identifying a given entry
Returns
Error code

Definition at line 347 of file ipsec.c.

◆ ipsecClearSadEntry()

error_t ipsecClearSadEntry ( IpsecContext context,
uint_t  index 
)

Clear entry at specified index in SAD database.

Parameters
[in]contextPointer to the IPsec context
[in]indexID type Zero-based index identifying a given entry
Returns
Error code

Definition at line 260 of file ipsec.c.

◆ ipsecClearSpdEntry()

error_t ipsecClearSpdEntry ( IpsecContext context,
uint_t  index 
)

Clear entry at specified index in SPD database.

Parameters
[in]contextPointer to the IPsec context
[in]indexID type Zero-based index identifying a given entry
Returns
Error code

Definition at line 159 of file ipsec.c.

◆ ipsecGetDefaultSettings()

void ipsecGetDefaultSettings ( IpsecSettings settings)

Initialize settings with default values.

Parameters
[out]settingsStructure that contains IPsec settings

Definition at line 48 of file ipsec.c.

◆ ipsecInit()

error_t ipsecInit ( IpsecContext context,
const IpsecSettings settings 
)

IPsec service initialization.

Parameters
[in]contextPointer to the IPsec context
[in]settingsIPsec specific settings
Returns
Error code

Definition at line 75 of file ipsec.c.

◆ ipsecSetPadEntry()

error_t ipsecSetPadEntry ( IpsecContext context,
uint_t  index,
IpsecPadEntry params 
)

Set entry at specified index in PAD database.

Parameters
[in]contextPointer to the IPsec context
[in]indexID type Zero-based index identifying a given entry
[in]paramsPointer to the structure describing the PAD entry
Returns
Error code

Definition at line 321 of file ipsec.c.

◆ ipsecSetSadEntry()

error_t ipsecSetSadEntry ( IpsecContext context,
uint_t  index,
IpsecSadEntry params 
)

Set entry at specified index in SAD database.

Parameters
[in]contextPointer to the IPsec context
[in]indexID type Zero-based index identifying a given entry
[in]paramsPointer to the structure describing the SAD entry
Returns
Error code

Definition at line 185 of file ipsec.c.

◆ ipsecSetSpdEntry()

error_t ipsecSetSpdEntry ( IpsecContext context,
uint_t  index,
IpsecSpdEntry params 
)

Set entry at specified index in SPD database.

Parameters
[in]contextPointer to the IPsec context
[in]indexID type Zero-based index identifying a given entry
[in]paramsPointer to the structure describing the SPD entry
Returns
Error code

Definition at line 133 of file ipsec.c.