esp.h File Reference

ESP (IP Encapsulating Security Payload) More...

#include "ipsec/ipsec.h"

Go to the source code of this file.

Macros

#define ESP_SUPPORT   ENABLED
 
#define ESP_ESN_SUPPORT   ENABLED
 
#define ESP_CBC_SUPPORT   ENABLED
 
#define ESP_CTR_SUPPORT   DISABLED
 
#define ESP_CCM_8_SUPPORT   DISABLED
 
#define ESP_CCM_12_SUPPORT   DISABLED
 
#define ESP_CCM_16_SUPPORT   DISABLED
 
#define ESP_GCM_8_SUPPORT   DISABLED
 
#define ESP_GCM_12_SUPPORT   DISABLED
 
#define ESP_GCM_16_SUPPORT   ENABLED
 
#define ESP_CHACHA20_POLY1305_SUPPORT   ENABLED
 
#define ESP_CMAC_SUPPORT   DISABLED
 
#define ESP_HMAC_SUPPORT   ENABLED
 
#define ESP_IDEA_SUPPORT   DISABLED
 
#define ESP_DES_SUPPORT   DISABLED
 
#define ESP_3DES_SUPPORT   DISABLED
 
#define ESP_AES_128_SUPPORT   ENABLED
 
#define ESP_AES_192_SUPPORT   ENABLED
 
#define ESP_AES_256_SUPPORT   ENABLED
 
#define ESP_CAMELLIA_128_SUPPORT   DISABLED
 
#define ESP_CAMELLIA_192_SUPPORT   DISABLED
 
#define ESP_CAMELLIA_256_SUPPORT   DISABLED
 
#define ESP_MD5_SUPPORT   DISABLED
 
#define ESP_SHA1_SUPPORT   ENABLED
 
#define ESP_SHA256_SUPPORT   ENABLED
 
#define ESP_SHA384_SUPPORT   ENABLED
 
#define ESP_SHA512_SUPPORT   ENABLED
 
#define ESP_BUFFER_SIZE   2048
 

Functions

error_t ipv4ProcessEspHeader (NetInterface *interface, const Ipv4Header *ipv4Header, const NetBuffer *buffer, size_t offset, NetRxAncillary *ancillary)
 Process ESP protected packet. More...
 
void espDumpHeader (const EspHeader *espHeader)
 Dump ESP header for debugging purpose. More...
 

Variables

typedef __packed_struct
 ESP header. More...
 
uint32_t seqNum
 
uint8_t payloadData []
 
 EspHeader
 
uint8_t nextHeader
 
uint8_t icv []
 
 EspTrailer
 

Detailed Description

ESP (IP Encapsulating Security Payload)

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.4

Definition in file esp.h.

Macro Definition Documentation

◆ ESP_3DES_SUPPORT

#define ESP_3DES_SUPPORT   DISABLED

Definition at line 144 of file esp.h.

◆ ESP_AES_128_SUPPORT

#define ESP_AES_128_SUPPORT   ENABLED

Definition at line 151 of file esp.h.

◆ ESP_AES_192_SUPPORT

#define ESP_AES_192_SUPPORT   ENABLED

Definition at line 158 of file esp.h.

◆ ESP_AES_256_SUPPORT

#define ESP_AES_256_SUPPORT   ENABLED

Definition at line 165 of file esp.h.

◆ ESP_BUFFER_SIZE

#define ESP_BUFFER_SIZE   2048

Definition at line 228 of file esp.h.

◆ ESP_CAMELLIA_128_SUPPORT

#define ESP_CAMELLIA_128_SUPPORT   DISABLED

Definition at line 172 of file esp.h.

◆ ESP_CAMELLIA_192_SUPPORT

#define ESP_CAMELLIA_192_SUPPORT   DISABLED

Definition at line 179 of file esp.h.

◆ ESP_CAMELLIA_256_SUPPORT

#define ESP_CAMELLIA_256_SUPPORT   DISABLED

Definition at line 186 of file esp.h.

◆ ESP_CBC_SUPPORT

#define ESP_CBC_SUPPORT   ENABLED

Definition at line 53 of file esp.h.

◆ ESP_CCM_12_SUPPORT

#define ESP_CCM_12_SUPPORT   DISABLED

Definition at line 74 of file esp.h.

◆ ESP_CCM_16_SUPPORT

#define ESP_CCM_16_SUPPORT   DISABLED

Definition at line 81 of file esp.h.

◆ ESP_CCM_8_SUPPORT

#define ESP_CCM_8_SUPPORT   DISABLED

Definition at line 67 of file esp.h.

◆ ESP_CHACHA20_POLY1305_SUPPORT

#define ESP_CHACHA20_POLY1305_SUPPORT   ENABLED

Definition at line 109 of file esp.h.

◆ ESP_CMAC_SUPPORT

#define ESP_CMAC_SUPPORT   DISABLED

Definition at line 116 of file esp.h.

◆ ESP_CTR_SUPPORT

#define ESP_CTR_SUPPORT   DISABLED

Definition at line 60 of file esp.h.

◆ ESP_DES_SUPPORT

#define ESP_DES_SUPPORT   DISABLED

Definition at line 137 of file esp.h.

◆ ESP_ESN_SUPPORT

#define ESP_ESN_SUPPORT   ENABLED

Definition at line 46 of file esp.h.

◆ ESP_GCM_12_SUPPORT

#define ESP_GCM_12_SUPPORT   DISABLED

Definition at line 95 of file esp.h.

◆ ESP_GCM_16_SUPPORT

#define ESP_GCM_16_SUPPORT   ENABLED

Definition at line 102 of file esp.h.

◆ ESP_GCM_8_SUPPORT

#define ESP_GCM_8_SUPPORT   DISABLED

Definition at line 88 of file esp.h.

◆ ESP_HMAC_SUPPORT

#define ESP_HMAC_SUPPORT   ENABLED

Definition at line 123 of file esp.h.

◆ ESP_IDEA_SUPPORT

#define ESP_IDEA_SUPPORT   DISABLED

Definition at line 130 of file esp.h.

◆ ESP_MD5_SUPPORT

#define ESP_MD5_SUPPORT   DISABLED

Definition at line 193 of file esp.h.

◆ ESP_SHA1_SUPPORT

#define ESP_SHA1_SUPPORT   ENABLED

Definition at line 200 of file esp.h.

◆ ESP_SHA256_SUPPORT

#define ESP_SHA256_SUPPORT   ENABLED

Definition at line 207 of file esp.h.

◆ ESP_SHA384_SUPPORT

#define ESP_SHA384_SUPPORT   ENABLED

Definition at line 214 of file esp.h.

◆ ESP_SHA512_SUPPORT

#define ESP_SHA512_SUPPORT   ENABLED

Definition at line 221 of file esp.h.

◆ ESP_SUPPORT

#define ESP_SUPPORT   ENABLED

Definition at line 39 of file esp.h.

Function Documentation

◆ espDumpHeader()

void espDumpHeader ( const EspHeader espHeader)

Dump ESP header for debugging purpose.

Parameters
[in]espHeaderPointer to the ESP header

Definition at line 301 of file esp.c.

◆ ipv4ProcessEspHeader()

error_t ipv4ProcessEspHeader ( NetInterface interface,
const Ipv4Header ipv4Header,
const NetBuffer buffer,
size_t  offset,
NetRxAncillary ancillary 
)

Process ESP protected packet.

Parameters
[in]interfaceUnderlying network interface
[in]ipv4HeaderPointer to the IPv4 header
[in]bufferMulti-part buffer containing the ESP protected packet
[in]offsetOffset to the first byte of the ESP header
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 61 of file esp.c.

Variable Documentation

◆ __packed_struct

typedef __packed_struct
Initial value:
{
uint32_t spi

ESP header.

ESP trailer.

Definition at line 250 of file esp.h.

◆ EspHeader

EspHeader

Definition at line 255 of file esp.h.

◆ EspTrailer

EspTrailer

Definition at line 267 of file esp.h.

◆ icv

uint8_t icv[]

Definition at line 266 of file esp.h.

◆ nextHeader

uint8_t nextHeader

Definition at line 265 of file esp.h.

◆ payloadData

uint8_t payloadData[]

Definition at line 254 of file esp.h.

◆ seqNum

uint32_t seqNum

Definition at line 253 of file esp.h.

uint32_t spi
Definition: ah.h:143